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

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

+132 -39
+13 -1
arch/arm/boot/dts/keystone.dtsi
··· 66 66 ranges = <0x0 0x0 0x0 0xc0000000>; 67 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 79 rstctrl: reset-controller { 70 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 86 /include/ "keystone-clocks.dtsi"
-1
arch/arm/configs/integrator_defconfig
··· 73 73 CONFIG_LEDS_TRIGGER_CPU=y 74 74 CONFIG_RTC_CLASS=y 75 75 CONFIG_RTC_DRV_PL030=y 76 - CONFIG_COMMON_CLK_DEBUG=y 77 76 CONFIG_EXT2_FS=y 78 77 CONFIG_VFAT_FS=y 79 78 CONFIG_TMPFS=y
+4 -1
arch/arm/configs/keystone_defconfig
··· 112 112 CONFIG_MTD_M25P80=y 113 113 CONFIG_MTD_NAND=y 114 114 CONFIG_MTD_NAND_DAVINCI=y 115 + CONFIG_MTD_SPI_NOR=y 115 116 CONFIG_MTD_UBI=y 116 117 CONFIG_PROC_DEVICETREE=y 117 118 CONFIG_BLK_DEV_LOOP=y ··· 132 131 CONFIG_SPI_DAVINCI=y 133 132 CONFIG_SPI_SPIDEV=y 134 133 # CONFIG_HWMON is not set 134 + CONFIG_POWER_SUPPLY=y 135 + CONFIG_POWER_RESET=y 136 + CONFIG_POWER_RESET_KEYSTONE=y 135 137 CONFIG_WATCHDOG=y 136 138 CONFIG_WATCHDOG_CORE=y 137 139 CONFIG_DAVINCI_WATCHDOG=y ··· 149 145 CONFIG_KEYSTONE_USB_PHY=y 150 146 CONFIG_DMADEVICES=y 151 147 CONFIG_TI_EDMA=y 152 - CONFIG_COMMON_CLK_DEBUG=y 153 148 CONFIG_MEMORY=y 154 149 CONFIG_TI_AEMIF=y 155 150 CONFIG_EXT4_FS=y
-1
arch/arm/configs/vt8500_v6_v7_defconfig
··· 73 73 CONFIG_RTC_CLASS=y 74 74 CONFIG_RTC_DRV_VT8500=y 75 75 CONFIG_DMADEVICES=y 76 - CONFIG_COMMON_CLK_DEBUG=y 77 76 # CONFIG_IOMMU_SUPPORT is not set 78 77 CONFIG_PWM=y 79 78 CONFIG_PWM_VT8500=y
+73 -33
arch/arm/mach-keystone/keystone.c
··· 14 14 #include <linux/init.h> 15 15 #include <linux/of_platform.h> 16 16 #include <linux/of_address.h> 17 + #include <linux/memblock.h> 17 18 18 19 #include <asm/setup.h> 19 20 #include <asm/mach/map.h> 20 21 #include <asm/mach/arch.h> 21 22 #include <asm/mach/time.h> 22 23 #include <asm/smp_plat.h> 24 + #include <asm/memory.h> 25 + 26 + #include "memory.h" 23 27 24 28 #include "keystone.h" 25 29 26 - #define PLL_RESET_WRITE_KEY_MASK 0xffff0000 27 - #define PLL_RESET_WRITE_KEY 0x5a69 28 - #define PLL_RESET BIT(16) 30 + static struct notifier_block platform_nb; 31 + static unsigned long keystone_dma_pfn_offset __read_mostly; 29 32 30 - static void __iomem *keystone_rstctrl; 33 + static int keystone_platform_notifier(struct notifier_block *nb, 34 + unsigned long event, void *data) 35 + { 36 + struct device *dev = data; 37 + 38 + if (event != BUS_NOTIFY_ADD_DEVICE) 39 + return NOTIFY_DONE; 40 + 41 + if (!dev) 42 + return NOTIFY_BAD; 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 + } 31 51 32 52 static void __init keystone_init(void) 33 53 { 34 - struct device_node *node; 35 - 36 - node = of_find_compatible_node(NULL, NULL, "ti,keystone-reset"); 37 - if (WARN_ON(!node)) 38 - pr_warn("ti,keystone-reset node undefined\n"); 39 - 40 - keystone_rstctrl = of_iomap(node, 0); 41 - if (WARN_ON(!keystone_rstctrl)) 42 - pr_warn("ti,keystone-reset iomap error\n"); 43 - 44 54 keystone_pm_runtime_init(); 55 + if (platform_nb.notifier_call) 56 + bus_register_notifier(&platform_bus_type, &platform_nb); 45 57 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 58 + } 59 + 60 + static phys_addr_t keystone_virt_to_idmap(unsigned long x) 61 + { 62 + return (phys_addr_t)(x) - CONFIG_PAGE_OFFSET + KEYSTONE_LOW_PHYS_START; 63 + } 64 + 65 + static void __init keystone_init_meminfo(void) 66 + { 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 + } 92 + 93 + offset += KEYSTONE_HIGH_PHYS_START; 94 + __pv_phys_pfn_offset = PFN_DOWN(offset); 95 + __pv_offset = (offset - PAGE_OFFSET); 96 + 97 + /* Populate the arch idmap hook */ 98 + arch_virt_to_idmap = keystone_virt_to_idmap; 99 + platform_nb.notifier_call = keystone_platform_notifier; 100 + keystone_dma_pfn_offset = PFN_DOWN(KEYSTONE_HIGH_PHYS_START - 101 + KEYSTONE_LOW_PHYS_START); 102 + 103 + pr_info("Switching to high address space at 0x%llx\n", (u64)offset); 46 104 } 47 105 48 106 static const char *keystone_match[] __initconst = { 49 107 "ti,keystone", 50 108 NULL, 51 109 }; 52 - 53 - void keystone_restart(enum reboot_mode mode, const char *cmd) 54 - { 55 - u32 val; 56 - 57 - BUG_ON(!keystone_rstctrl); 58 - 59 - /* Enable write access to RSTCTRL */ 60 - val = readl(keystone_rstctrl); 61 - val &= PLL_RESET_WRITE_KEY_MASK; 62 - val |= PLL_RESET_WRITE_KEY; 63 - writel(val, keystone_rstctrl); 64 - 65 - /* Reset the SOC */ 66 - val = readl(keystone_rstctrl); 67 - val &= ~PLL_RESET; 68 - writel(val, keystone_rstctrl); 69 - } 70 110 71 111 DT_MACHINE_START(KEYSTONE, "Keystone") 72 112 #if defined(CONFIG_ZONE_DMA) && defined(CONFIG_ARM_LPAE) ··· 115 75 .smp = smp_ops(keystone_smp_ops), 116 76 .init_machine = keystone_init, 117 77 .dt_compat = keystone_match, 118 - .restart = keystone_restart, 78 + .init_meminfo = keystone_init_meminfo, 119 79 MACHINE_END
+24
arch/arm/mach-keystone/memory.h
··· 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 */
+17 -1
arch/arm/mach-keystone/platsmp.c
··· 17 17 #include <linux/io.h> 18 18 19 19 #include <asm/smp_plat.h> 20 + #include <asm/prom.h> 21 + #include <asm/tlbflush.h> 22 + #include <asm/pgtable.h> 20 23 21 24 #include "keystone.h" 22 25 23 26 static int keystone_smp_boot_secondary(unsigned int cpu, 24 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 30 int error; 28 31 29 32 pr_debug("keystone-smp: booting cpu %d, vector %08lx\n", ··· 39 36 return error; 40 37 } 41 38 39 + #ifdef CONFIG_ARM_LPAE 40 + static void __cpuinit keystone_smp_secondary_initmem(unsigned int cpu) 41 + { 42 + pgd_t *pgd0 = pgd_offset_k(0); 43 + cpu_set_ttbr(1, __pa(pgd0) + TTBR1_OFFSET); 44 + local_flush_tlb_all(); 45 + } 46 + #else 47 + static inline void __cpuinit keystone_smp_secondary_initmem(unsigned int cpu) 48 + {} 49 + #endif 50 + 42 51 struct smp_operations keystone_smp_ops __initdata = { 43 52 .smp_boot_secondary = keystone_smp_boot_secondary, 53 + .smp_secondary_init = keystone_smp_secondary_initmem, 44 54 };
+1 -1
arch/arm/mach-orion5x/board-dt.c
··· 45 45 orion5x_id(&dev, &rev, &dev_name); 46 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 51 * Setup Orion address map