Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: Add platform support for LSI AXM55xx SoC

The AXM55xx family consists of devices that may contain up to 16 ARM Cortex-A15
cores (in a 4x4 cluster configuration). The cores within each cluster share an
L2 cache, and the clusters are connected to each other via a CCN-504 cache
coherent interconnect.

This machine requires CONFIG_ARM_LPAE enabled as all peripherals are located
above 4GB in the memory map.

Signed-off-by: Anders Berg <anders.berg@lsi.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

authored by

Anders Berg and committed by
Arnd Bergmann
1d22924e a798c10f

+187
+12
Documentation/devicetree/bindings/arm/axxia.txt
··· 1 + Axxia AXM55xx device tree bindings 2 + 3 + Boards using the AXM55xx SoC need to have the following properties: 4 + 5 + Required root node property: 6 + 7 + - compatible = "lsi,axm5516" 8 + 9 + Boards: 10 + 11 + LSI AXM5516 Validation board (Amarillo) 12 + compatible = "lsi,axm5516-amarillo", "lsi,axm5516"
+2
arch/arm/Kconfig
··· 950 950 951 951 source "arch/arm/mach-at91/Kconfig" 952 952 953 + source "arch/arm/mach-axxia/Kconfig" 954 + 953 955 source "arch/arm/mach-bcm/Kconfig" 954 956 955 957 source "arch/arm/mach-berlin/Kconfig"
+2
arch/arm/Makefile
··· 138 138 textofs-$(CONFIG_ARCH_MSM7X30) := 0x00208000 139 139 textofs-$(CONFIG_ARCH_MSM8X60) := 0x00208000 140 140 textofs-$(CONFIG_ARCH_MSM8960) := 0x00208000 141 + textofs-$(CONFIG_ARCH_AXXIA) := 0x00308000 141 142 142 143 # Machine directory name. This list is sorted alphanumerically 143 144 # by CONFIG_* macro name. 144 145 machine-$(CONFIG_ARCH_AT91) += at91 146 + machine-$(CONFIG_ARCH_AXXIA) += axxia 145 147 machine-$(CONFIG_ARCH_BCM) += bcm 146 148 machine-$(CONFIG_ARCH_BERLIN) += berlin 147 149 machine-$(CONFIG_ARCH_CLPS711X) += clps711x
+16
arch/arm/mach-axxia/Kconfig
··· 1 + config ARCH_AXXIA 2 + bool "LSI Axxia platforms" if (ARCH_MULTI_V7 && ARM_LPAE) 3 + select ARCH_DMA_ADDR_T_64BIT 4 + select ARM_AMBA 5 + select ARM_GIC 6 + select ARM_TIMER_SP804 7 + select HAVE_ARM_ARCH_TIMER 8 + select MFD_SYSCON 9 + select MIGHT_HAVE_PCI 10 + select PCI_DOMAINS if PCI 11 + select ZONE_DMA 12 + help 13 + This enables support for the LSI Axxia devices. 14 + 15 + The LSI Axxia platforms require a Flattened Device Tree to be passed 16 + to the kernel.
+2
arch/arm/mach-axxia/Makefile
··· 1 + obj-y += axxia.o 2 + obj-$(CONFIG_SMP) += platsmp.o
+28
arch/arm/mach-axxia/axxia.c
··· 1 + /* 2 + * Support for the LSI Axxia SoC devices based on ARM cores. 3 + * 4 + * Copyright (C) 2012 LSI 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License as published by 8 + * the Free Software Foundation; either version 2 of the License, or 9 + * (at your option) any later version. 10 + * 11 + * This program is distributed in the hope that it will be useful, 12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 + * GNU General Public License for more details. 15 + */ 16 + #include <linux/init.h> 17 + #include <asm/mach/arch.h> 18 + 19 + static const char *axxia_dt_match[] __initconst = { 20 + "lsi,axm5516", 21 + "lsi,axm5516-sim", 22 + "lsi,axm5516-emu", 23 + NULL 24 + }; 25 + 26 + DT_MACHINE_START(AXXIA_DT, "LSI Axxia AXM55XX") 27 + .dt_compat = axxia_dt_match, 28 + MACHINE_END
+89
arch/arm/mach-axxia/platsmp.c
··· 1 + /* 2 + * linux/arch/arm/mach-axxia/platsmp.c 3 + * 4 + * Copyright (C) 2012 LSI Corporation 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License version 2 as 8 + * published by the Free Software Foundation. 9 + */ 10 + 11 + #include <linux/init.h> 12 + #include <linux/io.h> 13 + #include <linux/smp.h> 14 + #include <linux/of.h> 15 + #include <linux/of_address.h> 16 + #include <asm/cacheflush.h> 17 + 18 + /* Syscon register offsets for releasing cores from reset */ 19 + #define SC_CRIT_WRITE_KEY 0x1000 20 + #define SC_RST_CPU_HOLD 0x1010 21 + 22 + /* 23 + * Write the kernel entry point for secondary CPUs to the specified address 24 + */ 25 + static void write_release_addr(u32 release_phys) 26 + { 27 + u32 *virt = (u32 *) phys_to_virt(release_phys); 28 + writel_relaxed(virt_to_phys(secondary_startup), virt); 29 + /* Make sure this store is visible to other CPUs */ 30 + smp_wmb(); 31 + __cpuc_flush_dcache_area(virt, sizeof(u32)); 32 + } 33 + 34 + static int axxia_boot_secondary(unsigned int cpu, struct task_struct *idle) 35 + { 36 + struct device_node *syscon_np; 37 + void __iomem *syscon; 38 + u32 tmp; 39 + 40 + syscon_np = of_find_compatible_node(NULL, NULL, "lsi,axxia-syscon"); 41 + if (!syscon_np) 42 + return -ENOENT; 43 + 44 + syscon = of_iomap(syscon_np, 0); 45 + if (!syscon) 46 + return -ENOMEM; 47 + 48 + tmp = readl(syscon + SC_RST_CPU_HOLD); 49 + writel(0xab, syscon + SC_CRIT_WRITE_KEY); 50 + tmp &= ~(1 << cpu); 51 + writel(tmp, syscon + SC_RST_CPU_HOLD); 52 + 53 + return 0; 54 + } 55 + 56 + static void __init axxia_smp_prepare_cpus(unsigned int max_cpus) 57 + { 58 + int cpu_count = 0; 59 + int cpu; 60 + 61 + /* 62 + * Initialise the present map, which describes the set of CPUs actually 63 + * populated at the present time. 64 + */ 65 + for_each_possible_cpu(cpu) { 66 + struct device_node *np; 67 + u32 release_phys; 68 + 69 + np = of_get_cpu_node(cpu, NULL); 70 + if (!np) 71 + continue; 72 + if (of_property_read_u32(np, "cpu-release-addr", &release_phys)) 73 + continue; 74 + 75 + if (cpu_count < max_cpus) { 76 + set_cpu_present(cpu, true); 77 + cpu_count++; 78 + } 79 + 80 + if (release_phys != 0) 81 + write_release_addr(release_phys); 82 + } 83 + } 84 + 85 + static struct smp_operations axxia_smp_ops __initdata = { 86 + .smp_prepare_cpus = axxia_smp_prepare_cpus, 87 + .smp_boot_secondary = axxia_boot_secondary, 88 + }; 89 + CPU_METHOD_OF_DECLARE(axxia_smp, "lsi,syscon-release", &axxia_smp_ops);
+36
include/dt-bindings/clock/lsi,axm5516-clks.h
··· 1 + /* 2 + * Copyright (c) 2014 LSI Corporation 3 + * 4 + * This software is licensed under the terms of the GNU General Public 5 + * License version 2, as published by the Free Software Foundation, and 6 + * may be copied, distributed, and modified under those terms. 7 + */ 8 + 9 + #ifndef _DT_BINDINGS_CLK_AXM5516_H 10 + #define _DT_BINDINGS_CLK_AXM5516_H 11 + 12 + #define AXXIA_CLK_FAB_PLL 0 13 + #define AXXIA_CLK_CPU_PLL 1 14 + #define AXXIA_CLK_SYS_PLL 2 15 + #define AXXIA_CLK_SM0_PLL 3 16 + #define AXXIA_CLK_SM1_PLL 4 17 + #define AXXIA_CLK_FAB_DIV 5 18 + #define AXXIA_CLK_SYS_DIV 6 19 + #define AXXIA_CLK_NRCP_DIV 7 20 + #define AXXIA_CLK_CPU0_DIV 8 21 + #define AXXIA_CLK_CPU1_DIV 9 22 + #define AXXIA_CLK_CPU2_DIV 10 23 + #define AXXIA_CLK_CPU3_DIV 11 24 + #define AXXIA_CLK_PER_DIV 12 25 + #define AXXIA_CLK_MMC_DIV 13 26 + #define AXXIA_CLK_FAB 14 27 + #define AXXIA_CLK_SYS 15 28 + #define AXXIA_CLK_NRCP 16 29 + #define AXXIA_CLK_CPU0 17 30 + #define AXXIA_CLK_CPU1 18 31 + #define AXXIA_CLK_CPU2 19 32 + #define AXXIA_CLK_CPU3 20 33 + #define AXXIA_CLK_PER 21 34 + #define AXXIA_CLK_MMC 22 35 + 36 + #endif