ARM: Broadcom BCM4760 support
v3 cover ARM: Broadcom BCM4760 support
Howdy,
here is the latest version of my patchest to support this Soc.
I included the sorting (and duplicates removal) of mach-* and plat-* entries by Russel.
Aside CONFIG_ARCH_BCM4760 selecting again mach-bcm (v1), nothing else is changed respect to v2.
Regards,
Domenico
PATCH v3 1/5 ARM: remove duplicates in mach-* and plat-*
An embedded and charset-unspecified text was scrubbed...
Name: arm-remove-machdirs-and-platdirs-duplicates.patch
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130815/580973f9/attachment.ksh>
PATCH v3 2/5 ARM: bcm4760: Add platform infrastructure
In reply to Domenico AndreoliAn embedded and charset-unspecified text was scrubbed...
Name: arm-bcm476x-add-infrastructure.patch
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130815/8d0e3cb2/attachment.ksh>
PATCH v3 2/5 ARM: bcm4760: Add platform infrastructure
Domenico,
Quoted 21 lines · Domenico Andreoli
From: Domenico Andreoli <[email protected]>
Platform infrastructure for the Broadcom BCM4760 based ARM11 SoCs.
v3:
* dropped the idea of unconditionally build mach-bcmv2:
* clocks are now configured via DT
* uart DT nodes have been renamed and hooked to the proper clock nodes
* dropped unneeded config options
* dropped misused initialization ofsystem_rev
* dropped unneeded early io mapping
* build rule of mach-bcm is moved to separated patchv1:
* initial releaseCc devicetree at vger.kernel.orgCc linux-arm-kernel at lists.infradead.orgSigned-off-by Domenico Andreoli <[email protected]>
Quoted 12 lines
--- Documentation/devicetree/bindings/arm/bcm4760.txt | 8 ++ MAINTAINERS | 7 ++ arch/arm/Makefile | 1 + arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/bcm4760-catalina.dts | 11 +++ arch/arm/boot/dts/bcm4760.dtsi | 71 +++++++++++++++++++++ arch/arm/configs/bcm4760_defconfig | 76 ++++++++++++++++++++++ arch/arm/mach-bcm/Kconfig | 7 ++ arch/arm/mach-bcm/Makefile | 2 + arch/arm/mach-bcm/bcm4760.c | 37 +++++++++++ 10 files changed, 221 insertions(+)
Since I raised the original objection to the unconditional build,
thx,
Jason.
PATCH v3 2/5 ARM: bcm4760: Add platform infrastructure
In reply to Domenico AndreoliHi,
Quoted 159 lines · Domenico Andreoli
From: Domenico Andreoli <[email protected]>
Platform infrastructure for the Broadcom BCM4760 based ARM11 SoCs.
v3:
* dropped the idea of unconditionally build mach-bcmv2:
* clocks are now configured via DT
* uart DT nodes have been renamed and hooked to the proper clock nodes
* dropped unneeded config options
* dropped misused initialization ofsystem_rev
* dropped unneeded early io mapping
* build rule of mach-bcm is moved to separated patchv1:
* initial releaseCc devicetree at vger.kernel.orgCc linux-arm-kernel at lists.infradead.orgSigned-off-by Domenico Andreoli <[email protected]>--- Documentation/devicetree/bindings/arm/bcm4760.txt | 8 ++ MAINTAINERS | 7 ++ arch/arm/Makefile | 1 + arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/bcm4760-catalina.dts | 11 +++ arch/arm/boot/dts/bcm4760.dtsi | 71 +++++++++++++++++++++ arch/arm/configs/bcm4760_defconfig | 76 ++++++++++++++++++++++ arch/arm/mach-bcm/Kconfig | 7 ++ arch/arm/mach-bcm/Makefile | 2 + arch/arm/mach-bcm/bcm4760.c | 37 +++++++++++ 10 files changed, 221 insertions(+)Index:
b/Documentation/devicetree/bindings/arm/bcm4760.txt
===================================================================Documentation/devicetree/bindings/arm/bcm4760.txt new file +8
-0@@ -0,0 +1,8 @@ +Broadcom BCM4760 ARM11 SoC device tree bindings +----------------------------------------------- + +Boards with the BCM4760 SoC shall have the following properties: + +Required root node property: + +compatible = "brcm,bcm4760";Index: b/arch/arm/configs/bcm4760_defconfig
===================================================================arch/arm/configs/bcm4760_defconfig new file +76
-0@@ -0,0 +1,76 @@ +CONFIG_IRQ_DOMAIN_DEBUG=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_BLK_DEV_INITRD=y +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_EMBEDDED=y +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_BLK_DEV_BSG is not set +# CONFIG_IOSCHED_DEADLINE is not set +# CONFIG_IOSCHED_CFQ is not set +CONFIG_ARCH_MULTI_V6=y +# CONFIG_ARCH_MULTI_V7 is not set +CONFIG_ARCH_BCM4760=y +CONFIG_ARM_ERRATA_411920=y +CONFIG_ARM_ERRATA_364296=y +CONFIG_AEABI=y +CONFIG_DEPRECATED_PARAM_STRUCT=y +CONFIG_ARM_APPENDED_DTB=y +CONFIG_ARM_ATAG_DTB_COMPAT=y +CONFIG_VFP=y +# CONFIG_SUSPEND is not set +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y +CONFIG_CMA=y +CONFIG_PROC_DEVICETREE=y +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_RAM=y +CONFIG_SCSI=y +# CONFIG_SCSI_PROC_FS is not set +CONFIG_BLK_DEV_SD=y +CONFIG_SCSI_MULTI_LUN=y +# CONFIG_SCSI_LOWLEVEL is not set +# CONFIG_INPUT_MOUSEDEV is not set +CONFIG_INPUT_EVDEV=y +# CONFIG_INPUT_KEYBOARD is not set +# CONFIG_INPUT_MOUSE is not set +# CONFIG_SERIO is not set +# CONFIG_VT is not set +# CONFIG_DEVKMEM is not set +CONFIG_SERIAL_AMBA_PL011=y +CONFIG_SERIAL_AMBA_PL011_CONSOLE=y +# CONFIG_HW_RANDOM is not set +# CONFIG_HWMON is not set +# CONFIG_HID is not set +# CONFIG_USB_SUPPORT is not set +CONFIG_COMMON_CLK_DEBUG=y +# CONFIG_IOMMU_SUPPORT is not set +CONFIG_EXT2_FS=y +CONFIG_EXT3_FS=y +# CONFIG_EXT3_FS_XATTR is not set +CONFIG_EXT4_FS=y +CONFIG_FANOTIFY=y +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y +# CONFIG_PROC_PAGE_MONITOR is not set +CONFIG_TMPFS=y +CONFIG_CRAMFS=y +CONFIG_ROMFS_FS=y +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_CODEPAGE_850=y +CONFIG_NLS_ISO8859_1=y +CONFIG_NLS_ISO8859_15=y +CONFIG_PRINTK_TIME=y +CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_INFO_REDUCED=y +CONFIG_STRIP_ASM_SYMS=y +CONFIG_DEBUG_SECTION_MISMATCH=y +CONFIG_MAGIC_SYSRQ=y +# CONFIG_SCHED_DEBUG is not set +CONFIG_DEBUG_SPINLOCK=y +CONFIG_DEBUG_MUTEXES=y +CONFIG_DEBUG_ATOMIC_SLEEP=y +# CONFIG_FTRACE is not set +# CONFIG_CRYPTO_ANSI_CPRNG is not set +# CONFIG_CRYPTO_HW is not setIndex:
b/arch/arm/mach-bcm/bcm4760.c
===================================================================arch/arm/mach-bcm/bcm4760.c new file +26
-0@@ -0,0 +1,37 @@ +/* +* Broadcom BCM4760 based ARM11 SoCs platform support +* +* Copyright (C) 2012 Domenico Andreoli <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/ + +#include <linux/init.h> +#include <linux/clk-provider.h> +#include <linux/of_platform.h> + +#include <asm/mach/arch.h> + +static void __init bcm4760_init (void ) +{ +of_clk_init (NULL ); +of_platform_populate (NULL , of_default_bus_match_table,NULL ,NULL );
arch/arm/mach-bcm/bcm4760.c line 36
Quoted 10 lines
arch/arm/mach-bcm/bcm4760.c new file +10
-0+} + +static const char *const bcm4760_compat[]__initconst = { +"brcm,bcm4760" , +NULL +}; + +DT_MACHINE_START (BCM4760 ,"Broadcom BCM4760" ) + .init_machine = bcm4760_init, + .dt_compat = bcm4760_compat
Please add a , after the last member too, it makes life much easier if someone is scripting a change across all these in the future (such as sorting them).
Quoted 5 lines
Index: b/arch/arm/mach-bcm/Kconfig
===================================================================
arch/arm/mach-bcm/Kconfig config ARCH_BCM · line 26
Quoted 10 lines
arch/arm/mach-bcm/Kconfig +7
-0@@ -17,3 +17,10 @@ config ARCH_BCM It currently supports the 'BCM281XX' family, which includes BCM11130, BCM11140, BCM11351, BCM28145 and BCM28155 variants. + +config ARCH_BCM4760 + bool "Broadcom BCM4760 based SoCs (ARM11)" if ARCH_MULTI_V6 + select ARM_AMBA + select ARM_VIC + select CLKSRC_OF + select SOC_BUS
So I think I mentioned this during previous discussions, but I think this should be solved by having:
config ARCH_BCM
bool "Broadcom platforms"
help
This enables support for Broadcom based systems
menu "Broadcom platform selection"
depends on ARCH_BCM
config ARCH_BCM281XX
... current ARCH_BCM contents
config ARCH_BCM4760
... above conents
endmenu
Quoted 15 lines
Index: b/arch/arm/mach-bcm/Makefile
===================================================================arch/arm/mach-bcm/Makefile +2
-0@@ -13,3 +13,5 @@ obj-$(CONFIG_ARCH_BCM) := board_bcm.o bcm_kona_smc.o bcm_kona_smc_asm.o plus_sec := $(call as-instr,.arch_extension sec,+sec) AFLAGS_bcm_kona_smc_asm.o :=-Wa,-march=armv7-a$(plus_sec) + +obj-$(CONFIG_ARCH_BCM4760) += bcm4760.oIndex: b/arch/arm/Makefile
===================================================================
arch/arm/Makefile textofs-$(CONFIG_ARCH_MSM8960) := 0x0020 · line 150
Quoted 4 lines
arch/arm/Makefile +1
-0@@ -147,6 +147,7 @@ textofs-$(CONFIG_ARCH_MSM8960) := 0x0020 machine-$(CONFIG_ARCH_AT91) += at91 machine-$(CONFIG_ARCH_BCM) += bcm machine-$(CONFIG_ARCH_BCM2835) += bcm2835 +machine-$(CONFIG_ARCH_BCM4760) += bcm
With the above change, this isn't needed.
-Olof
PATCH v3 2/5 ARM: bcm4760: Add platform infrastructure
Quoted 1 line · Olof Johansson
Hi,
Hi,
Quoted 165 lines · Domenico Andreoli
Quoted 164 lines
From: Domenico Andreoli <[email protected]>
Platform infrastructure for the Broadcom BCM4760 based ARM11 SoCs.
v3:
* dropped the idea of unconditionally build mach-bcmv2:
* clocks are now configured via DT
* uart DT nodes have been renamed and hooked to the proper clock nodes
* dropped unneeded config options
* dropped misused initialization ofsystem_rev
* dropped unneeded early io mapping
* build rule of mach-bcm is moved to separated patchv1:
* initial releaseCc devicetree at vger.kernel.orgCc linux-arm-kernel at lists.infradead.orgSigned-off-by Domenico Andreoli <[email protected]>--- Documentation/devicetree/bindings/arm/bcm4760.txt | 8 ++ MAINTAINERS | 7 ++ arch/arm/Makefile | 1 + arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/bcm4760-catalina.dts | 11 +++ arch/arm/boot/dts/bcm4760.dtsi | 71 +++++++++++++++++++++ arch/arm/configs/bcm4760_defconfig | 76 ++++++++++++++++++++++ arch/arm/mach-bcm/Kconfig | 7 ++ arch/arm/mach-bcm/Makefile | 2 + arch/arm/mach-bcm/bcm4760.c | 37 +++++++++++ 10 files changed, 221 insertions(+)Index:
b/Documentation/devicetree/bindings/arm/bcm4760.txt
===================================================================Documentation/devicetree/bindings/arm/bcm4760.txt new file +8
-0@@ -0,0 +1,8 @@ +Broadcom BCM4760 ARM11 SoC device tree bindings +----------------------------------------------- + +Boards with the BCM4760 SoC shall have the following properties: + +Required root node property: + +compatible = "brcm,bcm4760";Index: b/arch/arm/configs/bcm4760_defconfig
===================================================================arch/arm/configs/bcm4760_defconfig new file +76
-0@@ -0,0 +1,76 @@ +CONFIG_IRQ_DOMAIN_DEBUG=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_BLK_DEV_INITRD=y +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_EMBEDDED=y +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_BLK_DEV_BSG is not set +# CONFIG_IOSCHED_DEADLINE is not set +# CONFIG_IOSCHED_CFQ is not set +CONFIG_ARCH_MULTI_V6=y +# CONFIG_ARCH_MULTI_V7 is not set +CONFIG_ARCH_BCM4760=y +CONFIG_ARM_ERRATA_411920=y +CONFIG_ARM_ERRATA_364296=y +CONFIG_AEABI=y +CONFIG_DEPRECATED_PARAM_STRUCT=y +CONFIG_ARM_APPENDED_DTB=y +CONFIG_ARM_ATAG_DTB_COMPAT=y +CONFIG_VFP=y +# CONFIG_SUSPEND is not set +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y +CONFIG_CMA=y +CONFIG_PROC_DEVICETREE=y +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_RAM=y +CONFIG_SCSI=y +# CONFIG_SCSI_PROC_FS is not set +CONFIG_BLK_DEV_SD=y +CONFIG_SCSI_MULTI_LUN=y +# CONFIG_SCSI_LOWLEVEL is not set +# CONFIG_INPUT_MOUSEDEV is not set +CONFIG_INPUT_EVDEV=y +# CONFIG_INPUT_KEYBOARD is not set +# CONFIG_INPUT_MOUSE is not set +# CONFIG_SERIO is not set +# CONFIG_VT is not set +# CONFIG_DEVKMEM is not set +CONFIG_SERIAL_AMBA_PL011=y +CONFIG_SERIAL_AMBA_PL011_CONSOLE=y +# CONFIG_HW_RANDOM is not set +# CONFIG_HWMON is not set +# CONFIG_HID is not set +# CONFIG_USB_SUPPORT is not set +CONFIG_COMMON_CLK_DEBUG=y +# CONFIG_IOMMU_SUPPORT is not set +CONFIG_EXT2_FS=y +CONFIG_EXT3_FS=y +# CONFIG_EXT3_FS_XATTR is not set +CONFIG_EXT4_FS=y +CONFIG_FANOTIFY=y +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y +# CONFIG_PROC_PAGE_MONITOR is not set +CONFIG_TMPFS=y +CONFIG_CRAMFS=y +CONFIG_ROMFS_FS=y +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_CODEPAGE_850=y +CONFIG_NLS_ISO8859_1=y +CONFIG_NLS_ISO8859_15=y +CONFIG_PRINTK_TIME=y +CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_INFO_REDUCED=y +CONFIG_STRIP_ASM_SYMS=y +CONFIG_DEBUG_SECTION_MISMATCH=y +CONFIG_MAGIC_SYSRQ=y +# CONFIG_SCHED_DEBUG is not set +CONFIG_DEBUG_SPINLOCK=y +CONFIG_DEBUG_MUTEXES=y +CONFIG_DEBUG_ATOMIC_SLEEP=y +# CONFIG_FTRACE is not set +# CONFIG_CRYPTO_ANSI_CPRNG is not set +# CONFIG_CRYPTO_HW is not setIndex:
b/arch/arm/mach-bcm/bcm4760.c
===================================================================arch/arm/mach-bcm/bcm4760.c new file +31
-0@@ -0,0 +1,37 @@ +/* +* Broadcom BCM4760 based ARM11 SoCs platform support +* +* Copyright (C) 2012 Domenico Andreoli <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/ + +#include <linux/init.h> +#include <linux/clk-provider.h> +#include <linux/of_platform.h> + +#include <asm/mach/arch.h> + +static void __init bcm4760_init (void ) +{ +of_clk_init (NULL ); +of_platform_populate (NULL , of_default_bus_match_table,NULL ,NULL ); +} + +static const char *const bcm4760_compat[]__initconst = { +"brcm,bcm4760" , +NULL
Quoted 8 lines
arch/arm/mach-bcm/bcm4760.c line 36
Quoted 5 lines
arch/arm/mach-bcm/bcm4760.c new file +5
-0+}; + +DT_MACHINE_START (BCM4760 ,"Broadcom BCM4760" ) + .init_machine = bcm4760_init, + .dt_compat = bcm4760_compatPlease add a , after the last member too, it makes life much easier if someone is scripting a change across all these in the future (such as sorting them).
I usually pay attention to this detail. I'll fix.
Quoted 28 lines
Quoted 6 lines
Index: b/arch/arm/mach-bcm/Kconfig
===================================================================arch/arm/mach-bcm/Kconfig config ARCH_BCM · line 26
Quoted 10 lines
arch/arm/mach-bcm/Kconfig +7
-0@@ -17,3 +17,10 @@ config ARCH_BCM It currently supports the 'BCM281XX' family, which includes BCM11130, BCM11140, BCM11351, BCM28145 and BCM28155 variants. + +config ARCH_BCM4760 + bool "Broadcom BCM4760 based SoCs (ARM11)" if ARCH_MULTI_V6 + select ARM_AMBA + select ARM_VIC + select CLKSRC_OF + select SOC_BUSSo I think I mentioned this during previous discussions, but I think this should be solved by having:
config
ARCH_BCM
bool "Broadcom platforms"
help
This enables support for Broadcom based systemsmenu "Broadcom platform selection"
depends onARCH_BCM
Quoted 6 lines
config
ARCH_BCM281XX
... currentARCH_BCMcontentsconfig
ARCH_BCM4760
... above conents
endmenu
got it.
need to sync with Christian, the current owner of ARCH_BCM.
Quoted 15 lines
Quoted 15 lines
Index: b/arch/arm/mach-bcm/Makefile
===================================================================arch/arm/mach-bcm/Makefile +2
-0@@ -13,3 +13,5 @@ obj-$(CONFIG_ARCH_BCM) := board_bcm.o bcm_kona_smc.o bcm_kona_smc_asm.o plus_sec := $(call as-instr,.arch_extension sec,+sec) AFLAGS_bcm_kona_smc_asm.o :=-Wa,-march=armv7-a$(plus_sec) + +obj-$(CONFIG_ARCH_BCM4760) += bcm4760.oIndex: b/arch/arm/Makefile
===================================================================
--- a/arch/arm/Makefile
Quoted 8 lines
arch/arm/mach-bcm/Makefile textofs-$(CONFIG_ARCH_MSM8960) := 0x0020 · line 150
Quoted 6 lines
+++ b/arch/arm/Makefile
arch/arm/mach-bcm/Makefile +1
-0@@ -147,6 +147,7 @@ textofs-$(CONFIG_ARCH_MSM8960) := 0x0020 machine-$(CONFIG_ARCH_AT91) += at91 machine-$(CONFIG_ARCH_BCM) += bcm machine-$(CONFIG_ARCH_BCM2835) += bcm2835 +machine-$(CONFIG_ARCH_BCM4760) += bcmWith the above change, this isn't needed.
clear
Quoted 3 lines
-Olof
Thanks
Domenico
PATCH v3 2/5 ARM: bcm4760: Add platform infrastructure
Quoted 29 lines · Domenico Andreoli
Quoted 29 lines
Quoted 5 lines
Index: b/arch/arm/mach-bcm/Kconfig
===================================================================arch/arm/mach-bcm/Kconfig config ARCH_BCM · line 26
Quoted 10 lines
arch/arm/mach-bcm/Kconfig +7
-0@@ -17,3 +17,10 @@ config ARCH_BCM It currently supports the 'BCM281XX' family, which includes BCM11130, BCM11140, BCM11351, BCM28145 and BCM28155 variants. + +config ARCH_BCM4760 + bool "Broadcom BCM4760 based SoCs (ARM11)" if ARCH_MULTI_V6 + select ARM_AMBA + select ARM_VIC + select CLKSRC_OF + select SOC_BUSSo I think I mentioned this during previous discussions, but I think this should be solved by having:
config
ARCH_BCM
bool "Broadcom platforms"
help
This enables support for Broadcom based systemsmenu "Broadcom platform selection"
depends onARCH_BCMconfig
ARCH_BCM281XX
... currentARCH_BCMcontents
Quoted 6 lines
Quoted 3 lines
config
ARCH_BCM4760
... above conents
endmenugot it.
need to sync with Christian, the current owner of
ARCH_BCM.
This is fine, but it is better to name it MOBILEBCM instead for our platform, as it plan to keep it single zImage. My plan was to switch the current usage of ARCH_BCM for chips to ARCH_MOBILEBCM, and then leave ARCH_BCM as a generic BCM menu option as above. I can send a patch to that effect if everyone is okay with that.
thanks,
csd
PATCH v3 2/5 ARM: bcm4760: Add platform infrastructure
Quoted 38 lines · Christian Daudt
Quoted 37 lines · Domenico Andreoli
Quoted 28 lines
Quoted 6 lines
Index: b/arch/arm/mach-bcm/Kconfig
===================================================================arch/arm/mach-bcm/Kconfig config ARCH_BCM · line 26
Quoted 10 lines
arch/arm/mach-bcm/Kconfig +7
-0@@ -17,3 +17,10 @@ config ARCH_BCM It currently supports the 'BCM281XX' family, which includes BCM11130, BCM11140, BCM11351, BCM28145 and BCM28155 variants. + +config ARCH_BCM4760 + bool "Broadcom BCM4760 based SoCs (ARM11)" if ARCH_MULTI_V6 + select ARM_AMBA + select ARM_VIC + select CLKSRC_OF + select SOC_BUSSo I think I mentioned this during previous discussions, but I think this should be solved by having:
config
ARCH_BCM
bool "Broadcom platforms"
help
This enables support for Broadcom based systemsmenu "Broadcom platform selection"
depends onARCH_BCMQuoted 6 lines
config
ARCH_BCM281XX
... currentARCH_BCMcontentsconfig
ARCH_BCM4760
... above conents
endmenugot it.
Quoted 7 lines
Quoted 1 line
need to sync with Christian, the current owner of
ARCH_BCM.This is fine, but it is better to name it MOBILEBCM instead for our platform, as it plan to keep it single zImage. My plan was to switch the current usage of
ARCH_BCMfor chips toARCH_MOBILEBCM, and then leaveARCH_BCMas a generic BCM menu option as above. I can send a patch to that effect if everyone is okay with that.
Sounds good. Let's do that for 2.13.
-Olof
PATCH v3 2/5 ARM: bcm4760: Add platform infrastructure
Quoted 41 lines · Olof Johansson
Quoted 40 lines · Christian Daudt
Quoted 38 lines · Domenico Andreoli
Quoted 28 lines
Quoted 6 lines
Index: b/arch/arm/mach-bcm/Kconfig
===================================================================arch/arm/mach-bcm/Kconfig config ARCH_BCM · line 26
Quoted 10 lines
arch/arm/mach-bcm/Kconfig +7
-0@@ -17,3 +17,10 @@ config ARCH_BCM It currently supports the 'BCM281XX' family, which includes BCM11130, BCM11140, BCM11351, BCM28145 and BCM28155 variants. + +config ARCH_BCM4760 + bool "Broadcom BCM4760 based SoCs (ARM11)" if ARCH_MULTI_V6 + select ARM_AMBA + select ARM_VIC + select CLKSRC_OF + select SOC_BUSSo I think I mentioned this during previous discussions, but I think this should be solved by having:
config
ARCH_BCM
bool "Broadcom platforms"
help
This enables support for Broadcom based systemsmenu "Broadcom platform selection"
depends onARCH_BCMQuoted 6 lines
config
ARCH_BCM281XX
... currentARCH_BCMcontentsconfig
ARCH_BCM4760
... above conents
endmenugot it.
need to sync with Christian, the current owner of
ARCH_BCM.
Quoted 7 lines
Quoted 5 lines
This is fine, but it is better to name it MOBILEBCM instead for our platform, as it plan to keep it single zImage. My plan was to switch the current usage of
ARCH_BCMfor chips toARCH_MOBILEBCM, and then leaveARCH_BCMas a generic BCM menu option as above. I can send a patch to that effect if everyone is okay with that.Sounds good. Let's do that for 2.13.
Christian, can I assume you will prepare a patch to rename ARCH_BCM or do you prefer I include it my series, maybe simplifying the merge of it? I'm fine with both.
Regards,
Domenico
PATCH v3 2/5 ARM: bcm4760: Add platform infrastructure
Quoted 43 lines · Domenico Andreoli
Quoted 42 lines · Olof Johansson
Quoted 41 lines · Christian Daudt
Quoted 29 lines · Domenico Andreoli
Quoted 29 lines
Quoted 5 lines
Index: b/arch/arm/mach-bcm/Kconfig
===================================================================arch/arm/mach-bcm/Kconfig config ARCH_BCM · line 26
Quoted 10 lines
arch/arm/mach-bcm/Kconfig +7
-0@@ -17,3 +17,10 @@ config ARCH_BCM It currently supports the 'BCM281XX' family, which includes BCM11130, BCM11140, BCM11351, BCM28145 and BCM28155 variants. + +config ARCH_BCM4760 + bool "Broadcom BCM4760 based SoCs (ARM11)" if ARCH_MULTI_V6 + select ARM_AMBA + select ARM_VIC + select CLKSRC_OF + select SOC_BUSSo I think I mentioned this during previous discussions, but I think this should be solved by having:
config
ARCH_BCM
bool "Broadcom platforms"
help
This enables support for Broadcom based systemsmenu "Broadcom platform selection"
depends onARCH_BCMconfig
ARCH_BCM281XX
... currentARCH_BCMcontentsQuoted 6 lines
Quoted 3 lines
config
ARCH_BCM4760
... above conents
endmenugot it.
need to sync with Christian, the current owner of
ARCH_BCM.This is fine, but it is better to name it MOBILEBCM instead for our platform, as it plan to keep it single zImage. My plan was to switch the current usage of
ARCH_BCMfor chips toARCH_MOBILEBCM, and then leaveARCH_BCMas a generic BCM menu option as above. I can send a patch to that effect if everyone is okay with that.
Quoted 8 lines
Quoted 1 line
Sounds good. Let's do that for 2.13.
Christian, can I assume you will prepare a patch to rename
ARCH_BCMor do you prefer I include it my series, maybe simplifying the merge of it? I'm fine with both.Regards,
Domenico
Yes. I have a patch going through internal review, I'll post it early next week.
thanks,
csd
PATCH v3 3/5 ARM: bcm4760: Add system timer
In reply to Domenico AndreoliAn embedded and charset-unspecified text was scrubbed...
Name: arm-bcm476x-add-system-timer.patch
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130815/b7019de1/attachment.ksh>
PATCH v3 3/5 ARM: bcm4760: Add system timer
Quoted 15 lines · Domenico Andreoli
(quoted diff) +15
-0+ +static inline void __iomem *to_load(struct bcm4760_timer *timer) +{ + return timer->base + TIMER_LOAD_OFFSET; +} + +static inline void __iomem *to_control(struct bcm4760_timer *timer) +{ + return timer->base + TIMER_CONTROL_OFFSET; +} + +static inline void __iomem *to_intclr(struct bcm4760_timer *timer) +{ + return timer->base + TIMER_INTCLR_OFFSET; +}
Review
Quoted 10 lines
(quoted diff) +10
-0+ +static inline void __iomem *to_ris(struct bcm4760_timer *timer) +{ + return timer->base + TIMER_RIS_OFFSET; +} + +static inline void __iomem *to_mis(struct bcm4760_timer *timer) +{ + return timer->base + TIMER_MIS_OFFSET; +}
Style Nit: This is new. Usually people either make a <my_driver>_{readl,writel}() function that takes the struct and an offset or they just add the offset directly in their readl/writel calls. Can you do that? Probably save some lines of code.
Quoted 5 lines
(quoted diff) +5
-0+static irqreturn_t bcm4760_timer_interrupt(int irq, void *dev_id) +{ + struct bcm4760_timer *timer = dev_id; + void (*event_handler)(struct clock_event_device *); +
Review
Quoted 10 lines
(quoted diff) +10
-0+ /* check the (masked) interrupt status */ + if (!readl_relaxed(to_mis(timer))) + return IRQ_NONE; + + /* clear the timer interrupt */ + writel_relaxed(1, to_intclr(timer)); + + event_handler = ACCESS_ONCE(timer->evt.event_handler); + if (event_handler) + event_handler(&timer->evt);
This is unfortunate. Do you have a pending timer interrupt left by the bootloader?
Review
Quoted 8 lines
(quoted diff) +8
-0+ + return IRQ_HANDLED; +} + +static void __init bcm4760_init_time(struct device_node *node) +{ + void __iomem *base; + u32 freq = 24000000;
Why have freq in the DT binding at all then?
Quoted 21 lines
(quoted diff) +21
-0+ int irq; + struct bcm4760_timer *timer; + + base = of_iomap(node, 0); + if (!base) + panic("Can't remap timer registers"); + + timer = kzalloc(sizeof(*timer), GFP_KERNEL); + if (!timer) + panic("Can't allocate timer struct\n"); + + irq = irq_of_parse_and_map(node, 0); + if (irq <= 0) + panic("Can't parse timer IRQ"); + + timer->base = base; + timer->evt.name = node->name; + timer->evt.rating = 300; + timer->evt.features = CLOCK_EVT_FEAT_ONESHOT; + timer->evt.set_mode = bcm4760_timer_set_mode; + timer->evt.set_next_event = bcm4760_timer_set_next_event;
Review
Quoted 10 lines
(quoted diff) +10
-0+ timer->evt.cpumask = cpumask_of(0); + timer->act.name = node->name; + timer->act.flags = IRQF_TIMER | IRQF_SHARED; + timer->act.dev_id = timer; + timer->act.handler = bcm4760_timer_interrupt; + + if (setup_irq(irq, &timer->act)) + panic("Can't set up timer IRQ\n"); + + clockevents_config_and_register(&timer->evt, freq, 0xf, 0xffffffff);
If you switch this registration and the setup_irq() call you shouldn't need the ACCESS_ONCE() and that check in the irq handler. Please switch the order and or clear the interrupt before registering the clockevent and remove the checks in the interrupt handler.
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
PATCH v3 3/5 ARM: bcm4760: Add system timer
Quoted 24 lines · Stephen Boyd
Quoted 23 lines · Domenico Andreoli
(quoted diff) +23
-0+ +static inline void __iomem *to_load(struct bcm4760_timer *timer) +{ + return timer->base + TIMER_LOAD_OFFSET; +} + +static inline void __iomem *to_control(struct bcm4760_timer *timer) +{ + return timer->base + TIMER_CONTROL_OFFSET; +} + +static inline void __iomem *to_intclr(struct bcm4760_timer *timer) +{ + return timer->base + TIMER_INTCLR_OFFSET; +} + +static inline void __iomem *to_ris(struct bcm4760_timer *timer) +{ + return timer->base + TIMER_RIS_OFFSET; +} + +static inline void __iomem *to_mis(struct bcm4760_timer *timer) +{
Quoted 8 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ return timer->base + TIMER_MIS_OFFSET; +}Style Nit: This is new. Usually people either make a <my_driver>_{readl,writel}() function that takes the struct and an offset or they just add the offset directly in their readl/writel calls. Can you do that? Probably save some lines of code.
yes, sure.
Quoted 11 lines
Quoted 11 lines
(quoted diff) +10
-0+static irqreturn_t bcm4760_timer_interrupt(int irq, void *dev_id) +{ + struct bcm4760_timer *timer = dev_id; + void (*event_handler)(struct clock_event_device *); + + /* check the (masked) interrupt status */ + if (!readl_relaxed(to_mis(timer))) + return IRQ_NONE; + + /* clear the timer interrupt */
Quoted 8 lines
Review
Quoted 5 lines
(quoted diff) +5
-0+ writel_relaxed(1, to_intclr(timer)); + + event_handler = ACCESS_ONCE(timer->evt.event_handler); + if (event_handler) + event_handler(&timer->evt);This is unfortunate. Do you have a pending timer interrupt left by the bootloader?
Do you mean that if no interrupts are expected beween the irq request and the call clockevents_config_and_register(), I can assume event_handler is always set?
Quoted 11 lines
Review
Quoted 9 lines
(quoted diff) +8
-0+ + return IRQ_HANDLED; +} + +static void __init bcm4760_init_time(struct device_node *node) +{ + void __iomem *base; + u32 freq = 24000000;Why have freq in the DT binding at all then?
To get an HW address and remap it at runtime, I guess. I copied it but would also prefer to use DT only where really needed.
Quoted 30 lines
Quoted 30 lines
(quoted diff) +29
-0+ int irq; + struct bcm4760_timer *timer; + + base = of_iomap(node, 0); + if (!base) + panic("Can't remap timer registers"); + + timer = kzalloc(sizeof(*timer), GFP_KERNEL); + if (!timer) + panic("Can't allocate timer struct\n"); + + irq = irq_of_parse_and_map(node, 0); + if (irq <= 0) + panic("Can't parse timer IRQ"); + + timer->base = base; + timer->evt.name = node->name; + timer->evt.rating = 300; + timer->evt.features = CLOCK_EVT_FEAT_ONESHOT; + timer->evt.set_mode = bcm4760_timer_set_mode; + timer->evt.set_next_event = bcm4760_timer_set_next_event; + timer->evt.cpumask = cpumask_of(0); + timer->act.name = node->name; + timer->act.flags = IRQF_TIMER | IRQF_SHARED; + timer->act.dev_id = timer; + timer->act.handler = bcm4760_timer_interrupt; + + if (setup_irq(irq, &timer->act)) + panic("Can't set up timer IRQ\n");
Quoted 8 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ + clockevents_config_and_register(&timer->evt, freq, 0xf, 0xffffffff);If you switch this registration and the
setup_irq()call you shouldn't need theACCESS_ONCE()and that check in the irq handler. Please switch the order and or clear the interrupt before registering the clockevent and remove the checks in the interrupt handler.
got it. Thank you.
Domenico
PATCH v3 3/5 ARM: bcm4760: Add system timer
In reply to Domenico AndreoliQuoted 11 lines · Domenico Andreoli
From: Domenico Andreoli <[email protected]>
System timer implementation for the BCM4760 based SoCs.
v3:
* unchangedv2:
* dropped clock-frequency property, its allowed value was anyway fixed to 24MHz and not clearly related to any known clock
Quoted 8 lines
v1:
* initial releaseCc John Stultz <[email protected]>Cc Thomas Gleixner <[email protected]>Cc devicetree at vger.kernel.orgCc linux-arm-kernel at lists.infradead.orgSigned-off-by Domenico Andreoli <[email protected]>
PATCH v3 3/5 ARM: bcm4760: Add system timer
Quoted 1 line · Olof Johansson
Acked-by Olof Johansson <[email protected]>
Sorry, should have clarified: Acked if the changes requested by Stephen are done.
-Olof
PATCH v3 3/5 ARM: bcm4760: Add system timer
Quoted 6 lines · Olof Johansson
Quoted 1 line · Olof Johansson
Acked-by Olof Johansson <[email protected]>Sorry, should have clarified: Acked if the changes requested by Stephen are done.
I've already prepared them. Will repost later.
Quoted 3 lines
-Olof
Domenico
PATCH v3 4/5 ARM: bcm4760: Add ripple counter
In reply to Domenico AndreoliAn embedded and charset-unspecified text was scrubbed...
Name: arm-bcm476x-add-ripple-counter.patch
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130815/9bcd1289/attachment.ksh>
PATCH v3 5/5 ARM: bcm4760: Add restart hook
In reply to Domenico AndreoliAn embedded and charset-unspecified text was scrubbed...
Name: arm-bcm476x-add-restart-hook.patch
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130815/47530897/attachment.ksh>
PATCH v3 5/5 ARM: bcm4760: Add restart hook
Hi,
Quoted 3 lines · Domenico Andreoli
From: Domenico Andreoli <[email protected]>
Restart hook implementation for the Broadcom BCM4760 based ARM11 SoCs.
This essentially implements a wdt driver under mach-bcm. It'd be better to contain this under drivers/watchdog and use the reboot notifier to do the restart from there.
-Olof
PATCH v3 5/5 ARM: bcm4760: Add restart hook
Quoted 10 lines · Olof Johansson
Hi,
Quoted 3 lines · Domenico Andreoli
From: Domenico Andreoli <[email protected]>
Restart hook implementation for the Broadcom BCM4760 based ARM11 SoCs.
This essentially implements a wdt driver under mach-bcm. It'd be better to contain this under
drivers/watchdogand use the reboot notifier to do the restart from there.
do I need also a config option? I don't think I need one unless I have also a complete implementation.
Domenico