/* * $Id$ * * ADM5120 specific prom routines * * Copyright (C) 2007 OpenWrt.org * Copyright (C) 2007 Gabor Juhos * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include unsigned int adm5120_prom_type = ADM5120_PROM_GENERIC; struct board_desc { unsigned long mach_type; char *name; }; #define DEFBOARD(n, mt) { .mach_type = (mt), .name = (n)} static struct board_desc common_boards[] __initdata = { /* Cellvision/SparkLAN boards */ DEFBOARD("CAS-630", MACH_ADM5120_CAS630), DEFBOARD("CAS-670", MACH_ADM5120_CAS670), DEFBOARD("CAS-771", MACH_ADM5120_CAS771), DEFBOARD("CAS-790", MACH_ADM5120_CAS790), DEFBOARD("CAS-861", MACH_ADM5120_CAS861), /* Compex boards */ DEFBOARD("WP54G-WRT", MACH_ADM5120_WP54G_WRT), /* Edimax boards */ DEFBOARD("BR-6104K", MACH_ADM5120_BR6104K), DEFBOARD("BR-6104KP", MACH_ADM5120_BR6104K), /* Infineon boards */ DEFBOARD("EASY 5120P-ATA", MACH_ADM5120_EASY5120PATA), DEFBOARD("EASY 5120-RT", MACH_ADM5120_EASY5120RT), DEFBOARD("EASY 5120-WVoIP", MACH_ADM5120_EASY5120WVOIP), DEFBOARD("EASY 83000", MACH_ADM5120_EASY83000), /* Mikrotik RouterBOARDs */ DEFBOARD("111", MACH_ADM5120_RB_111), DEFBOARD("112", MACH_ADM5120_RB_112), DEFBOARD("133", MACH_ADM5120_RB_133), DEFBOARD("133C", MACH_ADM5120_RB_133C), DEFBOARD("133C3", MACH_ADM5120_RB_133C), DEFBOARD("150", MACH_ADM5120_RB_153), /* it's intentional */ DEFBOARD("153", MACH_ADM5120_RB_153), DEFBOARD("miniROUTER", MACH_ADM5120_RB_150), }; static unsigned long __init find_machtype_byname(char *name) { unsigned long ret; int i; ret = MACH_ADM5120_GENERIC; if (name == NULL) goto out; if (*name == '\0') goto out; for (i=0; i 0) strcpy( &(arcs_cmdline[0]), cmd); else strcpy(&(arcs_cmdline[0]), CONFIG_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); } void __init prom_init(void) { mips_machgroup = MACH_GROUP_ADM5120; prom_detect_machtype(); prom_init_cmdline(); } void __init prom_free_prom_memory(void) { /* We do not have to prom memory to free */ }