1 diff --git a/arch/mips/bcm47xx/prom.c b/arch/mips/bcm47xx/prom.c
2 --- a/arch/mips/bcm47xx/prom.c
3 +++ b/arch/mips/bcm47xx/prom.c
5 #include <asm/fw/cfe/cfe_error.h>
7 static int cfe_cons_handle;
8 +static void (* __prom_putchar)(char c);
10 const char *get_system_type(void)
12 @@ -40,65 +41,40 @@ const char *get_system_type(void)
14 void prom_putchar(char c)
20 +void prom_putchar_cfe(char c)
22 while (cfe_write(cfe_cons_handle, &c, 1) == 0)
26 -static __init void prom_init_cfe(void)
27 +static __init int prom_init_cfe(void)
33 - char **envp = (char **) fw_arg2;
34 - int *prom_vec = (int *) fw_arg3;
37 - * Check if a loader was used; if NOT, the 4 arguments are
38 - * what CFE gives us (handle, 0, EPT and EPTSEAL)
41 - cfe_handle = (uint32_t)argc;
42 - cfe_ept = (uint32_t)envp;
43 - cfe_eptseal = (uint32_t)prom_vec;
45 - if ((int)prom_vec < 0) {
47 - * Old loader; all it gives us is the handle,
48 - * so use the "known" entrypoint and assume
51 - cfe_handle = (uint32_t)prom_vec;
52 - cfe_ept = 0xBFC00500;
53 - cfe_eptseal = CFE_EPTSEAL;
56 - * Newer loaders bundle the handle/ept/eptseal
57 - * Note: prom_vec is in the loader's useg
58 - * which is still alive in the TLB.
60 - cfe_handle = prom_vec[0];
61 - cfe_ept = prom_vec[2];
62 - cfe_eptseal = prom_vec[3];
65 + cfe_eptseal = (uint32_t) fw_arg3;
66 + cfe_handle = (uint32_t) fw_arg0;
67 + cfe_ept = (uint32_t) fw_arg2;
69 - if (cfe_eptseal != CFE_EPTSEAL) {
70 - /* too early for panic to do any good */
71 - printk(KERN_ERR "CFE's entrypoint seal doesn't match.");
74 + if (cfe_eptseal != CFE_EPTSEAL)
77 cfe_init(cfe_handle, cfe_ept);
81 -static __init void prom_init_console(void)
82 +static __init void prom_init_console_cfe(void)
84 /* Initialize CFE console */
85 cfe_cons_handle = cfe_getstdhandle(CFE_STDHANDLE_CONSOLE);
88 -static __init void prom_init_cmdline(void)
89 +static __init void prom_init_cmdline_cfe(void)
93 @@ -146,9 +122,12 @@ static __init void prom_init_mem(void)
95 void __init prom_init(void)
98 - prom_init_console();
99 - prom_init_cmdline();
100 + if (prom_init_cfe() == 0) {
101 + prom_init_console_cfe();
102 + prom_init_cmdline_cfe();
103 + __prom_putchar = prom_putchar_cfe;