Lines Matching +full:- +full:sram

1 // SPDX-License-Identifier: GPL-2.0
12 extern void mpc52xx_deep_sleep(void __iomem *sram, void __iomem *sdram_regs,
24 static void __iomem *sram; variable
44 out_8(&gpiow->wkup_gpioe, in_8(&gpiow->wkup_gpioe) | (1 << pin)); in mpc52xx_set_wakeup_gpio()
46 out_8(&gpiow->wkup_ddr, in_8(&gpiow->wkup_ddr) & ~(1 << pin)); in mpc52xx_set_wakeup_gpio()
48 out_8(&gpiow->wkup_inten, in_8(&gpiow->wkup_inten) | (1 << pin)); in mpc52xx_set_wakeup_gpio()
50 tmp = in_be16(&gpiow->wkup_itype); in mpc52xx_set_wakeup_gpio()
53 out_be16(&gpiow->wkup_itype, tmp); in mpc52xx_set_wakeup_gpio()
55 out_8(&gpiow->wkup_maste, 1); in mpc52xx_set_wakeup_gpio()
64 { .compatible = "fsl,mpc5200-immr", }, in mpc52xx_pm_prepare()
65 { .compatible = "fsl,mpc5200b-immr", }, in mpc52xx_pm_prepare()
78 return -ENOSYS; in mpc52xx_pm_prepare()
81 mbar = ioremap(res.start, 0xc000); /* we should map whole region including SRAM */ in mpc52xx_pm_prepare()
86 return -ENOSYS; in mpc52xx_pm_prepare()
93 sram = mbar + 0x8000; /* Those will be handled by the */ in mpc52xx_pm_prepare()
109 return -ENOSYS; in mpc52xx_pm_prepare()
122 char saved_0x500[0x600-0x500]; in mpc52xx_pm_enter()
125 return -ENOMEM; in mpc52xx_pm_enter()
128 intr_main_mask = in_be32(&intr->main_mask); in mpc52xx_pm_enter()
129 out_be32(&intr->main_mask, intr_main_mask | 0x1ffff); in mpc52xx_pm_enter()
134 /* save SRAM */ in mpc52xx_pm_enter()
135 memcpy(saved_sram, sram, sram_size); in mpc52xx_pm_enter()
137 /* copy low level suspend code to sram */ in mpc52xx_pm_enter()
138 memcpy(sram, mpc52xx_ds_sram, mpc52xx_ds_sram_size); in mpc52xx_pm_enter()
140 out_8(&cdm->ccs_sleep_enable, 1); in mpc52xx_pm_enter()
141 out_8(&cdm->osc_sleep_enable, 1); in mpc52xx_pm_enter()
142 out_8(&cdm->ccs_qreq_test, 1); in mpc52xx_pm_enter()
144 /* disable all but SDRAM and bestcomm (SRAM) clocks */ in mpc52xx_pm_enter()
145 clk_enables = in_be32(&cdm->clk_enables); in mpc52xx_pm_enter()
146 out_be32(&cdm->clk_enables, clk_enables & 0x00088000); in mpc52xx_pm_enter()
161 /* call low-level sleep code */ in mpc52xx_pm_enter()
162 mpc52xx_deep_sleep(sram, sdram, cdm, intr); in mpc52xx_pm_enter()
173 out_be32(&cdm->clk_enables, clk_enables); in mpc52xx_pm_enter()
174 out_8(&cdm->ccs_sleep_enable, 0); in mpc52xx_pm_enter()
175 out_8(&cdm->osc_sleep_enable, 0); in mpc52xx_pm_enter()
177 /* restore SRAM */ in mpc52xx_pm_enter()
178 memcpy(sram, saved_sram, sram_size); in mpc52xx_pm_enter()
181 out_be32(&intr->main_mask, intr_main_mask); in mpc52xx_pm_enter()