aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/bcm47xx
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2013-09-24 18:36:55 -0400
committerRalf Baechle <ralf@linux-mips.org>2014-01-22 14:18:54 -0500
commitcb881f5e154c5bdeb4a440adc0b475e117c5dfc1 (patch)
treeefea228de5984518284fd678f5fd686a9eb8d036 /arch/mips/bcm47xx
parentdd5732850e3dad3c578cf1523e7d3581cf5a815f (diff)
MIPS: BCM47XX: Remove CFE support
bcm47xx only uses the CFE code for early print to a console, but that is also possible with a early print serial 8250 driver. The CFE api init causes hangs somewhere in prom_init_cfe() on some devices like the Buffalo WHR-HP-G54 and the Asus WL-520GU. This was reported in https://dev.openwrt.org/ticket/4061 and https://forum.openwrt.org/viewtopic.php?id=17063 This will remove all the CFE handling code from bcm47xx. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: John Crispin <blogic@openwrt.org> Patchwork: http://patchwork.linux-mips.org/patch/5888/
Diffstat (limited to 'arch/mips/bcm47xx')
-rw-r--r--arch/mips/bcm47xx/prom.c91
1 files changed, 0 insertions, 91 deletions
diff --git a/arch/mips/bcm47xx/prom.c b/arch/mips/bcm47xx/prom.c
index 53b9a3fbc8f5..99c3ce2d5b98 100644
--- a/arch/mips/bcm47xx/prom.c
+++ b/arch/mips/bcm47xx/prom.c
@@ -30,12 +30,9 @@
30#include <linux/spinlock.h> 30#include <linux/spinlock.h>
31#include <linux/smp.h> 31#include <linux/smp.h>
32#include <asm/bootinfo.h> 32#include <asm/bootinfo.h>
33#include <asm/fw/cfe/cfe_api.h>
34#include <asm/fw/cfe/cfe_error.h>
35#include <bcm47xx.h> 33#include <bcm47xx.h>
36#include <bcm47xx_board.h> 34#include <bcm47xx_board.h>
37 35
38static int cfe_cons_handle;
39 36
40static char bcm47xx_system_type[20] = "Broadcom BCM47XX"; 37static char bcm47xx_system_type[20] = "Broadcom BCM47XX";
41 38
@@ -52,91 +49,6 @@ __init void bcm47xx_set_system_type(u16 chip_id)
52 chip_id); 49 chip_id);
53} 50}
54 51
55void prom_putchar(char c)
56{
57 while (cfe_write(cfe_cons_handle, &c, 1) == 0)
58 ;
59}
60
61static __init void prom_init_cfe(void)
62{
63 uint32_t cfe_ept;
64 uint32_t cfe_handle;
65 uint32_t cfe_eptseal;
66 int argc = fw_arg0;
67 char **envp = (char **) fw_arg2;
68 int *prom_vec = (int *) fw_arg3;
69
70 /*
71 * Check if a loader was used; if NOT, the 4 arguments are
72 * what CFE gives us (handle, 0, EPT and EPTSEAL)
73 */
74 if (argc < 0) {
75 cfe_handle = (uint32_t)argc;
76 cfe_ept = (uint32_t)envp;
77 cfe_eptseal = (uint32_t)prom_vec;
78 } else {
79 if ((int)prom_vec < 0) {
80 /*
81 * Old loader; all it gives us is the handle,
82 * so use the "known" entrypoint and assume
83 * the seal.
84 */
85 cfe_handle = (uint32_t)prom_vec;
86 cfe_ept = 0xBFC00500;
87 cfe_eptseal = CFE_EPTSEAL;
88 } else {
89 /*
90 * Newer loaders bundle the handle/ept/eptseal
91 * Note: prom_vec is in the loader's useg
92 * which is still alive in the TLB.
93 */
94 cfe_handle = prom_vec[0];
95 cfe_ept = prom_vec[2];
96 cfe_eptseal = prom_vec[3];
97 }
98 }
99
100 if (cfe_eptseal != CFE_EPTSEAL) {
101 /* too early for panic to do any good */
102 printk(KERN_ERR "CFE's entrypoint seal doesn't match.");
103 while (1) ;
104 }
105
106 cfe_init(cfe_handle, cfe_ept);
107}
108
109static __init void prom_init_console(void)
110{
111 /* Initialize CFE console */
112 cfe_cons_handle = cfe_getstdhandle(CFE_STDHANDLE_CONSOLE);
113}
114
115static __init void prom_init_cmdline(void)
116{
117 static char buf[COMMAND_LINE_SIZE] __initdata;
118
119 /* Get the kernel command line from CFE */
120 if (cfe_getenv("LINUX_CMDLINE", buf, COMMAND_LINE_SIZE) >= 0) {
121 buf[COMMAND_LINE_SIZE - 1] = 0;
122 strcpy(arcs_cmdline, buf);
123 }
124
125 /* Force a console handover by adding a console= argument if needed,
126 * as CFE is not available anymore later in the boot process. */
127 if ((strstr(arcs_cmdline, "console=")) == NULL) {
128 /* Try to read the default serial port used by CFE */
129 if ((cfe_getenv("BOOT_CONSOLE", buf, COMMAND_LINE_SIZE) < 0)
130 || (strncmp("uart", buf, 4)))
131 /* Default to uart0 */
132 strcpy(buf, "uart0");
133
134 /* Compute the new command line */
135 snprintf(arcs_cmdline, COMMAND_LINE_SIZE, "%s console=ttyS%c,115200",
136 arcs_cmdline, buf[4]);
137 }
138}
139
140static __init void prom_init_mem(void) 52static __init void prom_init_mem(void)
141{ 53{
142 unsigned long mem; 54 unsigned long mem;
@@ -184,9 +96,6 @@ static __init void prom_init_mem(void)
184 96
185void __init prom_init(void) 97void __init prom_init(void)
186{ 98{
187 prom_init_cfe();
188 prom_init_console();
189 prom_init_cmdline();
190 prom_init_mem(); 99 prom_init_mem();
191} 100}
192 101