setup-sh7722.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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, 81, 83, 82 },
  22. }, {
  23. .flags = 0,
  24. }
  25. };
  26. static struct platform_device sci_device = {
  27. .name = "sh-sci",
  28. .id = -1,
  29. .dev = {
  30. .platform_data = sci_platform_data,
  31. },
  32. };
  33. static struct platform_device *sh7722_devices[] __initdata = {
  34. &sci_device,
  35. };
  36. static int __init sh7722_devices_setup(void)
  37. {
  38. return platform_add_devices(sh7722_devices,
  39. ARRAY_SIZE(sh7722_devices));
  40. }
  41. __initcall(sh7722_devices_setup);
  42. static struct ipr_data ipr_irq_table[] = {
  43. /* IRQ, IPR-idx, shift, prio */
  44. { 16, 0, 12, 2 }, /* TMU0 */
  45. { 17, 0, 8, 2 }, /* TMU1 */
  46. { 80, 6, 12, 3 }, /* SCIF ERI */
  47. { 81, 6, 12, 3 }, /* SCIF RXI */
  48. { 82, 6, 12, 3 }, /* SCIF BRI */
  49. { 83, 6, 12, 3 }, /* SCIF TXI */
  50. };
  51. static unsigned long ipr_offsets[] = {
  52. 0xa4080000, /* 0: IPRA */
  53. 0xa4080004, /* 1: IPRB */
  54. 0xa4080008, /* 2: IPRC */
  55. 0xa408000c, /* 3: IPRD */
  56. 0xa4080010, /* 4: IPRE */
  57. 0xa4080014, /* 5: IPRF */
  58. 0xa4080018, /* 6: IPRG */
  59. 0xa408001c, /* 7: IPRH */
  60. 0xa4080020, /* 8: IPRI */
  61. 0xa4080024, /* 9: IPRJ */
  62. 0xa4080028, /* 10: IPRK */
  63. 0xa408002c, /* 11: IPRL */
  64. };
  65. static struct ipr_desc ipr_irq_desc = {
  66. .ipr_offsets = ipr_offsets,
  67. .nr_offsets = ARRAY_SIZE(ipr_offsets),
  68. .ipr_data = ipr_irq_table,
  69. .nr_irqs = ARRAY_SIZE(ipr_irq_table),
  70. .chip = {
  71. .name = "IPR-sh7722",
  72. },
  73. };
  74. void __init init_IRQ_ipr(void)
  75. {
  76. register_ipr_controller(&ipr_irq_desc);
  77. }
  78. void __init plat_mem_setup(void)
  79. {
  80. /* Register the URAM space as Node 1 */
  81. setup_bootmem_node(1, 0x055f0000, 0x05610000);
  82. }