blob: 8ba7252455e13d8960a2acaf3b4839e3641256d3 [file] [log] [blame]
Mike Frysinger0a290592007-05-21 18:09:21 +08001/*
Robin Getz96f10502009-09-24 14:11:24 +00002 * Copyright 2004-2007 Analog Devices Inc.
3 * 2005 National ICT Australia (NICTA)
4 * Aidan Williams <aidan@nicta.com.au>
Mike Frysinger0a290592007-05-21 18:09:21 +08005 *
Robin Getz96f10502009-09-24 14:11:24 +00006 * Thanks to Jamey Hicks.
Mike Frysinger0a290592007-05-21 18:09:21 +08007 *
Robin Getz96f10502009-09-24 14:11:24 +00008 * Only SMSC91C1111 was registered, may do more later.
Mike Frysinger0a290592007-05-21 18:09:21 +08009 *
Robin Getz96f10502009-09-24 14:11:24 +000010 * Licensed under the GPL-2
Mike Frysinger0a290592007-05-21 18:09:21 +080011 */
12
13#include <linux/device.h>
14#include <linux/platform_device.h>
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080015#include <linux/irq.h>
Mike Frysinger0a290592007-05-21 18:09:21 +080016
Mike Frysinger066954a2007-10-21 22:36:06 +080017const char bfin_board_name[] = "Tepla-BF561";
Mike Frysinger0a290592007-05-21 18:09:21 +080018
19/*
20 * Driver needs to know address, irq and flag pin.
21 */
22static struct resource smc91x_resources[] = {
23 {
24 .start = 0x2C000300,
25 .end = 0x2C000320,
26 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080027 }, {
Mike Frysinger0a290592007-05-21 18:09:21 +080028 .start = IRQ_PROG_INTB,
29 .end = IRQ_PROG_INTB,
30 .flags = IORESOURCE_IRQ|IORESOURCE_IRQ_HIGHLEVEL,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080031 }, {
Mike Frysinger0a290592007-05-21 18:09:21 +080032 .start = IRQ_PF7,
33 .end = IRQ_PF7,
34 .flags = IORESOURCE_IRQ|IORESOURCE_IRQ_HIGHLEVEL,
35 },
36};
37
38static struct platform_device smc91x_device = {
39 .name = "smc91x",
40 .id = 0,
41 .num_resources = ARRAY_SIZE(smc91x_resources),
42 .resource = smc91x_resources,
43};
44
Graf Yang42bd8bc2009-01-07 23:14:39 +080045#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
46#ifdef CONFIG_BFIN_SIR0
47static struct resource bfin_sir0_resources[] = {
48 {
49 .start = 0xFFC00400,
50 .end = 0xFFC004FF,
51 .flags = IORESOURCE_MEM,
52 },
53 {
54 .start = IRQ_UART0_RX,
55 .end = IRQ_UART0_RX+1,
56 .flags = IORESOURCE_IRQ,
57 },
58 {
59 .start = CH_UART0_RX,
60 .end = CH_UART0_RX+1,
61 .flags = IORESOURCE_DMA,
62 },
63};
64
65static struct platform_device bfin_sir0_device = {
66 .name = "bfin_sir",
67 .id = 0,
68 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
69 .resource = bfin_sir0_resources,
70};
71#endif
72#endif
73
Mike Frysinger0a290592007-05-21 18:09:21 +080074static struct platform_device *tepla_devices[] __initdata = {
75 &smc91x_device,
Graf Yang42bd8bc2009-01-07 23:14:39 +080076#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
77#ifdef CONFIG_BFIN_SIR0
78 &bfin_sir0_device,
79#endif
80#endif
Mike Frysinger0a290592007-05-21 18:09:21 +080081};
82
83static int __init tepla_init(void)
84{
Harvey Harrisonb85d8582008-04-23 09:39:01 +080085 printk(KERN_INFO "%s(): registering device resources\n", __func__);
Mike Frysinger0a290592007-05-21 18:09:21 +080086 return platform_add_devices(tepla_devices, ARRAY_SIZE(tepla_devices));
87}
88
89arch_initcall(tepla_init);