기존 이솝 임베디드 포럼의 지식인 서비스가 게시판 형태로 변경되었습니다.
NAND 부팅 관련하여 질문을 드려봅니다.
'이솝보드 부팅 환결설정 방법'에 보면 커널을 하려면 커널을 0x6_0000 번지에 사이즈0x20_0000
설정하도록 되여 있습니다.
------------------------------------------------------------------------------------------------------------------------------
tftp c0008000 zImage-aESOP6410;nand erase 60000 200000;nand write c0008000 60000 200000
setenv bootcmd nand read c0008000 60000 200000;bootm c0008000
-------------------------------------------------------------------------------------------------------------------------------
그런데, 부팅하는 내용에서 NAND 파티션을 보면 다음과 같습니다.
------------------------------------------------------------------------------------------------------------------------------
NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit)
Creating 3 MTD partitions on "NAND 128MiB 3,3V 8-bit":
0x00000000-0x00040000 : "Bootloader"
0x00040000-0x00200000 : "Kernel"
0x00200000-0x08000000 : "File System"
------------------------------------------------------------------------------------------------------------------------------
커널의 주소가 0x40000 사이즈는 0x1c_0000으로 되여 있습니다.
그래서, uboot에서 0x40000 로 수정하여 tftp 다운 및 nand write하고 bootcmd를 수정하면 아래와 같은 에러가 나타납니다.
-----------------------------------------------------------------------------------------------------------------------------------
NAND read: device 0 offset 0x40000, size 0x1c0000
1835008 bytes read: OK
## Booting image at c0008000 ...
Boot with Image
Starting kernel ...
undefined instruction
pc : [<50008030>] lr : [<c7e22b10>]
sp : c7fffdc4 ip : 7f005000 fp : c7e608dd
r10: ea000013 r9 : c7e2c97c r8 : c7e5ffdc
r7 : 98000001 r6 : 00000000 r5 : 50000124 r4 : 00000000
r3 : 50008000 r2 : 50000100 r1 : 00000bb8 r0 : 00000000
Flags: nZCv IRQs off FIQs off Mode SVC_32
Resetting CPU ...
reset...
--------------------------------------------------------------------------------------------------------------------------------------
즉, 커널 부팅시 표기 내용과 실질적으로 설정된는 내용이 다른것으로 사료되는데,
이는 어떻게 보고 수정해야 하는지 알고 싶습니다.
또한, 메모리 사이즈 할당(파티션)을 어디서 설정 해야 하는지 알고 싶습니다.
NAND Flash의 경우 부트로더와 커널의 옵셋은 NAND Flash의 블럭단위로 파티션을 해줘야 합니다.
이솝 보드 초기에 이것을 잘 못해서 부팅할 때 오류가 생기는 일이 생겨서 수정 하였던 것 입니다.
하지만, 커널단에서는 수정이 안되어 있었던 것 같네요. :) (아마 최신 커널로 수정했던 것 같은데...)
U-Boot의 설정은 60000 이 맞습니다. 리눅스 커널단을 다음과 같이 수정해 보시기 바랍니다.
arch/arm/plat-s3c/include/plat/partition.h 파일 (2.6.28 이후 커널 기준)
/* linux/arch/arm/plat-s3c/include/plat/partition.h
*
* Copyright (c) 2008 Samsung Electronics
*
* Partition information
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <asm/mach/flash.h>
struct mtd_partition s3c_partition_info[] = {
{
.name = "Bootloader",
.offset = 0,
.size = (384*SZ_1K),
.mask_flags = MTD_CAP_ROM,
},
{
.name = "Kernel",
.offset = (384*SZ_1K),
.size = (4*SZ_1M) - (384*SZ_1K),
.mask_flags = MTD_CAP_ROM,
},
#if defined(CONFIG_SPLIT_ROOT_FILESYSTEM)
{
.name = "Rootfs",
.offset = (4*SZ_1M),
.size = (48*SZ_1M),
},
#endif
{
.name = "File System",
.offset = MTDPART_OFS_APPEND,
.size = MTDPART_SIZ_FULL,
}
};
struct s3c_nand_mtd_info s3c_nand_mtd_part_info = {
.chip_nr = 1,
.mtd_part_nr = ARRAY_SIZE(s3c_partition_info),
.partition = s3c_partition_info,
};
struct flash_platform_data s3c_onenand_data = {
.parts = s3c_partition_info,
.nr_parts = ARRAY_SIZE(s3c_partition_info),
};
2.6.21 커널의 경우 include/ 디렉터리에 partition.h 가 위치해 있습니다. (21이랑 28 이후랑 구조가 좀 틀립니다.)