3).串口初始化时需要获取系统时钟,这里修改 /cpu/arm920t/s3c24x0/speed.c ,
get_PLLCLK()中
return((CONFIG_SYS_CLK_FREQ * m) / (p << s));
return((CONFIG_SYS_CLK_FREQ * m) / (p << s));改为
return((CONFIG_SYS_CLK_FREQ * m * 2) / (p << s));
return((CONFIG_SYS_CLK_FREQ * m * 2) / (p << s));这是因为2410和2440主频计算公式的差异。
其他修改:
/* return HCLK frequency */
ulong get_HCLK(void)
{
return(get_FCLK()/4 );
}
/* return PCLK frequency */
ulong get_PCLK(void)
{
return(get_HCLK()/2 );
}
/* return HCLK frequency */ ulong get_HCLK(void) { return(get_FCLK()/4 ); } /* return PCLK frequency */ ulong get_PCLK(void) { return(get_HCLK()/2 ); }再次进行编译测试,出现打印信息:
U-Boot 1.1.6 (Jan 26 2017 - 17:10:05)
DRAM: 64 MB
Flash: 512 kB
*** Warning - bad CRC, using default environment
In: serial
Out: serial
Err: serial
SMDK2410 #
5.支持Nor Flash AM29lv160DB
打开 mini2440.h 头文件,发现flash配置项只有CONFIG_AMD_LV400和CONFIG_AMD_LV800,没有本型号,因为AM29lv160DB符合CFI接口标准,故使用 /drivers/cfi_flash.c 中的接口函数。进行下列修改:
1).屏蔽代码
/*-----------------------------------------------------------------------
* FLASH and environment organization
*/
#if 0
#define CONFIG_AMD_LV400 1 /* uncomment this if you have a LV400 flash */
#define CONFIG_AMD_LV800 1 /* uncomment this if you have a LV800 flash */
#endif
/*----------------------------------------------------------------------- * FLASH and environment organization */ #if 0 #define CONFIG_AMD_LV400 1 /* uncomment this if you have a LV400 flash */ #define CONFIG_AMD_LV800 1 /* uncomment this if you have a LV800 flash */ #endif增加宏定义
#define CFG_FLASH_CFI_DRIVER 1
修改代码
#define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */
#ifdef CONFIG_AMD_LV800
#define PHYS_FLASH_SIZE 0x00100000 /* 1MB */
#define CFG_MAX_FLASH_SECT (19) /* max number of sectors on one chip */
#define CFG_ENV_ADDR (CFG_FLASH_BASE + 0x0F0000) /* addr of environment */
#endif
#ifdef CONFIG_AMD_LV400
#define PHYS_FLASH_SIZE 0x00080000 /* 512KB */
#define CFG_MAX_FLASH_SECT (11) /* max number of sectors on one chip */
#define CFG_ENV_ADDR (CFG_FLASH_BASE + 0x070000) /* addr of environment */
#endif
为
#define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */
#ifdef CONFIG_AMD_LV800
#define PHYS_FLASH_SIZE 0x00100000 /* 1MB */
#define CFG_MAX_FLASH_SECT (19) /* max number of sectors on one chip */
#define CFG_ENV_ADDR (CFG_FLASH_BASE + 0x0F0000) /* addr of environment */
#elif defined CONFIG_AMD_LV400
#define PHYS_FLASH_SIZE 0x00080000 /* 512KB */
#define CFG_MAX_FLASH_SECT (11) /* max number of sectors on one chip */
#define CFG_ENV_ADDR (CFG_FLASH_BASE + 0x070000) /* addr of environment */
#else
#define PHYS_FLASH_SIZE 0x00200000 /* 2MB */
#define CFG_MAX_FLASH_SECT (99) /* max number of sectors on one chip */
#define CFG_ENV_ADDR (CFG_FLASH_BASE + 0x1F0000) /* addr of environment */