diff options
| author | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2009-01-06 22:36:41 +0000 | 
|---|---|---|
| committer | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2009-01-06 22:36:41 +0000 | 
| commit | 3b617e51ccb4e6e8fd00cbf15bf76a218776d6dd (patch) | |
| tree | 930ed8ba448c8cb7b266e8546bcfa3eb6333242b /target/linux/brcm47xx/patches-2.6.28/800-fix_cfe_detection.patch | |
| parent | 8ebc23314044a9974a92bdc698dd8bc2291a7788 (diff) | |
add initial 2.6.28 support for brcm47xx target
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@13909 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/brcm47xx/patches-2.6.28/800-fix_cfe_detection.patch')
| -rw-r--r-- | target/linux/brcm47xx/patches-2.6.28/800-fix_cfe_detection.patch | 108 | 
1 files changed, 108 insertions, 0 deletions
diff --git a/target/linux/brcm47xx/patches-2.6.28/800-fix_cfe_detection.patch b/target/linux/brcm47xx/patches-2.6.28/800-fix_cfe_detection.patch new file mode 100644 index 000000000..eb5ec49d5 --- /dev/null +++ b/target/linux/brcm47xx/patches-2.6.28/800-fix_cfe_detection.patch @@ -0,0 +1,108 @@ +diff --git a/arch/mips/bcm47xx/prom.c b/arch/mips/bcm47xx/prom.c +--- a/arch/mips/bcm47xx/prom.c ++++ b/arch/mips/bcm47xx/prom.c +@@ -32,6 +32,7 @@ + #include <asm/fw/cfe/cfe_error.h> +  + static int cfe_cons_handle; ++static void (* __prom_putchar)(char c); +  + const char *get_system_type(void) + { +@@ -40,65 +41,40 @@ const char *get_system_type(void) +  + void prom_putchar(char c) + { ++	if (__prom_putchar) ++		__prom_putchar(c); ++} ++ ++void prom_putchar_cfe(char c) ++{ + 	while (cfe_write(cfe_cons_handle, &c, 1) == 0) + 		; + } +  +-static __init void prom_init_cfe(void) ++static __init int prom_init_cfe(void) + { + 	uint32_t cfe_ept; + 	uint32_t cfe_handle; + 	uint32_t cfe_eptseal; +-	int argc = fw_arg0; +-	char **envp = (char **) fw_arg2; +-	int *prom_vec = (int *) fw_arg3; +  +-	/* +-	 * Check if a loader was used; if NOT, the 4 arguments are +-	 * what CFE gives us (handle, 0, EPT and EPTSEAL) +-	 */ +-	if (argc < 0) { +-		cfe_handle = (uint32_t)argc; +-		cfe_ept = (uint32_t)envp; +-		cfe_eptseal = (uint32_t)prom_vec; +-	} else { +-		if ((int)prom_vec < 0) { +-			/* +-			 * Old loader; all it gives us is the handle, +-			 * so use the "known" entrypoint and assume +-			 * the seal. +-			 */ +-			cfe_handle = (uint32_t)prom_vec; +-			cfe_ept = 0xBFC00500; +-			cfe_eptseal = CFE_EPTSEAL; +-		} else { +-			/* +-			 * Newer loaders bundle the handle/ept/eptseal +-			 * Note: prom_vec is in the loader's useg +-			 * which is still alive in the TLB. +-			 */ +-			cfe_handle = prom_vec[0]; +-			cfe_ept = prom_vec[2]; +-			cfe_eptseal = prom_vec[3]; +-		} +-	} ++	cfe_eptseal = (uint32_t) fw_arg3; ++	cfe_handle = (uint32_t) fw_arg0; ++	cfe_ept = (uint32_t) fw_arg2; +  +-	if (cfe_eptseal != CFE_EPTSEAL) { +-		/* too early for panic to do any good */ +-		printk(KERN_ERR "CFE's entrypoint seal doesn't match."); +-		while (1) ; +-	} ++	if (cfe_eptseal != CFE_EPTSEAL) ++		return -1; +  + 	cfe_init(cfe_handle, cfe_ept); ++	return 0; + } +  +-static __init void prom_init_console(void) ++static __init void prom_init_console_cfe(void) + { + 	/* Initialize CFE console */ + 	cfe_cons_handle = cfe_getstdhandle(CFE_STDHANDLE_CONSOLE); + } +  +-static __init void prom_init_cmdline(void) ++static __init void prom_init_cmdline_cfe(void) + { + 	char buf[CL_SIZE]; +  +@@ -146,9 +122,12 @@ static __init void prom_init_mem(void) +  + void __init prom_init(void) + { +-	prom_init_cfe(); +-	prom_init_console(); +-	prom_init_cmdline(); ++	if (prom_init_cfe() == 0) { ++		prom_init_console_cfe(); ++		prom_init_cmdline_cfe(); ++		__prom_putchar = prom_putchar_cfe; ++	} ++ + 	prom_init_mem(); + } +   | 
