Sascha Hauer | 693532d | 2006-06-19 15:29:43 +0100 | [diff] [blame] | 1 | /* |
| 2 | * arch/arm/mach-netx/nxdkn.c |
| 3 | * |
| 4 | * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License version 2 |
| 8 | * as published by the Free Software Foundation. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 18 | */ |
| 19 | |
| 20 | #include <linux/dma-mapping.h> |
| 21 | #include <linux/init.h> |
| 22 | #include <linux/interrupt.h> |
| 23 | #include <linux/mtd/plat-ram.h> |
| 24 | #include <linux/platform_device.h> |
| 25 | #include <linux/amba/bus.h> |
| 26 | #include <linux/amba/clcd.h> |
| 27 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 28 | #include <mach/hardware.h> |
Sascha Hauer | 693532d | 2006-06-19 15:29:43 +0100 | [diff] [blame] | 29 | #include <asm/mach-types.h> |
| 30 | #include <asm/mach/arch.h> |
Jamie Iles | 14f127ba | 2011-09-27 20:22:21 +0100 | [diff] [blame] | 31 | #include <asm/hardware/vic.h> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 32 | #include <mach/netx-regs.h> |
Arnd Bergmann | 2960ed3 | 2012-08-24 15:15:15 +0200 | [diff] [blame] | 33 | #include <linux/platform_data/eth-netx.h> |
Sascha Hauer | 693532d | 2006-06-19 15:29:43 +0100 | [diff] [blame] | 34 | |
| 35 | #include "generic.h" |
| 36 | |
| 37 | static struct netxeth_platform_data eth0_platform_data = { |
| 38 | .xcno = 0, |
| 39 | }; |
| 40 | |
| 41 | static struct platform_device nxdkn_eth0_device = { |
| 42 | .name = "netx-eth", |
| 43 | .id = 0, |
| 44 | .num_resources = 0, |
| 45 | .resource = NULL, |
| 46 | .dev = { |
| 47 | .platform_data = ð0_platform_data, |
| 48 | } |
| 49 | }; |
| 50 | |
| 51 | static struct netxeth_platform_data eth1_platform_data = { |
| 52 | .xcno = 1, |
| 53 | }; |
| 54 | |
| 55 | static struct platform_device nxdkn_eth1_device = { |
| 56 | .name = "netx-eth", |
| 57 | .id = 1, |
| 58 | .num_resources = 0, |
| 59 | .resource = NULL, |
| 60 | .dev = { |
| 61 | .platform_data = ð1_platform_data, |
| 62 | } |
| 63 | }; |
| 64 | |
| 65 | static struct resource netx_uart0_resources[] = { |
| 66 | [0] = { |
| 67 | .start = 0x00100A00, |
| 68 | .end = 0x00100A3F, |
| 69 | .flags = IORESOURCE_MEM, |
| 70 | }, |
| 71 | [1] = { |
| 72 | .start = (NETX_IRQ_UART0), |
| 73 | .end = (NETX_IRQ_UART0), |
| 74 | .flags = IORESOURCE_IRQ, |
| 75 | }, |
| 76 | }; |
| 77 | |
| 78 | static struct platform_device netx_uart0_device = { |
| 79 | .name = "netx-uart", |
| 80 | .id = 0, |
| 81 | .num_resources = ARRAY_SIZE(netx_uart0_resources), |
| 82 | .resource = netx_uart0_resources, |
| 83 | }; |
| 84 | |
| 85 | static struct platform_device *devices[] __initdata = { |
| 86 | &nxdkn_eth0_device, |
| 87 | &nxdkn_eth1_device, |
| 88 | &netx_uart0_device, |
| 89 | }; |
| 90 | |
| 91 | static void __init nxdkn_init(void) |
| 92 | { |
| 93 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
| 94 | } |
| 95 | |
| 96 | MACHINE_START(NXDKN, "Hilscher nxdkn") |
Nicolas Pitre | b11fd42 | 2011-07-05 22:38:14 -0400 | [diff] [blame] | 97 | .atag_offset = 0x100, |
Sascha Hauer | 693532d | 2006-06-19 15:29:43 +0100 | [diff] [blame] | 98 | .map_io = netx_map_io, |
| 99 | .init_irq = netx_init_irq, |
Jamie Iles | 14f127ba | 2011-09-27 20:22:21 +0100 | [diff] [blame] | 100 | .handle_irq = vic_handle_irq, |
Sascha Hauer | 693532d | 2006-06-19 15:29:43 +0100 | [diff] [blame] | 101 | .timer = &netx_timer, |
| 102 | .init_machine = nxdkn_init, |
Russell King | 8fb06b1 | 2011-11-11 15:12:17 +0000 | [diff] [blame] | 103 | .restart = netx_restart, |
Sascha Hauer | 693532d | 2006-06-19 15:29:43 +0100 | [diff] [blame] | 104 | MACHINE_END |