platform.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Platform device support for Au1x00 SoCs.
  3. *
  4. * Copyright 2004, Matt Porter <mporter@kernel.crashing.org>
  5. *
  6. * This file is licensed under the terms of the GNU General Public
  7. * License version 2. This program is licensed "as is" without any
  8. * warranty of any kind, whether express or implied.
  9. */
  10. #include <linux/device.h>
  11. #include <linux/kernel.h>
  12. #include <linux/init.h>
  13. #include <linux/resource.h>
  14. #include <asm/mach-au1x00/au1000.h>
  15. static struct resource au1xxx_usb_ohci_resources[] = {
  16. [0] = {
  17. .start = USB_OHCI_BASE,
  18. .end = USB_OHCI_BASE + USB_OHCI_LEN,
  19. .flags = IORESOURCE_MEM,
  20. },
  21. [1] = {
  22. .start = AU1000_USB_HOST_INT,
  23. .end = AU1000_USB_HOST_INT,
  24. .flags = IORESOURCE_IRQ,
  25. },
  26. };
  27. /* The dmamask must be set for OHCI to work */
  28. static u64 ohci_dmamask = ~(u32)0;
  29. static struct platform_device au1xxx_usb_ohci_device = {
  30. .name = "au1xxx-ohci",
  31. .id = 0,
  32. .dev = {
  33. .dma_mask = &ohci_dmamask,
  34. .coherent_dma_mask = 0xffffffff,
  35. },
  36. .num_resources = ARRAY_SIZE(au1xxx_usb_ohci_resources),
  37. .resource = au1xxx_usb_ohci_resources,
  38. };
  39. static struct platform_device *au1xxx_platform_devices[] __initdata = {
  40. &au1xxx_usb_ohci_device,
  41. };
  42. int au1xxx_platform_init(void)
  43. {
  44. return platform_add_devices(au1xxx_platform_devices, ARRAY_SIZE(au1xxx_platform_devices));
  45. }
  46. arch_initcall(au1xxx_platform_init);