summaryrefslogtreecommitdiff
path: root/target/linux/adm5120/files/arch
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2007-09-10 09:54:35 +0000
committerGabor Juhos <juhosg@openwrt.org>2007-09-10 09:54:35 +0000
commitac15780234f559c99eced96d1f9f725986c8fb64 (patch)
tree3df2fa62d83828651e1cc9dc15ad30c1ec3dbd29 /target/linux/adm5120/files/arch
parente83d637f65c15533cdcdbd8ec0c31da6bea48a9b (diff)
downloadmtk-20170518-ac15780234f559c99eced96d1f9f725986c8fb64.zip
mtk-20170518-ac15780234f559c99eced96d1f9f725986c8fb64.tar.gz
mtk-20170518-ac15780234f559c99eced96d1f9f725986c8fb64.tar.bz2
fix memory size detection (#2244)
SVN-Revision: 8728
Diffstat (limited to 'target/linux/adm5120/files/arch')
-rw-r--r--target/linux/adm5120/files/arch/mips/adm5120/memory.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/memory.c b/target/linux/adm5120/files/arch/mips/adm5120/memory.c
index 3881e9f..605df26 100644
--- a/target/linux/adm5120/files/arch/mips/adm5120/memory.c
+++ b/target/linux/adm5120/files/arch/mips/adm5120/memory.c
@@ -50,10 +50,11 @@ static int __init mem_check_pattern(u8 *addr, unsigned long offs)
u32 *p1 = (u32 *)addr;
u32 *p2 = (u32 *)(addr+offs);
u32 t,u,v;
+
/* save original value */
t = MEM_READL(p1);
- u = MEM_READL(p2);
+ u = MEM_READL(p2);
if (t != u)
return 0;
@@ -64,10 +65,7 @@ static int __init mem_check_pattern(u8 *addr, unsigned long offs)
mem_dbg("write 0x%08X to 0x%08lX\n", v, (unsigned long)p1);
MEM_WRITEL(p1, v);
-
- /* flush write buffers */
- MPMC_WRITE_REG(CTRL, MPMC_READ_REG(CTRL) | MPMC_CTRL_DWB);
-
+ adm5120_ndelay(1000);
u = MEM_READL(p2);
mem_dbg("pattern at 0x%08lX is 0x%08X\n", (unsigned long)p2, u);