nxdkn.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. #include <linux/dma-mapping.h>
  20. #include <linux/init.h>
  21. #include <linux/interrupt.h>
  22. #include <linux/mtd/plat-ram.h>
  23. #include <linux/platform_device.h>
  24. #include <linux/amba/bus.h>
  25. #include <linux/amba/clcd.h>
  26. #include <mach/hardware.h>
  27. #include <asm/mach-types.h>
  28. #include <asm/mach/arch.h>
  29. #include <asm/hardware/vic.h>
  30. #include <mach/netx-regs.h>
  31. #include <mach/eth.h>
  32. #include "generic.h"
  33. static struct netxeth_platform_data eth0_platform_data = {
  34. .xcno = 0,
  35. };
  36. static struct platform_device nxdkn_eth0_device = {
  37. .name = "netx-eth",
  38. .id = 0,
  39. .num_resources = 0,
  40. .resource = NULL,
  41. .dev = {
  42. .platform_data = &eth0_platform_data,
  43. }
  44. };
  45. static struct netxeth_platform_data eth1_platform_data = {
  46. .xcno = 1,
  47. };
  48. static struct platform_device nxdkn_eth1_device = {
  49. .name = "netx-eth",
  50. .id = 1,
  51. .num_resources = 0,
  52. .resource = NULL,
  53. .dev = {
  54. .platform_data = &eth1_platform_data,
  55. }
  56. };
  57. static struct resource netx_uart0_resources[] = {
  58. [0] = {
  59. .start = 0x00100A00,
  60. .end = 0x00100A3F,
  61. .flags = IORESOURCE_MEM,
  62. },
  63. [1] = {
  64. .start = (NETX_IRQ_UART0),
  65. .end = (NETX_IRQ_UART0),
  66. .flags = IORESOURCE_IRQ,
  67. },
  68. };
  69. static struct platform_device netx_uart0_device = {
  70. .name = "netx-uart",
  71. .id = 0,
  72. .num_resources = ARRAY_SIZE(netx_uart0_resources),
  73. .resource = netx_uart0_resources,
  74. };
  75. static struct platform_device *devices[] __initdata = {
  76. &nxdkn_eth0_device,
  77. &nxdkn_eth1_device,
  78. &netx_uart0_device,
  79. };
  80. static void __init nxdkn_init(void)
  81. {
  82. platform_add_devices(devices, ARRAY_SIZE(devices));
  83. }
  84. MACHINE_START(NXDKN, "Hilscher nxdkn")
  85. .atag_offset = 0x100,
  86. .map_io = netx_map_io,
  87. .init_irq = netx_init_irq,
  88. .handle_irq = vic_handle_irq,
  89. .timer = &netx_timer,
  90. .init_machine = nxdkn_init,
  91. .restart = netx_restart,
  92. MACHINE_END