부트로더는 U-Boot 1.1.4 를 이용하여 SMDK2440 용으로 포팅 했다.
그다지 어려울 것은 없고 U-Boot 에 미리 들어있는 SMDK2410 용을 이용하여 변형만 시켜주면 된다. 커널은 2.6.13, 2.6.14, 2.6.16.16 의 세가지 버전을 적용시켜 보았다. 2440 보드는 2410 과 거의 유사하므로 별로 할것이 없다. S3C2410_defconfig 파일을 이용한 후에 SMDK2440 을 체크하면 끝. 다음으로 mach-type 를 맞춰줘야 한다. 이 작업은 부트로더와 커널 양쪽을 맞춰주면 되나, 간단하게 빨리 끝내는 방법은 arch/arm/kernel/head.S 파일을 아래와 같이 편집한다. __INIT .type stext, %function ENTRY(stext) msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | MODE_SVC @ ensure svc mode @ and irqs disabled bl __lookup_processor_type @ r5=procinfo r9=cpuid movs r10, r5 @ invalid processor (r5=0)? beq __error_p @ yes, error 'p' ldr r1, =362 @ MACH_TYPE_S3C2440 => 이 부분을 추가시킨다. bl __lookup_machine_type @ r5=machinfo movs r8, r5 @ invalid machine (r5=0)? beq __error_a @ yes, error 'a' bl __create_page_tables 이 작업은 어떤 보드라도 리눅스를 포팅하기위해서는 필수적이다. 만일 해주지 않으면 위의 화면에서 더이상 진행을 하지 못한다. 다음은 커널이 제대로 부팅될때의 메시지. Uncompressing Linux..................................................................................... done, booting the kernel. Linux version 2.6.16.16 (root@exchange) (gcc version 3.4.1) #5 Tue May 16 06:11:17 EDT 2006 CPU: ARM920Tid(wb) [41129200] revision 0 (ARMv4T) Machine: SMDK2440 Memory policy: ECC disabled, Data cache writeback CPU S3C2440A (id 0x32440001) S3C2440: core 399.651 MHz, memory 133.217 MHz, peripheral 66.608 MHz S3C2410 Clocks, (c) 2004 Simtec Electronics CLOCK: Slow mode (2.116 MHz), fast, MPLL on, UPLL on CPU0: D VIVT write-back cache CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets Built 1 zonelists Kernel command line: root=/dev/nfs rw nfsroot=192.168.0.3:/arm/work/nfsroot/AESOP ip=192.168.0.5:192.168.0.3:192.168.0.1:255.255.255.0::eth0:off console=ttySAC1,115200n81 ethaddr=08:00:3e:26:0a:5b mem=64M init=/sbin/init irq: clearing subpending status 00000018 irq: clearing subpending status 00000010 PID hash table entries: 512 (order: 9, 8192 bytes) timer tcon=00500000, tcnt d8d2, tcfg 00000200,00000000, usec 0000170f Console: colour dummy device 80x30 Dentry cache hash table entries: 16384 (order: 4, 65536 bytes) Inode-cache hash table entries: 8192 (order: 3, 32768 bytes) Memory: 64MB = 64MB total Memory: 62080KB available (2180K code, 456K data, 108K init) Mount-cache hash table entries: 512 CPU: Testing write buffer coherency: ok NET: Registered protocol family 16 S3C2410 Power Management, (c) 2004 Simtec Electronics S3C2440: Initialising architecture S3C2440: IRQ Support S3C2440: Clock Support, UPLL 47.980 MHz, DVS off S3C2410 DMA Driver, (c) 2003-2004 Simtec Electronics DMA channel 0 at c4800000, irq 33 DMA channel 1 at c4800040, irq 34 DMA channel 2 at c4800080, irq 35 DMA channel 3 at c48000c0, irq 36 NetWinder Floating Point Emulator V0.97 (double precision) JFFS version 1.0, (C) 1999, 2000 Axis Communications AB JFFS2 version 2.2. (NAND) (C) 2001-2003 Red Hat, Inc. io scheduler noop registered io scheduler anticipatory registered (default) io scheduler deadline registered io scheduler cfq registered Console: switching to colour frame buffer device 30x40 fb0: s3c2410fb frame buffer device lp: driver loaded but no devices found S3C2410 RTC, (c) 2004 Simtec Electronics ppdev: user-space parallel port driver S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics s3c2440-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440 s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440 s3c2440-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440 RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize loop: loaded (max 8 devices) cs89x0:cs89x0_probe(0x0) cs89x0: no cs8900 or cs8920 detected. Be sure to disable PnP with SETUP Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2 ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx S3C24XX NAND Driver, (c) 2004 Simtec Electronics mice: PS/2 mouse device common for all mice s3c2440-i2c s3c2440-i2c: slave address 0x10 s3c2440-i2c s3c2440-i2c: bus frequency set to 378 KHz s3c2440-i2c s3c2440-i2c: i2c-0: S3C I2C adapter NET: Registered protocol family 2 IP route cache hash table entries: 1024 (order: 0, 4096 bytes) TCP established hash table entries: 4096 (order: 2, 16384 bytes) TCP bind hash table entries: 4096 (order: 2, 16384 bytes) TCP: Hash tables configured (established 4096 bind 4096) TCP reno registered TCP bic registered NET: Registered protocol family 1 IP-Config: Device `eth0' not found. Looking up port of RPC 100003/2 on 192.168.0.3 portmap: RPC call returned error 101 Root-NFS: Unable to get nfsd port number from server, using default Looking up port of RPC 100005/1 on 192.168.0.3 portmap: RPC call returned error 101 Root-NFS: Unable to get mountd port number from server, using default mount: RPC call returned error 101 Root-NFS: Server returned error -101 while mounting /arm/work/nfsroot/AESOP VFS: Unable to mount root fs via NFS, trying floppy. VFS: Cannot open root device "nfs" or unknown-block(2,0) Please append a correct "root=" boot option Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0) 일단 현재로는 CS8900 드라이버가 활성화 되질 못했다. nfs 로 root 파일시스템을 사용하도록 하였기 때문에 Kernel panic 이 나타났다. 위의 메시지 중 Kernel command line: root=/dev/nfs rw nfsroot=192.168.0.3:/arm/work/nfsroot/AESOP ip=192.168.0.5:192.168.0.3:192.168.0.1:255.255.255.0::eth0:off console=ttySAC1,115200n81 ethaddr=08:00:3e:26:0a:5b mem=64M init=/sbin/init 이 부분은 U-Boot 에서 설정된 값이 커널로 넘겨진 것이다. 커널 옵션에서 Boot options -> Default kernel command string 의 값이 전달된 형태인데, 이곳에 직접 적어주게 되면 변경할 때 마다 커널을 다시 컴파일 해야 하므로 매우 귀찮다. 따라서 U-Boot 에다 #define CONFIG_BOOTARGS "root=/dev/nfs rw nfsroot=192.168.0.3:/arm/work/nfsroot/AESOP ip=192.168.0.5:192.168.0.3:192.168.0.1:255.255.255.0::eth0:off console=ttySAC1,115200n81 ethaddr=08:00:3e:26:0a:5b mem=64M init=/sbin/init" 위와 같이 설정해 주고 Boot options 에서는 비워두면 U-Boot 에서 boot 옵션을 넘겨받게 된다. 만일, 이 값을 변경하고자 할때도 U-Boot을 새로 컴파일 할 필요가 없이 U-Boot 에서 SMDK2440 # setenv bootargs root=/dev/nfs rw nfsroot=192.168.0.3:/arm/work/nfsroot/AESOP ip=192.168.0.5:192.168.0.3:192.168.0.1:255.255.255.0::eth0:off console=ttySAC1,115200n81 ethaddr=08:00:3e:26:0a:5b mem=64M init=/sbin/init SMDK2440 # saveenv Saving Environment to Flash... Protect off 001F0000 ... 001FFFFF Un-Protecting sectors 34..34 in bank 1 Un-Protected 1 sectors Erasing Flash...Erase Flash from 0x001f0000 to 0x01010100 in Bank # 1 Erasing sector 001f0000 done Erased 1 sectors Writing to Flash...-done Protecting sectors 34..34 in bank 1 Protected 1 sectors SMDK2440 # 위와 같이 저장시켜 두면 바로 적용이 된다. |




