aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-spear
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-08-08 14:34:32 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-08 14:34:32 -0400
commit10c8e0562057b5d64ea170feab148e1550420030 (patch)
treecfd387208c85e893c93d24e324d147eb6e9abfc9 /arch/arm/mach-spear
parentd4e1f5a14e17d4f0e8034c0967511884bcb12fba (diff)
parent3e528cb7bae00ba0d73def6645d0f2fa906ee3e8 (diff)
Merge tag 'drivers-for-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC driver changes from Olof Johansson: "A handful of driver-related changes. We've had a bunch of them going in through other branches as well, so it's only a part of what we really have this release. Larger pieces are: - Removal of a now unused PWM driver for atmel [ This includes AVR32 changes that have been appropriately acked ] - Performance counter support for the arm CCN interconnect - OMAP mailbox driver cleanups and consolidation - PCI and SATA PHY drivers for SPEAr 13xx platforms - Redefinition (with backwards compatibility!) of PCI DT bindings for Tegra to better model regulators/power" Note: this merge also fixes up the semantic conflict with the new calling convention for devm_phy_create(), see commit f0ed817638b5 ("phy: core: Let node ptr of PHY point to PHY and not of PHY provider") that came in through Greg's USB tree. Semantic merge patch by Stephen Rothwell <sfr@canb.auug.org.au> through the next tree. * tag 'drivers-for-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (38 commits) bus: arm-ccn: Fix error handling at event allocation mailbox/omap: add a parent structure for every IP instance mailbox/omap: remove the private mailbox structure mailbox/omap: consolidate OMAP mailbox driver mailbox/omap: simplify the fifo assignment by using macros mailbox/omap: remove omap_mbox_type_t from mailbox ops mailbox/omap: remove OMAP1 mailbox driver mailbox/omap: use devm_* interfaces bus: ARM CCN: add PERF_EVENTS dependency bus: ARM CCN PMU driver PCI: spear: Remove spear13xx_pcie_remove() PCI: spear: Fix Section mismatch compilation warning for probe() ARM: tegra: Remove legacy PCIe power supply properties PCI: tegra: Remove deprecated power supply properties PCI: tegra: Implement accurate power supply scheme ARM: SPEAr13xx: Update defconfigs ARM: SPEAr13xx: Add pcie and miphy DT nodes ARM: SPEAr13xx: Add bindings and dt node for misc block ARM: SPEAr13xx: Fix static mapping table phy: Add drivers for PCIe and SATA phy on SPEAr13xx ...
Diffstat (limited to 'arch/arm/mach-spear')
-rw-r--r--arch/arm/mach-spear/Kconfig4
-rw-r--r--arch/arm/mach-spear/include/mach/spear.h4
-rw-r--r--arch/arm/mach-spear/spear1340.c125
-rw-r--r--arch/arm/mach-spear/spear13xx.c2
4 files changed, 8 insertions, 127 deletions
diff --git a/arch/arm/mach-spear/Kconfig b/arch/arm/mach-spear/Kconfig
index 90df2022276a..6fd4dc88160b 100644
--- a/arch/arm/mach-spear/Kconfig
+++ b/arch/arm/mach-spear/Kconfig
@@ -19,6 +19,8 @@ config ARCH_SPEAR13XX
19 select HAVE_ARM_SCU if SMP 19 select HAVE_ARM_SCU if SMP
20 select HAVE_ARM_TWD if SMP 20 select HAVE_ARM_TWD if SMP
21 select PINCTRL 21 select PINCTRL
22 select MFD_SYSCON
23 select MIGHT_HAVE_PCI
22 help 24 help
23 Supports for ARM's SPEAR13XX family 25 Supports for ARM's SPEAR13XX family
24 26
@@ -27,12 +29,14 @@ if ARCH_SPEAR13XX
27config MACH_SPEAR1310 29config MACH_SPEAR1310
28 bool "SPEAr1310 Machine support with Device Tree" 30 bool "SPEAr1310 Machine support with Device Tree"
29 select PINCTRL_SPEAR1310 31 select PINCTRL_SPEAR1310
32 select PHY_ST_SPEAR1310_MIPHY
30 help 33 help
31 Supports ST SPEAr1310 machine configured via the device-tree 34 Supports ST SPEAr1310 machine configured via the device-tree
32 35
33config MACH_SPEAR1340 36config MACH_SPEAR1340
34 bool "SPEAr1340 Machine support with Device Tree" 37 bool "SPEAr1340 Machine support with Device Tree"
35 select PINCTRL_SPEAR1340 38 select PINCTRL_SPEAR1340
39 select PHY_ST_SPEAR1340_MIPHY
36 help 40 help
37 Supports ST SPEAr1340 machine configured via the device-tree 41 Supports ST SPEAr1340 machine configured via the device-tree
38 42
diff --git a/arch/arm/mach-spear/include/mach/spear.h b/arch/arm/mach-spear/include/mach/spear.h
index 5cdc53d9b653..f2d6a0176575 100644
--- a/arch/arm/mach-spear/include/mach/spear.h
+++ b/arch/arm/mach-spear/include/mach/spear.h
@@ -52,10 +52,10 @@
52#ifdef CONFIG_ARCH_SPEAR13XX 52#ifdef CONFIG_ARCH_SPEAR13XX
53 53
54#define PERIP_GRP2_BASE UL(0xB3000000) 54#define PERIP_GRP2_BASE UL(0xB3000000)
55#define VA_PERIP_GRP2_BASE IOMEM(0xFE000000) 55#define VA_PERIP_GRP2_BASE IOMEM(0xF9000000)
56#define MCIF_SDHCI_BASE UL(0xB3000000) 56#define MCIF_SDHCI_BASE UL(0xB3000000)
57#define SYSRAM0_BASE UL(0xB3800000) 57#define SYSRAM0_BASE UL(0xB3800000)
58#define VA_SYSRAM0_BASE IOMEM(0xFE800000) 58#define VA_SYSRAM0_BASE IOMEM(0xF9800000)
59#define SYS_LOCATION (VA_SYSRAM0_BASE + 0x600) 59#define SYS_LOCATION (VA_SYSRAM0_BASE + 0x600)
60 60
61#define PERIP_GRP1_BASE UL(0xE0000000) 61#define PERIP_GRP1_BASE UL(0xE0000000)
diff --git a/arch/arm/mach-spear/spear1340.c b/arch/arm/mach-spear/spear1340.c
index c601799b4aea..3f3c0f124bd3 100644
--- a/arch/arm/mach-spear/spear1340.c
+++ b/arch/arm/mach-spear/spear1340.c
@@ -13,136 +13,13 @@
13 13
14#define pr_fmt(fmt) "SPEAr1340: " fmt 14#define pr_fmt(fmt) "SPEAr1340: " fmt
15 15
16#include <linux/ahci_platform.h>
17#include <linux/amba/serial.h>
18#include <linux/delay.h>
19#include <linux/of_platform.h> 16#include <linux/of_platform.h>
20#include <asm/mach/arch.h> 17#include <asm/mach/arch.h>
21#include "generic.h" 18#include "generic.h"
22#include <mach/spear.h>
23
24/* FIXME: Move SATA PHY code into a standalone driver */
25
26/* Base addresses */
27#define SPEAR1340_SATA_BASE UL(0xB1000000)
28
29/* Power Management Registers */
30#define SPEAR1340_PCM_CFG (VA_MISC_BASE + 0x100)
31#define SPEAR1340_PCM_WKUP_CFG (VA_MISC_BASE + 0x104)
32#define SPEAR1340_SWITCH_CTR (VA_MISC_BASE + 0x108)
33
34#define SPEAR1340_PERIP1_SW_RST (VA_MISC_BASE + 0x318)
35#define SPEAR1340_PERIP2_SW_RST (VA_MISC_BASE + 0x31C)
36#define SPEAR1340_PERIP3_SW_RST (VA_MISC_BASE + 0x320)
37
38/* PCIE - SATA configuration registers */
39#define SPEAR1340_PCIE_SATA_CFG (VA_MISC_BASE + 0x424)
40 /* PCIE CFG MASks */
41 #define SPEAR1340_PCIE_CFG_DEVICE_PRESENT (1 << 11)
42 #define SPEAR1340_PCIE_CFG_POWERUP_RESET (1 << 10)
43 #define SPEAR1340_PCIE_CFG_CORE_CLK_EN (1 << 9)
44 #define SPEAR1340_PCIE_CFG_AUX_CLK_EN (1 << 8)
45 #define SPEAR1340_SATA_CFG_TX_CLK_EN (1 << 4)
46 #define SPEAR1340_SATA_CFG_RX_CLK_EN (1 << 3)
47 #define SPEAR1340_SATA_CFG_POWERUP_RESET (1 << 2)
48 #define SPEAR1340_SATA_CFG_PM_CLK_EN (1 << 1)
49 #define SPEAR1340_PCIE_SATA_SEL_PCIE (0)
50 #define SPEAR1340_PCIE_SATA_SEL_SATA (1)
51 #define SPEAR1340_SATA_PCIE_CFG_MASK 0xF1F
52 #define SPEAR1340_PCIE_CFG_VAL (SPEAR1340_PCIE_SATA_SEL_PCIE | \
53 SPEAR1340_PCIE_CFG_AUX_CLK_EN | \
54 SPEAR1340_PCIE_CFG_CORE_CLK_EN | \
55 SPEAR1340_PCIE_CFG_POWERUP_RESET | \
56 SPEAR1340_PCIE_CFG_DEVICE_PRESENT)
57 #define SPEAR1340_SATA_CFG_VAL (SPEAR1340_PCIE_SATA_SEL_SATA | \
58 SPEAR1340_SATA_CFG_PM_CLK_EN | \
59 SPEAR1340_SATA_CFG_POWERUP_RESET | \
60 SPEAR1340_SATA_CFG_RX_CLK_EN | \
61 SPEAR1340_SATA_CFG_TX_CLK_EN)
62
63#define SPEAR1340_PCIE_MIPHY_CFG (VA_MISC_BASE + 0x428)
64 #define SPEAR1340_MIPHY_OSC_BYPASS_EXT (1 << 31)
65 #define SPEAR1340_MIPHY_CLK_REF_DIV2 (1 << 27)
66 #define SPEAR1340_MIPHY_CLK_REF_DIV4 (2 << 27)
67 #define SPEAR1340_MIPHY_CLK_REF_DIV8 (3 << 27)
68 #define SPEAR1340_MIPHY_PLL_RATIO_TOP(x) (x << 0)
69 #define SPEAR1340_PCIE_SATA_MIPHY_CFG_SATA \
70 (SPEAR1340_MIPHY_OSC_BYPASS_EXT | \
71 SPEAR1340_MIPHY_CLK_REF_DIV2 | \
72 SPEAR1340_MIPHY_PLL_RATIO_TOP(60))
73 #define SPEAR1340_PCIE_SATA_MIPHY_CFG_SATA_25M_CRYSTAL_CLK \
74 (SPEAR1340_MIPHY_PLL_RATIO_TOP(120))
75 #define SPEAR1340_PCIE_SATA_MIPHY_CFG_PCIE \
76 (SPEAR1340_MIPHY_OSC_BYPASS_EXT | \
77 SPEAR1340_MIPHY_PLL_RATIO_TOP(25))
78
79/* SATA device registration */
80static int sata_miphy_init(struct device *dev, void __iomem *addr)
81{
82 writel(SPEAR1340_SATA_CFG_VAL, SPEAR1340_PCIE_SATA_CFG);
83 writel(SPEAR1340_PCIE_SATA_MIPHY_CFG_SATA_25M_CRYSTAL_CLK,
84 SPEAR1340_PCIE_MIPHY_CFG);
85 /* Switch on sata power domain */
86 writel((readl(SPEAR1340_PCM_CFG) | (0x800)), SPEAR1340_PCM_CFG);
87 msleep(20);
88 /* Disable PCIE SATA Controller reset */
89 writel((readl(SPEAR1340_PERIP1_SW_RST) & (~0x1000)),
90 SPEAR1340_PERIP1_SW_RST);
91 msleep(20);
92
93 return 0;
94}
95
96static void sata_miphy_exit(struct device *dev)
97{
98 writel(0, SPEAR1340_PCIE_SATA_CFG);
99 writel(0, SPEAR1340_PCIE_MIPHY_CFG);
100
101 /* Enable PCIE SATA Controller reset */
102 writel((readl(SPEAR1340_PERIP1_SW_RST) | (0x1000)),
103 SPEAR1340_PERIP1_SW_RST);
104 msleep(20);
105 /* Switch off sata power domain */
106 writel((readl(SPEAR1340_PCM_CFG) & (~0x800)), SPEAR1340_PCM_CFG);
107 msleep(20);
108}
109
110static int sata_suspend(struct device *dev)
111{
112 if (dev->power.power_state.event == PM_EVENT_FREEZE)
113 return 0;
114
115 sata_miphy_exit(dev);
116
117 return 0;
118}
119
120static int sata_resume(struct device *dev)
121{
122 if (dev->power.power_state.event == PM_EVENT_THAW)
123 return 0;
124
125 return sata_miphy_init(dev, NULL);
126}
127
128static struct ahci_platform_data sata_pdata = {
129 .init = sata_miphy_init,
130 .exit = sata_miphy_exit,
131 .suspend = sata_suspend,
132 .resume = sata_resume,
133};
134
135/* Add SPEAr1340 auxdata to pass platform data */
136static struct of_dev_auxdata spear1340_auxdata_lookup[] __initdata = {
137 OF_DEV_AUXDATA("snps,spear-ahci", SPEAR1340_SATA_BASE, NULL,
138 &sata_pdata),
139 {}
140};
141 19
142static void __init spear1340_dt_init(void) 20static void __init spear1340_dt_init(void)
143{ 21{
144 of_platform_populate(NULL, of_default_bus_match_table, 22 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
145 spear1340_auxdata_lookup, NULL);
146 platform_device_register_simple("spear-cpufreq", -1, NULL, 0); 23 platform_device_register_simple("spear-cpufreq", -1, NULL, 0);
147} 24}
148 25
diff --git a/arch/arm/mach-spear/spear13xx.c b/arch/arm/mach-spear/spear13xx.c
index 8b56fe61a492..2e463a93468d 100644
--- a/arch/arm/mach-spear/spear13xx.c
+++ b/arch/arm/mach-spear/spear13xx.c
@@ -52,7 +52,7 @@ void __init spear13xx_l2x0_init(void)
52/* 52/*
53 * Following will create 16MB static virtual/physical mappings 53 * Following will create 16MB static virtual/physical mappings
54 * PHYSICAL VIRTUAL 54 * PHYSICAL VIRTUAL
55 * 0xB3000000 0xFE000000 55 * 0xB3000000 0xF9000000
56 * 0xE0000000 0xFD000000 56 * 0xE0000000 0xFD000000
57 * 0xEC000000 0xFC000000 57 * 0xEC000000 0xFC000000
58 * 0xED000000 0xFB000000 58 * 0xED000000 0xFB000000