aboutsummaryrefslogtreecommitdiff
path: root/drivers/ddr/marvell/a38x/mv_ddr_regs.h
diff options
context:
space:
mode:
authorTony Dinh <mibodhi@gmail.com>2023-01-18 19:03:04 -0800
committerStefan Roese <sr@denx.de>2023-01-26 07:30:20 +0100
commit54a08c4139e6677494d62c7cb595d70ef123a86b (patch)
tree1e5ee0e5183844df43a8d968e61aa2487a9856e2 /drivers/ddr/marvell/a38x/mv_ddr_regs.h
parent17e8e58fe62c019b2cc26af221b6defc3368229f (diff)
ddr: marvell: a38x: Add support for DDR4 from Marvell mv-ddr-marvell repository
This syncs drivers/ddr/marvell/a38x/ with the master branch of repository https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell.git up to the commit "mv_ddr: a3700: Use the right size for memset to not overflow" d5acc10c287e40cc2feeb28710b92e45c93c702c This patch was created by following steps: 1. Replace all a38x files in U-Boot tree by files from upstream github Marvell mv-ddr-marvell repository. 2. Run following command to omit portions not relevant for a38x, ddr3, and ddr4: files=drivers/ddr/marvell/a38x/* unifdef -m -UMV_DDR -UMV_DDR_ATF -UCONFIG_APN806 \ -UCONFIG_MC_STATIC -UCONFIG_MC_STATIC_PRINT -UCONFIG_PHY_STATIC \ -UCONFIG_PHY_STATIC_PRINT -UCONFIG_CUSTOMER_BOARD_SUPPORT \ -UCONFIG_A3700 -UA3900 -UA80X0 -UA70X0 -DCONFIG_ARMADA_38X -UCONFIG_ARMADA_39X \ -UCONFIG_64BIT $files 3. Manually change license to SPDX-License-Identifier (upstream license in upstream github repository contains long license texts and U-Boot is using just SPDX-License-Identifier. After applying this patch, a38x, ddr3, and ddr4 code in upstream Marvell github repository and in U-Boot would be fully identical. So in future applying above steps could be used to sync code again. The only change in this patch are: 1. Some fixes with include files. 2. Some function return and basic type defines changes in mv_ddr_plat.c (to correct Marvell bug). 3. Remove of dead code in newly copied files (as a result of the filter script stripping out everything other than a38x, dd3, and ddr4). Reference: "ddr: marvell: a38x: Sync code with Marvell mv-ddr-marvell repository" https://source.denx.de/u-boot/u-boot/-/commit/107c3391b95bcc2ba09a876da4fa0c31b6c1e460 Signed-off-by: Tony Dinh <mibodhi@gmail.com> Reviewed-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'drivers/ddr/marvell/a38x/mv_ddr_regs.h')
-rw-r--r--drivers/ddr/marvell/a38x/mv_ddr_regs.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/drivers/ddr/marvell/a38x/mv_ddr_regs.h b/drivers/ddr/marvell/a38x/mv_ddr_regs.h
index cf2a6c92e8..a19000dbdd 100644
--- a/drivers/ddr/marvell/a38x/mv_ddr_regs.h
+++ b/drivers/ddr/marvell/a38x/mv_ddr_regs.h
@@ -373,6 +373,65 @@ enum {
#define MRS2_CMD 0x8
#define MRS3_CMD 0x9
+#if defined(CONFIG_DDR4)
+/* DDR4 MRS */
+#define MRS4_CMD 0x10
+#define MRS5_CMD 0x11
+#define MRS6_CMD 0x12
+
+/* DDR4 Registers */
+#define DDR4_MR0_REG 0x1900
+#define DDR4_MR1_REG 0x1904
+#define DDR4_MR2_REG 0x1908
+#define DDR4_MR3_REG 0x190c
+#define DDR4_MPR_PS_OFFS 0
+#define DDR4_MPR_PS_MASK 0x3
+enum mv_ddr_mpr_ps { /* DDR4 MPR Page Selection */
+ DDR4_MPR_PAGE0,
+ DDR4_MPR_PAGE1,
+ DDR4_MPR_PAGE2,
+ DDR4_MPR_PAGE3
+};
+#define DDR4_MPR_OP_OFFS 2
+#define DDR4_MPR_OP_MASK 0x1
+enum mv_ddr_mpr_op { /* DDR4 MPR Operation */
+ DDR4_MPR_OP_DIS, /* normal operation */
+ DDR4_MPR_OP_ENA /* dataflow from mpr */
+};
+#define DDR4_MPR_RF_OFFS 11
+#define DDR4_MPR_RF_MASK 0x3
+enum mv_ddr_mpr_rd_frmt { /* DDR4 MPR Read Format */
+ DDR4_MPR_RF_SERIAL,
+ DDR4_MPR_RF_PARALLEL,
+ DDR4_MPR_RF_STAGGERED,
+ DDR4_MPR_RF_RSVD_TEMP
+
+};
+
+#define DDR4_MR4_REG 0x1910
+#define DDR4_RPT_OFFS 10
+#define DDR4_RPT_MASK 0x1
+enum { /* read preamble training mode */
+ DDR4_RPT_DIS,
+ DDR4_RPT_ENA
+};
+
+#define DDR4_MR5_REG 0x1914
+#define DDR4_MR6_REG 0x1918
+#define DDR4_MPR_WR_REG 0x19d0
+#define DDR4_MPR_LOC_OFFS 8
+#define DDR4_MPR_LOC_MASK 0x3
+/*
+ * MPR Location for MPR write and read accesses
+ * MPR Location 0..3 within the selected page (page selection in MR3 [1:0] bits)
+ */
+enum {
+ DDR4_MPR_LOC0,
+ DDR4_MPR_LOC1,
+ DDR4_MPR_LOC2,
+ DDR4_MPR_LOC3
+};
+#endif /* CONFIG_DDR4 */
#define DRAM_PINS_MUX_REG 0x19d4
#define CTRL_PINS_MUX_OFFS 0