From 06e550cd3103e4840ad49f23a2f4089a76b0a016 Mon Sep 17 00:00:00 2001 From: Anson Huang Date: Thu, 14 Jun 2018 13:25:33 +0800 Subject: imx8qxp: support MU power off during suspend Add MU power off support for suspend, it needs to be re-initialized after system resume. Signed-off-by: Anson Huang --- plat/imx/common/sci/mx8_mu.c | 16 ++++++++++++++++ plat/imx/common/sci/mx8_mu.h | 1 + 2 files changed, 17 insertions(+) (limited to 'plat/imx/common') diff --git a/plat/imx/common/sci/mx8_mu.c b/plat/imx/common/sci/mx8_mu.c index b2dbfc23..8b865375 100644 --- a/plat/imx/common/sci/mx8_mu.c +++ b/plat/imx/common/sci/mx8_mu.c @@ -55,3 +55,19 @@ void MU_Init(uint32_t base) | MU_CR_GIRn_MASK1 | MU_CR_Fn_MASK1); mmio_write_32(base + MU_ACR_OFFSET1, reg); } + +void MU_Resume(uint32_t base) +{ + uint32_t reg, i; + + reg = mmio_read_32(base + MU_ACR_OFFSET1); + /* Clear GIEn, RIEn, TIEn, GIRn and ABFn. */ + reg &= ~(MU_CR_GIEn_MASK1 | MU_CR_RIEn_MASK1 | MU_CR_TIEn_MASK1 + | MU_CR_GIRn_MASK1 | MU_CR_Fn_MASK1); + mmio_write_32(base + MU_ACR_OFFSET1, reg); + + /* Enable all RX interrupts */ + for (i = 0; i < MU_RR_COUNT; i++) { + MU_EnableRxFullInt(base, i); + } +} diff --git a/plat/imx/common/sci/mx8_mu.h b/plat/imx/common/sci/mx8_mu.h index 369ae926..9845e648 100644 --- a/plat/imx/common/sci/mx8_mu.h +++ b/plat/imx/common/sci/mx8_mu.h @@ -33,3 +33,4 @@ void MU_SendMessage(uint32_t base, uint32_t regIndex, uint32_t msg); void MU_ReceiveMsg(uint32_t base, uint32_t regIndex, uint32_t *msg); void MU_EnableGeneralInt(uint32_t base, uint32_t index); void MU_EnableRxFullInt(uint32_t base, uint32_t index); +void MU_Resume(uint32_t base); -- cgit v1.2.3