diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2015-12-09 17:36:51 -0500 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2015-12-16 09:36:25 -0500 |
commit | 541c9a84cd85203244307d9ebb821102eed82789 (patch) | |
tree | 55c3f1cfe18cf4c14c26dd4772241fcc564281fe /arch/mips/bcm47xx | |
parent | d0ca9900675860d2857f40df88393b199a558634 (diff) |
ssb: pick SoC invariants code from MIPS BCM47xx arch
There is code in ssb fetching "invariants" that is basically a set of
board specific data. Every host requires its own implementation of
reading function. In ssb we have support for PCI, PCMCIA & SDIO.
For some (historical?) reason code reading "invariants" for SoC was
placed in arch code and provided by a callback. This is not needed
nowadays, so lets move that into ssb. This way we keep all "invariants"
functions in a single module making code cleaner.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'arch/mips/bcm47xx')
-rw-r--r-- | arch/mips/bcm47xx/setup.c | 39 |
1 files changed, 1 insertions, 38 deletions
diff --git a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c index 6d38948f0f1e..c807e32d6d81 100644 --- a/arch/mips/bcm47xx/setup.c +++ b/arch/mips/bcm47xx/setup.c | |||
@@ -101,50 +101,13 @@ static void bcm47xx_machine_halt(void) | |||
101 | } | 101 | } |
102 | 102 | ||
103 | #ifdef CONFIG_BCM47XX_SSB | 103 | #ifdef CONFIG_BCM47XX_SSB |
104 | static 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 | |||
140 | static void __init bcm47xx_register_ssb(void) | 104 | static void __init bcm47xx_register_ssb(void) |
141 | { | 105 | { |
142 | int err; | 106 | int err; |
143 | char buf[100]; | 107 | char buf[100]; |
144 | struct ssb_mipscore *mcore; | 108 | struct ssb_mipscore *mcore; |
145 | 109 | ||
146 | err = ssb_bus_ssbbus_register(&bcm47xx_bus.ssb, SSB_ENUM_BASE, | 110 | err = ssb_bus_host_soc_register(&bcm47xx_bus.ssb, SSB_ENUM_BASE); |
147 | bcm47xx_get_invariants); | ||
148 | if (err) | 111 | if (err) |
149 | panic("Failed to initialize SSB bus (err %d)", err); | 112 | panic("Failed to initialize SSB bus (err %d)", err); |
150 | 113 | ||