From e79e5d32616162db4a71d90a907e9ed813acf1c0 Mon Sep 17 00:00:00 2001 From: Piotr Dymacz Date: Wed, 19 Mar 2014 11:54:18 +0100 Subject: [PATCH] Fix memory init for WR720N v3 CH --- u-boot/board/ar7240/ap121/ap121.c | 8 ++++++++ u-boot/cpu/mips/ar7240/hornet_ddr_init.S | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/u-boot/board/ar7240/ap121/ap121.c b/u-boot/board/ar7240/ap121/ap121.c index af6125b..f3882ba 100755 --- a/u-boot/board/ar7240/ap121/ap121.c +++ b/u-boot/board/ar7240/ap121/ap121.c @@ -406,6 +406,13 @@ int checkboard(void){ * Returns a string with memory type preceded by a space sign */ const char* print_mem_type(void){ +/* + * WR720N v3 (CH version) has wrong bootstrap configuration, + * so the memory type cannot be recognized automatically + */ +#if defined(CONFIG_FOR_TPLINK_WR720N_V3) + return " DDR 16-bit"; +#else unsigned int reg_val; reg_val = (ar7240_reg_rd(HORNET_BOOTSTRAP_STATUS) & HORNET_BOOTSTRAP_MEM_TYPE_MASK) >> HORNET_BOOTSTRAP_MEM_TYPE_SHIFT; @@ -427,4 +434,5 @@ const char* print_mem_type(void){ return ""; break; } +#endif /* defined(CONFIG_FOR_TPLINK_WR720N_V3) */ } diff --git a/u-boot/cpu/mips/ar7240/hornet_ddr_init.S b/u-boot/cpu/mips/ar7240/hornet_ddr_init.S index c25f374..49009d8 100755 --- a/u-boot/cpu/mips/ar7240/hornet_ddr_init.S +++ b/u-boot/cpu/mips/ar7240/hornet_ddr_init.S @@ -52,6 +52,11 @@ hornet_ddr_init: li t8, CFG_DDR_CONFIG2_VAL; set_mem(0xB8000004, t8); +/* + * WR720N v3 (CH version) has wrong bootstrap configuration, + * so the memory type cannot be recognized automatically + */ +#if !defined(CONFIG_FOR_TPLINK_WR720N_V3) mem_type: // TODO: what about SDRAM? // 0x180600AC (BOOT_STRAP, p. 81) @@ -178,6 +183,7 @@ ddr2_config: nop jr ra +#endif /* !defined(CONFIG_FOR_TPLINK_WR720N_V3) */ ddr1_config: // Precharge All -- 2.25.1