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

Merge tag 'mvebu-soc-3.15-2' of git://git.infradead.org/linux-mvebu into next/soc

Merge "mvebu soc changes for v3.15 (incremental pull #2)" from Jason Cooper:

- mvebu
- Add Armada 375, 380 and 385 SoCs

- kirkwood
- move kirkwood DT support to mach-mvebu
- add mostly DT support for HP T5325 thin client

* tag 'mvebu-soc-3.15-2' of git://git.infradead.org/linux-mvebu:
ARM: kirkwood: Add HP T5325 thin client
ARM: kirkwood: select dtbs based on SoC
ARM: kirkwood: Remove redundant kexec code
ARM: mvebu: Armada 375/38x depend on MULTI_V7
ARM: mvebu: Simplify headers and make local
ARM: mvebu: Enable mvebu-soc-id on Kirkwood
ARM: mvebu: Let kirkwood use the system controller for restart
ARM: mvebu: Move kirkwood DT boards into mach-mvebu
ARM: MM Enable building Feroceon L2 cache controller with ARCH_MVEBU
ARM: Fix default CPU selection for ARCH_MULTI_V5
ARM: MM: Add DT binding for Feroceon L2 cache
ARM: orion: Move cache-feroceon-l2.h out of plat-orion
ARM: mvebu: Add ARCH_MULTI_V7 to SoCs
ARM: kirkwood: ioremap memory control register
ARM: kirkwood: ioremap the cpu_config register before using it.
ARM: kirkwood: Separate board-dt from common and pcie code.
ARM: kirkwood: Drop printing the SoC type and revision
ARM: kirkwood: Convert mv88f6281gtw_ge switch setup to DT
ARM: kirkwood: Give pm.c its own header file.
ARM: mvebu: Rename the ARCH_MVEBU menu option

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

+682 -110
+16
Documentation/devicetree/bindings/arm/mrvl/feroceon.txt
··· 1 + * Marvell Feroceon Cache 2 + 3 + Required properties: 4 + - compatible : Should be either "marvell,feroceon-cache" or 5 + "marvell,kirkwood-cache". 6 + 7 + Optional properties: 8 + - reg : Address of the L2 cache control register. Mandatory for 9 + "marvell,kirkwood-cache", not used by "marvell,feroceon-cache" 10 + 11 + 12 + Example: 13 + l2: l2-cache@20128 { 14 + compatible = "marvell,kirkwood-cache"; 15 + reg = <0x20128 0x4>; 16 + };
+1 -1
arch/arm/Kconfig
··· 898 898 bool "ARMv5 based platforms (ARM926T, XSCALE, PJ1, ...)" 899 899 depends on !ARCH_MULTI_V6_V7 900 900 select ARCH_MULTI_V4_V5 901 - select CPU_ARM926T if (!CPU_ARM946E || CPU_ARM1020 || \ 901 + select CPU_ARM926T if !(CPU_ARM946E || CPU_ARM1020 || \ 902 902 CPU_ARM1020E || CPU_ARM1022 || CPU_ARM1026 || \ 903 903 CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_FEROCEON) 904 904
+5 -2
arch/arm/boot/dts/Makefile
··· 82 82 ecx-2000.dtb 83 83 dtb-$(CONFIG_ARCH_INTEGRATOR) += integratorap.dtb \ 84 84 integratorcp.dtb 85 - dtb-$(CONFIG_ARCH_LPC32XX) += ea3250.dtb phy3250.dtb 86 - dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-cloudbox.dtb \ 85 + kirkwood := \ 86 + kirkwood-cloudbox.dtb \ 87 87 kirkwood-db-88f6281.dtb \ 88 88 kirkwood-db-88f6282.dtb \ 89 89 kirkwood-dns320.dtb \ ··· 117 117 kirkwood-topkick.dtb \ 118 118 kirkwood-ts219-6281.dtb \ 119 119 kirkwood-ts219-6282.dtb 120 + dtb-$(CONFIG_ARCH_KIRKWOOD) += $(kirkwood) 121 + dtb-$(CONFIG_MACH_KIRKWOOD) += $(kirkwood) 122 + dtb-$(CONFIG_ARCH_LPC32XX) += ea3250.dtb phy3250.dtb 120 123 dtb-$(CONFIG_ARCH_MARCO) += marco-evb.dtb 121 124 dtb-$(CONFIG_ARCH_MOXART) += moxart-uc7112lx.dtb 122 125 dtb-$(CONFIG_ARCH_MVEBU) += armada-370-db.dtb \
+62
arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts
··· 122 122 gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; 123 123 }; 124 124 }; 125 + 126 + dsa@0 { 127 + compatible = "marvell,dsa"; 128 + #address-cells = <2>; 129 + #size-cells = <0>; 130 + 131 + dsa,ethernet = <&eth0>; 132 + dsa,mii-bus = <&ethphy0>; 133 + 134 + switch@0 { 135 + #address-cells = <1>; 136 + #size-cells = <0>; 137 + reg = <0 0>; /* MDIO address 0, switch 0 in tree */ 138 + 139 + port@0 { 140 + reg = <0>; 141 + label = "lan1"; 142 + }; 143 + 144 + port@1 { 145 + reg = <1>; 146 + label = "lan2"; 147 + }; 148 + 149 + port@2 { 150 + reg = <2>; 151 + label = "lan3"; 152 + }; 153 + 154 + port@3 { 155 + reg = <3>; 156 + label = "lan4"; 157 + }; 158 + 159 + port@4 { 160 + reg = <4>; 161 + label = "wan"; 162 + }; 163 + 164 + port@5 { 165 + reg = <5>; 166 + label = "cpu"; 167 + }; 168 + }; 169 + }; 170 + }; 171 + 172 + &mdio { 173 + status = "okay"; 174 + 175 + ethphy0: ethernet-phy@ff { 176 + reg = <0xff>; /* No phy attached */ 177 + speed = <1000>; 178 + duplex = <1>; 179 + }; 180 + }; 181 + 182 + &eth0 { 183 + status = "okay"; 184 + ethernet0-port@0 { 185 + phy-handle = <&ethphy0>; 186 + }; 125 187 };
-7
arch/arm/mach-kirkwood/Kconfig
··· 106 106 Say 'Y' here if you want your kernel to support the 107 107 Marvell Kirkwood using flattened device tree. 108 108 109 - config MACH_MV88F6281GTW_GE_DT 110 - bool "Marvell 88F6281 GTW GE Board (Flattened Device Tree)" 111 - depends on ARCH_KIRKWOOD_DT 112 - help 113 - Say 'Y' here if you want your kernel to support the 114 - Marvell 88F6281 GTW GE Board (Flattened Device Tree). 115 - 116 109 endmenu 117 110 118 111 endif
+1 -3
arch/arm/mach-kirkwood/Makefile
··· 1 - obj-y += common.o pcie.o 2 - obj-$(CONFIG_KIRKWOOD_LEGACY) += irq.o mpp.o 1 + obj-$(CONFIG_KIRKWOOD_LEGACY) += irq.o mpp.o common.o pcie.o 3 2 obj-$(CONFIG_PM) += pm.o 4 3 5 4 obj-$(CONFIG_MACH_D2NET_V2) += d2net_v2-setup.o lacie_v2-common.o ··· 12 13 obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o 13 14 14 15 obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o 15 - obj-$(CONFIG_MACH_MV88F6281GTW_GE_DT) += board-mv88f6281gtw_ge.o
+93 -20
arch/arm/mach-kirkwood/board-dt.c
··· 19 19 #include <linux/of_platform.h> 20 20 #include <linux/dma-mapping.h> 21 21 #include <linux/irqchip.h> 22 - #include <linux/kexec.h> 22 + #include <asm/hardware/cache-feroceon-l2.h> 23 23 #include <asm/mach/arch.h> 24 + #include <asm/mach/map.h> 24 25 #include <mach/bridge-regs.h> 25 26 #include <plat/common.h> 26 - #include "common.h" 27 + #include <plat/pcie.h> 28 + #include "pm.h" 29 + 30 + static struct map_desc kirkwood_io_desc[] __initdata = { 31 + { 32 + .virtual = (unsigned long) KIRKWOOD_REGS_VIRT_BASE, 33 + .pfn = __phys_to_pfn(KIRKWOOD_REGS_PHYS_BASE), 34 + .length = KIRKWOOD_REGS_SIZE, 35 + .type = MT_DEVICE, 36 + }, 37 + }; 38 + 39 + static void __init kirkwood_map_io(void) 40 + { 41 + iotable_init(kirkwood_io_desc, ARRAY_SIZE(kirkwood_io_desc)); 42 + } 43 + 44 + static struct resource kirkwood_cpufreq_resources[] = { 45 + [0] = { 46 + .start = CPU_CONTROL_PHYS, 47 + .end = CPU_CONTROL_PHYS + 3, 48 + .flags = IORESOURCE_MEM, 49 + }, 50 + }; 51 + 52 + static struct platform_device kirkwood_cpufreq_device = { 53 + .name = "kirkwood-cpufreq", 54 + .id = -1, 55 + .num_resources = ARRAY_SIZE(kirkwood_cpufreq_resources), 56 + .resource = kirkwood_cpufreq_resources, 57 + }; 58 + 59 + static void __init kirkwood_cpufreq_init(void) 60 + { 61 + platform_device_register(&kirkwood_cpufreq_device); 62 + } 63 + 64 + static struct resource kirkwood_cpuidle_resource[] = { 65 + { 66 + .flags = IORESOURCE_MEM, 67 + .start = DDR_OPERATION_BASE, 68 + .end = DDR_OPERATION_BASE + 3, 69 + }, 70 + }; 71 + 72 + static struct platform_device kirkwood_cpuidle = { 73 + .name = "kirkwood_cpuidle", 74 + .id = -1, 75 + .resource = kirkwood_cpuidle_resource, 76 + .num_resources = 1, 77 + }; 78 + 79 + static void __init kirkwood_cpuidle_init(void) 80 + { 81 + platform_device_register(&kirkwood_cpuidle); 82 + } 83 + 84 + /* Temporary here since mach-mvebu has a function we can use */ 85 + static void kirkwood_restart(enum reboot_mode mode, const char *cmd) 86 + { 87 + /* 88 + * Enable soft reset to assert RSTOUTn. 89 + */ 90 + writel(SOFT_RESET_OUT_EN, RSTOUTn_MASK); 91 + 92 + /* 93 + * Assert soft reset. 94 + */ 95 + writel(SOFT_RESET, SYSTEM_SOFT_RESET); 96 + 97 + while (1) 98 + ; 99 + } 27 100 28 101 #define MV643XX_ETH_MAC_ADDR_LOW 0x0414 29 102 #define MV643XX_ETH_MAC_ADDR_HIGH 0x0418 ··· 177 104 } 178 105 } 179 106 107 + /* 108 + * Disable propagation of mbus errors to the CPU local bus, as this 109 + * causes mbus errors (which can occur for example for PCI aborts) to 110 + * throw CPU aborts, which we're not set up to deal with. 111 + */ 112 + static void __init kirkwood_disable_mbus_error_propagation(void) 113 + { 114 + void __iomem *cpu_config; 115 + 116 + cpu_config = ioremap(CPU_CONFIG_PHYS, 4); 117 + writel(readl(cpu_config) & ~CPU_CONFIG_ERROR_PROP, cpu_config); 118 + iounmap(cpu_config); 119 + } 120 + 180 121 static void __init kirkwood_dt_init(void) 181 122 { 182 - pr_info("Kirkwood: %s.\n", kirkwood_id()); 183 - 184 - /* 185 - * Disable propagation of mbus errors to the CPU local bus, 186 - * as this causes mbus errors (which can occur for example 187 - * for PCI aborts) to throw CPU aborts, which we're not set 188 - * up to deal with. 189 - */ 190 - writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG); 123 + kirkwood_disable_mbus_error_propagation(); 191 124 192 125 BUG_ON(mvebu_mbus_dt_init()); 193 126 194 - kirkwood_l2_init(); 195 - 127 + #ifdef CONFIG_CACHE_FEROCEON_L2 128 + feroceon_of_init(); 129 + #endif 196 130 kirkwood_cpufreq_init(); 197 131 kirkwood_cpuidle_init(); 198 132 199 133 kirkwood_pm_init(); 200 134 kirkwood_dt_eth_fixup(); 201 - 202 - #ifdef CONFIG_KEXEC 203 - kexec_reinit = kirkwood_enable_pcie; 204 - #endif 205 - 206 - if (of_machine_is_compatible("marvell,mv88f6281gtw-ge")) 207 - mv88f6281gtw_ge_init(); 208 135 209 136 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 210 137 }
-50
arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c
··· 1 - /* 2 - * arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c 3 - * 4 - * Marvell 88F6281 GTW GE Board Setup 5 - * 6 - * This file is licensed under the terms of the GNU General Public 7 - * License version 2. This program is licensed "as is" without any 8 - * warranty of any kind, whether express or implied. 9 - */ 10 - 11 - #include <linux/kernel.h> 12 - #include <linux/init.h> 13 - #include <linux/platform_device.h> 14 - #include <linux/irq.h> 15 - #include <linux/timer.h> 16 - #include <linux/mv643xx_eth.h> 17 - #include <linux/ethtool.h> 18 - #include <linux/gpio.h> 19 - #include <net/dsa.h> 20 - #include <asm/mach-types.h> 21 - #include <asm/mach/arch.h> 22 - #include <asm/mach/pci.h> 23 - #include <mach/kirkwood.h> 24 - #include "common.h" 25 - 26 - static struct mv643xx_eth_platform_data mv88f6281gtw_ge_ge00_data = { 27 - .phy_addr = MV643XX_ETH_PHY_NONE, 28 - .speed = SPEED_1000, 29 - .duplex = DUPLEX_FULL, 30 - }; 31 - 32 - static struct dsa_chip_data mv88f6281gtw_ge_switch_chip_data = { 33 - .port_names[0] = "lan1", 34 - .port_names[1] = "lan2", 35 - .port_names[2] = "lan3", 36 - .port_names[3] = "lan4", 37 - .port_names[4] = "wan", 38 - .port_names[5] = "cpu", 39 - }; 40 - 41 - static struct dsa_platform_data mv88f6281gtw_ge_switch_plat_data = { 42 - .nr_chips = 1, 43 - .chip = &mv88f6281gtw_ge_switch_chip_data, 44 - }; 45 - 46 - void __init mv88f6281gtw_ge_init(void) 47 - { 48 - kirkwood_ge00_init(&mv88f6281gtw_ge_ge00_data); 49 - kirkwood_ge00_switch_init(&mv88f6281gtw_ge_switch_plat_data, NO_IRQ); 50 - }
+2 -1
arch/arm/mach-kirkwood/common.c
··· 25 25 #include <asm/page.h> 26 26 #include <asm/mach/map.h> 27 27 #include <asm/mach/time.h> 28 + #include <asm/hardware/cache-feroceon-l2.h> 28 29 #include <mach/kirkwood.h> 29 30 #include <mach/bridge-regs.h> 30 31 #include <linux/platform_data/asoc-kirkwood.h> 31 - #include <plat/cache-feroceon-l2.h> 32 32 #include <linux/platform_data/mmc-mvsdio.h> 33 33 #include <linux/platform_data/mtd-orion_nand.h> 34 34 #include <linux/platform_data/usb-ehci-orion.h> ··· 36 36 #include <plat/time.h> 37 37 #include <linux/platform_data/dma-mv_xor.h> 38 38 #include "common.h" 39 + #include "pm.h" 39 40 40 41 /* These can go away once Kirkwood uses the mvebu-mbus DT binding */ 41 42 #define KIRKWOOD_MBUS_NAND_TARGET 0x01
-13
arch/arm/mach-kirkwood/common.h
··· 58 58 void kirkwood_restart(enum reboot_mode, const char *); 59 59 void kirkwood_clk_init(void); 60 60 61 - #ifdef CONFIG_PM 62 - void kirkwood_pm_init(void); 63 - #else 64 - static inline void kirkwood_pm_init(void) {}; 65 - #endif 66 - 67 - /* board init functions for boards not fully converted to fdt */ 68 - #ifdef CONFIG_MACH_MV88F6281GTW_GE_DT 69 - void mv88f6281gtw_ge_init(void); 70 - #else 71 - static inline void mv88f6281gtw_ge_init(void) {}; 72 - #endif 73 - 74 61 /* early init functions not converted to fdt yet */ 75 62 char *kirkwood_id(void); 76 63 void kirkwood_l2_init(void);
+2
arch/arm/mach-kirkwood/include/mach/bridge-regs.h
··· 14 14 #include <mach/kirkwood.h> 15 15 16 16 #define CPU_CONFIG (BRIDGE_VIRT_BASE + 0x0100) 17 + #define CPU_CONFIG_PHYS (BRIDGE_PHYS_BASE + 0x0100) 17 18 #define CPU_CONFIG_ERROR_PROP 0x00000004 18 19 19 20 #define CPU_CONTROL (BRIDGE_VIRT_BASE + 0x0104) ··· 80 79 #define CGC_RESERVED (0x6 << 21) 81 80 82 81 #define MEMORY_PM_CTRL (BRIDGE_VIRT_BASE + 0x118) 82 + #define MEMORY_PM_CTRL_PHYS (BRIDGE_PHYS_BASE + 0x118) 83 83 84 84 #endif
+6 -3
arch/arm/mach-kirkwood/pm.c
··· 21 21 #include "common.h" 22 22 23 23 static void __iomem *ddr_operation_base; 24 + static void __iomem *memory_pm_ctrl; 24 25 25 26 static void kirkwood_low_power(void) 26 27 { 27 28 u32 mem_pm_ctrl; 28 29 29 - mem_pm_ctrl = readl(MEMORY_PM_CTRL); 30 + mem_pm_ctrl = readl(memory_pm_ctrl); 30 31 31 32 /* Set peripherals to low-power mode */ 32 - writel_relaxed(~0, MEMORY_PM_CTRL); 33 + writel_relaxed(~0, memory_pm_ctrl); 33 34 34 35 /* Set DDR in self-refresh */ 35 36 writel_relaxed(0x7, ddr_operation_base); ··· 42 41 */ 43 42 cpu_do_idle(); 44 43 45 - writel_relaxed(mem_pm_ctrl, MEMORY_PM_CTRL); 44 + writel_relaxed(mem_pm_ctrl, memory_pm_ctrl); 46 45 } 47 46 48 47 static int kirkwood_suspend_enter(suspend_state_t state) ··· 70 69 void __init kirkwood_pm_init(void) 71 70 { 72 71 ddr_operation_base = ioremap(DDR_OPERATION_BASE, 4); 72 + memory_pm_ctrl = ioremap(MEMORY_PM_CTRL_PHYS, 4); 73 + 73 74 suspend_set_ops(&kirkwood_suspend_ops); 74 75 }
+26
arch/arm/mach-kirkwood/pm.h
··· 1 + /* 2 + * Power Management driver for Marvell Kirkwood SoCs 3 + * 4 + * Copyright (C) 2013 Ezequiel Garcia <ezequiel@free-electrons.com> 5 + * Copyright (C) 2010 Simon Guinot <sguinot@lacie.com> 6 + * 7 + * This program is free software; you can redistribute it and/or modify 8 + * it under the terms of the GNU General Public License, 9 + * version 2 of the License. 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 + 17 + #ifndef __ARCH_KIRKWOOD_PM_H 18 + #define __ARCH_KIRKWOOD_PM_H 19 + 20 + #ifdef CONFIG_PM 21 + void kirkwood_pm_init(void); 22 + #else 23 + static inline void kirkwood_pm_init(void) {}; 24 + #endif 25 + 26 + #endif
+1 -1
arch/arm/mach-mv78xx0/common.c
··· 15 15 #include <linux/ata_platform.h> 16 16 #include <linux/clk-provider.h> 17 17 #include <linux/ethtool.h> 18 + #include <asm/hardware/cache-feroceon-l2.h> 18 19 #include <asm/mach/map.h> 19 20 #include <asm/mach/time.h> 20 21 #include <mach/mv78xx0.h> 21 22 #include <mach/bridge-regs.h> 22 - #include <plat/cache-feroceon-l2.h> 23 23 #include <linux/platform_data/usb-ehci-orion.h> 24 24 #include <linux/platform_data/mtd-orion_nand.h> 25 25 #include <plat/time.h>
+30 -6
arch/arm/mach-mvebu/Kconfig
··· 1 1 config ARCH_MVEBU 2 - bool "Marvell SOCs with Device Tree support" if ARCH_MULTI_V7 2 + bool "Marvell Engineering Business Unit (MVEBU) SoCs" if (ARCH_MULTI_V7 || ARCH_MULTI_V5) 3 3 select ARCH_SUPPORTS_BIG_ENDIAN 4 4 select CLKSRC_MMIO 5 5 select GENERIC_IRQ_CHIP ··· 14 14 15 15 if ARCH_MVEBU 16 16 17 - menu "Marvell SOC with device tree" 17 + menu "Marvell EBU SoC variants" 18 18 19 19 config MACH_MVEBU_V7 20 20 bool ··· 22 22 select CACHE_L2X0 23 23 24 24 config MACH_ARMADA_370 25 - bool "Marvell Armada 370 boards" 25 + bool "Marvell Armada 370 boards" if ARCH_MULTI_V7 26 26 select ARMADA_370_CLK 27 27 select CPU_PJ4B 28 28 select MACH_MVEBU_V7 ··· 32 32 on the Marvell Armada 370 SoC with device tree. 33 33 34 34 config MACH_ARMADA_375 35 - bool "Marvell Armada 375 boards" 35 + bool "Marvell Armada 375 boards" if ARCH_MULTI_V7 36 36 select ARM_ERRATA_720789 37 37 select ARM_ERRATA_753970 38 38 select ARM_GIC ··· 46 46 on the Marvell Armada 375 SoC with device tree. 47 47 48 48 config MACH_ARMADA_38X 49 - bool "Marvell Armada 380/385 boards" 49 + bool "Marvell Armada 380/385 boards" if ARCH_MULTI_V7 50 50 select ARM_ERRATA_720789 51 51 select ARM_ERRATA_753970 52 52 select ARM_GIC ··· 60 60 on the Marvell Armada 380/385 SoC with device tree. 61 61 62 62 config MACH_ARMADA_XP 63 - bool "Marvell Armada XP boards" 63 + bool "Marvell Armada XP boards" if ARCH_MULTI_V7 64 64 select ARMADA_XP_CLK 65 65 select CPU_PJ4B 66 66 select MACH_MVEBU_V7 ··· 68 68 help 69 69 Say 'Y' here if you want your kernel to support boards based 70 70 on the Marvell Armada XP SoC with device tree. 71 + 72 + config MACH_KIRKWOOD 73 + bool "Marvell Kirkwood boards" if ARCH_MULTI_V5 74 + select ARCH_HAS_CPUFREQ 75 + select ARCH_REQUIRE_GPIOLIB 76 + select CPU_FEROCEON 77 + select KIRKWOOD_CLK 78 + select OF_IRQ 79 + select ORION_IRQCHIP 80 + select ORION_TIMER 81 + select PCI 82 + select PCI_QUIRKS 83 + select PINCTRL_KIRKWOOD 84 + select USE_OF 85 + help 86 + Say 'Y' here if you want your kernel to support boards based 87 + on the Marvell Kirkwood device tree. 88 + 89 + config MACH_T5325 90 + bool "HP T5325 thin client" 91 + depends on MACH_KIRKWOOD 92 + help 93 + Say 'Y' here if you want your kernel to support the 94 + HP T5325 Thin client 71 95 72 96 endmenu 73 97
+2
arch/arm/mach-mvebu/Makefile
··· 8 8 obj-$(CONFIG_ARCH_MVEBU) += coherency.o coherency_ll.o pmsu.o 9 9 obj-$(CONFIG_SMP) += platsmp.o headsmp.o 10 10 obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 11 + obj-$(CONFIG_MACH_KIRKWOOD) += kirkwood.o kirkwood-pm.o 12 + obj-$(CONFIG_MACH_T5325) += board-t5325.o
+41
arch/arm/mach-mvebu/board-t5325.c
··· 1 + /* 2 + * HP T5325 Board Setup 3 + * 4 + * Copyright (C) 2014 5 + * 6 + * Andrew Lunn <andrew@lunn.ch> 7 + * 8 + * This file is licensed under the terms of the GNU General Public 9 + * License version 2. This program is licensed "as is" without any 10 + * warranty of any kind, whether express or implied. 11 + */ 12 + 13 + #include <linux/kernel.h> 14 + #include <linux/i2c.h> 15 + #include <linux/init.h> 16 + #include <linux/platform_device.h> 17 + #include <sound/alc5623.h> 18 + #include "board.h" 19 + 20 + static struct platform_device hp_t5325_audio_device = { 21 + .name = "t5325-audio", 22 + .id = -1, 23 + }; 24 + 25 + static struct alc5623_platform_data alc5621_data = { 26 + .add_ctrl = 0x3700, 27 + .jack_det_ctrl = 0x4810, 28 + }; 29 + 30 + static struct i2c_board_info i2c_board_info[] __initdata = { 31 + { 32 + I2C_BOARD_INFO("alc5621", 0x1a), 33 + .platform_data = &alc5621_data, 34 + }, 35 + }; 36 + 37 + void __init t5325_init(void) 38 + { 39 + i2c_register_board_info(0, i2c_board_info, ARRAY_SIZE(i2c_board_info)); 40 + platform_device_register(&hp_t5325_audio_device); 41 + }
+22
arch/arm/mach-mvebu/board.h
··· 1 + /* 2 + * Board functions for Marvell System On Chip 3 + * 4 + * Copyright (C) 2014 5 + * 6 + * Andrew Lunn <andrew@lunn.ch> 7 + * 8 + * This file is licensed under the terms of the GNU General Public 9 + * License version 2. This program is licensed "as is" without any 10 + * warranty of any kind, whether express or implied. 11 + */ 12 + 13 + #ifndef __ARCH_MVEBU_BOARD_H 14 + #define __ARCH_MVEBU_BOARD_H 15 + 16 + #ifdef CONFIG_MACH_T5325 17 + void t5325_init(void); 18 + #else 19 + static inline void t5325_init(void) {}; 20 + #endif 21 + 22 + #endif
+76
arch/arm/mach-mvebu/kirkwood-pm.c
··· 1 + /* 2 + * Power Management driver for Marvell Kirkwood SoCs 3 + * 4 + * Copyright (C) 2013 Ezequiel Garcia <ezequiel@free-electrons.com> 5 + * Copyright (C) 2010 Simon Guinot <sguinot@lacie.com> 6 + * 7 + * This program is free software; you can redistribute it and/or modify 8 + * it under the terms of the GNU General Public License, 9 + * version 2 of the License. 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 + 17 + #include <linux/kernel.h> 18 + #include <linux/suspend.h> 19 + #include <linux/io.h> 20 + #include "kirkwood.h" 21 + 22 + static void __iomem *ddr_operation_base; 23 + static void __iomem *memory_pm_ctrl; 24 + 25 + static void kirkwood_low_power(void) 26 + { 27 + u32 mem_pm_ctrl; 28 + 29 + mem_pm_ctrl = readl(memory_pm_ctrl); 30 + 31 + /* Set peripherals to low-power mode */ 32 + writel_relaxed(~0, memory_pm_ctrl); 33 + 34 + /* Set DDR in self-refresh */ 35 + writel_relaxed(0x7, ddr_operation_base); 36 + 37 + /* 38 + * Set CPU in wait-for-interrupt state. 39 + * This disables the CPU core clocks, 40 + * the array clocks, and also the L2 controller. 41 + */ 42 + cpu_do_idle(); 43 + 44 + writel_relaxed(mem_pm_ctrl, memory_pm_ctrl); 45 + } 46 + 47 + static int kirkwood_suspend_enter(suspend_state_t state) 48 + { 49 + switch (state) { 50 + case PM_SUSPEND_STANDBY: 51 + kirkwood_low_power(); 52 + break; 53 + default: 54 + return -EINVAL; 55 + } 56 + return 0; 57 + } 58 + 59 + static int kirkwood_pm_valid_standby(suspend_state_t state) 60 + { 61 + return state == PM_SUSPEND_STANDBY; 62 + } 63 + 64 + static const struct platform_suspend_ops kirkwood_suspend_ops = { 65 + .enter = kirkwood_suspend_enter, 66 + .valid = kirkwood_pm_valid_standby, 67 + }; 68 + 69 + int __init kirkwood_pm_init(void) 70 + { 71 + ddr_operation_base = ioremap(DDR_OPERATION_BASE, 4); 72 + memory_pm_ctrl = ioremap(MEMORY_PM_CTRL_PHYS, 4); 73 + 74 + suspend_set_ops(&kirkwood_suspend_ops); 75 + return 0; 76 + }
+26
arch/arm/mach-mvebu/kirkwood-pm.h
··· 1 + /* 2 + * Power Management driver for Marvell Kirkwood SoCs 3 + * 4 + * Copyright (C) 2013 Ezequiel Garcia <ezequiel@free-electrons.com> 5 + * Copyright (C) 2010 Simon Guinot <sguinot@lacie.com> 6 + * 7 + * This program is free software; you can redistribute it and/or modify 8 + * it under the terms of the GNU General Public License, 9 + * version 2 of the License. 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 + 17 + #ifndef __ARCH_KIRKWOOD_PM_H 18 + #define __ARCH_KIRKWOOD_PM_H 19 + 20 + #ifdef CONFIG_PM 21 + void kirkwood_pm_init(void); 22 + #else 23 + static inline void kirkwood_pm_init(void) {}; 24 + #endif 25 + 26 + #endif
+199
arch/arm/mach-mvebu/kirkwood.c
··· 1 + /* 2 + * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net> 3 + * 4 + * arch/arm/mach-mvebu/kirkwood.c 5 + * 6 + * Flattened Device Tree board initialization 7 + * 8 + * This file is licensed under the terms of the GNU General Public 9 + * License version 2. This program is licensed "as is" without any 10 + * warranty of any kind, whether express or implied. 11 + */ 12 + 13 + #include <linux/clk.h> 14 + #include <linux/kernel.h> 15 + #include <linux/init.h> 16 + #include <linux/mbus.h> 17 + #include <linux/of.h> 18 + #include <linux/of_address.h> 19 + #include <linux/of_net.h> 20 + #include <linux/of_platform.h> 21 + #include <linux/slab.h> 22 + #include <asm/hardware/cache-feroceon-l2.h> 23 + #include <asm/mach/arch.h> 24 + #include <asm/mach/map.h> 25 + #include "kirkwood.h" 26 + #include "kirkwood-pm.h" 27 + #include "common.h" 28 + #include "board.h" 29 + 30 + static struct resource kirkwood_cpufreq_resources[] = { 31 + [0] = { 32 + .start = CPU_CONTROL_PHYS, 33 + .end = CPU_CONTROL_PHYS + 3, 34 + .flags = IORESOURCE_MEM, 35 + }, 36 + }; 37 + 38 + static struct platform_device kirkwood_cpufreq_device = { 39 + .name = "kirkwood-cpufreq", 40 + .id = -1, 41 + .num_resources = ARRAY_SIZE(kirkwood_cpufreq_resources), 42 + .resource = kirkwood_cpufreq_resources, 43 + }; 44 + 45 + static void __init kirkwood_cpufreq_init(void) 46 + { 47 + platform_device_register(&kirkwood_cpufreq_device); 48 + } 49 + 50 + static struct resource kirkwood_cpuidle_resource[] = { 51 + { 52 + .flags = IORESOURCE_MEM, 53 + .start = DDR_OPERATION_BASE, 54 + .end = DDR_OPERATION_BASE + 3, 55 + }, 56 + }; 57 + 58 + static struct platform_device kirkwood_cpuidle = { 59 + .name = "kirkwood_cpuidle", 60 + .id = -1, 61 + .resource = kirkwood_cpuidle_resource, 62 + .num_resources = 1, 63 + }; 64 + 65 + static void __init kirkwood_cpuidle_init(void) 66 + { 67 + platform_device_register(&kirkwood_cpuidle); 68 + } 69 + 70 + #define MV643XX_ETH_MAC_ADDR_LOW 0x0414 71 + #define MV643XX_ETH_MAC_ADDR_HIGH 0x0418 72 + 73 + static void __init kirkwood_dt_eth_fixup(void) 74 + { 75 + struct device_node *np; 76 + 77 + /* 78 + * The ethernet interfaces forget the MAC address assigned by u-boot 79 + * if the clocks are turned off. Usually, u-boot on kirkwood boards 80 + * has no DT support to properly set local-mac-address property. 81 + * As a workaround, we get the MAC address from mv643xx_eth registers 82 + * and update the port device node if no valid MAC address is set. 83 + */ 84 + for_each_compatible_node(np, NULL, "marvell,kirkwood-eth-port") { 85 + struct device_node *pnp = of_get_parent(np); 86 + struct clk *clk; 87 + struct property *pmac; 88 + void __iomem *io; 89 + u8 *macaddr; 90 + u32 reg; 91 + 92 + if (!pnp) 93 + continue; 94 + 95 + /* skip disabled nodes or nodes with valid MAC address*/ 96 + if (!of_device_is_available(pnp) || of_get_mac_address(np)) 97 + goto eth_fixup_skip; 98 + 99 + clk = of_clk_get(pnp, 0); 100 + if (IS_ERR(clk)) 101 + goto eth_fixup_skip; 102 + 103 + io = of_iomap(pnp, 0); 104 + if (!io) 105 + goto eth_fixup_no_map; 106 + 107 + /* ensure port clock is not gated to not hang CPU */ 108 + clk_prepare_enable(clk); 109 + 110 + /* store MAC address register contents in local-mac-address */ 111 + pr_err(FW_INFO "%s: local-mac-address is not set\n", 112 + np->full_name); 113 + 114 + pmac = kzalloc(sizeof(*pmac) + 6, GFP_KERNEL); 115 + if (!pmac) 116 + goto eth_fixup_no_mem; 117 + 118 + pmac->value = pmac + 1; 119 + pmac->length = 6; 120 + pmac->name = kstrdup("local-mac-address", GFP_KERNEL); 121 + if (!pmac->name) { 122 + kfree(pmac); 123 + goto eth_fixup_no_mem; 124 + } 125 + 126 + macaddr = pmac->value; 127 + reg = readl(io + MV643XX_ETH_MAC_ADDR_HIGH); 128 + macaddr[0] = (reg >> 24) & 0xff; 129 + macaddr[1] = (reg >> 16) & 0xff; 130 + macaddr[2] = (reg >> 8) & 0xff; 131 + macaddr[3] = reg & 0xff; 132 + 133 + reg = readl(io + MV643XX_ETH_MAC_ADDR_LOW); 134 + macaddr[4] = (reg >> 8) & 0xff; 135 + macaddr[5] = reg & 0xff; 136 + 137 + of_update_property(np, pmac); 138 + 139 + eth_fixup_no_mem: 140 + iounmap(io); 141 + clk_disable_unprepare(clk); 142 + eth_fixup_no_map: 143 + clk_put(clk); 144 + eth_fixup_skip: 145 + of_node_put(pnp); 146 + } 147 + } 148 + 149 + /* 150 + * Disable propagation of mbus errors to the CPU local bus, as this 151 + * causes mbus errors (which can occur for example for PCI aborts) to 152 + * throw CPU aborts, which we're not set up to deal with. 153 + */ 154 + void kirkwood_disable_mbus_error_propagation(void) 155 + { 156 + void __iomem *cpu_config; 157 + 158 + cpu_config = ioremap(CPU_CONFIG_PHYS, 4); 159 + writel(readl(cpu_config) & ~CPU_CONFIG_ERROR_PROP, cpu_config); 160 + } 161 + 162 + static struct of_dev_auxdata auxdata[] __initdata = { 163 + OF_DEV_AUXDATA("marvell,kirkwood-audio", 0xf10a0000, 164 + "mvebu-audio", NULL), 165 + { /* sentinel */ } 166 + }; 167 + 168 + static void __init kirkwood_dt_init(void) 169 + { 170 + kirkwood_disable_mbus_error_propagation(); 171 + 172 + BUG_ON(mvebu_mbus_dt_init()); 173 + 174 + #ifdef CONFIG_CACHE_FEROCEON_L2 175 + feroceon_of_init(); 176 + #endif 177 + kirkwood_cpufreq_init(); 178 + kirkwood_cpuidle_init(); 179 + 180 + kirkwood_pm_init(); 181 + kirkwood_dt_eth_fixup(); 182 + 183 + if (of_machine_is_compatible("hp,t5325")) 184 + t5325_init(); 185 + 186 + of_platform_populate(NULL, of_default_bus_match_table, auxdata, NULL); 187 + } 188 + 189 + static const char * const kirkwood_dt_board_compat[] = { 190 + "marvell,kirkwood", 191 + NULL 192 + }; 193 + 194 + DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)") 195 + /* Maintainer: Jason Cooper <jason@lakedaemon.net> */ 196 + .init_machine = kirkwood_dt_init, 197 + .restart = mvebu_restart, 198 + .dt_compat = kirkwood_dt_board_compat, 199 + MACHINE_END
+22
arch/arm/mach-mvebu/kirkwood.h
··· 1 + /* 2 + * arch/arm/mach-mvebu/kirkwood.h 3 + * 4 + * Generic definitions for Marvell Kirkwood SoC flavors: 5 + * 88F6180, 88F6192 and 88F6281. 6 + * 7 + * This file is licensed under the terms of the GNU General Public 8 + * License version 2. This program is licensed "as is" without any 9 + * warranty of any kind, whether express or implied. 10 + */ 11 + 12 + #define KIRKWOOD_REGS_PHYS_BASE 0xf1000000 13 + #define DDR_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x00000) 14 + #define BRIDGE_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x20000) 15 + 16 + #define DDR_OPERATION_BASE (DDR_PHYS_BASE + 0x1418) 17 + 18 + #define CPU_CONFIG_PHYS (BRIDGE_PHYS_BASE + 0x0100) 19 + #define CPU_CONFIG_ERROR_PROP 0x00000004 20 + 21 + #define CPU_CONTROL_PHYS (BRIDGE_PHYS_BASE + 0x0104) 22 + #define MEMORY_PM_CTRL_PHYS (BRIDGE_PHYS_BASE + 0x0118)
+1
arch/arm/mach-mvebu/mvebu-soc-id.c
··· 38 38 static const struct of_device_id mvebu_pcie_of_match_table[] = { 39 39 { .compatible = "marvell,armada-xp-pcie", }, 40 40 { .compatible = "marvell,armada-370-pcie", }, 41 + { .compatible = "marvell,kirkwood-pcie" }, 41 42 {}, 42 43 }; 43 44
+1 -1
arch/arm/mm/Kconfig
··· 855 855 856 856 config CACHE_FEROCEON_L2 857 857 bool "Enable the Feroceon L2 cache controller" 858 - depends on ARCH_KIRKWOOD || ARCH_MV78XX0 858 + depends on ARCH_KIRKWOOD || ARCH_MV78XX0 || ARCH_MVEBU 859 859 default y 860 860 select OUTER_CACHE 861 861 help
+44 -1
arch/arm/mm/cache-feroceon-l2.c
··· 13 13 */ 14 14 15 15 #include <linux/init.h> 16 + #include <linux/of.h> 17 + #include <linux/of_address.h> 16 18 #include <linux/highmem.h> 19 + #include <linux/io.h> 17 20 #include <asm/cacheflush.h> 18 21 #include <asm/cp15.h> 19 - #include <plat/cache-feroceon-l2.h> 22 + #include <asm/hardware/cache-feroceon-l2.h> 23 + 24 + #define L2_WRITETHROUGH_KIRKWOOD BIT(4) 20 25 21 26 /* 22 27 * Low-level cache maintenance operations. ··· 355 350 printk(KERN_INFO "Feroceon L2: Cache support initialised%s.\n", 356 351 l2_wt_override ? ", in WT override mode" : ""); 357 352 } 353 + #ifdef CONFIG_OF 354 + static const struct of_device_id feroceon_ids[] __initconst = { 355 + { .compatible = "marvell,kirkwood-cache"}, 356 + { .compatible = "marvell,feroceon-cache"}, 357 + {} 358 + }; 359 + 360 + int __init feroceon_of_init(void) 361 + { 362 + struct device_node *node; 363 + void __iomem *base; 364 + bool l2_wt_override = false; 365 + struct resource res; 366 + 367 + #if defined(CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH) 368 + l2_wt_override = true; 369 + #endif 370 + 371 + node = of_find_matching_node(NULL, feroceon_ids); 372 + if (node && of_device_is_compatible(node, "marvell,kirkwood-cache")) { 373 + if (of_address_to_resource(node, 0, &res)) 374 + return -ENODEV; 375 + 376 + base = ioremap(res.start, resource_size(&res)); 377 + if (!base) 378 + return -ENOMEM; 379 + 380 + if (l2_wt_override) 381 + writel(readl(base) | L2_WRITETHROUGH_KIRKWOOD, base); 382 + else 383 + writel(readl(base) & ~L2_WRITETHROUGH_KIRKWOOD, base); 384 + } 385 + 386 + feroceon_l2_init(l2_wt_override); 387 + 388 + return 0; 389 + } 390 + #endif
+3 -1
arch/arm/plat-orion/include/plat/cache-feroceon-l2.h arch/arm/include/asm/hardware/cache-feroceon-l2.h
··· 1 1 /* 2 - * arch/arm/plat-orion/include/plat/cache-feroceon-l2.h 2 + * arch/arm/include/asm/hardware/cache-feroceon-l2.h 3 3 * 4 4 * Copyright (C) 2008 Marvell Semiconductor 5 5 * ··· 9 9 */ 10 10 11 11 extern void __init feroceon_l2_init(int l2_wt_override); 12 + extern int __init feroceon_of_init(void); 13 +