board-bockw-reference.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * Bock-W board support
  3. *
  4. * Copyright (C) 2013 Renesas Solutions Corp.
  5. * Copyright (C) 2013 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; version 2 of the License.
  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. #include <linux/of_platform.h>
  17. #include <asm/mach/arch.h>
  18. #include "common.h"
  19. #include "r8a7778.h"
  20. /*
  21. * see board-bock.c for checking detail of dip-switch
  22. */
  23. #define FPGA 0x18200000
  24. #define IRQ0MR 0x30
  25. #define COMCTLR 0x101c
  26. #define PFC 0xfffc0000
  27. #define PUPR4 0x110
  28. static void __init bockw_init(void)
  29. {
  30. void __iomem *fpga;
  31. void __iomem *pfc;
  32. r8a7778_clock_init();
  33. r8a7778_init_irq_extpin_dt(1);
  34. r8a7778_add_dt_devices();
  35. fpga = ioremap_nocache(FPGA, SZ_1M);
  36. if (fpga) {
  37. /*
  38. * CAUTION
  39. *
  40. * IRQ0/1 is cascaded interrupt from FPGA.
  41. * it should be cared in the future
  42. * Now, it is assuming IRQ0 was used only from SMSC.
  43. */
  44. u16 val = ioread16(fpga + IRQ0MR);
  45. val &= ~(1 << 4); /* enable SMSC911x */
  46. iowrite16(val, fpga + IRQ0MR);
  47. iounmap(fpga);
  48. }
  49. pfc = ioremap_nocache(PFC, 0x200);
  50. if (pfc) {
  51. /*
  52. * FIXME
  53. *
  54. * SDHI CD/WP pin needs pull-up
  55. */
  56. iowrite32(ioread32(pfc + PUPR4) | (3 << 26), pfc + PUPR4);
  57. iounmap(pfc);
  58. }
  59. of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
  60. }
  61. static const char *bockw_boards_compat_dt[] __initdata = {
  62. "renesas,bockw-reference",
  63. NULL,
  64. };
  65. DT_MACHINE_START(BOCKW_DT, "bockw")
  66. .init_early = shmobile_init_delay,
  67. .init_irq = r8a7778_init_irq_dt,
  68. .init_machine = bockw_init,
  69. .init_late = shmobile_init_late,
  70. .dt_compat = bockw_boards_compat_dt,
  71. MACHINE_END