powerpc/mpc85xx: SECURE BOOT - Bypass PAMU in case of secure boot
authorRuchika Gupta <ruchika.gupta@freescale.com>
Mon, 29 Sep 2014 06:05:33 +0000 (11:35 +0530)
committerYork Sun <yorksun@freescale.com>
Thu, 16 Oct 2014 21:17:42 +0000 (14:17 -0700)
By default, PAMU's (IOMMU) are enabled in case of secure boot.
Disable/bypass them once the control reaches the bootloader.

For non-secure boot, PAMU's are already bypassed in the default
SoC configuration.

Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com>
Reviewed-by: York Sun <yorksun@freescale.com>
arch/powerpc/cpu/mpc85xx/cpu_init.c
arch/powerpc/include/asm/immap_85xx.h

index 963e32676b3473fdcb7aafca4474822ba1476786..85d32fc6128558ac8e169dc391b40b54c8d7b7e4 100644 (file)
@@ -426,7 +426,8 @@ ulong cpu_init_f(void)
 {
        ulong flag = 0;
        extern void m8560_cpm_reset (void);
-#ifdef CONFIG_SYS_DCSRBAR_PHYS
+#if defined(CONFIG_SYS_DCSRBAR_PHYS) || \
+       (defined(CONFIG_SECURE_BOOT) && defined(CONFIG_FSL_CORENET))
        ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
 #endif
 #if defined(CONFIG_SECURE_BOOT)
@@ -458,6 +459,12 @@ ulong cpu_init_f(void)
 #if defined(CONFIG_SYS_CPC_REINIT_F)
        disable_cpc_sram();
 #endif
+
+#if defined(CONFIG_FSL_CORENET)
+       /* Put PAMU in bypass mode */
+       out_be32(&gur->pamubypenr, FSL_CORENET_PAMU_BYPASS);
+#endif
+
 #endif
 
 #ifdef CONFIG_CPM2
index 88c1e08df5ecf904220116af1e37bd273b72c8ff..0264523d6402779e094ed5fee993f9fddcc95be0 100644 (file)
@@ -1912,6 +1912,7 @@ defined(CONFIG_PPC_T1020) || defined(CONFIG_PPC_T1022)
        u8      res24[64];
        u32     pblsr;          /* Preboot loader status */
        u32     pamubypenr;     /* PAMU bypass enable */
+#define FSL_CORENET_PAMU_BYPASS                0xffff0000
        u32     dmacr1;         /* DMA control */
        u8      res25[4];
        u32     gensr1;         /* General status */