diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2014-09-04 18:18:49 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-09-09 15:27:20 -0400 |
commit | 37a7f8762d84327f8e7a8b7d7557c8415b42fc13 (patch) | |
tree | a7b84f626bdc3a059fd167f774369a3c42f26701 /drivers/bcma/main.c | |
parent | 6e094bd805a9b6ad2f5421125db8f604a166616c (diff) |
bcma: register NAND and QSPI cores early
On Northstar (ARM arch) we will use MTD subsystem to access NVRAM and
SPROM. To get access to flash device we need to register these cores
first.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/bcma/main.c')
-rw-r--r-- | drivers/bcma/main.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c index 9a86352352bc..297a2d46985a 100644 --- a/drivers/bcma/main.c +++ b/drivers/bcma/main.c | |||
@@ -120,6 +120,17 @@ static void bcma_release_core_dev(struct device *dev) | |||
120 | kfree(core); | 120 | kfree(core); |
121 | } | 121 | } |
122 | 122 | ||
123 | static bool bcma_is_core_needed_early(u16 core_id) | ||
124 | { | ||
125 | switch (core_id) { | ||
126 | case BCMA_CORE_NS_NAND: | ||
127 | case BCMA_CORE_NS_QSPI: | ||
128 | return true; | ||
129 | } | ||
130 | |||
131 | return false; | ||
132 | } | ||
133 | |||
123 | static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core) | 134 | static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core) |
124 | { | 135 | { |
125 | int err; | 136 | int err; |
@@ -170,6 +181,10 @@ static int bcma_register_devices(struct bcma_bus *bus) | |||
170 | continue; | 181 | continue; |
171 | } | 182 | } |
172 | 183 | ||
184 | /* Early cores were already registered */ | ||
185 | if (bcma_is_core_needed_early(core->id.id)) | ||
186 | continue; | ||
187 | |||
173 | /* Only first GMAC core on BCM4706 is connected and working */ | 188 | /* Only first GMAC core on BCM4706 is connected and working */ |
174 | if (core->id.id == BCMA_CORE_4706_MAC_GBIT && | 189 | if (core->id.id == BCMA_CORE_4706_MAC_GBIT && |
175 | core->core_unit > 0) | 190 | core->core_unit > 0) |
@@ -252,6 +267,12 @@ int bcma_bus_register(struct bcma_bus *bus) | |||
252 | bcma_core_chipcommon_early_init(&bus->drv_cc); | 267 | bcma_core_chipcommon_early_init(&bus->drv_cc); |
253 | } | 268 | } |
254 | 269 | ||
270 | /* Cores providing flash access go before SPROM init */ | ||
271 | list_for_each_entry(core, &bus->cores, list) { | ||
272 | if (bcma_is_core_needed_early(core->id.id)) | ||
273 | bcma_register_core(bus, core); | ||
274 | } | ||
275 | |||
255 | /* Try to get SPROM */ | 276 | /* Try to get SPROM */ |
256 | err = bcma_sprom_get(bus); | 277 | err = bcma_sprom_get(bus); |
257 | if (err == -ENOENT) { | 278 | if (err == -ENOENT) { |