Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1 | /* |
| 2 | * File: arch/blackfin/mach-bf533/generic_board.c |
| 3 | * Based on: arch/blackfin/mach-bf533/ezkit.c |
| 4 | * Author: Aidan Williams <aidan@nicta.com.au> |
| 5 | * |
| 6 | * Created: 2005 |
| 7 | * Description: |
| 8 | * |
| 9 | * Modified: |
| 10 | * Copyright 2005 National ICT Australia (NICTA) |
| 11 | * Copyright 2004-2006 Analog Devices Inc. |
| 12 | * |
| 13 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ |
| 14 | * |
| 15 | * This program is free software; you can redistribute it and/or modify |
| 16 | * it under the terms of the GNU General Public License as published by |
| 17 | * the Free Software Foundation; either version 2 of the License, or |
| 18 | * (at your option) any later version. |
| 19 | * |
| 20 | * This program is distributed in the hope that it will be useful, |
| 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 23 | * GNU General Public License for more details. |
| 24 | * |
| 25 | * You should have received a copy of the GNU General Public License |
| 26 | * along with this program; if not, see the file COPYING, or write |
| 27 | * to the Free Software Foundation, Inc., |
| 28 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 29 | */ |
| 30 | |
| 31 | #include <linux/device.h> |
| 32 | #include <linux/platform_device.h> |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 33 | #include <linux/irq.h> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 34 | |
| 35 | /* |
| 36 | * Name the Board for the /proc/cpuinfo |
| 37 | */ |
Mike Frysinger | 066954a | 2007-10-21 22:36:06 +0800 | [diff] [blame] | 38 | const char bfin_board_name[] = "UNKNOWN BOARD"; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 39 | |
| 40 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
| 41 | static struct platform_device rtc_device = { |
| 42 | .name = "rtc-bfin", |
| 43 | .id = -1, |
| 44 | }; |
| 45 | #endif |
| 46 | |
| 47 | /* |
| 48 | * Driver needs to know address, irq and flag pin. |
| 49 | */ |
| 50 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
| 51 | static struct resource smc91x_resources[] = { |
| 52 | { |
| 53 | .start = 0x20300300, |
| 54 | .end = 0x20300300 + 16, |
| 55 | .flags = IORESOURCE_MEM, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 56 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 57 | .start = IRQ_PROG_INTB, |
| 58 | .end = IRQ_PROG_INTB, |
| 59 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 60 | }, { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 61 | .start = IRQ_PF7, |
| 62 | .end = IRQ_PF7, |
| 63 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 64 | }, |
| 65 | }; |
| 66 | |
| 67 | static struct platform_device smc91x_device = { |
| 68 | .name = "smc91x", |
| 69 | .id = 0, |
| 70 | .num_resources = ARRAY_SIZE(smc91x_resources), |
| 71 | .resource = smc91x_resources, |
| 72 | }; |
| 73 | #endif |
| 74 | |
| 75 | static struct platform_device *generic_board_devices[] __initdata = { |
| 76 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
| 77 | &rtc_device, |
| 78 | #endif |
| 79 | |
| 80 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
| 81 | &smc91x_device, |
| 82 | #endif |
| 83 | }; |
| 84 | |
| 85 | static int __init generic_board_init(void) |
| 86 | { |
| 87 | printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__); |
| 88 | return platform_add_devices(generic_board_devices, ARRAY_SIZE(generic_board_devices)); |
| 89 | } |
| 90 | |
| 91 | arch_initcall(generic_board_init); |