Fix versatile board configuration for Qemu This patches makes different changes required to get the versatile board to work properly under Qemu : - Switch from the versatile-specific flash driver to the generic CFI driver ; - Change the announced CPU frequency ; - Modify the Ethernet drivers settings so that we declare the PHY to be external ; - Adjust the environment location settings. This patch applies on top of U-Boot 1.3.4. Signed-off-by: Thomas Petazzoni --- board/versatile/Makefile | 2 +- cpu/arm926ejs/versatile/timer.c | 2 +- include/configs/versatile.h | 30 ++++++++++++++---------------- 3 files changed, 16 insertions(+), 18 deletions(-) Index: u-boot-1.3.4/board/versatile/Makefile =================================================================== --- u-boot-1.3.4.orig/board/versatile/Makefile +++ u-boot-1.3.4/board/versatile/Makefile @@ -25,7 +25,7 @@ LIB = $(obj)lib$(BOARD).a -COBJS := versatile.o flash.o +COBJS := versatile.o SOBJS := lowlevel_init.o SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) Index: u-boot-1.3.4/cpu/arm926ejs/versatile/timer.c =================================================================== --- u-boot-1.3.4.orig/cpu/arm926ejs/versatile/timer.c +++ u-boot-1.3.4/cpu/arm926ejs/versatile/timer.c @@ -51,7 +51,7 @@ { *(volatile ulong *)(CFG_TIMERBASE + 0) = CFG_TIMER_RELOAD; /* TimerLoad */ *(volatile ulong *)(CFG_TIMERBASE + 4) = CFG_TIMER_RELOAD; /* TimerValue */ - *(volatile ulong *)(CFG_TIMERBASE + 8) = 0x8C; + *(volatile ulong *)(CFG_TIMERBASE + 8) = CFG_TIMER_CTRL; /* init the timestamp and lastdec value */ reset_timer_masked(); Index: u-boot-1.3.4/include/configs/versatile.h =================================================================== --- u-boot-1.3.4.orig/include/configs/versatile.h +++ u-boot-1.3.4/include/configs/versatile.h @@ -42,12 +42,12 @@ #define CFG_MEMTEST_START 0x100000 #define CFG_MEMTEST_END 0x10000000 -#define CFG_HZ (1000000 / 256) +#define CFG_HZ (1000000) #define CFG_TIMERBASE 0x101E2000 /* Timer 0 and 1 base */ #define CFG_TIMER_INTERVAL 10000 #define CFG_TIMER_RELOAD (CFG_TIMER_INTERVAL >> 4) /* Divide by 16 */ -#define CFG_TIMER_CTRL 0x84 /* Enable, Clock / 16 */ +#define CFG_TIMER_CTRL 0x82 /* Enable, Clock / 16 */ /* * control registers @@ -79,9 +79,9 @@ */ #define CONFIG_DRIVER_SMC91111 -#define CONFIG_SMC_USE_32_BIT #define CONFIG_SMC91111_BASE 0x10010000 -#undef CONFIG_SMC91111_EXT_PHY +#define CONFIG_SMC_USE_32_BIT +#define CONFIG_SMC91111_EXT_PHY /* * NS16550 Configuration @@ -171,24 +171,22 @@ * FLASH and environment organization */ -#define VERSATILE_SYS_BASE 0x10000000 -#define VERSATILE_SYS_FLASH_OFFSET 0x4C -#define VERSATILE_FLASHCTRL (VERSATILE_SYS_BASE + VERSATILE_SYS_FLASH_OFFSET) -#define VERSATILE_FLASHPROG_FLVPPEN (1 << 0) /* Enable writing to flash */ - -#define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */ -#define PHYS_FLASH_SIZE 0x34000000 /* 64MB */ -/* timeout values are in ticks */ +#define CFG_FLASH_CFI +#define CFG_FLASH_CFI_DRIVER + +#define CFG_FLASH_BANKS_LIST {CFG_FLASH_BASE} +#define CFG_MAX_FLASH_BANKS 1 +#define CFG_MAX_FLASH_SECT 256 #define CFG_FLASH_ERASE_TOUT (20*CFG_HZ) /* Timeout for Flash Erase */ #define CFG_FLASH_WRITE_TOUT (20*CFG_HZ) /* Timeout for Flash Write */ -#define CFG_MAX_FLASH_SECT (256) -#define PHYS_FLASH_1 (CFG_FLASH_BASE) +#define CFG_FLASH_USE_BUFFER_WRITE 1 +#define CFG_FLASH_EMPTY_INFO #define CFG_ENV_IS_IN_FLASH 1 /* env in flash instead of CFG_ENV_IS_NOWHERE */ -#define CFG_ENV_SECT_SIZE 0x00020000 /* 256 KB sectors (x2) */ +#define CFG_ENV_SECT_SIZE 0x00040000 /* 256 KB sectors (x2) */ #define CFG_ENV_SIZE 0x10000 /* Total Size of Environment Sector */ -#define CFG_ENV_OFFSET 0x01f00000 /* environment starts here */ +#define CFG_ENV_OFFSET 0x00040000 /* environment starts here */ #define CFG_ENV_ADDR (CFG_FLASH_BASE + CFG_ENV_OFFSET) #endif /* __CONFIG_H */