]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
fsl-layerscape: Consolidate registers space defination for CCI-400 bus
authorAshish Kumar <Ashish.Kumar@nxp.com>
Fri, 11 Aug 2017 05:39:14 +0000 (11:09 +0530)
committerYork Sun <york.sun@nxp.com>
Mon, 11 Sep 2017 14:55:36 +0000 (07:55 -0700)
CoreLink Cache Coherent Interconnect (CCI) provides full cache
coherency between two clusters of multi-core CPUs and I/O coherency
for devices and I/O masters.

This patch add new config option SYS_FSL_HAS_CCI400 and moves
existing register space definaton of CCI-400 bus to fsl_immap to be
shared. CONFIG_SYS_CCI400_ADDR is replaced with SYS_CCI400_OFFSET
in Kconfig.

Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
[YS: revised commit message, squashed patches for armv8 and armv7]
Reviewed-by: York Sun <york.sun@nxp.com>
15 files changed:
README
arch/arm/cpu/armv7/ls102xa/Kconfig
arch/arm/cpu/armv7/ls102xa/soc.c
arch/arm/cpu/armv8/fsl-layerscape/Kconfig
arch/arm/cpu/armv8/fsl-layerscape/cpu.c
arch/arm/cpu/armv8/fsl-layerscape/soc.c
arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
arch/arm/include/asm/arch-ls102xa/config.h
arch/arm/include/asm/arch-ls102xa/immap_ls102xa.h
board/freescale/ls1012afrdm/ls1012afrdm.c
board/freescale/ls1012aqds/ls1012aqds.c
board/freescale/ls1012ardb/ls1012ardb.c
board/freescale/ls1021aqds/ls1021aqds.c
include/fsl_immap.h
scripts/config_whitelist.txt

diff --git a/README b/README
index a46850c8085d5ced315e54cea8e18269367687a5..c0c8b559f9bcac54a706cad7f4adf0a70550b1a2 100644 (file)
--- a/README
+++ b/README
@@ -312,6 +312,15 @@ Many of the options are named exactly as the corresponding Linux
 kernel configuration options. The intention is to make it easier to
 build a config tool - later.
 
+- ARM Platform Bus Type(CCI):
+               CoreLink Cache Coherent Interconnect (CCI) is ARM BUS which
+               provides full cache coherency between two clusters of multi-core
+               CPUs and I/O coherency for devices and I/O masters
+
+               CONFIG_SYS_FSL_HAS_CCI400
+
+               Defined For SoC that has cache coherent interconnect
+               CCN-400
 
 The following options need to be configured:
 
index fadfce4f05a2e8c1da107a508f7767a3e23bc149..90d99e6cc30ed05e1b44cd2b6b7b7446e2216774 100644 (file)
@@ -5,6 +5,7 @@ config ARCH_LS1021A
        select SYS_FSL_ERRATUM_A009663
        select SYS_FSL_ERRATUM_A009942
        select SYS_FSL_ERRATUM_A010315
+       select SYS_FSL_HAS_CCI400
        select SYS_FSL_SRDS_1
        select SYS_HAS_SERDES
        select SYS_FSL_DDR_BE if SYS_FSL_DDR
@@ -49,9 +50,20 @@ config SECURE_BOOT
                Enable Freescale Secure Boot feature. Normally selected
                by defconfig. If unsure, do not change.
 
+config SYS_CCI400_OFFSET
+       hex "Offset for CCI400 base"
+       depends on SYS_FSL_HAS_CCI400
+       default 0x180000
+       help
+         Offset for CCI400 base.
+         CCI400 base addr = CCSRBAR + CCI400_OFFSET
+
 config SYS_FSL_ERRATUM_A010315
        bool "Workaround for PCIe erratum A010315"
 
+config SYS_FSL_HAS_CCI400
+       bool
+
 config SYS_FSL_SRDS_1
        bool
 
index b84a1a686a460c845f7ae406f43cd4f47d411858..c043b82ab7884fec9a62179132fab3288a556521 100644 (file)
@@ -80,7 +80,8 @@ void erratum_a010315(void)
 int arch_soc_init(void)
 {
        struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR;
-       struct ccsr_cci400 *cci = (struct ccsr_cci400 *)CONFIG_SYS_CCI400_ADDR;
+       struct ccsr_cci400 *cci = (struct ccsr_cci400 *)(CONFIG_SYS_IMMR +
+                                       CONFIG_SYS_CCI400_OFFSET);
        unsigned int major;
 
 #ifdef CONFIG_LAYERSCAPE_NS_ACCESS
index cdeef26fe5d4fd27f4ab55bd81070f1ea96232ae..3e02132537fb1c35a162500bb09afcb03264a958 100644 (file)
@@ -85,6 +85,7 @@ config ARCH_LS2080A
 
 config FSL_LSCH2
        bool
+       select SYS_FSL_HAS_CCI400
        select SYS_FSL_HAS_SEC
        select SYS_FSL_SEC_COMPAT_5
        select SYS_FSL_SEC_BE
@@ -248,6 +249,15 @@ config QSPI_AHB_INIT
          But some QSPI flash size up to 64MBytes, so initialize the QSPI AHB
          bus for those flashes to support the full QSPI flash size.
 
+config SYS_CCI400_OFFSET
+       hex "Offset for CCI400 base"
+       depends on SYS_FSL_HAS_CCI400
+       default 0x3090000 if ARCH_LS1088A
+       default 0x180000 if FSL_LSCH2
+       help
+         Offset for CCI400 base
+         CCI400 base addr = CCSRBAR + CCI400_OFFSET
+
 config SYS_FSL_IFC_BANK_COUNT
        int "Maximum banks of Integrated flash controller"
        depends on ARCH_LS1043A || ARCH_LS1046A || ARCH_LS2080A
@@ -255,6 +265,9 @@ config SYS_FSL_IFC_BANK_COUNT
        default 4 if ARCH_LS1046A
        default 8 if ARCH_LS2080A
 
+config SYS_FSL_HAS_CCI400
+       bool
+
 config SYS_FSL_HAS_DP_DDR
        bool
 
index c6fede31bab73d06aaf36b35aceda16dd915164e..ec5806517a8345104dc42b364f3e51db5cdb728e 100644 (file)
@@ -16,6 +16,7 @@
 #include <asm/arch/soc.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/speed.h>
+#include <fsl_immap.h>
 #include <asm/arch/mp.h>
 #include <efi_loader.h>
 #include <fm_eth.h>
index 639e9d2ddc8d643904f22872b42fbd21a66d29ff..339ff0c4c708e6047da60d718f54e341a24b3402 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <fsl_immap.h>
 #include <fsl_ifc.h>
 #include <ahci.h>
 #include <scsi.h>
@@ -285,7 +286,8 @@ static void erratum_a008850_early(void)
 {
 #ifdef CONFIG_SYS_FSL_ERRATUM_A008850
        /* part 1 of 2 */
-       struct ccsr_cci400 __iomem *cci = (void *)CONFIG_SYS_CCI400_ADDR;
+       struct ccsr_cci400 __iomem *cci = (void *)(CONFIG_SYS_IMMR +
+                                               CONFIG_SYS_CCI400_OFFSET);
        struct ccsr_ddr __iomem *ddr = (void *)CONFIG_SYS_FSL_DDR_ADDR;
 
        /* Skip if running at lower exception level */
@@ -304,7 +306,8 @@ void erratum_a008850_post(void)
 {
 #ifdef CONFIG_SYS_FSL_ERRATUM_A008850
        /* part 2 of 2 */
-       struct ccsr_cci400 __iomem *cci = (void *)CONFIG_SYS_CCI400_ADDR;
+       struct ccsr_cci400 __iomem *cci = (void *)(CONFIG_SYS_IMMR +
+                                               CONFIG_SYS_CCI400_OFFSET);
        struct ccsr_ddr __iomem *ddr = (void *)CONFIG_SYS_FSL_DDR_ADDR;
        u32 tmp;
 
@@ -439,7 +442,8 @@ int setup_chip_volt(void)
 
 void fsl_lsch2_early_init_f(void)
 {
-       struct ccsr_cci400 *cci = (struct ccsr_cci400 *)CONFIG_SYS_CCI400_ADDR;
+       struct ccsr_cci400 *cci = (struct ccsr_cci400 *)(CONFIG_SYS_IMMR +
+                                       CONFIG_SYS_CCI400_OFFSET);
        struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR;
 
 #ifdef CONFIG_LAYERSCAPE_NS_ACCESS
index 4afc338b8e7ca28e3679e865e65e6d6f496c9144..f169724379a02ae9846fb978be1eaa129adf3da2 100644 (file)
@@ -15,7 +15,6 @@
 #define CONFIG_SYS_DCSR_COP_CCP_ADDR   (CONFIG_SYS_DCSRBAR + 0x02008040)
 
 #define CONFIG_SYS_FSL_DDR_ADDR                        (CONFIG_SYS_IMMR + 0x00080000)
-#define CONFIG_SYS_CCI400_ADDR                 (CONFIG_SYS_IMMR + 0x00180000)
 #define CONFIG_SYS_GIC400_ADDR                 (CONFIG_SYS_IMMR + 0x00400000)
 #define CONFIG_SYS_IFC_ADDR                    (CONFIG_SYS_IMMR + 0x00530000)
 #define SYS_FSL_QSPI_ADDR                      (CONFIG_SYS_IMMR + 0x00550000)
@@ -544,54 +543,6 @@ struct ccsr_serdes {
        u8      res_19a0[0x2000-0x19a0];        /* from 0x19a0 to 0x1fff */
 };
 
-#define CCI400_CTRLORD_TERM_BARRIER    0x00000008
-#define CCI400_CTRLORD_EN_BARRIER      0
-#define CCI400_SHAORD_NON_SHAREABLE    0x00000002
-#define CCI400_DVM_MESSAGE_REQ_EN      0x00000002
-#define CCI400_SNOOP_REQ_EN            0x00000001
-
-/* CCI-400 registers */
-struct ccsr_cci400 {
-       u32 ctrl_ord;                   /* Control Override */
-       u32 spec_ctrl;                  /* Speculation Control */
-       u32 secure_access;              /* Secure Access */
-       u32 status;                     /* Status */
-       u32 impr_err;                   /* Imprecise Error */
-       u8 res_14[0x100 - 0x14];
-       u32 pmcr;                       /* Performance Monitor Control */
-       u8 res_104[0xfd0 - 0x104];
-       u32 pid[8];                     /* Peripheral ID */
-       u32 cid[4];                     /* Component ID */
-       struct {
-               u32 snoop_ctrl;         /* Snoop Control */
-               u32 sha_ord;            /* Shareable Override */
-               u8 res_1008[0x1100 - 0x1008];
-               u32 rc_qos_ord;         /* read channel QoS Value Override */
-               u32 wc_qos_ord;         /* read channel QoS Value Override */
-               u8 res_1108[0x110c - 0x1108];
-               u32 qos_ctrl;           /* QoS Control */
-               u32 max_ot;             /* Max OT */
-               u8 res_1114[0x1130 - 0x1114];
-               u32 target_lat;         /* Target Latency */
-               u32 latency_regu;       /* Latency Regulation */
-               u32 qos_range;          /* QoS Range */
-               u8 res_113c[0x2000 - 0x113c];
-       } slave[5];                     /* Slave Interface */
-       u8 res_6000[0x9004 - 0x6000];
-       u32 cycle_counter;              /* Cycle counter */
-       u32 count_ctrl;                 /* Count Control */
-       u32 overflow_status;            /* Overflow Flag Status */
-       u8 res_9010[0xa000 - 0x9010];
-       struct {
-               u32 event_select;       /* Event Select */
-               u32 event_count;        /* Event Count */
-               u32 counter_ctrl;       /* Counter Control */
-               u32 overflow_status;    /* Overflow Flag Status */
-               u8 res_a010[0xb000 - 0xa010];
-       } pcounter[4];                  /* Performance Counter */
-       u8 res_e004[0x10000 - 0xe004];
-};
-
 /* MMU 500 */
 #define SMMU_SCR0                      (SMMU_BASE + 0x0)
 #define SMMU_SCR1                      (SMMU_BASE + 0x4)
index fc954c536622a758f65bcb3f9224c4ecb2efc472..ff0fc47021efd54b805056abf85f01d52e4e5732 100644 (file)
@@ -20,7 +20,6 @@
 
 #define SYS_FSL_GIC_ADDR                       (CONFIG_SYS_IMMR + 0x00400000)
 #define CONFIG_SYS_FSL_DDR_ADDR                        (CONFIG_SYS_IMMR + 0x00080000)
-#define CONFIG_SYS_CCI400_ADDR                 (CONFIG_SYS_IMMR + 0x00180000)
 #define CONFIG_SYS_FSL_CSU_ADDR                 (CONFIG_SYS_IMMR + 0x00510000)
 #define CONFIG_SYS_IFC_ADDR                    (CONFIG_SYS_IMMR + 0x00530000)
 #define CONFIG_SYS_FSL_ESDHC_ADDR              (CONFIG_SYS_IMMR + 0x00560000)
index c34fd63e66b01308c8ca05adca042b9d8da0ad4a..1415b0b6ffd164a096ee77b382e6ada03b5c90cb 100644 (file)
@@ -6,6 +6,7 @@
 
 #ifndef __ASM_ARCH_LS102XA_IMMAP_H_
 #define __ASM_ARCH_LS102XA_IMMAP_H_
+#include <fsl_immap.h>
 
 #define SVR_MAJ(svr)           (((svr) >>  4) & 0xf)
 #define SVR_MIN(svr)           (((svr) >>  0) & 0xf)
@@ -374,53 +375,7 @@ struct ccsr_serdes {
        u8      res_a00[0x1000-0xa00];  /* from 0xa00 to 0xfff */
 };
 
-#define CCI400_CTRLORD_TERM_BARRIER    0x00000008
-#define CCI400_CTRLORD_EN_BARRIER      0
-#define CCI400_SHAORD_NON_SHAREABLE    0x00000002
-#define CCI400_DVM_MESSAGE_REQ_EN      0x00000002
-#define CCI400_SNOOP_REQ_EN            0x00000001
-
-/* CCI-400 registers */
-struct ccsr_cci400 {
-       u32 ctrl_ord;                   /* Control Override */
-       u32 spec_ctrl;                  /* Speculation Control */
-       u32 secure_access;              /* Secure Access */
-       u32 status;                     /* Status */
-       u32 impr_err;                   /* Imprecise Error */
-       u8 res_14[0x100 - 0x14];
-       u32 pmcr;                       /* Performance Monitor Control */
-       u8 res_104[0xfd0 - 0x104];
-       u32 pid[8];                     /* Peripheral ID */
-       u32 cid[4];                     /* Component ID */
-       struct {
-               u32 snoop_ctrl;         /* Snoop Control */
-               u32 sha_ord;            /* Shareable Override */
-               u8 res_1008[0x1100 - 0x1008];
-               u32 rc_qos_ord;         /* read channel QoS Value Override */
-               u32 wc_qos_ord;         /* read channel QoS Value Override */
-               u8 res_1108[0x110c - 0x1108];
-               u32 qos_ctrl;           /* QoS Control */
-               u32 max_ot;             /* Max OT */
-               u8 res_1114[0x1130 - 0x1114];
-               u32 target_lat;         /* Target Latency */
-               u32 latency_regu;       /* Latency Regulation */
-               u32 qos_range;          /* QoS Range */
-               u8 res_113c[0x2000 - 0x113c];
-       } slave[5];                     /* Slave Interface */
-       u8 res_6000[0x9004 - 0x6000];
-       u32 cycle_counter;              /* Cycle counter */
-       u32 count_ctrl;                 /* Count Control */
-       u32 overflow_status;            /* Overflow Flag Status */
-       u8 res_9010[0xa000 - 0x9010];
-       struct {
-               u32 event_select;       /* Event Select */
-               u32 event_count;        /* Event Count */
-               u32 counter_ctrl;       /* Counter Control */
-               u32 overflow_status;    /* Overflow Flag Status */
-               u8 res_a010[0xb000 - 0xa010];
-       } pcounter[4];                  /* Performance Counter */
-       u8 res_e004[0x10000 - 0xe004];
-};
+
 
 /* AHCI (sata) register map */
 struct ccsr_ahci {
index 25d22d25bf80ca7857a050c79af52ade7c8e1a82..9afd1c469e42b7aa66de98586ab09629fab943bf 100644 (file)
@@ -71,7 +71,9 @@ int board_early_init_f(void)
 
 int board_init(void)
 {
-       struct ccsr_cci400 *cci = (struct ccsr_cci400 *)CONFIG_SYS_CCI400_ADDR;
+       struct ccsr_cci400 *cci = (struct ccsr_cci400 *)(CONFIG_SYS_IMMR +
+                                       CONFIG_SYS_CCI400_OFFSET);
+
        /*
         * Set CCI-400 control override register to enable barrier
         * transaction
index 97ab3400ad211fe0a2b2cc52a56032156b3842ac..406194da27facce39f494eb1df634abdd6514e1e 100644 (file)
@@ -106,8 +106,8 @@ int misc_init_r(void)
 
 int board_init(void)
 {
-       struct ccsr_cci400 *cci = (struct ccsr_cci400 *)
-                                  CONFIG_SYS_CCI400_ADDR;
+       struct ccsr_cci400 *cci = (struct ccsr_cci400 *)(CONFIG_SYS_IMMR +
+                                  CONFIG_SYS_CCI400_OFFSET);
 
        /* Set CCI-400 control override register to enable barrier
         * transaction */
index a21e4c4aebc0dfd74dab1838ce152b83b53630fd..c6c1c71202e1787f846ddbf7be19d09cb6822bc8 100644 (file)
@@ -104,7 +104,8 @@ int board_early_init_f(void)
 
 int board_init(void)
 {
-       struct ccsr_cci400 *cci = (struct ccsr_cci400 *)CONFIG_SYS_CCI400_ADDR;
+       struct ccsr_cci400 *cci = (struct ccsr_cci400 *)(CONFIG_SYS_IMMR +
+                                       CONFIG_SYS_CCI400_OFFSET);
        /*
         * Set CCI-400 control override register to enable barrier
         * transaction
index d81d8abc9bf37f93bf39c4995329a2bb33136d5d..8b3f4ad78d8e944f008c9ab3d30ed82437785830 100644 (file)
@@ -204,7 +204,8 @@ int board_early_init_f(void)
 #ifdef CONFIG_SPL_BUILD
 void board_init_f(ulong dummy)
 {
-       struct ccsr_cci400 *cci = (struct ccsr_cci400 *)CONFIG_SYS_CCI400_ADDR;
+       struct ccsr_cci400 *cci = (struct ccsr_cci400 *)(CONFIG_SYS_IMMR +
+                                       CONFIG_SYS_CCI400_OFFSET);
        unsigned int major;
 
 #ifdef CONFIG_NAND_BOOT
@@ -425,7 +426,8 @@ int misc_init_r(void)
 
 int board_init(void)
 {
-       struct ccsr_cci400 *cci = (struct ccsr_cci400 *)CONFIG_SYS_CCI400_ADDR;
+       struct ccsr_cci400 *cci = (struct ccsr_cci400 *)(CONFIG_SYS_IMMR +
+                                       CONFIG_SYS_CCI400_OFFSET);
        unsigned int major;
 
 #ifdef CONFIG_SYS_FSL_ERRATUM_A010315
@@ -460,7 +462,8 @@ int board_init(void)
 #if defined(CONFIG_DEEP_SLEEP)
 void board_sleep_prepare(void)
 {
-       struct ccsr_cci400 __iomem *cci = (void *)CONFIG_SYS_CCI400_ADDR;
+       struct ccsr_cci400 __iomem *cci = (void *)(CONFIG_SYS_IMMR +
+                                               CONFIG_SYS_CCI400_OFFSET);
        unsigned int major;
 
        major = get_soc_major_rev();
index b1c4fe7969a951a43fc89da932fb3beee65d1ca4..4f5a19cdc1abc835dbb88a61cb5a6aa8ce03354b 100644 (file)
@@ -133,4 +133,55 @@ struct ccsr_ddr {
        u8      res_e5c[164];
        u32     debug[64];              /* debug_1 to debug_64 */
 };
+
+#ifdef CONFIG_SYS_FSL_HAS_CCI400
+#define CCI400_CTRLORD_TERM_BARRIER    0x00000008
+#define CCI400_CTRLORD_EN_BARRIER      0
+#define CCI400_SHAORD_NON_SHAREABLE    0x00000002
+#define CCI400_DVM_MESSAGE_REQ_EN      0x00000002
+#define CCI400_SNOOP_REQ_EN            0x00000001
+
+/* CCI-400 registers */
+struct ccsr_cci400 {
+       u32 ctrl_ord;                   /* Control Override */
+       u32 spec_ctrl;                  /* Speculation Control */
+       u32 secure_access;              /* Secure Access */
+       u32 status;                     /* Status */
+       u32 impr_err;                   /* Imprecise Error */
+       u8 res_14[0x100 - 0x14];
+       u32 pmcr;                       /* Performance Monitor Control */
+       u8 res_104[0xfd0 - 0x104];
+       u32 pid[8];                     /* Peripheral ID */
+       u32 cid[4];                     /* Component ID */
+       struct {
+               u32 snoop_ctrl;         /* Snoop Control */
+               u32 sha_ord;            /* Shareable Override */
+               u8 res_1008[0x1100 - 0x1008];
+               u32 rc_qos_ord;         /* read channel QoS Value Override */
+               u32 wc_qos_ord;         /* read channel QoS Value Override */
+               u8 res_1108[0x110c - 0x1108];
+               u32 qos_ctrl;           /* QoS Control */
+               u32 max_ot;             /* Max OT */
+               u8 res_1114[0x1130 - 0x1114];
+               u32 target_lat;         /* Target Latency */
+               u32 latency_regu;       /* Latency Regulation */
+               u32 qos_range;          /* QoS Range */
+               u8 res_113c[0x2000 - 0x113c];
+       } slave[5];                     /* Slave Interface */
+       u8 res_6000[0x9004 - 0x6000];
+       u32 cycle_counter;              /* Cycle counter */
+       u32 count_ctrl;                 /* Count Control */
+       u32 overflow_status;            /* Overflow Flag Status */
+       u8 res_9010[0xa000 - 0x9010];
+       struct {
+               u32 event_select;       /* Event Select */
+               u32 event_count;        /* Event Count */
+               u32 counter_ctrl;       /* Counter Control */
+               u32 overflow_status;    /* Overflow Flag Status */
+               u8 res_a010[0xb000 - 0xa010];
+       } pcounter[4];                  /* Performance Counter */
+       u8 res_e004[0x10000 - 0xe004];
+};
+#endif
+
 #endif /* __FSL_IMMAP_H */
index 9ce0c3f039ffa26e16b6e31897813ac42f13b590..9619db692839987baaa4745e4f75cb5c11e3b987 100644 (file)
@@ -2435,7 +2435,6 @@ CONFIG_SYS_CACHE_STASHING
 CONFIG_SYS_CADMUS_BASE_REG
 CONFIG_SYS_CBSIZE
 CONFIG_SYS_CCCR
-CONFIG_SYS_CCI400_ADDR
 CONFIG_SYS_CCSRBAR
 CONFIG_SYS_CCSRBAR_PHYS
 CONFIG_SYS_CCSRBAR_PHYS_HIGH