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 (wakeupgen_ops && wakeupgen_ops->save_context)
  254. wakeupgen_ops->save_context();
  255. }
  256. /*
  257. * Clear WakeupGen SAR backup status.
  258. */
  259. static void irq_sar_clear(void)
  260. {
  261. u32 val;
  262. u32 offset = SAR_BACKUP_STATUS_OFFSET;
  263. /* DRA7 has no SAR to save */
  264. if (soc_is_dra7xx())
  265. return;
  266. if (soc_is_omap54xx())
  267. offset = OMAP5_SAR_BACKUP_STATUS_OFFSET;
  268. val = readl_relaxed(sar_base + offset);
  269. val &= ~SAR_BACKUP_STATUS_WAKEUPGEN;
  270. writel_relaxed(val, sar_base + offset);
  271. }
  272. static void am43xx_irq_restore_context(void)
  273. {
  274. u32 i;
  275. for (i = 0; i < irq_banks; i++)
  276. wakeupgen_writel(wakeupgen_context[i], i, CPU0_ID);
  277. }
  278. static void irq_restore_context(void)
  279. {
  280. if (wakeupgen_ops && wakeupgen_ops->restore_context)
  281. wakeupgen_ops->restore_context();
  282. }
  283. /*
  284. * Save GIC and Wakeupgen interrupt context using secure API
  285. * for HS/EMU devices.
  286. */
  287. static void irq_save_secure_context(void)
  288. {
  289. u32 ret;
  290. ret = omap_secure_dispatcher(OMAP4_HAL_SAVEGIC_INDEX,
  291. FLAG_START_CRITICAL,
  292. 0, 0, 0, 0, 0);
  293. if (ret != API_HAL_RET_VALUE_OK)
  294. pr_err("GIC and Wakeupgen context save failed\n");
  295. }
  296. /* Define ops for context save and restore for each SoC */
  297. static struct omap_wakeupgen_ops omap4_wakeupgen_ops = {
  298. .save_context = omap4_irq_save_context,
  299. .restore_context = irq_sar_clear,
  300. };
  301. static struct omap_wakeupgen_ops omap5_wakeupgen_ops = {
  302. .save_context = omap5_irq_save_context,
  303. .restore_context = irq_sar_clear,
  304. };
  305. static struct omap_wakeupgen_ops am43xx_wakeupgen_ops = {
  306. .save_context = am43xx_irq_save_context,
  307. .restore_context = am43xx_irq_restore_context,
  308. };
  309. #else
  310. static struct omap_wakeupgen_ops omap4_wakeupgen_ops = {};
  311. static struct omap_wakeupgen_ops omap5_wakeupgen_ops = {};
  312. static struct omap_wakeupgen_ops am43xx_wakeupgen_ops = {};
  313. #endif
  314. #ifdef CONFIG_HOTPLUG_CPU
  315. static int omap_wakeupgen_cpu_online(unsigned int cpu)
  316. {
  317. wakeupgen_irqmask_all(cpu, 0);
  318. return 0;
  319. }
  320. static int omap_wakeupgen_cpu_dead(unsigned int cpu)
  321. {
  322. wakeupgen_irqmask_all(cpu, 1);
  323. return 0;
  324. }
  325. static void __init irq_hotplug_init(void)
  326. {
  327. cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN, "arm/omap-wake:online",
  328. omap_wakeupgen_cpu_online, NULL);
  329. cpuhp_setup_state_nocalls(CPUHP_ARM_OMAP_WAKE_DEAD,
  330. "arm/omap-wake:dead", NULL,
  331. omap_wakeupgen_cpu_dead);
  332. }
  333. #else
  334. static void __init irq_hotplug_init(void)
  335. {}
  336. #endif
  337. #ifdef CONFIG_CPU_PM
  338. static int irq_notifier(struct notifier_block *self, unsigned long cmd, void *v)
  339. {
  340. switch (cmd) {
  341. case CPU_CLUSTER_PM_ENTER:
  342. if (omap_type() == OMAP2_DEVICE_TYPE_GP)
  343. irq_save_context();
  344. else
  345. irq_save_secure_context();
  346. break;
  347. case CPU_CLUSTER_PM_EXIT:
  348. if (omap_type() == OMAP2_DEVICE_TYPE_GP)
  349. irq_restore_context();
  350. break;
  351. }
  352. return NOTIFY_OK;
  353. }
  354. static struct notifier_block irq_notifier_block = {
  355. .notifier_call = irq_notifier,
  356. };
  357. static void __init irq_pm_init(void)
  358. {
  359. /* FIXME: Remove this when MPU OSWR support is added */
  360. if (!IS_PM44XX_ERRATUM(PM_OMAP4_CPU_OSWR_DISABLE))
  361. cpu_pm_register_notifier(&irq_notifier_block);
  362. }
  363. #else
  364. static void __init irq_pm_init(void)
  365. {}
  366. #endif
  367. void __iomem *omap_get_wakeupgen_base(void)
  368. {
  369. return wakeupgen_base;
  370. }
  371. int omap_secure_apis_support(void)
  372. {
  373. return omap_secure_apis;
  374. }
  375. static struct irq_chip wakeupgen_chip = {
  376. .name = "WUGEN",
  377. .irq_eoi = irq_chip_eoi_parent,
  378. .irq_mask = wakeupgen_mask,
  379. .irq_unmask = wakeupgen_unmask,
  380. .irq_retrigger = irq_chip_retrigger_hierarchy,
  381. .irq_set_type = irq_chip_set_type_parent,
  382. .flags = IRQCHIP_SKIP_SET_WAKE | IRQCHIP_MASK_ON_SUSPEND,
  383. #ifdef CONFIG_SMP
  384. .irq_set_affinity = irq_chip_set_affinity_parent,
  385. #endif
  386. };
  387. static int wakeupgen_domain_translate(struct irq_domain *d,
  388. struct irq_fwspec *fwspec,
  389. unsigned long *hwirq,
  390. unsigned int *type)
  391. {
  392. if (is_of_node(fwspec->fwnode)) {
  393. if (fwspec->param_count != 3)
  394. return -EINVAL;
  395. /* No PPI should point to this domain */
  396. if (fwspec->param[0] != 0)
  397. return -EINVAL;
  398. *hwirq = fwspec->param[1];
  399. *type = fwspec->param[2];
  400. return 0;
  401. }
  402. return -EINVAL;
  403. }
  404. static int wakeupgen_domain_alloc(struct irq_domain *domain,
  405. unsigned int virq,
  406. unsigned int nr_irqs, void *data)
  407. {
  408. struct irq_fwspec *fwspec = data;
  409. struct irq_fwspec parent_fwspec;
  410. irq_hw_number_t hwirq;
  411. int i;
  412. if (fwspec->param_count != 3)
  413. return -EINVAL; /* Not GIC compliant */
  414. if (fwspec->param[0] != 0)
  415. return -EINVAL; /* No PPI should point to this domain */
  416. hwirq = fwspec->param[1];
  417. if (hwirq >= MAX_IRQS)
  418. return -EINVAL; /* Can't deal with this */
  419. for (i = 0; i < nr_irqs; i++)
  420. irq_domain_set_hwirq_and_chip(domain, virq + i, hwirq + i,
  421. &wakeupgen_chip, NULL);
  422. parent_fwspec = *fwspec;
  423. parent_fwspec.fwnode = domain->parent->fwnode;
  424. return irq_domain_alloc_irqs_parent(domain, virq, nr_irqs,
  425. &parent_fwspec);
  426. }
  427. static const struct irq_domain_ops wakeupgen_domain_ops = {
  428. .translate = wakeupgen_domain_translate,
  429. .alloc = wakeupgen_domain_alloc,
  430. .free = irq_domain_free_irqs_common,
  431. };
  432. /*
  433. * Initialise the wakeupgen module.
  434. */
  435. static int __init wakeupgen_init(struct device_node *node,
  436. struct device_node *parent)
  437. {
  438. struct irq_domain *parent_domain, *domain;
  439. int i;
  440. unsigned int boot_cpu = smp_processor_id();
  441. u32 val;
  442. if (!parent) {
  443. pr_err("%pOF: no parent, giving up\n", node);
  444. return -ENODEV;
  445. }
  446. parent_domain = irq_find_host(parent);
  447. if (!parent_domain) {
  448. pr_err("%pOF: unable to obtain parent domain\n", node);
  449. return -ENXIO;
  450. }
  451. /* Not supported on OMAP4 ES1.0 silicon */
  452. if (omap_rev() == OMAP4430_REV_ES1_0) {
  453. WARN(1, "WakeupGen: Not supported on OMAP4430 ES1.0\n");
  454. return -EPERM;
  455. }
  456. /* Static mapping, never released */
  457. wakeupgen_base = of_iomap(node, 0);
  458. if (WARN_ON(!wakeupgen_base))
  459. return -ENOMEM;
  460. if (cpu_is_omap44xx()) {
  461. irq_banks = OMAP4_NR_BANKS;
  462. max_irqs = OMAP4_NR_IRQS;
  463. omap_secure_apis = 1;
  464. wakeupgen_ops = &omap4_wakeupgen_ops;
  465. } else if (soc_is_omap54xx()) {
  466. wakeupgen_ops = &omap5_wakeupgen_ops;
  467. } else if (soc_is_am43xx()) {
  468. irq_banks = AM43XX_NR_REG_BANKS;
  469. max_irqs = AM43XX_IRQS;
  470. wakeupgen_ops = &am43xx_wakeupgen_ops;
  471. }
  472. domain = irq_domain_add_hierarchy(parent_domain, 0, max_irqs,
  473. node, &wakeupgen_domain_ops,
  474. NULL);
  475. if (!domain) {
  476. iounmap(wakeupgen_base);
  477. return -ENOMEM;
  478. }
  479. /* Clear all IRQ bitmasks at wakeupGen level */
  480. for (i = 0; i < irq_banks; i++) {
  481. wakeupgen_writel(0, i, CPU0_ID);
  482. if (!soc_is_am43xx())
  483. wakeupgen_writel(0, i, CPU1_ID);
  484. }
  485. /*
  486. * FIXME: Add support to set_smp_affinity() once the core
  487. * GIC code has necessary hooks in place.
  488. */
  489. /* Associate all the IRQs to boot CPU like GIC init does. */
  490. for (i = 0; i < max_irqs; i++)
  491. irq_target_cpu[i] = boot_cpu;
  492. /*
  493. * Enables OMAP5 ES2 PM Mode using ES2_PM_MODE in AMBA_IF_MODE
  494. * 0x0: ES1 behavior, CPU cores would enter and exit OFF mode together.
  495. * 0x1: ES2 behavior, CPU cores are allowed to enter/exit OFF mode
  496. * independently.
  497. * This needs to be set one time thanks to always ON domain.
  498. *
  499. * We do not support ES1 behavior anymore. OMAP5 is assumed to be
  500. * ES2.0, and the same is applicable for DRA7.
  501. */
  502. if (soc_is_omap54xx() || soc_is_dra7xx()) {
  503. val = __raw_readl(wakeupgen_base + OMAP_AMBA_IF_MODE);
  504. val |= BIT(5);
  505. omap_smc1(OMAP5_MON_AMBA_IF_INDEX, val);
  506. }
  507. irq_hotplug_init();
  508. irq_pm_init();
  509. sar_base = omap4_get_sar_ram_base();
  510. return 0;
  511. }
  512. IRQCHIP_DECLARE(ti_wakeupgen, "ti,omap4-wugen-mpu", wakeupgen_init);