platform.c 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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/init.h>
  21. #include <linux/platform_device.h>
  22. #include <asm/mach-au1x00/au1xxx.h>
  23. static struct resource ide_resources[] = {
  24. [0] = {
  25. .start = IDE_PHYS_ADDR,
  26. .end = IDE_PHYS_ADDR + IDE_PHYS_LEN - 1,
  27. .flags = IORESOURCE_MEM
  28. },
  29. [1] = {
  30. .start = IDE_INT,
  31. .end = IDE_INT,
  32. .flags = IORESOURCE_IRQ
  33. }
  34. };
  35. static u64 ide_dmamask = ~(u32)0;
  36. static struct platform_device ide_device = {
  37. .name = "au1200-ide",
  38. .id = 0,
  39. .dev = {
  40. .dma_mask = &ide_dmamask,
  41. .coherent_dma_mask = 0xffffffff,
  42. },
  43. .num_resources = ARRAY_SIZE(ide_resources),
  44. .resource = ide_resources
  45. };
  46. static struct resource smc91c111_resources[] = {
  47. [0] = {
  48. .name = "smc91x-regs",
  49. .start = SMC91C111_PHYS_ADDR,
  50. .end = SMC91C111_PHYS_ADDR + 0xf,
  51. .flags = IORESOURCE_MEM
  52. },
  53. [1] = {
  54. .start = SMC91C111_INT,
  55. .end = SMC91C111_INT,
  56. .flags = IORESOURCE_IRQ
  57. },
  58. };
  59. static struct platform_device smc91c111_device = {
  60. .name = "smc91x",
  61. .id = -1,
  62. .num_resources = ARRAY_SIZE(smc91c111_resources),
  63. .resource = smc91c111_resources
  64. };
  65. static struct platform_device *board_platform_devices[] __initdata = {
  66. &ide_device,
  67. &smc91c111_device
  68. };
  69. static int __init board_register_devices(void)
  70. {
  71. return platform_add_devices(board_platform_devices,
  72. ARRAY_SIZE(board_platform_devices));
  73. }
  74. arch_initcall(board_register_devices);