[U-Boot] Booting kernel from NAND flash on AT91SAM9 custom board using fsload
Nicholas Kinar
n.kinar at usask.ca
Tue Mar 29 18:14:11 CEST 2011
Hello,
I've designed a custom circuit board based around the AT91SAM9RL64
processor from Atmel. This is an ARM9 AT91SAM9 series chip. The Atmel
evaluation kit for this processor is supported by U-Boot, and the
configuration header file can be found in the u-boot-2010.09 source code
distribution (/include/configs/at91sam9rlek.h).
To support my custom hardware, I've made small changes to the
/include/configs/at91sam9rlek.h configuration file and to the files in
the /board/atmel/at91sam9rlek/ directory.
On my custom circuit board, the AT91bootstrap first-order bootloader is
loaded from SPI Dataflash. In turn, the AT91bootstrap code loads U-Boot
to SDRAM memory and then jumps to the load address. The U-Boot binary
is also stored on SPI dataflash. I am able to successfully load U-Boot
on my custom hardware, and I am able to use the nand subsystem commands
to access the NAND flash.
I would like to use the fsload command to load the Linux kernel from a
JFFS2 filesystem written to the NAND flash, but to me it is not
immediately clear what I need to modify in the U-Boot code to be able to
do this. Perhaps the YAFFS filesystem would be more appropriate?
I've found several mailing list threads on a related question, but I
still can't determine how to boot from NAND flash. Does fsload only
support NOR flash, or is it possible to use fsload on NAND flash?
[1] http://lists.denx.de/pipermail/u-boot/2007-December/027578.html
[2] http://www.mail-archive.com/u-boot@lists.denx.de/msg28173.html
[3] http://old.nabble.com/NAND-boot-from-file-td7930776.html
[4]
http://blackfin.uclinux.org/gf/project/u-boot/forum/?_forum_action=ForumMessageBrowse&thread_id=17711&action=ForumBrowse
As suggested in thread [4] above, I tried replacing jffs2_1pass.c with
jffs2_nand_1pass.c in the fs/jffs2 directory.
Also as instructed in the README.NAND, README.JFFS2 and
README.JFFS2_NAND files found in the /doc/ directory, I've tried
defining the following in my
/include/configs/at91sam9rlek.h configuration file:
#define CONFIG_JFFS2_NAND 1
#define CONFIG_CMD_JFFS2
#define CONFIG_SYS_MAX_FLASH_BANKS 1
#define CONFIG_CMD_NAND 1
However, after making these changes, the compilation process does not
work, with the following error being reported:
make[1]: Entering directory
`/home/nkinar/DEVICE-CODE/uboot/u-boot-2010.09/common'
arm-none-linux-gnueabi-gcc -g -Os -fno-common -ffixed-r8
-msoft-float -D__KERNEL__ -DTEXT_BASE=0x23f00000
-I/home/nkinar/DEVICE-CODE/uboot/u-boot-2010.09/include -fno-builtin
-ffreestanding -nostdinc -isystem
/home/nkinar/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.5.1/include
-pipe -DCONFIG_ARM -D__ARM__ -marm -mabi=aapcs-linux
-mno-thumb-interwork -march=armv5te -Wall -Wstrict-prototypes
-fno-stack-protector \
-o cmd_jffs2.o cmd_jffs2.c -c
cmd_jffs2.c: In function 'mtd_device_validate':
cmd_jffs2.c:172:24: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'flash_info'
cmd_jffs2.c:172:24: error: 'flash_info' undeclared (first use in this
function)
cmd_jffs2.c:172:24: note: each undeclared identifier is reported only
once for each function it appears in
cmd_jffs2.c:172:35: error: expected expression before ']' token
cmd_jffs2.c: In function 'get_part_sector_size_nor':
cmd_jffs2.c:275:22: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'flash_info'
cmd_jffs2.c:275:22: error: 'flash_info' undeclared (first use in this
function)
cmd_jffs2.c:275:33: error: expected expression before ']' token
cmd_jffs2.c:279:2: error: 'flash_info_t' undeclared (first use in this
function)
cmd_jffs2.c:279:16: error: 'flash' undeclared (first use in this function)
make[1]: *** [cmd_jffs2.o] Error 1
make[1]: Leaving directory
`/home/nkinar/DEVICE-CODE/uboot/u-boot-2010.09/common'
make: *** [common/libcommon.a] Error 2
What do I need to update in U-Boot to be able to use fsload on my custom
hardware?
More information about the U-Boot
mailing list