platform.c (e4da3fbfbd1de56d2367653e3823e6445e49f8a9) platform.c (809f36c6f4a0568178c909ff1096ca83eae33f7d)
1/*
2 * Platform device support for Au1x00 SoCs.
3 *
4 * Copyright 2004, Matt Porter <mporter@kernel.crashing.org>
5 *
6 * (C) Copyright Embedded Alley Solutions, Inc 2005
7 * Author: Pantelis Antoniou <pantelis@embeddedalley.com>
8 *

--- 68 unchanged lines hidden (view full) ---

77 PORT(AU1000_UART0_PHYS_ADDR, AU1550_UART0_INT),
78 PORT(AU1000_UART1_PHYS_ADDR, AU1550_UART1_INT),
79 PORT(AU1000_UART3_PHYS_ADDR, AU1550_UART3_INT),
80 },
81 [ALCHEMY_CPU_AU1200] = {
82 PORT(AU1000_UART0_PHYS_ADDR, AU1200_UART0_INT),
83 PORT(AU1000_UART1_PHYS_ADDR, AU1200_UART1_INT),
84 },
1/*
2 * Platform device support for Au1x00 SoCs.
3 *
4 * Copyright 2004, Matt Porter <mporter@kernel.crashing.org>
5 *
6 * (C) Copyright Embedded Alley Solutions, Inc 2005
7 * Author: Pantelis Antoniou <pantelis@embeddedalley.com>
8 *

--- 68 unchanged lines hidden (view full) ---

77 PORT(AU1000_UART0_PHYS_ADDR, AU1550_UART0_INT),
78 PORT(AU1000_UART1_PHYS_ADDR, AU1550_UART1_INT),
79 PORT(AU1000_UART3_PHYS_ADDR, AU1550_UART3_INT),
80 },
81 [ALCHEMY_CPU_AU1200] = {
82 PORT(AU1000_UART0_PHYS_ADDR, AU1200_UART0_INT),
83 PORT(AU1000_UART1_PHYS_ADDR, AU1200_UART1_INT),
84 },
85 [ALCHEMY_CPU_AU1300] = {
86 PORT(AU1300_UART0_PHYS_ADDR, AU1300_UART0_INT),
87 PORT(AU1300_UART1_PHYS_ADDR, AU1300_UART1_INT),
88 PORT(AU1300_UART2_PHYS_ADDR, AU1300_UART2_INT),
89 PORT(AU1300_UART3_PHYS_ADDR, AU1300_UART3_INT),
90 },
85};
86
87static struct platform_device au1xx0_uart_device = {
88 .name = "serial8250",
89 .id = PLAT8250_DEV_AU1X00,
90};
91
92static void __init alchemy_setup_uarts(int ctype)

--- 24 unchanged lines hidden (view full) ---

117static u64 __maybe_unused alchemy_ehci_dmamask = DMA_BIT_MASK(32);
118
119static unsigned long alchemy_ohci_data[][2] __initdata = {
120 [ALCHEMY_CPU_AU1000] = { AU1000_USB_OHCI_PHYS_ADDR, AU1000_USB_HOST_INT },
121 [ALCHEMY_CPU_AU1500] = { AU1000_USB_OHCI_PHYS_ADDR, AU1500_USB_HOST_INT },
122 [ALCHEMY_CPU_AU1100] = { AU1000_USB_OHCI_PHYS_ADDR, AU1100_USB_HOST_INT },
123 [ALCHEMY_CPU_AU1550] = { AU1550_USB_OHCI_PHYS_ADDR, AU1550_USB_HOST_INT },
124 [ALCHEMY_CPU_AU1200] = { AU1200_USB_OHCI_PHYS_ADDR, AU1200_USB_INT },
91};
92
93static struct platform_device au1xx0_uart_device = {
94 .name = "serial8250",
95 .id = PLAT8250_DEV_AU1X00,
96};
97
98static void __init alchemy_setup_uarts(int ctype)

--- 24 unchanged lines hidden (view full) ---

123static u64 __maybe_unused alchemy_ehci_dmamask = DMA_BIT_MASK(32);
124
125static unsigned long alchemy_ohci_data[][2] __initdata = {
126 [ALCHEMY_CPU_AU1000] = { AU1000_USB_OHCI_PHYS_ADDR, AU1000_USB_HOST_INT },
127 [ALCHEMY_CPU_AU1500] = { AU1000_USB_OHCI_PHYS_ADDR, AU1500_USB_HOST_INT },
128 [ALCHEMY_CPU_AU1100] = { AU1000_USB_OHCI_PHYS_ADDR, AU1100_USB_HOST_INT },
129 [ALCHEMY_CPU_AU1550] = { AU1550_USB_OHCI_PHYS_ADDR, AU1550_USB_HOST_INT },
130 [ALCHEMY_CPU_AU1200] = { AU1200_USB_OHCI_PHYS_ADDR, AU1200_USB_INT },
131 [ALCHEMY_CPU_AU1300] = { AU1300_USB_OHCI0_PHYS_ADDR, AU1300_USB_INT },
125};
126
127static unsigned long alchemy_ehci_data[][2] __initdata = {
128 [ALCHEMY_CPU_AU1200] = { AU1200_USB_EHCI_PHYS_ADDR, AU1200_USB_INT },
132};
133
134static unsigned long alchemy_ehci_data[][2] __initdata = {
135 [ALCHEMY_CPU_AU1200] = { AU1200_USB_EHCI_PHYS_ADDR, AU1200_USB_INT },
136 [ALCHEMY_CPU_AU1300] = { AU1300_USB_EHCI_PHYS_ADDR, AU1300_USB_INT },
129};
130
131static int __init _new_usbres(struct resource **r, struct platform_device **d)
132{
133 *r = kzalloc(sizeof(struct resource) * 2, GFP_KERNEL);
134 if (!*r)
135 return -ENOMEM;
136 *d = kzalloc(sizeof(struct platform_device), GFP_KERNEL);

--- 27 unchanged lines hidden (view full) ---

164 pdev->name = "au1xxx-ohci";
165 pdev->id = 0;
166 pdev->dev.dma_mask = &alchemy_ohci_dmamask;
167
168 if (platform_device_register(pdev))
169 printk(KERN_INFO "Alchemy USB: cannot add OHCI0\n");
170
171
137};
138
139static int __init _new_usbres(struct resource **r, struct platform_device **d)
140{
141 *r = kzalloc(sizeof(struct resource) * 2, GFP_KERNEL);
142 if (!*r)
143 return -ENOMEM;
144 *d = kzalloc(sizeof(struct platform_device), GFP_KERNEL);

--- 27 unchanged lines hidden (view full) ---

172 pdev->name = "au1xxx-ohci";
173 pdev->id = 0;
174 pdev->dev.dma_mask = &alchemy_ohci_dmamask;
175
176 if (platform_device_register(pdev))
177 printk(KERN_INFO "Alchemy USB: cannot add OHCI0\n");
178
179
172 /* setup EHCI0: Au1200 */
173 if (ctype == ALCHEMY_CPU_AU1200) {
180 /* setup EHCI0: Au1200/Au1300 */
181 if ((ctype == ALCHEMY_CPU_AU1200) || (ctype == ALCHEMY_CPU_AU1300)) {
174 if (_new_usbres(&res, &pdev))
175 return;
176
177 res[0].start = alchemy_ehci_data[ctype][0];
178 res[0].end = res[0].start + 0x100 - 1;
179 res[0].flags = IORESOURCE_MEM;
180 res[1].start = alchemy_ehci_data[ctype][1];
181 res[1].end = res[1].start;
182 res[1].flags = IORESOURCE_IRQ;
183 pdev->name = "au1xxx-ehci";
184 pdev->id = 0;
185 pdev->dev.dma_mask = &alchemy_ehci_dmamask;
186
187 if (platform_device_register(pdev))
188 printk(KERN_INFO "Alchemy USB: cannot add EHCI0\n");
189 }
182 if (_new_usbres(&res, &pdev))
183 return;
184
185 res[0].start = alchemy_ehci_data[ctype][0];
186 res[0].end = res[0].start + 0x100 - 1;
187 res[0].flags = IORESOURCE_MEM;
188 res[1].start = alchemy_ehci_data[ctype][1];
189 res[1].end = res[1].start;
190 res[1].flags = IORESOURCE_IRQ;
191 pdev->name = "au1xxx-ehci";
192 pdev->id = 0;
193 pdev->dev.dma_mask = &alchemy_ehci_dmamask;
194
195 if (platform_device_register(pdev))
196 printk(KERN_INFO "Alchemy USB: cannot add EHCI0\n");
197 }
198
199 /* Au1300: OHCI1 */
200 if (ctype == ALCHEMY_CPU_AU1300) {
201 if (_new_usbres(&res, &pdev))
202 return;
203
204 res[0].start = AU1300_USB_OHCI1_PHYS_ADDR;
205 res[0].end = res[0].start + 0x100 - 1;
206 res[0].flags = IORESOURCE_MEM;
207 res[1].start = AU1300_USB_INT;
208 res[1].end = res[1].start;
209 res[1].flags = IORESOURCE_IRQ;
210 pdev->name = "au1xxx-ohci";
211 pdev->id = 1;
212 pdev->dev.dma_mask = &alchemy_ohci_dmamask;
213
214 if (platform_device_register(pdev))
215 printk(KERN_INFO "Alchemy USB: cannot add OHCI1\n");
216 }
190}
191
192/* Macro to help defining the Ethernet MAC resources */
193#define MAC_RES_COUNT 4 /* MAC regs, MAC en, MAC INT, MACDMA regs */
194#define MAC_RES(_base, _enable, _irq, _macdma) \
195 { \
196 .start = _base, \
197 .end = _base + 0xffff, \

--- 167 unchanged lines hidden ---
217}
218
219/* Macro to help defining the Ethernet MAC resources */
220#define MAC_RES_COUNT 4 /* MAC regs, MAC en, MAC INT, MACDMA regs */
221#define MAC_RES(_base, _enable, _irq, _macdma) \
222 { \
223 .start = _base, \
224 .end = _base + 0xffff, \

--- 167 unchanged lines hidden ---