leon_pmc.c (cdd38c5f1ce4398ec58fec95904b75824daab7b5) leon_pmc.c (89b3098703bd2aa3237ef10a704e6a5838e6ea69)
1// SPDX-License-Identifier: GPL-2.0
2/* leon_pmc.c: LEON Power-down cpu_idle() handler
3 *
4 * Copyright (C) 2011 Daniel Hellstrom (daniel@gaisler.com) Aeroflex Gaisler AB
5 */
6
7#include <linux/init.h>
8#include <linux/pm.h>

--- 43 unchanged lines hidden (view full) ---

52 /* Interrupts need to be enabled to not hang the CPU */
53 raw_local_irq_enable();
54
55 __asm__ __volatile__ (
56 "wr %%g0, %%asr19\n"
57 "lda [%0] %1, %%g0\n"
58 :
59 : "r"(address), "i"(ASI_LEON_BYPASS));
1// SPDX-License-Identifier: GPL-2.0
2/* leon_pmc.c: LEON Power-down cpu_idle() handler
3 *
4 * Copyright (C) 2011 Daniel Hellstrom (daniel@gaisler.com) Aeroflex Gaisler AB
5 */
6
7#include <linux/init.h>
8#include <linux/pm.h>

--- 43 unchanged lines hidden (view full) ---

52 /* Interrupts need to be enabled to not hang the CPU */
53 raw_local_irq_enable();
54
55 __asm__ __volatile__ (
56 "wr %%g0, %%asr19\n"
57 "lda [%0] %1, %%g0\n"
58 :
59 : "r"(address), "i"(ASI_LEON_BYPASS));
60
61 raw_local_irq_disable();
60}
61
62/*
63 * CPU idle callback function
64 * See .../arch/sparc/kernel/process.c
65 */
66static void pmc_leon_idle(void)
67{
68 /* Interrupts need to be enabled to not hang the CPU */
69 raw_local_irq_enable();
70
71 /* For systems without power-down, this will be no-op */
72 __asm__ __volatile__ ("wr %g0, %asr19\n\t");
62}
63
64/*
65 * CPU idle callback function
66 * See .../arch/sparc/kernel/process.c
67 */
68static void pmc_leon_idle(void)
69{
70 /* Interrupts need to be enabled to not hang the CPU */
71 raw_local_irq_enable();
72
73 /* For systems without power-down, this will be no-op */
74 __asm__ __volatile__ ("wr %g0, %asr19\n\t");
75
76 raw_local_irq_disable();
73}
74
75/* Install LEON Power Down function */
76static int __init leon_pmc_install(void)
77{
78 if (sparc_cpu_model == sparc_leon) {
79 /* Assign power management IDLE handler */
80 if (pmc_leon_need_fixup())

--- 14 unchanged lines hidden ---
77}
78
79/* Install LEON Power Down function */
80static int __init leon_pmc_install(void)
81{
82 if (sparc_cpu_model == sparc_leon) {
83 /* Assign power management IDLE handler */
84 if (pmc_leon_need_fixup())

--- 14 unchanged lines hidden ---