blob: 2543575895f5471f2ab1c875392e10b7d6c3be3c [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0 */
Stefan Roese5ffceb82015-03-26 15:36:56 +01002/*
3 * Copyright (C) Marvell International Ltd. and its affiliates
Stefan Roese5ffceb82015-03-26 15:36:56 +01004 */
5
6#ifndef _DDR3_A38X_H
7#define _DDR3_A38X_H
8
9#define MAX_INTERFACE_NUM 1
10#define MAX_BUS_NUM 5
11
12#include "ddr3_hws_hw_training_def.h"
13
Stefan Roese5ffceb82015-03-26 15:36:56 +010014#define ECC_SUPPORT
15
16/* right now, we're not supporting this in mainline */
17#undef SUPPORT_STATIC_DUNIT_CONFIG
18
19/* Controler bus divider 1 for 32 bit, 2 for 64 bit */
20#define DDR_CONTROLLER_BUS_WIDTH_MULTIPLIER 1
21
22/* Tune internal training params values */
23#define TUNE_TRAINING_PARAMS_CK_DELAY 160
24#define TUNE_TRAINING_PARAMS_CK_DELAY_16 160
25#define TUNE_TRAINING_PARAMS_PFINGER 41
26#define TUNE_TRAINING_PARAMS_NFINGER 43
27#define TUNE_TRAINING_PARAMS_PHYREG3VAL 0xa
28
29#define MARVELL_BOARD MARVELL_BOARD_ID_BASE
30
31
32#define REG_DEVICE_SAR1_ADDR 0xe4204
33#define RST2_CPU_DDR_CLOCK_SELECT_IN_OFFSET 17
34#define RST2_CPU_DDR_CLOCK_SELECT_IN_MASK 0x1f
35
36/* DRAM Windows */
37#define REG_XBAR_WIN_5_CTRL_ADDR 0x20050
38#define REG_XBAR_WIN_5_BASE_ADDR 0x20054
39
40/* DRAM Windows */
41#define REG_XBAR_WIN_4_CTRL_ADDR 0x20040
42#define REG_XBAR_WIN_4_BASE_ADDR 0x20044
43#define REG_XBAR_WIN_4_REMAP_ADDR 0x20048
44#define REG_XBAR_WIN_7_REMAP_ADDR 0x20078
45#define REG_XBAR_WIN_16_CTRL_ADDR 0x200d0
46#define REG_XBAR_WIN_16_BASE_ADDR 0x200d4
47#define REG_XBAR_WIN_16_REMAP_ADDR 0x200dc
48#define REG_XBAR_WIN_19_CTRL_ADDR 0x200e8
49
50#define REG_FASTPATH_WIN_BASE_ADDR(win) (0x20180 + (0x8 * win))
51#define REG_FASTPATH_WIN_CTRL_ADDR(win) (0x20184 + (0x8 * win))
52
53/* SatR defined too change topology busWidth and ECC configuration */
54#define DDR_SATR_CONFIG_MASK_WIDTH 0x8
55#define DDR_SATR_CONFIG_MASK_ECC 0x10
56#define DDR_SATR_CONFIG_MASK_ECC_PUP 0x20
57
58#define REG_SAMPLE_RESET_HIGH_ADDR 0x18600
59
60#define MV_BOARD_REFCLK MV_BOARD_REFCLK_25MHZ
61
62/* Matrix enables DRAM modes (bus width/ECC) per boardId */
63#define TOPOLOGY_UPDATE_32BIT 0
64#define TOPOLOGY_UPDATE_32BIT_ECC 1
65#define TOPOLOGY_UPDATE_16BIT 2
66#define TOPOLOGY_UPDATE_16BIT_ECC 3
67#define TOPOLOGY_UPDATE_16BIT_ECC_PUP3 4
68#define TOPOLOGY_UPDATE { \
69 /* 32Bit, 32bit ECC, 16bit, 16bit ECC PUP4, 16bit ECC PUP3 */ \
70 {1, 1, 1, 1, 1}, /* RD_NAS_68XX_ID */ \
71 {1, 1, 1, 1, 1}, /* DB_68XX_ID */ \
72 {1, 0, 1, 0, 1}, /* RD_AP_68XX_ID */ \
73 {1, 0, 1, 0, 1}, /* DB_AP_68XX_ID */ \
74 {1, 0, 1, 0, 1}, /* DB_GP_68XX_ID */ \
75 {0, 0, 1, 1, 0}, /* DB_BP_6821_ID */ \
76 {1, 1, 1, 1, 1} /* DB_AMC_6820_ID */ \
77 };
78
79enum {
80 CPU_1066MHZ_DDR_400MHZ,
81 CPU_RESERVED_DDR_RESERVED0,
82 CPU_667MHZ_DDR_667MHZ,
83 CPU_800MHZ_DDR_800MHZ,
84 CPU_RESERVED_DDR_RESERVED1,
85 CPU_RESERVED_DDR_RESERVED2,
86 CPU_RESERVED_DDR_RESERVED3,
87 LAST_FREQ
88};
89
90#define ACTIVE_INTERFACE_MASK 0x1
91
92#endif /* _DDR3_A38X_H */