]> git.sur5r.net Git - u-boot/blobdiff - arch/powerpc/cpu/mpc8xxx/srio.c
arch/powerpc/cpu/mpc8xxx/: sparse fixes
[u-boot] / arch / powerpc / cpu / mpc8xxx / srio.c
index e7ff59a1ca963aa06eb8574630135ee649f7e024..6e6f7dcc3fd927a96383b6b457620f82d1d49296 100644 (file)
@@ -24,6 +24,7 @@
 #include <asm/fsl_srio.h>
 #include <asm/errno.h>
 
+#ifdef CONFIG_SYS_FSL_SRIO_PCIE_BOOT_MASTER
 #define SRIO_PORT_ACCEPT_ALL 0x10000001
 #define SRIO_IB_ATMU_AR 0x80f55000
 #define SRIO_OB_ATMU_AR_MAINT 0x80077000
 #define SRIO_MAINT_WIN_SIZE 0x1000000 /* 16M */
 #define SRIO_RW_WIN_SIZE 0x100000 /* 1M */
 #define SRIO_LCSBA1CSR 0x60000000
+#endif
 
 #if defined(CONFIG_FSL_CORENET)
+#ifdef CONFIG_SYS_FSL_QORIQ_CHASSIS2
+       #define _DEVDISR_SRIO1 FSL_CORENET_DEVDISR3_SRIO1
+       #define _DEVDISR_SRIO2 FSL_CORENET_DEVDISR3_SRIO2
+#else
        #define _DEVDISR_SRIO1 FSL_CORENET_DEVDISR_SRIO1
        #define _DEVDISR_SRIO2 FSL_CORENET_DEVDISR_SRIO2
+#endif
        #define _DEVDISR_RMU   FSL_CORENET_DEVDISR_RMU
        #define CONFIG_SYS_MPC8xxx_GUTS_ADDR CONFIG_SYS_MPC85xx_GUTS_ADDR
 #elif defined(CONFIG_MPC85xx)
@@ -236,7 +243,13 @@ void srio_init(void)
 {
        ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC8xxx_GUTS_ADDR;
        int srio1_used = 0, srio2_used = 0;
+       u32 *devdisr;
 
+#ifdef CONFIG_SYS_FSL_QORIQ_CHASSIS2
+       devdisr = &gur->devdisr3;
+#else
+       devdisr = &gur->devdisr;
+#endif
        if (is_serdes_configured(SRIO1)) {
                set_next_law(CONFIG_SYS_SRIO1_MEM_PHYS,
                                law_size_bits(CONFIG_SYS_SRIO1_MEM_SIZE),
@@ -273,20 +286,20 @@ void srio_init(void)
 #ifdef CONFIG_FSL_CORENET
        /* On FSL_CORENET devices we can disable individual ports */
        if (!srio1_used)
-               setbits_be32(&gur->devdisr, FSL_CORENET_DEVDISR_SRIO1);
+               setbits_be32(devdisr, _DEVDISR_SRIO1);
        if (!srio2_used)
-               setbits_be32(&gur->devdisr, FSL_CORENET_DEVDISR_SRIO2);
+               setbits_be32(devdisr, _DEVDISR_SRIO2);
 #endif
 
        /* neither port is used - disable everything */
        if (!srio1_used && !srio2_used) {
-               setbits_be32(&gur->devdisr, _DEVDISR_SRIO1);
-               setbits_be32(&gur->devdisr, _DEVDISR_SRIO2);
-               setbits_be32(&gur->devdisr, _DEVDISR_RMU);
+               setbits_be32(devdisr, _DEVDISR_SRIO1);
+               setbits_be32(devdisr, _DEVDISR_SRIO2);
+               setbits_be32(devdisr, _DEVDISR_RMU);
        }
 }
 
-#ifdef CONFIG_FSL_CORENET
+#ifdef CONFIG_SYS_FSL_SRIO_PCIE_BOOT_MASTER
 void srio_boot_master(int port)
 {
        struct ccsr_rio *srio = (void *)CONFIG_SYS_FSL_SRIO_ADDR;