Blame view
arch/arm/mach-imx/mm-imx3.c
7.31 KB
27ad4bf72 ARM: imx: move mx... |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
/* * Copyright (C) 1999,2000 Arm Limited * Copyright (C) 2000 Deep Blue Solutions Ltd * Copyright (C) 2002 Shane Nay (shane@minirl.com) * Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved. * - add MX31 specific definitions * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include <linux/mm.h> #include <linux/init.h> #include <linux/err.h> #include <asm/pgtable.h> |
ddd5f51bf arm/imx: change m... |
24 |
#include <asm/hardware/cache-l2x0.h> |
27ad4bf72 ARM: imx: move mx... |
25 26 27 |
#include <asm/mach/map.h> #include <mach/common.h> |
362236043 ARM: mxc: clean u... |
28 |
#include <mach/devices-common.h> |
27ad4bf72 ARM: imx: move mx... |
29 30 |
#include <mach/hardware.h> #include <mach/iomux-v3.h> |
27ad4bf72 ARM: imx: move mx... |
31 |
#include <mach/irqs.h> |
41e7daf27 arm/imx: remove c... |
32 33 34 |
static void imx3_idle(void) { unsigned long reg = 0; |
8c6d8319e arm/imx: remove i... |
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
if (!need_resched()) __asm__ __volatile__( /* disable I and D cache */ "mrc p15, 0, %0, c1, c0, 0 " "bic %0, %0, #0x00001000 " "bic %0, %0, #0x00000004 " "mcr p15, 0, %0, c1, c0, 0 " /* invalidate I cache */ "mov %0, #0 " "mcr p15, 0, %0, c7, c5, 0 " /* clear and invalidate D cache */ "mov %0, #0 " "mcr p15, 0, %0, c7, c14, 0 " /* WFI */ "mov %0, #0 " "mcr p15, 0, %0, c7, c0, 4 " "nop " "nop " "nop " "nop " "nop " "nop " "nop " /* enable I and D cache */ "mrc p15, 0, %0, c1, c0, 0 " "orr %0, %0, #0x00001000 " "orr %0, %0, #0x00000004 " "mcr p15, 0, %0, c1, c0, 0 " : "=r" (reg)); local_irq_enable(); |
41e7daf27 arm/imx: remove c... |
82 |
} |
f548897ff arm/imx: remove c... |
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
static void __iomem *imx3_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype) { if (mtype == MT_DEVICE) { /* * Access all peripherals below 0x80000000 as nonshared device * on mx3, but leave l2cc alone. Otherwise cache corruptions * can occur. */ if (phys_addr < 0x80000000 && !addr_in_module(phys_addr, MX3x_L2CC)) mtype = MT_DEVICE_NONSHARED; } return __arm_ioremap(phys_addr, size, mtype); } |
ddd5f51bf arm/imx: change m... |
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
void imx3_init_l2x0(void) { void __iomem *l2x0_base; void __iomem *clkctl_base; /* * First of all, we must repair broken chip settings. There are some * i.MX35 CPUs in the wild, comming with bogus L2 cache settings. These * misconfigured CPUs will run amok immediately when the L2 cache gets enabled. * Workaraound is to setup the correct register setting prior enabling the * L2 cache. This should not hurt already working CPUs, as they are using the * same value. */ #define L2_MEM_VAL 0x10 clkctl_base = ioremap(MX35_CLKCTL_BASE_ADDR, 4096); if (clkctl_base != NULL) { writel(0x00000515, clkctl_base + L2_MEM_VAL); iounmap(clkctl_base); } else { pr_err("L2 cache: Cannot fix timing. Trying to continue without "); } l2x0_base = ioremap(MX3x_L2CC_BASE_ADDR, 4096); if (IS_ERR(l2x0_base)) { printk(KERN_ERR "remapping L2 cache area failed with %ld ", PTR_ERR(l2x0_base)); return; } l2x0_init(l2x0_base, 0x00030024, 0x00000000); } |
87514fced ARM: imx/mm-imx3:... |
133 |
#ifdef CONFIG_SOC_IMX31 |
27ad4bf72 ARM: imx: move mx... |
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
static struct map_desc mx31_io_desc[] __initdata = { imx_map_entry(MX31, X_MEMC, MT_DEVICE), imx_map_entry(MX31, AVIC, MT_DEVICE_NONSHARED), imx_map_entry(MX31, AIPS1, MT_DEVICE_NONSHARED), imx_map_entry(MX31, AIPS2, MT_DEVICE_NONSHARED), imx_map_entry(MX31, SPBA0, MT_DEVICE_NONSHARED), }; /* * This function initializes the memory map. It is called during the * system startup to create static physical to virtual memory mappings * for the IO modules. */ void __init mx31_map_io(void) { iotable_init(mx31_io_desc, ARRAY_SIZE(mx31_io_desc)); } void __init imx31_init_early(void) { mxc_set_cpu_type(MXC_CPU_MX31); mxc_arch_reset_init(MX31_IO_ADDRESS(MX31_WDOG_BASE_ADDR)); |
8c6d8319e arm/imx: remove i... |
156 |
pm_idle = imx3_idle; |
f548897ff arm/imx: remove c... |
157 |
imx_ioremap = imx3_ioremap; |
27ad4bf72 ARM: imx: move mx... |
158 |
} |
27ad4bf72 ARM: imx: move mx... |
159 160 161 |
void __init mx31_init_irq(void) { mxc_init_irq(MX31_IO_ADDRESS(MX31_AVIC_BASE_ADDR)); |
b78d8e59a gpio/mxc: Change ... |
162 |
} |
362236043 ARM: mxc: clean u... |
163 164 165 166 167 168 169 170 171 172 173 |
static struct sdma_script_start_addrs imx31_to1_sdma_script __initdata = { .per_2_per_addr = 1677, }; static struct sdma_script_start_addrs imx31_to2_sdma_script __initdata = { .ap_2_ap_addr = 423, .ap_2_bp_addr = 829, .bp_2_ap_addr = 1029, }; static struct sdma_platform_data imx31_sdma_pdata __initdata = { |
2e534b21a dmaengine: imx-sd... |
174 |
.fw_name = "sdma-imx31-to2.bin", |
362236043 ARM: mxc: clean u... |
175 176 |
.script_addrs = &imx31_to2_sdma_script, }; |
b78d8e59a gpio/mxc: Change ... |
177 178 |
void __init imx31_soc_init(void) { |
362236043 ARM: mxc: clean u... |
179 |
int to_version = mx31_revision() >> 4; |
ddd5f51bf arm/imx: change m... |
180 |
imx3_init_l2x0(); |
e7fc6ae74 gpio/mxc: get rid... |
181 182 183 |
mxc_register_gpio("imx31-gpio", 0, MX31_GPIO1_BASE_ADDR, SZ_16K, MX31_INT_GPIO1, 0); mxc_register_gpio("imx31-gpio", 1, MX31_GPIO2_BASE_ADDR, SZ_16K, MX31_INT_GPIO2, 0); mxc_register_gpio("imx31-gpio", 2, MX31_GPIO3_BASE_ADDR, SZ_16K, MX31_INT_GPIO3, 0); |
362236043 ARM: mxc: clean u... |
184 |
|
2e534b21a dmaengine: imx-sd... |
185 186 187 |
if (to_version == 1) { strncpy(imx31_sdma_pdata.fw_name, "sdma-imx31-to1.bin", strlen(imx31_sdma_pdata.fw_name)); |
362236043 ARM: mxc: clean u... |
188 |
imx31_sdma_pdata.script_addrs = &imx31_to1_sdma_script; |
2e534b21a dmaengine: imx-sd... |
189 |
} |
62550cd7c dmaengine: imx-sd... |
190 |
imx_add_imx_sdma("imx31-sdma", MX31_SDMA_BASE_ADDR, MX31_INT_SDMA, &imx31_sdma_pdata); |
27ad4bf72 ARM: imx: move mx... |
191 |
} |
87514fced ARM: imx/mm-imx3:... |
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 |
#endif /* ifdef CONFIG_SOC_IMX31 */ #ifdef CONFIG_SOC_IMX35 static struct map_desc mx35_io_desc[] __initdata = { imx_map_entry(MX35, X_MEMC, MT_DEVICE), imx_map_entry(MX35, AVIC, MT_DEVICE_NONSHARED), imx_map_entry(MX35, AIPS1, MT_DEVICE_NONSHARED), imx_map_entry(MX35, AIPS2, MT_DEVICE_NONSHARED), imx_map_entry(MX35, SPBA0, MT_DEVICE_NONSHARED), }; void __init mx35_map_io(void) { iotable_init(mx35_io_desc, ARRAY_SIZE(mx35_io_desc)); } void __init imx35_init_early(void) { mxc_set_cpu_type(MXC_CPU_MX35); mxc_iomux_v3_init(MX35_IO_ADDRESS(MX35_IOMUXC_BASE_ADDR)); mxc_arch_reset_init(MX35_IO_ADDRESS(MX35_WDOG_BASE_ADDR)); |
9a2ee7152 Merge branch 'cle... |
213 |
pm_idle = imx3_idle; |
87514fced ARM: imx/mm-imx3:... |
214 215 216 217 218 219 220 |
imx_ioremap = imx3_ioremap; } void __init mx35_init_irq(void) { mxc_init_irq(MX35_IO_ADDRESS(MX35_AVIC_BASE_ADDR)); } |
f1263de20 arm/imx: merge mm... |
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 |
static struct sdma_script_start_addrs imx35_to1_sdma_script __initdata = { .ap_2_ap_addr = 642, .uart_2_mcu_addr = 817, .mcu_2_app_addr = 747, .uartsh_2_mcu_addr = 1183, .per_2_shp_addr = 1033, .mcu_2_shp_addr = 961, .ata_2_mcu_addr = 1333, .mcu_2_ata_addr = 1252, .app_2_mcu_addr = 683, .shp_2_per_addr = 1111, .shp_2_mcu_addr = 892, }; static struct sdma_script_start_addrs imx35_to2_sdma_script __initdata = { .ap_2_ap_addr = 729, .uart_2_mcu_addr = 904, .per_2_app_addr = 1597, .mcu_2_app_addr = 834, .uartsh_2_mcu_addr = 1270, .per_2_shp_addr = 1120, .mcu_2_shp_addr = 1048, .ata_2_mcu_addr = 1429, .mcu_2_ata_addr = 1339, .app_2_per_addr = 1531, .app_2_mcu_addr = 770, .shp_2_per_addr = 1198, .shp_2_mcu_addr = 979, }; static struct sdma_platform_data imx35_sdma_pdata __initdata = { .fw_name = "sdma-imx35-to2.bin", .script_addrs = &imx35_to2_sdma_script, }; void __init imx35_soc_init(void) { int to_version = mx35_revision() >> 4; |
ddd5f51bf arm/imx: change m... |
260 |
imx3_init_l2x0(); |
f1263de20 arm/imx: merge mm... |
261 262 263 264 265 266 267 268 269 270 271 272 273 |
/* i.mx35 has the i.mx31 type gpio */ mxc_register_gpio("imx31-gpio", 0, MX35_GPIO1_BASE_ADDR, SZ_16K, MX35_INT_GPIO1, 0); mxc_register_gpio("imx31-gpio", 1, MX35_GPIO2_BASE_ADDR, SZ_16K, MX35_INT_GPIO2, 0); mxc_register_gpio("imx31-gpio", 2, MX35_GPIO3_BASE_ADDR, SZ_16K, MX35_INT_GPIO3, 0); if (to_version == 1) { strncpy(imx35_sdma_pdata.fw_name, "sdma-imx35-to1.bin", strlen(imx35_sdma_pdata.fw_name)); imx35_sdma_pdata.script_addrs = &imx35_to1_sdma_script; } imx_add_imx_sdma("imx35-sdma", MX35_SDMA_BASE_ADDR, MX35_INT_SDMA, &imx35_sdma_pdata); } |
87514fced ARM: imx/mm-imx3:... |
274 |
#endif /* ifdef CONFIG_SOC_IMX35 */ |