diff options
author | Arnd Bergmann <arnd@arndb.de> | 2015-12-16 00:02:54 +0100 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2015-12-16 00:56:18 +0100 |
commit | 22ba14f41ca6b7f96fe3d4a8eb116358060595fd (patch) | |
tree | fbc59ebf82556cd604b1946304c61e64c4469caf /arch/arm | |
parent | 7379d96bdabdfb2bf619c174fb6160a9c0a00ca3 (diff) | |
parent | 5420b4b156179ec634d9e42279b6898b85852960 (diff) |
Merge tag 'realview-base-armsoc-1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator into next/multiplatform
Merge "Realview multiplatform support" from Linus Walleij:
The board and infrastructure changes for RealView
multiplatform and extended DT support.
* tag 'realview-base-armsoc-1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator:
ARM: realview: add an DT SMP boot method
ARM: realview: select SP810 and ICST for the DT variant
soc: versatile: add support for the PB11MPCore
clk: versatile-icst: add device tree support
clk: versatile-icst: refactor to allocate regmap separately
clk: versatile-icst: convert to use regmap
ARM: realview: remove private barrier implementation
ARM: no longer force unbuffered DMA for realview
clk/realview: stop using machine headers
ARM: realview: don't map undefined PCI registers
ARM: realview: remove sparsemem hack
Conflicts:
drivers/clk/versatile/Kconfig
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/Kconfig | 2 | ||||
-rw-r--r-- | arch/arm/mach-realview/Kconfig | 11 | ||||
-rw-r--r-- | arch/arm/mach-realview/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-realview/include/mach/barriers.h | 8 | ||||
-rw-r--r-- | arch/arm/mach-realview/include/mach/memory.h | 64 | ||||
-rw-r--r-- | arch/arm/mach-realview/platsmp-dt.c | 91 | ||||
-rw-r--r-- | arch/arm/mach-realview/realview_eb.c | 7 | ||||
-rw-r--r-- | arch/arm/mach-realview/realview_pb11mp.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-realview/realview_pba8.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-realview/realview_pbx.c | 8 | ||||
-rw-r--r-- | arch/arm/mm/Kconfig | 2 |
11 files changed, 111 insertions, 98 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index aebe283a4275..70eb100b56e7 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -241,7 +241,6 @@ config ARM_PATCH_PHYS_VIRT bool "Patch physical to virtual translations at runtime" if EMBEDDED default y depends on !XIP_KERNEL && MMU - depends on !ARCH_REALVIEW || !SPARSEMEM help Patch phys-to-virt and virt-to-phys translation functions at boot and module load time according to the position of the @@ -356,7 +355,6 @@ config ARCH_REALVIEW select GENERIC_CLOCKEVENTS select GPIO_PL061 if GPIOLIB select ICST - select NEED_MACH_MEMORY_H select PLAT_VERSATILE select PLAT_VERSATILE_SCHED_CLOCK help diff --git a/arch/arm/mach-realview/Kconfig b/arch/arm/mach-realview/Kconfig index 565925f37dc5..7316fff0f3ba 100644 --- a/arch/arm/mach-realview/Kconfig +++ b/arch/arm/mach-realview/Kconfig @@ -4,10 +4,14 @@ menu "RealView platform type" config REALVIEW_DT bool "Support RealView(R) Device Tree based boot" select ARM_GIC + select CLK_SP810 + select HAVE_SMP + select ICST select MFD_SYSCON select POWER_RESET select POWER_RESET_VERSATILE select POWER_SUPPLY + select SMP_ON_UP select SOC_REALVIEW select USE_OF help @@ -36,7 +40,6 @@ config REALVIEW_EB_A9MP config REALVIEW_EB_ARM11MP bool "Support ARM11MPCore Tile" depends on MACH_REALVIEW_EB - select ARCH_HAS_BARRIERS if SMP select CPU_V6K select HAVE_ARM_SCU if SMP select HAVE_ARM_TWD if SMP @@ -57,7 +60,6 @@ config REALVIEW_EB_ARM11MP_REVB config MACH_REALVIEW_PB11MP bool "Support RealView(R) Platform Baseboard for ARM11MPCore" - select ARCH_HAS_BARRIERS if SMP select ARM_GIC select CPU_V6K select HAVE_ARM_SCU if SMP @@ -102,14 +104,13 @@ config MACH_REALVIEW_PBA8 config MACH_REALVIEW_PBX bool "Support RealView(R) Platform Baseboard Explore" - select ARCH_SPARSEMEM_ENABLE if CPU_V7 && !REALVIEW_HIGH_PHYS_OFFSET select ARM_GIC select HAVE_ARM_SCU if SMP select HAVE_ARM_TWD if SMP select HAVE_PATA_PLATFORM select HAVE_SMP select MIGHT_HAVE_CACHE_L2X0 - select ZONE_DMA if SPARSEMEM + select ZONE_DMA help Include support for the ARM(R) RealView(R) Platform Baseboard Explore. @@ -124,6 +125,6 @@ config REALVIEW_HIGH_PHYS_OFFSET the board supports 512MB of RAM, this option allows the memory to be accessed contiguously at the high physical offset. On the PBX board, disabling this option allows 1GB of - RAM to be used with SPARSEMEM. + RAM to be used with HIGHMEM. endmenu diff --git a/arch/arm/mach-realview/Makefile b/arch/arm/mach-realview/Makefile index e07fdf7ae8a7..a46fa694cf07 100644 --- a/arch/arm/mach-realview/Makefile +++ b/arch/arm/mach-realview/Makefile @@ -3,7 +3,7 @@ # obj-y := core.o -obj-$(CONFIG_REALVIEW_DT) += realview-dt.o +obj-$(CONFIG_REALVIEW_DT) += realview-dt.o platsmp-dt.o obj-$(CONFIG_MACH_REALVIEW_EB) += realview_eb.o obj-$(CONFIG_MACH_REALVIEW_PB11MP) += realview_pb11mp.o obj-$(CONFIG_MACH_REALVIEW_PB1176) += realview_pb1176.o diff --git a/arch/arm/mach-realview/include/mach/barriers.h b/arch/arm/mach-realview/include/mach/barriers.h deleted file mode 100644 index 9a732195aa1c..000000000000 --- a/arch/arm/mach-realview/include/mach/barriers.h +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Barriers redefined for RealView ARM11MPCore platforms with L220 cache - * controller to work around hardware errata causing the outer_sync() - * operation to deadlock the system. - */ -#define mb() dsb() -#define rmb() dsb() -#define wmb() mb() diff --git a/arch/arm/mach-realview/include/mach/memory.h b/arch/arm/mach-realview/include/mach/memory.h deleted file mode 100644 index 23e7a313f75d..000000000000 --- a/arch/arm/mach-realview/include/mach/memory.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * arch/arm/mach-realview/include/mach/memory.h - * - * Copyright (C) 2003 ARM Limited - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __ASM_ARCH_MEMORY_H -#define __ASM_ARCH_MEMORY_H - -#ifdef CONFIG_SPARSEMEM - -/* - * Sparsemem definitions for RealView PBX. - * - * The RealView PBX board has another block of 512MB of RAM at 0x20000000, - * however only the block at 0x70000000 (or the 256MB mirror at 0x00000000) - * may be used for DMA. - * - * The macros below define a section size of 256MB and a non-linear virtual to - * physical mapping: - * - * 256MB @ 0x00000000 -> PAGE_OFFSET - * 512MB @ 0x20000000 -> PAGE_OFFSET + 0x10000000 - * 256MB @ 0x80000000 -> PAGE_OFFSET + 0x30000000 - */ -#ifdef CONFIG_REALVIEW_HIGH_PHYS_OFFSET -#error "SPARSEMEM not available with REALVIEW_HIGH_PHYS_OFFSET" -#endif - -#define MAX_PHYSMEM_BITS 32 -#define SECTION_SIZE_BITS 28 - -/* bank page offsets */ -#define PAGE_OFFSET1 (PAGE_OFFSET + 0x10000000) -#define PAGE_OFFSET2 (PAGE_OFFSET + 0x30000000) - -#define PHYS_OFFSET PLAT_PHYS_OFFSET - -#define __phys_to_virt(phys) \ - ((phys) >= 0x80000000 ? (phys) - 0x80000000 + PAGE_OFFSET2 : \ - (phys) >= 0x20000000 ? (phys) - 0x20000000 + PAGE_OFFSET1 : \ - (phys) + PAGE_OFFSET) - -#define __virt_to_phys(virt) \ - ((virt) >= PAGE_OFFSET2 ? (virt) - PAGE_OFFSET2 + 0x80000000 : \ - (virt) >= PAGE_OFFSET1 ? (virt) - PAGE_OFFSET1 + 0x20000000 : \ - (virt) - PAGE_OFFSET) - -#endif /* CONFIG_SPARSEMEM */ - -#endif diff --git a/arch/arm/mach-realview/platsmp-dt.c b/arch/arm/mach-realview/platsmp-dt.c new file mode 100644 index 000000000000..65585392655b --- /dev/null +++ b/arch/arm/mach-realview/platsmp-dt.c @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2015 Linus Walleij + * + * 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. + */ +#include <linux/smp.h> +#include <linux/io.h> +#include <linux/of.h> +#include <linux/of_address.h> +#include <linux/regmap.h> +#include <linux/mfd/syscon.h> + +#include <asm/cacheflush.h> +#include <asm/smp_plat.h> +#include <asm/smp_scu.h> + +#include <plat/platsmp.h> + +#include "core.h" + +#define REALVIEW_SYS_FLAGSSET_OFFSET 0x30 + +static const struct of_device_id realview_scu_match[] = { + { .compatible = "arm,arm11mp-scu", }, + { .compatible = "arm,cortex-a9-scu", }, + { .compatible = "arm,cortex-a5-scu", }, + { } +}; + +static const struct of_device_id realview_syscon_match[] = { + { .compatible = "arm,core-module-integrator", }, + { .compatible = "arm,realview-eb-syscon", }, + { .compatible = "arm,realview-pb11mp-syscon", }, + { .compatible = "arm,realview-pbx-syscon", }, + { }, +}; + +static void __init realview_smp_prepare_cpus(unsigned int max_cpus) +{ + struct device_node *np; + void __iomem *scu_base; + struct regmap *map; + unsigned int ncores; + int i; + + np = of_find_matching_node(NULL, realview_scu_match); + if (!np) { + pr_err("PLATSMP: No SCU base address\n"); + return; + } + scu_base = of_iomap(np, 0); + of_node_put(np); + if (!scu_base) { + pr_err("PLATSMP: No SCU remap\n"); + return; + } + + scu_enable(scu_base); + ncores = scu_get_core_count(scu_base); + pr_info("SCU: %d cores detected\n", ncores); + for (i = 0; i < ncores; i++) + set_cpu_possible(i, true); + iounmap(scu_base); + + /* The syscon contains the magic SMP start address registers */ + np = of_find_matching_node(NULL, realview_syscon_match); + if (!np) { + pr_err("PLATSMP: No syscon match\n"); + return; + } + map = syscon_node_to_regmap(np); + if (IS_ERR(map)) { + pr_err("PLATSMP: No syscon regmap\n"); + return; + } + /* Put the boot address in this magic register */ + regmap_write(map, REALVIEW_SYS_FLAGSSET_OFFSET, + virt_to_phys(versatile_secondary_startup)); +} + +struct smp_operations realview_dt_smp_ops __initdata = { + .smp_prepare_cpus = realview_smp_prepare_cpus, + .smp_secondary_init = versatile_secondary_init, + .smp_boot_secondary = versatile_boot_secondary, +#ifdef CONFIG_HOTPLUG_CPU + .cpu_die = realview_cpu_die, +#endif +}; +CPU_METHOD_OF_DECLARE(realview_smp, "arm,realview-smp", &realview_dt_smp_ops); diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c index b3869cbbcc68..1a2a89708fb7 100644 --- a/arch/arm/mach-realview/realview_eb.c +++ b/arch/arm/mach-realview/realview_eb.c @@ -38,6 +38,7 @@ #include <asm/hardware/cache-l2x0.h> #include <asm/smp_twd.h> #include <asm/system_info.h> +#include <asm/outercache.h> #include <asm/mach/arch.h> #include <asm/mach/map.h> @@ -450,6 +451,12 @@ static void __init realview_eb_init(void) * Bits: .... ...0 0111 1001 0000 .... .... .... */ l2x0_init(__io_address(REALVIEW_EB11MP_L220_BASE), 0x00790000, 0xfe000fff); + + /* + * due to a bug in the l220 cache controller, we must not call + * the sync function. stub it out here instead! + */ + outer_cache.sync = NULL; #endif pmu_device.name = core_tile_a9mp() ? "armv7-pmu" : "armv6-pmu"; platform_device_register(&pmu_device); diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c index 15c45e25095f..5bb460300b6a 100644 --- a/arch/arm/mach-realview/realview_pb11mp.c +++ b/arch/arm/mach-realview/realview_pb11mp.c @@ -42,6 +42,7 @@ #include <asm/mach/flash.h> #include <asm/mach/map.h> #include <asm/mach/time.h> +#include <asm/outercache.h> #include <mach/board-pb11mp.h> #include <mach/irqs.h> @@ -345,6 +346,11 @@ static void __init realview_pb11mp_init(void) * Bits: .... ...0 0111 1001 0000 .... .... .... */ l2x0_init(__io_address(REALVIEW_TC11MP_L220_BASE), 0x00790000, 0xfe000fff); + /* + * due to a bug in the l220 cache controller, we must not call + * the sync function. stub it out here instead! + */ + outer_cache.sync = NULL; #endif realview_flash_register(realview_pb11mp_flash_resource, diff --git a/arch/arm/mach-realview/realview_pba8.c b/arch/arm/mach-realview/realview_pba8.c index 4c64662f5437..b3549a637ff0 100644 --- a/arch/arm/mach-realview/realview_pba8.c +++ b/arch/arm/mach-realview/realview_pba8.c @@ -77,14 +77,6 @@ static struct map_desc realview_pba8_io_desc[] __initdata = { .length = SZ_4K, .type = MT_DEVICE, }, -#ifdef CONFIG_PCI - { - .virtual = PCIX_UNIT_BASE, - .pfn = __phys_to_pfn(REALVIEW_PBA8_PCI_BASE), - .length = REALVIEW_PBA8_PCI_BASE_SIZE, - .type = MT_DEVICE - }, -#endif #ifdef CONFIG_DEBUG_LL { .virtual = IO_ADDRESS(REALVIEW_PBA8_UART0_BASE), diff --git a/arch/arm/mach-realview/realview_pbx.c b/arch/arm/mach-realview/realview_pbx.c index 9a22b864219f..f26e1e09f29e 100644 --- a/arch/arm/mach-realview/realview_pbx.c +++ b/arch/arm/mach-realview/realview_pbx.c @@ -79,14 +79,6 @@ static struct map_desc realview_pbx_io_desc[] __initdata = { .length = SZ_4K, .type = MT_DEVICE, }, -#ifdef CONFIG_PCI - { - .virtual = PCIX_UNIT_BASE, - .pfn = __phys_to_pfn(REALVIEW_PBX_PCI_BASE), - .length = REALVIEW_PBX_PCI_BASE_SIZE, - .type = MT_DEVICE, - }, -#endif #ifdef CONFIG_DEBUG_LL { .virtual = IO_ADDRESS(REALVIEW_PBX_UART0_BASE), diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index 41218867a9a6..76f65f2d59b1 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig @@ -1005,8 +1005,6 @@ config ARM_L1_CACHE_SHIFT config ARM_DMA_MEM_BUFFERABLE bool "Use non-cacheable memory for DMA" if (CPU_V6 || CPU_V6K) && !CPU_V7 - depends on !(MACH_REALVIEW_PB1176 || REALVIEW_EB_ARM11MP || \ - MACH_REALVIEW_PB11MP) default y if CPU_V6 || CPU_V6K || CPU_V7 help Historically, the kernel has used strongly ordered mappings to |