setup.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Renesas System Solutions Asia Pte. Ltd - Migo-R
  3. *
  4. * Copyright (C) 2008 Magnus Damm
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file "COPYING" in the main directory of this archive
  8. * for more details.
  9. */
  10. #include <linux/init.h>
  11. #include <linux/platform_device.h>
  12. #include <linux/interrupt.h>
  13. #include <asm/machvec.h>
  14. #include <asm/io.h>
  15. /* Address IRQ Size Bus Description
  16. * 0x00000000 64MB 16 NOR Flash (SP29PL256N)
  17. * 0x0c000000 64MB 64 SDRAM (2xK4M563233G)
  18. * 0x10000000 IRQ0 16 Ethernet (SMC91C111)
  19. * 0x14000000 IRQ4 16 USB 2.0 Host Controller (M66596)
  20. * 0x18000000 8GB 8 NAND Flash (K9K8G08U0A)
  21. */
  22. static struct resource smc91x_eth_resources[] = {
  23. [0] = {
  24. .name = "smc91x-regs" ,
  25. .start = P2SEGADDR(0x10000300),
  26. .end = P2SEGADDR(0x1000030f),
  27. .flags = IORESOURCE_MEM,
  28. },
  29. [1] = {
  30. .start = 32, /* IRQ0 */
  31. .flags = IORESOURCE_IRQ | IRQF_TRIGGER_HIGH,
  32. },
  33. };
  34. static struct platform_device smc91x_eth_device = {
  35. .name = "smc91x",
  36. .num_resources = ARRAY_SIZE(smc91x_eth_resources),
  37. .resource = smc91x_eth_resources,
  38. };
  39. static struct platform_device *migor_devices[] __initdata = {
  40. &smc91x_eth_device,
  41. };
  42. static int __init migor_devices_setup(void)
  43. {
  44. return platform_add_devices(migor_devices, ARRAY_SIZE(migor_devices));
  45. }
  46. __initcall(migor_devices_setup);
  47. static void __init migor_setup(char **cmdline_p)
  48. {
  49. ctrl_outw(0x1000, 0xa4050110); /* Enable IRQ0 in PJCR */
  50. }
  51. static struct sh_machine_vector mv_migor __initmv = {
  52. .mv_name = "Migo-R",
  53. .mv_setup = migor_setup,
  54. };