board-bockw-reference.c 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. #ifndef CONFIG_COMMON_CLK
  33. r8a7778_clock_init();
  34. #endif
  35. r8a7778_init_irq_extpin_dt(1);
  36. r8a7778_add_dt_devices();
  37. fpga = ioremap_nocache(FPGA, SZ_1M);
  38. if (fpga) {
  39. /*
  40. * CAUTION
  41. *
  42. * IRQ0/1 is cascaded interrupt from FPGA.
  43. * it should be cared in the future
  44. * Now, it is assuming IRQ0 was used only from SMSC.
  45. */
  46. u16 val = ioread16(fpga + IRQ0MR);
  47. val &= ~(1 << 4); /* enable SMSC911x */
  48. iowrite16(val, fpga + IRQ0MR);
  49. iounmap(fpga);
  50. }
  51. pfc = ioremap_nocache(PFC, 0x200);
  52. if (pfc) {
  53. /*
  54. * FIXME
  55. *
  56. * SDHI CD/WP pin needs pull-up
  57. */
  58. iowrite32(ioread32(pfc + PUPR4) | (3 << 26), pfc + PUPR4);
  59. iounmap(pfc);
  60. }
  61. of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
  62. }
  63. static const char *bockw_boards_compat_dt[] __initdata = {
  64. "renesas,bockw-reference",
  65. NULL,
  66. };
  67. DT_MACHINE_START(BOCKW_DT, "bockw")
  68. .init_early = shmobile_init_delay,
  69. .init_irq = r8a7778_init_irq_dt,
  70. .init_machine = bockw_init,
  71. .init_late = shmobile_init_late,
  72. .dt_compat = bockw_boards_compat_dt,
  73. MACHINE_END