omap-wakeupgen.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603
  1. /*
  2. * OMAP WakeupGen Source file
  3. *
  4. * OMAP WakeupGen is the interrupt controller extension used along
  5. * with ARM GIC to wake the CPU out from low power states on
  6. * external interrupts. It is responsible for generating wakeup
  7. * event from the incoming interrupts and enable bits. It is
  8. * implemented in MPU always ON power domain. During normal operation,
  9. * WakeupGen delivers external interrupts directly to the GIC.
  10. *
  11. * Copyright (C) 2011 Texas Instruments, Inc.
  12. * Santosh Shilimkar <santosh.shilimkar@ti.com>
  13. *
  14. * This program is free software; you can redistribute it and/or modify
  15. * it under the terms of the GNU General Public License version 2 as
  16. * published by the Free Software Foundation.
  17. */
  18. #include <linux/kernel.h>
  19. #include <linux/init.h>
  20. #include <linux/io.h>
  21. #include <linux/irq.h>
  22. #include <linux/irqchip.h>
  23. #include <linux/irqdomain.h>
  24. #include <linux/of_address.h>
  25. #include <linux/platform_device.h>
  26. #include <linux/cpu.h>
  27. #include <linux/notifier.h>
  28. #include <linux/cpu_pm.h>
  29. #include "omap-wakeupgen.h"
  30. #include "omap-secure.h"
  31. #include "soc.h"
  32. #include "omap4-sar-layout.h"
  33. #include "common.h"
  34. #include "pm.h"
  35. #define AM43XX_NR_REG_BANKS 7
  36. #define AM43XX_IRQS 224
  37. #define MAX_NR_REG_BANKS AM43XX_NR_REG_BANKS
  38. #define MAX_IRQS AM43XX_IRQS
  39. #define DEFAULT_NR_REG_BANKS 5
  40. #define DEFAULT_IRQS 160
  41. #define WKG_MASK_ALL 0x00000000
  42. #define WKG_UNMASK_ALL 0xffffffff
  43. #define CPU_ENA_OFFSET 0x400
  44. #define CPU0_ID 0x0
  45. #define CPU1_ID 0x1
  46. #define OMAP4_NR_BANKS 4
  47. #define OMAP4_NR_IRQS 128
  48. static void __iomem *wakeupgen_base;
  49. static void __iomem *sar_base;
  50. static DEFINE_RAW_SPINLOCK(wakeupgen_lock);
  51. static unsigned int irq_target_cpu[MAX_IRQS];
  52. static unsigned int irq_banks = DEFAULT_NR_REG_BANKS;
  53. static unsigned int max_irqs = DEFAULT_IRQS;
  54. static unsigned int omap_secure_apis;
  55. #ifdef CONFIG_CPU_PM
  56. static unsigned int wakeupgen_context[MAX_NR_REG_BANKS];
  57. #endif
  58. struct omap_wakeupgen_ops {
  59. void (*save_context)(void);
  60. void (*restore_context)(void);
  61. };
  62. static struct omap_wakeupgen_ops *wakeupgen_ops;
  63. /*
  64. * Static helper functions.
  65. */
  66. static inline u32 wakeupgen_readl(u8 idx, u32 cpu)
  67. {
  68. return readl_relaxed(wakeupgen_base + OMAP_WKG_ENB_A_0 +
  69. (cpu * CPU_ENA_OFFSET) + (idx * 4));
  70. }
  71. static inline void wakeupgen_writel(u32 val, u8 idx, u32 cpu)
  72. {
  73. writel_relaxed(val, wakeupgen_base + OMAP_WKG_ENB_A_0 +
  74. (cpu * CPU_ENA_OFFSET) + (idx * 4));
  75. }
  76. static inline void sar_writel(u32 val, u32 offset, u8 idx)
  77. {
  78. writel_relaxed(val, sar_base + offset + (idx * 4));
  79. }
  80. static inline int _wakeupgen_get_irq_info(u32 irq, u32 *bit_posn, u8 *reg_index)
  81. {
  82. /*
  83. * Each WakeupGen register controls 32 interrupt.
  84. * i.e. 1 bit per SPI IRQ
  85. */
  86. *reg_index = irq >> 5;
  87. *bit_posn = irq %= 32;
  88. return 0;
  89. }
  90. static void _wakeupgen_clear(unsigned int irq, unsigned int cpu)
  91. {
  92. u32 val, bit_number;
  93. u8 i;
  94. if (_wakeupgen_get_irq_info(irq, &bit_number, &i))
  95. return;
  96. val = wakeupgen_readl(i, cpu);
  97. val &= ~BIT(bit_number);
  98. wakeupgen_writel(val, i, cpu);
  99. }
  100. static void _wakeupgen_set(unsigned int irq, unsigned int cpu)
  101. {
  102. u32 val, bit_number;
  103. u8 i;
  104. if (_wakeupgen_get_irq_info(irq, &bit_number, &i))
  105. return;
  106. val = wakeupgen_readl(i, cpu);
  107. val |= BIT(bit_number);
  108. wakeupgen_writel(val, i, cpu);
  109. }
  110. /*
  111. * Architecture specific Mask extension
  112. */
  113. static void wakeupgen_mask(struct irq_data *d)
  114. {
  115. unsigned long flags;
  116. raw_spin_lock_irqsave(&wakeupgen_lock, flags);
  117. _wakeupgen_clear(d->hwirq, irq_target_cpu[d->hwirq]);
  118. raw_spin_unlock_irqrestore(&wakeupgen_lock, flags);
  119. irq_chip_mask_parent(d);
  120. }
  121. /*
  122. * Architecture specific Unmask extension
  123. */
  124. static void wakeupgen_unmask(struct irq_data *d)
  125. {
  126. unsigned long flags;
  127. raw_spin_lock_irqsave(&wakeupgen_lock, flags);
  128. _wakeupgen_set(d->hwirq, irq_target_cpu[d->hwirq]);
  129. raw_spin_unlock_irqrestore(&wakeupgen_lock, flags);
  130. irq_chip_unmask_parent(d);
  131. }
  132. #ifdef CONFIG_HOTPLUG_CPU
  133. static DEFINE_PER_CPU(u32 [MAX_NR_REG_BANKS], irqmasks);
  134. static void _wakeupgen_save_masks(unsigned int cpu)
  135. {
  136. u8 i;
  137. for (i = 0; i < irq_banks; i++)
  138. per_cpu(irqmasks, cpu)[i] = wakeupgen_readl(i, cpu);
  139. }
  140. static void _wakeupgen_restore_masks(unsigned int cpu)
  141. {
  142. u8 i;
  143. for (i = 0; i < irq_banks; i++)
  144. wakeupgen_writel(per_cpu(irqmasks, cpu)[i], i, cpu);
  145. }
  146. static void _wakeupgen_set_all(unsigned int cpu, unsigned int reg)
  147. {
  148. u8 i;
  149. for (i = 0; i < irq_banks; i++)
  150. wakeupgen_writel(reg, i, cpu);
  151. }
  152. /*
  153. * Mask or unmask all interrupts on given CPU.
  154. * 0 = Mask all interrupts on the 'cpu'
  155. * 1 = Unmask all interrupts on the 'cpu'
  156. * Ensure that the initial mask is maintained. This is faster than
  157. * iterating through GIC registers to arrive at the correct masks.
  158. */
  159. static void wakeupgen_irqmask_all(unsigned int cpu, unsigned int set)
  160. {
  161. unsigned long flags;
  162. raw_spin_lock_irqsave(&wakeupgen_lock, flags);
  163. if (set) {
  164. _wakeupgen_save_masks(cpu);
  165. _wakeupgen_set_all(cpu, WKG_MASK_ALL);
  166. } else {
  167. _wakeupgen_set_all(cpu, WKG_UNMASK_ALL);
  168. _wakeupgen_restore_masks(cpu);
  169. }
  170. raw_spin_unlock_irqrestore(&wakeupgen_lock, flags);
  171. }
  172. #endif
  173. #ifdef CONFIG_CPU_PM
  174. static inline void omap4_irq_save_context(void)
  175. {
  176. u32 i, val;
  177. if (omap_rev() == OMAP4430_REV_ES1_0)
  178. return;
  179. for (i = 0; i < irq_banks; i++) {
  180. /* Save the CPUx interrupt mask for IRQ 0 to 127 */
  181. val = wakeupgen_readl(i, 0);
  182. sar_writel(val, WAKEUPGENENB_OFFSET_CPU0, i);
  183. val = wakeupgen_readl(i, 1);
  184. sar_writel(val, WAKEUPGENENB_OFFSET_CPU1, i);
  185. /*
  186. * Disable the secure interrupts for CPUx. The restore
  187. * code blindly restores secure and non-secure interrupt
  188. * masks from SAR RAM. Secure interrupts are not suppose
  189. * to be enabled from HLOS. So overwrite the SAR location
  190. * so that the secure interrupt remains disabled.
  191. */
  192. sar_writel(0x0, WAKEUPGENENB_SECURE_OFFSET_CPU0, i);
  193. sar_writel(0x0, WAKEUPGENENB_SECURE_OFFSET_CPU1, i);
  194. }
  195. /* Save AuxBoot* registers */
  196. val = readl_relaxed(wakeupgen_base + OMAP_AUX_CORE_BOOT_0);
  197. writel_relaxed(val, sar_base + AUXCOREBOOT0_OFFSET);
  198. val = readl_relaxed(wakeupgen_base + OMAP_AUX_CORE_BOOT_1);
  199. writel_relaxed(val, sar_base + AUXCOREBOOT1_OFFSET);
  200. /* Save SyncReq generation logic */
  201. val = readl_relaxed(wakeupgen_base + OMAP_PTMSYNCREQ_MASK);
  202. writel_relaxed(val, sar_base + PTMSYNCREQ_MASK_OFFSET);
  203. val = readl_relaxed(wakeupgen_base + OMAP_PTMSYNCREQ_EN);
  204. writel_relaxed(val, sar_base + PTMSYNCREQ_EN_OFFSET);
  205. /* Set the Backup Bit Mask status */
  206. val = readl_relaxed(sar_base + SAR_BACKUP_STATUS_OFFSET);
  207. val |= SAR_BACKUP_STATUS_WAKEUPGEN;
  208. writel_relaxed(val, sar_base + SAR_BACKUP_STATUS_OFFSET);
  209. }
  210. static inline void omap5_irq_save_context(void)
  211. {
  212. u32 i, val;
  213. for (i = 0; i < irq_banks; i++) {
  214. /* Save the CPUx interrupt mask for IRQ 0 to 159 */
  215. val = wakeupgen_readl(i, 0);
  216. sar_writel(val, OMAP5_WAKEUPGENENB_OFFSET_CPU0, i);
  217. val = wakeupgen_readl(i, 1);
  218. sar_writel(val, OMAP5_WAKEUPGENENB_OFFSET_CPU1, i);
  219. sar_writel(0x0, OMAP5_WAKEUPGENENB_SECURE_OFFSET_CPU0, i);
  220. sar_writel(0x0, OMAP5_WAKEUPGENENB_SECURE_OFFSET_CPU1, i);
  221. }
  222. /* Save AuxBoot* registers */
  223. val = readl_relaxed(wakeupgen_base + OMAP_AUX_CORE_BOOT_0);
  224. writel_relaxed(val, sar_base + OMAP5_AUXCOREBOOT0_OFFSET);
  225. val = readl_relaxed(wakeupgen_base + OMAP_AUX_CORE_BOOT_0);
  226. writel_relaxed(val, sar_base + OMAP5_AUXCOREBOOT1_OFFSET);
  227. /* Set the Backup Bit Mask status */
  228. val = readl_relaxed(sar_base + OMAP5_SAR_BACKUP_STATUS_OFFSET);
  229. val |= SAR_BACKUP_STATUS_WAKEUPGEN;
  230. writel_relaxed(val, sar_base + OMAP5_SAR_BACKUP_STATUS_OFFSET);
  231. }
  232. static inline void am43xx_irq_save_context(void)
  233. {
  234. u32 i;
  235. for (i = 0; i < irq_banks; i++) {
  236. wakeupgen_context[i] = wakeupgen_readl(i, 0);
  237. wakeupgen_writel(0, i, CPU0_ID);
  238. }
  239. }
  240. /*
  241. * Save WakeupGen interrupt context in SAR BANK3. Restore is done by
  242. * ROM code. WakeupGen IP is integrated along with GIC to manage the
  243. * interrupt wakeups from CPU low power states. It manages
  244. * masking/unmasking of Shared peripheral interrupts(SPI). So the
  245. * interrupt enable/disable control should be in sync and consistent
  246. * at WakeupGen and GIC so that interrupts are not lost.
  247. */
  248. static void irq_save_context(void)
  249. {
  250. /* DRA7 has no SAR to save */
  251. if (soc_is_dra7xx())
  252. return;
  253. if (!sar_base)
  254. sar_base = omap4_get_sar_ram_base();
  255. if (wakeupgen_ops && wakeupgen_ops->save_context)
  256. wakeupgen_ops->save_context();
  257. }
  258. /*
  259. * Clear WakeupGen SAR backup status.
  260. */
  261. static void irq_sar_clear(void)
  262. {
  263. u32 val;
  264. u32 offset = SAR_BACKUP_STATUS_OFFSET;
  265. /* DRA7 has no SAR to save */
  266. if (soc_is_dra7xx())
  267. return;
  268. if (soc_is_omap54xx())
  269. offset = OMAP5_SAR_BACKUP_STATUS_OFFSET;
  270. val = readl_relaxed(sar_base + offset);
  271. val &= ~SAR_BACKUP_STATUS_WAKEUPGEN;
  272. writel_relaxed(val, sar_base + offset);
  273. }
  274. static void am43xx_irq_restore_context(void)
  275. {
  276. u32 i;
  277. for (i = 0; i < irq_banks; i++)
  278. wakeupgen_writel(wakeupgen_context[i], i, CPU0_ID);
  279. }
  280. static void irq_restore_context(void)
  281. {
  282. if (wakeupgen_ops && wakeupgen_ops->restore_context)
  283. wakeupgen_ops->restore_context();
  284. }
  285. /*
  286. * Save GIC and Wakeupgen interrupt context using secure API
  287. * for HS/EMU devices.
  288. */
  289. static void irq_save_secure_context(void)
  290. {
  291. u32 ret;
  292. ret = omap_secure_dispatcher(OMAP4_HAL_SAVEGIC_INDEX,
  293. FLAG_START_CRITICAL,
  294. 0, 0, 0, 0, 0);
  295. if (ret != API_HAL_RET_VALUE_OK)
  296. pr_err("GIC and Wakeupgen context save failed\n");
  297. }
  298. /* Define ops for context save and restore for each SoC */
  299. static struct omap_wakeupgen_ops omap4_wakeupgen_ops = {
  300. .save_context = omap4_irq_save_context,
  301. .restore_context = irq_sar_clear,
  302. };
  303. static struct omap_wakeupgen_ops omap5_wakeupgen_ops = {
  304. .save_context = omap5_irq_save_context,
  305. .restore_context = irq_sar_clear,
  306. };
  307. static struct omap_wakeupgen_ops am43xx_wakeupgen_ops = {
  308. .save_context = am43xx_irq_save_context,
  309. .restore_context = am43xx_irq_restore_context,
  310. };
  311. #else
  312. static struct omap_wakeupgen_ops omap4_wakeupgen_ops = {};
  313. static struct omap_wakeupgen_ops omap5_wakeupgen_ops = {};
  314. static struct omap_wakeupgen_ops am43xx_wakeupgen_ops = {};
  315. #endif
  316. #ifdef CONFIG_HOTPLUG_CPU
  317. static int omap_wakeupgen_cpu_online(unsigned int cpu)
  318. {
  319. wakeupgen_irqmask_all(cpu, 0);
  320. return 0;
  321. }
  322. static int omap_wakeupgen_cpu_dead(unsigned int cpu)
  323. {
  324. wakeupgen_irqmask_all(cpu, 1);
  325. return 0;
  326. }
  327. static void __init irq_hotplug_init(void)
  328. {
  329. cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN, "arm/omap-wake:online",
  330. omap_wakeupgen_cpu_online, NULL);
  331. cpuhp_setup_state_nocalls(CPUHP_ARM_OMAP_WAKE_DEAD,
  332. "arm/omap-wake:dead", NULL,
  333. omap_wakeupgen_cpu_dead);
  334. }
  335. #else
  336. static void __init irq_hotplug_init(void)
  337. {}
  338. #endif
  339. #ifdef CONFIG_CPU_PM
  340. static int irq_notifier(struct notifier_block *self, unsigned long cmd, void *v)
  341. {
  342. switch (cmd) {
  343. case CPU_CLUSTER_PM_ENTER:
  344. if (omap_type() == OMAP2_DEVICE_TYPE_GP)
  345. irq_save_context();
  346. else
  347. irq_save_secure_context();
  348. break;
  349. case CPU_CLUSTER_PM_EXIT:
  350. if (omap_type() == OMAP2_DEVICE_TYPE_GP)
  351. irq_restore_context();
  352. break;
  353. }
  354. return NOTIFY_OK;
  355. }
  356. static struct notifier_block irq_notifier_block = {
  357. .notifier_call = irq_notifier,
  358. };
  359. static void __init irq_pm_init(void)
  360. {
  361. /* FIXME: Remove this when MPU OSWR support is added */
  362. if (!IS_PM44XX_ERRATUM(PM_OMAP4_CPU_OSWR_DISABLE))
  363. cpu_pm_register_notifier(&irq_notifier_block);
  364. }
  365. #else
  366. static void __init irq_pm_init(void)
  367. {}
  368. #endif
  369. void __iomem *omap_get_wakeupgen_base(void)
  370. {
  371. return wakeupgen_base;
  372. }
  373. int omap_secure_apis_support(void)
  374. {
  375. return omap_secure_apis;
  376. }
  377. static struct irq_chip wakeupgen_chip = {
  378. .name = "WUGEN",
  379. .irq_eoi = irq_chip_eoi_parent,
  380. .irq_mask = wakeupgen_mask,
  381. .irq_unmask = wakeupgen_unmask,
  382. .irq_retrigger = irq_chip_retrigger_hierarchy,
  383. .irq_set_type = irq_chip_set_type_parent,
  384. .flags = IRQCHIP_SKIP_SET_WAKE | IRQCHIP_MASK_ON_SUSPEND,
  385. #ifdef CONFIG_SMP
  386. .irq_set_affinity = irq_chip_set_affinity_parent,
  387. #endif
  388. };
  389. static int wakeupgen_domain_translate(struct irq_domain *d,
  390. struct irq_fwspec *fwspec,
  391. unsigned long *hwirq,
  392. unsigned int *type)
  393. {
  394. if (is_of_node(fwspec->fwnode)) {
  395. if (fwspec->param_count != 3)
  396. return -EINVAL;
  397. /* No PPI should point to this domain */
  398. if (fwspec->param[0] != 0)
  399. return -EINVAL;
  400. *hwirq = fwspec->param[1];
  401. *type = fwspec->param[2];
  402. return 0;
  403. }
  404. return -EINVAL;
  405. }
  406. static int wakeupgen_domain_alloc(struct irq_domain *domain,
  407. unsigned int virq,
  408. unsigned int nr_irqs, void *data)
  409. {
  410. struct irq_fwspec *fwspec = data;
  411. struct irq_fwspec parent_fwspec;
  412. irq_hw_number_t hwirq;
  413. int i;
  414. if (fwspec->param_count != 3)
  415. return -EINVAL; /* Not GIC compliant */
  416. if (fwspec->param[0] != 0)
  417. return -EINVAL; /* No PPI should point to this domain */
  418. hwirq = fwspec->param[1];
  419. if (hwirq >= MAX_IRQS)
  420. return -EINVAL; /* Can't deal with this */
  421. for (i = 0; i < nr_irqs; i++)
  422. irq_domain_set_hwirq_and_chip(domain, virq + i, hwirq + i,
  423. &wakeupgen_chip, NULL);
  424. parent_fwspec = *fwspec;
  425. parent_fwspec.fwnode = domain->parent->fwnode;
  426. return irq_domain_alloc_irqs_parent(domain, virq, nr_irqs,
  427. &parent_fwspec);
  428. }
  429. static const struct irq_domain_ops wakeupgen_domain_ops = {
  430. .translate = wakeupgen_domain_translate,
  431. .alloc = wakeupgen_domain_alloc,
  432. .free = irq_domain_free_irqs_common,
  433. };
  434. /*
  435. * Initialise the wakeupgen module.
  436. */
  437. static int __init wakeupgen_init(struct device_node *node,
  438. struct device_node *parent)
  439. {
  440. struct irq_domain *parent_domain, *domain;
  441. int i;
  442. unsigned int boot_cpu = smp_processor_id();
  443. u32 val;
  444. if (!parent) {
  445. pr_err("%s: no parent, giving up\n", node->full_name);
  446. return -ENODEV;
  447. }
  448. parent_domain = irq_find_host(parent);
  449. if (!parent_domain) {
  450. pr_err("%s: unable to obtain parent domain\n", node->full_name);
  451. return -ENXIO;
  452. }
  453. /* Not supported on OMAP4 ES1.0 silicon */
  454. if (omap_rev() == OMAP4430_REV_ES1_0) {
  455. WARN(1, "WakeupGen: Not supported on OMAP4430 ES1.0\n");
  456. return -EPERM;
  457. }
  458. /* Static mapping, never released */
  459. wakeupgen_base = of_iomap(node, 0);
  460. if (WARN_ON(!wakeupgen_base))
  461. return -ENOMEM;
  462. if (cpu_is_omap44xx()) {
  463. irq_banks = OMAP4_NR_BANKS;
  464. max_irqs = OMAP4_NR_IRQS;
  465. omap_secure_apis = 1;
  466. wakeupgen_ops = &omap4_wakeupgen_ops;
  467. } else if (soc_is_omap54xx()) {
  468. wakeupgen_ops = &omap5_wakeupgen_ops;
  469. } else if (soc_is_am43xx()) {
  470. irq_banks = AM43XX_NR_REG_BANKS;
  471. max_irqs = AM43XX_IRQS;
  472. wakeupgen_ops = &am43xx_wakeupgen_ops;
  473. }
  474. domain = irq_domain_add_hierarchy(parent_domain, 0, max_irqs,
  475. node, &wakeupgen_domain_ops,
  476. NULL);
  477. if (!domain) {
  478. iounmap(wakeupgen_base);
  479. return -ENOMEM;
  480. }
  481. /* Clear all IRQ bitmasks at wakeupGen level */
  482. for (i = 0; i < irq_banks; i++) {
  483. wakeupgen_writel(0, i, CPU0_ID);
  484. if (!soc_is_am43xx())
  485. wakeupgen_writel(0, i, CPU1_ID);
  486. }
  487. /*
  488. * FIXME: Add support to set_smp_affinity() once the core
  489. * GIC code has necessary hooks in place.
  490. */
  491. /* Associate all the IRQs to boot CPU like GIC init does. */
  492. for (i = 0; i < max_irqs; i++)
  493. irq_target_cpu[i] = boot_cpu;
  494. /*
  495. * Enables OMAP5 ES2 PM Mode using ES2_PM_MODE in AMBA_IF_MODE
  496. * 0x0: ES1 behavior, CPU cores would enter and exit OFF mode together.
  497. * 0x1: ES2 behavior, CPU cores are allowed to enter/exit OFF mode
  498. * independently.
  499. * This needs to be set one time thanks to always ON domain.
  500. *
  501. * We do not support ES1 behavior anymore. OMAP5 is assumed to be
  502. * ES2.0, and the same is applicable for DRA7.
  503. */
  504. if (soc_is_omap54xx() || soc_is_dra7xx()) {
  505. val = __raw_readl(wakeupgen_base + OMAP_AMBA_IF_MODE);
  506. val |= BIT(5);
  507. omap_smc1(OMAP5_MON_AMBA_IF_INDEX, val);
  508. }
  509. irq_hotplug_init();
  510. irq_pm_init();
  511. return 0;
  512. }
  513. IRQCHIP_DECLARE(ti_wakeupgen, "ti,omap4-wugen-mpu", wakeupgen_init);