In this section, refine the uboot, modify the Uboot partition 1. Thin Uboot
Configure what features are implemented in Uboot in two files, Include/configs/smdk2440.h,configs/smdk2440_defconfig
Modifying a configuration file Configs/smdk2440_defconfig
Config_arm=y
config_target_smdk2440=y
config_bootdelay=5
# config_sys_stdio_deregister is not set
# Config_display_boardinfo is not set
config_hush_parser=y
config_sys_prompt= "SMDK2440 #"
#CONFIG_CMD_ Usb=y
# config_cmd_setexpr is not set
#CONFIG_CMD_DHCP =y
config_cmd_ping=y
config_cmd_cache=y
#CONFIG_CMD_EXT2 =y
#CONFIG_CMD_FAT =y
#CONFIG_CMD_UBI =y
#CONFIG_USB =y
#CONFIG_USB_ Storage=y
#CONFIG_USB_KEYBOARD =y
Modifying a configuration file
/************************************************************
* USB Support (currently-works with D-cache off )
************************************************************/
#if 0
#define CONFIG_USB_OHCI
# Define CONFIG_USB_OHCI_S3C24XX
#define Config_dos_partition
#endif
/********************************
* RTC
************************************************************/
# If 0
#define config_rtc_s3c24x0
#endif
#if 0
#define Config_cmd_date
#endif
#define Config_bootargs "console=ttysac0 root=/dev/mtdblock3"
#define Config_bootcommand "NAND read 30000000 kernel 0x200000;bootm 30000000 "
#if 0
#define CONFIG_BZIP2
#define CONFIG_LZO
#define Config_lzma
#endif
#if 0
#define CONFIG_CMD_UBIFS
#define CONFIG_CMD_MTDPARTS
#define Config_mtd_device
#define Config_mtd_partitions
#define CONFIG_YAFFS2
#define Config_rbtree
# endif
After compiling, see if there are errors, some functions depend on the definition of multiple macros, at this time need to compile to find the problem, choose the problem of the function.
After defining the Config_bootargs Config_bootcommand above, you can see that the new Uboot runtime is ready to count down. 2. Specify the Uboot parameter storage address
Uboot the default parameters are stored in nor flash, we use NAND flash, so we want to modify the storage address to NAND flash.
Modify Include/configs/smdk2440.h
#if 0
#define CONFIG_ENV_ADDR (config_sys_flash_base + 0x070000)
#define Config_env_is_in_flash
# Define Config_env_size 0x10000/* Allow to
overwrite serial and ETHADDR */
#define Config_env_overwrite
#else
#define Config_env_is_in_nand
#define CONFIG_ENV_OFFSET 0x00040000
#define Config_ Env_size 0x00020000
#endif
If you cannot find any changes to this section, you can find the execution function of the saveenv command, find the specific macro definition in the middle of the code, and then compile the other definitions.
At this point, after modifying the parameters in Uboot, you can save with the Save command. 3. Modify the partition parameters of the Uboot
This part of the function seems to be a partition, in fact, to the KERNEL,ROOTFS lamp storage of the starting address, size and other parameters to provide macros, in order to better operate this part of the storage space.
Modify Include/configs/smdk2440.h
#define Config_cmd_mtdparts
#define Config_mtd_device
#define Config_mtd_partitions
#define Mtdids_ DEFAULT "nand0=jz2440"
#define Mtdparts_default "mtdparts=jz2440:256k (u-boot)," \
"128k (params), "\
" 2m (kernel), "\
Modify COMMON/BOARD_R.C
extern int mtdparts_init (void);
Join in the Init_sequence_r
#if defined (CONFIG_SPARC)
prom_init,
#endif
mtdparts_init,
Run_main_loop,
After compiling uboot, use the command mtdparts to see that the specified storage space has been identified. 4. Download the kernel using the command
NFS 30000000 136.17.69.70:/home/shuimu/more/linuxdriver/uimage
NAND erase.part kernel
NAND write 30000000 Kernel
Reset
You can then see that the kernel starts up normally, but there is no file system and it doesn't work properly.