summaryrefslogtreecommitdiff
path: root/target/linux/ar7-2.6/files
diff options
context:
space:
mode:
authorEugene Konev <ejka@imfi.kspu.ru>2007-03-22 16:39:07 +0000
committerEugene Konev <ejka@imfi.kspu.ru>2007-03-22 16:39:07 +0000
commitec63c08be8af722414f3a6885740e6597a4c6a1b (patch)
tree7c26cb9178fb7adf9a8326a5eddb845fd4768d34 /target/linux/ar7-2.6/files
parent0d7c5a12e14eb5d4074dbda2996d02683cb9bd50 (diff)
downloadmtk-20170518-ec63c08be8af722414f3a6885740e6597a4c6a1b.zip
mtk-20170518-ec63c08be8af722414f3a6885740e6597a4c6a1b.tar.gz
mtk-20170518-ec63c08be8af722414f3a6885740e6597a4c6a1b.tar.bz2
ar7 misc fixes: - serial - memory probing
SVN-Revision: 6635
Diffstat (limited to 'target/linux/ar7-2.6/files')
-rw-r--r--target/linux/ar7-2.6/files/arch/mips/ar7/memory.c44
-rw-r--r--target/linux/ar7-2.6/files/arch/mips/ar7/platform.c4
-rw-r--r--target/linux/ar7-2.6/files/arch/mips/ar7/prom.c2
3 files changed, 21 insertions, 29 deletions
diff --git a/target/linux/ar7-2.6/files/arch/mips/ar7/memory.c b/target/linux/ar7-2.6/files/arch/mips/ar7/memory.c
index 17cb740..10dc09d 100644
--- a/target/linux/ar7-2.6/files/arch/mips/ar7/memory.c
+++ b/target/linux/ar7-2.6/files/arch/mips/ar7/memory.c
@@ -38,33 +38,26 @@
#include <asm/mips-boards/prom.h>
-#warning FIXME: use sdram control regs and/or autodetection
static int __init memsize(void)
{
- char *memsize_str;
- unsigned int result;
- char cmdline[CL_SIZE], *ptr;
-
- /* Check the command line first for a memsize directive */
- strcpy(cmdline, arcs_cmdline);
- ptr = strstr(cmdline, "memsize=");
- if (ptr && (ptr != cmdline) && (*(ptr - 1) != ' '))
- ptr = strstr(ptr, " memsize=");
-
- if (ptr) {
- result = memparse(ptr + 8, &ptr);
- } else {
- /* otherwise look in the environment */
- memsize_str = prom_getenv("memsize");
- if (!memsize_str) {
- prom_printf("memsize not set in boot prom, set to default (8Mb)\n");
- result = 0x00800000;
- } else {
- result = simple_strtol(memsize_str, NULL, 0);
- }
+ u32 size = (64 << 20);
+ volatile u32 *addr = (u32 *)KSEG1ADDR(0x14000000 + size - 4);
+ u32 *kernel_end = (u32 *)KSEG1ADDR(CPHYSADDR((u32)&_end));
+
+ while (addr > kernel_end) {
+ *addr = (u32)addr;
+ size >>= 1;
+ addr -= size >> 2;
}
- return result;
+ do {
+ addr += size >> 2;
+ if (*addr != (u32)addr)
+ break;
+ size <<= 1;
+ } while (size < (64 << 20));
+
+ return size;
}
#ifdef CONFIG_NEED_MULTIPLE_NODES
@@ -167,9 +160,10 @@ void __init mem_init(void)
void __init prom_meminit(void)
{
+ unsigned long pages;
#ifdef CONFIG_NEED_MULTIPLE_NODES
unsigned long kernel_start, kernel_end;
- unsigned long pages, free_pages;
+ unsigned long free_pages;
unsigned long bootmap_size;
#endif
@@ -196,7 +190,5 @@ void __init prom_meminit(void)
unsigned long __init prom_free_prom_memory(void)
{
-/* return freed;
-*/
return 0;
}
diff --git a/target/linux/ar7-2.6/files/arch/mips/ar7/platform.c b/target/linux/ar7-2.6/files/arch/mips/ar7/platform.c
index ea170ed..c61e20a 100644
--- a/target/linux/ar7-2.6/files/arch/mips/ar7/platform.c
+++ b/target/linux/ar7-2.6/files/arch/mips/ar7/platform.c
@@ -321,7 +321,7 @@ static int __init ar7_register_devices(void)
memset(uart_port, 0, sizeof(struct uart_port) * 2);
- uart_port[0].type = PORT_16750;
+ uart_port[0].type = PORT_AR7;
uart_port[0].line = 0;
uart_port[0].irq = AR7_IRQ_UART0;
uart_port[0].uartclk = ar7_bus_freq() / 2;
@@ -333,7 +333,7 @@ static int __init ar7_register_devices(void)
if (res)
return res;
- uart_port[1].type = PORT_16750;
+ uart_port[1].type = PORT_AR7;
uart_port[1].line = 1;
uart_port[1].irq = AR7_IRQ_UART1;
uart_port[1].uartclk = ar7_bus_freq() / 2;
diff --git a/target/linux/ar7-2.6/files/arch/mips/ar7/prom.c b/target/linux/ar7-2.6/files/arch/mips/ar7/prom.c
index 4db4303..7176be3 100644
--- a/target/linux/ar7-2.6/files/arch/mips/ar7/prom.c
+++ b/target/linux/ar7-2.6/files/arch/mips/ar7/prom.c
@@ -258,7 +258,7 @@ char prom_getchar(void)
int prom_putchar(char c)
{
- while ((serial_in(UART_LSR) & UART_LSR_THRE) == 0);
+ while ((serial_in(UART_LSR) & UART_LSR_TEMT) == 0);
serial_out(UART_TX, c);
return 1;
}