setup-r8a7778.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * r8a7778 processor support
  3. *
  4. * Copyright (C) 2013 Renesas Solutions Corp.
  5. * Copyright (C) 2013 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
  6. * Copyright (C) 2013 Cogent Embedded, Inc.
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; version 2 of the License.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. */
  17. #include <linux/clk/renesas.h>
  18. #include <linux/io.h>
  19. #include <linux/irqchip.h>
  20. #include <asm/mach/arch.h>
  21. #include "common.h"
  22. #define MODEMR 0xffcc0020
  23. static void __init r8a7778_timer_init(void)
  24. {
  25. u32 mode;
  26. void __iomem *modemr = ioremap_nocache(MODEMR, 4);
  27. BUG_ON(!modemr);
  28. mode = ioread32(modemr);
  29. iounmap(modemr);
  30. r8a7778_clocks_init(mode);
  31. }
  32. #define INT2SMSKCR0 0x82288 /* 0xfe782288 */
  33. #define INT2SMSKCR1 0x8228c /* 0xfe78228c */
  34. #define INT2NTSR0 0x00018 /* 0xfe700018 */
  35. #define INT2NTSR1 0x0002c /* 0xfe70002c */
  36. static void __init r8a7778_init_irq_dt(void)
  37. {
  38. void __iomem *base = ioremap_nocache(0xfe700000, 0x00100000);
  39. BUG_ON(!base);
  40. irqchip_init();
  41. /* route all interrupts to ARM */
  42. __raw_writel(0x73ffffff, base + INT2NTSR0);
  43. __raw_writel(0xffffffff, base + INT2NTSR1);
  44. /* unmask all known interrupts in INTCS2 */
  45. __raw_writel(0x08330773, base + INT2SMSKCR0);
  46. __raw_writel(0x00311110, base + INT2SMSKCR1);
  47. iounmap(base);
  48. }
  49. static const char *const r8a7778_compat_dt[] __initconst = {
  50. "renesas,r8a7778",
  51. NULL,
  52. };
  53. DT_MACHINE_START(R8A7778_DT, "Generic R8A7778 (Flattened Device Tree)")
  54. .init_early = shmobile_init_delay,
  55. .init_irq = r8a7778_init_irq_dt,
  56. .init_late = shmobile_init_late,
  57. .init_time = r8a7778_timer_init,
  58. .dt_compat = r8a7778_compat_dt,
  59. MACHINE_END