1 --- a/arch/mips/bcm47xx/prom.c
2 +++ b/arch/mips/bcm47xx/prom.c
4 #include <asm/fw/cfe/cfe_error.h>
6 static int cfe_cons_handle;
7 +static void (* __prom_putchar)(char c);
9 const char *get_system_type(void)
11 @@ -40,65 +41,40 @@ const char *get_system_type(void)
13 void prom_putchar(char c)
19 +void prom_putchar_cfe(char c)
21 while (cfe_write(cfe_cons_handle, &c, 1) == 0)
25 -static __init void prom_init_cfe(void)
26 +static __init int prom_init_cfe(void)
32 - char **envp = (char **) fw_arg2;
33 - int *prom_vec = (int *) fw_arg3;
36 - * Check if a loader was used; if NOT, the 4 arguments are
37 - * what CFE gives us (handle, 0, EPT and EPTSEAL)
40 - cfe_handle = (uint32_t)argc;
41 - cfe_ept = (uint32_t)envp;
42 - cfe_eptseal = (uint32_t)prom_vec;
44 - if ((int)prom_vec < 0) {
46 - * Old loader; all it gives us is the handle,
47 - * so use the "known" entrypoint and assume
50 - cfe_handle = (uint32_t)prom_vec;
51 - cfe_ept = 0xBFC00500;
52 - cfe_eptseal = CFE_EPTSEAL;
55 - * Newer loaders bundle the handle/ept/eptseal
56 - * Note: prom_vec is in the loader's useg
57 - * which is still alive in the TLB.
59 - cfe_handle = prom_vec[0];
60 - cfe_ept = prom_vec[2];
61 - cfe_eptseal = prom_vec[3];
65 - if (cfe_eptseal != CFE_EPTSEAL) {
66 - /* too early for panic to do any good */
67 - printk(KERN_ERR "CFE's entrypoint seal doesn't match.");
70 + cfe_eptseal = (uint32_t) fw_arg3;
71 + cfe_handle = (uint32_t) fw_arg0;
72 + cfe_ept = (uint32_t) fw_arg2;
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 @@ -154,9 +130,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;