Commit 72a525cbb8037ecf8663720b7087e8e6fc77a49a

Authored by Rafał Miłecki
Committed by John W. Linville
1 parent 79afb22d09

ssb: add place for serial flash driver

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

Showing 5 changed files with 37 additions and 1 deletions Side-by-side Diff

... ... @@ -136,6 +136,11 @@
136 136  
137 137 If unsure, say N
138 138  
  139 +config SSB_SFLASH
  140 + bool "SSB serial flash support"
  141 + depends on SSB_DRIVER_MIPS && BROKEN
  142 + default y
  143 +
139 144 # Assumption: We are on embedded, if we compile the MIPS core.
140 145 config SSB_EMBEDDED
141 146 bool
drivers/ssb/Makefile
... ... @@ -11,6 +11,7 @@
11 11 # built-in drivers
12 12 ssb-y += driver_chipcommon.o
13 13 ssb-y += driver_chipcommon_pmu.o
  14 +ssb-$(CONFIG_SSB_SFLASH) += driver_chipcommon_sflash.o
14 15 ssb-$(CONFIG_SSB_DRIVER_MIPS) += driver_mipscore.o
15 16 ssb-$(CONFIG_SSB_DRIVER_EXTIF) += driver_extif.o
16 17 ssb-$(CONFIG_SSB_DRIVER_PCICORE) += driver_pcicore.o
drivers/ssb/driver_chipcommon_sflash.c
  1 +/*
  2 + * Sonics Silicon Backplane
  3 + * ChipCommon serial flash interface
  4 + *
  5 + * Licensed under the GNU/GPL. See COPYING for details.
  6 + */
  7 +
  8 +#include <linux/ssb/ssb.h>
  9 +
  10 +#include "ssb_private.h"
  11 +
  12 +/* Initialize serial flash access */
  13 +int ssb_sflash_init(struct ssb_chipcommon *cc)
  14 +{
  15 + pr_err("Serial flash support is not implemented yet!\n");
  16 +
  17 + return -ENOTSUPP;
  18 +}
drivers/ssb/driver_mipscore.c
... ... @@ -203,7 +203,8 @@
203 203 switch (bus->chipco.capabilities & SSB_CHIPCO_CAP_FLASHT) {
204 204 case SSB_CHIPCO_FLASHT_STSER:
205 205 case SSB_CHIPCO_FLASHT_ATSER:
206   - pr_err("Serial flash not supported\n");
  206 + pr_debug("Found serial flash\n");
  207 + ssb_sflash_init(&bus->chipco);
207 208 break;
208 209 case SSB_CHIPCO_FLASHT_PARA:
209 210 pr_debug("Found parallel flash\n");
drivers/ssb/ssb_private.h
... ... @@ -217,6 +217,17 @@
217 217 u32 ticks);
218 218 extern u32 ssb_chipco_watchdog_timer_set_ms(struct bcm47xx_wdt *wdt, u32 ms);
219 219  
  220 +/* driver_chipcommon_sflash.c */
  221 +#ifdef CONFIG_SSB_SFLASH
  222 +int ssb_sflash_init(struct ssb_chipcommon *cc);
  223 +#else
  224 +static inline int ssb_sflash_init(struct ssb_chipcommon *cc)
  225 +{
  226 + pr_err("Serial flash not supported\n");
  227 + return 0;
  228 +}
  229 +#endif /* CONFIG_SSB_SFLASH */
  230 +
220 231 #ifdef CONFIG_SSB_DRIVER_EXTIF
221 232 extern u32 ssb_extif_watchdog_timer_set_wdt(struct bcm47xx_wdt *wdt, u32 ticks);
222 233 extern u32 ssb_extif_watchdog_timer_set_ms(struct bcm47xx_wdt *wdt, u32 ms);