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 518f58de7cSeric miao static 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 648f58de7cSeric miao static u64 pxamci_dmamask = 0xffffffffUL; 658f58de7cSeric miao 668f58de7cSeric miao struct platform_device pxa_device_mci = { 678f58de7cSeric miao .name = "pxa2xx-mci", 68fafc9d3fSBridge Wu .id = 0, 698f58de7cSeric miao .dev = { 708f58de7cSeric miao .dma_mask = &pxamci_dmamask, 718f58de7cSeric miao .coherent_dma_mask = 0xffffffff, 728f58de7cSeric miao }, 738f58de7cSeric miao .num_resources = ARRAY_SIZE(pxamci_resources), 748f58de7cSeric miao .resource = pxamci_resources, 758f58de7cSeric miao }; 768f58de7cSeric miao 778f58de7cSeric miao void __init pxa_set_mci_info(struct pxamci_platform_data *info) 788f58de7cSeric miao { 798f58de7cSeric miao pxa_register_device(&pxa_device_mci, info); 808f58de7cSeric miao } 818f58de7cSeric miao 821257629bSPhilipp Zabel static struct pxa2xx_udc_mach_info pxa_udc_info = { 831257629bSPhilipp Zabel .gpio_pullup = -1, 841257629bSPhilipp Zabel }; 858f58de7cSeric miao 868f58de7cSeric miao static struct resource pxa2xx_udc_resources[] = { 878f58de7cSeric miao [0] = { 888f58de7cSeric miao .start = 0x40600000, 898f58de7cSeric miao .end = 0x4060ffff, 908f58de7cSeric miao .flags = IORESOURCE_MEM, 918f58de7cSeric miao }, 928f58de7cSeric miao [1] = { 938f58de7cSeric miao .start = IRQ_USB, 948f58de7cSeric miao .end = IRQ_USB, 958f58de7cSeric miao .flags = IORESOURCE_IRQ, 968f58de7cSeric miao }, 978f58de7cSeric miao }; 988f58de7cSeric miao 998f58de7cSeric miao static u64 udc_dma_mask = ~(u32)0; 1008f58de7cSeric miao 1017a857620SPhilipp Zabel struct platform_device pxa25x_device_udc = { 1027a857620SPhilipp Zabel .name = "pxa25x-udc", 1037a857620SPhilipp Zabel .id = -1, 1047a857620SPhilipp Zabel .resource = pxa2xx_udc_resources, 1057a857620SPhilipp Zabel .num_resources = ARRAY_SIZE(pxa2xx_udc_resources), 1067a857620SPhilipp Zabel .dev = { 1077a857620SPhilipp Zabel .platform_data = &pxa_udc_info, 1087a857620SPhilipp Zabel .dma_mask = &udc_dma_mask, 1097a857620SPhilipp Zabel } 1107a857620SPhilipp Zabel }; 1117a857620SPhilipp Zabel 1127a857620SPhilipp Zabel struct platform_device pxa27x_device_udc = { 1137a857620SPhilipp Zabel .name = "pxa27x-udc", 1148f58de7cSeric miao .id = -1, 1158f58de7cSeric miao .resource = pxa2xx_udc_resources, 1168f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa2xx_udc_resources), 1178f58de7cSeric miao .dev = { 1188f58de7cSeric miao .platform_data = &pxa_udc_info, 1198f58de7cSeric miao .dma_mask = &udc_dma_mask, 1208f58de7cSeric miao } 1218f58de7cSeric miao }; 1228f58de7cSeric miao 1238f58de7cSeric miao static struct resource pxafb_resources[] = { 1248f58de7cSeric miao [0] = { 1258f58de7cSeric miao .start = 0x44000000, 1268f58de7cSeric miao .end = 0x4400ffff, 1278f58de7cSeric miao .flags = IORESOURCE_MEM, 1288f58de7cSeric miao }, 1298f58de7cSeric miao [1] = { 1308f58de7cSeric miao .start = IRQ_LCD, 1318f58de7cSeric miao .end = IRQ_LCD, 1328f58de7cSeric miao .flags = IORESOURCE_IRQ, 1338f58de7cSeric miao }, 1348f58de7cSeric miao }; 1358f58de7cSeric miao 1368f58de7cSeric miao static u64 fb_dma_mask = ~(u64)0; 1378f58de7cSeric miao 1388f58de7cSeric miao struct platform_device pxa_device_fb = { 1398f58de7cSeric miao .name = "pxa2xx-fb", 1408f58de7cSeric miao .id = -1, 1418f58de7cSeric miao .dev = { 1428f58de7cSeric miao .dma_mask = &fb_dma_mask, 1438f58de7cSeric miao .coherent_dma_mask = 0xffffffff, 1448f58de7cSeric miao }, 1458f58de7cSeric miao .num_resources = ARRAY_SIZE(pxafb_resources), 1468f58de7cSeric miao .resource = pxafb_resources, 1478f58de7cSeric miao }; 1488f58de7cSeric miao 1494321e1a1SRussell King - ARM Linux void __init pxa_set_fb_info(struct device *parent, struct pxafb_mach_info *info) 1508f58de7cSeric miao { 1514321e1a1SRussell King - ARM Linux pxa_device_fb.dev.parent = parent; 1528f58de7cSeric miao pxa_register_device(&pxa_device_fb, info); 1538f58de7cSeric miao } 1548f58de7cSeric miao 1558f58de7cSeric miao static struct resource pxa_resource_ffuart[] = { 1568f58de7cSeric miao { 15702f65262SEric Miao .start = 0x40100000, 15802f65262SEric Miao .end = 0x40100023, 1598f58de7cSeric miao .flags = IORESOURCE_MEM, 1608f58de7cSeric miao }, { 1618f58de7cSeric miao .start = IRQ_FFUART, 1628f58de7cSeric miao .end = IRQ_FFUART, 1638f58de7cSeric miao .flags = IORESOURCE_IRQ, 1648f58de7cSeric miao } 1658f58de7cSeric miao }; 1668f58de7cSeric miao 1678f58de7cSeric miao struct platform_device pxa_device_ffuart = { 1688f58de7cSeric miao .name = "pxa2xx-uart", 1698f58de7cSeric miao .id = 0, 1708f58de7cSeric miao .resource = pxa_resource_ffuart, 1718f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa_resource_ffuart), 1728f58de7cSeric miao }; 1738f58de7cSeric miao 174cc155c6fSRussell King void __init pxa_set_ffuart_info(void *info) 175cc155c6fSRussell King { 176cc155c6fSRussell King pxa_register_device(&pxa_device_ffuart, info); 177cc155c6fSRussell King } 178cc155c6fSRussell King 1798f58de7cSeric miao static struct resource pxa_resource_btuart[] = { 1808f58de7cSeric miao { 18102f65262SEric Miao .start = 0x40200000, 18202f65262SEric Miao .end = 0x40200023, 1838f58de7cSeric miao .flags = IORESOURCE_MEM, 1848f58de7cSeric miao }, { 1858f58de7cSeric miao .start = IRQ_BTUART, 1868f58de7cSeric miao .end = IRQ_BTUART, 1878f58de7cSeric miao .flags = IORESOURCE_IRQ, 1888f58de7cSeric miao } 1898f58de7cSeric miao }; 1908f58de7cSeric miao 1918f58de7cSeric miao struct platform_device pxa_device_btuart = { 1928f58de7cSeric miao .name = "pxa2xx-uart", 1938f58de7cSeric miao .id = 1, 1948f58de7cSeric miao .resource = pxa_resource_btuart, 1958f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa_resource_btuart), 1968f58de7cSeric miao }; 1978f58de7cSeric miao 198cc155c6fSRussell King void __init pxa_set_btuart_info(void *info) 199cc155c6fSRussell King { 200cc155c6fSRussell King pxa_register_device(&pxa_device_btuart, info); 201cc155c6fSRussell King } 202cc155c6fSRussell King 2038f58de7cSeric miao static struct resource pxa_resource_stuart[] = { 2048f58de7cSeric miao { 20502f65262SEric Miao .start = 0x40700000, 20602f65262SEric Miao .end = 0x40700023, 2078f58de7cSeric miao .flags = IORESOURCE_MEM, 2088f58de7cSeric miao }, { 2098f58de7cSeric miao .start = IRQ_STUART, 2108f58de7cSeric miao .end = IRQ_STUART, 2118f58de7cSeric miao .flags = IORESOURCE_IRQ, 2128f58de7cSeric miao } 2138f58de7cSeric miao }; 2148f58de7cSeric miao 2158f58de7cSeric miao struct platform_device pxa_device_stuart = { 2168f58de7cSeric miao .name = "pxa2xx-uart", 2178f58de7cSeric miao .id = 2, 2188f58de7cSeric miao .resource = pxa_resource_stuart, 2198f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa_resource_stuart), 2208f58de7cSeric miao }; 2218f58de7cSeric miao 222cc155c6fSRussell King void __init pxa_set_stuart_info(void *info) 223cc155c6fSRussell King { 224cc155c6fSRussell King pxa_register_device(&pxa_device_stuart, info); 225cc155c6fSRussell King } 226cc155c6fSRussell King 2278f58de7cSeric miao static struct resource pxa_resource_hwuart[] = { 2288f58de7cSeric miao { 22902f65262SEric Miao .start = 0x41600000, 23002f65262SEric Miao .end = 0x4160002F, 2318f58de7cSeric miao .flags = IORESOURCE_MEM, 2328f58de7cSeric miao }, { 2338f58de7cSeric miao .start = IRQ_HWUART, 2348f58de7cSeric miao .end = IRQ_HWUART, 2358f58de7cSeric miao .flags = IORESOURCE_IRQ, 2368f58de7cSeric miao } 2378f58de7cSeric miao }; 2388f58de7cSeric miao 2398f58de7cSeric miao struct platform_device pxa_device_hwuart = { 2408f58de7cSeric miao .name = "pxa2xx-uart", 2418f58de7cSeric miao .id = 3, 2428f58de7cSeric miao .resource = pxa_resource_hwuart, 2438f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa_resource_hwuart), 2448f58de7cSeric miao }; 2458f58de7cSeric miao 246cc155c6fSRussell King void __init pxa_set_hwuart_info(void *info) 247cc155c6fSRussell King { 248cc155c6fSRussell King if (cpu_is_pxa255()) 249cc155c6fSRussell King pxa_register_device(&pxa_device_hwuart, info); 250cc155c6fSRussell King else 251cc155c6fSRussell King pr_info("UART: Ignoring attempt to register HWUART on non-PXA255 hardware"); 252cc155c6fSRussell King } 253cc155c6fSRussell King 2548f58de7cSeric miao static struct resource pxai2c_resources[] = { 2558f58de7cSeric miao { 2568f58de7cSeric miao .start = 0x40301680, 2578f58de7cSeric miao .end = 0x403016a3, 2588f58de7cSeric miao .flags = IORESOURCE_MEM, 2598f58de7cSeric miao }, { 2608f58de7cSeric miao .start = IRQ_I2C, 2618f58de7cSeric miao .end = IRQ_I2C, 2628f58de7cSeric miao .flags = IORESOURCE_IRQ, 2638f58de7cSeric miao }, 2648f58de7cSeric miao }; 2658f58de7cSeric miao 2668f58de7cSeric miao struct platform_device pxa_device_i2c = { 2678f58de7cSeric miao .name = "pxa2xx-i2c", 2688f58de7cSeric miao .id = 0, 2698f58de7cSeric miao .resource = pxai2c_resources, 2708f58de7cSeric miao .num_resources = ARRAY_SIZE(pxai2c_resources), 2718f58de7cSeric miao }; 2728f58de7cSeric miao 2738f58de7cSeric miao void __init pxa_set_i2c_info(struct i2c_pxa_platform_data *info) 2748f58de7cSeric miao { 2758f58de7cSeric miao pxa_register_device(&pxa_device_i2c, info); 2768f58de7cSeric miao } 2778f58de7cSeric miao 27899464293SEric Miao #ifdef CONFIG_PXA27x 27999464293SEric Miao static struct resource pxa27x_resources_i2c_power[] = { 28099464293SEric Miao { 28199464293SEric Miao .start = 0x40f00180, 28299464293SEric Miao .end = 0x40f001a3, 28399464293SEric Miao .flags = IORESOURCE_MEM, 28499464293SEric Miao }, { 28599464293SEric Miao .start = IRQ_PWRI2C, 28699464293SEric Miao .end = IRQ_PWRI2C, 28799464293SEric Miao .flags = IORESOURCE_IRQ, 28899464293SEric Miao }, 28999464293SEric Miao }; 29099464293SEric Miao 29199464293SEric Miao struct platform_device pxa27x_device_i2c_power = { 29299464293SEric Miao .name = "pxa2xx-i2c", 29399464293SEric Miao .id = 1, 29499464293SEric Miao .resource = pxa27x_resources_i2c_power, 29599464293SEric Miao .num_resources = ARRAY_SIZE(pxa27x_resources_i2c_power), 29699464293SEric Miao }; 29799464293SEric Miao #endif 29899464293SEric Miao 2998f58de7cSeric miao static struct resource pxai2s_resources[] = { 3008f58de7cSeric miao { 3018f58de7cSeric miao .start = 0x40400000, 3028f58de7cSeric miao .end = 0x40400083, 3038f58de7cSeric miao .flags = IORESOURCE_MEM, 3048f58de7cSeric miao }, { 3058f58de7cSeric miao .start = IRQ_I2S, 3068f58de7cSeric miao .end = IRQ_I2S, 3078f58de7cSeric miao .flags = IORESOURCE_IRQ, 3088f58de7cSeric miao }, 3098f58de7cSeric miao }; 3108f58de7cSeric miao 3118f58de7cSeric miao struct platform_device pxa_device_i2s = { 3128f58de7cSeric miao .name = "pxa2xx-i2s", 3138f58de7cSeric miao .id = -1, 3148f58de7cSeric miao .resource = pxai2s_resources, 3158f58de7cSeric miao .num_resources = ARRAY_SIZE(pxai2s_resources), 3168f58de7cSeric miao }; 3178f58de7cSeric miao 318f0fba2adSLiam Girdwood struct platform_device pxa_device_asoc_ssp1 = { 319f0fba2adSLiam Girdwood .name = "pxa-ssp-dai", 320f0fba2adSLiam Girdwood .id = 0, 321f0fba2adSLiam Girdwood }; 322f0fba2adSLiam Girdwood 323f0fba2adSLiam Girdwood struct platform_device pxa_device_asoc_ssp2= { 324f0fba2adSLiam Girdwood .name = "pxa-ssp-dai", 325f0fba2adSLiam Girdwood .id = 1, 326f0fba2adSLiam Girdwood }; 327f0fba2adSLiam Girdwood 328f0fba2adSLiam Girdwood struct platform_device pxa_device_asoc_ssp3 = { 329f0fba2adSLiam Girdwood .name = "pxa-ssp-dai", 330f0fba2adSLiam Girdwood .id = 2, 331f0fba2adSLiam Girdwood }; 332f0fba2adSLiam Girdwood 333f0fba2adSLiam Girdwood struct platform_device pxa_device_asoc_ssp4 = { 334f0fba2adSLiam Girdwood .name = "pxa-ssp-dai", 335f0fba2adSLiam Girdwood .id = 3, 336f0fba2adSLiam Girdwood }; 337f0fba2adSLiam Girdwood 338f0fba2adSLiam Girdwood struct platform_device pxa_device_asoc_platform = { 339f0fba2adSLiam Girdwood .name = "pxa-pcm-audio", 340f0fba2adSLiam Girdwood .id = -1, 341f0fba2adSLiam Girdwood }; 342f0fba2adSLiam Girdwood 34372493146SRobert Jarzmik static struct resource pxa_rtc_resources[] = { 34472493146SRobert Jarzmik [0] = { 34572493146SRobert Jarzmik .start = 0x40900000, 34672493146SRobert Jarzmik .end = 0x40900000 + 0x3b, 34772493146SRobert Jarzmik .flags = IORESOURCE_MEM, 34872493146SRobert Jarzmik }, 34972493146SRobert Jarzmik [1] = { 35072493146SRobert Jarzmik .start = IRQ_RTC1Hz, 35172493146SRobert Jarzmik .end = IRQ_RTC1Hz, 3523888c090SHaojian Zhuang .name = "rtc 1Hz", 35372493146SRobert Jarzmik .flags = IORESOURCE_IRQ, 35472493146SRobert Jarzmik }, 35572493146SRobert Jarzmik [2] = { 35672493146SRobert Jarzmik .start = IRQ_RTCAlrm, 35772493146SRobert Jarzmik .end = IRQ_RTCAlrm, 3583888c090SHaojian Zhuang .name = "rtc alarm", 35972493146SRobert Jarzmik .flags = IORESOURCE_IRQ, 36072493146SRobert Jarzmik }, 36172493146SRobert Jarzmik }; 36272493146SRobert Jarzmik 36372493146SRobert Jarzmik struct platform_device pxa_device_rtc = { 36472493146SRobert Jarzmik .name = "pxa-rtc", 36572493146SRobert Jarzmik .id = -1, 36672493146SRobert Jarzmik .num_resources = ARRAY_SIZE(pxa_rtc_resources), 36772493146SRobert Jarzmik .resource = pxa_rtc_resources, 36872493146SRobert Jarzmik }; 36972493146SRobert Jarzmik 3703888c090SHaojian Zhuang struct platform_device sa1100_device_rtc = { 3713888c090SHaojian Zhuang .name = "sa1100-rtc", 3723888c090SHaojian Zhuang .id = -1, 3732c4fabecSRob Herring .num_resources = ARRAY_SIZE(pxa_rtc_resources), 3742c4fabecSRob Herring .resource = pxa_rtc_resources, 3753888c090SHaojian Zhuang }; 3763888c090SHaojian Zhuang 3778f58de7cSeric miao #ifdef CONFIG_PXA25x 3788f58de7cSeric miao 37975540c1aSeric miao static struct resource pxa25x_resource_pwm0[] = { 38075540c1aSeric miao [0] = { 38175540c1aSeric miao .start = 0x40b00000, 38275540c1aSeric miao .end = 0x40b0000f, 38375540c1aSeric miao .flags = IORESOURCE_MEM, 38475540c1aSeric miao }, 38575540c1aSeric miao }; 38675540c1aSeric miao 38775540c1aSeric miao struct platform_device pxa25x_device_pwm0 = { 38875540c1aSeric miao .name = "pxa25x-pwm", 38975540c1aSeric miao .id = 0, 39075540c1aSeric miao .resource = pxa25x_resource_pwm0, 39175540c1aSeric miao .num_resources = ARRAY_SIZE(pxa25x_resource_pwm0), 39275540c1aSeric miao }; 39375540c1aSeric miao 39475540c1aSeric miao static struct resource pxa25x_resource_pwm1[] = { 39575540c1aSeric miao [0] = { 39675540c1aSeric miao .start = 0x40c00000, 39775540c1aSeric miao .end = 0x40c0000f, 39875540c1aSeric miao .flags = IORESOURCE_MEM, 39975540c1aSeric miao }, 40075540c1aSeric miao }; 40175540c1aSeric miao 40275540c1aSeric miao struct platform_device pxa25x_device_pwm1 = { 40375540c1aSeric miao .name = "pxa25x-pwm", 40475540c1aSeric miao .id = 1, 40575540c1aSeric miao .resource = pxa25x_resource_pwm1, 40675540c1aSeric miao .num_resources = ARRAY_SIZE(pxa25x_resource_pwm1), 40775540c1aSeric miao }; 40875540c1aSeric miao 4098f58de7cSeric miao static u64 pxa25x_ssp_dma_mask = DMA_BIT_MASK(32); 4108f58de7cSeric miao 4118f58de7cSeric miao static struct resource pxa25x_resource_ssp[] = { 4128f58de7cSeric miao [0] = { 4138f58de7cSeric miao .start = 0x41000000, 4148f58de7cSeric miao .end = 0x4100001f, 4158f58de7cSeric miao .flags = IORESOURCE_MEM, 4168f58de7cSeric miao }, 4178f58de7cSeric miao [1] = { 4188f58de7cSeric miao .start = IRQ_SSP, 4198f58de7cSeric miao .end = IRQ_SSP, 4208f58de7cSeric miao .flags = IORESOURCE_IRQ, 4218f58de7cSeric miao }, 4228f58de7cSeric miao }; 4238f58de7cSeric miao 4248f58de7cSeric miao struct platform_device pxa25x_device_ssp = { 4258f58de7cSeric miao .name = "pxa25x-ssp", 4268f58de7cSeric miao .id = 0, 4278f58de7cSeric miao .dev = { 4288f58de7cSeric miao .dma_mask = &pxa25x_ssp_dma_mask, 4298f58de7cSeric miao .coherent_dma_mask = DMA_BIT_MASK(32), 4308f58de7cSeric miao }, 4318f58de7cSeric miao .resource = pxa25x_resource_ssp, 4328f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa25x_resource_ssp), 4338f58de7cSeric miao }; 4348f58de7cSeric miao 4358f58de7cSeric miao static u64 pxa25x_nssp_dma_mask = DMA_BIT_MASK(32); 4368f58de7cSeric miao 4378f58de7cSeric miao static struct resource pxa25x_resource_nssp[] = { 4388f58de7cSeric miao [0] = { 4398f58de7cSeric miao .start = 0x41400000, 4408f58de7cSeric miao .end = 0x4140002f, 4418f58de7cSeric miao .flags = IORESOURCE_MEM, 4428f58de7cSeric miao }, 4438f58de7cSeric miao [1] = { 4448f58de7cSeric miao .start = IRQ_NSSP, 4458f58de7cSeric miao .end = IRQ_NSSP, 4468f58de7cSeric miao .flags = IORESOURCE_IRQ, 4478f58de7cSeric miao }, 4488f58de7cSeric miao }; 4498f58de7cSeric miao 4508f58de7cSeric miao struct platform_device pxa25x_device_nssp = { 4518f58de7cSeric miao .name = "pxa25x-nssp", 4528f58de7cSeric miao .id = 1, 4538f58de7cSeric miao .dev = { 4548f58de7cSeric miao .dma_mask = &pxa25x_nssp_dma_mask, 4558f58de7cSeric miao .coherent_dma_mask = DMA_BIT_MASK(32), 4568f58de7cSeric miao }, 4578f58de7cSeric miao .resource = pxa25x_resource_nssp, 4588f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa25x_resource_nssp), 4598f58de7cSeric miao }; 4608f58de7cSeric miao 4618f58de7cSeric miao static u64 pxa25x_assp_dma_mask = DMA_BIT_MASK(32); 4628f58de7cSeric miao 4638f58de7cSeric miao static struct resource pxa25x_resource_assp[] = { 4648f58de7cSeric miao [0] = { 4658f58de7cSeric miao .start = 0x41500000, 4668f58de7cSeric miao .end = 0x4150002f, 4678f58de7cSeric miao .flags = IORESOURCE_MEM, 4688f58de7cSeric miao }, 4698f58de7cSeric miao [1] = { 4708f58de7cSeric miao .start = IRQ_ASSP, 4718f58de7cSeric miao .end = IRQ_ASSP, 4728f58de7cSeric miao .flags = IORESOURCE_IRQ, 4738f58de7cSeric miao }, 4748f58de7cSeric miao }; 4758f58de7cSeric miao 4768f58de7cSeric miao struct platform_device pxa25x_device_assp = { 4778f58de7cSeric miao /* ASSP is basically equivalent to NSSP */ 4788f58de7cSeric miao .name = "pxa25x-nssp", 4798f58de7cSeric miao .id = 2, 4808f58de7cSeric miao .dev = { 4818f58de7cSeric miao .dma_mask = &pxa25x_assp_dma_mask, 4828f58de7cSeric miao .coherent_dma_mask = DMA_BIT_MASK(32), 4838f58de7cSeric miao }, 4848f58de7cSeric miao .resource = pxa25x_resource_assp, 4858f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa25x_resource_assp), 4868f58de7cSeric miao }; 4878f58de7cSeric miao #endif /* CONFIG_PXA25x */ 4888f58de7cSeric miao 4898f58de7cSeric miao #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) 490ec68e45bSeric miao static u64 pxa27x_ohci_dma_mask = DMA_BIT_MASK(32); 491ec68e45bSeric miao 492ec68e45bSeric miao static struct resource pxa27x_resource_ohci[] = { 493ec68e45bSeric miao [0] = { 494ec68e45bSeric miao .start = 0x4C000000, 495ec68e45bSeric miao .end = 0x4C00ff6f, 496ec68e45bSeric miao .flags = IORESOURCE_MEM, 497ec68e45bSeric miao }, 498ec68e45bSeric miao [1] = { 499ec68e45bSeric miao .start = IRQ_USBH1, 500ec68e45bSeric miao .end = IRQ_USBH1, 501ec68e45bSeric miao .flags = IORESOURCE_IRQ, 502ec68e45bSeric miao }, 503ec68e45bSeric miao }; 504ec68e45bSeric miao 505ec68e45bSeric miao struct platform_device pxa27x_device_ohci = { 506ec68e45bSeric miao .name = "pxa27x-ohci", 507ec68e45bSeric miao .id = -1, 508ec68e45bSeric miao .dev = { 509ec68e45bSeric miao .dma_mask = &pxa27x_ohci_dma_mask, 510ec68e45bSeric miao .coherent_dma_mask = DMA_BIT_MASK(32), 511ec68e45bSeric miao }, 512ec68e45bSeric miao .num_resources = ARRAY_SIZE(pxa27x_resource_ohci), 513ec68e45bSeric miao .resource = pxa27x_resource_ohci, 514ec68e45bSeric miao }; 515ec68e45bSeric miao 516ec68e45bSeric miao void __init pxa_set_ohci_info(struct pxaohci_platform_data *info) 517ec68e45bSeric miao { 518ec68e45bSeric miao pxa_register_device(&pxa27x_device_ohci, info); 519ec68e45bSeric miao } 520a4553358SHaojian Zhuang #endif /* CONFIG_PXA27x || CONFIG_PXA3xx */ 521a4553358SHaojian Zhuang 52249ea7fc0SHaojian Zhuang #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) 5238f58de7cSeric miao static u64 pxa27x_ssp1_dma_mask = DMA_BIT_MASK(32); 5248f58de7cSeric miao 5258f58de7cSeric miao static struct resource pxa27x_resource_ssp1[] = { 5268f58de7cSeric miao [0] = { 5278f58de7cSeric miao .start = 0x41000000, 5288f58de7cSeric miao .end = 0x4100003f, 5298f58de7cSeric miao .flags = IORESOURCE_MEM, 5308f58de7cSeric miao }, 5318f58de7cSeric miao [1] = { 5328f58de7cSeric miao .start = IRQ_SSP, 5338f58de7cSeric miao .end = IRQ_SSP, 5348f58de7cSeric miao .flags = IORESOURCE_IRQ, 5358f58de7cSeric miao }, 5368f58de7cSeric miao }; 5378f58de7cSeric miao 5388f58de7cSeric miao struct platform_device pxa27x_device_ssp1 = { 5398f58de7cSeric miao .name = "pxa27x-ssp", 5408f58de7cSeric miao .id = 0, 5418f58de7cSeric miao .dev = { 5428f58de7cSeric miao .dma_mask = &pxa27x_ssp1_dma_mask, 5438f58de7cSeric miao .coherent_dma_mask = DMA_BIT_MASK(32), 5448f58de7cSeric miao }, 5458f58de7cSeric miao .resource = pxa27x_resource_ssp1, 5468f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa27x_resource_ssp1), 5478f58de7cSeric miao }; 5488f58de7cSeric miao 5498f58de7cSeric miao static u64 pxa27x_ssp2_dma_mask = DMA_BIT_MASK(32); 5508f58de7cSeric miao 5518f58de7cSeric miao static struct resource pxa27x_resource_ssp2[] = { 5528f58de7cSeric miao [0] = { 5538f58de7cSeric miao .start = 0x41700000, 5548f58de7cSeric miao .end = 0x4170003f, 5558f58de7cSeric miao .flags = IORESOURCE_MEM, 5568f58de7cSeric miao }, 5578f58de7cSeric miao [1] = { 5588f58de7cSeric miao .start = IRQ_SSP2, 5598f58de7cSeric miao .end = IRQ_SSP2, 5608f58de7cSeric miao .flags = IORESOURCE_IRQ, 5618f58de7cSeric miao }, 5628f58de7cSeric miao }; 5638f58de7cSeric miao 5648f58de7cSeric miao struct platform_device pxa27x_device_ssp2 = { 5658f58de7cSeric miao .name = "pxa27x-ssp", 5668f58de7cSeric miao .id = 1, 5678f58de7cSeric miao .dev = { 5688f58de7cSeric miao .dma_mask = &pxa27x_ssp2_dma_mask, 5698f58de7cSeric miao .coherent_dma_mask = DMA_BIT_MASK(32), 5708f58de7cSeric miao }, 5718f58de7cSeric miao .resource = pxa27x_resource_ssp2, 5728f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa27x_resource_ssp2), 5738f58de7cSeric miao }; 5748f58de7cSeric miao 5758f58de7cSeric miao static u64 pxa27x_ssp3_dma_mask = DMA_BIT_MASK(32); 5768f58de7cSeric miao 5778f58de7cSeric miao static struct resource pxa27x_resource_ssp3[] = { 5788f58de7cSeric miao [0] = { 5798f58de7cSeric miao .start = 0x41900000, 5808f58de7cSeric miao .end = 0x4190003f, 5818f58de7cSeric miao .flags = IORESOURCE_MEM, 5828f58de7cSeric miao }, 5838f58de7cSeric miao [1] = { 5848f58de7cSeric miao .start = IRQ_SSP3, 5858f58de7cSeric miao .end = IRQ_SSP3, 5868f58de7cSeric miao .flags = IORESOURCE_IRQ, 5878f58de7cSeric miao }, 5888f58de7cSeric miao }; 5898f58de7cSeric miao 5908f58de7cSeric miao struct platform_device pxa27x_device_ssp3 = { 5918f58de7cSeric miao .name = "pxa27x-ssp", 5928f58de7cSeric miao .id = 2, 5938f58de7cSeric miao .dev = { 5948f58de7cSeric miao .dma_mask = &pxa27x_ssp3_dma_mask, 5958f58de7cSeric miao .coherent_dma_mask = DMA_BIT_MASK(32), 5968f58de7cSeric miao }, 5978f58de7cSeric miao .resource = pxa27x_resource_ssp3, 5988f58de7cSeric miao .num_resources = ARRAY_SIZE(pxa27x_resource_ssp3), 5998f58de7cSeric miao }; 6003f3acefbSGuennadi Liakhovetski 60175540c1aSeric miao static struct resource pxa27x_resource_pwm0[] = { 60275540c1aSeric miao [0] = { 60375540c1aSeric miao .start = 0x40b00000, 60475540c1aSeric miao .end = 0x40b0001f, 60575540c1aSeric miao .flags = IORESOURCE_MEM, 60675540c1aSeric miao }, 60775540c1aSeric miao }; 60875540c1aSeric miao 60975540c1aSeric miao struct platform_device pxa27x_device_pwm0 = { 61075540c1aSeric miao .name = "pxa27x-pwm", 61175540c1aSeric miao .id = 0, 61275540c1aSeric miao .resource = pxa27x_resource_pwm0, 61375540c1aSeric miao .num_resources = ARRAY_SIZE(pxa27x_resource_pwm0), 61475540c1aSeric miao }; 61575540c1aSeric miao 61675540c1aSeric miao static struct resource pxa27x_resource_pwm1[] = { 61775540c1aSeric miao [0] = { 61875540c1aSeric miao .start = 0x40c00000, 61975540c1aSeric miao .end = 0x40c0001f, 62075540c1aSeric miao .flags = IORESOURCE_MEM, 62175540c1aSeric miao }, 62275540c1aSeric miao }; 62375540c1aSeric miao 62475540c1aSeric miao struct platform_device pxa27x_device_pwm1 = { 62575540c1aSeric miao .name = "pxa27x-pwm", 62675540c1aSeric miao .id = 1, 62775540c1aSeric miao .resource = pxa27x_resource_pwm1, 62875540c1aSeric miao .num_resources = ARRAY_SIZE(pxa27x_resource_pwm1), 62975540c1aSeric miao }; 63049ea7fc0SHaojian Zhuang #endif /* CONFIG_PXA27x || CONFIG_PXA3xx */ 6318f58de7cSeric miao 632*f1d6588aSDmitry Torokhov const struct software_node pxa2xx_gpiochip_node = { 633*f1d6588aSDmitry Torokhov .name = "gpio-pxa", 634*f1d6588aSDmitry Torokhov }; 635*f1d6588aSDmitry Torokhov 636157d2644SHaojian Zhuang struct resource pxa_resource_gpio[] = { 637157d2644SHaojian Zhuang { 638157d2644SHaojian Zhuang .start = 0x40e00000, 639157d2644SHaojian Zhuang .end = 0x40e0ffff, 640157d2644SHaojian Zhuang .flags = IORESOURCE_MEM, 641157d2644SHaojian Zhuang }, { 642157d2644SHaojian Zhuang .start = IRQ_GPIO0, 643157d2644SHaojian Zhuang .end = IRQ_GPIO0, 644157d2644SHaojian Zhuang .name = "gpio0", 645157d2644SHaojian Zhuang .flags = IORESOURCE_IRQ, 646157d2644SHaojian Zhuang }, { 647157d2644SHaojian Zhuang .start = IRQ_GPIO1, 648157d2644SHaojian Zhuang .end = IRQ_GPIO1, 649157d2644SHaojian Zhuang .name = "gpio1", 650157d2644SHaojian Zhuang .flags = IORESOURCE_IRQ, 651157d2644SHaojian Zhuang }, { 652157d2644SHaojian Zhuang .start = IRQ_GPIO_2_x, 653157d2644SHaojian Zhuang .end = IRQ_GPIO_2_x, 654157d2644SHaojian Zhuang .name = "gpio_mux", 655157d2644SHaojian Zhuang .flags = IORESOURCE_IRQ, 656157d2644SHaojian Zhuang }, 657157d2644SHaojian Zhuang }; 658157d2644SHaojian Zhuang 659917195d6SDmitry Torokhov static struct pxa_gpio_platform_data pxa2xx_gpio_info = { 660917195d6SDmitry Torokhov .irq_base = PXA_GPIO_TO_IRQ(0), 661917195d6SDmitry Torokhov .gpio_set_wake = gpio_set_wake, 662917195d6SDmitry Torokhov }; 663917195d6SDmitry Torokhov 6642cab0292SHaojian Zhuang struct platform_device pxa25x_device_gpio = { 6652cab0292SHaojian Zhuang .name = "pxa25x-gpio", 6662cab0292SHaojian Zhuang .id = -1, 6672cab0292SHaojian Zhuang .num_resources = ARRAY_SIZE(pxa_resource_gpio), 6682cab0292SHaojian Zhuang .resource = pxa_resource_gpio, 669917195d6SDmitry Torokhov .dev = { 670917195d6SDmitry Torokhov .platform_data = &pxa2xx_gpio_info, 671917195d6SDmitry Torokhov }, 6722cab0292SHaojian Zhuang }; 6732cab0292SHaojian Zhuang 6742cab0292SHaojian Zhuang struct platform_device pxa27x_device_gpio = { 6752cab0292SHaojian Zhuang .name = "pxa27x-gpio", 6762cab0292SHaojian Zhuang .id = -1, 6772cab0292SHaojian Zhuang .num_resources = ARRAY_SIZE(pxa_resource_gpio), 6782cab0292SHaojian Zhuang .resource = pxa_resource_gpio, 679917195d6SDmitry Torokhov .dev = { 680917195d6SDmitry Torokhov .platform_data = &pxa2xx_gpio_info, 681917195d6SDmitry Torokhov }, 6822cab0292SHaojian Zhuang }; 6832cab0292SHaojian Zhuang 6844be0856fSRobert Jarzmik static struct resource pxa_dma_resource[] = { 6854be0856fSRobert Jarzmik [0] = { 6864be0856fSRobert Jarzmik .start = 0x40000000, 6874be0856fSRobert Jarzmik .end = 0x4000ffff, 6884be0856fSRobert Jarzmik .flags = IORESOURCE_MEM, 6894be0856fSRobert Jarzmik }, 6904be0856fSRobert Jarzmik [1] = { 6914be0856fSRobert Jarzmik .start = IRQ_DMA, 6924be0856fSRobert Jarzmik .end = IRQ_DMA, 6934be0856fSRobert Jarzmik .flags = IORESOURCE_IRQ, 6944be0856fSRobert Jarzmik }, 6954be0856fSRobert Jarzmik }; 6964be0856fSRobert Jarzmik 6974be0856fSRobert Jarzmik static u64 pxadma_dmamask = 0xffffffffUL; 6984be0856fSRobert Jarzmik 6994be0856fSRobert Jarzmik static struct platform_device pxa2xx_pxa_dma = { 7004be0856fSRobert Jarzmik .name = "pxa-dma", 7014be0856fSRobert Jarzmik .id = 0, 7024be0856fSRobert Jarzmik .dev = { 7034be0856fSRobert Jarzmik .dma_mask = &pxadma_dmamask, 7044be0856fSRobert Jarzmik .coherent_dma_mask = 0xffffffff, 7054be0856fSRobert Jarzmik }, 7064be0856fSRobert Jarzmik .num_resources = ARRAY_SIZE(pxa_dma_resource), 7074be0856fSRobert Jarzmik .resource = pxa_dma_resource, 7084be0856fSRobert Jarzmik }; 7094be0856fSRobert Jarzmik 7101da10c17SRobert Jarzmik void __init pxa2xx_set_dmac_info(struct mmp_dma_platdata *dma_pdata) 7114be0856fSRobert Jarzmik { 7121da10c17SRobert Jarzmik pxa_register_device(&pxa2xx_pxa_dma, dma_pdata); 7134be0856fSRobert Jarzmik } 714e86bd43bSArnd Bergmann 715e86bd43bSArnd Bergmann void __init pxa_register_wdt(unsigned int reset_status) 716e86bd43bSArnd Bergmann { 717e86bd43bSArnd Bergmann struct resource res = DEFINE_RES_MEM(OST_PHYS, OST_LEN); 718e86bd43bSArnd Bergmann 719e86bd43bSArnd Bergmann reset_status &= RESET_STATUS_WATCHDOG; 720e86bd43bSArnd Bergmann platform_device_register_resndata(NULL, "sa1100_wdt", -1, &res, 1, 721e86bd43bSArnd Bergmann &reset_status, sizeof(reset_status)); 722e86bd43bSArnd Bergmann } 723