aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar7/files
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/ar7/files')
-rw-r--r--target/linux/ar7/files/arch/mips/ar7/clock.c20
-rw-r--r--target/linux/ar7/files/arch/mips/ar7/memory.c15
2 files changed, 19 insertions, 16 deletions
diff --git a/target/linux/ar7/files/arch/mips/ar7/clock.c b/target/linux/ar7/files/arch/mips/ar7/clock.c
index 0f7e2d7eeb..450769e7fd 100644
--- a/target/linux/ar7/files/arch/mips/ar7/clock.c
+++ b/target/linux/ar7/files/arch/mips/ar7/clock.c
@@ -48,12 +48,12 @@
#define TNETD7200_DEF_USB_CLK 48000000
struct tnetd7300_clock {
- volatile u32 ctrl;
+ u32 ctrl;
#define PREDIV_MASK 0x001f0000
#define PREDIV_SHIFT 16
#define POSTDIV_MASK 0x0000001f
u32 unused1[3];
- volatile u32 pll;
+ u32 pll;
#define MUL_MASK 0x0000f000
#define MUL_SHIFT 12
#define PLL_MODE_MASK 0x00000001
@@ -71,17 +71,17 @@ struct tnetd7300_clocks {
};
struct tnetd7200_clock {
- volatile u32 ctrl;
+ u32 ctrl;
u32 unused1[3];
#define DIVISOR_ENABLE_MASK 0x00008000
- volatile u32 mul;
- volatile u32 prediv;
- volatile u32 postdiv;
- volatile u32 postdiv2;
+ u32 mul;
+ u32 prediv;
+ u32 postdiv;
+ u32 postdiv2;
u32 unused2[6];
- volatile u32 cmd;
- volatile u32 status;
- volatile u32 cmden;
+ u32 cmd;
+ u32 status;
+ u32 cmden;
u32 padding[15];
};
diff --git a/target/linux/ar7/files/arch/mips/ar7/memory.c b/target/linux/ar7/files/arch/mips/ar7/memory.c
index 72d6668a1a..e8522a1741 100644
--- a/target/linux/ar7/files/arch/mips/ar7/memory.c
+++ b/target/linux/ar7/files/arch/mips/ar7/memory.c
@@ -37,22 +37,25 @@
static int __init memsize(void)
{
u32 size = (64 << 20);
- volatile u32 *addr = (u32 *)KSEG1ADDR(0x14000000 + size - 4);
+ u32 *addr = (u32 *)KSEG1ADDR(0x14000000 + size - 4);
u32 *kernel_end = (u32 *)KSEG1ADDR(CPHYSADDR((u32)&_end));
+ u32 *tmpaddr = addr;
- while (addr > kernel_end) {
- *addr = (u32)addr;
+ while (tmpaddr > kernel_end) {
+ *tmpaddr = (u32)tmpaddr;
size >>= 1;
- addr -= size >> 2;
+ tmpaddr -= size >> 2;
}
do {
- addr += size >> 2;
- if (*addr != (u32)addr)
+ tmpaddr += size >> 2;
+ if (*tmpaddr != (u32)tmpaddr)
break;
size <<= 1;
} while (size < (64 << 20));
+ writel(tmpaddr, &addr);
+
return size;
}