setup.c (9b18d42dda985c99db4adde45bbdf7cd79a7525c) setup.c (541c9a84cd85203244307d9ebb821102eed82789)
1/*
2 * Copyright (C) 2004 Florian Schirmer <jolt@tuxbox.org>
3 * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org>
4 * Copyright (C) 2006 Michael Buesch <m@bues.ch>
5 * Copyright (C) 2010 Waldemar Brodkorb <wbx@openadk.org>
6 * Copyright (C) 2010-2012 Hauke Mehrtens <hauke@hauke-m.de>
7 *
8 * This program is free software; you can redistribute it and/or modify it

--- 87 unchanged lines hidden (view full) ---

96 break;
97#endif
98 }
99 while (1)
100 cpu_relax();
101}
102
103#ifdef CONFIG_BCM47XX_SSB
1/*
2 * Copyright (C) 2004 Florian Schirmer <jolt@tuxbox.org>
3 * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org>
4 * Copyright (C) 2006 Michael Buesch <m@bues.ch>
5 * Copyright (C) 2010 Waldemar Brodkorb <wbx@openadk.org>
6 * Copyright (C) 2010-2012 Hauke Mehrtens <hauke@hauke-m.de>
7 *
8 * This program is free software; you can redistribute it and/or modify it

--- 87 unchanged lines hidden (view full) ---

96 break;
97#endif
98 }
99 while (1)
100 cpu_relax();
101}
102
103#ifdef CONFIG_BCM47XX_SSB
104static int bcm47xx_get_invariants(struct ssb_bus *bus,
105 struct ssb_init_invariants *iv)
106{
107 char buf[20];
108 int len, err;
109
110 /* Fill boardinfo structure */
111 memset(&iv->boardinfo, 0 , sizeof(struct ssb_boardinfo));
112
113 len = bcm47xx_nvram_getenv("boardvendor", buf, sizeof(buf));
114 if (len > 0) {
115 err = kstrtou16(strim(buf), 0, &iv->boardinfo.vendor);
116 if (err)
117 pr_warn("Couldn't parse nvram board vendor entry with value \"%s\"\n",
118 buf);
119 }
120 if (!iv->boardinfo.vendor)
121 iv->boardinfo.vendor = SSB_BOARDVENDOR_BCM;
122
123 len = bcm47xx_nvram_getenv("boardtype", buf, sizeof(buf));
124 if (len > 0) {
125 err = kstrtou16(strim(buf), 0, &iv->boardinfo.type);
126 if (err)
127 pr_warn("Couldn't parse nvram board type entry with value \"%s\"\n",
128 buf);
129 }
130
131 memset(&iv->sprom, 0, sizeof(struct ssb_sprom));
132 bcm47xx_fill_sprom(&iv->sprom, NULL, false);
133
134 if (bcm47xx_nvram_getenv("cardbus", buf, sizeof(buf)) >= 0)
135 iv->has_cardbus_slot = !!simple_strtoul(buf, NULL, 10);
136
137 return 0;
138}
139
140static void __init bcm47xx_register_ssb(void)
141{
142 int err;
143 char buf[100];
144 struct ssb_mipscore *mcore;
145
104static void __init bcm47xx_register_ssb(void)
105{
106 int err;
107 char buf[100];
108 struct ssb_mipscore *mcore;
109
146 err = ssb_bus_ssbbus_register(&bcm47xx_bus.ssb, SSB_ENUM_BASE,
147 bcm47xx_get_invariants);
110 err = ssb_bus_host_soc_register(&bcm47xx_bus.ssb, SSB_ENUM_BASE);
148 if (err)
149 panic("Failed to initialize SSB bus (err %d)", err);
150
151 mcore = &bcm47xx_bus.ssb.mipscore;
152 if (bcm47xx_nvram_getenv("kernel_args", buf, sizeof(buf)) >= 0) {
153 if (strstr(buf, "console=ttyS1")) {
154 struct ssb_serial_port port;
155

--- 131 unchanged lines hidden ---
111 if (err)
112 panic("Failed to initialize SSB bus (err %d)", err);
113
114 mcore = &bcm47xx_bus.ssb.mipscore;
115 if (bcm47xx_nvram_getenv("kernel_args", buf, sizeof(buf)) >= 0) {
116 if (strstr(buf, "console=ttyS1")) {
117 struct ssb_serial_port port;
118

--- 131 unchanged lines hidden ---