2 * Copyright 2004-2007 Analog Devices Inc.
3 * 2005 National ICT Australia (NICTA)
4 * Aidan Williams <aidan@nicta.com.au>
6 * Thanks to Jamey Hicks.
8 * Only SMSC91C1111 was registered, may do more later.
10 * Licensed under the GPL-2
13 #include <linux/device.h>
14 #include <linux/platform_device.h>
15 #include <linux/irq.h>
17 const char bfin_board_name[] = "Tepla-BF561";
20 * Driver needs to know address, irq and flag pin.
22 static struct resource smc91x_resources[] = {
26 .flags = IORESOURCE_MEM,
28 .start = IRQ_PROG_INTB,
30 .flags = IORESOURCE_IRQ|IORESOURCE_IRQ_HIGHLEVEL,
34 .flags = IORESOURCE_IRQ|IORESOURCE_IRQ_HIGHLEVEL,
38 static struct platform_device smc91x_device = {
41 .num_resources = ARRAY_SIZE(smc91x_resources),
42 .resource = smc91x_resources,
45 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
46 #ifdef CONFIG_SERIAL_BFIN_UART0
47 static struct resource bfin_uart0_resources[] = {
49 .start = BFIN_UART_THR,
50 .end = BFIN_UART_GCTL+2,
51 .flags = IORESOURCE_MEM,
56 .flags = IORESOURCE_IRQ,
61 .flags = IORESOURCE_IRQ,
64 .start = IRQ_UART_ERROR,
65 .end = IRQ_UART_ERROR,
66 .flags = IORESOURCE_IRQ,
71 .flags = IORESOURCE_DMA,
76 .flags = IORESOURCE_DMA,
80 static unsigned short bfin_uart0_peripherals[] = {
81 P_UART0_TX, P_UART0_RX, 0
84 static struct platform_device bfin_uart0_device = {
87 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
88 .resource = bfin_uart0_resources,
90 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
96 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
97 #ifdef CONFIG_BFIN_SIR0
98 static struct resource bfin_sir0_resources[] = {
102 .flags = IORESOURCE_MEM,
105 .start = IRQ_UART0_RX,
106 .end = IRQ_UART0_RX+1,
107 .flags = IORESOURCE_IRQ,
110 .start = CH_UART0_RX,
111 .end = CH_UART0_RX+1,
112 .flags = IORESOURCE_DMA,
116 static struct platform_device bfin_sir0_device = {
119 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
120 .resource = bfin_sir0_resources,
125 static struct platform_device *tepla_devices[] __initdata = {
128 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
129 #ifdef CONFIG_SERIAL_BFIN_UART0
134 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
135 #ifdef CONFIG_BFIN_SIR0
141 static int __init tepla_init(void)
143 printk(KERN_INFO "%s(): registering device resources\n", __func__);
144 return platform_add_devices(tepla_devices, ARRAY_SIZE(tepla_devices));
147 arch_initcall(tepla_init);
149 static struct platform_device *tepla_early_devices[] __initdata = {
150 #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
151 #ifdef CONFIG_SERIAL_BFIN_UART0
157 void __init native_machine_early_platform_add_devices(void)
159 printk(KERN_INFO "register early platform devices\n");
160 early_platform_add_devices(tepla_early_devices,
161 ARRAY_SIZE(tepla_early_devices));