讓TQ2440也用上設備樹(1)

作者:彭東林

郵箱:pengdonglin137@163.com

QQ:405728433

 

開發板

TQ2440 + 64MB 內存 + 256MB Nand

軟件

Linux: Linux-4.9 (https://github.com/pengdonglin137/linux-4.9 )

u-boot:U-Boot 2015.04  (http://www.cnblogs.com/pengdonglin137/p/4541705.html 以及 https://github.com/pengdonglin137/u-boot )

busybox:1.25.0

工具鏈:

編譯內核使用的是arm-2014.05-29-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2(下載

編譯busybox使用的是EABI-4.3.3_EmbedSky_20100610.tar.bz2 (開發板自帶的工具鏈),因爲發現,如果用跟編譯kernel同樣的那個工具鏈的話,啓動init進程啓動會有問題

概述

以往TQ2440上移植Linux內核都沒有支持設備樹,而設備樹纔是潮流,tq2440沒用上設備樹這件事我心裏糾結了很長時間,所以特意花了一天時間搞一搞,同時爲想研究學習設備樹的同志鋪一鋪路。好在Samsung已經做了很多工作,最後我發現,需要我們修改的基本都是設備樹文件,而kernel代碼幾乎不用怎麼大動。

在移植的時候,需要對Linux下的中斷子系統、時鐘子系統有一些認識。

目前這個版本支持:

1. serial0

2. rtc

3. watchdog (如果沒有這個的話,reboot的時候板子不會自動復位)

4. DM9000 (有了這個,就可以用nfs掛載遠程目錄,對於調試工作很有益處)

下面是下載代碼的鏈接:

git clone git@github.com:pengdonglin137/linux-4.9.git  -b  tq2440_dt

使用方法:

  • 下載代碼後,修改Makefile文件,設置ARCH和CROSS_COMPILE

  • make tq2440_dt_defconfig

  • 編譯uImage,然後將uImage拷貝到/tftpboot下: make uImage -j4

  • 編譯設備樹,然後將s3c2440-tq2440-dt.dtb拷貝到/tftpboot下:make dtbs

  • 製作ramdisk:下載tq2440_ramdisk.tar.gz,解壓後,執行下面的腳本mk_ramdisk.sh,會生成一個ramdisk.img文件

進入u-boot注意:後下載的鏡像不要把前面的鏡像覆蓋了

  • 下載uImage:tftp 0x30008000 uImage; 

  • 下載ramdisk:tftp 0x31000000 ramdisk.img;

  • 下載設備樹文件:tftp 0x33000000 s3c2440-tq2440-dt.dtb;

  • 啓動:bootm 0x30008000 0x31000000 0x33000000

正文

在移植的時候參考了s3c2416的代碼,因爲目前s3c2416採用的就是設備樹,但是畢竟跟s3c2440不同,無法直接使用,需要修改設備樹配置。

在移植初期,kernel啓動的時候會在很多地方卡住,臨時的處理辦法是先把卡住的函數注掉,把出問題的模塊先從內核配置中拿掉。最後,板子起來後,再回頭分析前面模塊被卡住的原因。目前我是在tq2440上面移植的,由於mini2440跟tq2440基本一樣(初期我使用的內核配置文件copy的就是mini2440_defconfig,然後在此基礎上修改),所以理論上使用上面的鏡像也可以將mini2440啓動起來。

下面的移植記錄不會很全,詳細的代碼改動請參考上面我上傳到github上的代碼。

一、添加設備樹文件,我仿照s3c2416-smdk2416.dts的結構添加了tq2440的設備樹需要的文件,下面是設備樹的結構

s3c2440-tq2440-dt.dts

    ----> s3c2440.dtsi

            ----> s3c24xx.dtsi

                    ----> skeleton.dtsi

            ----> s3c2440-pinctrl.dtsi 

我們大概介紹一下上面的幾個文件:

  • skeleton.dtsi 存放的是一個設備樹必備的一些基本屬性

  • s3c24xx.dtsi 中存放的是整個s3c24xx系列SoC公共的一些屬性,如中斷控制器、串口、看門狗、RTC、I2C控制器等等

  • s3c2440-pinctrl.dtsi 存放的是s3c2440這款SoC中GPIO控制器、外部中斷控制器、引腳複用等信息的配置

  • s3c2440.dtsi 存放的是s3c2440這個SoC跟其他s3c24xx系列不同的一些硬件信息,如clock控制器、串口等等

  • s3c2440-tq2440-dt.dts 存放的是tq2440的硬件信息

設備樹這樣一層層包含的好處是: 在同名節點中,後出現的屬性會覆蓋前面出現的同名屬性,不同的屬性將來會合併到所隸屬的同名的節點下面。

然後修改arch/arm/boot/dts/Makefile:

 1 diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
 2 index c558ba7..28381c0 100644
 3 --- a/arch/arm/boot/dts/Makefile
 4 +++ b/arch/arm/boot/dts/Makefile
 5 @@ -661,7 +661,8 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += \
 6         rk3288-veyron-pinky.dtb \
 7         rk3288-veyron-speedy.dtb
 8  dtb-$(CONFIG_ARCH_S3C24XX) += \
 9 -       s3c2416-smdk2416.dtb
10 +       s3c2416-smdk2416.dtb \
11 +       s3c2440-tq2440-dt.dtb
12  dtb-$(CONFIG_ARCH_S3C64XX) += \
13         s3c6410-mini6410.dtb \
14         s3c6410-smdk6410.dtb

這樣在make dtbs編譯設備樹的時候就會編譯s3c2440-tq2440-dt.dts,在arch/arm/boot/dts/下生成s3c2440-tq2440-dt.dtb

二、修改Makefile和Kconfig,添加tq2440板子的信息,以便在kernel啓動的時候能夠用從設備樹鏡像中解析到的信息匹配到tq2440板子

  • 修改arch/arm/mach-s3c24xx/Kconfig

 1 diff --git a/arch/arm/mach-s3c24xx/Kconfig b/arch/arm/mach-s3c24xx/Kconfig
 2 index 4b1690a..5b2e34f 100644
 3 --- a/arch/arm/mach-s3c24xx/Kconfig
 4 +++ b/arch/arm/mach-s3c24xx/Kconfig
 5 @@ -475,6 +475,15 @@ config MACH_MINI2440
 6           Say Y here to select support for the MINI2440. Is a 10cm x 10cm board
 7           available via various sources. It can come with a 3.5" or 7" touch LCD.
 8  
 9 +config MACH_TQ2440_DT
10 +       bool "TQ2440 development board using device tree"
11 +       select CLKSRC_OF
12 +       select USE_OF
13 +       select PINCTRL
14 +       select PINCTRL_S3C24XX
15 +       help
16 +         Say Y here to select support for the TQ2440.
17 +
18  config MACH_NEXCODER_2440
19         bool "NexVision NEXCODER 2440 Light Board"
20         select S3C2440_XTAL_12000000

這樣在make menuconfig的時候,選擇上這個配置。選擇這個配置的時候,CONFIG_CLKSRC_OF/CONFIG_USE_OF/CONFIG_PINCTRL/CONFIG_S3C24XX都會被配置上。

  • 修改arch/arm/mach-s3c24xx/Makefile

 1     diff --git a/arch/arm/mach-s3c24xx/Makefile b/arch/arm/mach-s3c24xx/Makefile
 2     index 8ac2f58..2be494d100644
 3     --- a/arch/arm/mach-s3c24xx/Makefile
 4     +++ b/arch/arm/mach-s3c24xx/Makefile
 5     @@-60,6+60,8@@ obj-$(CONFIG_ARCH_SMDK2410)           += mach-smdk2410.o
 6     obj-$(CONFIG_MACH_TCT_HAMMER)          += mach-tct_hammer.o
 7     obj-$(CONFIG_MACH_VR1000)              += mach-vr1000.o
 8     +obj-$(CONFIG_MACH_TQ2440_DT)           += mach-tq2440-dt.o
 9     +
10     obj-$(CONFIG_MACH_JIVE)                        += mach-jive.o
11     obj-$(CONFIG_MACH_SMDK2413)            += mach-smdk2413.o
12     obj-$(CONFIG_MACH_VSTMS)               += mach-vstms.o

在Kconfig配置上CONFIG_MACH_TQ2440_DT後,在make uImage的時候就會編譯mach-tq2440-dt.c

  • 添加arch/arm/mach-s3c24xx/mach-tq2440-dt.c

 1 #include <linux/clocksource.h>
 2 #include <linux/irqchip.h>
 3 #include <linux/serial_s3c.h>
 4 #include <asm/mach/arch.h>
 5 #include <mach/map.h>
 6 #include <plat/cpu.h>
 7 #include <plat/pm.h>
 8 #include "common.h"
 9 static void __init tq2440_dt_map_io(void)
10 {
11     s3c24xx_init_io(NULL, 0);
12 }
13 static void __init tq2440_dt_machine_init(void)
14 {
15     s3c_pm_init();
16 }
17 static const char *const tq2440_dt_compat[] __initconst = {
18     "samsung,s3c2440",
19     "samsung,tq2440",
20     NULL
21 };
22 DT_MACHINE_START(TQ2440_DT, "Samsung S3C2440 (Flattened Device Tree)")
23     .dt_compat    = tq2440_dt_compat,
24     .map_io        = tq2440_dt_map_io,
25     .init_irq    = irqchip_init,
26     .init_machine    = tq2440_dt_machine_init,
27 MACHINE_END

第11行會對一些常用的內存進行靜態映射。

這裏我們需要注意的是第30行的dt_compat數組,其中的值要跟設備樹中的compatible匹配,如arch/arm/boot/dts/s3c2440-tq2440-dt.dts:

 1 /dts-v1/;
 2 #include "s3c2440.dtsi"
 3 #include <dt-bindings/interrupt-controller/irq.h>
 4 #include <dt-bindings/clock/s3c2410.h>
 5 / {
 6     model = "TQ2440";
 7     compatible = "samsung,s3c2440", "samsung,tq2440";
 8     memory {
 9         reg =  <0x30000000 0x34000000>;
10     };

如上面的第7行,跟tq2440_dt_compat是相匹配的。

三、打開內核調試開關

如果uboot中設置了bootargs屬性的話,在boot的之前它會修改設備樹鏡像,覆蓋其中chosen節點中的bootargs屬性,爲了便於調試,我在uboot中執行setenv bootargs命令,這樣就可以刪除uboot中bootargs環境變量。

在啓動kernel的時候最煩人的是,uboot打印出"Starting kernel ..."後,整個系統就沒有任何動靜了,此時,就需要打開內核早期的調試log,方法如下:

爲了能夠儘量看到更多內核啓動早期的log,一定要在內核配置文件中把內核早期的log配置打開:

Kernel hacking  --->

    [*] Kernel low-level debugging functions (read help!)

        Kernel low-level debugging port (Use Samsung S3C UART 0 for low-level debug)  --->

    [*] Early printk

除了上面的配置,還必須在bootargs中添加一個earlyprintk字符串,否則這些log還是打印不出來,此外,建議再在bootargs中添加一個ignore_loglevel參數,防止有些模塊的log由於loglevel的問題無法輸出log

下面是設備樹(s3c2440-tq2440-dt.dts)中chosen節點的定義:

1     chosen {
2         bootargs = "root=/dev/ram0 rw rootfstype=ext2 console=ttySAC0,115200n8 init=/linuxrc ignore_loglevel earlyprintk";
3     };

四、剩下的工作就是修改設備樹了

這也是導致kernel無法啓動的原因,當然前期並不確定問題是出在設備樹還是kernel,下面提示幾個比較關鍵的點。

  • fixed-clock時鐘配置

在移植以前不支持設備樹的內核代碼的時候(https://github.com/pengdonglin137/linux-3-14-y/tree/transplant_to_tq2440 )在mach-tq2440.c中:

1 static void __init tq2440_map_io(void)
2 {
3     s3c24xx_init_io(tq2440_iodesc, ARRAY_SIZE(tq2440_iodesc));
4     s3c24xx_init_clocks(12000000);
5     s3c24xx_init_uarts(tq2440_uartcfgs, ARRAY_SIZE(tq2440_uartcfgs));
6     samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
7 }

第4行設置了XTI的時鐘是12MKHz,但是有了設備樹後,就不能這樣做了,你可以看看在linux-4.9下面s3c24xx_init_clocks函數的實現,由於cpu->init_clocks爲NULL,會導致kernel panic。

那爲什麼是12M呢?在TQ2440的核心板上可以看到XTIpll上接了一個12M的晶振:

對應在設備樹中的配置(s3c2440-tq2440-dt.dts)是:

 1     clocks {
 2         compatible = "simple-bus";
 3         #address-cells = <1>;
 4         #size-cells = <0>;
 5         xti: oscillator@0 {
 6             compatible = "fixed-clock";
 7             reg = <0>;
 8             clock-frequency = <12000000>;
 9             clock-output-names = "xti";
10             #clock-cells = <0>;
11         };
12     };

這個還是比較關鍵的,s3c2416並沒有這個節點,如果這個沒有配置的話,會導致很多問題,如後面的在bootconsole被disable後,由於時鐘問題,串口輸出會出問題,此外,也會導致很多內核除0異常。

  • clock控制器配置

這個也非常關鍵,在某個模塊在get_clk的時候就會用到,此外,在某個節點的屬性中配置了clocks和clock-names屬性的時候也會用到它,如果配置有問題,也會出現很多問題。

對應的設備樹配置(s3c2440.dtsi)如下:

1     clocks: clock-controller@4c000000 {
2         compatible = "samsung,s3c2440-clock";
3         reg = <0x4c000000 0x20>;
4         #clock-cells = <1>;
5     };

關於clock這部分可以參考內核文檔:Documentation/devicetree/bindings/clock/samsung,s3c2410-clock.txt

串口引用clocks節點(s3c2440-tq2440-dt.dts):

1     serial@50000000 {
2         status = "okay";
3         clock-names = "uart";
4         clocks = <&clocks PCLK_UART0>;
5         pinctrl-names = "default";
6         pinctrl-0 = <&uart0_data>;
7     };

其中PCLK_UART0參考arch/arm/boot/dts/include/dt-bindings/clock/s3c2410.h或者這個clock控制器驅動的實現

  • watchdog配置(s3c2440.dtsi)

這個是在使用時發現執行reboot命令後,系統沒有啓動復位重啓,而是提示進入halt狀態,原因是watchdog的硬件信息不完整而且其status默認是disabled狀態。

1     watchdog: watchdog@53000000 {
2         interrupts = <1 9 27 3>;
3         clocks = <&clocks PCLK>;
4         clock-names = "watchdog";
5     };

從S3C2440的芯片手冊上面看,看門狗的clock直接接到PCLK上面了,並沒有加什麼開關,所以這裏clocks傳PCLK參數。

然後將watchdog使能的配置最好放到s3c2440-tq2440-dt.dts中,這樣很符合邏輯。

1 &uart0 {
2     status = "okay";
3 };

標號uart0是在s3c24xx.dtsi中,有了標號,在引用一個節點的時候會很方面。

  • RTC配置(s3c2440.dtsi)

默認這個模塊也是disabled的,需要在s3c2440-tq2440-dt.dts將其使能,同時在s3c2440.dtsi中爲其配置一下時鐘。

  • DM9000配置

先看設備樹配置:

 1     srom-cs4@20000000 {
 2         compatible = "simple-bus";
 3         #address-cells = <1>;
 4         #size-cells = <1>;
 5         reg = <0x20000000 0x8000000>;
 6         ranges;
 7         ethernet@18000000 {
 8             compatible = "davicom,dm9000";
 9             reg = <0x20000000 0x2 0x20000004 0x2>;
10             interrupt-parent = <&gpf>;
11             interrupts = <7 IRQ_TYPE_EDGE_RISING>;
12             local-mac-address = [00 00 de ad be ef];
13             davicom,no-eeprom;
14         };
15     };

 DM9000接到了CS4上面,其地址範圍是:0x20000000 --> 0x28000000

看一下底板原理圖:

這裏關注幾點:

1. EINT7中斷: DM9000會臉道s3c2440的外部中斷7上,配置見第11和12行

2. LADDR2:接到了DM9000的CMD上,這個是用於區分發送給DM9000的數據是地址還是數據,低電平是地址,高電平是數據。LADDR2是第2根地址線(從0算起),所以addr和data的區分就在地址第2位上,所以addr是0x2000_0000,而data是0x2000_0004

3. nLAN_CS2:接到nGCS4上面,同時也接到DM9000的片選信號上面,當s3c2440發出0x2000_0000--->0x2800_0000範圍地址時,該引腳會被拉低,DM9000被選擇

4. reg屬性中的0x2的意思是DM9000工作在16bit模式,具體請參考DM9000的驅動:drivers/net/ethernet/davicom/dm9000.c

此外,在Linux-4.9下的dm9000驅動在tq2440上面並不能很好的工作,丟包嚴重,針對這部分,還是參照以前的修改辦法。

五、根文件系統

目前由於還沒有添加NandFlash的硬件信息,所以目前採用的是ramdisk形式的內存文件系統。

直接使用tq2440_ramdisk.tar.gz就可以了,使用ramdisk後,kernel裏也必須有相應的配置,剛開始就是由於kernel配置不當,導致根文件系統無法正常掛載。

關於這部分可以參考:http://blog.csdn.net/ctthuangcheng/article/details/8555529,這裏把關鍵的地方列出來:

make menuconfig ARCH=arm

  • 打开配置菜单,修改两个配置项,分别是:

a):General setup-->选择 Initial RAM filesystem and RAM disk...... 项
b):Device Drivers-->Block devices-->选择 RAM block device support 项
c):并检查Optimize for size是否被选中,如果没有则选中,此项优化内核大小,根据需要进行配置。

d):device driver->block device里的一个选项,‍Default Ramdisk 设置ramdisk的大小.16384

Note:修改Default RAM disk size kbytes选项为(8192)Default RAM disk size kbytes, 之所以修改是因为我們制作的ramdisk是8192KB大小的。如果这个大小和你做的ramdisk不匹配,则启动时仍然会出现kernel panic内核恐慌,提示ramdisk格式不正确,挂载不上ramdisk。
  • 进入File systems菜单,选上<*> Second extended fs support

ramdisk是一种内存虚拟磁盘技术,实质上并不是一种文件系统,它使用的文件系统是ext2文件系统。
这样就为内核添加好了ramdisk启动功能和ramdisk的驱动支持了。

然後在chosen的bootargs中配置添加ramdisk相關的字段:

bootargs = "root=/dev/ram0 rw rootfstype=ext2 console=ttySAC0,115200n8 init=/linuxrc ignore_loglevel earlyprintk"

 

結尾

後續會慢慢把tq2440板子上的其他設備也bring up起來,對次感興趣的小夥伴也可以自己嘗試一下,盡享設備樹帶來的樂趣吧!!

最後附上啓動log:

  1 U-Boot 2015.04-g5095150 (Dec 21 2015 - 06:17:05)
  2 CPUID: 32440001
  3 FCLK:      400 MHz
  4 HCLK:      100 MHz
  5 PCLK:       50 MHz
  6 I2C:   ready
  7 DRAM:  64 MiB
  8 WARNING: Caches not enabled
  9 Flash: 0 Bytes
 10 NAND:  256 MiB
 11 In:    serial
 12 Out:   serial
 13 Err:   serial
 14 Net:   dm9000
 15 Hit any key to stop autoboot:  0  
 16 TQ2440 # print
 17 baudrate=115200
 18 bootcmd=run cmd
 19 bootdelay=0
 20 cmd=tftp 0x30008000 uImage; tftp 0x31000000 ramdisk.img;  tftp 0x33000000 dtb; bootm 0x30008000 0x31000000 0x33000000
 21 cmd2=root=/dev/nfs rw nfsroot=192.168.2.8:/nfsroot/rootfs init=/linuxrc console=ttySAC0,115200n8 ip=192.168.2.6
 22 cmd3=noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0,115200n8 earlyprintk
 23 cmd4=nand read 0x30008000 0x200000 0x400000;bootm 0x30008000;
 24 cmd5=tftp 0x30008000 uImage; tftp 0x32000000 dtb; bootm 0x30008000 - 0x32000000
 25 ethact=dm9000
 26 ethaddr=00:0c:29:2a:5c:a5
 27 fileaddr=33000000
 28 filesize=fc6
 29 ipaddr=192.168.2.8
 30 netmask=255.255.255.0
 31 serverip=192.168.2.6
 32 Environment size: 665/524284 bytes
 33 TQ2440 # boot   
 34 dm9000 i/o: 0x20000000, id: 0x90000a46 
 35 DM9000: running in 16 bit mode
 36 MAC: 00:0c:29:2a:5c:a5
 37 could not establish link
 38 Using dm9000 device
 39 TFTP from server 192.168.2.6; our IP address is 192.168.2.8
 40 Filename 'uImage'.
 41 Load address: 0x30008000
 42 Loading: #################################################################
 43      #################################################################
 44      #################################################################
 45      ##########################
 46      1.4 MiB/s
 47 done
 48 Bytes transferred = 3238648 (316af8 hex)
 49 dm9000 i/o: 0x20000000, id: 0x90000a46 
 50 DM9000: running in 16 bit mode
 51 MAC: 00:0c:29:2a:5c:a5
 52 could not establish link
 53 Using dm9000 device
 54 TFTP from server 192.168.2.6; our IP address is 192.168.2.8
 55 Filename 'ramdisk.img'.
 56 Load address: 0x31000000
 57 Loading: #################################################################
 58      #################################################################
 59      ######################################
 60      1.4 MiB/s
 61 done
 62 Bytes transferred = 2465340 (259e3c hex)
 63 dm9000 i/o: 0x20000000, id: 0x90000a46 
 64 DM9000: running in 16 bit mode
 65 MAC: 00:0c:29:2a:5c:a5
 66 could not establish link
 67 Using dm9000 device
 68 TFTP from server 192.168.2.6; our IP address is 192.168.2.8
 69 Filename 'dtb'.
 70 Load address: 0x33000000
 71 Loading: #
 72      962.9 KiB/s
 73 done
 74 Bytes transferred = 3944 (f68 hex)
 75 ## Booting kernel from Legacy Image at 30008000 ...
 76    Image Name:   Linux-4.9.0+
 77    Created:      2016-12-31  12:23:03 UTC
 78    Image Type:   ARM Linux Kernel Image (uncompressed)
 79    Data Size:    3238584 Bytes = 3.1 MiB
 80    Load Address: 30008000
 81    Entry Point:  30008000
 82    Verifying Checksum ... OK
 83 ## Loading init Ramdisk from Legacy Image at 31000000 ...
 84    Image Name:   ramdisk
 85    Created:      2016-12-31  15:42:22 UTC
 86    Image Type:   ARM Linux RAMDisk Image (gzip compressed)
 87    Data Size:    2465276 Bytes = 2.4 MiB
 88    Load Address: 00000000
 89    Entry Point:  00000000
 90    Verifying Checksum ... OK
 91 ## Flattened Device Tree blob at 33000000
 92    Booting using the fdt blob at 0x33000000
 93    Loading Kernel Image ... OK
 94    Loading Ramdisk to 33850000, end 33aa9dfc ... OK
 95    Loading Device Tree to 3384c000, end 3384ff67 ... OK
 96 Starting kernel ...
 97 Uncompressing Linux... done, booting the kernel.
 98 [    0.000000] Booting Linux on physical CPU 0x0
 99 [    0.000000] Linux version 4.9.0+ (pengdonglin@pengdonglin-dell) (gcc version 4.8.3 20140320 (prerelease) (Sourcery CodeBench Lite 2014.05-29) ) #26 Sat Dec 31 20:22:58 CST 2016
100 [    0.000000] CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c000717f
101 [    0.000000] CPU: VIVT data cache, VIVT instruction cache
102 [    0.000000] OF: fdt:Machine model: TQ2440
103 [    0.000000] debug: ignoring loglevel setting.
104 [    0.000000] bootconsole [earlycon0] enabled
105 [    0.000000] Memory policy: Data cache writeback
106 [    0.000000] CPU S3C2440A (id 0x32440001)
107 [    0.000000] On node 0 totalpages: 16384
108 [    0.000000] free_area_init_node: node 0, pgdat c0618928, node_mem_map c3f7a000
109 [    0.000000]   Normal zone: 128 pages used for memmap
110 [    0.000000]   Normal zone: 0 pages reserved
111 [    0.000000]   Normal zone: 16384 pages, LIFO batch:3
112 [    0.000000] DT missing boot CPU MPIDR[23:0], fall back to default cpu_logical_map
113 [    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
114 [    0.000000] pcpu-alloc: [0] 0 
115 [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
116 [    0.000000] Kernel command line: root=/dev/ram0 rw rootfstype=ext2 console=ttySAC0,115200n8 init=/linuxrc ignore_loglevel earlyprintk
117 [    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
118 [    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
119 [    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
120 [    0.000000] Memory: 55968K/65536K available (4573K kernel code, 210K rwdata, 1108K rodata, 192K init, 259K bss, 9568K reserved, 0K cma-reserved)
121 [    0.000000] Virtual kernel memory layout:
122 [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
123 [    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
124 [    0.000000]     vmalloc : 0xc4800000 - 0xff800000   ( 944 MB)
125 [    0.000000]     lowmem  : 0xc0000000 - 0xc4000000   (  64 MB)
126 [    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
127 [    0.000000]       .text : 0xc0008000 - 0xc047f990   (4575 kB)
128 [    0.000000]       .init : 0xc05bc000 - 0xc05ec000   ( 192 kB)
129 [    0.000000]       .data : 0xc05ec000 - 0xc06209d8   ( 211 kB)
130 [    0.000000]        .bss : 0xc06209d8 - 0xc06619a8   ( 260 kB)
131 [    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
132 [    0.000000] NR_IRQS:103
133 [    0.000000] irq: clearing pending status 00000003
134 [    0.000000] irq: clearing pending status 00000002
135 [    0.000000] _get_rate: could not find clock xti
136 [    0.000129] sched_clock: 16 bits at 1000kHz, resolution 1000ns, wraps every 32767500ns
137 [    0.008042] clocksource: samsung_clocksource_timer: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 29163075 ns
138 [    0.019075] Console: colour dummy device 80x30
139 [    0.023815] Calibrating delay loop... 199.47 BogoMIPS (lpj=498688)
140 [    0.067559] pid_max: default: 32768 minimum: 301
141 [    0.072895] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
142 [    0.079743] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
143 [    0.090398] CPU: Testing write buffer coherency: ok
144 [    0.097459] Setting up static identity map for 0x30008200 - 0x30008258
145 [    0.127589] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9556302231375000 ns
146 [    0.138119] pinctrl core: initialized pinctrl subsystem
147 [    0.146746] NET: Registered protocol family 16
148 [    0.154580] DMA: preallocated 256 KiB pool for atomic coherent allocations
149 [    0.185425] cpuidle: using governor ladder
150 [    0.190320] S3C Power Management, Copyright 2004 Simtec Electronics
151 [    0.196746] No ATAGs?[    0.198745] S3C2440: Initialising architecture
152 [    0.437862] usbcore: registered new interface driver usbfs
153 [    0.444333] usbcore: registered new interface driver hub
154 [    0.450408] usbcore: registered new device driver usb
155 [    0.458996] Advanced Linux Sound Architecture Driver Initialized.
156 [    0.493161] clocksource: Switched to clocksource samsung_clocksource_timer
157 [    0.567114] NET: Registered protocol family 2
158 [    0.576074] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
159 [    0.583350] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
160 [    0.589831] TCP: Hash tables configured (established 1024 bind 1024)
161 [    0.596823] UDP hash table entries: 256 (order: 0, 4096 bytes)
162 [    0.602928] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
163 [    0.610683] NET: Registered protocol family 1
164 [    0.693880] RPC: Registered named UNIX socket transport module.
165 [    0.700159] RPC: Registered udp transport module.
166 [    0.704816] RPC: Registered tcp transport module.
167 [    0.709791] RPC: Registered tcp NFSv4.1 backchannel transport module.
168 [    0.718625] Trying to unpack rootfs image as initramfs...
169 [    0.731241] rootfs image is not initramfs (no cpio magic); looks like an initrd
170 [    0.840512] Freeing initrd memory: 2408K (c3850000 - c3aaa000)
171 [    0.852741] futex hash table entries: 256 (order: -1, 3072 bytes)
172 [    0.867903] workingset: timestamp_bits=30 max_order=14 bucket_order=0
173 [    1.008016] NFS: Registering the id_resolver key type
174 [    1.013569] Key type id_resolver registered
175 [    1.017959] Key type id_legacy registered
176 [    1.022229] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
177 [    1.029376] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
178 [    1.044788] romfs: ROMFS MTD (C) 2007 Red Hat, Inc.
179 [    1.071030] io scheduler noop registered
180 [    1.075219] io scheduler deadline registered
181 [    1.081221] io scheduler cfq registered (default)
182 [    1.300355] 50000000.serial: ttySAC0 at MMIO 0x50000000 (irq = 32, base_baud = 0) is a S3C2440
183 [    1.309382] console [ttySAC0] enabled
184 [    1.309382] console [ttySAC0] enabled
185 [    1.316901] bootconsole [earlycon0] disabled
186 [    1.316901] bootconsole [earlycon0] disabled
187 [    1.340212] random: fast init done
188 [    1.716981] brd: module loaded
189 [    1.725986] eth0: dm9000e at c4930000,c4932004 IRQ 7 MAC: 00:00:de:ad:be:ef (platform data)
190 [    1.729245] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
191 [    1.735383] ohci-s3c2410: OHCI S3C2410 driver
192 [    1.742082] mousedev: PS/2 mouse device common for all mice
193 [    1.747121] s3c-rtc 57000000.rtc: rtc disabled, re-enabling
194 [    1.751306] rtc rtc0: alarm rollover not handled
195 [    1.754867] rtc rtc0: invalid alarm value: 1900-2-1 0:0:0
196 [    1.761576] s3c-rtc 57000000.rtc: rtc core: registered s3c as rtc0
197 [    1.767510] i2c /dev entries driver
198 [    1.773729] s3c2410-wdt 53000000.watchdog: watchdog inactive, reset disabled, irq disabled
199 [    1.780689] sdhci: Secure Digital Host Controller Interface driver
200 [    1.784136] sdhci: Copyright(c) Pierre Ossman
201 [    1.790752] hidraw: raw HID events driver (C) Jiri Kosina
202 [    1.801870] usbcore: registered new interface driver usbhid
203 [    1.802003] usbhid: USB HID core driver
204 [    1.810764] NET: Registered protocol family 17
205 [    1.811441] Key type dns_resolver registered
206 [    1.881679] s3c-rtc 57000000.rtc: setting system clock to 2000-04-10 11:09:42 UTC (955364982)
207 [    1.885538] ALSA device list:
208 [    1.887578]   No soundcards found.
209 [    1.894813] RAMDISK: gzip image found at block 0
210 [    3.637668] VFS: Mounted root (ext2 filesystem) on device 1:0.
211 [    3.639332] Freeing unused kernel memory: 192K (c05bc000 - c05ec000)
212 [    3.644519] This architecture does not have kernel memory protection.
213 [    6.050107] dm9000 20000000.ethernet eth0: link down
214 Please press Enter to activate this console. 
215 [root@TQ2440 ]# 
216 [root@TQ2440 ]# 
217 [root@TQ2440 ]# [    8.175096] dm9000 20000000.ethernet eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1
218 [root@TQ2440 ]# 
219 [root@TQ2440 ]# ping 192.168.2.6
220 PING 192.168.2.6 (192.168.2.6): 56 data bytes
221 64 bytes from 192.168.2.6: seq=0 ttl=64 time=1.888 ms
222 64 bytes from 192.168.2.6: seq=1 ttl=64 time=1.086 ms
223 64 bytes from 192.168.2.6: seq=2 ttl=64 time=1.088 ms
224 ^C
225 --- 192.168.2.6 ping statistics ---
226 3 packets transmitted, 3 packets received, 0% packet loss
227 round-trip min/avg/max = 1.086/1.354/1.888 ms
228 [root@TQ2440 ]# 

完。

posted @ 2017-01-02 00:18  摩斯电码  阅读(5927)  评论(11编辑  收藏  举报