Merge branch 'for-rmk' of git://git.pengutronix.de/git/imx/linux-2.6

Conflicts:
arch/arm/mach-mx3/mach-pcm037.c

+382 -70
+10
arch/arm/mach-mx3/Kconfig
··· 62 62 Include support for MX31PDK (3DS) platform. This includes specific 63 63 configurations for the board and its peripherals. 64 64 65 + config MACH_MX31_3DS_MXC_NAND_USE_BBT 66 + bool "Make the MXC NAND driver use the in flash Bad Block Table" 67 + depends on MACH_MX31_3DS 68 + depends on MTD_NAND_MXC 69 + help 70 + Enable this if you want that the MXC NAND driver uses the in flash 71 + Bad Block Table to know what blocks are bad instead of scanning the 72 + entire flash looking for bad block markers. 73 + 65 74 config MACH_MX31MOBOARD 66 75 bool "Support mx31moboard platforms (EPFL Mobots group)" 67 76 select ARCH_MX31 ··· 104 95 config MACH_ARMADILLO5X0 105 96 bool "Support Atmark Armadillo-500 Development Base Board" 106 97 select ARCH_MX31 98 + select MXC_ULPI if USB_ULPI 107 99 help 108 100 Include support for Atmark Armadillo-500 platform. This includes 109 101 specific configurations for the board and its peripherals.
+2 -3
arch/arm/mach-mx3/clock-imx31.c
··· 468 468 } 469 469 470 470 DEFINE_CLOCK(perclk_clk, 0, NULL, 0, NULL, NULL, &ipg_clk); 471 + DEFINE_CLOCK(ckil_clk, 0, NULL, 0, clk_ckil_get_rate, NULL, NULL); 471 472 472 473 DEFINE_CLOCK(sdhc1_clk, 0, MXC_CCM_CGR0, 0, NULL, NULL, &perclk_clk); 473 474 DEFINE_CLOCK(sdhc2_clk, 1, MXC_CCM_CGR0, 2, NULL, NULL, &perclk_clk); ··· 491 490 DEFINE_CLOCK(mstick1_clk, 0, MXC_CCM_CGR1, 2, mstick1_get_rate, NULL, &usb_pll_clk); 492 491 DEFINE_CLOCK(mstick2_clk, 1, MXC_CCM_CGR1, 4, mstick2_get_rate, NULL, &usb_pll_clk); 493 492 DEFINE_CLOCK1(csi_clk, 0, MXC_CCM_CGR1, 6, csi, NULL, &serial_pll_clk); 494 - DEFINE_CLOCK(rtc_clk, 0, MXC_CCM_CGR1, 8, NULL, NULL, &ipg_clk); 493 + DEFINE_CLOCK(rtc_clk, 0, MXC_CCM_CGR1, 8, NULL, NULL, &ckil_clk); 495 494 DEFINE_CLOCK(wdog_clk, 0, MXC_CCM_CGR1, 10, NULL, NULL, &ipg_clk); 496 495 DEFINE_CLOCK(pwm_clk, 0, MXC_CCM_CGR1, 12, NULL, NULL, &perclk_clk); 497 496 DEFINE_CLOCK(usb_clk2, 0, MXC_CCM_CGR1, 18, usb_get_rate, NULL, &ahb_clk); ··· 515 514 DEFINE_CLOCK(nfc_clk, 0, NULL, 0, nfc_get_rate, NULL, &ahb_clk); 516 515 DEFINE_CLOCK(scc_clk, 0, NULL, 0, NULL, NULL, &ipg_clk); 517 516 DEFINE_CLOCK(ipg_clk, 0, NULL, 0, ipg_get_rate, NULL, &ahb_clk); 518 - DEFINE_CLOCK(ckil_clk, 0, NULL, 0, clk_ckil_get_rate, NULL, NULL); 519 517 520 518 #define _REGISTER_CLOCK(d, n, c) \ 521 519 { \ ··· 572 572 _REGISTER_CLOCK(NULL, "iim", iim_clk) 573 573 _REGISTER_CLOCK(NULL, "mpeg4", mpeg4_clk) 574 574 _REGISTER_CLOCK(NULL, "mbx", mbx_clk) 575 - _REGISTER_CLOCK("mxc_rtc", NULL, ckil_clk) 576 575 }; 577 576 578 577 int __init mx31_clocks_init(unsigned long fref)
+18 -1
arch/arm/mach-mx3/devices.c
··· 575 575 .resource = imx_ssi_resources1, 576 576 }; 577 577 578 - static int mx3_devices_init(void) 578 + static struct resource imx_wdt_resources[] = { 579 + { 580 + .flags = IORESOURCE_MEM, 581 + }, 582 + }; 583 + 584 + struct platform_device imx_wdt_device0 = { 585 + .name = "imx-wdt", 586 + .id = 0, 587 + .num_resources = ARRAY_SIZE(imx_wdt_resources), 588 + .resource = imx_wdt_resources, 589 + }; 590 + 591 + static int __init mx3_devices_init(void) 579 592 { 580 593 if (cpu_is_mx31()) { 581 594 mxc_nand_resources[0].start = MX31_NFC_BASE_ADDR; 582 595 mxc_nand_resources[0].end = MX31_NFC_BASE_ADDR + 0xfff; 596 + imx_wdt_resources[0].start = MX31_WDOG_BASE_ADDR; 597 + imx_wdt_resources[0].end = MX31_WDOG_BASE_ADDR + 0x3fff; 583 598 mxc_register_device(&mxc_rnga_device, NULL); 584 599 } 585 600 if (cpu_is_mx35()) { ··· 612 597 imx_ssi_resources0[1].end = MX35_INT_SSI1; 613 598 imx_ssi_resources1[1].start = MX35_INT_SSI2; 614 599 imx_ssi_resources1[1].end = MX35_INT_SSI2; 600 + imx_wdt_resources[0].start = MX35_WDOG_BASE_ADDR; 601 + imx_wdt_resources[0].end = MX35_WDOG_BASE_ADDR + 0x3fff; 615 602 } 616 603 617 604 return 0;
+2 -1
arch/arm/mach-mx3/devices.h
··· 25 25 extern struct platform_device mxc_spi_device2; 26 26 extern struct platform_device imx_ssi_device0; 27 27 extern struct platform_device imx_ssi_device1; 28 - 28 + extern struct platform_device imx_ssi_device1; 29 + extern struct platform_device imx_wdt_device0;
+166
arch/arm/mach-mx3/mach-armadillo5x0.c
··· 36 36 #include <linux/input.h> 37 37 #include <linux/gpio_keys.h> 38 38 #include <linux/i2c.h> 39 + #include <linux/usb/otg.h> 40 + #include <linux/usb/ulpi.h> 41 + #include <linux/delay.h> 39 42 40 43 #include <mach/hardware.h> 41 44 #include <asm/mach-types.h> ··· 55 52 #include <mach/ipu.h> 56 53 #include <mach/mx3fb.h> 57 54 #include <mach/mxc_nand.h> 55 + #include <mach/mxc_ehci.h> 56 + #include <mach/ulpi.h> 58 57 59 58 #include "devices.h" 60 59 #include "crm_regs.h" ··· 108 103 /* I2C2 */ 109 104 MX31_PIN_CSPI2_MOSI__SCL, 110 105 MX31_PIN_CSPI2_MISO__SDA, 106 + /* OTG */ 107 + MX31_PIN_USBOTG_DATA0__USBOTG_DATA0, 108 + MX31_PIN_USBOTG_DATA1__USBOTG_DATA1, 109 + MX31_PIN_USBOTG_DATA2__USBOTG_DATA2, 110 + MX31_PIN_USBOTG_DATA3__USBOTG_DATA3, 111 + MX31_PIN_USBOTG_DATA4__USBOTG_DATA4, 112 + MX31_PIN_USBOTG_DATA5__USBOTG_DATA5, 113 + MX31_PIN_USBOTG_DATA6__USBOTG_DATA6, 114 + MX31_PIN_USBOTG_DATA7__USBOTG_DATA7, 115 + MX31_PIN_USBOTG_CLK__USBOTG_CLK, 116 + MX31_PIN_USBOTG_DIR__USBOTG_DIR, 117 + MX31_PIN_USBOTG_NXT__USBOTG_NXT, 118 + MX31_PIN_USBOTG_STP__USBOTG_STP, 119 + /* USB host 2 */ 120 + IOMUX_MODE(MX31_PIN_USBH2_CLK, IOMUX_CONFIG_FUNC), 121 + IOMUX_MODE(MX31_PIN_USBH2_DIR, IOMUX_CONFIG_FUNC), 122 + IOMUX_MODE(MX31_PIN_USBH2_NXT, IOMUX_CONFIG_FUNC), 123 + IOMUX_MODE(MX31_PIN_USBH2_STP, IOMUX_CONFIG_FUNC), 124 + IOMUX_MODE(MX31_PIN_USBH2_DATA0, IOMUX_CONFIG_FUNC), 125 + IOMUX_MODE(MX31_PIN_USBH2_DATA1, IOMUX_CONFIG_FUNC), 126 + IOMUX_MODE(MX31_PIN_STXD3, IOMUX_CONFIG_FUNC), 127 + IOMUX_MODE(MX31_PIN_SRXD3, IOMUX_CONFIG_FUNC), 128 + IOMUX_MODE(MX31_PIN_SCK3, IOMUX_CONFIG_FUNC), 129 + IOMUX_MODE(MX31_PIN_SFS3, IOMUX_CONFIG_FUNC), 130 + IOMUX_MODE(MX31_PIN_STXD6, IOMUX_CONFIG_FUNC), 131 + IOMUX_MODE(MX31_PIN_SRXD6, IOMUX_CONFIG_FUNC), 111 132 }; 133 + 134 + /* USB */ 135 + #if defined(CONFIG_USB_ULPI) 136 + 137 + #define OTG_RESET IOMUX_TO_GPIO(MX31_PIN_STXD4) 138 + #define USBH2_RESET IOMUX_TO_GPIO(MX31_PIN_SCK6) 139 + #define USBH2_CS IOMUX_TO_GPIO(MX31_PIN_GPIO1_3) 140 + 141 + #define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \ 142 + PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU) 143 + 144 + static int usbotg_init(struct platform_device *pdev) 145 + { 146 + int err; 147 + 148 + mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA0, USB_PAD_CFG); 149 + mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA1, USB_PAD_CFG); 150 + mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA2, USB_PAD_CFG); 151 + mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA3, USB_PAD_CFG); 152 + mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA4, USB_PAD_CFG); 153 + mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA5, USB_PAD_CFG); 154 + mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA6, USB_PAD_CFG); 155 + mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA7, USB_PAD_CFG); 156 + mxc_iomux_set_pad(MX31_PIN_USBOTG_CLK, USB_PAD_CFG); 157 + mxc_iomux_set_pad(MX31_PIN_USBOTG_DIR, USB_PAD_CFG); 158 + mxc_iomux_set_pad(MX31_PIN_USBOTG_NXT, USB_PAD_CFG); 159 + mxc_iomux_set_pad(MX31_PIN_USBOTG_STP, USB_PAD_CFG); 160 + 161 + /* Chip already enabled by hardware */ 162 + /* OTG phy reset*/ 163 + err = gpio_request(OTG_RESET, "USB-OTG-RESET"); 164 + if (err) { 165 + pr_err("Failed to request the usb otg reset gpio\n"); 166 + return err; 167 + } 168 + 169 + err = gpio_direction_output(OTG_RESET, 1/*HIGH*/); 170 + if (err) { 171 + pr_err("Failed to reset the usb otg phy\n"); 172 + goto otg_free_reset; 173 + } 174 + 175 + gpio_set_value(OTG_RESET, 0/*LOW*/); 176 + mdelay(5); 177 + gpio_set_value(OTG_RESET, 1/*HIGH*/); 178 + 179 + return 0; 180 + 181 + otg_free_reset: 182 + gpio_free(OTG_RESET); 183 + return err; 184 + } 185 + 186 + static int usbh2_init(struct platform_device *pdev) 187 + { 188 + int err; 189 + 190 + mxc_iomux_set_pad(MX31_PIN_USBH2_CLK, USB_PAD_CFG); 191 + mxc_iomux_set_pad(MX31_PIN_USBH2_DIR, USB_PAD_CFG); 192 + mxc_iomux_set_pad(MX31_PIN_USBH2_NXT, USB_PAD_CFG); 193 + mxc_iomux_set_pad(MX31_PIN_USBH2_STP, USB_PAD_CFG); 194 + mxc_iomux_set_pad(MX31_PIN_USBH2_DATA0, USB_PAD_CFG); 195 + mxc_iomux_set_pad(MX31_PIN_USBH2_DATA1, USB_PAD_CFG); 196 + mxc_iomux_set_pad(MX31_PIN_SRXD6, USB_PAD_CFG); 197 + mxc_iomux_set_pad(MX31_PIN_STXD6, USB_PAD_CFG); 198 + mxc_iomux_set_pad(MX31_PIN_SFS3, USB_PAD_CFG); 199 + mxc_iomux_set_pad(MX31_PIN_SCK3, USB_PAD_CFG); 200 + mxc_iomux_set_pad(MX31_PIN_SRXD3, USB_PAD_CFG); 201 + mxc_iomux_set_pad(MX31_PIN_STXD3, USB_PAD_CFG); 202 + 203 + mxc_iomux_set_gpr(MUX_PGP_UH2, true); 204 + 205 + 206 + /* Enable the chip */ 207 + err = gpio_request(USBH2_CS, "USB-H2-CS"); 208 + if (err) { 209 + pr_err("Failed to request the usb host 2 CS gpio\n"); 210 + return err; 211 + } 212 + 213 + err = gpio_direction_output(USBH2_CS, 0/*Enabled*/); 214 + if (err) { 215 + pr_err("Failed to drive the usb host 2 CS gpio\n"); 216 + goto h2_free_cs; 217 + } 218 + 219 + /* H2 phy reset*/ 220 + err = gpio_request(USBH2_RESET, "USB-H2-RESET"); 221 + if (err) { 222 + pr_err("Failed to request the usb host 2 reset gpio\n"); 223 + goto h2_free_cs; 224 + } 225 + 226 + err = gpio_direction_output(USBH2_RESET, 1/*HIGH*/); 227 + if (err) { 228 + pr_err("Failed to reset the usb host 2 phy\n"); 229 + goto h2_free_reset; 230 + } 231 + 232 + gpio_set_value(USBH2_RESET, 0/*LOW*/); 233 + mdelay(5); 234 + gpio_set_value(USBH2_RESET, 1/*HIGH*/); 235 + 236 + return 0; 237 + 238 + h2_free_reset: 239 + gpio_free(USBH2_RESET); 240 + h2_free_cs: 241 + gpio_free(USBH2_CS); 242 + return err; 243 + } 244 + 245 + static struct mxc_usbh_platform_data usbotg_pdata = { 246 + .init = usbotg_init, 247 + .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, 248 + .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_DIFF_UNI, 249 + }; 250 + 251 + static struct mxc_usbh_platform_data usbh2_pdata = { 252 + .init = usbh2_init, 253 + .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, 254 + .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_DIFF_UNI, 255 + }; 256 + #endif /* CONFIG_USB_ULPI */ 112 257 113 258 /* RTC over I2C*/ 114 259 #define ARMADILLO5X0_RTC_GPIO IOMUX_TO_GPIO(MX31_PIN_SRXD4) ··· 548 393 if (armadillo5x0_i2c_rtc.irq == 0) 549 394 pr_warning("armadillo5x0_init: failed to get RTC IRQ\n"); 550 395 i2c_register_board_info(1, &armadillo5x0_i2c_rtc, 1); 396 + 397 + /* USB */ 398 + #if defined(CONFIG_USB_ULPI) 399 + usbotg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, 400 + USB_OTG_DRV_VBUS | USB_OTG_DRV_VBUS_EXT); 401 + usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, 402 + USB_OTG_DRV_VBUS | USB_OTG_DRV_VBUS_EXT); 403 + 404 + mxc_register_device(&mxc_otg_host, &usbotg_pdata); 405 + mxc_register_device(&mxc_usbh2, &usbh2_pdata); 406 + #endif 551 407 } 552 408 553 409 static void __init armadillo5x0_timer_init(void)
+97 -19
arch/arm/mach-mx3/mach-mx31_3ds.c
··· 23 23 #include <linux/gpio.h> 24 24 #include <linux/smsc911x.h> 25 25 #include <linux/platform_device.h> 26 + #include <linux/mfd/mc13783.h> 27 + #include <linux/spi/spi.h> 28 + #include <linux/regulator/machine.h> 26 29 27 30 #include <mach/hardware.h> 28 31 #include <asm/mach-types.h> ··· 34 31 #include <asm/memory.h> 35 32 #include <asm/mach/map.h> 36 33 #include <mach/common.h> 37 - #include <mach/board-mx31pdk.h> 34 + #include <mach/board-mx31_3ds.h> 38 35 #include <mach/imx-uart.h> 39 36 #include <mach/iomux-mx3.h> 37 + #include <mach/mxc_nand.h> 38 + #include <mach/spi.h> 40 39 #include "devices.h" 41 40 42 41 /*! 43 - * @file mx31pdk.c 42 + * @file mx31_3ds.c 44 43 * 45 44 * @brief This file contains the board-specific initialization routines. 46 45 * 47 46 * @ingroup System 48 47 */ 49 48 50 - static int mx31pdk_pins[] = { 49 + static int mx31_3ds_pins[] = { 51 50 /* UART1 */ 52 51 MX31_PIN_CTS1__CTS1, 53 52 MX31_PIN_RTS1__RTS1, 54 53 MX31_PIN_TXD1__TXD1, 55 54 MX31_PIN_RXD1__RXD1, 56 55 IOMUX_MODE(MX31_PIN_GPIO1_1, IOMUX_CONFIG_GPIO), 56 + /* SPI 1 */ 57 + MX31_PIN_CSPI2_SCLK__SCLK, 58 + MX31_PIN_CSPI2_MOSI__MOSI, 59 + MX31_PIN_CSPI2_MISO__MISO, 60 + MX31_PIN_CSPI2_SPI_RDY__SPI_RDY, 61 + MX31_PIN_CSPI2_SS0__SS0, 62 + MX31_PIN_CSPI2_SS2__SS2, /*CS for MC13783 */ 63 + /* MC13783 IRQ */ 64 + IOMUX_MODE(MX31_PIN_GPIO1_3, IOMUX_CONFIG_GPIO), 65 + }; 66 + 67 + /* Regulators */ 68 + static struct regulator_init_data pwgtx_init = { 69 + .constraints = { 70 + .boot_on = 1, 71 + .always_on = 1, 72 + }, 73 + }; 74 + 75 + static struct mc13783_regulator_init_data mx31_3ds_regulators[] = { 76 + { 77 + .id = MC13783_REGU_PWGT1SPI, /* Power Gate for ARM core. */ 78 + .init_data = &pwgtx_init, 79 + }, { 80 + .id = MC13783_REGU_PWGT2SPI, /* Power Gate for L2 Cache. */ 81 + .init_data = &pwgtx_init, 82 + }, 83 + }; 84 + 85 + /* MC13783 */ 86 + static struct mc13783_platform_data mc13783_pdata __initdata = { 87 + .regulators = mx31_3ds_regulators, 88 + .num_regulators = ARRAY_SIZE(mx31_3ds_regulators), 89 + .flags = MC13783_USE_REGULATOR, 90 + }; 91 + 92 + /* SPI */ 93 + static int spi1_internal_chipselect[] = { 94 + MXC_SPI_CS(0), 95 + MXC_SPI_CS(2), 96 + }; 97 + 98 + static struct spi_imx_master spi1_pdata = { 99 + .chipselect = spi1_internal_chipselect, 100 + .num_chipselect = ARRAY_SIZE(spi1_internal_chipselect), 101 + }; 102 + 103 + static struct spi_board_info mx31_3ds_spi_devs[] __initdata = { 104 + { 105 + .modalias = "mc13783", 106 + .max_speed_hz = 1000000, 107 + .bus_num = 1, 108 + .chip_select = 1, /* SS2 */ 109 + .platform_data = &mc13783_pdata, 110 + .irq = IOMUX_TO_IRQ(MX31_PIN_GPIO1_3), 111 + .mode = SPI_CS_HIGH, 112 + }, 113 + }; 114 + 115 + /* 116 + * NAND Flash 117 + */ 118 + static struct mxc_nand_platform_data imx31_3ds_nand_flash_pdata = { 119 + .width = 1, 120 + .hw_ecc = 1, 121 + #ifdef MACH_MX31_3DS_MXC_NAND_USE_BBT 122 + .flash_bbt = 1, 123 + #endif 57 124 }; 58 125 59 126 static struct imxuart_platform_data uart_pdata = { ··· 168 95 * LEDs, switches, interrupts for Ethernet. 169 96 */ 170 97 171 - static void mx31pdk_expio_irq_handler(uint32_t irq, struct irq_desc *desc) 98 + static void mx31_3ds_expio_irq_handler(uint32_t irq, struct irq_desc *desc) 172 99 { 173 100 uint32_t imr_val; 174 101 uint32_t int_valid; ··· 236 163 .unmask = expio_unmask_irq, 237 164 }; 238 165 239 - static int __init mx31pdk_init_expio(void) 166 + static int __init mx31_3ds_init_expio(void) 240 167 { 241 168 int i; 242 169 int ret; ··· 249 176 return -ENODEV; 250 177 } 251 178 252 - pr_info("i.MX31PDK Debug board detected, rev = 0x%04X\n", 179 + pr_info("i.MX31 3DS Debug board detected, rev = 0x%04X\n", 253 180 __raw_readw(CPLD_CODE_VER_REG)); 254 181 255 182 /* ··· 274 201 set_irq_flags(i, IRQF_VALID); 275 202 } 276 203 set_irq_type(EXPIO_PARENT_INT, IRQ_TYPE_LEVEL_LOW); 277 - set_irq_chained_handler(EXPIO_PARENT_INT, mx31pdk_expio_irq_handler); 204 + set_irq_chained_handler(EXPIO_PARENT_INT, mx31_3ds_expio_irq_handler); 278 205 279 206 return 0; 280 207 } ··· 282 209 /* 283 210 * This structure defines the MX31 memory map. 284 211 */ 285 - static struct map_desc mx31pdk_io_desc[] __initdata = { 212 + static struct map_desc mx31_3ds_io_desc[] __initdata = { 286 213 { 287 214 .virtual = MX31_CS5_BASE_ADDR_VIRT, 288 215 .pfn = __phys_to_pfn(MX31_CS5_BASE_ADDR), ··· 294 221 /* 295 222 * Set up static virtual mappings. 296 223 */ 297 - static void __init mx31pdk_map_io(void) 224 + static void __init mx31_3ds_map_io(void) 298 225 { 299 226 mx31_map_io(); 300 - iotable_init(mx31pdk_io_desc, ARRAY_SIZE(mx31pdk_io_desc)); 227 + iotable_init(mx31_3ds_io_desc, ARRAY_SIZE(mx31_3ds_io_desc)); 301 228 } 302 229 303 230 /*! ··· 305 232 */ 306 233 static void __init mxc_board_init(void) 307 234 { 308 - mxc_iomux_setup_multiple_pins(mx31pdk_pins, ARRAY_SIZE(mx31pdk_pins), 309 - "mx31pdk"); 235 + mxc_iomux_setup_multiple_pins(mx31_3ds_pins, ARRAY_SIZE(mx31_3ds_pins), 236 + "mx31_3ds"); 310 237 311 238 mxc_register_device(&mxc_uart_device0, &uart_pdata); 239 + mxc_register_device(&mxc_nand_device, &imx31_3ds_nand_flash_pdata); 312 240 313 - if (!mx31pdk_init_expio()) 241 + mxc_register_device(&mxc_spi_device1, &spi1_pdata); 242 + spi_register_board_info(mx31_3ds_spi_devs, 243 + ARRAY_SIZE(mx31_3ds_spi_devs)); 244 + 245 + if (!mx31_3ds_init_expio()) 314 246 platform_device_register(&smsc911x_device); 315 247 } 316 248 317 - static void __init mx31pdk_timer_init(void) 249 + static void __init mx31_3ds_timer_init(void) 318 250 { 319 251 mx31_clocks_init(26000000); 320 252 } 321 253 322 - static struct sys_timer mx31pdk_timer = { 323 - .init = mx31pdk_timer_init, 254 + static struct sys_timer mx31_3ds_timer = { 255 + .init = mx31_3ds_timer_init, 324 256 }; 325 257 326 258 /* 327 259 * The following uses standard kernel macros defined in arch.h in order to 328 - * initialize __mach_desc_MX31PDK data structure. 260 + * initialize __mach_desc_MX31_3DS data structure. 329 261 */ 330 262 MACHINE_START(MX31_3DS, "Freescale MX31PDK (3DS)") 331 263 /* Maintainer: Freescale Semiconductor, Inc. */ 332 264 .phys_io = MX31_AIPS1_BASE_ADDR, 333 265 .io_pg_offst = (MX31_AIPS1_BASE_ADDR_VIRT >> 18) & 0xfffc, 334 266 .boot_params = MX3x_PHYS_OFFSET + 0x100, 335 - .map_io = mx31pdk_map_io, 267 + .map_io = mx31_3ds_map_io, 336 268 .init_irq = mx31_init_irq, 337 269 .init_machine = mxc_board_init, 338 - .timer = &mx31pdk_timer, 270 + .timer = &mx31_3ds_timer, 339 271 MACHINE_END
-1
arch/arm/mach-mx3/mach-pcm037.c
··· 35 35 #include <linux/can/platform/sja1000.h> 36 36 #include <linux/usb/otg.h> 37 37 #include <linux/usb/ulpi.h> 38 - #include <linux/fsl_devices.h> 39 38 #include <linux/gfp.h> 40 39 41 40 #include <media/soc_camera.h>
+1 -1
arch/arm/mach-mx3/mx31lite-db.c
··· 28 28 #include <linux/types.h> 29 29 #include <linux/init.h> 30 30 #include <linux/gpio.h> 31 - #include <linux/platform_device.h> 32 31 #include <linux/leds.h> 33 32 #include <linux/platform_device.h> 34 33 ··· 205 206 mxc_register_device(&mxcsdhc_device0, &mmc_pdata); 206 207 mxc_register_device(&mxc_spi_device0, &spi0_pdata); 207 208 platform_device_register(&litekit_led_device); 209 + mxc_register_device(&imx_wdt_device0, NULL); 208 210 } 209 211
+1 -1
arch/arm/mach-mx5/clock-mx51.c
··· 757 757 758 758 /* GPT */ 759 759 DEFINE_CLOCK(gpt_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG9_OFFSET, 760 - NULL, NULL, &ipg_perclk, NULL); 760 + NULL, NULL, &ipg_clk, NULL); 761 761 DEFINE_CLOCK(gpt_ipg_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG10_OFFSET, 762 762 NULL, NULL, &ipg_clk, NULL); 763 763
+53
arch/arm/mach-mx5/cpu.c
··· 14 14 #include <linux/types.h> 15 15 #include <linux/kernel.h> 16 16 #include <linux/init.h> 17 + #include <linux/module.h> 17 18 #include <mach/hardware.h> 18 19 #include <asm/io.h> 20 + 21 + static int cpu_silicon_rev = -1; 22 + 23 + #define SI_REV 0x48 24 + 25 + static void query_silicon_parameter(void) 26 + { 27 + void __iomem *rom = ioremap(MX51_IROM_BASE_ADDR, MX51_IROM_SIZE); 28 + u32 rev; 29 + 30 + if (!rom) { 31 + cpu_silicon_rev = -EINVAL; 32 + return; 33 + } 34 + 35 + rev = readl(rom + SI_REV); 36 + switch (rev) { 37 + case 0x1: 38 + cpu_silicon_rev = MX51_CHIP_REV_1_0; 39 + break; 40 + case 0x2: 41 + cpu_silicon_rev = MX51_CHIP_REV_1_1; 42 + break; 43 + case 0x10: 44 + cpu_silicon_rev = MX51_CHIP_REV_2_0; 45 + break; 46 + case 0x20: 47 + cpu_silicon_rev = MX51_CHIP_REV_3_0; 48 + break; 49 + default: 50 + cpu_silicon_rev = 0; 51 + } 52 + 53 + iounmap(rom); 54 + } 55 + 56 + /* 57 + * Returns: 58 + * the silicon revision of the cpu 59 + * -EINVAL - not a mx51 60 + */ 61 + int mx51_revision(void) 62 + { 63 + if (!cpu_is_mx51()) 64 + return -EINVAL; 65 + 66 + if (cpu_silicon_rev == -1) 67 + query_silicon_parameter(); 68 + 69 + return cpu_silicon_rev; 70 + } 71 + EXPORT_SYMBOL(mx51_revision); 19 72 20 73 static int __init post_cpu_init(void) 21 74 {
+13 -19
arch/arm/mach-mx5/mm.c
··· 35 35 .length = MX51_DEBUG_SIZE, 36 36 .type = MT_DEVICE 37 37 }, { 38 - .virtual = MX51_TZIC_BASE_ADDR_VIRT, 39 - .pfn = __phys_to_pfn(MX51_TZIC_BASE_ADDR), 40 - .length = MX51_TZIC_SIZE, 41 - .type = MT_DEVICE 42 - }, { 43 38 .virtual = MX51_AIPS1_BASE_ADDR_VIRT, 44 39 .pfn = __phys_to_pfn(MX51_AIPS1_BASE_ADDR), 45 40 .length = MX51_AIPS1_SIZE, ··· 49 54 .pfn = __phys_to_pfn(MX51_AIPS2_BASE_ADDR), 50 55 .length = MX51_AIPS2_SIZE, 51 56 .type = MT_DEVICE 52 - }, { 53 - .virtual = MX51_NFC_AXI_BASE_ADDR_VIRT, 54 - .pfn = __phys_to_pfn(MX51_NFC_AXI_BASE_ADDR), 55 - .length = MX51_NFC_AXI_SIZE, 56 - .type = MT_DEVICE 57 57 }, 58 58 }; 59 59 ··· 59 69 */ 60 70 void __init mx51_map_io(void) 61 71 { 62 - u32 tzic_addr; 63 - 64 - if (mx51_revision() < MX51_CHIP_REV_2_0) 65 - tzic_addr = 0x8FFFC000; 66 - else 67 - tzic_addr = 0xE0003000; 68 - mxc_io_desc[2].pfn = __phys_to_pfn(tzic_addr); 69 - 70 72 mxc_set_cpu_type(MXC_CPU_MX51); 71 73 mxc_iomux_v3_init(MX51_IO_ADDRESS(MX51_IOMUXC_BASE_ADDR)); 72 74 mxc_arch_reset_init(MX51_IO_ADDRESS(MX51_WDOG_BASE_ADDR)); ··· 67 85 68 86 void __init mx51_init_irq(void) 69 87 { 70 - tzic_init_irq(MX51_IO_ADDRESS(MX51_TZIC_BASE_ADDR)); 88 + unsigned long tzic_addr; 89 + void __iomem *tzic_virt; 90 + 91 + if (mx51_revision() < MX51_CHIP_REV_2_0) 92 + tzic_addr = MX51_TZIC_BASE_ADDR_TO1; 93 + else 94 + tzic_addr = MX51_TZIC_BASE_ADDR; 95 + 96 + tzic_virt = ioremap(tzic_addr, SZ_16K); 97 + if (!tzic_virt) 98 + panic("unable to map TZIC interrupt controller\n"); 99 + 100 + tzic_init_irq(tzic_virt); 71 101 }
+3 -3
arch/arm/plat-mxc/include/mach/board-mx31pdk.h arch/arm/plat-mxc/include/mach/board-mx31_3ds.h
··· 8 8 * published by the Free Software Foundation. 9 9 */ 10 10 11 - #ifndef __ASM_ARCH_MXC_BOARD_MX31PDK_H__ 12 - #define __ASM_ARCH_MXC_BOARD_MX31PDK_H__ 11 + #ifndef __ASM_ARCH_MXC_BOARD_MX31_3DS_H__ 12 + #define __ASM_ARCH_MXC_BOARD_MX31_3DS_H__ 13 13 14 14 /* Definitions for components on the Debug board */ 15 15 ··· 56 56 57 57 #define MXC_MAX_EXP_IO_LINES 16 58 58 59 - #endif /* __ASM_ARCH_MXC_BOARD_MX31PDK_H__ */ 59 + #endif /* __ASM_ARCH_MXC_BOARD_MX31_3DS_H__ */
+12 -21
arch/arm/plat-mxc/include/mach/mx51.h
··· 14 14 * FB100000 70000000 1M SPBA 0 15 15 * FB000000 73F00000 1M AIPS 1 16 16 * FB200000 83F00000 1M AIPS 2 17 - * FA100000 8FFFC000 16K TZIC (interrupt controller) 17 + * 8FFFC000 16K TZIC (interrupt controller) 18 18 * 90000000 256M CSD0 SDRAM/DDR 19 19 * A0000000 256M CSD1 SDRAM/DDR 20 20 * B0000000 128M CS0 Flash ··· 23 23 * C8000000 64M CS3 Flash 24 24 * CC000000 32M CS4 SRAM 25 25 * CE000000 32M CS5 SRAM 26 - * F9000000 CFFF0000 64K NFC (NAND Flash AXI) 26 + * CFFF0000 64K NFC (NAND Flash AXI) 27 27 * 28 28 */ 29 + 30 + /* 31 + * IROM 32 + */ 33 + #define MX51_IROM_BASE_ADDR 0x0 34 + #define MX51_IROM_SIZE SZ_64K 29 35 30 36 /* 31 37 * IRAM ··· 46 40 * NFC 47 41 */ 48 42 #define MX51_NFC_AXI_BASE_ADDR 0xCFFF0000 /* NAND flash AXI */ 49 - #define MX51_NFC_AXI_BASE_ADDR_VIRT 0xF9000000 50 43 #define MX51_NFC_AXI_SIZE SZ_64K 51 44 52 45 /* ··· 54 49 #define MX51_GPU_BASE_ADDR 0x20000000 55 50 #define MX51_GPU2D_BASE_ADDR 0xD0000000 56 51 57 - #define MX51_TZIC_BASE_ADDR 0x8FFFC000 58 - #define MX51_TZIC_BASE_ADDR_VIRT 0xFA100000 59 - #define MX51_TZIC_SIZE SZ_16K 52 + #define MX51_TZIC_BASE_ADDR_TO1 0x8FFFC000 53 + #define MX51_TZIC_BASE_ADDR 0xE0000000 60 54 61 55 #define MX51_DEBUG_BASE_ADDR 0x60000000 62 56 #define MX51_DEBUG_BASE_ADDR_VIRT 0xFA200000 ··· 236 232 #define MX51_IO_ADDRESS(x) \ 237 233 (void __iomem *) \ 238 234 (MX51_IS_MODULE(x, IRAM) ? MX51_IRAM_IO_ADDRESS(x) : \ 239 - MX51_IS_MODULE(x, TZIC) ? MX51_TZIC_IO_ADDRESS(x) : \ 240 235 MX51_IS_MODULE(x, DEBUG) ? MX51_DEBUG_IO_ADDRESS(x) : \ 241 236 MX51_IS_MODULE(x, SPBA0) ? MX51_SPBA0_IO_ADDRESS(x) : \ 242 237 MX51_IS_MODULE(x, AIPS1) ? MX51_AIPS1_IO_ADDRESS(x) : \ 243 - MX51_IS_MODULE(x, AIPS2) ? MX51_AIPS2_IO_ADDRESS(x) : \ 244 - MX51_IS_MODULE(x, NFC_AXI) ? MX51_NFC_AXI_IO_ADDRESS(x) : \ 238 + MX51_IS_MODULE(x, AIPS2) ? MX51_AIPS2_IO_ADDRESS(x) : \ 245 239 0xDEADBEEF) 246 240 247 241 /* ··· 247 245 */ 248 246 #define MX51_IRAM_IO_ADDRESS(x) \ 249 247 (((x) - MX51_IRAM_BASE_ADDR) + MX51_IRAM_BASE_ADDR_VIRT) 250 - 251 - #define MX51_TZIC_IO_ADDRESS(x) \ 252 - (((x) - MX51_TZIC_BASE_ADDR) + MX51_TZIC_BASE_ADDR_VIRT) 253 248 254 249 #define MX51_DEBUG_IO_ADDRESS(x) \ 255 250 (((x) - MX51_DEBUG_BASE_ADDR) + MX51_DEBUG_BASE_ADDR_VIRT) ··· 259 260 260 261 #define MX51_AIPS2_IO_ADDRESS(x) \ 261 262 (((x) - MX51_AIPS2_BASE_ADDR) + MX51_AIPS2_BASE_ADDR_VIRT) 262 - 263 - #define MX51_NFC_AXI_IO_ADDRESS(x) \ 264 - (((x) - MX51_NFC_AXI_BASE_ADDR) + MX51_NFC_AXI_BASE_ADDR_VIRT) 265 263 266 264 #define MX51_IS_MEM_DEVICE_NONSHARED(x) 0 267 265 ··· 439 443 440 444 #if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS) 441 445 442 - extern unsigned int system_rev; 443 - 444 - static inline unsigned int mx51_revision(void) 445 - { 446 - return system_rev; 447 - } 446 + extern int mx51_revision(void); 448 447 #endif 449 448 450 449 #endif /* __ASM_ARCH_MXC_MX51_H__ */
+4
arch/arm/plat-mxc/include/mach/uncompress.h
··· 66 66 #define MX2X_UART1_BASE_ADDR 0x1000a000 67 67 #define MX3X_UART1_BASE_ADDR 0x43F90000 68 68 #define MX3X_UART2_BASE_ADDR 0x43F94000 69 + #define MX51_UART1_BASE_ADDR 0x73fbc000 69 70 70 71 static __inline__ void __arch_decomp_setup(unsigned long arch_id) 71 72 { ··· 101 100 break; 102 101 case MACH_TYPE_MAGX_ZN5: 103 102 uart_base = MX3X_UART2_BASE_ADDR; 103 + break; 104 + case MACH_TYPE_MX51_BABBAGE: 105 + uart_base = MX51_UART1_BASE_ADDR; 104 106 break; 105 107 default: 106 108 break;