2 * arch/ubicom32/mach-ip5k/board-ip5160dev.c
3 * Platform initialization for ip5160dev board.
5 * (C) Copyright 2009, Ubicom, Inc.
7 * This file is part of the Ubicom32 Linux Kernel Port.
9 * The Ubicom32 Linux Kernel Port is free software: you can redistribute
10 * it and/or modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation, either version 2 of the
12 * License, or (at your option) any later version.
14 * The Ubicom32 Linux Kernel Port is distributed in the hope that it
15 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
16 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
17 * the GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with the Ubicom32 Linux Kernel Port. If not,
21 * see <http://www.gnu.org/licenses/>.
23 * Ubicom32 implementation derived from (with many thanks):
28 #include <linux/device.h>
29 #include <linux/platform_device.h>
30 #include <linux/gpio.h>
32 #include <asm/board.h>
33 #include <asm/machdep.h>
34 #ifdef CONFIG_SERIAL_UBI32_SERDES
35 #include <asm/ubicom32suart.h>
39 * Factory Default Button on the board at PXn
40 * TODO: This is just a placeholder and it needs to include proper header files
42 struct ubicom32fdb_platform_data
{
47 static struct ubicom32fdb_platform_data ip5160dev_fdb_data
= {
52 static struct platform_device ip5160dev_fdb_device
= {
53 .name
= "ubicom32fdb",
56 .platform_data
= &ip5160dev_fdb_data
,
60 #ifdef CONFIG_SERIAL_UBI32_SERDES
61 static struct resource ip5160dev_ubicom32_suart_resources
[] = {
65 .flags
= IORESOURCE_MEM
,
68 .start
= PORT_OTHER_INT(RD
),
69 .end
= PORT_OTHER_INT(RD
),
70 .flags
= IORESOURCE_IRQ
,
75 .flags
= UBICOM32_SUART_IORESOURCE_CLOCK
,
79 static struct platform_device ip5160dev_ubicom32_suart_device
= {
80 .name
= "ubicom32suart",
82 .num_resources
= ARRAY_SIZE(ip5160dev_ubicom32_suart_resources
),
83 .resource
= ip5160dev_ubicom32_suart_resources
,
88 * List of all devices in our system
90 static struct platform_device
*ip5160dev_devices
[] __initdata
= {
91 #ifdef CONFIG_SERIAL_UBI32_SERDES
92 &ip5160dev_ubicom32_suart_device
,
94 &ip5160dev_fdb_device
,
99 * Called to add the devices which we have on this board
101 static int __init
ip5160dev_init(void)
104 printk(KERN_INFO
"%s: registering device resources\n", __FUNCTION__
);
105 platform_add_devices(ip5160dev_devices
, ARRAY_SIZE(ip5160dev_devices
));
109 arch_initcall(ip5160dev_init
);