From 51bf6848bc309f4e1111a756f8800a9586c3e3dd Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Thu, 12 Oct 2017 12:26:52 +0200 Subject: ARM: vexpress: switch to DT probe and multi-image build This switches the VExpress support to use an internal DT, instead of probing the peripherals from a board file. It also switches to a multi-iamge build with both CA9 and CA15 variants of the VExpress board being supported. Signed-off-by: Lucas Stach Signed-off-by: Sascha Hauer --- arch/arm/mach-vexpress/Kconfig | 3 + arch/arm/mach-vexpress/Makefile | 1 - arch/arm/mach-vexpress/devices.c | 83 --------------------------- arch/arm/mach-vexpress/include/mach/devices.h | 9 --- arch/arm/mach-vexpress/v2m.c | 38 ------------ 5 files changed, 3 insertions(+), 131 deletions(-) delete mode 100644 arch/arm/mach-vexpress/devices.c (limited to 'arch/arm/mach-vexpress') diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig index 8253feb2f7..aaa535f073 100644 --- a/arch/arm/mach-vexpress/Kconfig +++ b/arch/arm/mach-vexpress/Kconfig @@ -10,6 +10,9 @@ choice config MACH_VEXPRESS bool "ARM Vexpress" select RELOCATABLE + select HAVE_PBL_MULTI_IMAGES + select OFTREE + select OFDEVICE select COMMON_CLK_OF_PROVIDER endchoice diff --git a/arch/arm/mach-vexpress/Makefile b/arch/arm/mach-vexpress/Makefile index 74b4a0feb2..9a06e648a6 100644 --- a/arch/arm/mach-vexpress/Makefile +++ b/arch/arm/mach-vexpress/Makefile @@ -1,3 +1,2 @@ obj-y += v2m.o -obj-y += devices.o obj-y += reset.o diff --git a/arch/arm/mach-vexpress/devices.c b/arch/arm/mach-vexpress/devices.c deleted file mode 100644 index 5b53011924..0000000000 --- a/arch/arm/mach-vexpress/devices.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD - * - * GPLv2 only - */ - -#include - -#include - -#include - -#include - -void vexpress_a9_legacy_add_ddram(u32 ddr0_size, u32 ddr1_size) -{ - arm_add_mem_device("ram0", 0x60000000, ddr0_size); - - if (ddr1_size) - arm_add_mem_device("ram1", 0x80000000, ddr1_size); -} - -void vexpress_a9_legacy_register_uart(unsigned id) -{ - resource_size_t start; - - switch (id) { - case 0: - start = 0x10009000; - break; - case 1: - start = 0x1000a000; - break; - case 2: - start = 0x1000b000; - break; - case 3: - start = 0x1000c000; - break; - default: - return; - } - amba_apb_device_add(NULL, "uart-pl011", id, start, 4096, NULL, 0); -} - -void vexpress_a9_legacy_register_mmc(struct mmci_platform_data *plat) -{ - amba_apb_device_add(NULL, "mmci-pl18x", DEVICE_ID_SINGLE, 0x10005000, - 4096, plat, 0); -} - -void vexpress_add_ddram(u32 size) -{ - arm_add_mem_device("ram1", 0x80000000, size); -} - -void vexpress_register_uart(unsigned id) -{ - resource_size_t start; - - switch (id) { - case 0: - start = 0x1c090000; - break; - case 1: - start = 0x1c0a0000; - break; - case 2: - start = 0x1c0b0000; - break; - case 3: - start = 0x1c0c0000; - break; - default: - return; - } - amba_apb_device_add(NULL, "uart-pl011", id, start, 4096, NULL, 0); -} - -void vexpress_register_mmc(struct mmci_platform_data *plat) -{ - amba_apb_device_add(NULL, "mmci-pl18x", DEVICE_ID_SINGLE, 0x1c050000, 4096, plat, 0); -} diff --git a/arch/arm/mach-vexpress/include/mach/devices.h b/arch/arm/mach-vexpress/include/mach/devices.h index 96d1400501..bef8c8b94f 100644 --- a/arch/arm/mach-vexpress/include/mach/devices.h +++ b/arch/arm/mach-vexpress/include/mach/devices.h @@ -9,18 +9,9 @@ #include -void vexpress_a9_legacy_add_ddram(u32 ddr0_size, u32 ddr1_size); -void vexpress_add_ddram(u32 size); - -void vexpress_a9_legacy_register_uart(unsigned id); -void vexpress_register_uart(unsigned id); - void vexpress_a9_legacy_init(void); void vexpress_init(void); -void vexpress_a9_legacy_register_mmc(struct mmci_platform_data *plat); -void vexpress_register_mmc(struct mmci_platform_data *plat); - extern void *v2m_wdt_base; extern void *v2m_sysreg_base; diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c index 025bbb17fc..3535262848 100644 --- a/arch/arm/mach-vexpress/v2m.c +++ b/arch/arm/mach-vexpress/v2m.c @@ -19,31 +19,6 @@ void __iomem *v2m_sysreg_base; -static const char *v2m_osc2_periphs[] = { - "mb:mmci", "mmci-pl18x", /* PL180 MMCI */ - "mb:uart0", "uart-pl0110", /* PL011 UART0 */ - "mb:uart1", "uart-pl0111", /* PL011 UART1 */ - "mb:uart2", "uart-pl0112", /* PL011 UART2 */ - "mb:uart3", "uart-pl0113", /* PL011 UART3 */ -}; - -static void v2m_clk_init(void) -{ - struct clk *clk; - int i; - - clk = clk_fixed("dummy_apb_pclk", 0); - clk_register_clkdev(clk, "apb_pclk", NULL); - - clk = clk_fixed("mb:sp804_clk", 1000000); - clk_register_clkdev(clk, NULL, "sp804"); - - clk = clk_fixed("mb:osc2", 24000000); - for (i = 0; i < ARRAY_SIZE(v2m_osc2_periphs); i++) - clk_register_clkdev(clk, NULL, v2m_osc2_periphs[i]); - -} - static void v2m_sysctl_init(void __iomem *base) { u32 scctrl; @@ -58,21 +33,11 @@ static void v2m_sysctl_init(void __iomem *base) writel(scctrl, base + SCCTRL); } -static void __init v2m_sp804_init(void __iomem *base) -{ - writel(0, base + TIMER_1_BASE + TIMER_CTRL); - - amba_apb_device_add(NULL, "sp804", DEVICE_ID_SINGLE, (resource_size_t)base, 4096, NULL, 0); -} - void vexpress_a9_legacy_init(void) { v2m_wdt_base = IOMEM(0x1000f000); v2m_sysreg_base = IOMEM(0x10001000); v2m_sysctl_init(IOMEM(0x10001000)); - v2m_clk_init(); - - v2m_sp804_init(IOMEM(0x10011000)); } void vexpress_init(void) @@ -80,7 +45,4 @@ void vexpress_init(void) v2m_wdt_base = IOMEM(0x1c0f0000); v2m_sysreg_base = IOMEM(0x1c020000); v2m_sysctl_init(IOMEM(0x1c020000)); - v2m_clk_init(); - - v2m_sp804_init(IOMEM(0x1c110000)); } -- cgit v1.2.3