mach-bcm: clean up config and build targets

Message ID 1396557052-24029-1-git-send-email-elder@linaro.org
State New
Headers show

Commit Message

Alex Elder April 3, 2014, 8:30 p.m.
Currently CONFIG_ARCH_BCM_MOBILE is used to select all Broadcom
mobile SoCs.  Instead, use that only as a config menu switch, and
define specific symbols like CONFIG_ARCH_BCM_281XX to select a
particular SoC family.  If ARCH_BCM_MOBILE is selected, all of the
SoCs will be selected by default, but this way each can be disabled
individually as well.

This allows more precision in controlling what gets built under
mach-bcm.  Another benefit to doing this is that it makes it obvious
that the code that implements SMC calls to control L2 cache is only
used for BCM281XX (for example).

Also use Kbuild's $(<modulename>-y) variable mechanism to build a
single object file containing everything used for the bcm281xx board
in arch/arm/mach-bcm.

Note:  This patch is based on the current arm-soc/for-next branch:
    e98cd72 arm-soc: document samsung merges

The patch is available here:
    http://git.linaro.org/landing-teams/working/broadcom/kernel.git
    Branch review/mach-bcm-cleanup

Signed-off-by: Alex Elder <elder@linaro.org>
---
 arch/arm/mach-bcm/Kconfig  |   28 ++++++++++++++++++++++++----
 arch/arm/mach-bcm/Makefile |   16 ++++++++++++----
 2 files changed, 36 insertions(+), 8 deletions(-)

Comments

Paul Bolle April 3, 2014, 8:49 p.m. | #1
On Thu, 2014-04-03 at 15:30 -0500, Alex Elder wrote:
> Currently CONFIG_ARCH_BCM_MOBILE is used to select all Broadcom
> mobile SoCs.  Instead, use that only as a config menu switch, and
> define specific symbols like CONFIG_ARCH_BCM_281XX to select a
> particular SoC family.  If ARCH_BCM_MOBILE is selected, all of the
> SoCs will be selected by default, but this way each can be disabled
> individually as well.
> 
> This allows more precision in controlling what gets built under
> mach-bcm.  Another benefit to doing this is that it makes it obvious
> that the code that implements SMC calls to control L2 cache is only
> used for BCM281XX (for example).
> 
> Also use Kbuild's $(<modulename>-y) variable mechanism to build a
> single object file containing everything used for the bcm281xx board
> in arch/arm/mach-bcm.
> 
> Note:  This patch is based on the current arm-soc/for-next branch:
>     e98cd72 arm-soc: document samsung merges
> 
> The patch is available here:
>     http://git.linaro.org/landing-teams/working/broadcom/kernel.git
>     Branch review/mach-bcm-cleanup

It seems the last two paragraphs should actually be below the "---"
marker. There's no need to include them in the commit explanation, is
there?

> Signed-off-by: Alex Elder <elder@linaro.org>
> ---


Paul Bolle

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Alex Elder April 3, 2014, 9:02 p.m. | #2
On 04/03/2014 03:49 PM, Paul Bolle wrote:
> On Thu, 2014-04-03 at 15:30 -0500, Alex Elder wrote:
>> Currently CONFIG_ARCH_BCM_MOBILE is used to select all Broadcom
>> mobile SoCs.  Instead, use that only as a config menu switch, and
>> define specific symbols like CONFIG_ARCH_BCM_281XX to select a
>> particular SoC family.  If ARCH_BCM_MOBILE is selected, all of the
>> SoCs will be selected by default, but this way each can be disabled
>> individually as well.
>>
>> This allows more precision in controlling what gets built under
>> mach-bcm.  Another benefit to doing this is that it makes it obvious
>> that the code that implements SMC calls to control L2 cache is only
>> used for BCM281XX (for example).
>>
>> Also use Kbuild's $(<modulename>-y) variable mechanism to build a
>> single object file containing everything used for the bcm281xx board
>> in arch/arm/mach-bcm.
>>
>> Note:  This patch is based on the current arm-soc/for-next branch:
>>     e98cd72 arm-soc: document samsung merges
>>
>> The patch is available here:
>>     http://git.linaro.org/landing-teams/working/broadcom/kernel.git
>>     Branch review/mach-bcm-cleanup
> 
> It seems the last two paragraphs should actually be below the "---"
> marker. There's no need to include them in the commit explanation, is
> there?

You're right.  Sorry about that.

I got another comment too and will be doing a v2 shortly.

					-Alex
> 
>> Signed-off-by: Alex Elder <elder@linaro.org>
>> ---
> 
> 
> Paul Bolle
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Patch

diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig
index 21f97f7..183fdef 100644
--- a/arch/arm/mach-bcm/Kconfig
+++ b/arch/arm/mach-bcm/Kconfig
@@ -10,7 +10,7 @@  if ARCH_BCM
 menu "Broadcom SoC Selection"
 
 config ARCH_BCM_MOBILE
-	bool "Broadcom Mobile SoC" if ARCH_MULTI_V7
+	bool "Broadcom Mobile SoC Support" if ARCH_MULTI_V7
 	depends on MMU
 	select ARCH_REQUIRE_GPIOLIB
 	select ARM_ERRATA_754322
@@ -23,9 +23,29 @@  config ARCH_BCM_MOBILE
 	select PINCTRL
 	help
 	  This enables support for systems based on Broadcom mobile SoCs.
-	  It currently supports the 'BCM281XX' family, which includes
-	  BCM11130, BCM11140, BCM11351, BCM28145 and
-	  BCM28155 variants.
+
+if ARCH_BCM_MOBILE
+
+menu "Broadcom Mobile SoC Selection"
+
+config ARCH_BCM_281XX
+	bool "Broadcom BCM281XX SoC family"
+	default y
+	help
+	  Enable support for the the BCM281XX family, which includes
+	  BCM11130, BCM11140, BCM11351, BCM28145 and BCM28155
+	  variants.
+
+config ARCH_BCM_21664
+	bool "Broadcom BCM21664 SoC family"
+	default y
+	help
+	  Enable support for the the BCM21664 family, which includes
+	  BCM21663 and BCM21664 variants.
+
+endmenu
+
+endif
 
 
 config ARCH_BCM2835
diff --git a/arch/arm/mach-bcm/Makefile b/arch/arm/mach-bcm/Makefile
index a326b28..08e63c1 100644
--- a/arch/arm/mach-bcm/Makefile
+++ b/arch/arm/mach-bcm/Makefile
@@ -10,10 +10,18 @@ 
 # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-obj-$(CONFIG_ARCH_BCM_MOBILE)	:= board_bcm281xx.o board_bcm21664.o \
-				bcm_kona_smc.o bcm_kona_smc_asm.o kona.o
-obj-$(CONFIG_ARCH_BCM2835)	+= board_bcm2835.o
-
+# BCM281XX
+obj-$(CONFIG_ARCH_BCM_281XX)	+= bcm281xx.o
+bcm281xx-y			:= board_bcm281xx.o
+bcm281xx-y			+= bcm_kona_smc.o bcm_kona_smc_asm.o kona.o
 plus_sec := $(call as-instr,.arch_extension sec,+sec)
 AFLAGS_bcm_kona_smc_asm.o	:=-Wa,-march=armv7-a$(plus_sec)
+
+# BCM21664
+obj-$(CONFIG_ARCH_BCM_21664)	+= board_bcm21664.o
+
+# BCM2835
+obj-$(CONFIG_ARCH_BCM2835)	+= board_bcm2835.o
+
+# BCM5301X
 obj-$(CONFIG_ARCH_BCM_5301X)	+= bcm_5301x.o