Mike Frysinger | 0a29059 | 2007-05-21 18:09:21 +0800 | [diff] [blame] | 1 | /* |
| 2 | * File: arch/blackfin/mach-bf561/tepla.c |
| 3 | * |
| 4 | * Copyright 2004-2007 Analog Devices Inc. |
| 5 | * Only SMSC91C1111 was registered, may do more later. |
| 6 | * |
| 7 | * Copyright 2005 National ICT Australia (NICTA), Aidan Williams <aidan@nicta.com.au> |
| 8 | * Thanks to Jamey Hicks. |
| 9 | * |
| 10 | * This program is free software; you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License version 2 as |
| 12 | * published by the Free Software Foundation. |
| 13 | */ |
| 14 | |
| 15 | #include <linux/device.h> |
| 16 | #include <linux/platform_device.h> |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 17 | #include <linux/irq.h> |
Mike Frysinger | 0a29059 | 2007-05-21 18:09:21 +0800 | [diff] [blame] | 18 | |
Mike Frysinger | 066954a | 2007-10-21 22:36:06 +0800 | [diff] [blame] | 19 | const char bfin_board_name[] = "Tepla-BF561"; |
Mike Frysinger | 0a29059 | 2007-05-21 18:09:21 +0800 | [diff] [blame] | 20 | |
| 21 | /* |
| 22 | * Driver needs to know address, irq and flag pin. |
| 23 | */ |
| 24 | static struct resource smc91x_resources[] = { |
| 25 | { |
| 26 | .start = 0x2C000300, |
| 27 | .end = 0x2C000320, |
| 28 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 29 | }, { |
Mike Frysinger | 0a29059 | 2007-05-21 18:09:21 +0800 | [diff] [blame] | 30 | .start = IRQ_PROG_INTB, |
| 31 | .end = IRQ_PROG_INTB, |
| 32 | .flags = IORESOURCE_IRQ|IORESOURCE_IRQ_HIGHLEVEL, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 33 | }, { |
Mike Frysinger | 0a29059 | 2007-05-21 18:09:21 +0800 | [diff] [blame] | 34 | .start = IRQ_PF7, |
| 35 | .end = IRQ_PF7, |
| 36 | .flags = IORESOURCE_IRQ|IORESOURCE_IRQ_HIGHLEVEL, |
| 37 | }, |
| 38 | }; |
| 39 | |
| 40 | static struct platform_device smc91x_device = { |
| 41 | .name = "smc91x", |
| 42 | .id = 0, |
| 43 | .num_resources = ARRAY_SIZE(smc91x_resources), |
| 44 | .resource = smc91x_resources, |
| 45 | }; |
| 46 | |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame^] | 47 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
| 48 | #ifdef CONFIG_BFIN_SIR0 |
| 49 | static struct resource bfin_sir0_resources[] = { |
| 50 | { |
| 51 | .start = 0xFFC00400, |
| 52 | .end = 0xFFC004FF, |
| 53 | .flags = IORESOURCE_MEM, |
| 54 | }, |
| 55 | { |
| 56 | .start = IRQ_UART0_RX, |
| 57 | .end = IRQ_UART0_RX+1, |
| 58 | .flags = IORESOURCE_IRQ, |
| 59 | }, |
| 60 | { |
| 61 | .start = CH_UART0_RX, |
| 62 | .end = CH_UART0_RX+1, |
| 63 | .flags = IORESOURCE_DMA, |
| 64 | }, |
| 65 | }; |
| 66 | |
| 67 | static struct platform_device bfin_sir0_device = { |
| 68 | .name = "bfin_sir", |
| 69 | .id = 0, |
| 70 | .num_resources = ARRAY_SIZE(bfin_sir0_resources), |
| 71 | .resource = bfin_sir0_resources, |
| 72 | }; |
| 73 | #endif |
| 74 | #endif |
| 75 | |
Mike Frysinger | 0a29059 | 2007-05-21 18:09:21 +0800 | [diff] [blame] | 76 | static struct platform_device *tepla_devices[] __initdata = { |
| 77 | &smc91x_device, |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame^] | 78 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
| 79 | #ifdef CONFIG_BFIN_SIR0 |
| 80 | &bfin_sir0_device, |
| 81 | #endif |
| 82 | #endif |
Mike Frysinger | 0a29059 | 2007-05-21 18:09:21 +0800 | [diff] [blame] | 83 | }; |
| 84 | |
| 85 | static int __init tepla_init(void) |
| 86 | { |
Harvey Harrison | b85d858 | 2008-04-23 09:39:01 +0800 | [diff] [blame] | 87 | printk(KERN_INFO "%s(): registering device resources\n", __func__); |
Mike Frysinger | 0a29059 | 2007-05-21 18:09:21 +0800 | [diff] [blame] | 88 | return platform_add_devices(tepla_devices, ARRAY_SIZE(tepla_devices)); |
| 89 | } |
| 90 | |
| 91 | arch_initcall(tepla_init); |