aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-04-05 18:29:04 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-05 18:29:04 -0400
commitf83ccb93585d1f472c30fa2bbb8b56c23dbdb506 (patch)
tree6548d92ff3f362f590bc96129df3e5cb5170ac02 /arch/arm/mach-omap2
parent930b440cd8256f3861bdb0a59d26efaadac7941a (diff)
parent50b4af414d414af9e4df6f64e613bb0ffe581055 (diff)
Merge tag 'dt-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC device tree changes from Arnd Bergmann: "A large part of the arm-soc patches are nowadays DT changes, adding support for new SoCs, boards and devices without changing kernel source. The plan is still to move the devicetree files out of the kernel tree and reduce the amount of churn going on here, but we keep finding reasons to delay doing that. Changes are really all over the place, with little sticking out particularly. We have contributions from a total of 116 people in this branch. Unfortunately, the size of this branch also causes a significant number of conflicts at the moment, typically when subsystem maintainers merge patches that change the driver at the same time as the dts files. In most cases this could be avoided because the dts changes are supposed to be compatible in both ways, and we are asking everyone to send ARM dts changes through our tree only" * tag 'dt-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (541 commits) dts: stmmac: Document the clocks property in the stmmac base document dts: socfpga: Add DTS entry for adding the stmmac glue layer for stmmac. ARM: STi: stih41x: Add support for the FSM Serial Flash Controller ARM: STi: stih416: Add support for the FSM Serial Flash Controller ARM: tegra: fix Dalmore pinctrl configuration ARM: dts: keystone: use common "ti,keystone" compatible instead of -evm ARM: dts: k2hk-evm: set ubifs partition size for 512M NAND ARM: dts: Build all keystone dt blobs ARM: dts: keystone: Fix control register range for clktsip ARM: dts: keystone: Fix domain register range for clkfftc1 ARM: dts: bcm28155-ap: leave camldo1 on to fix reboot ARM: dts: add bcm590xx pmu support and enable for bcm28155-ap ARM: dts: bcm21664: Add device tree files. ARM: DT: bcm21664: Device tree bindings ARM: efm32: properly namespace i2c location property ARM: efm32: fix unit address part in USART2 device nodes' names ARM: mvebu: Enable NAND controller in Armada 385-DB ARM: mvebu: Add support for NAND controller in Armada 38x SoC ARM: mvebu: Add the Core Divider clock to Armada 38x SoCs ARM: mvebu: Add a 2 GHz fixed-clock on Armada 38x SoCs ...
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/clockdomains3xxx_data.c2
-rw-r--r--arch/arm/mach-omap2/devices.c3
-rw-r--r--arch/arm/mach-omap2/gpmc-nand.c31
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_3xxx_data.c12
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_54xx_data.c83
-rw-r--r--arch/arm/mach-omap2/pdata-quirks.c117
6 files changed, 210 insertions, 38 deletions
diff --git a/arch/arm/mach-omap2/clockdomains3xxx_data.c b/arch/arm/mach-omap2/clockdomains3xxx_data.c
index e6b91e552d3d..f03dc97921ad 100644
--- a/arch/arm/mach-omap2/clockdomains3xxx_data.c
+++ b/arch/arm/mach-omap2/clockdomains3xxx_data.c
@@ -247,7 +247,7 @@ static struct clockdomain neon_clkdm = {
247static struct clockdomain iva2_clkdm = { 247static struct clockdomain iva2_clkdm = {
248 .name = "iva2_clkdm", 248 .name = "iva2_clkdm",
249 .pwrdm = { .name = "iva2_pwrdm" }, 249 .pwrdm = { .name = "iva2_pwrdm" },
250 .flags = CLKDM_CAN_HWSUP_SWSUP, 250 .flags = CLKDM_CAN_SWSUP,
251 .dep_bit = OMAP3430_PM_WKDEP_MPU_EN_IVA2_SHIFT, 251 .dep_bit = OMAP3430_PM_WKDEP_MPU_EN_IVA2_SHIFT,
252 .wkdep_srcs = iva2_wkdeps, 252 .wkdep_srcs = iva2_wkdeps,
253 .clktrctrl_mask = OMAP3430_CLKTRCTRL_IVA2_MASK, 253 .clktrctrl_mask = OMAP3430_CLKTRCTRL_IVA2_MASK,
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 0dd6398bade4..e58609b312c7 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -229,6 +229,9 @@ static struct omap_iommu_arch_data omap3_isp_iommu = {
229 229
230int omap3_init_camera(struct isp_platform_data *pdata) 230int omap3_init_camera(struct isp_platform_data *pdata)
231{ 231{
232 if (of_have_populated_dt())
233 omap3_isp_iommu.name = "480bd400.mmu";
234
232 omap3isp_device.dev.platform_data = pdata; 235 omap3isp_device.dev.platform_data = pdata;
233 omap3isp_device.dev.archdata.iommu = &omap3_isp_iommu; 236 omap3isp_device.dev.archdata.iommu = &omap3_isp_iommu;
234 237
diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c
index 174caecc3186..4349e82debfe 100644
--- a/arch/arm/mach-omap2/gpmc-nand.c
+++ b/arch/arm/mach-omap2/gpmc-nand.c
@@ -45,24 +45,31 @@ static struct platform_device gpmc_nand_device = {
45 45
46static bool gpmc_hwecc_bch_capable(enum omap_ecc ecc_opt) 46static bool gpmc_hwecc_bch_capable(enum omap_ecc ecc_opt)
47{ 47{
48 /* support only OMAP3 class */ 48 /* platforms which support all ECC schemes */
49 if (!cpu_is_omap34xx() && !soc_is_am33xx()) { 49 if (soc_is_am33xx() || cpu_is_omap44xx() ||
50 pr_err("BCH ecc is not supported on this CPU\n"); 50 soc_is_omap54xx() || soc_is_dra7xx())
51 return 1;
52
53 /* OMAP3xxx do not have ELM engine, so cannot support ECC schemes
54 * which require H/W based ECC error detection */
55 if ((cpu_is_omap34xx() || cpu_is_omap3630()) &&
56 ((ecc_opt == OMAP_ECC_BCH4_CODE_HW) ||
57 (ecc_opt == OMAP_ECC_BCH8_CODE_HW)))
51 return 0; 58 return 0;
52 }
53 59
54 /* 60 /*
55 * For now, assume 4-bit mode is only supported on OMAP3630 ES1.x, x>=1 61 * For now, assume 4-bit mode is only supported on OMAP3630 ES1.x, x>=1
56 * and AM33xx derivates. Other chips may be added if confirmed to work. 62 * and AM33xx derivates. Other chips may be added if confirmed to work.
57 */ 63 */
58 if ((ecc_opt == OMAP_ECC_BCH4_CODE_HW) && 64 if ((ecc_opt == OMAP_ECC_BCH4_CODE_HW_DETECTION_SW) &&
59 (!cpu_is_omap3630() || (GET_OMAP_REVISION() == 0)) && 65 (!cpu_is_omap3630() || (GET_OMAP_REVISION() == 0)))
60 (!soc_is_am33xx())) {
61 pr_err("BCH 4-bit mode is not supported on this CPU\n");
62 return 0; 66 return 0;
63 }
64 67
65 return 1; 68 /* legacy platforms support only HAM1 (1-bit Hamming) ECC scheme */
69 if (ecc_opt == OMAP_ECC_HAM1_CODE_HW)
70 return 1;
71 else
72 return 0;
66} 73}
67 74
68/* This function will go away once the device-tree convertion is complete */ 75/* This function will go away once the device-tree convertion is complete */
@@ -133,8 +140,10 @@ int gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data,
133 140
134 gpmc_update_nand_reg(&gpmc_nand_data->reg, gpmc_nand_data->cs); 141 gpmc_update_nand_reg(&gpmc_nand_data->reg, gpmc_nand_data->cs);
135 142
136 if (!gpmc_hwecc_bch_capable(gpmc_nand_data->ecc_opt)) 143 if (!gpmc_hwecc_bch_capable(gpmc_nand_data->ecc_opt)) {
144 dev_err(dev, "Unsupported NAND ECC scheme selected\n");
137 return -EINVAL; 145 return -EINVAL;
146 }
138 147
139 err = platform_device_register(&gpmc_nand_device); 148 err = platform_device_register(&gpmc_nand_device);
140 if (err < 0) { 149 if (err < 0) {
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 4c3b1e6df508..9c7e23aa0e7f 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -3029,8 +3029,6 @@ static struct omap_hwmod omap3xxx_mmu_isp_hwmod = {
3029 .flags = HWMOD_NO_IDLEST, 3029 .flags = HWMOD_NO_IDLEST,
3030}; 3030};
3031 3031
3032#ifdef CONFIG_OMAP_IOMMU_IVA2
3033
3034/* mmu iva */ 3032/* mmu iva */
3035 3033
3036static struct omap_mmu_dev_attr mmu_iva_dev_attr = { 3034static struct omap_mmu_dev_attr mmu_iva_dev_attr = {
@@ -3070,20 +3068,22 @@ static struct omap_hwmod omap3xxx_mmu_iva_hwmod = {
3070 .name = "mmu_iva", 3068 .name = "mmu_iva",
3071 .class = &omap3xxx_mmu_hwmod_class, 3069 .class = &omap3xxx_mmu_hwmod_class,
3072 .mpu_irqs = omap3xxx_mmu_iva_irqs, 3070 .mpu_irqs = omap3xxx_mmu_iva_irqs,
3071 .clkdm_name = "iva2_clkdm",
3073 .rst_lines = omap3xxx_mmu_iva_resets, 3072 .rst_lines = omap3xxx_mmu_iva_resets,
3074 .rst_lines_cnt = ARRAY_SIZE(omap3xxx_mmu_iva_resets), 3073 .rst_lines_cnt = ARRAY_SIZE(omap3xxx_mmu_iva_resets),
3075 .main_clk = "iva2_ck", 3074 .main_clk = "iva2_ck",
3076 .prcm = { 3075 .prcm = {
3077 .omap2 = { 3076 .omap2 = {
3078 .module_offs = OMAP3430_IVA2_MOD, 3077 .module_offs = OMAP3430_IVA2_MOD,
3078 .module_bit = OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_SHIFT,
3079 .idlest_reg_id = 1,
3080 .idlest_idle_bit = OMAP3430_ST_IVA2_SHIFT,
3079 }, 3081 },
3080 }, 3082 },
3081 .dev_attr = &mmu_iva_dev_attr, 3083 .dev_attr = &mmu_iva_dev_attr,
3082 .flags = HWMOD_NO_IDLEST, 3084 .flags = HWMOD_NO_IDLEST,
3083}; 3085};
3084 3086
3085#endif
3086
3087/* l4_per -> gpio4 */ 3087/* l4_per -> gpio4 */
3088static struct omap_hwmod_addr_space omap3xxx_gpio4_addrs[] = { 3088static struct omap_hwmod_addr_space omap3xxx_gpio4_addrs[] = {
3089 { 3089 {
@@ -3855,9 +3855,7 @@ static struct omap_hwmod_ocp_if *omap34xx_hwmod_ocp_ifs[] __initdata = {
3855 &omap3xxx_l4_core__hdq1w, 3855 &omap3xxx_l4_core__hdq1w,
3856 &omap3xxx_sad2d__l3, 3856 &omap3xxx_sad2d__l3,
3857 &omap3xxx_l4_core__mmu_isp, 3857 &omap3xxx_l4_core__mmu_isp,
3858#ifdef CONFIG_OMAP_IOMMU_IVA2
3859 &omap3xxx_l3_main__mmu_iva, 3858 &omap3xxx_l3_main__mmu_iva,
3860#endif
3861 &omap34xx_l4_core__ssi, 3859 &omap34xx_l4_core__ssi,
3862 NULL 3860 NULL
3863}; 3861};
@@ -3881,9 +3879,7 @@ static struct omap_hwmod_ocp_if *omap36xx_hwmod_ocp_ifs[] __initdata = {
3881 &omap3xxx_l4_core__hdq1w, 3879 &omap3xxx_l4_core__hdq1w,
3882 &omap3xxx_sad2d__l3, 3880 &omap3xxx_sad2d__l3,
3883 &omap3xxx_l4_core__mmu_isp, 3881 &omap3xxx_l4_core__mmu_isp,
3884#ifdef CONFIG_OMAP_IOMMU_IVA2
3885 &omap3xxx_l3_main__mmu_iva, 3882 &omap3xxx_l3_main__mmu_iva,
3886#endif
3887 NULL 3883 NULL
3888}; 3884};
3889 3885
diff --git a/arch/arm/mach-omap2/omap_hwmod_54xx_data.c b/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
index e297d6231c3a..892317294fdc 100644
--- a/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
@@ -1122,6 +1122,71 @@ static struct omap_hwmod omap54xx_mmc5_hwmod = {
1122}; 1122};
1123 1123
1124/* 1124/*
1125 * 'mmu' class
1126 * The memory management unit performs virtual to physical address translation
1127 * for its requestors.
1128 */
1129
1130static struct omap_hwmod_class_sysconfig omap54xx_mmu_sysc = {
1131 .rev_offs = 0x0000,
1132 .sysc_offs = 0x0010,
1133 .syss_offs = 0x0014,
1134 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
1135 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
1136 SYSS_HAS_RESET_STATUS),
1137 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
1138 .sysc_fields = &omap_hwmod_sysc_type1,
1139};
1140
1141static struct omap_hwmod_class omap54xx_mmu_hwmod_class = {
1142 .name = "mmu",
1143 .sysc = &omap54xx_mmu_sysc,
1144};
1145
1146static struct omap_hwmod_rst_info omap54xx_mmu_dsp_resets[] = {
1147 { .name = "mmu_cache", .rst_shift = 1 },
1148};
1149
1150static struct omap_hwmod omap54xx_mmu_dsp_hwmod = {
1151 .name = "mmu_dsp",
1152 .class = &omap54xx_mmu_hwmod_class,
1153 .clkdm_name = "dsp_clkdm",
1154 .rst_lines = omap54xx_mmu_dsp_resets,
1155 .rst_lines_cnt = ARRAY_SIZE(omap54xx_mmu_dsp_resets),
1156 .main_clk = "dpll_iva_h11x2_ck",
1157 .prcm = {
1158 .omap4 = {
1159 .clkctrl_offs = OMAP54XX_CM_DSP_DSP_CLKCTRL_OFFSET,
1160 .rstctrl_offs = OMAP54XX_RM_DSP_RSTCTRL_OFFSET,
1161 .context_offs = OMAP54XX_RM_DSP_DSP_CONTEXT_OFFSET,
1162 .modulemode = MODULEMODE_HWCTRL,
1163 },
1164 },
1165};
1166
1167/* mmu ipu */
1168static struct omap_hwmod_rst_info omap54xx_mmu_ipu_resets[] = {
1169 { .name = "mmu_cache", .rst_shift = 2 },
1170};
1171
1172static struct omap_hwmod omap54xx_mmu_ipu_hwmod = {
1173 .name = "mmu_ipu",
1174 .class = &omap54xx_mmu_hwmod_class,
1175 .clkdm_name = "ipu_clkdm",
1176 .rst_lines = omap54xx_mmu_ipu_resets,
1177 .rst_lines_cnt = ARRAY_SIZE(omap54xx_mmu_ipu_resets),
1178 .main_clk = "dpll_core_h22x2_ck",
1179 .prcm = {
1180 .omap4 = {
1181 .clkctrl_offs = OMAP54XX_CM_IPU_IPU_CLKCTRL_OFFSET,
1182 .rstctrl_offs = OMAP54XX_RM_IPU_RSTCTRL_OFFSET,
1183 .context_offs = OMAP54XX_RM_IPU_IPU_CONTEXT_OFFSET,
1184 .modulemode = MODULEMODE_HWCTRL,
1185 },
1186 },
1187};
1188
1189/*
1125 * 'mpu' class 1190 * 'mpu' class
1126 * mpu sub-system 1191 * mpu sub-system
1127 */ 1192 */
@@ -1763,6 +1828,14 @@ static struct omap_hwmod_ocp_if omap54xx_l4_cfg__l3_main_1 = {
1763 .user = OCP_USER_MPU | OCP_USER_SDMA, 1828 .user = OCP_USER_MPU | OCP_USER_SDMA,
1764}; 1829};
1765 1830
1831/* l4_cfg -> mmu_dsp */
1832static struct omap_hwmod_ocp_if omap54xx_l4_cfg__mmu_dsp = {
1833 .master = &omap54xx_l4_cfg_hwmod,
1834 .slave = &omap54xx_mmu_dsp_hwmod,
1835 .clk = "l4_root_clk_div",
1836 .user = OCP_USER_MPU | OCP_USER_SDMA,
1837};
1838
1766/* mpu -> l3_main_1 */ 1839/* mpu -> l3_main_1 */
1767static struct omap_hwmod_ocp_if omap54xx_mpu__l3_main_1 = { 1840static struct omap_hwmod_ocp_if omap54xx_mpu__l3_main_1 = {
1768 .master = &omap54xx_mpu_hwmod, 1841 .master = &omap54xx_mpu_hwmod,
@@ -1787,6 +1860,14 @@ static struct omap_hwmod_ocp_if omap54xx_l4_cfg__l3_main_2 = {
1787 .user = OCP_USER_MPU | OCP_USER_SDMA, 1860 .user = OCP_USER_MPU | OCP_USER_SDMA,
1788}; 1861};
1789 1862
1863/* l3_main_2 -> mmu_ipu */
1864static struct omap_hwmod_ocp_if omap54xx_l3_main_2__mmu_ipu = {
1865 .master = &omap54xx_l3_main_2_hwmod,
1866 .slave = &omap54xx_mmu_ipu_hwmod,
1867 .clk = "l3_iclk_div",
1868 .user = OCP_USER_MPU | OCP_USER_SDMA,
1869};
1870
1790/* l3_main_1 -> l3_main_3 */ 1871/* l3_main_1 -> l3_main_3 */
1791static struct omap_hwmod_ocp_if omap54xx_l3_main_1__l3_main_3 = { 1872static struct omap_hwmod_ocp_if omap54xx_l3_main_1__l3_main_3 = {
1792 .master = &omap54xx_l3_main_1_hwmod, 1873 .master = &omap54xx_l3_main_1_hwmod,
@@ -2345,6 +2426,7 @@ static struct omap_hwmod_ocp_if *omap54xx_hwmod_ocp_ifs[] __initdata = {
2345 &omap54xx_l4_wkup__counter_32k, 2426 &omap54xx_l4_wkup__counter_32k,
2346 &omap54xx_l4_cfg__dma_system, 2427 &omap54xx_l4_cfg__dma_system,
2347 &omap54xx_l4_abe__dmic, 2428 &omap54xx_l4_abe__dmic,
2429 &omap54xx_l4_cfg__mmu_dsp,
2348 &omap54xx_mpu__emif1, 2430 &omap54xx_mpu__emif1,
2349 &omap54xx_mpu__emif2, 2431 &omap54xx_mpu__emif2,
2350 &omap54xx_l4_wkup__gpio1, 2432 &omap54xx_l4_wkup__gpio1,
@@ -2360,6 +2442,7 @@ static struct omap_hwmod_ocp_if *omap54xx_hwmod_ocp_ifs[] __initdata = {
2360 &omap54xx_l4_per__i2c3, 2442 &omap54xx_l4_per__i2c3,
2361 &omap54xx_l4_per__i2c4, 2443 &omap54xx_l4_per__i2c4,
2362 &omap54xx_l4_per__i2c5, 2444 &omap54xx_l4_per__i2c5,
2445 &omap54xx_l3_main_2__mmu_ipu,
2363 &omap54xx_l4_wkup__kbd, 2446 &omap54xx_l4_wkup__kbd,
2364 &omap54xx_l4_cfg__mailbox, 2447 &omap54xx_l4_cfg__mailbox,
2365 &omap54xx_l4_abe__mcbsp1, 2448 &omap54xx_l4_abe__mcbsp1,
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index c33e07e2f0d4..b04c5f0fc278 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -16,12 +16,14 @@
16#include <linux/wl12xx.h> 16#include <linux/wl12xx.h>
17 17
18#include <linux/platform_data/pinctrl-single.h> 18#include <linux/platform_data/pinctrl-single.h>
19#include <linux/platform_data/iommu-omap.h>
19 20
20#include "am35xx.h" 21#include "am35xx.h"
21#include "common.h" 22#include "common.h"
22#include "common-board-devices.h" 23#include "common-board-devices.h"
23#include "dss-common.h" 24#include "dss-common.h"
24#include "control.h" 25#include "control.h"
26#include "omap_device.h"
25#include "omap-secure.h" 27#include "omap-secure.h"
26#include "soc.h" 28#include "soc.h"
27 29
@@ -33,20 +35,6 @@ struct pdata_init {
33struct of_dev_auxdata omap_auxdata_lookup[]; 35struct of_dev_auxdata omap_auxdata_lookup[];
34static struct twl4030_gpio_platform_data twl_gpio_auxdata; 36static struct twl4030_gpio_platform_data twl_gpio_auxdata;
35 37
36/*
37 * Create alias for USB host PHY clock.
38 * Remove this when clock phandle can be provided via DT
39 */
40static void __init __used legacy_init_ehci_clk(char *clkname)
41{
42 int ret;
43
44 ret = clk_add_alias("main_clk", NULL, clkname, NULL);
45 if (ret)
46 pr_err("%s:Failed to add main_clk alias to %s :%d\n",
47 __func__, clkname, ret);
48}
49
50#if IS_ENABLED(CONFIG_WL12XX) 38#if IS_ENABLED(CONFIG_WL12XX)
51 39
52static struct wl12xx_platform_data wl12xx __initdata; 40static struct wl12xx_platform_data wl12xx __initdata;
@@ -94,6 +82,12 @@ static void __init hsmmc2_internal_input_clk(void)
94 omap_ctrl_writel(reg, OMAP343X_CONTROL_DEVCONF1); 82 omap_ctrl_writel(reg, OMAP343X_CONTROL_DEVCONF1);
95} 83}
96 84
85static struct iommu_platform_data omap3_iommu_pdata = {
86 .reset_name = "mmu",
87 .assert_reset = omap_device_assert_hardreset,
88 .deassert_reset = omap_device_deassert_hardreset,
89};
90
97static int omap3_sbc_t3730_twl_callback(struct device *dev, 91static int omap3_sbc_t3730_twl_callback(struct device *dev,
98 unsigned gpio, 92 unsigned gpio,
99 unsigned ngpio) 93 unsigned ngpio)
@@ -101,7 +95,7 @@ static int omap3_sbc_t3730_twl_callback(struct device *dev,
101 int res; 95 int res;
102 96
103 res = gpio_request_one(gpio + 2, GPIOF_OUT_INIT_HIGH, 97 res = gpio_request_one(gpio + 2, GPIOF_OUT_INIT_HIGH,
104 "wlan rst"); 98 "wlan pwr");
105 if (res) 99 if (res)
106 return res; 100 return res;
107 101
@@ -110,6 +104,23 @@ static int omap3_sbc_t3730_twl_callback(struct device *dev,
110 return 0; 104 return 0;
111} 105}
112 106
107static void __init omap3_sbc_t3x_usb_hub_init(int gpio, char *hub_name)
108{
109 int err = gpio_request_one(gpio, GPIOF_OUT_INIT_LOW, hub_name);
110
111 if (err) {
112 pr_err("SBC-T3x: %s reset gpio request failed: %d\n",
113 hub_name, err);
114 return;
115 }
116
117 gpio_export(gpio, 0);
118
119 udelay(10);
120 gpio_set_value(gpio, 1);
121 msleep(1);
122}
123
113static void __init omap3_sbc_t3730_twl_init(void) 124static void __init omap3_sbc_t3730_twl_init(void)
114{ 125{
115 twl_gpio_auxdata.setup = omap3_sbc_t3730_twl_callback; 126 twl_gpio_auxdata.setup = omap3_sbc_t3730_twl_callback;
@@ -117,10 +128,17 @@ static void __init omap3_sbc_t3730_twl_init(void)
117 128
118static void __init omap3_sbc_t3730_legacy_init(void) 129static void __init omap3_sbc_t3730_legacy_init(void)
119{ 130{
131 omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub");
120 legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 136); 132 legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 136);
121 omap_ads7846_init(1, 57, 0, NULL); 133 omap_ads7846_init(1, 57, 0, NULL);
122} 134}
123 135
136static void __init omap3_sbc_t3530_legacy_init(void)
137{
138 omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub");
139 omap_ads7846_init(1, 57, 0, NULL);
140}
141
124static void __init omap3_igep0020_legacy_init(void) 142static void __init omap3_igep0020_legacy_init(void)
125{ 143{
126 omap3_igep2_display_init_of(); 144 omap3_igep2_display_init_of();
@@ -162,7 +180,7 @@ static struct emac_platform_data am35xx_emac_pdata = {
162 .interrupt_disable = am35xx_disable_emac_int, 180 .interrupt_disable = am35xx_disable_emac_int,
163}; 181};
164 182
165static void __init am3517_evm_legacy_init(void) 183static void __init am35xx_emac_reset(void)
166{ 184{
167 u32 v; 185 u32 v;
168 186
@@ -172,6 +190,43 @@ static void __init am3517_evm_legacy_init(void)
172 omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); /* OCP barrier */ 190 omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); /* OCP barrier */
173} 191}
174 192
193static struct gpio cm_t3517_wlan_gpios[] __initdata = {
194 { 56, GPIOF_OUT_INIT_HIGH, "wlan pwr" },
195 { 4, GPIOF_OUT_INIT_HIGH, "xcvr noe" },
196};
197
198static void __init omap3_sbc_t3517_wifi_init(void)
199{
200 int err = gpio_request_array(cm_t3517_wlan_gpios,
201 ARRAY_SIZE(cm_t3517_wlan_gpios));
202 if (err) {
203 pr_err("SBC-T3517: wl12xx gpios request failed: %d\n", err);
204 return;
205 }
206
207 gpio_export(cm_t3517_wlan_gpios[0].gpio, 0);
208 gpio_export(cm_t3517_wlan_gpios[1].gpio, 0);
209
210 msleep(100);
211 gpio_set_value(cm_t3517_wlan_gpios[1].gpio, 0);
212}
213
214static void __init omap3_sbc_t3517_legacy_init(void)
215{
216 omap3_sbc_t3x_usb_hub_init(152, "cm-t3517 usb hub");
217 omap3_sbc_t3x_usb_hub_init(98, "sb-t35 usb hub");
218 am35xx_emac_reset();
219 hsmmc2_internal_input_clk();
220 omap3_sbc_t3517_wifi_init();
221 legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 145);
222 omap_ads7846_init(1, 57, 0, NULL);
223}
224
225static void __init am3517_evm_legacy_init(void)
226{
227 am35xx_emac_reset();
228}
229
175static void __init nokia_n900_legacy_init(void) 230static void __init nokia_n900_legacy_init(void)
176{ 231{
177 hsmmc2_internal_input_clk(); 232 hsmmc2_internal_input_clk();
@@ -200,15 +255,28 @@ static void __init omap4_sdp_legacy_init(void)
200static void __init omap4_panda_legacy_init(void) 255static void __init omap4_panda_legacy_init(void)
201{ 256{
202 omap4_panda_display_init_of(); 257 omap4_panda_display_init_of();
203 legacy_init_ehci_clk("auxclk3_ck");
204 legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 53); 258 legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 53);
205} 259}
206#endif 260#endif
207 261
262#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
263static struct iommu_platform_data omap4_iommu_pdata = {
264 .reset_name = "mmu_cache",
265 .assert_reset = omap_device_assert_hardreset,
266 .deassert_reset = omap_device_deassert_hardreset,
267};
268#endif
269
270#ifdef CONFIG_SOC_AM33XX
271static void __init am335x_evmsk_legacy_init(void)
272{
273 legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 31);
274}
275#endif
276
208#ifdef CONFIG_SOC_OMAP5 277#ifdef CONFIG_SOC_OMAP5
209static void __init omap5_uevm_legacy_init(void) 278static void __init omap5_uevm_legacy_init(void)
210{ 279{
211 legacy_init_ehci_clk("auxclk1_ck");
212} 280}
213#endif 281#endif
214 282
@@ -259,6 +327,8 @@ struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
259 OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002030, "48002030.pinmux", &pcs_pdata), 327 OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002030, "48002030.pinmux", &pcs_pdata),
260 OF_DEV_AUXDATA("ti,omap3-padconf", 0x480025a0, "480025a0.pinmux", &pcs_pdata), 328 OF_DEV_AUXDATA("ti,omap3-padconf", 0x480025a0, "480025a0.pinmux", &pcs_pdata),
261 OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002a00, "48002a00.pinmux", &pcs_pdata), 329 OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002a00, "48002a00.pinmux", &pcs_pdata),
330 OF_DEV_AUXDATA("ti,omap2-iommu", 0x5d000000, "5d000000.mmu",
331 &omap3_iommu_pdata),
262 /* Only on am3517 */ 332 /* Only on am3517 */
263 OF_DEV_AUXDATA("ti,davinci_mdio", 0x5c030000, "davinci_mdio.0", NULL), 333 OF_DEV_AUXDATA("ti,davinci_mdio", 0x5c030000, "davinci_mdio.0", NULL),
264 OF_DEV_AUXDATA("ti,am3517-emac", 0x5c000000, "davinci_emac.0", 334 OF_DEV_AUXDATA("ti,am3517-emac", 0x5c000000, "davinci_emac.0",
@@ -268,6 +338,12 @@ struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
268 OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a100040, "4a100040.pinmux", &pcs_pdata), 338 OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a100040, "4a100040.pinmux", &pcs_pdata),
269 OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a31e040, "4a31e040.pinmux", &pcs_pdata), 339 OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a31e040, "4a31e040.pinmux", &pcs_pdata),
270#endif 340#endif
341#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
342 OF_DEV_AUXDATA("ti,omap4-iommu", 0x4a066000, "4a066000.mmu",
343 &omap4_iommu_pdata),
344 OF_DEV_AUXDATA("ti,omap4-iommu", 0x55082000, "55082000.mmu",
345 &omap4_iommu_pdata),
346#endif
271 { /* sentinel */ }, 347 { /* sentinel */ },
272}; 348};
273 349
@@ -277,6 +353,8 @@ struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
277 */ 353 */
278static struct pdata_init pdata_quirks[] __initdata = { 354static struct pdata_init pdata_quirks[] __initdata = {
279#ifdef CONFIG_ARCH_OMAP3 355#ifdef CONFIG_ARCH_OMAP3
356 { "compulab,omap3-sbc-t3517", omap3_sbc_t3517_legacy_init, },
357 { "compulab,omap3-sbc-t3530", omap3_sbc_t3530_legacy_init, },
280 { "compulab,omap3-sbc-t3730", omap3_sbc_t3730_legacy_init, }, 358 { "compulab,omap3-sbc-t3730", omap3_sbc_t3730_legacy_init, },
281 { "nokia,omap3-n900", nokia_n900_legacy_init, }, 359 { "nokia,omap3-n900", nokia_n900_legacy_init, },
282 { "nokia,omap3-n9", hsmmc2_internal_input_clk, }, 360 { "nokia,omap3-n9", hsmmc2_internal_input_clk, },
@@ -290,6 +368,9 @@ static struct pdata_init pdata_quirks[] __initdata = {
290 { "ti,omap4-sdp", omap4_sdp_legacy_init, }, 368 { "ti,omap4-sdp", omap4_sdp_legacy_init, },
291 { "ti,omap4-panda", omap4_panda_legacy_init, }, 369 { "ti,omap4-panda", omap4_panda_legacy_init, },
292#endif 370#endif
371#ifdef CONFIG_SOC_AM33XX
372 { "ti,am335x-evmsk", am335x_evmsk_legacy_init, },
373#endif
293#ifdef CONFIG_SOC_OMAP5 374#ifdef CONFIG_SOC_OMAP5
294 { "ti,omap5-uevm", omap5_uevm_legacy_init, }, 375 { "ti,omap5-uevm", omap5_uevm_legacy_init, },
295#endif 376#endif