Message ID | 1354914392-9634-6-git-send-email-catalin.marinas@arm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Friday 07 December 2012, Catalin Marinas wrote: > diff --git a/arch/arm64/platforms/Kconfig b/arch/arm64/platforms/Kconfig > index e69de29..3533d71 100644 > --- a/arch/arm64/platforms/Kconfig > +++ b/arch/arm64/platforms/Kconfig > @@ -0,0 +1,11 @@ > +config ARCH_VEXPRESS > + bool "ARMv8 software model (Versatile Express)" > + select ARCH_REQUIRE_GPIOLIB > + select ARM_AMBA > + select ARM_GIC > + select COMMON_CLK_VERSATILE > + select GENERIC_GPIO > + select VEXPRESS_CONFIG I would expect that we can always select ARCH_REQUIRE_GPIOLIB, ARM_AMBA, ARM_GIC and GENERIC_GPIO for ARM64. Do you expect to see systems that don't have all of those? > diff --git a/arch/arm6 > +static const char *vexpress_dt_match[] __initdata = { > + "arm,vexpress", > + NULL, > +}; > + > +static int __init vexpress_init(void) > +{ > + if (!of_flat_dt_match(of_get_flat_dt_root(), vexpress_dt_match)) > + return 0; > + > + vexpress_sysreg_of_early_init(); > + vexpress_clk_of_init(); > + > + return 0; > +} > +arch_initcall(vexpress_init); I think it would be more appropriate for these two to check the presence of the individual devices, and move the caller into the actual device driver, rather than checking for the root node of the device tree. There may be cases where we want to check the root node, but both the clock setup and the sysreg should both be detectable. Arnd
On Tue, Dec 11, 2012 at 03:41:15PM +0000, Arnd Bergmann wrote: > On Friday 07 December 2012, Catalin Marinas wrote: > > diff --git a/arch/arm64/platforms/Kconfig b/arch/arm64/platforms/Kconfig > > index e69de29..3533d71 100644 > > --- a/arch/arm64/platforms/Kconfig > > +++ b/arch/arm64/platforms/Kconfig > > @@ -0,0 +1,11 @@ > > +config ARCH_VEXPRESS > > + bool "ARMv8 software model (Versatile Express)" > > + select ARCH_REQUIRE_GPIOLIB > > + select ARM_AMBA > > + select ARM_GIC > > + select COMMON_CLK_VERSATILE > > + select GENERIC_GPIO > > + select VEXPRESS_CONFIG > > I would expect that we can always select ARCH_REQUIRE_GPIOLIB, ARM_AMBA, > ARM_GIC and GENERIC_GPIO for ARM64. Do you expect to see systems that > don't have all of those? I'm not entirely sure about ARM_AMBA though we can probably leave it on. As for the GIC, that's GICv2 and we'll get a new version with a new driver (too different to share the same code). So we can either select all GICs or allow interrupt controllers to be selectable but I only see this useful if we don't have any ARCH_* Kconfig entries, just defconfigs for various platforms. The latter would be nice but current vexpress support defines ARCH_VEXPRESS under arch/arm/. > > diff --git a/arch/arm6 > > +static const char *vexpress_dt_match[] __initdata = { > > + "arm,vexpress", > > + NULL, > > +}; > > + > > +static int __init vexpress_init(void) > > +{ > > + if (!of_flat_dt_match(of_get_flat_dt_root(), vexpress_dt_match)) > > + return 0; > > + > > + vexpress_sysreg_of_early_init(); > > + vexpress_clk_of_init(); > > + > > + return 0; > > +} > > +arch_initcall(vexpress_init); > > I think it would be more appropriate for these two to check the presence of > the individual devices, and move the caller into the actual device driver, > rather than checking for the root node of the device tree. > > There may be cases where we want to check the root node, but both the clock > setup and the sysreg should both be detectable. I cc'ed Pawel as well since it's touching his code. We've been through several versions internally and didn't find a clear winner. Currently, vexpress_clk_of_init() requires vexpress_sysreg_of_early_init() to be called first. Pawel has a patch to allow sysreg self-initialisation when called from vexpress_clk_of_init(). This leaves us with a way to call vexpress_clk_of_init() directly from clk-vexpress.c. There are two ways: 1. arch_initcall() in clk-vexpress.c, checking for the DT match. 2. driver registration (arch_initcall) and later probing when of_platform_populate() is called from the arch/arm64 code. The 2nd option above relies on the DT order since the clocks must be registered before any AMBA device is registered, so I'm not too keen. This leaves us with option 1 or any other suggestion you may have.
On Tue, Dec 11, 2012 at 04:39:32PM +0000, Catalin Marinas wrote: > On Tue, Dec 11, 2012 at 03:41:15PM +0000, Arnd Bergmann wrote: > > On Friday 07 December 2012, Catalin Marinas wrote: > > > diff --git a/arch/arm6 > > > +static const char *vexpress_dt_match[] __initdata = { > > > + "arm,vexpress", > > > + NULL, > > > +}; > > > + > > > +static int __init vexpress_init(void) > > > +{ > > > + if (!of_flat_dt_match(of_get_flat_dt_root(), vexpress_dt_match)) > > > + return 0; > > > + > > > + vexpress_sysreg_of_early_init(); > > > + vexpress_clk_of_init(); > > > + > > > + return 0; > > > +} > > > +arch_initcall(vexpress_init); > > > > I think it would be more appropriate for these two to check the presence of > > the individual devices, and move the caller into the actual device driver, > > rather than checking for the root node of the device tree. > > > > There may be cases where we want to check the root node, but both the clock > > setup and the sysreg should both be detectable. > > I cc'ed Pawel as well since it's touching his code. We've been through > several versions internally and didn't find a clear winner. Currently, > vexpress_clk_of_init() requires vexpress_sysreg_of_early_init() to be > called first. Pawel has a patch to allow sysreg self-initialisation when > called from vexpress_clk_of_init(). > > This leaves us with a way to call vexpress_clk_of_init() directly from > clk-vexpress.c. There are two ways: > > 1. arch_initcall() in clk-vexpress.c, checking for the DT match. > 2. driver registration (arch_initcall) and later probing when > of_platform_populate() is called from the arch/arm64 code. After some more thinking, none of these would work for arch/arm since vexpress_clk_of_init() is called very early via the time_init() ... v2m_dt_timer_init(). On arm64 we rely on the architected timers to be always present but this assumption is not valid on arm where clocks would need to be initialised early. While I'd really like to get rid of the SoC code in arch/arm64, the best place I see for the vexpress_clk_of_init() call is still the arch code (unless we add #ifdefs in the clk-vexpress.c code).
On Tuesday 18 December 2012, Catalin Marinas wrote: > After some more thinking, none of these would work for arch/arm since > vexpress_clk_of_init() is called very early via the time_init() ... > v2m_dt_timer_init(). On arm64 we rely on the architected timers to be > always present but this assumption is not valid on arm where clocks > would need to be initialised early. > > While I'd really like to get rid of the SoC code in arch/arm64, the best > place I see for the vexpress_clk_of_init() call is still the arch code > (unless we add #ifdefs in the clk-vexpress.c code). I think I'd prefer the #ifdef in this case. Ideally, we would get rid of most of the early init functions in ARM as well, but that is a different battle for now. Getting the arch/arm64 to look nice IMHO is more important in this case, and we can fix the 32 bit version later. Arnd
On Tue, 2012-12-18 at 17:59 +0000, Arnd Bergmann wrote: > On Tuesday 18 December 2012, Catalin Marinas wrote: > > After some more thinking, none of these would work for arch/arm since > > vexpress_clk_of_init() is called very early via the time_init() ... > > v2m_dt_timer_init(). On arm64 we rely on the architected timers to be > > always present but this assumption is not valid on arm where clocks > > would need to be initialised early. > > > > While I'd really like to get rid of the SoC code in arch/arm64, the best > > place I see for the vexpress_clk_of_init() call is still the arch code > > (unless we add #ifdefs in the clk-vexpress.c code). > > I think I'd prefer the #ifdef in this case. Ideally, we would get rid > of most of the early init functions in ARM as well, but that is > a different battle for now. Getting the arch/arm64 to look nice > IMHO is more important in this case, and we can fix the 32 bit > version later. I'm sure we'll be able to make the vexpress_clk_* functions behave correctly, either with a help of #ifdef or in some other way - don't concern yourself with this detail. The bigger fish to fry is the generic initialization of the clocks (as in: when to call the of_clk_init() and how to gather all possible of_match-es)... Pawe?
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index e58a35a..d66a444 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -91,6 +91,9 @@ config SWIOTLB config IOMMU_HELPER def_bool SWIOTLB +config GENERIC_GPIO + bool + source "init/Kconfig" source "kernel/Kconfig.freezer" diff --git a/arch/arm64/configs/vexpress_defconfig b/arch/arm64/configs/vexpress_defconfig new file mode 100644 index 0000000..c1ee86d --- /dev/null +++ b/arch/arm64/configs/vexpress_defconfig @@ -0,0 +1,90 @@ +# CONFIG_LOCALVERSION_AUTO is not set +# CONFIG_SWAP is not set +CONFIG_SYSVIPC=y +CONFIG_POSIX_MQUEUE=y +CONFIG_NO_HZ=y +CONFIG_HIGH_RES_TIMERS=y +CONFIG_BSD_PROCESS_ACCT=y +CONFIG_BSD_PROCESS_ACCT_V3=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_UTS_NS is not set +# CONFIG_IPC_NS is not set +# CONFIG_PID_NS is not set +# CONFIG_NET_NS is not set +CONFIG_SCHED_AUTOGROUP=y +CONFIG_BLK_DEV_INITRD=y +CONFIG_KALLSYMS_ALL=y +# CONFIG_COMPAT_BRK is not set +CONFIG_PROFILING=y +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_BLK_DEV_BSG is not set +# CONFIG_IOSCHED_DEADLINE is not set +CONFIG_ARCH_VEXPRESS=y +CONFIG_SMP=y +CONFIG_PREEMPT_VOLUNTARY=y +CONFIG_CMDLINE="console=ttyAMA0" +# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set +CONFIG_COMPAT=y +CONFIG_NET=y +CONFIG_PACKET=y +CONFIG_UNIX=y +CONFIG_INET=y +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +CONFIG_IP_PNP_BOOTP=y +# CONFIG_INET_LRO is not set +# CONFIG_IPV6 is not set +# CONFIG_WIRELESS is not set +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" +CONFIG_DEVTMPFS=y +# CONFIG_BLK_DEV is not set +CONFIG_SCSI=y +# CONFIG_SCSI_PROC_FS is not set +CONFIG_BLK_DEV_SD=y +# CONFIG_SCSI_LOWLEVEL is not set +CONFIG_NETDEVICES=y +# CONFIG_NET_CADENCE is not set +CONFIG_SMC91X=y +# CONFIG_WLAN is not set +CONFIG_INPUT_EVDEV=y +# CONFIG_SERIO_I8042 is not set +# CONFIG_SERIO_SERPORT is not set +CONFIG_SERIO_AMBAKMI=y +CONFIG_LEGACY_PTY_COUNT=16 +CONFIG_SERIAL_AMBA_PL011=y +CONFIG_SERIAL_AMBA_PL011_CONSOLE=y +# CONFIG_HW_RANDOM is not set +# CONFIG_HWMON is not set +CONFIG_FB=y +# CONFIG_VGA_CONSOLE is not set +CONFIG_FRAMEBUFFER_CONSOLE=y +CONFIG_LOGO=y +# CONFIG_LOGO_LINUX_MONO is not set +# CONFIG_LOGO_LINUX_VGA16 is not set +# CONFIG_USB_SUPPORT is not set +# CONFIG_IOMMU_SUPPORT is not set +CONFIG_EXT2_FS=y +CONFIG_EXT3_FS=y +# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set +# CONFIG_EXT3_FS_XATTR is not set +CONFIG_FUSE_FS=y +CONFIG_CUSE=y +CONFIG_VFAT_FS=y +CONFIG_TMPFS=y +# CONFIG_MISC_FILESYSTEMS is not set +CONFIG_NFS_FS=y +CONFIG_ROOT_NFS=y +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_ISO8859_1=y +CONFIG_MAGIC_SYSRQ=y +CONFIG_DEBUG_FS=y +CONFIG_DEBUG_KERNEL=y +# CONFIG_SCHED_DEBUG is not set +CONFIG_DEBUG_INFO=y +CONFIG_RCU_CPU_STALL_TIMEOUT=60 +# CONFIG_FTRACE is not set +CONFIG_ATOMIC64_SELFTEST=y +CONFIG_DEBUG_ERRORS=y diff --git a/arch/arm64/platforms/Kconfig b/arch/arm64/platforms/Kconfig index e69de29..3533d71 100644 --- a/arch/arm64/platforms/Kconfig +++ b/arch/arm64/platforms/Kconfig @@ -0,0 +1,11 @@ +config ARCH_VEXPRESS + bool "ARMv8 software model (Versatile Express)" + select ARCH_REQUIRE_GPIOLIB + select ARM_AMBA + select ARM_GIC + select COMMON_CLK_VERSATILE + select GENERIC_GPIO + select VEXPRESS_CONFIG + help + This enables support for the ARMv8 software model (Versatile + Express). diff --git a/arch/arm64/platforms/Makefile b/arch/arm64/platforms/Makefile index e69de29..2e3fcba 100644 --- a/arch/arm64/platforms/Makefile +++ b/arch/arm64/platforms/Makefile @@ -0,0 +1 @@ +obj-$(CONFIG_ARCH_VEXPRESS) := vexpress.o diff --git a/arch/arm64/platforms/vexpress.c b/arch/arm64/platforms/vexpress.c new file mode 100644 index 0000000..a484aac --- /dev/null +++ b/arch/arm64/platforms/vexpress.c @@ -0,0 +1,38 @@ +/* + * ARMv8 software model (Versatile Express) support + * + * Copyright (C) 2012 ARM Ltd. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include <linux/init.h> +#include <linux/of_fdt.h> +#include <linux/vexpress.h> + +static const char *vexpress_dt_match[] __initdata = { + "arm,vexpress", + NULL, +}; + +static int __init vexpress_init(void) +{ + if (!of_flat_dt_match(of_get_flat_dt_root(), vexpress_dt_match)) + return 0; + + vexpress_sysreg_of_early_init(); + vexpress_clk_of_init(); + + return 0; +} +arch_initcall(vexpress_init); diff --git a/drivers/net/ethernet/smsc/Kconfig b/drivers/net/ethernet/smsc/Kconfig index 5a689af..bb4c167 100644 --- a/drivers/net/ethernet/smsc/Kconfig +++ b/drivers/net/ethernet/smsc/Kconfig @@ -5,7 +5,7 @@ config NET_VENDOR_SMSC bool "SMC (SMSC)/Western Digital devices" default y - depends on ARM || ISA || MAC || ARM || MIPS || M32R || SUPERH || \ + depends on ARM || ISA || MAC || ARM64 || MIPS || M32R || SUPERH || \ BLACKFIN || MN10300 || COLDFIRE || PCI || PCMCIA ---help--- If you have a network (Ethernet) card belonging to this class, say Y @@ -40,7 +40,7 @@ config SMC91X select NET_CORE select MII depends on (ARM || M32R || SUPERH || MIPS || BLACKFIN || \ - MN10300 || COLDFIRE) + MN10300 || COLDFIRE || ARM64) ---help--- This is a driver for SMC's 91x series of Ethernet chipsets, including the SMC91C94 and the SMC91C111. Say Y if you want it
This patch introduces support for the ARMv8 software model (Versatile Express platform). The aim is to reduce the SoC code to a single file and pass the driver specific data in FDT. Single kernel Image file for multiple SoCs is mandatory. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> --- arch/arm64/Kconfig | 3 ++ arch/arm64/configs/vexpress_defconfig | 90 +++++++++++++++++++++++++++++++++++ arch/arm64/platforms/Kconfig | 11 +++++ arch/arm64/platforms/Makefile | 1 + arch/arm64/platforms/vexpress.c | 38 +++++++++++++++ drivers/net/ethernet/smsc/Kconfig | 4 +- 6 files changed, 145 insertions(+), 2 deletions(-) create mode 100644 arch/arm64/configs/vexpress_defconfig create mode 100644 arch/arm64/platforms/vexpress.c