mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-26 06:50:10 +00:00
Merge "feat(imx8m): move the gpc reg & macro to a separate header file" into integration
This commit is contained in:
commit
117b357260
2 changed files with 9 additions and 59 deletions
plat/imx/imx8m
|
@ -8,14 +8,12 @@
|
|||
#include <lib/mmio.h>
|
||||
|
||||
#include <dram.h>
|
||||
#include <gpc_reg.h>
|
||||
#include <platform_def.h>
|
||||
|
||||
#define SRC_DDR1_RCR (IMX_SRC_BASE + 0x1000)
|
||||
#define SRC_DDR2_RCR (IMX_SRC_BASE + 0x1004)
|
||||
|
||||
#define PU_PGC_UP_TRG 0xf8
|
||||
#define PU_PGC_DN_TRG 0x104
|
||||
#define GPC_PU_PWRHSK (IMX_GPC_BASE + 0x01FC)
|
||||
#define CCM_SRC_CTRL_OFFSET (IMX_CCM_BASE + 0x800)
|
||||
#define CCM_CCGR_OFFSET (IMX_CCM_BASE + 0x4000)
|
||||
#define CCM_TARGET_ROOT_OFFSET (IMX_CCM_BASE + 0x8000)
|
||||
|
@ -102,21 +100,12 @@ void dram_enter_retention(void)
|
|||
}
|
||||
dwc_ddrphy_apb_wr(0xd0000, 0x1);
|
||||
|
||||
#if defined(PLAT_imx8mq)
|
||||
/* pwrdnreqn_async adbm/adbs of ddr */
|
||||
mmio_clrbits_32(GPC_PU_PWRHSK, BIT(1));
|
||||
while (mmio_read_32(GPC_PU_PWRHSK) & BIT(18)) {
|
||||
mmio_clrbits_32(IMX_GPC_BASE + GPC_PU_PWRHSK, DDRMIX_ADB400_SYNC);
|
||||
while (mmio_read_32(IMX_GPC_BASE + GPC_PU_PWRHSK) & DDRMIX_ADB400_ACK)
|
||||
;
|
||||
}
|
||||
mmio_setbits_32(GPC_PU_PWRHSK, BIT(1));
|
||||
#else
|
||||
/* pwrdnreqn_async adbm/adbs of ddr */
|
||||
mmio_clrbits_32(GPC_PU_PWRHSK, BIT(2));
|
||||
while (mmio_read_32(GPC_PU_PWRHSK) & BIT(20)) {
|
||||
;
|
||||
}
|
||||
mmio_setbits_32(GPC_PU_PWRHSK, BIT(2));
|
||||
#endif
|
||||
mmio_setbits_32(IMX_GPC_BASE + GPC_PU_PWRHSK, DDRMIX_ADB400_SYNC);
|
||||
|
||||
/* remove PowerOk */
|
||||
mmio_write_32(SRC_DDR1_RCR, 0x8F000008);
|
||||
|
||||
|
@ -124,8 +113,8 @@ void dram_enter_retention(void)
|
|||
mmio_write_32(CCM_SRC_CTRL(15), 2);
|
||||
|
||||
/* enable the phy iso */
|
||||
mmio_setbits_32(IMX_GPC_BASE + 0xd40, 1);
|
||||
mmio_setbits_32(IMX_GPC_BASE + PU_PGC_DN_TRG, BIT(5));
|
||||
mmio_setbits_32(IMX_GPC_BASE + DDRMIX_PGC, 1);
|
||||
mmio_setbits_32(IMX_GPC_BASE + PU_PGC_DN_TRG, DDRMIX_PWR_REQ);
|
||||
|
||||
VERBOSE("dram enter retention\n");
|
||||
}
|
||||
|
@ -150,7 +139,7 @@ void dram_exit_retention(void)
|
|||
mmio_write_32(CCM_TARGET_ROOT(65) + 0x4, (0x4 << 24) | (0x3 << 16));
|
||||
|
||||
/* disable iso */
|
||||
mmio_setbits_32(IMX_GPC_BASE + PU_PGC_UP_TRG, BIT(5));
|
||||
mmio_setbits_32(IMX_GPC_BASE + PU_PGC_UP_TRG, DDRMIX_PWR_REQ);
|
||||
mmio_write_32(SRC_DDR1_RCR, 0x8F000006);
|
||||
|
||||
/* wait dram pll locked */
|
||||
|
|
|
@ -19,46 +19,7 @@
|
|||
#include <gpc.h>
|
||||
#include <imx_sip_svc.h>
|
||||
|
||||
#define MIPI_PWR_REQ BIT(0)
|
||||
#define PCIE_PWR_REQ BIT(1)
|
||||
#define OTG1_PWR_REQ BIT(2)
|
||||
#define OTG2_PWR_REQ BIT(3)
|
||||
#define HSIOMIX_PWR_REQ BIT(4)
|
||||
#define GPU2D_PWR_REQ BIT(6)
|
||||
#define GPUMIX_PWR_REQ BIT(7)
|
||||
#define VPUMIX_PWR_REQ BIT(8)
|
||||
#define GPU3D_PWR_REQ BIT(9)
|
||||
#define DISPMIX_PWR_REQ BIT(10)
|
||||
#define VPU_G1_PWR_REQ BIT(11)
|
||||
#define VPU_G2_PWR_REQ BIT(12)
|
||||
#define VPU_H1_PWR_REQ BIT(13)
|
||||
|
||||
#define HSIOMIX_ADB400_SYNC (0x3 << 5)
|
||||
#define DISPMIX_ADB400_SYNC BIT(7)
|
||||
#define VPUMIX_ADB400_SYNC BIT(8)
|
||||
#define GPU3D_ADB400_SYNC BIT(9)
|
||||
#define GPU2D_ADB400_SYNC BIT(10)
|
||||
#define GPUMIX_ADB400_SYNC BIT(11)
|
||||
#define HSIOMIX_ADB400_ACK (0x3 << 23)
|
||||
#define DISPMIX_ADB400_ACK BIT(25)
|
||||
#define VPUMIX_ADB400_ACK BIT(26)
|
||||
#define GPU3D_ADB400_ACK BIT(27)
|
||||
#define GPU2D_ADB400_ACK BIT(28)
|
||||
#define GPUMIX_ADB400_ACK BIT(29)
|
||||
|
||||
#define MIPI_PGC 0xc00
|
||||
#define PCIE_PGC 0xc40
|
||||
#define OTG1_PGC 0xc80
|
||||
#define OTG2_PGC 0xcc0
|
||||
#define HSIOMIX_PGC 0xd00
|
||||
#define GPU2D_PGC 0xd80
|
||||
#define GPUMIX_PGC 0xdc0
|
||||
#define VPUMIX_PGC 0xe00
|
||||
#define GPU3D_PGC 0xe40
|
||||
#define DISPMIX_PGC 0xe80
|
||||
#define VPU_G1_PGC 0xec0
|
||||
#define VPU_G2_PGC 0xf00
|
||||
#define VPU_H1_PGC 0xf40
|
||||
#define CCGR(x) (0x4000 + (x) * 16)
|
||||
|
||||
enum pu_domain_id {
|
||||
HSIOMIX,
|
||||
|
|
Loading…
Add table
Reference in a new issue