[adm5120] add support for generic eb214a, thanks cezary (#7027)
[openwrt.git] / target / linux / adm5120 / files / arch / mips / adm5120 / common / prom.c
index ceab35d..8506366 100644 (file)
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/mm.h>
-#include <linux/io.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 #include <asm/mips_machine.h>
 
 #include <asm/mach-adm5120/adm5120_info.h>
-#include <asm/mach-adm5120/adm5120_defs.h>
-#include <asm/mach-adm5120/adm5120_uart.h>
 
 #include <prom/cfe.h>
 #include <prom/generic.h>
@@ -68,8 +64,12 @@ static struct board_desc common_boards[] __initdata = {
        DEFBOARD("153",         MACH_ADM5120_RB_153),
        DEFBOARD("192",         MACH_ADM5120_RB_192),
        DEFBOARD("miniROUTER",  MACH_ADM5120_RB_150),
+       /* OSBRiDGE boards */
+       DEFBOARD("OSBRiDGE 5GXi",       MACH_ADM5120_5GXI),
        /* Motorola boards */
        DEFBOARD("Powerline MU Gateway",MACH_ADM5120_PMUGW),
+       /* Generic EB-214A */
+       DEFBOARD("ADM5120",     MACH_ADM5120_EB_214A),
 };
 
 static unsigned long __init find_machtype_byname(char *name)
@@ -204,61 +204,53 @@ static void __init prom_detect_machtype(void)
 {
        if (bootbase_present()) {
                adm5120_prom_type = ADM5120_PROM_BOOTBASE;
-               adm5120_mach_type = detect_machtype_bootbase();
+               mips_machtype = detect_machtype_bootbase();
                return;
        }
 
        if (cfe_present()) {
                adm5120_prom_type = ADM5120_PROM_CFE;
-               adm5120_mach_type = detect_machtype_cfe();
+               mips_machtype = detect_machtype_cfe();
                return;
        }
 
        if (myloader_present()) {
                adm5120_prom_type = ADM5120_PROM_MYLOADER;
-               adm5120_mach_type = detect_machtype_myloader();
+               mips_machtype = detect_machtype_myloader();
                return;
        }
 
        if (routerboot_present()) {
                adm5120_prom_type = ADM5120_PROM_ROUTERBOOT;
-               adm5120_mach_type = detect_machtype_routerboot();
+               mips_machtype = detect_machtype_routerboot();
                return;
        }
 
        if (generic_prom_present()) {
                adm5120_prom_type = ADM5120_PROM_GENERIC;
-               adm5120_mach_type = detect_machtype_generic();
+               mips_machtype = detect_machtype_generic();
                return;
        }
 
-       adm5120_mach_type = MACH_ADM5120_GENERIC;
+       mips_machtype = MACH_ADM5120_GENERIC;
 }
 
-/* TODO: this is an ugly hack for RouterBOARDS */
-extern char _image_cmdline;
+#ifdef CONFIG_IMAGE_CMDLINE_HACK
+extern char __image_cmdline[];
+
 static void __init prom_init_cmdline(void)
 {
        char *cmd;
 
        /* init command line, register a default kernel command line */
-       cmd = &_image_cmdline + 8;
+       cmd = __image_cmdline;
        if (strlen(cmd) > 0)
                strlcpy(arcs_cmdline, cmd, sizeof(arcs_cmdline));
 
 }
-
-#define UART_READ(r) \
-       __raw_readl((void __iomem *)(KSEG1ADDR(ADM5120_UART0_BASE)+(r)))
-#define UART_WRITE(r, v) \
-       __raw_writel((v), (void __iomem *)(KSEG1ADDR(ADM5120_UART0_BASE)+(r)))
-
-void __init prom_putchar(char ch)
-{
-       while ((UART_READ(UART_REG_FLAG) & UART_FLAG_TXFE) == 0);
-       UART_WRITE(UART_REG_DATA, ch);
-       while ((UART_READ(UART_REG_FLAG) & UART_FLAG_TXFE) == 0);
-}
+#else
+static void inline prom_init_cmdline(void) {}
+#endif /* CONFIG_IMAGE_CMDLINE_HACK */
 
 void __init prom_init(void)
 {
This page took 0.028836 seconds and 4 git commands to generate.