diff options
| author | Arnd Bergmann <arnd@arndb.de> | 2014-05-23 12:49:25 -0400 |
|---|---|---|
| committer | Arnd Bergmann <arnd@arndb.de> | 2014-05-23 15:58:10 -0400 |
| commit | 9f0f10117228b73ec657aab8f303c9ae88fda070 (patch) | |
| tree | 43bb4bb94bdf3d1ea2965282a66da8586c15405b | |
| parent | a36d82e9d3c92f692c7ad68b72b4c1ea87905090 (diff) | |
| parent | 14f3791439b5a6cf12127fb80204265533d92664 (diff) | |
Merge tag 'keystone-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone into next/soc
Keystone SOC updates for 3.16
- Drop unused COMMON_CLK_DEBUG option
- Enable MTD_SPI_NOR config needed for M25P80
- Enable coherent higher address memory space
* tag 'keystone-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone:
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
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
| -rw-r--r-- | arch/arm/configs/integrator_defconfig | 1 | ||||
| -rw-r--r-- | arch/arm/configs/keystone_defconfig | 2 | ||||
| -rw-r--r-- | arch/arm/configs/sunxi_defconfig | 1 | ||||
| -rw-r--r-- | arch/arm/configs/vt8500_v6_v7_defconfig | 1 | ||||
| -rw-r--r-- | arch/arm/mach-keystone/keystone.c | 74 | ||||
| -rw-r--r-- | arch/arm/mach-keystone/memory.h | 24 | ||||
| -rw-r--r-- | arch/arm/mach-keystone/platsmp.c | 18 |
7 files changed, 116 insertions, 5 deletions
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 | |||
| 73 | CONFIG_LEDS_TRIGGER_CPU=y | 73 | CONFIG_LEDS_TRIGGER_CPU=y |
| 74 | CONFIG_RTC_CLASS=y | 74 | CONFIG_RTC_CLASS=y |
| 75 | CONFIG_RTC_DRV_PL030=y | 75 | CONFIG_RTC_DRV_PL030=y |
| 76 | CONFIG_COMMON_CLK_DEBUG=y | ||
| 77 | CONFIG_EXT2_FS=y | 76 | CONFIG_EXT2_FS=y |
| 78 | CONFIG_VFAT_FS=y | 77 | CONFIG_VFAT_FS=y |
| 79 | CONFIG_TMPFS=y | 78 | CONFIG_TMPFS=y |
diff --git a/arch/arm/configs/keystone_defconfig b/arch/arm/configs/keystone_defconfig index ec9a41d50680..07b43277ccd3 100644 --- a/arch/arm/configs/keystone_defconfig +++ b/arch/arm/configs/keystone_defconfig | |||
| @@ -112,6 +112,7 @@ CONFIG_MTD_PLATRAM=y | |||
| 112 | CONFIG_MTD_M25P80=y | 112 | CONFIG_MTD_M25P80=y |
| 113 | CONFIG_MTD_NAND=y | 113 | CONFIG_MTD_NAND=y |
| 114 | CONFIG_MTD_NAND_DAVINCI=y | 114 | CONFIG_MTD_NAND_DAVINCI=y |
| 115 | CONFIG_MTD_SPI_NOR=y | ||
| 115 | CONFIG_MTD_UBI=y | 116 | CONFIG_MTD_UBI=y |
| 116 | CONFIG_PROC_DEVICETREE=y | 117 | CONFIG_PROC_DEVICETREE=y |
| 117 | CONFIG_BLK_DEV_LOOP=y | 118 | CONFIG_BLK_DEV_LOOP=y |
| @@ -146,7 +147,6 @@ CONFIG_USB_DWC3_VERBOSE=y | |||
| 146 | CONFIG_KEYSTONE_USB_PHY=y | 147 | CONFIG_KEYSTONE_USB_PHY=y |
| 147 | CONFIG_DMADEVICES=y | 148 | CONFIG_DMADEVICES=y |
| 148 | CONFIG_TI_EDMA=y | 149 | CONFIG_TI_EDMA=y |
| 149 | CONFIG_COMMON_CLK_DEBUG=y | ||
| 150 | CONFIG_MEMORY=y | 150 | CONFIG_MEMORY=y |
| 151 | CONFIG_TI_AEMIF=y | 151 | CONFIG_TI_AEMIF=y |
| 152 | CONFIG_EXT4_FS=y | 152 | CONFIG_EXT4_FS=y |
diff --git a/arch/arm/configs/sunxi_defconfig b/arch/arm/configs/sunxi_defconfig index b5df4a511b0a..28287aebdc15 100644 --- a/arch/arm/configs/sunxi_defconfig +++ b/arch/arm/configs/sunxi_defconfig | |||
| @@ -62,7 +62,6 @@ CONFIG_LEDS_GPIO=y | |||
| 62 | CONFIG_LEDS_TRIGGERS=y | 62 | CONFIG_LEDS_TRIGGERS=y |
| 63 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y | 63 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y |
| 64 | CONFIG_LEDS_TRIGGER_DEFAULT_ON=y | 64 | CONFIG_LEDS_TRIGGER_DEFAULT_ON=y |
| 65 | CONFIG_COMMON_CLK_DEBUG=y | ||
| 66 | # CONFIG_IOMMU_SUPPORT is not set | 65 | # CONFIG_IOMMU_SUPPORT is not set |
| 67 | CONFIG_TMPFS=y | 66 | CONFIG_TMPFS=y |
| 68 | CONFIG_NFS_FS=y | 67 | CONFIG_NFS_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 | |||
| 73 | CONFIG_RTC_CLASS=y | 73 | CONFIG_RTC_CLASS=y |
| 74 | CONFIG_RTC_DRV_VT8500=y | 74 | CONFIG_RTC_DRV_VT8500=y |
| 75 | CONFIG_DMADEVICES=y | 75 | CONFIG_DMADEVICES=y |
| 76 | CONFIG_COMMON_CLK_DEBUG=y | ||
| 77 | # CONFIG_IOMMU_SUPPORT is not set | 76 | # CONFIG_IOMMU_SUPPORT is not set |
| 78 | CONFIG_PWM=y | 77 | CONFIG_PWM=y |
| 79 | CONFIG_PWM_VT8500=y | 78 | CONFIG_PWM_VT8500=y |
diff --git a/arch/arm/mach-keystone/keystone.c b/arch/arm/mach-keystone/keystone.c index e0b9e1b9cf30..59b8383cbdb0 100644 --- a/arch/arm/mach-keystone/keystone.c +++ b/arch/arm/mach-keystone/keystone.c | |||
| @@ -20,6 +20,9 @@ | |||
| 20 | #include <asm/mach/arch.h> | 20 | #include <asm/mach/arch.h> |
| 21 | #include <asm/mach/time.h> | 21 | #include <asm/mach/time.h> |
| 22 | #include <asm/smp_plat.h> | 22 | #include <asm/smp_plat.h> |
| 23 | #include <asm/memory.h> | ||
| 24 | |||
| 25 | #include "memory.h" | ||
| 23 | 26 | ||
| 24 | #include "keystone.h" | 27 | #include "keystone.h" |
| 25 | 28 | ||
| @@ -28,6 +31,27 @@ | |||
| 28 | #define PLL_RESET BIT(16) | 31 | #define PLL_RESET BIT(16) |
| 29 | 32 | ||
| 30 | static void __iomem *keystone_rstctrl; | 33 | static void __iomem *keystone_rstctrl; |
| 34 | static struct notifier_block platform_nb; | ||
| 35 | static unsigned long keystone_dma_pfn_offset __read_mostly; | ||
| 36 | |||
| 37 | static int keystone_platform_notifier(struct notifier_block *nb, | ||
| 38 | unsigned long event, void *data) | ||
| 39 | { | ||
| 40 | struct device *dev = data; | ||
| 41 | |||
| 42 | if (event != BUS_NOTIFY_ADD_DEVICE) | ||
| 43 | return NOTIFY_DONE; | ||
| 44 | |||
| 45 | if (!dev) | ||
| 46 | return NOTIFY_BAD; | ||
| 47 | |||
| 48 | if (!dev->of_node) { | ||
| 49 | dev->dma_pfn_offset = keystone_dma_pfn_offset; | ||
| 50 | dev_err(dev, "set dma_pfn_offset%08lx\n", | ||
| 51 | dev->dma_pfn_offset); | ||
| 52 | } | ||
| 53 | return NOTIFY_OK; | ||
| 54 | } | ||
| 31 | 55 | ||
| 32 | static void __init keystone_init(void) | 56 | static void __init keystone_init(void) |
| 33 | { | 57 | { |
| @@ -42,9 +66,58 @@ static void __init keystone_init(void) | |||
| 42 | pr_warn("ti,keystone-reset iomap error\n"); | 66 | pr_warn("ti,keystone-reset iomap error\n"); |
| 43 | 67 | ||
| 44 | keystone_pm_runtime_init(); | 68 | keystone_pm_runtime_init(); |
| 69 | if (platform_nb.notifier_call) | ||
| 70 | bus_register_notifier(&platform_bus_type, &platform_nb); | ||
| 45 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 71 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
| 46 | } | 72 | } |
| 47 | 73 | ||
| 74 | static phys_addr_t keystone_virt_to_idmap(unsigned long x) | ||
| 75 | { | ||
| 76 | return (phys_addr_t)(x) - CONFIG_PAGE_OFFSET + KEYSTONE_LOW_PHYS_START; | ||
| 77 | } | ||
| 78 | |||
| 79 | static void __init keystone_init_meminfo(void) | ||
| 80 | { | ||
| 81 | bool lpae = IS_ENABLED(CONFIG_ARM_LPAE); | ||
| 82 | bool pvpatch = IS_ENABLED(CONFIG_ARM_PATCH_PHYS_VIRT); | ||
| 83 | phys_addr_t offset = PHYS_OFFSET - KEYSTONE_LOW_PHYS_START; | ||
| 84 | phys_addr_t mem_start, mem_end; | ||
| 85 | |||
| 86 | BUG_ON(meminfo.nr_banks < 1); | ||
| 87 | mem_start = meminfo.bank[0].start; | ||
| 88 | mem_end = mem_start + meminfo.bank[0].size - 1; | ||
| 89 | |||
| 90 | /* nothing to do if we are running out of the <32-bit space */ | ||
| 91 | if (mem_start >= KEYSTONE_LOW_PHYS_START && | ||
| 92 | mem_end <= KEYSTONE_LOW_PHYS_END) | ||
| 93 | return; | ||
| 94 | |||
| 95 | if (!lpae || !pvpatch) { | ||
| 96 | pr_crit("Enable %s%s%s to run outside 32-bit space\n", | ||
| 97 | !lpae ? __stringify(CONFIG_ARM_LPAE) : "", | ||
| 98 | (!lpae && !pvpatch) ? " and " : "", | ||
| 99 | !pvpatch ? __stringify(CONFIG_ARM_PATCH_PHYS_VIRT) : ""); | ||
| 100 | } | ||
| 101 | |||
| 102 | if (mem_start < KEYSTONE_HIGH_PHYS_START || | ||
| 103 | mem_end > KEYSTONE_HIGH_PHYS_END) { | ||
| 104 | pr_crit("Invalid address space for memory (%08llx-%08llx)\n", | ||
| 105 | (u64)mem_start, (u64)mem_end); | ||
| 106 | } | ||
| 107 | |||
| 108 | offset += KEYSTONE_HIGH_PHYS_START; | ||
| 109 | __pv_phys_pfn_offset = PFN_DOWN(offset); | ||
| 110 | __pv_offset = (offset - PAGE_OFFSET); | ||
| 111 | |||
| 112 | /* Populate the arch idmap hook */ | ||
| 113 | arch_virt_to_idmap = keystone_virt_to_idmap; | ||
| 114 | platform_nb.notifier_call = keystone_platform_notifier; | ||
| 115 | keystone_dma_pfn_offset = PFN_DOWN(KEYSTONE_HIGH_PHYS_START - | ||
| 116 | KEYSTONE_LOW_PHYS_START); | ||
| 117 | |||
| 118 | pr_info("Switching to high address space at 0x%llx\n", (u64)offset); | ||
| 119 | } | ||
| 120 | |||
| 48 | static const char *keystone_match[] __initconst = { | 121 | static const char *keystone_match[] __initconst = { |
| 49 | "ti,keystone", | 122 | "ti,keystone", |
| 50 | NULL, | 123 | NULL, |
| @@ -76,4 +149,5 @@ DT_MACHINE_START(KEYSTONE, "Keystone") | |||
| 76 | .init_machine = keystone_init, | 149 | .init_machine = keystone_init, |
| 77 | .dt_compat = keystone_match, | 150 | .dt_compat = keystone_match, |
| 78 | .restart = keystone_restart, | 151 | .restart = keystone_restart, |
| 152 | .init_meminfo = keystone_init_meminfo, | ||
| 79 | MACHINE_END | 153 | MACHINE_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 | ||
| 23 | static int keystone_smp_boot_secondary(unsigned int cpu, | 26 | static 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 | ||
| 43 | static 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 | ||
| 50 | static inline void __cpuinit keystone_smp_secondary_initmem(unsigned int cpu) | ||
| 51 | {} | ||
| 52 | #endif | ||
| 53 | |||
| 39 | struct smp_operations keystone_smp_ops __initdata = { | 54 | struct 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 | }; |
