diff options
| author | Olof Johansson <olof@lixom.net> | 2012-12-14 16:16:07 -0500 |
|---|---|---|
| committer | Olof Johansson <olof@lixom.net> | 2012-12-14 16:17:01 -0500 |
| commit | c91321e8ff338a88a9272dcd938f085955cd5846 (patch) | |
| tree | 3285fcdc17b2275555ad28747364eae6c4aa2e11 | |
| parent | 1f1ba836455b94494aaee9381ed9197ade2f770f (diff) | |
| parent | 9560f840f301868b4b4b175e81afa96dc57611ac (diff) | |
ARM: arm-soc: Merge branch 'next/smp' into next/soc2
Merging in the smp-on-socfpga branch into soc2 since the topics are similar
and it's a short branch in the first place.
* next/smp:
ARM: socfpga: mark secondary_trampoline as cpuinit
socfpga: map uart into virtual address space so that early_printk() works
ARM: socfpga: fix build break for allyesconfig
ARM: socfpga: Enable SMP for socfpga
Signed-off-by: Olof Johansson <olof@lixom.net>
| -rw-r--r-- | Documentation/devicetree/bindings/arm/altera/socfpga-reset.txt | 11 | ||||
| -rw-r--r-- | Documentation/devicetree/bindings/arm/altera/socfpga-system.txt | 11 | ||||
| -rw-r--r-- | arch/arm/boot/dts/socfpga.dtsi | 10 | ||||
| -rw-r--r-- | arch/arm/configs/socfpga_defconfig | 3 | ||||
| -rw-r--r-- | arch/arm/mach-socfpga/Kconfig | 1 | ||||
| -rw-r--r-- | arch/arm/mach-socfpga/Makefile | 1 | ||||
| -rw-r--r-- | arch/arm/mach-socfpga/core.h | 34 | ||||
| -rw-r--r-- | arch/arm/mach-socfpga/headsmp.S | 25 | ||||
| -rw-r--r-- | arch/arm/mach-socfpga/platsmp.c | 116 | ||||
| -rw-r--r-- | arch/arm/mach-socfpga/socfpga.c | 54 |
10 files changed, 264 insertions, 2 deletions
diff --git a/Documentation/devicetree/bindings/arm/altera/socfpga-reset.txt b/Documentation/devicetree/bindings/arm/altera/socfpga-reset.txt new file mode 100644 index 000000000000..ecdb57d69dbf --- /dev/null +++ b/Documentation/devicetree/bindings/arm/altera/socfpga-reset.txt | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | Altera SOCFPGA Reset Manager | ||
| 2 | |||
| 3 | Required properties: | ||
| 4 | - compatible : "altr,rst-mgr" | ||
| 5 | - reg : Should contain 1 register ranges(address and length) | ||
| 6 | |||
| 7 | Example: | ||
| 8 | rstmgr@ffd05000 { | ||
| 9 | compatible = "altr,rst-mgr"; | ||
| 10 | reg = <0xffd05000 0x1000>; | ||
| 11 | }; | ||
diff --git a/Documentation/devicetree/bindings/arm/altera/socfpga-system.txt b/Documentation/devicetree/bindings/arm/altera/socfpga-system.txt new file mode 100644 index 000000000000..07c65e3cdcbe --- /dev/null +++ b/Documentation/devicetree/bindings/arm/altera/socfpga-system.txt | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | Altera SOCFPGA System Manager | ||
| 2 | |||
| 3 | Required properties: | ||
| 4 | - compatible : "altr,sys-mgr" | ||
| 5 | - reg : Should contain 1 register ranges(address and length) | ||
| 6 | |||
| 7 | Example: | ||
| 8 | sysmgr@ffd08000 { | ||
| 9 | compatible = "altr,sys-mgr"; | ||
| 10 | reg = <0xffd08000 0x1000>; | ||
| 11 | }; | ||
diff --git a/arch/arm/boot/dts/socfpga.dtsi b/arch/arm/boot/dts/socfpga.dtsi index 0772f5739f59..19aec421bb26 100644 --- a/arch/arm/boot/dts/socfpga.dtsi +++ b/arch/arm/boot/dts/socfpga.dtsi | |||
| @@ -143,5 +143,15 @@ | |||
| 143 | reg-shift = <2>; | 143 | reg-shift = <2>; |
| 144 | reg-io-width = <4>; | 144 | reg-io-width = <4>; |
| 145 | }; | 145 | }; |
| 146 | |||
| 147 | rstmgr@ffd05000 { | ||
| 148 | compatible = "altr,rst-mgr"; | ||
| 149 | reg = <0xffd05000 0x1000>; | ||
| 150 | }; | ||
| 151 | |||
| 152 | sysmgr@ffd08000 { | ||
| 153 | compatible = "altr,sys-mgr"; | ||
| 154 | reg = <0xffd08000 0x4000>; | ||
| 155 | }; | ||
| 146 | }; | 156 | }; |
| 147 | }; | 157 | }; |
diff --git a/arch/arm/configs/socfpga_defconfig b/arch/arm/configs/socfpga_defconfig index 0ac1293dba10..4e1ce211d43f 100644 --- a/arch/arm/configs/socfpga_defconfig +++ b/arch/arm/configs/socfpga_defconfig | |||
| @@ -18,9 +18,10 @@ CONFIG_MODULE_UNLOAD=y | |||
| 18 | CONFIG_ARCH_SOCFPGA=y | 18 | CONFIG_ARCH_SOCFPGA=y |
| 19 | CONFIG_MACH_SOCFPGA_CYCLONE5=y | 19 | CONFIG_MACH_SOCFPGA_CYCLONE5=y |
| 20 | CONFIG_ARM_THUMBEE=y | 20 | CONFIG_ARM_THUMBEE=y |
| 21 | # CONFIG_ARCH_VEXPRESS_CORTEX_A5_A9_ERRATA is not set | ||
| 21 | # CONFIG_CACHE_L2X0 is not set | 22 | # CONFIG_CACHE_L2X0 is not set |
| 22 | CONFIG_HIGH_RES_TIMERS=y | 23 | CONFIG_HIGH_RES_TIMERS=y |
| 23 | CONFIG_VMSPLIT_2G=y | 24 | CONFIG_SMP=y |
| 24 | CONFIG_NR_CPUS=2 | 25 | CONFIG_NR_CPUS=2 |
| 25 | CONFIG_AEABI=y | 26 | CONFIG_AEABI=y |
| 26 | CONFIG_ZBOOT_ROM_TEXT=0x0 | 27 | CONFIG_ZBOOT_ROM_TEXT=0x0 |
diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-socfpga/Kconfig index 803a3281feb5..566e804d4036 100644 --- a/arch/arm/mach-socfpga/Kconfig +++ b/arch/arm/mach-socfpga/Kconfig | |||
| @@ -12,5 +12,6 @@ config ARCH_SOCFPGA | |||
| 12 | select GENERIC_CLOCKEVENTS | 12 | select GENERIC_CLOCKEVENTS |
| 13 | select GPIO_PL061 if GPIOLIB | 13 | select GPIO_PL061 if GPIOLIB |
| 14 | select HAVE_ARM_SCU | 14 | select HAVE_ARM_SCU |
| 15 | select HAVE_SMP | ||
| 15 | select SPARSE_IRQ | 16 | select SPARSE_IRQ |
| 16 | select USE_OF | 17 | select USE_OF |
diff --git a/arch/arm/mach-socfpga/Makefile b/arch/arm/mach-socfpga/Makefile index 4fb93240971d..6dd7a93a90fe 100644 --- a/arch/arm/mach-socfpga/Makefile +++ b/arch/arm/mach-socfpga/Makefile | |||
| @@ -3,3 +3,4 @@ | |||
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | obj-y := socfpga.o | 5 | obj-y := socfpga.o |
| 6 | obj-$(CONFIG_SMP) += headsmp.o platsmp.o | ||
diff --git a/arch/arm/mach-socfpga/core.h b/arch/arm/mach-socfpga/core.h new file mode 100644 index 000000000000..9941caa94931 --- /dev/null +++ b/arch/arm/mach-socfpga/core.h | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2012 Pavel Machek <pavel@denx.de> | ||
| 3 | * Copyright (C) 2012 Altera Corporation | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation; either version 2 of the License, or | ||
| 8 | * (at your option) any later version. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with this program; if not, write to the Free Software | ||
| 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 18 | */ | ||
| 19 | |||
| 20 | #ifndef __MACH_CORE_H | ||
| 21 | #define __MACH_CORE_H | ||
| 22 | |||
| 23 | extern void secondary_startup(void); | ||
| 24 | extern void __iomem *socfpga_scu_base_addr; | ||
| 25 | |||
| 26 | extern void socfpga_init_clocks(void); | ||
| 27 | extern void socfpga_sysmgr_init(void); | ||
| 28 | |||
| 29 | extern struct smp_operations socfpga_smp_ops; | ||
| 30 | extern char secondary_trampoline, secondary_trampoline_end; | ||
| 31 | |||
| 32 | #define SOCFPGA_SCU_VIRT_BASE 0xfffec000 | ||
| 33 | |||
| 34 | #endif | ||
diff --git a/arch/arm/mach-socfpga/headsmp.S b/arch/arm/mach-socfpga/headsmp.S new file mode 100644 index 000000000000..f09b1283ffca --- /dev/null +++ b/arch/arm/mach-socfpga/headsmp.S | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2003 ARM Limited | ||
| 3 | * Copyright (c) u-boot contributors | ||
| 4 | * Copyright (c) 2012 Pavel Machek <pavel@denx.de> | ||
| 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 | #include <linux/linkage.h> | ||
| 11 | #include <linux/init.h> | ||
| 12 | |||
| 13 | __CPUINIT | ||
| 14 | .arch armv7-a | ||
| 15 | |||
| 16 | #define CPU1_START_ADDR 0xffd08010 | ||
| 17 | |||
| 18 | ENTRY(secondary_trampoline) | ||
| 19 | movw r0, #:lower16:CPU1_START_ADDR | ||
| 20 | movt r0, #:upper16:CPU1_START_ADDR | ||
| 21 | |||
| 22 | ldr r1, [r0] | ||
| 23 | bx r1 | ||
| 24 | |||
| 25 | ENTRY(secondary_trampoline_end) | ||
diff --git a/arch/arm/mach-socfpga/platsmp.c b/arch/arm/mach-socfpga/platsmp.c new file mode 100644 index 000000000000..68dd1b69512a --- /dev/null +++ b/arch/arm/mach-socfpga/platsmp.c | |||
| @@ -0,0 +1,116 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2010-2011 Calxeda, Inc. | ||
| 3 | * Copyright 2012 Pavel Machek <pavel@denx.de> | ||
| 4 | * Based on platsmp.c, Copyright (C) 2002 ARM Ltd. | ||
| 5 | * Copyright (C) 2012 Altera Corporation | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify it | ||
| 8 | * under the terms and conditions of the GNU General Public License, | ||
| 9 | * version 2, as published by the Free Software Foundation. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 14 | * more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License along with | ||
| 17 | * this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 18 | */ | ||
| 19 | #include <linux/delay.h> | ||
| 20 | #include <linux/init.h> | ||
| 21 | #include <linux/smp.h> | ||
| 22 | #include <linux/io.h> | ||
| 23 | #include <linux/of.h> | ||
| 24 | #include <linux/of_address.h> | ||
| 25 | |||
| 26 | #include <asm/cacheflush.h> | ||
| 27 | #include <asm/hardware/gic.h> | ||
| 28 | #include <asm/smp_scu.h> | ||
| 29 | #include <asm/smp_plat.h> | ||
| 30 | |||
