Skip to contentSkip to conversation

ssb: move functions specific to SoC hosted bus to separated file

PATCH In review Rafał Miłecki 3 participants 5 messages Oct 25, 2015 – Oct 28, 2015

Subsystems (3)
lore
Share & tools
lore

Rafał Miłecki

author maintainer
#0 lore raw

PATCH 1/2 ssb: move functions specific to SoC hosted bus to separated file

This cleans main.c a bit and will allow us to compile SoC related code conditionally in the future.

---
 drivers/ssb/Makefile      |   1 +
 drivers/ssb/host_soc.c    | 173 ++++++++++++++++++++++++++++++++++++++++++++++
 drivers/ssb/main.c        | 162 +------------------------------------------
 drivers/ssb/ssb_private.h |   5 ++
 4 files changed, 180 insertions(+), 161 deletions(-)
 create mode 100644 drivers/ssb/host_soc.c
drivers/ssb/Makefile +1 -0
index 7daa03e..30194c5 100644
@@ -7,6 +7,7 @@ ssb-$(CONFIG_SSB_SPROM)			+= sprom.o
 ssb-$(CONFIG_SSB_PCIHOST)		+= pci.o pcihost_wrapper.o
 ssb-$(CONFIG_SSB_PCMCIAHOST)		+= pcmcia.o bridge_pcmcia_80211.o
 ssb-$(CONFIG_SSB_SDIOHOST)		+= sdio.o
+ssb-y					+= host_soc.o
 
 # built-in drivers
 ssb-y					+= driver_chipcommon.o
drivers/ssb/host_soc.c new file +173 -0

173 lines not on this page · raw message

drivers/ssb/main.c +1 -161

174 lines not on this page · raw message

drivers/ssb/ssb_private.h +5 -0
index 93bb8f0..0a756c2 100644
@@ -157,6 +157,11 @@ static inline int ssb_sdio_init(struct ssb_bus *bus)
 }
 #endif /* CONFIG_SSB_SDIOHOST */
 
+/**************************************************
+ * host_soc.c
+ **************************************************/
+
+extern const struct ssb_bus_ops ssb_host_soc_ops;
 
 /* scan.c */
 extern const char *ssb_core_name(u16 coreid);
Signature · 1 line
1.8.4.5
author maintainer
#1 lore raw

PATCH 2/2 ssb: add Kconfig entry for compiling SoC related code

This allows saving a little of space when not using ssb on Broadcom SoC.

---
 arch/mips/bcm47xx/Kconfig | 1 +
 drivers/ssb/Kconfig       | 9 +++++++++
 drivers/ssb/Makefile      | 2 +-
 drivers/ssb/main.c        | 2 ++
 drivers/ssb/ssb_private.h | 2 ++
 5 files changed, 15 insertions(+), 1 deletion(-)
arch/mips/bcm47xx/Kconfig +1 -0
index 51ed599..e970fd9 100644
@@ -4,6 +4,7 @@ config BCM47XX_SSB
 	bool "SSB Support for Broadcom BCM47XX"
 	select SYS_HAS_CPU_BMIPS32_3300
 	select SSB
+	select SSB_HOST_SOC
 	select SSB_DRIVER_MIPS
 	select SSB_DRIVER_EXTIF
 	select SSB_EMBEDDED
drivers/ssb/Kconfig +9 -0
index f0d22cd..149214b 100644
@@ -80,6 +80,15 @@ config SSB_SDIOHOST
 
 	  If unsure, say N
 
+config SSB_HOST_SOC
+	bool "Support for SSB bus on SoC"
+	depends on SSB
+	help
+	  Host interface for a SSB directly mapped into memory. This is
+	  for some Broadcom SoCs from the BCM47xx and BCM53xx lines.
+
+	  If unsure, say N
+
 config SSB_SILENT
 	bool "No SSB kernel messages"
 	depends on SSB && EXPERT
drivers/ssb/Makefile +1 -1
index 30194c5..64a0968 100644
@@ -7,7 +7,7 @@ ssb-$(CONFIG_SSB_SPROM)			+= sprom.o
 ssb-$(CONFIG_SSB_PCIHOST)		+= pci.o pcihost_wrapper.o
 ssb-$(CONFIG_SSB_PCMCIAHOST)		+= pcmcia.o bridge_pcmcia_80211.o
 ssb-$(CONFIG_SSB_SDIOHOST)		+= sdio.o
-ssb-y					+= host_soc.o
+ssb-$(CONFIG_SSB_HOST_SOC)		+= host_soc.o
 
 # built-in drivers
 ssb-y					+= driver_chipcommon.o
drivers/ssb/main.c +2 -0
index bea823e..5d1e9a0 100644
@@ -761,6 +761,7 @@ int ssb_bus_sdiobus_register(struct ssb_bus *bus, struct sdio_func *func,
 EXPORT_SYMBOL(ssb_bus_sdiobus_register);
 #endif /* CONFIG_SSB_PCMCIAHOST */
 
+#ifdef CONFIG_SSB_HOST_SOC
 int ssb_bus_ssbbus_register(struct ssb_bus *bus, unsigned long baseaddr,
 			    ssb_invariants_func_t get_invariants)
 {
@@ -777,6 +778,7 @@ int ssb_bus_ssbbus_register(struct ssb_bus *bus, unsigned long baseaddr,
 
 	return err;
 }
+#endif
 
 int __ssb_driver_register(struct ssb_driver *drv, struct module *owner)
 {
drivers/ssb/ssb_private.h +2 -0
index 0a756c2..15bfd5c 100644
@@ -161,7 +161,9 @@ static inline int ssb_sdio_init(struct ssb_bus *bus)
  * host_soc.c
  **************************************************/
 
+#ifdef CONFIG_SSB_HOST_SOC
 extern const struct ssb_bus_ops ssb_host_soc_ops;
+#endif
 
 /* scan.c */
 extern const char *ssb_core_name(u16 coreid);
Signature · 1 line
1.8.4.5
maintainer Acked-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] ssb: add Kconfig entry for compiling SoC related code

Quoted 1 line · On Sun, 25 Oct 2015 19:32:43 +0100 Rafał Miłecki <[email protected]> wrote:

This allows saving a little of space when not using ssb on Broadcom SoC.

I'm not sure whether it's worth it.
But I don't mind having this anyway.

Signature · 1 line
Michael
maintainer Acked-by on v1 1/2
#3 lore raw
In reply to Rafał Miłecki
Quoted 2 lines · On Sun, 25 Oct 2015 19:32:42 +0100 Rafał Miłecki <[email protected]> wrote:

This cleans main.c a bit and will allow us to compile SoC related code conditionally in the future.

Looks good.

Quoted 1 line

+#ifdef CONFIG_SSB_BLOCKIO

I wonder whether we should remove that option entirely. It does not save that much space and most people will probably have it enabled anyway. It's required for non-DMA PIO transfers.

So if you want, you could remove that in a separate patch.

Signature · 1 line
Michael