aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-11 14:03:24 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-11 14:03:24 -0400
commit2dc24b0d0636349d403ae803bbad0c84f6c2ea57 (patch)
tree3f2661ad4bf5f497e0d411bfdb2f5e512f936181 /arch
parent2840c566e95599cd60c7143762ca8b49d9395050 (diff)
parentbbea06f3efbae5776e6c285fea59fd249eec44ff (diff)
Merge tag 'soc2-for-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull part two of ARM SoC updates from Arnd Bergmann: "This is a small follow-up to the larger ARM SoC updates merged last week, almost entirely for the keystone platform. The main change here is to use the new dma-ranges parsing code that came in through Russell's ARM tree. This allows the keystone platform to do cache-coherent DMA and to finally support all the available physical memory when LPAE is enabled. Aside from this, the keystone reset driver has been rewritten, and there is a small bug fix to allow building the orion5x platform again" * tag 'soc2-for-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: ARM: keystone: Drop use of meminfo since its not available anymore ARM: orion5x: fix mvebu_mbus_dt_init call ARM: configs: keystone: enable reset driver support ARM: dts: keystone: update reset node to work with reset driver ARM: keystone: remove redundant reset stuff ARM: keystone: Update the dma offset for non-dt platform devices ARM: keystone: Switch over to coherent memory address space ARM: configs: keystone: add MTD_SPI_NOR (new dependency for M25P80) ARM: configs: keystone: drop CONFIG_COMMON_CLK_DEBUG
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/boot/dts/keystone.dtsi14
-rw-r--r--arch/arm/configs/integrator_defconfig1
-rw-r--r--arch/arm/configs/keystone_defconfig5
-rw-r--r--arch/arm/configs/vt8500_v6_v7_defconfig1
-rw-r--r--arch/arm/mach-keystone/keystone.c100
-rw-r--r--arch/arm/mach-keystone/memory.h24
-rw-r--r--arch/arm/mach-keystone/platsmp.c18
-rw-r--r--arch/arm/mach-orion5x/board-dt.c2
8 files changed, 129 insertions, 36 deletions
diff --git a/arch/arm/boot/dts/keystone.dtsi b/arch/arm/boot/dts/keystone.dtsi
index d9f99e7deb83..c1414cb81fd4 100644
--- a/arch/arm/boot/dts/keystone.dtsi
+++ b/arch/arm/boot/dts/keystone.dtsi
@@ -66,9 +66,21 @@
66 ranges = <0x0 0x0 0x0 0xc0000000>; 66 ranges = <0x0 0x0 0x0 0xc0000000>;
67 dma-ranges = <0x80000000 0x8 0x00000000 0x80000000>; 67 dma-ranges = <0x80000000 0x8 0x00000000 0x80000000>;
68 68
69 pllctrl: pll-controller@02310000 {
70 compatible = "ti,keystone-pllctrl", "syscon";
71 reg = <0x02310000 0x200>;
72 };
73
74 devctrl: device-state-control@02620000 {
75 compatible = "ti,keystone-devctrl", "syscon";
76 reg = <0x02620000 0x1000>;
77 };
78
69 rstctrl: reset-controller { 79 rstctrl: reset-controller {
70 compatible = "ti,keystone-reset"; 80 compatible = "ti,keystone-reset";
71 reg = <0x023100e8 4>; /* pll reset control reg */ 81 ti,syscon-pll = <&pllctrl 0xe4>;
82 ti,syscon-dev = <&devctrl 0x328>;
83 ti,wdt-list = <0>;
72 }; 84 };
73 85
74 /include/ "keystone-clocks.dtsi" 86 /include/ "keystone-clocks.dtsi"
diff --git a/arch/arm/configs/integrator_defconfig b/arch/arm/configs/integrator_defconfig
index 5bae19557591..c1f5adc5493e 100644
--- a/arch/arm/configs/integrator_defconfig
+++ b/arch/arm/configs/integrator_defconfig
@@ -73,7 +73,6 @@ CONFIG_LEDS_TRIGGER_HEARTBEAT=y
73CONFIG_LEDS_TRIGGER_CPU=y 73CONFIG_LEDS_TRIGGER_CPU=y
74CONFIG_RTC_CLASS=y 74CONFIG_RTC_CLASS=y
75CONFIG_RTC_DRV_PL030=y 75CONFIG_RTC_DRV_PL030=y
76CONFIG_COMMON_CLK_DEBUG=y
77CONFIG_EXT2_FS=y 76CONFIG_EXT2_FS=y
78CONFIG_VFAT_FS=y 77CONFIG_VFAT_FS=y
79CONFIG_TMPFS=y 78CONFIG_TMPFS=y
diff --git a/arch/arm/configs/keystone_defconfig b/arch/arm/configs/keystone_defconfig
index 095bb52671f6..932ae40fb128 100644
--- a/arch/arm/configs/keystone_defconfig
+++ b/arch/arm/configs/keystone_defconfig
@@ -112,6 +112,7 @@ CONFIG_MTD_PLATRAM=y
112CONFIG_MTD_M25P80=y 112CONFIG_MTD_M25P80=y
113CONFIG_MTD_NAND=y 113CONFIG_MTD_NAND=y
114CONFIG_MTD_NAND_DAVINCI=y 114CONFIG_MTD_NAND_DAVINCI=y
115CONFIG_MTD_SPI_NOR=y
115CONFIG_MTD_UBI=y 116CONFIG_MTD_UBI=y
116CONFIG_PROC_DEVICETREE=y 117CONFIG_PROC_DEVICETREE=y
117CONFIG_BLK_DEV_LOOP=y 118CONFIG_BLK_DEV_LOOP=y
@@ -131,6 +132,9 @@ CONFIG_SPI=y
131CONFIG_SPI_DAVINCI=y 132CONFIG_SPI_DAVINCI=y
132CONFIG_SPI_SPIDEV=y 133CONFIG_SPI_SPIDEV=y
133# CONFIG_HWMON is not set 134# CONFIG_HWMON is not set
135CONFIG_POWER_SUPPLY=y
136CONFIG_POWER_RESET=y
137CONFIG_POWER_RESET_KEYSTONE=y
134CONFIG_WATCHDOG=y 138CONFIG_WATCHDOG=y
135CONFIG_WATCHDOG_CORE=y 139CONFIG_WATCHDOG_CORE=y
136CONFIG_DAVINCI_WATCHDOG=y 140CONFIG_DAVINCI_WATCHDOG=y
@@ -145,7 +149,6 @@ CONFIG_USB_DWC3_VERBOSE=y
145CONFIG_KEYSTONE_USB_PHY=y 149CONFIG_KEYSTONE_USB_PHY=y
146CONFIG_DMADEVICES=y 150CONFIG_DMADEVICES=y
147CONFIG_TI_EDMA=y 151CONFIG_TI_EDMA=y
148CONFIG_COMMON_CLK_DEBUG=y
149CONFIG_MEMORY=y 152CONFIG_MEMORY=y
150CONFIG_TI_AEMIF=y 153CONFIG_TI_AEMIF=y
151CONFIG_EXT4_FS=y 154CONFIG_EXT4_FS=y
diff --git a/arch/arm/configs/vt8500_v6_v7_defconfig b/arch/arm/configs/vt8500_v6_v7_defconfig
index f0520176acd0..9e7a25639690 100644
--- a/arch/arm/configs/vt8500_v6_v7_defconfig
+++ b/arch/arm/configs/vt8500_v6_v7_defconfig
@@ -73,7 +73,6 @@ CONFIG_LEDS_TRIGGERS=y
73CONFIG_RTC_CLASS=y 73CONFIG_RTC_CLASS=y
74CONFIG_RTC_DRV_VT8500=y 74CONFIG_RTC_DRV_VT8500=y
75CONFIG_DMADEVICES=y 75CONFIG_DMADEVICES=y
76CONFIG_COMMON_CLK_DEBUG=y
77# CONFIG_IOMMU_SUPPORT is not set 76# CONFIG_IOMMU_SUPPORT is not set
78CONFIG_PWM=y 77CONFIG_PWM=y
79CONFIG_PWM_VT8500=y 78CONFIG_PWM_VT8500=y
diff --git a/arch/arm/mach-keystone/keystone.c b/arch/arm/mach-keystone/keystone.c
index e0b9e1b9cf30..7f352de26099 100644
--- a/arch/arm/mach-keystone/keystone.c
+++ b/arch/arm/mach-keystone/keystone.c
@@ -14,60 +14,100 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/of_platform.h> 15#include <linux/of_platform.h>
16#include <linux/of_address.h> 16#include <linux/of_address.h>
17#include <linux/memblock.h>
17 18
18#include <asm/setup.h> 19#include <asm/setup.h>
19#include <asm/mach/map.h> 20#include <asm/mach/map.h>
20#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
21#include <asm/mach/time.h> 22#include <asm/mach/time.h>
22#include <asm/smp_plat.h> 23#include <asm/smp_plat.h>
24#include <asm/memory.h>
23 25
24#include "keystone.h" 26#include "memory.h"
25 27
26#define PLL_RESET_WRITE_KEY_MASK 0xffff0000 28#include "keystone.h"
27#define PLL_RESET_WRITE_KEY 0x5a69
28#define PLL_RESET BIT(16)
29 29
30static void __iomem *keystone_rstctrl; 30static struct notifier_block platform_nb;
31static unsigned long keystone_dma_pfn_offset __read_mostly;
31 32
32static void __init keystone_init(void) 33static int keystone_platform_notifier(struct notifier_block *nb,
34 unsigned long event, void *data)
33{ 35{
34 struct device_node *node; 36 struct device *dev = data;
35 37
36 node = of_find_compatible_node(NULL, NULL, "ti,keystone-reset"); 38 if (event != BUS_NOTIFY_ADD_DEVICE)
37 if (WARN_ON(!node)) 39 return NOTIFY_DONE;
38 pr_warn("ti,keystone-reset node undefined\n");
39 40
40 keystone_rstctrl = of_iomap(node, 0); 41 if (!dev)
41 if (WARN_ON(!keystone_rstctrl)) 42 return NOTIFY_BAD;
42 pr_warn("ti,keystone-reset iomap error\n");
43 43
44 if (!dev->of_node) {
45 dev->dma_pfn_offset = keystone_dma_pfn_offset;
46 dev_err(dev, "set dma_pfn_offset%08lx\n",
47 dev->dma_pfn_offset);
48 }
49 return NOTIFY_OK;
50}
51
52static void __init keystone_init(void)
53{
44 keystone_pm_runtime_init(); 54 keystone_pm_runtime_init();
55 if (platform_nb.notifier_call)
56 bus_register_notifier(&platform_bus_type, &platform_nb);
45 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 57 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
46} 58}
47 59
48static const char *keystone_match[] __initconst = { 60static phys_addr_t keystone_virt_to_idmap(unsigned long x)
49 "ti,keystone", 61{
50 NULL, 62 return (phys_addr_t)(x) - CONFIG_PAGE_OFFSET + KEYSTONE_LOW_PHYS_START;
51}; 63}
52 64
53void keystone_restart(enum reboot_mode mode, const char *cmd) 65static void __init keystone_init_meminfo(void)
54{ 66{
55 u32 val; 67 bool lpae = IS_ENABLED(CONFIG_ARM_LPAE);
68 bool pvpatch = IS_ENABLED(CONFIG_ARM_PATCH_PHYS_VIRT);
69 phys_addr_t offset = PHYS_OFFSET - KEYSTONE_LOW_PHYS_START;
70 phys_addr_t mem_start, mem_end;
71
72 mem_start = memblock_start_of_DRAM();
73 mem_end = memblock_end_of_DRAM();
74
75 /* nothing to do if we are running out of the <32-bit space */
76 if (mem_start >= KEYSTONE_LOW_PHYS_START &&
77 mem_end <= KEYSTONE_LOW_PHYS_END)
78 return;
79
80 if (!lpae || !pvpatch) {
81 pr_crit("Enable %s%s%s to run outside 32-bit space\n",
82 !lpae ? __stringify(CONFIG_ARM_LPAE) : "",
83 (!lpae && !pvpatch) ? " and " : "",
84 !pvpatch ? __stringify(CONFIG_ARM_PATCH_PHYS_VIRT) : "");
85 }
86
87 if (mem_start < KEYSTONE_HIGH_PHYS_START ||
88 mem_end > KEYSTONE_HIGH_PHYS_END) {
89 pr_crit("Invalid address space for memory (%08llx-%08llx)\n",
90 (u64)mem_start, (u64)mem_end);
91 }
56 92
57 BUG_ON(!keystone_rstctrl); 93 offset += KEYSTONE_HIGH_PHYS_START;
94 __pv_phys_pfn_offset = PFN_DOWN(offset);
95 __pv_offset = (offset - PAGE_OFFSET);
58 96
59 /* Enable write access to RSTCTRL */ 97 /* Populate the arch idmap hook */
60 val = readl(keystone_rstctrl); 98 arch_virt_to_idmap = keystone_virt_to_idmap;
61 val &= PLL_RESET_WRITE_KEY_MASK; 99 platform_nb.notifier_call = keystone_platform_notifier;
62 val |= PLL_RESET_WRITE_KEY; 100 keystone_dma_pfn_offset = PFN_DOWN(KEYSTONE_HIGH_PHYS_START -
63 writel(val, keystone_rstctrl); 101 KEYSTONE_LOW_PHYS_START);
64 102
65 /* Reset the SOC */ 103 pr_info("Switching to high address space at 0x%llx\n", (u64)offset);
66 val = readl(keystone_rstctrl);
67 val &= ~PLL_RESET;
68 writel(val, keystone_rstctrl);
69} 104}
70 105
106static const char *keystone_match[] __initconst = {
107 "ti,keystone",
108 NULL,
109};
110
71DT_MACHINE_START(KEYSTONE, "Keystone") 111DT_MACHINE_START(KEYSTONE, "Keystone")
72#if defined(CONFIG_ZONE_DMA) && defined(CONFIG_ARM_LPAE) 112#if defined(CONFIG_ZONE_DMA) && defined(CONFIG_ARM_LPAE)
73 .dma_zone_size = SZ_2G, 113 .dma_zone_size = SZ_2G,
@@ -75,5 +115,5 @@ DT_MACHINE_START(KEYSTONE, "Keystone")
75 .smp = smp_ops(keystone_smp_ops), 115 .smp = smp_ops(keystone_smp_ops),
76 .init_machine = keystone_init, 116 .init_machine = keystone_init,
77 .dt_compat = keystone_match, 117 .dt_compat = keystone_match,
78 .restart = keystone_restart, 118 .init_meminfo = keystone_init_meminfo,
79MACHINE_END 119MACHINE_END
diff --git a/arch/arm/mach-keystone/memory.h b/arch/arm/mach-keystone/memory.h
new file mode 100644
index 000000000000..b854fb18eef1
--- /dev/null
+++ b/arch/arm/mach-keystone/memory.h
@@ -0,0 +1,24 @@
1/*
2 * Copyright 2014 Texas Instruments, Inc.
3 * Santosh Shilimkar <santosh.shilimkar@ti.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 */
9#ifndef __MEMORY_H
10#define __MEMORY_H
11
12#define MAX_PHYSMEM_BITS 36
13#define SECTION_SIZE_BITS 34
14
15#define KEYSTONE_LOW_PHYS_START 0x80000000ULL
16#define KEYSTONE_LOW_PHYS_SIZE 0x80000000ULL /* 2G */
17#define KEYSTONE_LOW_PHYS_END (KEYSTONE_LOW_PHYS_START + \
18 KEYSTONE_LOW_PHYS_SIZE - 1)
19
20#define KEYSTONE_HIGH_PHYS_START 0x800000000ULL
21#define KEYSTONE_HIGH_PHYS_SIZE 0x400000000ULL /* 16G */
22#define KEYSTONE_HIGH_PHYS_END (KEYSTONE_HIGH_PHYS_START + \
23 KEYSTONE_HIGH_PHYS_SIZE - 1)
24#endif /* __MEMORY_H */
diff --git a/arch/arm/mach-keystone/platsmp.c b/arch/arm/mach-keystone/platsmp.c
index 5cf0683577ea..5f46a7cf907b 100644
--- a/arch/arm/mach-keystone/platsmp.c
+++ b/arch/arm/mach-keystone/platsmp.c
@@ -17,13 +17,16 @@
17#include <linux/io.h> 17#include <linux/io.h>
18 18
19#include <asm/smp_plat.h> 19#include <asm/smp_plat.h>
20#include <asm/prom.h>
21#include <asm/tlbflush.h>
22#include <asm/pgtable.h>
20 23
21#include "keystone.h" 24#include "keystone.h"
22 25
23static int keystone_smp_boot_secondary(unsigned int cpu, 26static int keystone_smp_boot_secondary(unsigned int cpu,
24 struct task_struct *idle) 27 struct task_struct *idle)
25{ 28{
26 unsigned long start = virt_to_phys(&secondary_startup); 29 unsigned long start = virt_to_idmap(&secondary_startup);
27 int error; 30 int error;
28 31
29 pr_debug("keystone-smp: booting cpu %d, vector %08lx\n", 32 pr_debug("keystone-smp: booting cpu %d, vector %08lx\n",
@@ -36,6 +39,19 @@ static int keystone_smp_boot_secondary(unsigned int cpu,
36 return error; 39 return error;
37} 40}
38 41
42#ifdef CONFIG_ARM_LPAE
43static void __cpuinit keystone_smp_secondary_initmem(unsigned int cpu)
44{
45 pgd_t *pgd0 = pgd_offset_k(0);
46 cpu_set_ttbr(1, __pa(pgd0) + TTBR1_OFFSET);
47 local_flush_tlb_all();
48}
49#else
50static inline void __cpuinit keystone_smp_secondary_initmem(unsigned int cpu)
51{}
52#endif
53
39struct smp_operations keystone_smp_ops __initdata = { 54struct smp_operations keystone_smp_ops __initdata = {
40 .smp_boot_secondary = keystone_smp_boot_secondary, 55 .smp_boot_secondary = keystone_smp_boot_secondary,
56 .smp_secondary_init = keystone_smp_secondary_initmem,
41}; 57};
diff --git a/arch/arm/mach-orion5x/board-dt.c b/arch/arm/mach-orion5x/board-dt.c
index 35d418faf8f1..79f033b1ddff 100644
--- a/arch/arm/mach-orion5x/board-dt.c
+++ b/arch/arm/mach-orion5x/board-dt.c
@@ -45,7 +45,7 @@ static void __init orion5x_dt_init(void)
45 orion5x_id(&dev, &rev, &dev_name); 45 orion5x_id(&dev, &rev, &dev_name);
46 printk(KERN_INFO "Orion ID: %s. TCLK=%d.\n", dev_name, orion5x_tclk); 46 printk(KERN_INFO "Orion ID: %s. TCLK=%d.\n", dev_name, orion5x_tclk);
47 47
48 BUG_ON(mvebu_mbus_dt_init()); 48 BUG_ON(mvebu_mbus_dt_init(false));
49 49
50 /* 50 /*
51 * Setup Orion address map 51 * Setup Orion address map