--- zzzz-none-000/linux-2.6.19.2/arch/mips/mips-boards/generic/init.c 2007-01-10 19:10:37.000000000 +0000 +++ davinci-8020-5505/linux-2.6.19.2/arch/mips/mips-boards/generic/init.c 2008-02-07 08:45:55.000000000 +0000 @@ -24,7 +24,9 @@ #include #include +#ifdef CONFIG_MIPS_GT64120 #include +#endif #include #include #include @@ -35,7 +37,10 @@ #include #include +#ifdef CONFIG_MIPS_MALTA #include +#endif +#include #ifdef CONFIG_KGDB extern int rs_kgdb_hook(int, int); @@ -47,13 +52,14 @@ #endif int prom_argc; -int *_prom_argv, *_prom_envp; +int *_prom_argv; +/*--- , *_prom_envp; ---*/ /* * YAMON (32-bit PROM) pass arguments and environment as 32-bit pointer. * This macro take care of sign extension, if running in 64-bit mode. */ -#define prom_envp(index) ((char *)(long)_prom_envp[(index)]) +/*--- #define prom_envp(index) ((char *)(long)_prom_envp[(index)]) ---*/ int init_debug = 0; @@ -69,6 +75,7 @@ /* MIPS System controller register base */ unsigned long _pcictrl_msc; +#if 0 char *prom_getenv(char *envname) { /* @@ -90,6 +97,7 @@ return NULL; } +#endif static inline unsigned char str2hexnum(unsigned char c) { @@ -145,6 +153,7 @@ char parity = '\0', bits = '\0', flow = '\0'; char *s; +#ifndef CONFIG_SERIAL_8250_CONSOLE_DEFAULTS_TO_STANDARD_TTY if ((strstr(prom_getcmdline(), "console=ttyS")) == NULL) { s = prom_getenv("modetty0"); if (s) { @@ -169,6 +178,32 @@ strcat (prom_getcmdline(), console_string); prom_printf("Config serial console:%s\n", console_string); } +#else + if ((strstr(prom_getcmdline(), "console=")) == NULL) { + s = prom_getenv("modetty0"); + if (s) { + while (*s >= '0' && *s <= '9') + baud = baud*10 + *s++ - '0'; + if (*s == ',') s++; + if (*s) parity = *s++; + if (*s == ',') s++; + if (*s) bits = *s++; + if (*s == ',') s++; + if (*s == 'h') flow = 'r'; + } + if (baud == 0) + baud = 38400; + if (parity != 'n' && parity != 'o' && parity != 'e') + parity = 'n'; + if (bits != '7' && bits != '8') + bits = '8'; + if (flow == '\0') + flow = 'r'; + sprintf (console_string, " console=tty0"); + strcat (prom_getcmdline(), console_string); + prom_printf("Config serial console:%s\n", console_string); + } +#endif } #endif @@ -248,23 +283,64 @@ flush_icache_range((unsigned long)base, (unsigned long)base + 0x80); } +/*------------------------------------------------------------------------------------------*\ + * der Urlader übergibt dem Kernel 4 Parameter + * fw_arg0 = argc + * fw_arg1 = argv[] + * fw_arg2 = penvironment + * fw_arg3 = pConfig - z.Z. nur beim UR8 +\*------------------------------------------------------------------------------------------*/ +static char env_buffer[2048]; +#define DEBUG_PROM_INIT void __init prom_init(void) { u32 start, map, mask, data; + char *p; +#if defined(DEBUG_PROM_INIT) + int i; +#endif prom_argc = fw_arg0; _prom_argv = (int *) fw_arg1; - _prom_envp = (int *) fw_arg2; +#if defined(DEBUG_PROM_INIT) + prom_printf("[prom_init] 0\n"); +#endif /*--- #if defined(DEBUG_PROM_INIT) ---*/ + +#if defined(CONFIG_MIPS_OHIO) || defined(CONFIG_MIPS_AR7) || defined(CONFIG_MIPS_UR8) + /*--------------------------------------------------------------------------------------*\ + \*--------------------------------------------------------------------------------------*/ + env_buffer[0] = '\0'; + p = env_buffer; +#if defined(DEBUG_PROM_INIT) + for(i = 0 ; i < prom_argc ; i++) { + prom_printf("[prom_init] argv[%u]=%s\n", i, _prom_argv[i]); + } +#endif /*--- #if defined(DEBUG_PROM_INIT) ---*/ + + env_init((int *)fw_arg2, ENV_LOCATION_FLASH); +#if defined(CONFIG_MIPS_UR8) +#if defined(DEBUG_PROM_INIT) + prom_printf("[prom_init] fw_arg3 0x%x\n", fw_arg3); +#endif /*--- #if defined(DEBUG_PROM_INIT) ---*/ + set_wlan_dect_config_address((unsigned int *)fw_arg3); +#endif +#endif /*--- #if defined(CONFIG_MIPS_OHIO) || defined(CONFIG_MIPS_AR7) || defined(CONFIG_MIPS_UR8) ---*/ + + /*--------------------------------------------------------------------------------------*\ + \*--------------------------------------------------------------------------------------*/ mips_display_message("LINUX"); #ifdef CONFIG_MIPS_SEAD set_io_port_base(KSEG1); +#elif defined(CONFIG_MIPS_OHIO) || defined(CONFIG_MIPS_AR7) || defined(CONFIG_MIPS_UR8) + set_io_port_base(KSEG1); #else /* * early setup of _pcictrl_bonito so that we can determine * the system controller on a CORE_EMUL board */ +#if !defined(CONFIG_MIPS_OHIO) && !defined(CONFIG_MIPS_AR7) && !defined(CONFIG_MIPS_UR8) _pcictrl_bonito = (unsigned long)ioremap(BONITO_REG_BASE, BONITO_REG_SIZE); mips_revision_corid = MIPS_REVISION_CORID; @@ -301,7 +377,11 @@ GT_WRITE(GT_PCI0IOREMAP_OFS, map); } +#ifdef CONFIG_MIPS_MALTA set_io_port_base(MALTA_GT_PORT_BASE); +#else + set_io_port_base((unsigned long)ioremap(0, 0x20000000)); +#endif break; case MIPS_REVISION_CORID_CORE_EMUL_BON: @@ -330,7 +410,11 @@ BONITO_BONGENCFG_BYTESWAP; #endif +#ifdef CONFIG_MIPS_MALTA set_io_port_base(MALTA_BONITO_PORT_BASE); +#else + set_io_port_base((unsigned long)ioremap(0, 0x20000000)); +#endif break; case MIPS_REVISION_CORID_CORE_MSC: @@ -370,7 +454,11 @@ MSC_WRITE(MSC01_PCI_CFG, data); mb(); +#ifdef CONFIG_MIPS_MALTA set_io_port_base(MALTA_MSC_PORT_BASE); +#else + set_io_port_base((unsigned long)ioremap(0, 0x20000000)); +#endif break; default: @@ -379,6 +467,7 @@ while(1); /* We die here... */ } #endif +#endif /*--- #if !defined(CONFIG_MIPS_OHIO) && !defined(CONFIG_MIPS_AR7) && !defined(CONFIG_MIPS_UR8) ---*/ board_nmi_handler_setup = mips_nmi_setup; board_ejtag_handler_setup = mips_ejtag_setup;