platform.c 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * Pb1200/DBAu1200 board platform device registration
  3. *
  4. * Copyright (C) 2008 MontaVista Software Inc. <source@mvista.com>
  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 as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. #include <linux/dma-mapping.h>
  21. #include <linux/init.h>
  22. #include <linux/platform_device.h>
  23. #include <asm/mach-au1x00/au1xxx.h>
  24. static struct resource ide_resources[] = {
  25. [0] = {
  26. .start = IDE_PHYS_ADDR,
  27. .end = IDE_PHYS_ADDR + IDE_PHYS_LEN - 1,
  28. .flags = IORESOURCE_MEM
  29. },
  30. [1] = {
  31. .start = IDE_INT,
  32. .end = IDE_INT,
  33. .flags = IORESOURCE_IRQ
  34. }
  35. };
  36. static u64 ide_dmamask = DMA_32BIT_MASK;
  37. static struct platform_device ide_device = {
  38. .name = "au1200-ide",
  39. .id = 0,
  40. .dev = {
  41. .dma_mask = &ide_dmamask,
  42. .coherent_dma_mask = DMA_32BIT_MASK,
  43. },
  44. .num_resources = ARRAY_SIZE(ide_resources),
  45. .resource = ide_resources
  46. };
  47. static struct resource smc91c111_resources[] = {
  48. [0] = {
  49. .name = "smc91x-regs",
  50. .start = SMC91C111_PHYS_ADDR,
  51. .end = SMC91C111_PHYS_ADDR + 0xf,
  52. .flags = IORESOURCE_MEM
  53. },
  54. [1] = {
  55. .start = SMC91C111_INT,
  56. .end = SMC91C111_INT,
  57. .flags = IORESOURCE_IRQ
  58. },
  59. };
  60. static struct platform_device smc91c111_device = {
  61. .name = "smc91x",
  62. .id = -1,
  63. .num_resources = ARRAY_SIZE(smc91c111_resources),
  64. .resource = smc91c111_resources
  65. };
  66. static struct platform_device *board_platform_devices[] __initdata = {
  67. &ide_device,
  68. &smc91c111_device
  69. };
  70. static int __init board_register_devices(void)
  71. {
  72. return platform_add_devices(board_platform_devices,
  73. ARRAY_SIZE(board_platform_devices));
  74. }
  75. arch_initcall(board_register_devices);