nxdkn.c 2.4 KB

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