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

Merge tag 'realview-base-armsoc-1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator into next/multiplatform

Merge "Realview multiplatform support" from Linus Walleij:

The board and infrastructure changes for RealView
multiplatform and extended DT support.

* tag 'realview-base-armsoc-1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator:
ARM: realview: add an DT SMP boot method
ARM: realview: select SP810 and ICST for the DT variant
soc: versatile: add support for the PB11MPCore
clk: versatile-icst: add device tree support
clk: versatile-icst: refactor to allocate regmap separately
clk: versatile-icst: convert to use regmap
ARM: realview: remove private barrier implementation
ARM: no longer force unbuffered DMA for realview
clk/realview: stop using machine headers
ARM: realview: don't map undefined PCI registers
ARM: realview: remove sparsemem hack

Conflicts:
drivers/clk/versatile/Kconfig

+285 -134
+1
Documentation/devicetree/bindings/arm/cpus.txt
··· 190 190 "allwinner,sun6i-a31" 191 191 "allwinner,sun8i-a23" 192 192 "arm,psci" 193 + "arm,realview-smp" 193 194 "brcm,brahma-b15" 194 195 "marvell,armada-375-smp" 195 196 "marvell,armada-380-smp"
-2
arch/arm/Kconfig
··· 241 241 bool "Patch physical to virtual translations at runtime" if EMBEDDED 242 242 default y 243 243 depends on !XIP_KERNEL && MMU 244 - depends on !ARCH_REALVIEW || !SPARSEMEM 245 244 help 246 245 Patch phys-to-virt and virt-to-phys translation functions at 247 246 boot and module load time according to the position of the ··· 355 356 select GENERIC_CLOCKEVENTS 356 357 select GPIO_PL061 if GPIOLIB 357 358 select ICST 358 - select NEED_MACH_MEMORY_H 359 359 select PLAT_VERSATILE 360 360 select PLAT_VERSATILE_SCHED_CLOCK 361 361 help
+6 -5
arch/arm/mach-realview/Kconfig
··· 4 4 config REALVIEW_DT 5 5 bool "Support RealView(R) Device Tree based boot" 6 6 select ARM_GIC 7 + select CLK_SP810 8 + select HAVE_SMP 9 + select ICST 7 10 select MFD_SYSCON 8 11 select POWER_RESET 9 12 select POWER_RESET_VERSATILE 10 13 select POWER_SUPPLY 14 + select SMP_ON_UP 11 15 select SOC_REALVIEW 12 16 select USE_OF 13 17 help ··· 40 36 config REALVIEW_EB_ARM11MP 41 37 bool "Support ARM11MPCore Tile" 42 38 depends on MACH_REALVIEW_EB 43 - select ARCH_HAS_BARRIERS if SMP 44 39 select CPU_V6K 45 40 select HAVE_ARM_SCU if SMP 46 41 select HAVE_ARM_TWD if SMP ··· 60 57 61 58 config MACH_REALVIEW_PB11MP 62 59 bool "Support RealView(R) Platform Baseboard for ARM11MPCore" 63 - select ARCH_HAS_BARRIERS if SMP 64 60 select ARM_GIC 65 61 select CPU_V6K 66 62 select HAVE_ARM_SCU if SMP ··· 104 102 105 103 config MACH_REALVIEW_PBX 106 104 bool "Support RealView(R) Platform Baseboard Explore" 107 - select ARCH_SPARSEMEM_ENABLE if CPU_V7 && !REALVIEW_HIGH_PHYS_OFFSET 108 105 select ARM_GIC 109 106 select HAVE_ARM_SCU if SMP 110 107 select HAVE_ARM_TWD if SMP 111 108 select HAVE_PATA_PLATFORM 112 109 select HAVE_SMP 113 110 select MIGHT_HAVE_CACHE_L2X0 114 - select ZONE_DMA if SPARSEMEM 111 + select ZONE_DMA 115 112 help 116 113 Include support for the ARM(R) RealView(R) Platform Baseboard 117 114 Explore. ··· 125 124 the board supports 512MB of RAM, this option allows the 126 125 memory to be accessed contiguously at the high physical 127 126 offset. On the PBX board, disabling this option allows 1GB of 128 - RAM to be used with SPARSEMEM. 127 + RAM to be used with HIGHMEM. 129 128 130 129 endmenu
+1 -1
arch/arm/mach-realview/Makefile
··· 3 3 # 4 4 5 5 obj-y := core.o 6 - obj-$(CONFIG_REALVIEW_DT) += realview-dt.o 6 + obj-$(CONFIG_REALVIEW_DT) += realview-dt.o platsmp-dt.o 7 7 obj-$(CONFIG_MACH_REALVIEW_EB) += realview_eb.o 8 8 obj-$(CONFIG_MACH_REALVIEW_PB11MP) += realview_pb11mp.o 9 9 obj-$(CONFIG_MACH_REALVIEW_PB1176) += realview_pb1176.o
-8
arch/arm/mach-realview/include/mach/barriers.h
··· 1 - /* 2 - * Barriers redefined for RealView ARM11MPCore platforms with L220 cache 3 - * controller to work around hardware errata causing the outer_sync() 4 - * operation to deadlock the system. 5 - */ 6 - #define mb() dsb() 7 - #define rmb() dsb() 8 - #define wmb() mb()
-64
arch/arm/mach-realview/include/mach/memory.h
··· 1 - /* 2 - * arch/arm/mach-realview/include/mach/memory.h 3 - * 4 - * Copyright (C) 2003 ARM Limited 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 - * You should have received a copy of the GNU General Public License 17 - * along with this program; if not, write to the Free Software 18 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 - */ 20 - #ifndef __ASM_ARCH_MEMORY_H 21 - #define __ASM_ARCH_MEMORY_H 22 - 23 - #ifdef CONFIG_SPARSEMEM 24 - 25 - /* 26 - * Sparsemem definitions for RealView PBX. 27 - * 28 - * The RealView PBX board has another block of 512MB of RAM at 0x20000000, 29 - * however only the block at 0x70000000 (or the 256MB mirror at 0x00000000) 30 - * may be used for DMA. 31 - * 32 - * The macros below define a section size of 256MB and a non-linear virtual to 33 - * physical mapping: 34 - * 35 - * 256MB @ 0x00000000 -> PAGE_OFFSET 36 - * 512MB @ 0x20000000 -> PAGE_OFFSET + 0x10000000 37 - * 256MB @ 0x80000000 -> PAGE_OFFSET + 0x30000000 38 - */ 39 - #ifdef CONFIG_REALVIEW_HIGH_PHYS_OFFSET 40 - #error "SPARSEMEM not available with REALVIEW_HIGH_PHYS_OFFSET" 41 - #endif 42 - 43 - #define MAX_PHYSMEM_BITS 32 44 - #define SECTION_SIZE_BITS 28 45 - 46 - /* bank page offsets */ 47 - #define PAGE_OFFSET1 (PAGE_OFFSET + 0x10000000) 48 - #define PAGE_OFFSET2 (PAGE_OFFSET + 0x30000000) 49 - 50 - #define PHYS_OFFSET PLAT_PHYS_OFFSET 51 - 52 - #define __phys_to_virt(phys) \ 53 - ((phys) >= 0x80000000 ? (phys) - 0x80000000 + PAGE_OFFSET2 : \ 54 - (phys) >= 0x20000000 ? (phys) - 0x20000000 + PAGE_OFFSET1 : \ 55 - (phys) + PAGE_OFFSET) 56 - 57 - #define __virt_to_phys(virt) \ 58 - ((virt) >= PAGE_OFFSET2 ? (virt) - PAGE_OFFSET2 + 0x80000000 : \ 59 - (virt) >= PAGE_OFFSET1 ? (virt) - PAGE_OFFSET1 + 0x20000000 : \ 60 - (virt) - PAGE_OFFSET) 61 - 62 - #endif /* CONFIG_SPARSEMEM */ 63 - 64 - #endif
+91
arch/arm/mach-realview/platsmp-dt.c
··· 1 + /* 2 + * Copyright (C) 2015 Linus Walleij 3 + * 4 + * This program is free software; you can redistribute it and/or modify 5 + * it under the terms of the GNU General Public License version 2 as 6 + * published by the Free Software Foundation. 7 + */ 8 + #include <linux/smp.h> 9 + #include <linux/io.h> 10 + #include <linux/of.h> 11 + #include <linux/of_address.h> 12 + #include <linux/regmap.h> 13 + #include <linux/mfd/syscon.h> 14 + 15 + #include <asm/cacheflush.h> 16 + #include <asm/smp_plat.h> 17 + #include <asm/smp_scu.h> 18 + 19 + #include <plat/platsmp.h> 20 + 21 + #include "core.h" 22 + 23 + #define REALVIEW_SYS_FLAGSSET_OFFSET 0x30 24 + 25 + static const struct of_device_id realview_scu_match[] = { 26 + { .compatible = "arm,arm11mp-scu", }, 27 + { .compatible = "arm,cortex-a9-scu", }, 28 + { .compatible = "arm,cortex-a5-scu", }, 29 + { } 30 + }; 31 + 32 + static const struct of_device_id realview_syscon_match[] = { 33 + { .compatible = "arm,core-module-integrator", }, 34 + { .compatible = "arm,realview-eb-syscon", }, 35 + { .compatible = "arm,realview-pb11mp-syscon", }, 36 + { .compatible = "arm,realview-pbx-syscon", }, 37 + { }, 38 + }; 39 + 40 + static void __init realview_smp_prepare_cpus(unsigned int max_cpus) 41 + { 42 + struct device_node *np; 43 + void __iomem *scu_base; 44 + struct regmap *map; 45 + unsigned int ncores; 46 + int i; 47 + 48 + np = of_find_matching_node(NULL, realview_scu_match); 49 + if (!np) { 50 + pr_err("PLATSMP: No SCU base address\n"); 51 + return; 52 + } 53 + scu_base = of_iomap(np, 0); 54 + of_node_put(np); 55 + if (!scu_base) { 56 + pr_err("PLATSMP: No SCU remap\n"); 57 + return; 58 + } 59 + 60 + scu_enable(scu_base); 61 + ncores = scu_get_core_count(scu_base); 62 + pr_info("SCU: %d cores detected\n", ncores); 63 + for (i = 0; i < ncores; i++) 64 + set_cpu_possible(i, true); 65 + iounmap(scu_base); 66 + 67 + /* The syscon contains the magic SMP start address registers */ 68 + np = of_find_matching_node(NULL, realview_syscon_match); 69 + if (!np) { 70 + pr_err("PLATSMP: No syscon match\n"); 71 + return; 72 + } 73 + map = syscon_node_to_regmap(np); 74 + if (IS_ERR(map)) { 75 + pr_err("PLATSMP: No syscon regmap\n"); 76 + return; 77 + } 78 + /* Put the boot address in this magic register */ 79 + regmap_write(map, REALVIEW_SYS_FLAGSSET_OFFSET, 80 + virt_to_phys(versatile_secondary_startup)); 81 + } 82 + 83 + struct smp_operations realview_dt_smp_ops __initdata = { 84 + .smp_prepare_cpus = realview_smp_prepare_cpus, 85 + .smp_secondary_init = versatile_secondary_init, 86 + .smp_boot_secondary = versatile_boot_secondary, 87 + #ifdef CONFIG_HOTPLUG_CPU 88 + .cpu_die = realview_cpu_die, 89 + #endif 90 + }; 91 + CPU_METHOD_OF_DECLARE(realview_smp, "arm,realview-smp", &realview_dt_smp_ops);
+7
arch/arm/mach-realview/realview_eb.c
··· 38 38 #include <asm/hardware/cache-l2x0.h> 39 39 #include <asm/smp_twd.h> 40 40 #include <asm/system_info.h> 41 + #include <asm/outercache.h> 41 42 42 43 #include <asm/mach/arch.h> 43 44 #include <asm/mach/map.h> ··· 451 450 * Bits: .... ...0 0111 1001 0000 .... .... .... 452 451 */ 453 452 l2x0_init(__io_address(REALVIEW_EB11MP_L220_BASE), 0x00790000, 0xfe000fff); 453 + 454 + /* 455 + * due to a bug in the l220 cache controller, we must not call 456 + * the sync function. stub it out here instead! 457 + */ 458 + outer_cache.sync = NULL; 454 459 #endif 455 460 pmu_device.name = core_tile_a9mp() ? "armv7-pmu" : "armv6-pmu"; 456 461 platform_device_register(&pmu_device);
+6
arch/arm/mach-realview/realview_pb11mp.c
··· 42 42 #include <asm/mach/flash.h> 43 43 #include <asm/mach/map.h> 44 44 #include <asm/mach/time.h> 45 + #include <asm/outercache.h> 45 46 46 47 #include <mach/board-pb11mp.h> 47 48 #include <mach/irqs.h> ··· 346 345 * Bits: .... ...0 0111 1001 0000 .... .... .... 347 346 */ 348 347 l2x0_init(__io_address(REALVIEW_TC11MP_L220_BASE), 0x00790000, 0xfe000fff); 348 + /* 349 + * due to a bug in the l220 cache controller, we must not call 350 + * the sync function. stub it out here instead! 351 + */ 352 + outer_cache.sync = NULL; 349 353 #endif 350 354 351 355 realview_flash_register(realview_pb11mp_flash_resource,
-8
arch/arm/mach-realview/realview_pba8.c
··· 77 77 .length = SZ_4K, 78 78 .type = MT_DEVICE, 79 79 }, 80 - #ifdef CONFIG_PCI 81 - { 82 - .virtual = PCIX_UNIT_BASE, 83 - .pfn = __phys_to_pfn(REALVIEW_PBA8_PCI_BASE), 84 - .length = REALVIEW_PBA8_PCI_BASE_SIZE, 85 - .type = MT_DEVICE 86 - }, 87 - #endif 88 80 #ifdef CONFIG_DEBUG_LL 89 81 { 90 82 .virtual = IO_ADDRESS(REALVIEW_PBA8_UART0_BASE),
-8
arch/arm/mach-realview/realview_pbx.c
··· 79 79 .length = SZ_4K, 80 80 .type = MT_DEVICE, 81 81 }, 82 - #ifdef CONFIG_PCI 83 - { 84 - .virtual = PCIX_UNIT_BASE, 85 - .pfn = __phys_to_pfn(REALVIEW_PBX_PCI_BASE), 86 - .length = REALVIEW_PBX_PCI_BASE_SIZE, 87 - .type = MT_DEVICE, 88 - }, 89 - #endif 90 82 #ifdef CONFIG_DEBUG_LL 91 83 { 92 84 .virtual = IO_ADDRESS(REALVIEW_PBX_UART0_BASE),
-2
arch/arm/mm/Kconfig
··· 1005 1005 1006 1006 config ARM_DMA_MEM_BUFFERABLE 1007 1007 bool "Use non-cacheable memory for DMA" if (CPU_V6 || CPU_V6K) && !CPU_V7 1008 - depends on !(MACH_REALVIEW_PB1176 || REALVIEW_EB_ARM11MP || \ 1009 - MACH_REALVIEW_PB11MP) 1010 1008 default y if CPU_V6 || CPU_V6K || CPU_V7 1011 1009 help 1012 1010 Historically, the kernel has used strongly ordered mappings to
+1
drivers/clk/versatile/Kconfig
··· 3 3 depends on ARCH_INTEGRATOR || ARCH_REALVIEW || \ 4 4 ARCH_VERSATILE || ARCH_VEXPRESS || ARM64 || \ 5 5 COMPILE_TEST 6 + select REGMAP_MMIO 6 7 ---help--- 7 8 Supports clocking on ARM Reference designs: 8 9 - Integrator/AP and Integrator/CP
+161 -33
drivers/clk/versatile/clk-icst.c
··· 3 3 * We wrap the custom interface from <asm/hardware/icst.h> into the generic 4 4 * clock framework. 5 5 * 6 - * Copyright (C) 2012 Linus Walleij 6 + * Copyright (C) 2012-2015 Linus Walleij 7 7 * 8 8 * This program is free software; you can redistribute it and/or modify 9 9 * it under the terms of the GNU General Public License version 2 as ··· 19 19 #include <linux/err.h> 20 20 #include <linux/clk-provider.h> 21 21 #include <linux/io.h> 22 + #include <linux/regmap.h> 23 + #include <linux/mfd/syscon.h> 22 24 23 25 #include "clk-icst.h" 26 + 27 + /* Magic unlocking token used on all Versatile boards */ 28 + #define VERSATILE_LOCK_VAL 0xA05F 24 29 25 30 /** 26 31 * struct clk_icst - ICST VCO clock wrapper ··· 37 32 */ 38 33 struct clk_icst { 39 34 struct clk_hw hw; 40 - void __iomem *vcoreg; 41 - void __iomem *lockreg; 35 + struct regmap *map; 36 + u32 vcoreg_off; 37 + u32 lockreg_off; 42 38 struct icst_params *params; 43 39 unsigned long rate; 44 40 }; ··· 47 41 #define to_icst(_hw) container_of(_hw, struct clk_icst, hw) 48 42 49 43 /** 50 - * vco_get() - get ICST VCO settings from a certain register 51 - * @vcoreg: register containing the VCO settings 44 + * vco_get() - get ICST VCO settings from a certain ICST 45 + * @icst: the ICST clock to get 46 + * @vco: the VCO struct to return the value in 52 47 */ 53 - static struct icst_vco vco_get(void __iomem *vcoreg) 48 + static int vco_get(struct clk_icst *icst, struct icst_vco *vco) 54 49 { 55 50 u32 val; 56 - struct icst_vco vco; 51 + int ret; 57 52 58 - val = readl(vcoreg); 59 - vco.v = val & 0x1ff; 60 - vco.r = (val >> 9) & 0x7f; 61 - vco.s = (val >> 16) & 03; 62 - return vco; 53 + ret = regmap_read(icst->map, icst->vcoreg_off, &val); 54 + if (ret) 55 + return ret; 56 + vco->v = val & 0x1ff; 57 + vco->r = (val >> 9) & 0x7f; 58 + vco->s = (val >> 16) & 03; 59 + return 0; 63 60 } 64 61 65 62 /** 66 63 * vco_set() - commit changes to an ICST VCO 67 - * @locreg: register to poke to unlock the VCO for writing 68 - * @vcoreg: register containing the VCO settings 69 - * @vco: ICST VCO parameters to commit 64 + * @icst: the ICST clock to set 65 + * @vco: the VCO struct to set the changes from 70 66 */ 71 - static void vco_set(void __iomem *lockreg, 72 - void __iomem *vcoreg, 73 - struct icst_vco vco) 67 + static int vco_set(struct clk_icst *icst, struct icst_vco vco) 74 68 { 75 69 u32 val; 70 + int ret; 76 71 77 - val = readl(vcoreg) & ~0x7ffff; 72 + ret = regmap_read(icst->map, icst->vcoreg_off, &val); 73 + if (ret) 74 + return ret; 78 75 val |= vco.v | (vco.r << 9) | (vco.s << 16); 79 76 80 77 /* This magic unlocks the VCO so it can be controlled */ 81 - writel(0xa05f, lockreg); 82 - writel(val, vcoreg); 78 + ret = regmap_write(icst->map, icst->lockreg_off, VERSATILE_LOCK_VAL); 79 + if (ret) 80 + return ret; 81 + ret = regmap_write(icst->map, icst->vcoreg_off, val); 82 + if (ret) 83 + return ret; 83 84 /* This locks the VCO again */ 84 - writel(0, lockreg); 85 + ret = regmap_write(icst->map, icst->lockreg_off, 0); 86 + if (ret) 87 + return ret; 88 + return 0; 85 89 } 86 - 87 90 88 91 static unsigned long icst_recalc_rate(struct clk_hw *hw, 89 92 unsigned long parent_rate) 90 93 { 91 94 struct clk_icst *icst = to_icst(hw); 92 95 struct icst_vco vco; 96 + int ret; 93 97 94 98 if (parent_rate) 95 99 icst->params->ref = parent_rate; 96 - vco = vco_get(icst->vcoreg); 100 + ret = vco_get(icst, &vco); 101 + if (ret) { 102 + pr_err("ICST: could not get VCO setting\n"); 103 + return 0; 104 + } 97 105 icst->rate = icst_hz(icst->params, vco); 98 106 return icst->rate; 99 107 } ··· 132 112 icst->params->ref = parent_rate; 133 113 vco = icst_hz_to_vco(icst->params, rate); 134 114 icst->rate = icst_hz(icst->params, vco); 135 - vco_set(icst->lockreg, icst->vcoreg, vco); 136 - return 0; 115 + return vco_set(icst, vco); 137 116 } 138 117 139 118 static const struct clk_ops icst_ops = { ··· 141 122 .set_rate = icst_set_rate, 142 123 }; 143 124 144 - struct clk *icst_clk_register(struct device *dev, 145 - const struct clk_icst_desc *desc, 146 - const char *name, 147 - const char *parent_name, 148 - void __iomem *base) 125 + static struct clk *icst_clk_setup(struct device *dev, 126 + const struct clk_icst_desc *desc, 127 + const char *name, 128 + const char *parent_name, 129 + struct regmap *map) 149 130 { 150 131 struct clk *clk; 151 132 struct clk_icst *icst; ··· 170 151 init.flags = CLK_IS_ROOT; 171 152 init.parent_names = (parent_name ? &parent_name : NULL); 172 153 init.num_parents = (parent_name ? 1 : 0); 154 + icst->map = map; 173 155 icst->hw.init = &init; 174 156 icst->params = pclone; 175 - icst->vcoreg = base + desc->vco_offset; 176 - icst->lockreg = base + desc->lock_offset; 157 + icst->vcoreg_off = desc->vco_offset; 158 + icst->lockreg_off = desc->lock_offset; 177 159 178 160 clk = clk_register(dev, &icst->hw); 179 161 if (IS_ERR(clk)) { ··· 184 164 185 165 return clk; 186 166 } 167 + 168 + struct clk *icst_clk_register(struct device *dev, 169 + const struct clk_icst_desc *desc, 170 + const char *name, 171 + const char *parent_name, 172 + void __iomem *base) 173 + { 174 + struct regmap_config icst_regmap_conf = { 175 + .reg_bits = 32, 176 + .val_bits = 32, 177 + .reg_stride = 4, 178 + }; 179 + struct regmap *map; 180 + 181 + map = regmap_init_mmio(dev, base, &icst_regmap_conf); 182 + if (IS_ERR(map)) { 183 + pr_err("could not initialize ICST regmap\n"); 184 + return ERR_CAST(map); 185 + } 186 + return icst_clk_setup(dev, desc, name, parent_name, map); 187 + } 187 188 EXPORT_SYMBOL_GPL(icst_clk_register); 189 + 190 + #ifdef CONFIG_OF 191 + /* 192 + * In a device tree, an memory-mapped ICST clock appear as a child 193 + * of a syscon node. Assume this and probe it only as a child of a 194 + * syscon. 195 + */ 196 + 197 + static const struct icst_params icst525_params = { 198 + .vco_max = ICST525_VCO_MAX_5V, 199 + .vco_min = ICST525_VCO_MIN, 200 + .vd_min = 8, 201 + .vd_max = 263, 202 + .rd_min = 3, 203 + .rd_max = 65, 204 + .s2div = icst525_s2div, 205 + .idx2s = icst525_idx2s, 206 + }; 207 + 208 + static const struct icst_params icst307_params = { 209 + .vco_max = ICST307_VCO_MAX, 210 + .vco_min = ICST307_VCO_MIN, 211 + .vd_min = 4 + 8, 212 + .vd_max = 511 + 8, 213 + .rd_min = 1 + 2, 214 + .rd_max = 127 + 2, 215 + .s2div = icst307_s2div, 216 + .idx2s = icst307_idx2s, 217 + }; 218 + 219 + static void __init of_syscon_icst_setup(struct device_node *np) 220 + { 221 + struct device_node *parent; 222 + struct regmap *map; 223 + struct clk_icst_desc icst_desc; 224 + const char *name = np->name; 225 + const char *parent_name; 226 + struct clk *regclk; 227 + 228 + /* We do not release this reference, we are using it perpetually */ 229 + parent = of_get_parent(np); 230 + if (!parent) { 231 + pr_err("no parent node for syscon ICST clock\n"); 232 + return; 233 + } 234 + map = syscon_node_to_regmap(parent); 235 + if (IS_ERR(map)) { 236 + pr_err("no regmap for syscon ICST clock parent\n"); 237 + return; 238 + } 239 + 240 + if (of_property_read_u32(np, "vco-offset", &icst_desc.vco_offset)) { 241 + pr_err("no VCO register offset for ICST clock\n"); 242 + return; 243 + } 244 + if (of_property_read_u32(np, "lock-offset", &icst_desc.lock_offset)) { 245 + pr_err("no lock register offset for ICST clock\n"); 246 + return; 247 + } 248 + 249 + if (of_device_is_compatible(np, "arm,syscon-icst525")) 250 + icst_desc.params = &icst525_params; 251 + else if (of_device_is_compatible(np, "arm,syscon-icst307")) 252 + icst_desc.params = &icst307_params; 253 + else { 254 + pr_err("unknown ICST clock %s\n", name); 255 + return; 256 + } 257 + 258 + /* Parent clock name is not the same as node parent */ 259 + parent_name = of_clk_get_parent_name(np, 0); 260 + 261 + regclk = icst_clk_setup(NULL, &icst_desc, name, parent_name, map); 262 + if (IS_ERR(regclk)) { 263 + pr_err("error setting up syscon ICST clock %s\n", name); 264 + return; 265 + } 266 + of_clk_add_provider(np, of_clk_src_simple_get, regclk); 267 + pr_debug("registered syscon ICST clock %s\n", name); 268 + } 269 + 270 + CLK_OF_DECLARE(arm_syscon_icst525_clk, 271 + "arm,syscon-icst525", of_syscon_icst_setup); 272 + CLK_OF_DECLARE(arm_syscon_icst307_clk, 273 + "arm,syscon-icst307", of_syscon_icst_setup); 274 + 275 + #endif
+7 -3
drivers/clk/versatile/clk-realview.c
··· 11 11 #include <linux/io.h> 12 12 #include <linux/clk-provider.h> 13 13 14 - #include <mach/hardware.h> 15 - #include <mach/platform.h> 16 - 17 14 #include "clk-icst.h" 15 + 16 + #define REALVIEW_SYS_OSC0_OFFSET 0x0C 17 + #define REALVIEW_SYS_OSC1_OFFSET 0x10 18 + #define REALVIEW_SYS_OSC2_OFFSET 0x14 19 + #define REALVIEW_SYS_OSC3_OFFSET 0x18 20 + #define REALVIEW_SYS_OSC4_OFFSET 0x1C /* OSC1 for RealView/AB */ 21 + #define REALVIEW_SYS_LOCK_OFFSET 0x20 18 22 19 23 /* 20 24 * Implementation of the ARM RealView clock trees.
+4
drivers/soc/versatile/soc-realview.c
··· 36 36 switch ((id >> 16) & 0xfff) { 37 37 case 0x0147: 38 38 return "HBI-0147"; 39 + case 0x0159: 40 + return "HBI-0159"; 39 41 default: 40 42 return "Unknown"; 41 43 } ··· 46 44 static const char *realview_arch_str(u32 id) 47 45 { 48 46 switch ((id >> 8) & 0xf) { 47 + case 0x04: 48 + return "AHB"; 49 49 case 0x05: 50 50 return "Multi-layer AXI"; 51 51 default: