1b2441318SGreg Kroah-Hartman // SPDX-License-Identifier: GPL-2.0 28f58de7cSeric miao #include <linux/module.h> 38f58de7cSeric miao #include <linux/kernel.h> 48f58de7cSeric miao #include <linux/init.h> 58f58de7cSeric miao #include <linux/platform_device.h> 622abc0d2SRobert Jarzmik #include <linux/clkdev.h> 7a52e1736SEzequiel Garcia #include <linux/clk-provider.h> 88f58de7cSeric miao #include <linux/dma-mapping.h> 91da10c17SRobert Jarzmik #include <linux/dmaengine.h> 10917195d6SDmitry Torokhov #include <linux/gpio-pxa.h> 11f15fc9b1SWolfram Sang #include <linux/platform_data/i2c-pxa.h> 1208d3df8cSArnd Bergmann #include <linux/soc/pxa/cpu.h> 138f58de7cSeric miao 144c25c5d2SArnd Bergmann #include "udc.h" 15293b2da1SArnd Bergmann #include <linux/platform_data/video-pxafb.h> 16293b2da1SArnd Bergmann #include <linux/platform_data/mmc-pxamci.h> 17e6acc406SArnd Bergmann #include "irqs.h" 18293b2da1SArnd Bergmann #include <linux/platform_data/usb-ohci-pxa27x.h> 194be0856fSRobert Jarzmik #include <linux/platform_data/mmp_dma.h> 208f58de7cSeric miao 21917195d6SDmitry Torokhov #include "mfp-pxa2xx.h" 22e6acc406SArnd Bergmann #include "regs-ost.h" 23e6acc406SArnd Bergmann #include "reset.h" 248f58de7cSeric miao #include "devices.h" 25bc3a5959SPhilipp Zabel #include "generic.h" 268f58de7cSeric miao 278f58de7cSeric miao void __init pxa_register_device(struct platform_device *dev, void *data) 288f58de7cSeric miao { 298f58de7cSeric miao int ret; 308f58de7cSeric miao 318f58de7cSeric miao dev->dev.platform_data = data; 328f58de7cSeric miao 338f58de7cSeric miao ret = platform_device_register(dev); 348f58de7cSeric miao if (ret) 358f58de7cSeric miao dev_err(&dev->dev, "unable to register device: %d\n", ret); 368f58de7cSeric miao } 378f58de7cSeric miao 3809a5358dSEric Miao static struct resource pxa_resource_pmu = { 3909a5358dSEric Miao .start = IRQ_PMU, 4009a5358dSEric Miao .end = IRQ_PMU, 4109a5358dSEric Miao .flags = IORESOURCE_IRQ, 4209a5358dSEric Miao }; 4309a5358dSEric Miao 4409a5358dSEric Miao struct platform_device pxa_device_pmu = { 45f9eff219SMark Rutland .name = "xscale-pmu", 46df3d17e0SSudeep KarkadaNagesha .id = -1, 4709a5358dSEric Miao .resource = &pxa_resource_pmu, 4809a5358dSEric Miao .num_resources = 1, 4909a5358dSEric Miao }; 5009a5358dSEric Miao 51*444b8987SDmitry Torokhov static const struct resource pxamci_resources[] = { 528f58de7cSeric miao [0] = { 538f58de7cSeric miao .start = 0x41100000, 548f58de7cSeric miao .end = 0x41100fff, 558f58de7cSeric miao .flags = IORESOURCE_MEM, 568f58de7cSeric miao }, 578f58de7cSeric miao [1] = { 588f58de7cSeric miao .start = IRQ_MMC, 598f58de7cSeric miao .end = IRQ_MMC, 608f58de7cSeric miao .flags = IORESOURCE_IRQ, 618f58de7cSeric miao }, 628f58de7cSeric miao }; 638f58de7cSeric miao 64*444b8987SDmitry Torokhov void __init pxa_set_mci_info(const struct pxamci_platform_data *info, 65*444b8987SDmitry Torokhov const struct property_entry *props) 66*444b8987SDmitry Torokhov { 67*444b8987SDmitry Torokhov const struct platform_device_info mci_info = { 688f58de7cSeric miao .name = "pxa2xx-mci", 69fafc9d3fSBridge Wu .id = 0, 70*444b8987SDmitry Torokhov .res = pxamci_resources, 71*444b8987SDmitry Torokhov .num_res = ARRAY_SIZE(pxamci_resources), 72*444b8987SDmitry Torokhov .data = info, 73*444b8987SDmitry Torokhov .size_data = sizeof(*info), 74*444b8987SDmitry Torokhov .dma_mask = 0xffffffffUL, 75*444b8987SDmitry Torokhov .properties = props, 768f58de7cSeric miao }; 77*444b8987SDmitry Torokhov struct platform_device *mci_dev; 78*444b8987SDmitry Torokhov int err; 798f58de7cSeric miao 80*444b8987SDmitry Torokhov mci_dev = platform_device_register_full(&mci_info); 81*444b8987SDmitry Torokhov err = PTR_ERR_OR_ZERO(mci_dev); 82*444b8987SDmitry Torokhov if (err) 83*444b8987SDmitry Torokhov pr_err("Unable to create mci device: %d\n", err); 848f58de7cSeric miao } 858f58de7cSeric miao 861257629bSPhilipp Zabel static struct pxa2xx_udc_mach_info pxa_udc_info = { 871257629bSPhilipp Zabel .gpio_pullup = -1, 881257629bSPhilipp Zabel }; 898f58de7cSeric miao 908f58de7cSeric miao static struct resource pxa2xx_udc_resources[] = { 918f58de7cSeric miao [0] = { 928f58de7cSeric miao .start = 0x40600000, 938f58de7cSeric miao .end = 0x4060ffff, 948f58de7cSeric miao .flags = IORESOURCE_MEM, 958f58de7cSeric miao }, 968f58de7cSeric miao [1] = { 978f58de7cSeric miao .start = IRQ_USB, 988f58de7cSeric miao .end = IRQ_USB, 998f58de7cSeric miao .flags = IORESOURCE_IRQ, 1008f58de7cSeric miao }, 1018f58de7cSeric miao }; 1028f58de7cSeric miao 1038f58de7cSeric miao static u64 udc_dma_mask = ~(u32)0; 1048f58de7cSeric miao 1057a857620SPhilipp Zabel struct platform_device pxa25x_device_udc = { 1067a857620SPhilipp Zabel .name = "pxa25x-udc", 1077a857620SPhilipp Zabel .id = -1, 1087a857620SPhilipp Zabel .resource = pxa2xx_udc_resources, 1097a857620SPhilipp Zabel .num_resources = ARRAY_SIZE(pxa2xx_udc_resources), 1107a857620SPhilipp Zabel .dev = { 1117a857620SPhilipp Zabel .platform_data = &pxa_udc_info, 1127a857620SPhilipp Zabel .dma_mask = &udc_dma_mask, 1137a857620SPhilipp Zabel } 1147a857620SPhilipp Zabel }; 1157a857620SPhilipp Zabel 1167a857620SPhilipp Zabel struct platform_device pxa27x_device_udc = { 1177a857620SPhilipp Zabel .name = "pxa27x-udc", 1188f58de7cSeric miao .id = -1, 1198f58de7cSeric miao .resource = pxa2xx_udc_resources, 1208f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa2xx_udc_resources), 1218f58de7cSeric miao .dev = { 1228f58de7cSeric miao .platform_data = &pxa_udc_info, 1238f58de7cSeric miao .dma_mask = &udc_dma_mask, 1248f58de7cSeric miao } 1258f58de7cSeric miao }; 1268f58de7cSeric miao 1278f58de7cSeric miao static struct resource pxafb_resources[] = { 1288f58de7cSeric miao [0] = { 1298f58de7cSeric miao .start = 0x44000000, 1308f58de7cSeric miao .end = 0x4400ffff, 1318f58de7cSeric miao .flags = IORESOURCE_MEM, 1328f58de7cSeric miao }, 1338f58de7cSeric miao [1] = { 1348f58de7cSeric miao .start = IRQ_LCD, 1358f58de7cSeric miao .end = IRQ_LCD, 1368f58de7cSeric miao .flags = IORESOURCE_IRQ, 1378f58de7cSeric miao }, 1388f58de7cSeric miao }; 1398f58de7cSeric miao 1408f58de7cSeric miao static u64 fb_dma_mask = ~(u64)0; 1418f58de7cSeric miao 1428f58de7cSeric miao struct platform_device pxa_device_fb = { 1438f58de7cSeric miao .name = "pxa2xx-fb", 1448f58de7cSeric miao .id = -1, 1458f58de7cSeric miao .dev = { 1468f58de7cSeric miao .dma_mask = &fb_dma_mask, 1478f58de7cSeric miao .coherent_dma_mask = 0xffffffff, 1488f58de7cSeric miao }, 1498f58de7cSeric miao .num_resources = ARRAY_SIZE(pxafb_resources), 1508f58de7cSeric miao .resource = pxafb_resources, 1518f58de7cSeric miao }; 1528f58de7cSeric miao 1534321e1a1SRussell King - ARM Linux void __init pxa_set_fb_info(struct device *parent, struct pxafb_mach_info *info) 1548f58de7cSeric miao { 1554321e1a1SRussell King - ARM Linux pxa_device_fb.dev.parent = parent; 1568f58de7cSeric miao pxa_register_device(&pxa_device_fb, info); 1578f58de7cSeric miao } 1588f58de7cSeric miao 1598f58de7cSeric miao static struct resource pxa_resource_ffuart[] = { 1608f58de7cSeric miao { 16102f65262SEric Miao .start = 0x40100000, 16202f65262SEric Miao .end = 0x40100023, 1638f58de7cSeric miao .flags = IORESOURCE_MEM, 1648f58de7cSeric miao }, { 1658f58de7cSeric miao .start = IRQ_FFUART, 1668f58de7cSeric miao .end = IRQ_FFUART, 1678f58de7cSeric miao .flags = IORESOURCE_IRQ, 1688f58de7cSeric miao } 1698f58de7cSeric miao }; 1708f58de7cSeric miao 1718f58de7cSeric miao struct platform_device pxa_device_ffuart = { 1728f58de7cSeric miao .name = "pxa2xx-uart", 1738f58de7cSeric miao .id = 0, 1748f58de7cSeric miao .resource = pxa_resource_ffuart, 1758f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa_resource_ffuart), 1768f58de7cSeric miao }; 1778f58de7cSeric miao 178cc155c6fSRussell King void __init pxa_set_ffuart_info(void *info) 179cc155c6fSRussell King { 180cc155c6fSRussell King pxa_register_device(&pxa_device_ffuart, info); 181cc155c6fSRussell King } 182cc155c6fSRussell King 1838f58de7cSeric miao static struct resource pxa_resource_btuart[] = { 1848f58de7cSeric miao { 18502f65262SEric Miao .start = 0x40200000, 18602f65262SEric Miao .end = 0x40200023, 1878f58de7cSeric miao .flags = IORESOURCE_MEM, 1888f58de7cSeric miao }, { 1898f58de7cSeric miao .start = IRQ_BTUART, 1908f58de7cSeric miao .end = IRQ_BTUART, 1918f58de7cSeric miao .flags = IORESOURCE_IRQ, 1928f58de7cSeric miao } 1938f58de7cSeric miao }; 1948f58de7cSeric miao 1958f58de7cSeric miao struct platform_device pxa_device_btuart = { 1968f58de7cSeric miao .name = "pxa2xx-uart", 1978f58de7cSeric miao .id = 1, 1988f58de7cSeric miao .resource = pxa_resource_btuart, 1998f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa_resource_btuart), 2008f58de7cSeric miao }; 2018f58de7cSeric miao 202cc155c6fSRussell King void __init pxa_set_btuart_info(void *info) 203cc155c6fSRussell King { 204cc155c6fSRussell King pxa_register_device(&pxa_device_btuart, info); 205cc155c6fSRussell King } 206cc155c6fSRussell King 2078f58de7cSeric miao static struct resource pxa_resource_stuart[] = { 2088f58de7cSeric miao { 20902f65262SEric Miao .start = 0x40700000, 21002f65262SEric Miao .end = 0x40700023, 2118f58de7cSeric miao .flags = IORESOURCE_MEM, 2128f58de7cSeric miao }, { 2138f58de7cSeric miao .start = IRQ_STUART, 2148f58de7cSeric miao .end = IRQ_STUART, 2158f58de7cSeric miao .flags = IORESOURCE_IRQ, 2168f58de7cSeric miao } 2178f58de7cSeric miao }; 2188f58de7cSeric miao 2198f58de7cSeric miao struct platform_device pxa_device_stuart = { 2208f58de7cSeric miao .name = "pxa2xx-uart", 2218f58de7cSeric miao .id = 2, 2228f58de7cSeric miao .resource = pxa_resource_stuart, 2238f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa_resource_stuart), 2248f58de7cSeric miao }; 2258f58de7cSeric miao 226cc155c6fSRussell King void __init pxa_set_stuart_info(void *info) 227cc155c6fSRussell King { 228cc155c6fSRussell King pxa_register_device(&pxa_device_stuart, info); 229cc155c6fSRussell King } 230cc155c6fSRussell King 2318f58de7cSeric miao static struct resource pxa_resource_hwuart[] = { 2328f58de7cSeric miao { 23302f65262SEric Miao .start = 0x41600000, 23402f65262SEric Miao .end = 0x4160002F, 2358f58de7cSeric miao .flags = IORESOURCE_MEM, 2368f58de7cSeric miao }, { 2378f58de7cSeric miao .start = IRQ_HWUART, 2388f58de7cSeric miao .end = IRQ_HWUART, 2398f58de7cSeric miao .flags = IORESOURCE_IRQ, 2408f58de7cSeric miao } 2418f58de7cSeric miao }; 2428f58de7cSeric miao 2438f58de7cSeric miao struct platform_device pxa_device_hwuart = { 2448f58de7cSeric miao .name = "pxa2xx-uart", 2458f58de7cSeric miao .id = 3, 2468f58de7cSeric miao .resource = pxa_resource_hwuart, 2478f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa_resource_hwuart), 2488f58de7cSeric miao }; 2498f58de7cSeric miao 250cc155c6fSRussell King void __init pxa_set_hwuart_info(void *info) 251cc155c6fSRussell King { 252cc155c6fSRussell King if (cpu_is_pxa255()) 253cc155c6fSRussell King pxa_register_device(&pxa_device_hwuart, info); 254cc155c6fSRussell King else 255cc155c6fSRussell King pr_info("UART: Ignoring attempt to register HWUART on non-PXA255 hardware"); 256cc155c6fSRussell King } 257cc155c6fSRussell King 2588f58de7cSeric miao static struct resource pxai2c_resources[] = { 2598f58de7cSeric miao { 2608f58de7cSeric miao .start = 0x40301680, 2618f58de7cSeric miao .end = 0x403016a3, 2628f58de7cSeric miao .flags = IORESOURCE_MEM, 2638f58de7cSeric miao }, { 2648f58de7cSeric miao .start = IRQ_I2C, 2658f58de7cSeric miao .end = IRQ_I2C, 2668f58de7cSeric miao .flags = IORESOURCE_IRQ, 2678f58de7cSeric miao }, 2688f58de7cSeric miao }; 2698f58de7cSeric miao 2708f58de7cSeric miao struct platform_device pxa_device_i2c = { 2718f58de7cSeric miao .name = "pxa2xx-i2c", 2728f58de7cSeric miao .id = 0, 2738f58de7cSeric miao .resource = pxai2c_resources, 2748f58de7cSeric miao .num_resources = ARRAY_SIZE(pxai2c_resources), 2758f58de7cSeric miao }; 2768f58de7cSeric miao 2778f58de7cSeric miao void __init pxa_set_i2c_info(struct i2c_pxa_platform_data *info) 2788f58de7cSeric miao { 2798f58de7cSeric miao pxa_register_device(&pxa_device_i2c, info); 2808f58de7cSeric miao } 2818f58de7cSeric miao 28299464293SEric Miao #ifdef CONFIG_PXA27x 28399464293SEric Miao static struct resource pxa27x_resources_i2c_power[] = { 28499464293SEric Miao { 28599464293SEric Miao .start = 0x40f00180, 28699464293SEric Miao .end = 0x40f001a3, 28799464293SEric Miao .flags = IORESOURCE_MEM, 28899464293SEric Miao }, { 28999464293SEric Miao .start = IRQ_PWRI2C, 29099464293SEric Miao .end = IRQ_PWRI2C, 29199464293SEric Miao .flags = IORESOURCE_IRQ, 29299464293SEric Miao }, 29399464293SEric Miao }; 29499464293SEric Miao 29599464293SEric Miao struct platform_device pxa27x_device_i2c_power = { 29699464293SEric Miao .name = "pxa2xx-i2c", 29799464293SEric Miao .id = 1, 29899464293SEric Miao .resource = pxa27x_resources_i2c_power, 29999464293SEric Miao .num_resources = ARRAY_SIZE(pxa27x_resources_i2c_power), 30099464293SEric Miao }; 30199464293SEric Miao #endif 30299464293SEric Miao 3038f58de7cSeric miao static struct resource pxai2s_resources[] = { 3048f58de7cSeric miao { 3058f58de7cSeric miao .start = 0x40400000, 3068f58de7cSeric miao .end = 0x40400083, 3078f58de7cSeric miao .flags = IORESOURCE_MEM, 3088f58de7cSeric miao }, { 3098f58de7cSeric miao .start = IRQ_I2S, 3108f58de7cSeric miao .end = IRQ_I2S, 3118f58de7cSeric miao .flags = IORESOURCE_IRQ, 3128f58de7cSeric miao }, 3138f58de7cSeric miao }; 3148f58de7cSeric miao 3158f58de7cSeric miao struct platform_device pxa_device_i2s = { 3168f58de7cSeric miao .name = "pxa2xx-i2s", 3178f58de7cSeric miao .id = -1, 3188f58de7cSeric miao .resource = pxai2s_resources, 3198f58de7cSeric miao .num_resources = ARRAY_SIZE(pxai2s_resources), 3208f58de7cSeric miao }; 3218f58de7cSeric miao 322f0fba2adSLiam Girdwood struct platform_device pxa_device_asoc_ssp1 = { 323f0fba2adSLiam Girdwood .name = "pxa-ssp-dai", 324f0fba2adSLiam Girdwood .id = 0, 325f0fba2adSLiam Girdwood }; 326f0fba2adSLiam Girdwood 327f0fba2adSLiam Girdwood struct platform_device pxa_device_asoc_ssp2= { 328f0fba2adSLiam Girdwood .name = "pxa-ssp-dai", 329f0fba2adSLiam Girdwood .id = 1, 330f0fba2adSLiam Girdwood }; 331f0fba2adSLiam Girdwood 332f0fba2adSLiam Girdwood struct platform_device pxa_device_asoc_ssp3 = { 333f0fba2adSLiam Girdwood .name = "pxa-ssp-dai", 334f0fba2adSLiam Girdwood .id = 2, 335f0fba2adSLiam Girdwood }; 336f0fba2adSLiam Girdwood 337f0fba2adSLiam Girdwood struct platform_device pxa_device_asoc_ssp4 = { 338f0fba2adSLiam Girdwood .name = "pxa-ssp-dai", 339f0fba2adSLiam Girdwood .id = 3, 340f0fba2adSLiam Girdwood }; 341f0fba2adSLiam Girdwood 342f0fba2adSLiam Girdwood struct platform_device pxa_device_asoc_platform = { 343f0fba2adSLiam Girdwood .name = "pxa-pcm-audio", 344f0fba2adSLiam Girdwood .id = -1, 345f0fba2adSLiam Girdwood }; 346f0fba2adSLiam Girdwood 34772493146SRobert Jarzmik static struct resource pxa_rtc_resources[] = { 34872493146SRobert Jarzmik [0] = { 34972493146SRobert Jarzmik .start = 0x40900000, 35072493146SRobert Jarzmik .end = 0x40900000 + 0x3b, 35172493146SRobert Jarzmik .flags = IORESOURCE_MEM, 35272493146SRobert Jarzmik }, 35372493146SRobert Jarzmik [1] = { 35472493146SRobert Jarzmik .start = IRQ_RTC1Hz, 35572493146SRobert Jarzmik .end = IRQ_RTC1Hz, 3563888c090SHaojian Zhuang .name = "rtc 1Hz", 35772493146SRobert Jarzmik .flags = IORESOURCE_IRQ, 35872493146SRobert Jarzmik }, 35972493146SRobert Jarzmik [2] = { 36072493146SRobert Jarzmik .start = IRQ_RTCAlrm, 36172493146SRobert Jarzmik .end = IRQ_RTCAlrm, 3623888c090SHaojian Zhuang .name = "rtc alarm", 36372493146SRobert Jarzmik .flags = IORESOURCE_IRQ, 36472493146SRobert Jarzmik }, 36572493146SRobert Jarzmik }; 36672493146SRobert Jarzmik 36772493146SRobert Jarzmik struct platform_device pxa_device_rtc = { 36872493146SRobert Jarzmik .name = "pxa-rtc", 36972493146SRobert Jarzmik .id = -1, 37072493146SRobert Jarzmik .num_resources = ARRAY_SIZE(pxa_rtc_resources), 37172493146SRobert Jarzmik .resource = pxa_rtc_resources, 37272493146SRobert Jarzmik }; 37372493146SRobert Jarzmik 3743888c090SHaojian Zhuang struct platform_device sa1100_device_rtc = { 3753888c090SHaojian Zhuang .name = "sa1100-rtc", 3763888c090SHaojian Zhuang .id = -1, 3772c4fabecSRob Herring .num_resources = ARRAY_SIZE(pxa_rtc_resources), 3782c4fabecSRob Herring .resource = pxa_rtc_resources, 3793888c090SHaojian Zhuang }; 3803888c090SHaojian Zhuang 3818f58de7cSeric miao #ifdef CONFIG_PXA25x 3828f58de7cSeric miao 38375540c1aSeric miao static struct resource pxa25x_resource_pwm0[] = { 38475540c1aSeric miao [0] = { 38575540c1aSeric miao .start = 0x40b00000, 38675540c1aSeric miao .end = 0x40b0000f, 38775540c1aSeric miao .flags = IORESOURCE_MEM, 38875540c1aSeric miao }, 38975540c1aSeric miao }; 39075540c1aSeric miao 39175540c1aSeric miao struct platform_device pxa25x_device_pwm0 = { 39275540c1aSeric miao .name = "pxa25x-pwm", 39375540c1aSeric miao .id = 0, 39475540c1aSeric miao .resource = pxa25x_resource_pwm0, 39575540c1aSeric miao .num_resources = ARRAY_SIZE(pxa25x_resource_pwm0), 39675540c1aSeric miao }; 39775540c1aSeric miao 39875540c1aSeric miao static struct resource pxa25x_resource_pwm1[] = { 39975540c1aSeric miao [0] = { 40075540c1aSeric miao .start = 0x40c00000, 40175540c1aSeric miao .end = 0x40c0000f, 40275540c1aSeric miao .flags = IORESOURCE_MEM, 40375540c1aSeric miao }, 40475540c1aSeric miao }; 40575540c1aSeric miao 40675540c1aSeric miao struct platform_device pxa25x_device_pwm1 = { 40775540c1aSeric miao .name = "pxa25x-pwm", 40875540c1aSeric miao .id = 1, 40975540c1aSeric miao .resource = pxa25x_resource_pwm1, 41075540c1aSeric miao .num_resources = ARRAY_SIZE(pxa25x_resource_pwm1), 41175540c1aSeric miao }; 41275540c1aSeric miao 4138f58de7cSeric miao static u64 pxa25x_ssp_dma_mask = DMA_BIT_MASK(32); 4148f58de7cSeric miao 4158f58de7cSeric miao static struct resource pxa25x_resource_ssp[] = { 4168f58de7cSeric miao [0] = { 4178f58de7cSeric miao .start = 0x41000000, 4188f58de7cSeric miao .end = 0x4100001f, 4198f58de7cSeric miao .flags = IORESOURCE_MEM, 4208f58de7cSeric miao }, 4218f58de7cSeric miao [1] = { 4228f58de7cSeric miao .start = IRQ_SSP, 4238f58de7cSeric miao .end = IRQ_SSP, 4248f58de7cSeric miao .flags = IORESOURCE_IRQ, 4258f58de7cSeric miao }, 4268f58de7cSeric miao }; 4278f58de7cSeric miao 4288f58de7cSeric miao struct platform_device pxa25x_device_ssp = { 4298f58de7cSeric miao .name = "pxa25x-ssp", 4308f58de7cSeric miao .id = 0, 4318f58de7cSeric miao .dev = { 4328f58de7cSeric miao .dma_mask = &pxa25x_ssp_dma_mask, 4338f58de7cSeric miao .coherent_dma_mask = DMA_BIT_MASK(32), 4348f58de7cSeric miao }, 4358f58de7cSeric miao .resource = pxa25x_resource_ssp, 4368f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa25x_resource_ssp), 4378f58de7cSeric miao }; 4388f58de7cSeric miao 4398f58de7cSeric miao static u64 pxa25x_nssp_dma_mask = DMA_BIT_MASK(32); 4408f58de7cSeric miao 4418f58de7cSeric miao static struct resource pxa25x_resource_nssp[] = { 4428f58de7cSeric miao [0] = { 4438f58de7cSeric miao .start = 0x41400000, 4448f58de7cSeric miao .end = 0x4140002f, 4458f58de7cSeric miao .flags = IORESOURCE_MEM, 4468f58de7cSeric miao }, 4478f58de7cSeric miao [1] = { 4488f58de7cSeric miao .start = IRQ_NSSP, 4498f58de7cSeric miao .end = IRQ_NSSP, 4508f58de7cSeric miao .flags = IORESOURCE_IRQ, 4518f58de7cSeric miao }, 4528f58de7cSeric miao }; 4538f58de7cSeric miao 4548f58de7cSeric miao struct platform_device pxa25x_device_nssp = { 4558f58de7cSeric miao .name = "pxa25x-nssp", 4568f58de7cSeric miao .id = 1, 4578f58de7cSeric miao .dev = { 4588f58de7cSeric miao .dma_mask = &pxa25x_nssp_dma_mask, 4598f58de7cSeric miao .coherent_dma_mask = DMA_BIT_MASK(32), 4608f58de7cSeric miao }, 4618f58de7cSeric miao .resource = pxa25x_resource_nssp, 4628f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa25x_resource_nssp), 4638f58de7cSeric miao }; 4648f58de7cSeric miao 4658f58de7cSeric miao static u64 pxa25x_assp_dma_mask = DMA_BIT_MASK(32); 4668f58de7cSeric miao 4678f58de7cSeric miao static struct resource pxa25x_resource_assp[] = { 4688f58de7cSeric miao [0] = { 4698f58de7cSeric miao .start = 0x41500000, 4708f58de7cSeric miao .end = 0x4150002f, 4718f58de7cSeric miao .flags = IORESOURCE_MEM, 4728f58de7cSeric miao }, 4738f58de7cSeric miao [1] = { 4748f58de7cSeric miao .start = IRQ_ASSP, 4758f58de7cSeric miao .end = IRQ_ASSP, 4768f58de7cSeric miao .flags = IORESOURCE_IRQ, 4778f58de7cSeric miao }, 4788f58de7cSeric miao }; 4798f58de7cSeric miao 4808f58de7cSeric miao struct platform_device pxa25x_device_assp = { 4818f58de7cSeric miao /* ASSP is basically equivalent to NSSP */ 4828f58de7cSeric miao .name = "pxa25x-nssp", 4838f58de7cSeric miao .id = 2, 4848f58de7cSeric miao .dev = { 4858f58de7cSeric miao .dma_mask = &pxa25x_assp_dma_mask, 4868f58de7cSeric miao .coherent_dma_mask = DMA_BIT_MASK(32), 4878f58de7cSeric miao }, 4888f58de7cSeric miao .resource = pxa25x_resource_assp, 4898f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa25x_resource_assp), 4908f58de7cSeric miao }; 4918f58de7cSeric miao #endif /* CONFIG_PXA25x */ 4928f58de7cSeric miao 4938f58de7cSeric miao #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) 494ec68e45bSeric miao static u64 pxa27x_ohci_dma_mask = DMA_BIT_MASK(32); 495ec68e45bSeric miao 496ec68e45bSeric miao static struct resource pxa27x_resource_ohci[] = { 497ec68e45bSeric miao [0] = { 498ec68e45bSeric miao .start = 0x4C000000, 499ec68e45bSeric miao .end = 0x4C00ff6f, 500ec68e45bSeric miao .flags = IORESOURCE_MEM, 501ec68e45bSeric miao }, 502ec68e45bSeric miao [1] = { 503ec68e45bSeric miao .start = IRQ_USBH1, 504ec68e45bSeric miao .end = IRQ_USBH1, 505ec68e45bSeric miao .flags = IORESOURCE_IRQ, 506ec68e45bSeric miao }, 507ec68e45bSeric miao }; 508ec68e45bSeric miao 509ec68e45bSeric miao struct platform_device pxa27x_device_ohci = { 510ec68e45bSeric miao .name = "pxa27x-ohci", 511ec68e45bSeric miao .id = -1, 512ec68e45bSeric miao .dev = { 513ec68e45bSeric miao .dma_mask = &pxa27x_ohci_dma_mask, 514ec68e45bSeric miao .coherent_dma_mask = DMA_BIT_MASK(32), 515ec68e45bSeric miao }, 516ec68e45bSeric miao .num_resources = ARRAY_SIZE(pxa27x_resource_ohci), 517ec68e45bSeric miao .resource = pxa27x_resource_ohci, 518ec68e45bSeric miao }; 519ec68e45bSeric miao 520ec68e45bSeric miao void __init pxa_set_ohci_info(struct pxaohci_platform_data *info) 521ec68e45bSeric miao { 522ec68e45bSeric miao pxa_register_device(&pxa27x_device_ohci, info); 523ec68e45bSeric miao } 524a4553358SHaojian Zhuang #endif /* CONFIG_PXA27x || CONFIG_PXA3xx */ 525a4553358SHaojian Zhuang 52649ea7fc0SHaojian Zhuang #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) 5278f58de7cSeric miao static u64 pxa27x_ssp1_dma_mask = DMA_BIT_MASK(32); 5288f58de7cSeric miao 5298f58de7cSeric miao static struct resource pxa27x_resource_ssp1[] = { 5308f58de7cSeric miao [0] = { 5318f58de7cSeric miao .start = 0x41000000, 5328f58de7cSeric miao .end = 0x4100003f, 5338f58de7cSeric miao .flags = IORESOURCE_MEM, 5348f58de7cSeric miao }, 5358f58de7cSeric miao [1] = { 5368f58de7cSeric miao .start = IRQ_SSP, 5378f58de7cSeric miao .end = IRQ_SSP, 5388f58de7cSeric miao .flags = IORESOURCE_IRQ, 5398f58de7cSeric miao }, 5408f58de7cSeric miao }; 5418f58de7cSeric miao 5428f58de7cSeric miao struct platform_device pxa27x_device_ssp1 = { 5438f58de7cSeric miao .name = "pxa27x-ssp", 5448f58de7cSeric miao .id = 0, 5458f58de7cSeric miao .dev = { 5468f58de7cSeric miao .dma_mask = &pxa27x_ssp1_dma_mask, 5478f58de7cSeric miao .coherent_dma_mask = DMA_BIT_MASK(32), 5488f58de7cSeric miao }, 5498f58de7cSeric miao .resource = pxa27x_resource_ssp1, 5508f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa27x_resource_ssp1), 5518f58de7cSeric miao }; 5528f58de7cSeric miao 5538f58de7cSeric miao static u64 pxa27x_ssp2_dma_mask = DMA_BIT_MASK(32); 5548f58de7cSeric miao 5558f58de7cSeric miao static struct resource pxa27x_resource_ssp2[] = { 5568f58de7cSeric miao [0] = { 5578f58de7cSeric miao .start = 0x41700000, 5588f58de7cSeric miao .end = 0x4170003f, 5598f58de7cSeric miao .flags = IORESOURCE_MEM, 5608f58de7cSeric miao }, 5618f58de7cSeric miao [1] = { 5628f58de7cSeric miao .start = IRQ_SSP2, 5638f58de7cSeric miao .end = IRQ_SSP2, 5648f58de7cSeric miao .flags = IORESOURCE_IRQ, 5658f58de7cSeric miao }, 5668f58de7cSeric miao }; 5678f58de7cSeric miao 5688f58de7cSeric miao struct platform_device pxa27x_device_ssp2 = { 5698f58de7cSeric miao .name = "pxa27x-ssp", 5708f58de7cSeric miao .id = 1, 5718f58de7cSeric miao .dev = { 5728f58de7cSeric miao .dma_mask = &pxa27x_ssp2_dma_mask, 5738f58de7cSeric miao .coherent_dma_mask = DMA_BIT_MASK(32), 5748f58de7cSeric miao }, 5758f58de7cSeric miao .resource = pxa27x_resource_ssp2, 5768f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa27x_resource_ssp2), 5778f58de7cSeric miao }; 5788f58de7cSeric miao 5798f58de7cSeric miao static u64 pxa27x_ssp3_dma_mask = DMA_BIT_MASK(32); 5808f58de7cSeric miao 5818f58de7cSeric miao static struct resource pxa27x_resource_ssp3[] = { 5828f58de7cSeric miao [0] = { 5838f58de7cSeric miao .start = 0x41900000, 5848f58de7cSeric miao .end = 0x4190003f, 5858f58de7cSeric miao .flags = IORESOURCE_MEM, 5868f58de7cSeric miao }, 5878f58de7cSeric miao [1] = { 5888f58de7cSeric miao .start = IRQ_SSP3, 5898f58de7cSeric miao .end = IRQ_SSP3, 5908f58de7cSeric miao .flags = IORESOURCE_IRQ, 5918f58de7cSeric miao }, 5928f58de7cSeric miao }; 5938f58de7cSeric miao 5948f58de7cSeric miao struct platform_device pxa27x_device_ssp3 = { 5958f58de7cSeric miao .name = "pxa27x-ssp", 5968f58de7cSeric miao .id = 2, 5978f58de7cSeric miao .dev = { 5988f58de7cSeric miao .dma_mask = &pxa27x_ssp3_dma_mask, 5998f58de7cSeric miao .coherent_dma_mask = DMA_BIT_MASK(32), 6008f58de7cSeric miao }, 6018f58de7cSeric miao .resource = pxa27x_resource_ssp3, 6028f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa27x_resource_ssp3), 6038f58de7cSeric miao }; 6043f3acefbSGuennadi Liakhovetski 60575540c1aSeric miao static struct resource pxa27x_resource_pwm0[] = { 60675540c1aSeric miao [0] = { 60775540c1aSeric miao .start = 0x40b00000, 60875540c1aSeric miao .end = 0x40b0001f, 60975540c1aSeric miao .flags = IORESOURCE_MEM, 61075540c1aSeric miao }, 61175540c1aSeric miao }; 61275540c1aSeric miao 61375540c1aSeric miao struct platform_device pxa27x_device_pwm0 = { 61475540c1aSeric miao .name = "pxa27x-pwm", 61575540c1aSeric miao .id = 0, 61675540c1aSeric miao .resource = pxa27x_resource_pwm0, 61775540c1aSeric miao .num_resources = ARRAY_SIZE(pxa27x_resource_pwm0), 61875540c1aSeric miao }; 61975540c1aSeric miao 62075540c1aSeric miao static struct resource pxa27x_resource_pwm1[] = { 62175540c1aSeric miao [0] = { 62275540c1aSeric miao .start = 0x40c00000, 62375540c1aSeric miao .end = 0x40c0001f, 62475540c1aSeric miao .flags = IORESOURCE_MEM, 62575540c1aSeric miao }, 62675540c1aSeric miao }; 62775540c1aSeric miao 62875540c1aSeric miao struct platform_device pxa27x_device_pwm1 = { 62975540c1aSeric miao .name = "pxa27x-pwm", 63075540c1aSeric miao .id = 1, 63175540c1aSeric miao .resource = pxa27x_resource_pwm1, 63275540c1aSeric miao .num_resources = ARRAY_SIZE(pxa27x_resource_pwm1), 63375540c1aSeric miao }; 63449ea7fc0SHaojian Zhuang #endif /* CONFIG_PXA27x || CONFIG_PXA3xx */ 6358f58de7cSeric miao 636f1d6588aSDmitry Torokhov const struct software_node pxa2xx_gpiochip_node = { 637f1d6588aSDmitry Torokhov .name = "gpio-pxa", 638f1d6588aSDmitry Torokhov }; 639f1d6588aSDmitry Torokhov 640157d2644SHaojian Zhuang struct resource pxa_resource_gpio[] = { 641157d2644SHaojian Zhuang { 642157d2644SHaojian Zhuang .start = 0x40e00000, 643157d2644SHaojian Zhuang .end = 0x40e0ffff, 644157d2644SHaojian Zhuang .flags = IORESOURCE_MEM, 645157d2644SHaojian Zhuang }, { 646157d2644SHaojian Zhuang .start = IRQ_GPIO0, 647157d2644SHaojian Zhuang .end = IRQ_GPIO0, 648157d2644SHaojian Zhuang .name = "gpio0", 649157d2644SHaojian Zhuang .flags = IORESOURCE_IRQ, 650157d2644SHaojian Zhuang }, { 651157d2644SHaojian Zhuang .start = IRQ_GPIO1, 652157d2644SHaojian Zhuang .end = IRQ_GPIO1, 653157d2644SHaojian Zhuang .name = "gpio1", 654157d2644SHaojian Zhuang .flags = IORESOURCE_IRQ, 655157d2644SHaojian Zhuang }, { 656157d2644SHaojian Zhuang .start = IRQ_GPIO_2_x, 657157d2644SHaojian Zhuang .end = IRQ_GPIO_2_x, 658157d2644SHaojian Zhuang .name = "gpio_mux", 659157d2644SHaojian Zhuang .flags = IORESOURCE_IRQ, 660157d2644SHaojian Zhuang }, 661157d2644SHaojian Zhuang }; 662157d2644SHaojian Zhuang 663917195d6SDmitry Torokhov static struct pxa_gpio_platform_data pxa2xx_gpio_info = { 664917195d6SDmitry Torokhov .irq_base = PXA_GPIO_TO_IRQ(0), 665917195d6SDmitry Torokhov .gpio_set_wake = gpio_set_wake, 666917195d6SDmitry Torokhov }; 667917195d6SDmitry Torokhov 6682cab0292SHaojian Zhuang struct platform_device pxa25x_device_gpio = { 6692cab0292SHaojian Zhuang .name = "pxa25x-gpio", 6702cab0292SHaojian Zhuang .id = -1, 6712cab0292SHaojian Zhuang .num_resources = ARRAY_SIZE(pxa_resource_gpio), 6722cab0292SHaojian Zhuang .resource = pxa_resource_gpio, 673917195d6SDmitry Torokhov .dev = { 674917195d6SDmitry Torokhov .platform_data = &pxa2xx_gpio_info, 675917195d6SDmitry Torokhov }, 6762cab0292SHaojian Zhuang }; 6772cab0292SHaojian Zhuang 6782cab0292SHaojian Zhuang struct platform_device pxa27x_device_gpio = { 6792cab0292SHaojian Zhuang .name = "pxa27x-gpio", 6802cab0292SHaojian Zhuang .id = -1, 6812cab0292SHaojian Zhuang .num_resources = ARRAY_SIZE(pxa_resource_gpio), 6822cab0292SHaojian Zhuang .resource = pxa_resource_gpio, 683917195d6SDmitry Torokhov .dev = { 684917195d6SDmitry Torokhov .platform_data = &pxa2xx_gpio_info, 685917195d6SDmitry Torokhov }, 6862cab0292SHaojian Zhuang }; 6872cab0292SHaojian Zhuang 6884be0856fSRobert Jarzmik static struct resource pxa_dma_resource[] = { 6894be0856fSRobert Jarzmik [0] = { 6904be0856fSRobert Jarzmik .start = 0x40000000, 6914be0856fSRobert Jarzmik .end = 0x4000ffff, 6924be0856fSRobert Jarzmik .flags = IORESOURCE_MEM, 6934be0856fSRobert Jarzmik }, 6944be0856fSRobert Jarzmik [1] = { 6954be0856fSRobert Jarzmik .start = IRQ_DMA, 6964be0856fSRobert Jarzmik .end = IRQ_DMA, 6974be0856fSRobert Jarzmik .flags = IORESOURCE_IRQ, 6984be0856fSRobert Jarzmik }, 6994be0856fSRobert Jarzmik }; 7004be0856fSRobert Jarzmik 7014be0856fSRobert Jarzmik static u64 pxadma_dmamask = 0xffffffffUL; 7024be0856fSRobert Jarzmik 7034be0856fSRobert Jarzmik static struct platform_device pxa2xx_pxa_dma = { 7044be0856fSRobert Jarzmik .name = "pxa-dma", 7054be0856fSRobert Jarzmik .id = 0, 7064be0856fSRobert Jarzmik .dev = { 7074be0856fSRobert Jarzmik .dma_mask = &pxadma_dmamask, 7084be0856fSRobert Jarzmik .coherent_dma_mask = 0xffffffff, 7094be0856fSRobert Jarzmik }, 7104be0856fSRobert Jarzmik .num_resources = ARRAY_SIZE(pxa_dma_resource), 7114be0856fSRobert Jarzmik .resource = pxa_dma_resource, 7124be0856fSRobert Jarzmik }; 7134be0856fSRobert Jarzmik 7141da10c17SRobert Jarzmik void __init pxa2xx_set_dmac_info(struct mmp_dma_platdata *dma_pdata) 7154be0856fSRobert Jarzmik { 7161da10c17SRobert Jarzmik pxa_register_device(&pxa2xx_pxa_dma, dma_pdata); 7174be0856fSRobert Jarzmik } 718e86bd43bSArnd Bergmann 719e86bd43bSArnd Bergmann void __init pxa_register_wdt(unsigned int reset_status) 720e86bd43bSArnd Bergmann { 721e86bd43bSArnd Bergmann struct resource res = DEFINE_RES_MEM(OST_PHYS, OST_LEN); 722e86bd43bSArnd Bergmann 723e86bd43bSArnd Bergmann reset_status &= RESET_STATUS_WATCHDOG; 724e86bd43bSArnd Bergmann platform_device_register_resndata(NULL, "sa1100_wdt", -1, &res, 1, 725e86bd43bSArnd Bergmann &reset_status, sizeof(reset_status)); 726e86bd43bSArnd Bergmann } 727