setup-sh7722.c 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. * SH7722 Setup
  3. *
  4. * Copyright (C) 2006 - 2007 Paul Mundt
  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/platform_device.h>
  11. #include <linux/init.h>
  12. #include <linux/serial.h>
  13. #include <linux/mm.h>
  14. #include <asm/mmzone.h>
  15. #include <asm/sci.h>
  16. static struct plat_sci_port sci_platform_data[] = {
  17. {
  18. .mapbase = 0xffe00000,
  19. .flags = UPF_BOOT_AUTOCONF,
  20. .type = PORT_SCIF,
  21. .irqs = { 80, 80, 80, 80 },
  22. },
  23. {
  24. .mapbase = 0xffe10000,
  25. .flags = UPF_BOOT_AUTOCONF,
  26. .type = PORT_SCIF,
  27. .irqs = { 81, 81, 81, 81 },
  28. },
  29. {
  30. .mapbase = 0xffe20000,
  31. .flags = UPF_BOOT_AUTOCONF,
  32. .type = PORT_SCIF,
  33. .irqs = { 82, 82, 82, 82 },
  34. },
  35. {
  36. .flags = 0,
  37. }
  38. };
  39. static struct platform_device sci_device = {
  40. .name = "sh-sci",
  41. .id = -1,
  42. .dev = {
  43. .platform_data = sci_platform_data,
  44. },
  45. };
  46. static struct platform_device *sh7722_devices[] __initdata = {
  47. &sci_device,
  48. };
  49. static int __init sh7722_devices_setup(void)
  50. {
  51. return platform_add_devices(sh7722_devices,
  52. ARRAY_SIZE(sh7722_devices));
  53. }
  54. __initcall(sh7722_devices_setup);
  55. static struct ipr_data ipr_irq_table[] = {
  56. /* IRQ, IPR-idx, shift, prio */
  57. { 16, 0, 12, 2 }, /* TMU0 */
  58. { 17, 0, 8, 2 }, /* TMU1 */
  59. { 80, 6, 12, 3 }, /* SCIF0 */
  60. { 81, 6, 8, 3 }, /* SCIF1 */
  61. { 82, 6, 4, 3 }, /* SCIF2 */
  62. };
  63. static unsigned long ipr_offsets[] = {
  64. 0xa4080000, /* 0: IPRA */
  65. 0xa4080004, /* 1: IPRB */
  66. 0xa4080008, /* 2: IPRC */
  67. 0xa408000c, /* 3: IPRD */
  68. 0xa4080010, /* 4: IPRE */
  69. 0xa4080014, /* 5: IPRF */
  70. 0xa4080018, /* 6: IPRG */
  71. 0xa408001c, /* 7: IPRH */
  72. 0xa4080020, /* 8: IPRI */
  73. 0xa4080024, /* 9: IPRJ */
  74. 0xa4080028, /* 10: IPRK */
  75. 0xa408002c, /* 11: IPRL */
  76. };
  77. static struct ipr_desc ipr_irq_desc = {
  78. .ipr_offsets = ipr_offsets,
  79. .nr_offsets = ARRAY_SIZE(ipr_offsets),
  80. .ipr_data = ipr_irq_table,
  81. .nr_irqs = ARRAY_SIZE(ipr_irq_table),
  82. .chip = {
  83. .name = "IPR-sh7722",
  84. },
  85. };
  86. void __init init_IRQ_ipr(void)
  87. {
  88. register_ipr_controller(&ipr_irq_desc);
  89. }
  90. void __init plat_mem_setup(void)
  91. {
  92. /* Register the URAM space as Node 1 */
  93. setup_bootmem_node(1, 0x055f0000, 0x05610000);
  94. }