ssb: add place for serial flash driver
authorRafał Miłecki <zajec5@gmail.com>
Sun, 6 Jan 2013 20:48:50 +0000 (21:48 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 9 Jan 2013 19:37:09 +0000 (14:37 -0500)
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/ssb/Kconfig
drivers/ssb/Makefile
drivers/ssb/driver_chipcommon_sflash.c [new file with mode: 0644]
drivers/ssb/driver_mipscore.c
drivers/ssb/ssb_private.h

index ff3c8a21f10d90397dc9fda07b99dcfb08ebc9b9..f7305e2fddcc690b09d2a793d553c0b8b937390e 100644 (file)
@@ -136,6 +136,11 @@ config SSB_DRIVER_MIPS
 
          If unsure, say N
 
+config SSB_SFLASH
+       bool "SSB serial flash support"
+       depends on SSB_DRIVER_MIPS && BROKEN
+       default y
+
 # Assumption: We are on embedded, if we compile the MIPS core.
 config SSB_EMBEDDED
        bool
index 9159ba77c388086a06196767da05d87150d3aacd..b1ddc116d387c47119408ed07d71d3274cce0691 100644 (file)
@@ -11,6 +11,7 @@ ssb-$(CONFIG_SSB_SDIOHOST)            += sdio.o
 # built-in drivers
 ssb-y                                  += driver_chipcommon.o
 ssb-y                                  += driver_chipcommon_pmu.o
+ssb-$(CONFIG_SSB_SFLASH)               += driver_chipcommon_sflash.o
 ssb-$(CONFIG_SSB_DRIVER_MIPS)          += driver_mipscore.o
 ssb-$(CONFIG_SSB_DRIVER_EXTIF)         += driver_extif.o
 ssb-$(CONFIG_SSB_DRIVER_PCICORE)       += driver_pcicore.o
diff --git a/drivers/ssb/driver_chipcommon_sflash.c b/drivers/ssb/driver_chipcommon_sflash.c
new file mode 100644 (file)
index 0000000..8662697
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * Sonics Silicon Backplane
+ * ChipCommon serial flash interface
+ *
+ * Licensed under the GNU/GPL. See COPYING for details.
+ */
+
+#include <linux/ssb/ssb.h>
+
+#include "ssb_private.h"
+
+/* Initialize serial flash access */
+int ssb_sflash_init(struct ssb_chipcommon *cc)
+{
+       pr_err("Serial flash support is not implemented yet!\n");
+
+       return -ENOTSUPP;
+}
index 5bd05b136d22ef80b2cd93f78b65d6ef60640473..2a7684c90243f78fce00c314bc56bff701b671ab 100644 (file)
@@ -203,7 +203,8 @@ static void ssb_mips_flash_detect(struct ssb_mipscore *mcore)
        switch (bus->chipco.capabilities & SSB_CHIPCO_CAP_FLASHT) {
        case SSB_CHIPCO_FLASHT_STSER:
        case SSB_CHIPCO_FLASHT_ATSER:
-               pr_err("Serial flash not supported\n");
+               pr_debug("Found serial flash\n");
+               ssb_sflash_init(&bus->chipco);
                break;
        case SSB_CHIPCO_FLASHT_PARA:
                pr_debug("Found parallel flash\n");
index 6c10b66c796cf7ee23ae3e9334086034198e911c..77d942630750c5ca7bd7ae50d2aacd1f4bc377f0 100644 (file)
@@ -217,6 +217,17 @@ extern u32 ssb_chipco_watchdog_timer_set_wdt(struct bcm47xx_wdt *wdt,
                                             u32 ticks);
 extern u32 ssb_chipco_watchdog_timer_set_ms(struct bcm47xx_wdt *wdt, u32 ms);
 
+/* driver_chipcommon_sflash.c */
+#ifdef CONFIG_SSB_SFLASH
+int ssb_sflash_init(struct ssb_chipcommon *cc);
+#else
+static inline int ssb_sflash_init(struct ssb_chipcommon *cc)
+{
+       pr_err("Serial flash not supported\n");
+       return 0;
+}
+#endif /* CONFIG_SSB_SFLASH */
+
 #ifdef CONFIG_SSB_DRIVER_EXTIF
 extern u32 ssb_extif_watchdog_timer_set_wdt(struct bcm47xx_wdt *wdt, u32 ticks);
 extern u32 ssb_extif_watchdog_timer_set_ms(struct bcm47xx_wdt *wdt, u32 ms);