현철님과 재훈님의 NOR MTD 문서를 보고 따라하기를 해봤습니다..
=============================================
U-Boot 1.1.2 (May 5 2006 - 02:50:19)
U-Boot code: 33C00000 -> 33C3FC50 BSS: -> 33C794F0
RAM Configuration:
Bank #0: 30000000 64 MB
Get flash bank 0 size @ 0x0
Total Flash bank's sizes: 0x200000
protect monitor 3fc50 bytes @ address 0
Flash: 2 MB
NAND:64 MB
In: serial
Out: serial
Err: serial
SD Initialize fail..
Hit any key to stop autoboot: 0
TFTP from server 192.168.10.105; our IP address is 192.168.10.120
Filename 'aesopk'.
Load address: 0x32000000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
########
done
Bytes transferred = 1369800 (14e6c8 hex)
## Booting image at 32000000 ...
Image Name: Linux-2.6.13-h1940-aesop2440
Created: 2006-05-05 10:14:38 UTC
Image Type: ARM Linux Kernel Image (gzip compressed)
Data Size: 1369736 Bytes = 1.3 MB
Load Address: 30008000
Entry Point: 30008000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
Starting kernel ...
Linux version 2.6.13-h1940-aesop2440 (root@aesop) (gcc version 3.3.4) #4 Fri May 5 19:14:34 KST 2006
CPU: ARM920Tid(wb) [41129200] revision 0 (ARMv4T)
Machine: aESOP-2440
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
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.10.105:/scratchbox/users/aesop/targets/AESOP ip=192.168.10.120:192.168.10.105:192.168.10.1:255.255.255.0::eth0:off console=ttySAC0,115200n81 mtdparts=aesop-nor:512k(uboot),-(kernel)
irq: clearing subpending status 00000002
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: 61824KB available (2301K code, 574K data, 112K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
S3C2440: Initialising architecture
S3C2440: IRQ Support
S3C2440: Clock Support, UPLL 47.980 MHz
SCSI subsystem initialized
usbcore: registered new driver hub
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)
yaffs May 5 2006 19:11:53 Installing.
Initializing Cryptographic API
s3c2410 Backlight Driver Initialized.
Console: switching to colour frame buffer device 96x34
S3C24X0 fb0: s3c2410fb frame buffer device initialize done
GPIO L3 bus interface for S3C2440, installed
S3C2410 RTC, (c) 2004 Simtec Electronics
s3c2410-rtc s3c2410-rtc: rtc disabled, re-enabling
s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440
s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440
s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
loop: loaded (max 8 devices)
nbd: registered device at major 43
cs89x0:cs89x0_probe(0x0)
PP_addr=0x3000
cs89x0.c: v2.4.3-pre1 Russell Nelson <
[email protected]>, Andrew Morton <
[email protected]>
eth0: cs8900 rev J found at 0xf8000300
cs89x0: Extended EEPROM checksum bad and no Cirrus EEPROM, relying on command line
cs89x0 media RJ-45, IRQ 53, programmed I/O, MAC 00:00:c0:ff:ee:08
cs89x0_probe1() successful
cs89x0:cs89x0_probe(0x0)
cs89x0: request_region(0xf8000300, 0x10) failed
cs89x0: no cs8900 or cs8920 detected. Be sure to disable PnP with SETUP
AESOP NOR-Flash Driver, (c) 2006 AESOP Embedded
aesop-nor: Found 1 x16 devices at 0x0 in 16-bit bank
Amd/Fujitsu Extended Query Table at 0x0040
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
2 cmdlinepart partitions found on MTD device aesop-nor
Creating 2 MTD partitions on "aesop-nor":
0x00000000-0x00080000 : "uboot"
0x00080000-0x00200000 : "kernel"
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c2410-nand: mapped registers at c4b00000
s3c2410-nand: timing: Tacls 13ns, Twrph0 66ns, Twrph1 39ns
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)
Scanning device for bad blocks
Bad eraseblock 4059 at 0x03f6c000
Creating 1 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x00000000-0x04000000 : "Total nand"
usbmon: debugfs is not available
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
s3c2410_udc: version 28 Aug 2005
mice: PS/2 mouse device common for all mice
s3c2410-buttons successfully loaded
s3c2410 TouchScreen successfully loaded
i2c /dev entries driver
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
mmci-s3c2410: probe: mapped sdi_base=c5100000 irq=37 irq_cd=62 dma=0.
mmci-s3c2410: initialisation done.
godori: AESOP2440 SOUND driver register
godori: AESOP2440 SOUND driver.........probe
AESOP2440 UDA1341 audio driver initialized
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 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
NET: Registered protocol family 17
eth0: using half-duplex 10Base-T (RJ-45)
MMC: sd_app_op_cond timed out. Probably no SD-Card here.
IP-Config: Complete:
device=eth0, addr=192.168.10.120, mask=255.255.255.0, gw=192.168.10.1,
host=192.168.10.120, domain=, nis-domain=(none),
bootserver=192.168.10.105, rootserver=192.168.10.105, rootpath=
Looking up port of RPC 100003/2 on 192.168.10.105
Looking up port of RPC 100005/1 on 192.168.10.105
VFS: Mounted root (nfs filesystem).
Freeing init memory: 112K
INIT: version 2.86 booting
Initializing udev dynamic device directory.
mount: Mounting /dev/root on / failed: No such file or directory
INIT: Entering runlevel: 3
[: 0: unknown operand
Linux 2.6.13-h1940-aesop2440.
/) /)
(='.'=)
login[288]: root login on `tts/0'
root@godori:~#
================================================
Nor에 파티션까지 설정이 되었네요...
uboot 파티션을 512k로 하고 커널은 1.3M 정도라서 나머지를 커널로 파티션을 잡았습니다..
그러면 2M안에 uboot와 kernel이 딱 들어가겠네요...
root@godori:~# flash_eraseall /dev/mtd/0
Erasing 64 Kibyte @ 70000 -- 87 % complete.
root@godori:~# cat aesopb > /dev/mtdblock0
root@godori:~#
root@godori:~# flash_eraseall /dev/mtd/1
Erasing 64 Kibyte @ 170000 -- 95 % complete.
root@godori:~# cat aesopk > /dev/mtdblock1
root@godori:~#
커널도 위와 같은 방법으로 올리는게 맞는지요....
그리고 nand일때는
nand write 32000000 0 커널사이즈
setenv bootcmd nand read 32000000 0 1FFFFF ;bootm 32000000
이렇게 해주면 되는데 nor일때는 setenv 설정을 어떻게 해줘야 하는지
찾아봐도 없는거 같아서 질문 드립니다........
uboot 명령으로 가능한 것인지 아니면 uboot에서 좀 수정을 해줘야 하는건지요...
nor에 부트로더와 커널을 올리고 nand에 rootfs를 올려볼려고 합니다...
왜냐하면, NOR 2M중 맨 마지막 블럭은 u-boot의 환경변수로
사용이 됩니다.
해서 u-boot를 고쳐서 환경변수 영역을 u-boot가 올라간 위치 다음에서
사용이 되도록 하거나, 아니면 mtd영역을 세개로 쪼개야 합니다.
잘 못 하다가는 환경변수 영역을 싸그리 밀어버리는 현상이 발생할 겁니다.
그리고, 커널도 위와같은 방법으로 하는게 맞습니다.
nand에 rootfs를 올릴때는 nfs로 부팅한 후 flash erase해주고, yaffs로 마운트 한 후 쓰시면 됩니다.
아닐 경우는 좀 복잡한데, 이유는 nand의 bad처리때문입니다.