Lines Matching +full:- +full:sram

1 // SPDX-License-Identifier: GPL-2.0
10 extern void mpc52xx_deep_sleep(void __iomem *sram, void __iomem *sdram_regs,
22 static void __iomem *sram; variable
42 out_8(&gpiow->wkup_gpioe, in_8(&gpiow->wkup_gpioe) | (1 << pin)); in mpc52xx_set_wakeup_gpio()
44 out_8(&gpiow->wkup_ddr, in_8(&gpiow->wkup_ddr) & ~(1 << pin)); in mpc52xx_set_wakeup_gpio()
46 out_8(&gpiow->wkup_inten, in_8(&gpiow->wkup_inten) | (1 << pin)); in mpc52xx_set_wakeup_gpio()
48 tmp = in_be16(&gpiow->wkup_itype); in mpc52xx_set_wakeup_gpio()
51 out_be16(&gpiow->wkup_itype, tmp); in mpc52xx_set_wakeup_gpio()
53 out_8(&gpiow->wkup_maste, 1); in mpc52xx_set_wakeup_gpio()
62 { .compatible = "fsl,mpc5200-immr", }, in mpc52xx_pm_prepare()
63 { .compatible = "fsl,mpc5200b-immr", }, in mpc52xx_pm_prepare()
76 return -ENOSYS; in mpc52xx_pm_prepare()
79 mbar = ioremap(res.start, 0xc000); /* we should map whole region including SRAM */ in mpc52xx_pm_prepare()
84 return -ENOSYS; in mpc52xx_pm_prepare()
91 sram = mbar + 0x8000; /* Those will be handled by the */ in mpc52xx_pm_prepare()
107 return -ENOSYS; in mpc52xx_pm_prepare()
120 char saved_0x500[0x600-0x500]; in mpc52xx_pm_enter()
123 return -ENOMEM; in mpc52xx_pm_enter()
126 intr_main_mask = in_be32(&intr->main_mask); in mpc52xx_pm_enter()
127 out_be32(&intr->main_mask, intr_main_mask | 0x1ffff); in mpc52xx_pm_enter()
132 /* save SRAM */ in mpc52xx_pm_enter()
133 memcpy(saved_sram, sram, sram_size); in mpc52xx_pm_enter()
135 /* copy low level suspend code to sram */ in mpc52xx_pm_enter()
136 memcpy(sram, mpc52xx_ds_sram, mpc52xx_ds_sram_size); in mpc52xx_pm_enter()
138 out_8(&cdm->ccs_sleep_enable, 1); in mpc52xx_pm_enter()
139 out_8(&cdm->osc_sleep_enable, 1); in mpc52xx_pm_enter()
140 out_8(&cdm->ccs_qreq_test, 1); in mpc52xx_pm_enter()
142 /* disable all but SDRAM and bestcomm (SRAM) clocks */ in mpc52xx_pm_enter()
143 clk_enables = in_be32(&cdm->clk_enables); in mpc52xx_pm_enter()
144 out_be32(&cdm->clk_enables, clk_enables & 0x00088000); in mpc52xx_pm_enter()
159 /* call low-level sleep code */ in mpc52xx_pm_enter()
160 mpc52xx_deep_sleep(sram, sdram, cdm, intr); in mpc52xx_pm_enter()
171 out_be32(&cdm->clk_enables, clk_enables); in mpc52xx_pm_enter()
172 out_8(&cdm->ccs_sleep_enable, 0); in mpc52xx_pm_enter()
173 out_8(&cdm->osc_sleep_enable, 0); in mpc52xx_pm_enter()
175 /* restore SRAM */ in mpc52xx_pm_enter()
176 memcpy(sram, saved_sram, sram_size); in mpc52xx_pm_enter()
179 out_be32(&intr->main_mask, intr_main_mask); in mpc52xx_pm_enter()