4.2)下来我来讲讲为什么要进行上面的修改。
因为内核本身是支持dm9000 的,所以我们要做的就是告诉内核,我添加了这个设备了,并且添加他的物理地址。
#define S3C64XX_PA_DM9000 (0x18000000) #define S3C64XX_SZ_DM9000 SZ_1M #define S3C64XX_VA_DM9000 S3C_ADDR(0x03b00300)
这一个语句的意思就是 DM9000 设备的物理地址为0x18000000, 大小为1M , 虚拟地址为0x03b00300而当我做了N多便还是错,报错信息为:
NET: Registered protocol family 16
smsc911x: failed to claim resource 0
------------[ cut here ]------------
WARNING: at drivers/base/core.c:130 device_release+0x80/0x8c()
Device 'platform-lcd.0' does not have a release() function, it is broken and must be fixed.
Modules linked in:
[<c0037b20>] (unwind_backtrace+0x0/0xf8) from [<c0035b9c>] (dump_stack+0x18/0x1c)
[<c0035b9c>] (dump_stack+0x18/0x1c) from [<c004bfec>] (warn_slowpath_common+0x58/0x70)
我总以为是 nand flash 的信息错了,其实不是。
在我排查DM9000 驱动的时候,我注意到DM9000 分配的物理地址还被分配到了另一设备,就是 smdk6410_smsc911x 这个设备
它在 arch/arm/mach-s3c64xx/include/mach/map.h 被这样定义
#define S3C64XX_PA_XM0CSN1 (18000000)
这个错误让我找了好久,好久,为了找到这个错误,我编译过的内核不下5个不同的版本,编译的次数不下30 次,
原因就是自己太菜,并且飞凌在使用这些已经被定义的 设备资源的时候,竟然在代码中没有丝毫的注释,真是整人啊。
到这里,编译内核,(注意要加载DM9000 驱动支持) 下载到开发板上就可以启动你的NFS 根文件系统了。
下面是我启动内核的全部打印信息,你可以对照着参考一下:
U-Boot 1.1.6 (May 13 2011 - 16:11:02) for SMDK6410
****************************************
** u-boot 1.1.6 **
** Updated for TE6410 Board **
** Version 1.0 (10-01-15) **
** OEM: Forlinx Embedded **
** Web: **
****************************************
CPU: S3C6410 @532MHz
Fclk = 532MHz, Hclk = 133MHz, Pclk = 66MHz, Serial = CLKUART (SYNC Mode)
Board: SMDK6410
DRAM: 256 MB
Flash: 0 kB
NAND: select s3c_nand_oob_mlc_128
2048 MB
In: serial
Out: serial
Err: serial
Hit any key to stop autoboot: 0
NAND read: device 0 offset 0x100000, size 0x500000
5242880 bytes read: OK
Boot with zImage
Starting kernel ...
Uncompressing Linux... done, booting the kernel.
Linux version 2.6.36.2 (root@Ubuntu) (gcc version 4.2.2) #1 Thu Apr 26 15:43:55 UTC 2012
CPU: ARMv6-compatible processor [410fb766] revision 6 (ARMv7), cr=00c5387f
CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine: SMDK6410
Memory policy: ECC disabled, Data cache writeback
CPU S3C6410 (id 0x36410101)
S3C24XX Clocks, Copyright 2004 Simtec Electronics
camera: no parent clock specified
S3C64XX: PLL settings, A=532000000, M=532000000, E=24000000
S3C64XX: HCLK2=266000000, HCLK=133000000, PCLK=66500000
mout_apll: source is fout_apll (1), rate is 532000000
mout_epll: source is epll (1), rate is 24000000
mout_mpll: source is mpll (1), rate is 532000000
mmc_bus: source is mout_epll (0), rate is 24000000
mmc_bus: source is mout_epll (0), rate is 24000000
mmc_bus: source is mout_epll (0), rate is 24000000
usb-bus-host: source is clk_48m (0), rate is 48000000
uclk1: source is dout_mpll (1), rate is 66500000
spi-bus: source is mout_epll (0), rate is 24000000
spi-bus: source is mout_epll (0), rate is 24000000
audio-bus: source is mout_epll (0), rate is 24000000
audio-bus: source is mout_epll (0), rate is 24000000
audio-bus: source is mout_epll (0), rate is 24000000
irda-bus: source is mout_epll (0), rate is 24000000
camera: no parent clock specified
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 65024
Kernel command line: root=/dev/nfs nfsroot=192.168.0.231:/forlinx/root ip=192.168.0.232:192.168.0.231:192.168.0.201:255.255.255.0:witech.com.cn:eth0:off console=ttySAC0,115200
PID hash table entries: 1024 (order: 0, 4096 bytes)
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 256MB = 256MB total
Memory: 252148k/252148k available, 9996k reserved, 0K highmem
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
DMA : 0xff600000 - 0xffe00000 ( 8 MB)
vmalloc : 0xd0800000 - 0xe0000000 ( 248 MB)
lowmem : 0xc0000000 - 0xd0000000 ( 256 MB)
pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
.init : 0xc0008000 - 0xc0031000 ( 164 kB)
.text : 0xc0031000 - 0xc0662000 (6340 kB)
.data : 0xc06c2000 - 0xc070b040 ( 293 kB)
SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Hierarchical RCU implementation.
RCU-based detection of stalled CPUs is disabled.
Verbose stalled-CPUs detection is disabled.
NR_IRQS:246
VIC @f4000000: id 0x00041192, vendor 0x41
VIC @f4010000: id 0x00041192, vendor 0x41
Console: colour dummy device 80x30
console [ttySAC0] enabled
Calibrating delay loop... 530.84 BogoMIPS (lpj=2654208)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
devtmpfs: initialized
NET: Registered protocol family 16
hw perfevents: enabled with v6 PMU driver, 3 counters available
s3c64xx_dma_init: Registering DMA channels
s3c64xx_dma_init1: registering DMA 0 (d0808100)
s3c64xx_dma_init1: registering DMA 1 (d0808120)
s3c64xx_dma_init1: registering DMA 2 (d0808140)
s3c64xx_dma_init1: registering DMA 3 (d0808160)
s3c64xx_dma_init1: registering DMA 4 (d0808180)
s3c64xx_dma_init1: registering DMA 5 (d08081a0)
s3c64xx_dma_init1: registering DMA 6 (d08081c0)
s3c64xx_dma_init1: registering DMA 7 (d08081e0)
PL080: IRQ 73, at d0808000
s3c64xx_dma_init1: registering DMA 8 (d080c100)
s3c64xx_dma_init1: registering DMA 9 (d080c120)
s3c64xx_dma_init1: registering DMA 10 (d080c140)
s3c64xx_dma_init1: registering DMA 11 (d080c160)
s3c64xx_dma_init1: registering DMA 12 (d080c180)
s3c64xx_dma_init1: registering DMA 13 (d080c1a0)
s3c64xx_dma_init1: registering DMA 14 (d080c1c0)
s3c64xx_dma_init1: registering DMA 15 (d080c1e0)
PL080: IRQ 74, at d080c000
S3C6410: Initialising architecture
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
s3c-i2c s3c2440-i2c.0: slave address 0x10
s3c-i2c s3c2440-i2c.0: bus frequency set to 64 KHz
s3c-i2c s3c2440-i2c.0: i2c-0: S3C I2C adapter
Advanced Linux Sound Architecture Driver Version 1.0.23.
cfg80211: Calling CRDA to update world regulatory domain
NET: Registered protocol family 2
IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
TCP established hash table entries: 8192 (order: 4, 65536 bytes)
TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
msgmni has been set to 492
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
s3c6400-uart.0: s3c2410_serial0 at MMIO 0x7f005000 (irq = 16) is a S3C6400/10
s3c6400-uart.1: s3c2410_serial1 at MMIO 0x7f005400 (irq = 20) is a S3C6400/10
s3c6400-uart.2: s3c2410_serial2 at MMIO 0x7f005800 (irq = 24) is a S3C6400/10
s3c6400-uart.3: s3c2410_serial3 at MMIO 0x7f005c00 (irq = 28) is a S3C6400/10
S3C NAND Driver, (c) 2008 Samsung Electronics
S3C NAND Driver is using software ECC.
NAND device: Manufacturer ID: 0xec, Chip ID: 0xd5 (Samsung NAND 2GiB 3,3V 8-bit)
Creating 4 MTD partitions on "NAND 2GiB 3,3V 8-bit":
0x000000000000-0x000000100000 : "Bootloader"
0x000000100000-0x000000600000 : "Kernel"
0x000000600000-0x000007e00000 : "User"
0x000007e00000-0x000080000000 : "File System" // 这个是加载的nand flash 分区信息,证明nand flash 驱动移植成功
PPP generic driver version 2.4.2
PPP Deflate Compression module registered
PPP BSD Compression module registered
PPP MPPE Compression module registered
NET: Registered protocol family 24
dm9000 Ethernet Driver, V1.31 // 这个设 dm9000网卡初始化启动信息,证明网卡驱动移植成功
eth0: dm9000a at d0820000,d0c00004 IRQ 108 MAC: 08:90:00:a0:90:90 (platform data)
libertas_sdio: Libertas SDIO driver
libertas_sdio: Copyright Pierre Ossman
usbcore: registered new interface driver rt73usb
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 79, io mem 0x74300000
s3c2410-ohci s3c2410-ohci: init err (00000000 0000)
ohci_hcd: can't start s3c24xx
s3c2410-ohci s3c2410-ohci: startup error -75
s3c2410-ohci s3c2410-ohci: USB bus 1 deregistered
s3c2410-ohci: probe of s3c2410-ohci failed with error -75
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver usbserial
usbserial: USB Serial Driver core
USB Serial support registered for pl2303
usbcore: registered new interface driver pl2303
pl2303: Prolific PL2303 USB to serial adaptor driver
mice: PS/2 mouse device common for all mice
S3C24XX RTC, (c) 2004,2006 Simtec Electronics
s3c-rtc s3c64xx-rtc: rtc disabled, re-enabling
s3c-rtc s3c64xx-rtc: rtc core: registered s3c as rtc0
i2c /dev entries driver
lirc_dev: IR Remote Control driver registered, major 253
IR NEC protocol handler initialized
IR RC5(x) protocol handler initialized
IR RC6 protocol handler initialized
IR JVC protocol handler initialized
IR Sony protocol handler initialized
IR LIRC bridge handler initialized
Linux video capture interface: v2.00
usbcore: registered new interface driver em28xx
em28xx driver loaded
Em28xx: Initialized (Em28xx Audio Extension) extension
cx231xx v4l2 driver loaded.
usbcore: registered new interface driver cx231xx
cx231xx: Cx231xx Audio Extension initialized
usbcore: registered new interface driver usbvision
USBVision USB Video Device Driver for Linux : 0.9.10
usbcore: registered new interface driver pvrusb2
pvrusb2: V4L in-tree version:Hauppauge WinTV-PVR-USB2 MPEG2 Encoder/Tuner
pvrusb2: Debug mask is 31 (0x1f)
SE401 usb camera driver version 0.24 registering
usbcore: registered new interface driver se401
usbcore: registered new interface driver zr364xx
zr364xx: Zoran 364xx
usbcore: registered new interface driver stkwebcam
sn9c102: V4L2 driver for SN9C1xx PC Camera Controllers v1:1.47pre49
usbcore: registered new interface driver sn9c102
pwc: Philips webcam module version 10.0.13 loaded.
pwc: Supports Philips PCA645/646, PCVC675/680/690, PCVC720[40]/730/740/750 & PCVC830/840.
pwc: Also supports the Askey VC010, various Logitech Quickcams, Samsung MPC-C10 and MPC-C30,
pwc: the Creative WebCam 5 & Pro Ex, SOTEC Afina Eye and Visionite VCS-UC300 and VCS-UM100.
usbcore: registered new interface driver Philips webcam
gspca: main v2.10.0 registered
usbcore: registered new interface driver hdpvr
usbcore: registered new interface driver ibmcam
usbcore: registered new interface driver ultracam
konicawc: v1.4:Konica Webcam driver
usbcore: registered new interface driver konicawc
usbcore: registered new interface driver vicam
usbcore: registered new interface driver s2255
usbcore: registered new interface driver uvcvideo
USB Video Class driver (v0.1.0)
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
s3c-sdhci s3c-sdhci.0: clock source 0: hsmmc (133000000 Hz)
s3c-sdhci s3c-sdhci.0: clock source 1: hsmmc (133000000 Hz)
s3c-sdhci s3c-sdhci.0: clock source 2: mmc_bus (24000000 Hz)
mmc0: SDHCI controller on samsung-hsmmc [s3c-sdhci.0] using ADMA
s3c-sdhci s3c-sdhci.1: clock source 0: hsmmc (133000000 Hz)
s3c-sdhci s3c-sdhci.1: clock source 1: hsmmc (133000000 Hz)
s3c-sdhci s3c-sdhci.1: clock source 2: mmc_bus (24000000 Hz)
mmc1: SDHCI controller on samsung-hsmmc [s3c-sdhci.1] using ADMA
s3c6400_setup_sdhci_cfg_card: CTRL 2=c0004120, 3=80808080
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
ALSA device list:
No soundcards found.
TCP cubic registered
lib80211: common routines for IEEE802.11 drivers
Registering the dns_resolver key type
s3c-rtc s3c64xx-rtc: setting system clock to 2001-02-11 09:36:19 UTC (981884179)
s3c6400_setup_sdhci_cfg_card: CTRL 2=c0004120, 3=80808080
eth0: link down
eth0: link up, 100Mbps, full-duplex, lpa 0x41E1 // 这个是挂载NFS根文件系统 dm9000 网卡的相应信息
IP-Config: Complete:
device=eth0, addr=192.168.0.232, mask=255.255.255.0, gw=192.168.0.201,
host=witech, domain=, nis-domain=com.cn,
bootserver=192.168.0.231, rootserver=192.168.0.231, rootpath=
Looking up port of RPC 100003/2 on 192.168.0.231
Looking up port of RPC 100005/1 on 192.168.0.231
VFS: Mounted root (nfs filesystem) on device 0:13.
devtmpfs: mounted
Freeing init memory: 164K
Bad inittab entry at line 3
---------------munt all----------------
***************************************
**********Studying ARM*****************
Kernel_version:linux-2.6.34.4
Student: Acanoe one
Date : 2012,04,19
***************************************
Please press Enter to activate this console.
[root@MrAcanoe=2]#