Skip to main content.
Navigation:
DENX
>
DULG
>
LinuxInNANDFlash
Translations:
Edit
|
Attach
|
Raw
|
Ref-By
|
Printable
|
More
DULG
Sections of this site:
DENX Home
|
DULG
|
ELDK-5
|
Know
|
Training
|
U-Boot
|
U-Bootdoc
Topics
DULG Home
BoardSelect
Manual
FAQ
Application Notes
Changes
Index
List of pages in DULG
Search
%SECTION0{name=LinuxInNandFlash}% Boot from NAND Flash Memory The previous section described how to load the Linux kernel image over ethernet using TFTP. This is especially well suited for your development and test environment, when the kernel image is still undergoing frequent changes, for instance because you are modifying kernel code or configuration. Later in your development cycle you will work on application code or device drivers, which can be loaded dynamically as modules. If the Linux kernel remains the same then you can save the time needed for the TFTP download and put the kernel image into the NAND flash memory of your %BOARDNAME% board. After having deleted the target flash area, you can download the Linux image and write it to flash. Below is a transcript of the complete operation with a final =iminfo= command to check the newly placed Linux kernel image in the flash memory. %INCLUDE{DULGData_%BOARD%.UBootInstallNandKernelTftp}% Note how the =filesize= variable (which gets set by the TFTP transfer) is used to automatically adjust for the actual image size. %IF{ "%HAVE_FDT%" eq "true"}% Since kernel requires the flattened device tree blob to be passed at boot time, you have to also write the blob to the flash memory. Below is a transcript of this operation. %INCLUDE{DULGData_%BOARD%.UBootInstallNandBlobTftp}% %ENDIF% Now we can boot directly from flash. All we need to do is passing the in-flash address of the image (%KERNEL_ADDR%) %IF{ "%HAVE_FDT%" eq "true"}% and the in-flash address of the flattened device tree (%FDT_ADDR%) %ENDIF% with the =bootm= command; we also make the definition of the =bootargs= variable permanent now: <pre> %UBOOT_PROMPT% setenv bootcmd bootm %KERNEL_ADDR% %IF{ "%HAVE_FDT%" eq "true"}% - %FDT_ADDR% %ENDIF% %UBOOT_PROMPT% setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${rootpath} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off </pre> Use =printenv= to verify that everything is OK before you save the environment settings: <pre> %UBOOT_PROMPT% printenv bootdelay=5 baudrate=%CONSOLE_BAUDRATE% stdin=serial stdout=serial stderr=serial bootcmd=bootm %KERNEL_ADDR% %IF{ "%HAVE_FDT%" eq "true"}% - %FDT_ADDR% %ENDIF% bootargs=root=/dev/nfs rw nfsroot=%SERVERIP%:%ROOTPATH% ip=%IPADDR%:%SERVERIP%:%GATEWAYIP%:%NETMASK%:%HOSTNAME%::off .... %UBOOT_PROMPT% saveenv </pre> To test booting from flash you can now reset the board (either by power-cycling it, or using the U-Boot command =reset=), or you can manually call the =boot= command which will run the commands in the =bootcmd= variable: %INCLUDE{"DULGData_%BOARD%.LinuxBootSelfNand"}%