18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*  *********************************************************************
38c2ecf20Sopenharmony_ci    *  SB1250 Board Support Package
48c2ecf20Sopenharmony_ci    *
58c2ecf20Sopenharmony_ci    *  Memory Controller constants		File: sb1250_mc.h
68c2ecf20Sopenharmony_ci    *
78c2ecf20Sopenharmony_ci    *  This module contains constants and macros useful for
88c2ecf20Sopenharmony_ci    *  programming the memory controller.
98c2ecf20Sopenharmony_ci    *
108c2ecf20Sopenharmony_ci    *  SB1250 specification level:  User's manual 1/02/02
118c2ecf20Sopenharmony_ci    *
128c2ecf20Sopenharmony_ci    *********************************************************************
138c2ecf20Sopenharmony_ci    *
148c2ecf20Sopenharmony_ci    *  Copyright 2000, 2001, 2002, 2003
158c2ecf20Sopenharmony_ci    *  Broadcom Corporation. All rights reserved.
168c2ecf20Sopenharmony_ci    *
178c2ecf20Sopenharmony_ci    ********************************************************************* */
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci#ifndef _SB1250_MC_H
218c2ecf20Sopenharmony_ci#define _SB1250_MC_H
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci#include <asm/sibyte/sb1250_defs.h>
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci/*
268c2ecf20Sopenharmony_ci * Memory Channel Config Register (table 6-14)
278c2ecf20Sopenharmony_ci */
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci#define S_MC_RESERVED0		    0
308c2ecf20Sopenharmony_ci#define M_MC_RESERVED0		    _SB_MAKEMASK(8, S_MC_RESERVED0)
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci#define S_MC_CHANNEL_SEL	    8
338c2ecf20Sopenharmony_ci#define M_MC_CHANNEL_SEL	    _SB_MAKEMASK(8, S_MC_CHANNEL_SEL)
348c2ecf20Sopenharmony_ci#define V_MC_CHANNEL_SEL(x)	    _SB_MAKEVALUE(x, S_MC_CHANNEL_SEL)
358c2ecf20Sopenharmony_ci#define G_MC_CHANNEL_SEL(x)	    _SB_GETVALUE(x, S_MC_CHANNEL_SEL, M_MC_CHANNEL_SEL)
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci#define S_MC_BANK0_MAP		    16
388c2ecf20Sopenharmony_ci#define M_MC_BANK0_MAP		    _SB_MAKEMASK(4, S_MC_BANK0_MAP)
398c2ecf20Sopenharmony_ci#define V_MC_BANK0_MAP(x)	    _SB_MAKEVALUE(x, S_MC_BANK0_MAP)
408c2ecf20Sopenharmony_ci#define G_MC_BANK0_MAP(x)	    _SB_GETVALUE(x, S_MC_BANK0_MAP, M_MC_BANK0_MAP)
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci#define K_MC_BANK0_MAP_DEFAULT	    0x00
438c2ecf20Sopenharmony_ci#define V_MC_BANK0_MAP_DEFAULT	    V_MC_BANK0_MAP(K_MC_BANK0_MAP_DEFAULT)
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci#define S_MC_BANK1_MAP		    20
468c2ecf20Sopenharmony_ci#define M_MC_BANK1_MAP		    _SB_MAKEMASK(4, S_MC_BANK1_MAP)
478c2ecf20Sopenharmony_ci#define V_MC_BANK1_MAP(x)	    _SB_MAKEVALUE(x, S_MC_BANK1_MAP)
488c2ecf20Sopenharmony_ci#define G_MC_BANK1_MAP(x)	    _SB_GETVALUE(x, S_MC_BANK1_MAP, M_MC_BANK1_MAP)
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci#define K_MC_BANK1_MAP_DEFAULT	    0x08
518c2ecf20Sopenharmony_ci#define V_MC_BANK1_MAP_DEFAULT	    V_MC_BANK1_MAP(K_MC_BANK1_MAP_DEFAULT)
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci#define S_MC_BANK2_MAP		    24
548c2ecf20Sopenharmony_ci#define M_MC_BANK2_MAP		    _SB_MAKEMASK(4, S_MC_BANK2_MAP)
558c2ecf20Sopenharmony_ci#define V_MC_BANK2_MAP(x)	    _SB_MAKEVALUE(x, S_MC_BANK2_MAP)
568c2ecf20Sopenharmony_ci#define G_MC_BANK2_MAP(x)	    _SB_GETVALUE(x, S_MC_BANK2_MAP, M_MC_BANK2_MAP)
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci#define K_MC_BANK2_MAP_DEFAULT	    0x09
598c2ecf20Sopenharmony_ci#define V_MC_BANK2_MAP_DEFAULT	    V_MC_BANK2_MAP(K_MC_BANK2_MAP_DEFAULT)
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci#define S_MC_BANK3_MAP		    28
628c2ecf20Sopenharmony_ci#define M_MC_BANK3_MAP		    _SB_MAKEMASK(4, S_MC_BANK3_MAP)
638c2ecf20Sopenharmony_ci#define V_MC_BANK3_MAP(x)	    _SB_MAKEVALUE(x, S_MC_BANK3_MAP)
648c2ecf20Sopenharmony_ci#define G_MC_BANK3_MAP(x)	    _SB_GETVALUE(x, S_MC_BANK3_MAP, M_MC_BANK3_MAP)
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci#define K_MC_BANK3_MAP_DEFAULT	    0x0C
678c2ecf20Sopenharmony_ci#define V_MC_BANK3_MAP_DEFAULT	    V_MC_BANK3_MAP(K_MC_BANK3_MAP_DEFAULT)
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci#define M_MC_RESERVED1		    _SB_MAKEMASK(8, 32)
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci#define S_MC_QUEUE_SIZE		    40
728c2ecf20Sopenharmony_ci#define M_MC_QUEUE_SIZE		    _SB_MAKEMASK(4, S_MC_QUEUE_SIZE)
738c2ecf20Sopenharmony_ci#define V_MC_QUEUE_SIZE(x)	    _SB_MAKEVALUE(x, S_MC_QUEUE_SIZE)
748c2ecf20Sopenharmony_ci#define G_MC_QUEUE_SIZE(x)	    _SB_GETVALUE(x, S_MC_QUEUE_SIZE, M_MC_QUEUE_SIZE)
758c2ecf20Sopenharmony_ci#define V_MC_QUEUE_SIZE_DEFAULT	    V_MC_QUEUE_SIZE(0x0A)
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ci#define S_MC_AGE_LIMIT		    44
788c2ecf20Sopenharmony_ci#define M_MC_AGE_LIMIT		    _SB_MAKEMASK(4, S_MC_AGE_LIMIT)
798c2ecf20Sopenharmony_ci#define V_MC_AGE_LIMIT(x)	    _SB_MAKEVALUE(x, S_MC_AGE_LIMIT)
808c2ecf20Sopenharmony_ci#define G_MC_AGE_LIMIT(x)	    _SB_GETVALUE(x, S_MC_AGE_LIMIT, M_MC_AGE_LIMIT)
818c2ecf20Sopenharmony_ci#define V_MC_AGE_LIMIT_DEFAULT	    V_MC_AGE_LIMIT(8)
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci#define S_MC_WR_LIMIT		    48
848c2ecf20Sopenharmony_ci#define M_MC_WR_LIMIT		    _SB_MAKEMASK(4, S_MC_WR_LIMIT)
858c2ecf20Sopenharmony_ci#define V_MC_WR_LIMIT(x)	    _SB_MAKEVALUE(x, S_MC_WR_LIMIT)
868c2ecf20Sopenharmony_ci#define G_MC_WR_LIMIT(x)	    _SB_GETVALUE(x, S_MC_WR_LIMIT, M_MC_WR_LIMIT)
878c2ecf20Sopenharmony_ci#define V_MC_WR_LIMIT_DEFAULT	    V_MC_WR_LIMIT(5)
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci#define M_MC_IOB1HIGHPRIORITY	    _SB_MAKEMASK1(52)
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ci#define M_MC_RESERVED2		    _SB_MAKEMASK(3, 53)
928c2ecf20Sopenharmony_ci
938c2ecf20Sopenharmony_ci#define S_MC_CS_MODE		    56
948c2ecf20Sopenharmony_ci#define M_MC_CS_MODE		    _SB_MAKEMASK(4, S_MC_CS_MODE)
958c2ecf20Sopenharmony_ci#define V_MC_CS_MODE(x)		    _SB_MAKEVALUE(x, S_MC_CS_MODE)
968c2ecf20Sopenharmony_ci#define G_MC_CS_MODE(x)		    _SB_GETVALUE(x, S_MC_CS_MODE, M_MC_CS_MODE)
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci#define K_MC_CS_MODE_MSB_CS	    0
998c2ecf20Sopenharmony_ci#define K_MC_CS_MODE_INTLV_CS	    15
1008c2ecf20Sopenharmony_ci#define K_MC_CS_MODE_MIXED_CS_10    12
1018c2ecf20Sopenharmony_ci#define K_MC_CS_MODE_MIXED_CS_30    6
1028c2ecf20Sopenharmony_ci#define K_MC_CS_MODE_MIXED_CS_32    3
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci#define V_MC_CS_MODE_MSB_CS	    V_MC_CS_MODE(K_MC_CS_MODE_MSB_CS)
1058c2ecf20Sopenharmony_ci#define V_MC_CS_MODE_INTLV_CS	    V_MC_CS_MODE(K_MC_CS_MODE_INTLV_CS)
1068c2ecf20Sopenharmony_ci#define V_MC_CS_MODE_MIXED_CS_10    V_MC_CS_MODE(K_MC_CS_MODE_MIXED_CS_10)
1078c2ecf20Sopenharmony_ci#define V_MC_CS_MODE_MIXED_CS_30    V_MC_CS_MODE(K_MC_CS_MODE_MIXED_CS_30)
1088c2ecf20Sopenharmony_ci#define V_MC_CS_MODE_MIXED_CS_32    V_MC_CS_MODE(K_MC_CS_MODE_MIXED_CS_32)
1098c2ecf20Sopenharmony_ci
1108c2ecf20Sopenharmony_ci#define M_MC_ECC_DISABLE	    _SB_MAKEMASK1(60)
1118c2ecf20Sopenharmony_ci#define M_MC_BERR_DISABLE	    _SB_MAKEMASK1(61)
1128c2ecf20Sopenharmony_ci#define M_MC_FORCE_SEQ		    _SB_MAKEMASK1(62)
1138c2ecf20Sopenharmony_ci#define M_MC_DEBUG		    _SB_MAKEMASK1(63)
1148c2ecf20Sopenharmony_ci
1158c2ecf20Sopenharmony_ci#define V_MC_CONFIG_DEFAULT	V_MC_WR_LIMIT_DEFAULT | V_MC_AGE_LIMIT_DEFAULT | \
1168c2ecf20Sopenharmony_ci				V_MC_BANK0_MAP_DEFAULT | V_MC_BANK1_MAP_DEFAULT | \
1178c2ecf20Sopenharmony_ci				V_MC_BANK2_MAP_DEFAULT | V_MC_BANK3_MAP_DEFAULT | V_MC_CHANNEL_SEL(0) | \
1188c2ecf20Sopenharmony_ci				M_MC_IOB1HIGHPRIORITY | V_MC_QUEUE_SIZE_DEFAULT
1198c2ecf20Sopenharmony_ci
1208c2ecf20Sopenharmony_ci
1218c2ecf20Sopenharmony_ci/*
1228c2ecf20Sopenharmony_ci * Memory clock config register (Table 6-15)
1238c2ecf20Sopenharmony_ci *
1248c2ecf20Sopenharmony_ci * Note: this field has been updated to be consistent with the errata to 0.2
1258c2ecf20Sopenharmony_ci */
1268c2ecf20Sopenharmony_ci
1278c2ecf20Sopenharmony_ci#define S_MC_CLK_RATIO		    0
1288c2ecf20Sopenharmony_ci#define M_MC_CLK_RATIO		    _SB_MAKEMASK(4, S_MC_CLK_RATIO)
1298c2ecf20Sopenharmony_ci#define V_MC_CLK_RATIO(x)	    _SB_MAKEVALUE(x, S_MC_CLK_RATIO)
1308c2ecf20Sopenharmony_ci#define G_MC_CLK_RATIO(x)	    _SB_GETVALUE(x, S_MC_CLK_RATIO, M_MC_CLK_RATIO)
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ci#define K_MC_CLK_RATIO_2X	    4
1338c2ecf20Sopenharmony_ci#define K_MC_CLK_RATIO_25X	    5
1348c2ecf20Sopenharmony_ci#define K_MC_CLK_RATIO_3X	    6
1358c2ecf20Sopenharmony_ci#define K_MC_CLK_RATIO_35X	    7
1368c2ecf20Sopenharmony_ci#define K_MC_CLK_RATIO_4X	    8
1378c2ecf20Sopenharmony_ci#define K_MC_CLK_RATIO_45X	    9
1388c2ecf20Sopenharmony_ci
1398c2ecf20Sopenharmony_ci#define V_MC_CLK_RATIO_2X	    V_MC_CLK_RATIO(K_MC_CLK_RATIO_2X)
1408c2ecf20Sopenharmony_ci#define V_MC_CLK_RATIO_25X	    V_MC_CLK_RATIO(K_MC_CLK_RATIO_25X)
1418c2ecf20Sopenharmony_ci#define V_MC_CLK_RATIO_3X	    V_MC_CLK_RATIO(K_MC_CLK_RATIO_3X)
1428c2ecf20Sopenharmony_ci#define V_MC_CLK_RATIO_35X	    V_MC_CLK_RATIO(K_MC_CLK_RATIO_35X)
1438c2ecf20Sopenharmony_ci#define V_MC_CLK_RATIO_4X	    V_MC_CLK_RATIO(K_MC_CLK_RATIO_4X)
1448c2ecf20Sopenharmony_ci#define V_MC_CLK_RATIO_45X	    V_MC_CLK_RATIO(K_MC_CLK_RATIO_45X)
1458c2ecf20Sopenharmony_ci#define V_MC_CLK_RATIO_DEFAULT	    V_MC_CLK_RATIO_25X
1468c2ecf20Sopenharmony_ci
1478c2ecf20Sopenharmony_ci#define S_MC_REF_RATE		     8
1488c2ecf20Sopenharmony_ci#define M_MC_REF_RATE		     _SB_MAKEMASK(8, S_MC_REF_RATE)
1498c2ecf20Sopenharmony_ci#define V_MC_REF_RATE(x)	     _SB_MAKEVALUE(x, S_MC_REF_RATE)
1508c2ecf20Sopenharmony_ci#define G_MC_REF_RATE(x)	     _SB_GETVALUE(x, S_MC_REF_RATE, M_MC_REF_RATE)
1518c2ecf20Sopenharmony_ci
1528c2ecf20Sopenharmony_ci#define K_MC_REF_RATE_100MHz	     0x62
1538c2ecf20Sopenharmony_ci#define K_MC_REF_RATE_133MHz	     0x81
1548c2ecf20Sopenharmony_ci#define K_MC_REF_RATE_200MHz	     0xC4
1558c2ecf20Sopenharmony_ci
1568c2ecf20Sopenharmony_ci#define V_MC_REF_RATE_100MHz	     V_MC_REF_RATE(K_MC_REF_RATE_100MHz)
1578c2ecf20Sopenharmony_ci#define V_MC_REF_RATE_133MHz	     V_MC_REF_RATE(K_MC_REF_RATE_133MHz)
1588c2ecf20Sopenharmony_ci#define V_MC_REF_RATE_200MHz	     V_MC_REF_RATE(K_MC_REF_RATE_200MHz)
1598c2ecf20Sopenharmony_ci#define V_MC_REF_RATE_DEFAULT	     V_MC_REF_RATE_100MHz
1608c2ecf20Sopenharmony_ci
1618c2ecf20Sopenharmony_ci#define S_MC_CLOCK_DRIVE	     16
1628c2ecf20Sopenharmony_ci#define M_MC_CLOCK_DRIVE	     _SB_MAKEMASK(4, S_MC_CLOCK_DRIVE)
1638c2ecf20Sopenharmony_ci#define V_MC_CLOCK_DRIVE(x)	     _SB_MAKEVALUE(x, S_MC_CLOCK_DRIVE)
1648c2ecf20Sopenharmony_ci#define G_MC_CLOCK_DRIVE(x)	     _SB_GETVALUE(x, S_MC_CLOCK_DRIVE, M_MC_CLOCK_DRIVE)
1658c2ecf20Sopenharmony_ci#define V_MC_CLOCK_DRIVE_DEFAULT     V_MC_CLOCK_DRIVE(0xF)
1668c2ecf20Sopenharmony_ci
1678c2ecf20Sopenharmony_ci#define S_MC_DATA_DRIVE		     20
1688c2ecf20Sopenharmony_ci#define M_MC_DATA_DRIVE		     _SB_MAKEMASK(4, S_MC_DATA_DRIVE)
1698c2ecf20Sopenharmony_ci#define V_MC_DATA_DRIVE(x)	     _SB_MAKEVALUE(x, S_MC_DATA_DRIVE)
1708c2ecf20Sopenharmony_ci#define G_MC_DATA_DRIVE(x)	     _SB_GETVALUE(x, S_MC_DATA_DRIVE, M_MC_DATA_DRIVE)
1718c2ecf20Sopenharmony_ci#define V_MC_DATA_DRIVE_DEFAULT	     V_MC_DATA_DRIVE(0x0)
1728c2ecf20Sopenharmony_ci
1738c2ecf20Sopenharmony_ci#define S_MC_ADDR_DRIVE		     24
1748c2ecf20Sopenharmony_ci#define M_MC_ADDR_DRIVE		     _SB_MAKEMASK(4, S_MC_ADDR_DRIVE)
1758c2ecf20Sopenharmony_ci#define V_MC_ADDR_DRIVE(x)	     _SB_MAKEVALUE(x, S_MC_ADDR_DRIVE)
1768c2ecf20Sopenharmony_ci#define G_MC_ADDR_DRIVE(x)	     _SB_GETVALUE(x, S_MC_ADDR_DRIVE, M_MC_ADDR_DRIVE)
1778c2ecf20Sopenharmony_ci#define V_MC_ADDR_DRIVE_DEFAULT	     V_MC_ADDR_DRIVE(0x0)
1788c2ecf20Sopenharmony_ci
1798c2ecf20Sopenharmony_ci#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1)
1808c2ecf20Sopenharmony_ci#define M_MC_REF_DISABLE	     _SB_MAKEMASK1(30)
1818c2ecf20Sopenharmony_ci#endif /* 1250 PASS3 || 112x PASS1 */
1828c2ecf20Sopenharmony_ci
1838c2ecf20Sopenharmony_ci#define M_MC_DLL_BYPASS		     _SB_MAKEMASK1(31)
1848c2ecf20Sopenharmony_ci
1858c2ecf20Sopenharmony_ci#define S_MC_DQI_SKEW		    32
1868c2ecf20Sopenharmony_ci#define M_MC_DQI_SKEW		    _SB_MAKEMASK(8, S_MC_DQI_SKEW)
1878c2ecf20Sopenharmony_ci#define V_MC_DQI_SKEW(x)	    _SB_MAKEVALUE(x, S_MC_DQI_SKEW)
1888c2ecf20Sopenharmony_ci#define G_MC_DQI_SKEW(x)	    _SB_GETVALUE(x, S_MC_DQI_SKEW, M_MC_DQI_SKEW)
1898c2ecf20Sopenharmony_ci#define V_MC_DQI_SKEW_DEFAULT	    V_MC_DQI_SKEW(0)
1908c2ecf20Sopenharmony_ci
1918c2ecf20Sopenharmony_ci#define S_MC_DQO_SKEW		    40
1928c2ecf20Sopenharmony_ci#define M_MC_DQO_SKEW		    _SB_MAKEMASK(8, S_MC_DQO_SKEW)
1938c2ecf20Sopenharmony_ci#define V_MC_DQO_SKEW(x)	    _SB_MAKEVALUE(x, S_MC_DQO_SKEW)
1948c2ecf20Sopenharmony_ci#define G_MC_DQO_SKEW(x)	    _SB_GETVALUE(x, S_MC_DQO_SKEW, M_MC_DQO_SKEW)
1958c2ecf20Sopenharmony_ci#define V_MC_DQO_SKEW_DEFAULT	    V_MC_DQO_SKEW(0)
1968c2ecf20Sopenharmony_ci
1978c2ecf20Sopenharmony_ci#define S_MC_ADDR_SKEW		     48
1988c2ecf20Sopenharmony_ci#define M_MC_ADDR_SKEW		     _SB_MAKEMASK(8, S_MC_ADDR_SKEW)
1998c2ecf20Sopenharmony_ci#define V_MC_ADDR_SKEW(x)	     _SB_MAKEVALUE(x, S_MC_ADDR_SKEW)
2008c2ecf20Sopenharmony_ci#define G_MC_ADDR_SKEW(x)	     _SB_GETVALUE(x, S_MC_ADDR_SKEW, M_MC_ADDR_SKEW)
2018c2ecf20Sopenharmony_ci#define V_MC_ADDR_SKEW_DEFAULT	     V_MC_ADDR_SKEW(0x0F)
2028c2ecf20Sopenharmony_ci
2038c2ecf20Sopenharmony_ci#define S_MC_DLL_DEFAULT	     56
2048c2ecf20Sopenharmony_ci#define M_MC_DLL_DEFAULT	     _SB_MAKEMASK(8, S_MC_DLL_DEFAULT)
2058c2ecf20Sopenharmony_ci#define V_MC_DLL_DEFAULT(x)	     _SB_MAKEVALUE(x, S_MC_DLL_DEFAULT)
2068c2ecf20Sopenharmony_ci#define G_MC_DLL_DEFAULT(x)	     _SB_GETVALUE(x, S_MC_DLL_DEFAULT, M_MC_DLL_DEFAULT)
2078c2ecf20Sopenharmony_ci#define V_MC_DLL_DEFAULT_DEFAULT     V_MC_DLL_DEFAULT(0x10)
2088c2ecf20Sopenharmony_ci
2098c2ecf20Sopenharmony_ci#define V_MC_CLKCONFIG_DEFAULT	     V_MC_DLL_DEFAULT_DEFAULT |	 \
2108c2ecf20Sopenharmony_ci				     V_MC_ADDR_SKEW_DEFAULT | \
2118c2ecf20Sopenharmony_ci				     V_MC_DQO_SKEW_DEFAULT | \
2128c2ecf20Sopenharmony_ci				     V_MC_DQI_SKEW_DEFAULT | \
2138c2ecf20Sopenharmony_ci				     V_MC_ADDR_DRIVE_DEFAULT | \
2148c2ecf20Sopenharmony_ci				     V_MC_DATA_DRIVE_DEFAULT | \
2158c2ecf20Sopenharmony_ci				     V_MC_CLOCK_DRIVE_DEFAULT | \
2168c2ecf20Sopenharmony_ci				     V_MC_REF_RATE_DEFAULT
2178c2ecf20Sopenharmony_ci
2188c2ecf20Sopenharmony_ci
2198c2ecf20Sopenharmony_ci
2208c2ecf20Sopenharmony_ci/*
2218c2ecf20Sopenharmony_ci * DRAM Command Register (Table 6-13)
2228c2ecf20Sopenharmony_ci */
2238c2ecf20Sopenharmony_ci
2248c2ecf20Sopenharmony_ci#define S_MC_COMMAND		    0
2258c2ecf20Sopenharmony_ci#define M_MC_COMMAND		    _SB_MAKEMASK(4, S_MC_COMMAND)
2268c2ecf20Sopenharmony_ci#define V_MC_COMMAND(x)		    _SB_MAKEVALUE(x, S_MC_COMMAND)
2278c2ecf20Sopenharmony_ci#define G_MC_COMMAND(x)		    _SB_GETVALUE(x, S_MC_COMMAND, M_MC_COMMAND)
2288c2ecf20Sopenharmony_ci
2298c2ecf20Sopenharmony_ci#define K_MC_COMMAND_EMRS	    0
2308c2ecf20Sopenharmony_ci#define K_MC_COMMAND_MRS	    1
2318c2ecf20Sopenharmony_ci#define K_MC_COMMAND_PRE	    2
2328c2ecf20Sopenharmony_ci#define K_MC_COMMAND_AR		    3
2338c2ecf20Sopenharmony_ci#define K_MC_COMMAND_SETRFSH	    4
2348c2ecf20Sopenharmony_ci#define K_MC_COMMAND_CLRRFSH	    5
2358c2ecf20Sopenharmony_ci#define K_MC_COMMAND_SETPWRDN	    6
2368c2ecf20Sopenharmony_ci#define K_MC_COMMAND_CLRPWRDN	    7
2378c2ecf20Sopenharmony_ci
2388c2ecf20Sopenharmony_ci#define V_MC_COMMAND_EMRS	    V_MC_COMMAND(K_MC_COMMAND_EMRS)
2398c2ecf20Sopenharmony_ci#define V_MC_COMMAND_MRS	    V_MC_COMMAND(K_MC_COMMAND_MRS)
2408c2ecf20Sopenharmony_ci#define V_MC_COMMAND_PRE	    V_MC_COMMAND(K_MC_COMMAND_PRE)
2418c2ecf20Sopenharmony_ci#define V_MC_COMMAND_AR		    V_MC_COMMAND(K_MC_COMMAND_AR)
2428c2ecf20Sopenharmony_ci#define V_MC_COMMAND_SETRFSH	    V_MC_COMMAND(K_MC_COMMAND_SETRFSH)
2438c2ecf20Sopenharmony_ci#define V_MC_COMMAND_CLRRFSH	    V_MC_COMMAND(K_MC_COMMAND_CLRRFSH)
2448c2ecf20Sopenharmony_ci#define V_MC_COMMAND_SETPWRDN	    V_MC_COMMAND(K_MC_COMMAND_SETPWRDN)
2458c2ecf20Sopenharmony_ci#define V_MC_COMMAND_CLRPWRDN	    V_MC_COMMAND(K_MC_COMMAND_CLRPWRDN)
2468c2ecf20Sopenharmony_ci
2478c2ecf20Sopenharmony_ci#define M_MC_CS0		    _SB_MAKEMASK1(4)
2488c2ecf20Sopenharmony_ci#define M_MC_CS1		    _SB_MAKEMASK1(5)
2498c2ecf20Sopenharmony_ci#define M_MC_CS2		    _SB_MAKEMASK1(6)
2508c2ecf20Sopenharmony_ci#define M_MC_CS3		    _SB_MAKEMASK1(7)
2518c2ecf20Sopenharmony_ci
2528c2ecf20Sopenharmony_ci/*
2538c2ecf20Sopenharmony_ci * DRAM Mode Register (Table 6-14)
2548c2ecf20Sopenharmony_ci */
2558c2ecf20Sopenharmony_ci
2568c2ecf20Sopenharmony_ci#define S_MC_EMODE		    0
2578c2ecf20Sopenharmony_ci#define M_MC_EMODE		    _SB_MAKEMASK(15, S_MC_EMODE)
2588c2ecf20Sopenharmony_ci#define V_MC_EMODE(x)		    _SB_MAKEVALUE(x, S_MC_EMODE)
2598c2ecf20Sopenharmony_ci#define G_MC_EMODE(x)		    _SB_GETVALUE(x, S_MC_EMODE, M_MC_EMODE)
2608c2ecf20Sopenharmony_ci#define V_MC_EMODE_DEFAULT	    V_MC_EMODE(0)
2618c2ecf20Sopenharmony_ci
2628c2ecf20Sopenharmony_ci#define S_MC_MODE		    16
2638c2ecf20Sopenharmony_ci#define M_MC_MODE		    _SB_MAKEMASK(15, S_MC_MODE)
2648c2ecf20Sopenharmony_ci#define V_MC_MODE(x)		    _SB_MAKEVALUE(x, S_MC_MODE)
2658c2ecf20Sopenharmony_ci#define G_MC_MODE(x)		    _SB_GETVALUE(x, S_MC_MODE, M_MC_MODE)
2668c2ecf20Sopenharmony_ci#define V_MC_MODE_DEFAULT	    V_MC_MODE(0x22)
2678c2ecf20Sopenharmony_ci
2688c2ecf20Sopenharmony_ci#define S_MC_DRAM_TYPE		    32
2698c2ecf20Sopenharmony_ci#define M_MC_DRAM_TYPE		    _SB_MAKEMASK(3, S_MC_DRAM_TYPE)
2708c2ecf20Sopenharmony_ci#define V_MC_DRAM_TYPE(x)	    _SB_MAKEVALUE(x, S_MC_DRAM_TYPE)
2718c2ecf20Sopenharmony_ci#define G_MC_DRAM_TYPE(x)	    _SB_GETVALUE(x, S_MC_DRAM_TYPE, M_MC_DRAM_TYPE)
2728c2ecf20Sopenharmony_ci
2738c2ecf20Sopenharmony_ci#define K_MC_DRAM_TYPE_JEDEC	    0
2748c2ecf20Sopenharmony_ci#define K_MC_DRAM_TYPE_FCRAM	    1
2758c2ecf20Sopenharmony_ci#define K_MC_DRAM_TYPE_SGRAM	    2
2768c2ecf20Sopenharmony_ci
2778c2ecf20Sopenharmony_ci#define V_MC_DRAM_TYPE_JEDEC	    V_MC_DRAM_TYPE(K_MC_DRAM_TYPE_JEDEC)
2788c2ecf20Sopenharmony_ci#define V_MC_DRAM_TYPE_FCRAM	    V_MC_DRAM_TYPE(K_MC_DRAM_TYPE_FCRAM)
2798c2ecf20Sopenharmony_ci#define V_MC_DRAM_TYPE_SGRAM	    V_MC_DRAM_TYPE(K_MC_DRAM_TYPE_SGRAM)
2808c2ecf20Sopenharmony_ci
2818c2ecf20Sopenharmony_ci#define M_MC_EXTERNALDECODE	    _SB_MAKEMASK1(35)
2828c2ecf20Sopenharmony_ci
2838c2ecf20Sopenharmony_ci#if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1)
2848c2ecf20Sopenharmony_ci#define M_MC_PRE_ON_A8		    _SB_MAKEMASK1(36)
2858c2ecf20Sopenharmony_ci#define M_MC_RAM_WITH_A13	    _SB_MAKEMASK1(37)
2868c2ecf20Sopenharmony_ci#endif /* 1250 PASS3 || 112x PASS1 */
2878c2ecf20Sopenharmony_ci
2888c2ecf20Sopenharmony_ci
2898c2ecf20Sopenharmony_ci
2908c2ecf20Sopenharmony_ci/*
2918c2ecf20Sopenharmony_ci * SDRAM Timing Register  (Table 6-15)
2928c2ecf20Sopenharmony_ci */
2938c2ecf20Sopenharmony_ci
2948c2ecf20Sopenharmony_ci#define M_MC_w2rIDLE_TWOCYCLES	  _SB_MAKEMASK1(60)
2958c2ecf20Sopenharmony_ci#define M_MC_r2wIDLE_TWOCYCLES	  _SB_MAKEMASK1(61)
2968c2ecf20Sopenharmony_ci#define M_MC_r2rIDLE_TWOCYCLES	  _SB_MAKEMASK1(62)
2978c2ecf20Sopenharmony_ci
2988c2ecf20Sopenharmony_ci#define S_MC_tFIFO		  56
2998c2ecf20Sopenharmony_ci#define M_MC_tFIFO		  _SB_MAKEMASK(4, S_MC_tFIFO)
3008c2ecf20Sopenharmony_ci#define V_MC_tFIFO(x)		  _SB_MAKEVALUE(x, S_MC_tFIFO)
3018c2ecf20Sopenharmony_ci#define G_MC_tFIFO(x)		  _SB_GETVALUE(x, S_MC_tFIFO, M_MC_tFIFO)
3028c2ecf20Sopenharmony_ci#define K_MC_tFIFO_DEFAULT	  1
3038c2ecf20Sopenharmony_ci#define V_MC_tFIFO_DEFAULT	  V_MC_tFIFO(K_MC_tFIFO_DEFAULT)
3048c2ecf20Sopenharmony_ci
3058c2ecf20Sopenharmony_ci#define S_MC_tRFC		  52
3068c2ecf20Sopenharmony_ci#define M_MC_tRFC		  _SB_MAKEMASK(4, S_MC_tRFC)
3078c2ecf20Sopenharmony_ci#define V_MC_tRFC(x)		  _SB_MAKEVALUE(x, S_MC_tRFC)
3088c2ecf20Sopenharmony_ci#define G_MC_tRFC(x)		  _SB_GETVALUE(x, S_MC_tRFC, M_MC_tRFC)
3098c2ecf20Sopenharmony_ci#define K_MC_tRFC_DEFAULT	  12
3108c2ecf20Sopenharmony_ci#define V_MC_tRFC_DEFAULT	  V_MC_tRFC(K_MC_tRFC_DEFAULT)
3118c2ecf20Sopenharmony_ci
3128c2ecf20Sopenharmony_ci#if SIBYTE_HDR_FEATURE(1250, PASS3)
3138c2ecf20Sopenharmony_ci#define M_MC_tRFC_PLUS16	  _SB_MAKEMASK1(51)	/* 1250C3 and later.  */
3148c2ecf20Sopenharmony_ci#endif
3158c2ecf20Sopenharmony_ci
3168c2ecf20Sopenharmony_ci#define S_MC_tCwCr		  40
3178c2ecf20Sopenharmony_ci#define M_MC_tCwCr		  _SB_MAKEMASK(4, S_MC_tCwCr)
3188c2ecf20Sopenharmony_ci#define V_MC_tCwCr(x)		  _SB_MAKEVALUE(x, S_MC_tCwCr)
3198c2ecf20Sopenharmony_ci#define G_MC_tCwCr(x)		  _SB_GETVALUE(x, S_MC_tCwCr, M_MC_tCwCr)
3208c2ecf20Sopenharmony_ci#define K_MC_tCwCr_DEFAULT	  4
3218c2ecf20Sopenharmony_ci#define V_MC_tCwCr_DEFAULT	  V_MC_tCwCr(K_MC_tCwCr_DEFAULT)
3228c2ecf20Sopenharmony_ci
3238c2ecf20Sopenharmony_ci#define S_MC_tRCr		  28
3248c2ecf20Sopenharmony_ci#define M_MC_tRCr		  _SB_MAKEMASK(4, S_MC_tRCr)
3258c2ecf20Sopenharmony_ci#define V_MC_tRCr(x)		  _SB_MAKEVALUE(x, S_MC_tRCr)
3268c2ecf20Sopenharmony_ci#define G_MC_tRCr(x)		  _SB_GETVALUE(x, S_MC_tRCr, M_MC_tRCr)
3278c2ecf20Sopenharmony_ci#define K_MC_tRCr_DEFAULT	  9
3288c2ecf20Sopenharmony_ci#define V_MC_tRCr_DEFAULT	  V_MC_tRCr(K_MC_tRCr_DEFAULT)
3298c2ecf20Sopenharmony_ci
3308c2ecf20Sopenharmony_ci#define S_MC_tRCw		  24
3318c2ecf20Sopenharmony_ci#define M_MC_tRCw		  _SB_MAKEMASK(4, S_MC_tRCw)
3328c2ecf20Sopenharmony_ci#define V_MC_tRCw(x)		  _SB_MAKEVALUE(x, S_MC_tRCw)
3338c2ecf20Sopenharmony_ci#define G_MC_tRCw(x)		  _SB_GETVALUE(x, S_MC_tRCw, M_MC_tRCw)
3348c2ecf20Sopenharmony_ci#define K_MC_tRCw_DEFAULT	  10
3358c2ecf20Sopenharmony_ci#define V_MC_tRCw_DEFAULT	  V_MC_tRCw(K_MC_tRCw_DEFAULT)
3368c2ecf20Sopenharmony_ci
3378c2ecf20Sopenharmony_ci#define S_MC_tRRD		  20
3388c2ecf20Sopenharmony_ci#define M_MC_tRRD		  _SB_MAKEMASK(4, S_MC_tRRD)
3398c2ecf20Sopenharmony_ci#define V_MC_tRRD(x)		  _SB_MAKEVALUE(x, S_MC_tRRD)
3408c2ecf20Sopenharmony_ci#define G_MC_tRRD(x)		  _SB_GETVALUE(x, S_MC_tRRD, M_MC_tRRD)
3418c2ecf20Sopenharmony_ci#define K_MC_tRRD_DEFAULT	  2
3428c2ecf20Sopenharmony_ci#define V_MC_tRRD_DEFAULT	  V_MC_tRRD(K_MC_tRRD_DEFAULT)
3438c2ecf20Sopenharmony_ci
3448c2ecf20Sopenharmony_ci#define S_MC_tRP		  16
3458c2ecf20Sopenharmony_ci#define M_MC_tRP		  _SB_MAKEMASK(4, S_MC_tRP)
3468c2ecf20Sopenharmony_ci#define V_MC_tRP(x)		  _SB_MAKEVALUE(x, S_MC_tRP)
3478c2ecf20Sopenharmony_ci#define G_MC_tRP(x)		  _SB_GETVALUE(x, S_MC_tRP, M_MC_tRP)
3488c2ecf20Sopenharmony_ci#define K_MC_tRP_DEFAULT	  4
3498c2ecf20Sopenharmony_ci#define V_MC_tRP_DEFAULT	  V_MC_tRP(K_MC_tRP_DEFAULT)
3508c2ecf20Sopenharmony_ci
3518c2ecf20Sopenharmony_ci#define S_MC_tCwD		  8
3528c2ecf20Sopenharmony_ci#define M_MC_tCwD		  _SB_MAKEMASK(4, S_MC_tCwD)
3538c2ecf20Sopenharmony_ci#define V_MC_tCwD(x)		  _SB_MAKEVALUE(x, S_MC_tCwD)
3548c2ecf20Sopenharmony_ci#define G_MC_tCwD(x)		  _SB_GETVALUE(x, S_MC_tCwD, M_MC_tCwD)
3558c2ecf20Sopenharmony_ci#define K_MC_tCwD_DEFAULT	  1
3568c2ecf20Sopenharmony_ci#define V_MC_tCwD_DEFAULT	  V_MC_tCwD(K_MC_tCwD_DEFAULT)
3578c2ecf20Sopenharmony_ci
3588c2ecf20Sopenharmony_ci#define M_tCrDh			  _SB_MAKEMASK1(7)
3598c2ecf20Sopenharmony_ci#define M_MC_tCrDh		  M_tCrDh
3608c2ecf20Sopenharmony_ci
3618c2ecf20Sopenharmony_ci#define S_MC_tCrD		  4
3628c2ecf20Sopenharmony_ci#define M_MC_tCrD		  _SB_MAKEMASK(3, S_MC_tCrD)
3638c2ecf20Sopenharmony_ci#define V_MC_tCrD(x)		  _SB_MAKEVALUE(x, S_MC_tCrD)
3648c2ecf20Sopenharmony_ci#define G_MC_tCrD(x)		  _SB_GETVALUE(x, S_MC_tCrD, M_MC_tCrD)
3658c2ecf20Sopenharmony_ci#define K_MC_tCrD_DEFAULT	  2
3668c2ecf20Sopenharmony_ci#define V_MC_tCrD_DEFAULT	  V_MC_tCrD(K_MC_tCrD_DEFAULT)
3678c2ecf20Sopenharmony_ci
3688c2ecf20Sopenharmony_ci#define S_MC_tRCD		  0
3698c2ecf20Sopenharmony_ci#define M_MC_tRCD		  _SB_MAKEMASK(4, S_MC_tRCD)
3708c2ecf20Sopenharmony_ci#define V_MC_tRCD(x)		  _SB_MAKEVALUE(x, S_MC_tRCD)
3718c2ecf20Sopenharmony_ci#define G_MC_tRCD(x)		  _SB_GETVALUE(x, S_MC_tRCD, M_MC_tRCD)
3728c2ecf20Sopenharmony_ci#define K_MC_tRCD_DEFAULT	  3
3738c2ecf20Sopenharmony_ci#define V_MC_tRCD_DEFAULT	  V_MC_tRCD(K_MC_tRCD_DEFAULT)
3748c2ecf20Sopenharmony_ci
3758c2ecf20Sopenharmony_ci#define V_MC_TIMING_DEFAULT	V_MC_tFIFO(K_MC_tFIFO_DEFAULT) | \
3768c2ecf20Sopenharmony_ci				V_MC_tRFC(K_MC_tRFC_DEFAULT) | \
3778c2ecf20Sopenharmony_ci				V_MC_tCwCr(K_MC_tCwCr_DEFAULT) | \
3788c2ecf20Sopenharmony_ci				V_MC_tRCr(K_MC_tRCr_DEFAULT) | \
3798c2ecf20Sopenharmony_ci				V_MC_tRCw(K_MC_tRCw_DEFAULT) | \
3808c2ecf20Sopenharmony_ci				V_MC_tRRD(K_MC_tRRD_DEFAULT) | \
3818c2ecf20Sopenharmony_ci				V_MC_tRP(K_MC_tRP_DEFAULT) | \
3828c2ecf20Sopenharmony_ci				V_MC_tCwD(K_MC_tCwD_DEFAULT) | \
3838c2ecf20Sopenharmony_ci				V_MC_tCrD(K_MC_tCrD_DEFAULT) | \
3848c2ecf20Sopenharmony_ci				V_MC_tRCD(K_MC_tRCD_DEFAULT) | \
3858c2ecf20Sopenharmony_ci				M_MC_r2rIDLE_TWOCYCLES
3868c2ecf20Sopenharmony_ci
3878c2ecf20Sopenharmony_ci/*
3888c2ecf20Sopenharmony_ci * Errata says these are not the default
3898c2ecf20Sopenharmony_ci *				 M_MC_w2rIDLE_TWOCYCLES | \
3908c2ecf20Sopenharmony_ci *				 M_MC_r2wIDLE_TWOCYCLES | \
3918c2ecf20Sopenharmony_ci */
3928c2ecf20Sopenharmony_ci
3938c2ecf20Sopenharmony_ci
3948c2ecf20Sopenharmony_ci/*
3958c2ecf20Sopenharmony_ci * Chip Select Start Address Register (Table 6-17)
3968c2ecf20Sopenharmony_ci */
3978c2ecf20Sopenharmony_ci
3988c2ecf20Sopenharmony_ci#define S_MC_CS0_START		    0
3998c2ecf20Sopenharmony_ci#define M_MC_CS0_START		    _SB_MAKEMASK(16, S_MC_CS0_START)
4008c2ecf20Sopenharmony_ci#define V_MC_CS0_START(x)	    _SB_MAKEVALUE(x, S_MC_CS0_START)
4018c2ecf20Sopenharmony_ci#define G_MC_CS0_START(x)	    _SB_GETVALUE(x, S_MC_CS0_START, M_MC_CS0_START)
4028c2ecf20Sopenharmony_ci
4038c2ecf20Sopenharmony_ci#define S_MC_CS1_START		    16
4048c2ecf20Sopenharmony_ci#define M_MC_CS1_START		    _SB_MAKEMASK(16, S_MC_CS1_START)
4058c2ecf20Sopenharmony_ci#define V_MC_CS1_START(x)	    _SB_MAKEVALUE(x, S_MC_CS1_START)
4068c2ecf20Sopenharmony_ci#define G_MC_CS1_START(x)	    _SB_GETVALUE(x, S_MC_CS1_START, M_MC_CS1_START)
4078c2ecf20Sopenharmony_ci
4088c2ecf20Sopenharmony_ci#define S_MC_CS2_START		    32
4098c2ecf20Sopenharmony_ci#define M_MC_CS2_START		    _SB_MAKEMASK(16, S_MC_CS2_START)
4108c2ecf20Sopenharmony_ci#define V_MC_CS2_START(x)	    _SB_MAKEVALUE(x, S_MC_CS2_START)
4118c2ecf20Sopenharmony_ci#define G_MC_CS2_START(x)	    _SB_GETVALUE(x, S_MC_CS2_START, M_MC_CS2_START)
4128c2ecf20Sopenharmony_ci
4138c2ecf20Sopenharmony_ci#define S_MC_CS3_START		    48
4148c2ecf20Sopenharmony_ci#define M_MC_CS3_START		    _SB_MAKEMASK(16, S_MC_CS3_START)
4158c2ecf20Sopenharmony_ci#define V_MC_CS3_START(x)	    _SB_MAKEVALUE(x, S_MC_CS3_START)
4168c2ecf20Sopenharmony_ci#define G_MC_CS3_START(x)	    _SB_GETVALUE(x, S_MC_CS3_START, M_MC_CS3_START)
4178c2ecf20Sopenharmony_ci
4188c2ecf20Sopenharmony_ci/*
4198c2ecf20Sopenharmony_ci * Chip Select End Address Register (Table 6-18)
4208c2ecf20Sopenharmony_ci */
4218c2ecf20Sopenharmony_ci
4228c2ecf20Sopenharmony_ci#define S_MC_CS0_END		    0
4238c2ecf20Sopenharmony_ci#define M_MC_CS0_END		    _SB_MAKEMASK(16, S_MC_CS0_END)
4248c2ecf20Sopenharmony_ci#define V_MC_CS0_END(x)		    _SB_MAKEVALUE(x, S_MC_CS0_END)
4258c2ecf20Sopenharmony_ci#define G_MC_CS0_END(x)		    _SB_GETVALUE(x, S_MC_CS0_END, M_MC_CS0_END)
4268c2ecf20Sopenharmony_ci
4278c2ecf20Sopenharmony_ci#define S_MC_CS1_END		    16
4288c2ecf20Sopenharmony_ci#define M_MC_CS1_END		    _SB_MAKEMASK(16, S_MC_CS1_END)
4298c2ecf20Sopenharmony_ci#define V_MC_CS1_END(x)		    _SB_MAKEVALUE(x, S_MC_CS1_END)
4308c2ecf20Sopenharmony_ci#define G_MC_CS1_END(x)		    _SB_GETVALUE(x, S_MC_CS1_END, M_MC_CS1_END)
4318c2ecf20Sopenharmony_ci
4328c2ecf20Sopenharmony_ci#define S_MC_CS2_END		    32
4338c2ecf20Sopenharmony_ci#define M_MC_CS2_END		    _SB_MAKEMASK(16, S_MC_CS2_END)
4348c2ecf20Sopenharmony_ci#define V_MC_CS2_END(x)		    _SB_MAKEVALUE(x, S_MC_CS2_END)
4358c2ecf20Sopenharmony_ci#define G_MC_CS2_END(x)		    _SB_GETVALUE(x, S_MC_CS2_END, M_MC_CS2_END)
4368c2ecf20Sopenharmony_ci
4378c2ecf20Sopenharmony_ci#define S_MC_CS3_END		    48
4388c2ecf20Sopenharmony_ci#define M_MC_CS3_END		    _SB_MAKEMASK(16, S_MC_CS3_END)
4398c2ecf20Sopenharmony_ci#define V_MC_CS3_END(x)		    _SB_MAKEVALUE(x, S_MC_CS3_END)
4408c2ecf20Sopenharmony_ci#define G_MC_CS3_END(x)		    _SB_GETVALUE(x, S_MC_CS3_END, M_MC_CS3_END)
4418c2ecf20Sopenharmony_ci
4428c2ecf20Sopenharmony_ci/*
4438c2ecf20Sopenharmony_ci * Chip Select Interleave Register (Table 6-19)
4448c2ecf20Sopenharmony_ci */
4458c2ecf20Sopenharmony_ci
4468c2ecf20Sopenharmony_ci#define S_MC_INTLV_RESERVED	    0
4478c2ecf20Sopenharmony_ci#define M_MC_INTLV_RESERVED	    _SB_MAKEMASK(5, S_MC_INTLV_RESERVED)
4488c2ecf20Sopenharmony_ci
4498c2ecf20Sopenharmony_ci#define S_MC_INTERLEAVE		    7
4508c2ecf20Sopenharmony_ci#define M_MC_INTERLEAVE		    _SB_MAKEMASK(18, S_MC_INTERLEAVE)
4518c2ecf20Sopenharmony_ci#define V_MC_INTERLEAVE(x)	    _SB_MAKEVALUE(x, S_MC_INTERLEAVE)
4528c2ecf20Sopenharmony_ci
4538c2ecf20Sopenharmony_ci#define S_MC_INTLV_MBZ		    25
4548c2ecf20Sopenharmony_ci#define M_MC_INTLV_MBZ		    _SB_MAKEMASK(39, S_MC_INTLV_MBZ)
4558c2ecf20Sopenharmony_ci
4568c2ecf20Sopenharmony_ci/*
4578c2ecf20Sopenharmony_ci * Row Address Bits Register (Table 6-20)
4588c2ecf20Sopenharmony_ci */
4598c2ecf20Sopenharmony_ci
4608c2ecf20Sopenharmony_ci#define S_MC_RAS_RESERVED	    0
4618c2ecf20Sopenharmony_ci#define M_MC_RAS_RESERVED	    _SB_MAKEMASK(5, S_MC_RAS_RESERVED)
4628c2ecf20Sopenharmony_ci
4638c2ecf20Sopenharmony_ci#define S_MC_RAS_SELECT		    12
4648c2ecf20Sopenharmony_ci#define M_MC_RAS_SELECT		    _SB_MAKEMASK(25, S_MC_RAS_SELECT)
4658c2ecf20Sopenharmony_ci#define V_MC_RAS_SELECT(x)	    _SB_MAKEVALUE(x, S_MC_RAS_SELECT)
4668c2ecf20Sopenharmony_ci
4678c2ecf20Sopenharmony_ci#define S_MC_RAS_MBZ		    37
4688c2ecf20Sopenharmony_ci#define M_MC_RAS_MBZ		    _SB_MAKEMASK(27, S_MC_RAS_MBZ)
4698c2ecf20Sopenharmony_ci
4708c2ecf20Sopenharmony_ci
4718c2ecf20Sopenharmony_ci/*
4728c2ecf20Sopenharmony_ci * Column Address Bits Register (Table 6-21)
4738c2ecf20Sopenharmony_ci */
4748c2ecf20Sopenharmony_ci
4758c2ecf20Sopenharmony_ci#define S_MC_CAS_RESERVED	    0
4768c2ecf20Sopenharmony_ci#define M_MC_CAS_RESERVED	    _SB_MAKEMASK(5, S_MC_CAS_RESERVED)
4778c2ecf20Sopenharmony_ci
4788c2ecf20Sopenharmony_ci#define S_MC_CAS_SELECT		    5
4798c2ecf20Sopenharmony_ci#define M_MC_CAS_SELECT		    _SB_MAKEMASK(18, S_MC_CAS_SELECT)
4808c2ecf20Sopenharmony_ci#define V_MC_CAS_SELECT(x)	    _SB_MAKEVALUE(x, S_MC_CAS_SELECT)
4818c2ecf20Sopenharmony_ci
4828c2ecf20Sopenharmony_ci#define S_MC_CAS_MBZ		    23
4838c2ecf20Sopenharmony_ci#define M_MC_CAS_MBZ		    _SB_MAKEMASK(41, S_MC_CAS_MBZ)
4848c2ecf20Sopenharmony_ci
4858c2ecf20Sopenharmony_ci
4868c2ecf20Sopenharmony_ci/*
4878c2ecf20Sopenharmony_ci * Bank Address Address Bits Register (Table 6-22)
4888c2ecf20Sopenharmony_ci */
4898c2ecf20Sopenharmony_ci
4908c2ecf20Sopenharmony_ci#define S_MC_BA_RESERVED	    0
4918c2ecf20Sopenharmony_ci#define M_MC_BA_RESERVED	    _SB_MAKEMASK(5, S_MC_BA_RESERVED)
4928c2ecf20Sopenharmony_ci
4938c2ecf20Sopenharmony_ci#define S_MC_BA_SELECT		    5
4948c2ecf20Sopenharmony_ci#define M_MC_BA_SELECT		    _SB_MAKEMASK(20, S_MC_BA_SELECT)
4958c2ecf20Sopenharmony_ci#define V_MC_BA_SELECT(x)	    _SB_MAKEVALUE(x, S_MC_BA_SELECT)
4968c2ecf20Sopenharmony_ci
4978c2ecf20Sopenharmony_ci#define S_MC_BA_MBZ		    25
4988c2ecf20Sopenharmony_ci#define M_MC_BA_MBZ		    _SB_MAKEMASK(39, S_MC_BA_MBZ)
4998c2ecf20Sopenharmony_ci
5008c2ecf20Sopenharmony_ci/*
5018c2ecf20Sopenharmony_ci * Chip Select Attribute Register (Table 6-23)
5028c2ecf20Sopenharmony_ci */
5038c2ecf20Sopenharmony_ci
5048c2ecf20Sopenharmony_ci#define K_MC_CS_ATTR_CLOSED	    0
5058c2ecf20Sopenharmony_ci#define K_MC_CS_ATTR_CASCHECK	    1
5068c2ecf20Sopenharmony_ci#define K_MC_CS_ATTR_HINT	    2
5078c2ecf20Sopenharmony_ci#define K_MC_CS_ATTR_OPEN	    3
5088c2ecf20Sopenharmony_ci
5098c2ecf20Sopenharmony_ci#define S_MC_CS0_PAGE		    0
5108c2ecf20Sopenharmony_ci#define M_MC_CS0_PAGE		    _SB_MAKEMASK(2, S_MC_CS0_PAGE)
5118c2ecf20Sopenharmony_ci#define V_MC_CS0_PAGE(x)	    _SB_MAKEVALUE(x, S_MC_CS0_PAGE)
5128c2ecf20Sopenharmony_ci#define G_MC_CS0_PAGE(x)	    _SB_GETVALUE(x, S_MC_CS0_PAGE, M_MC_CS0_PAGE)
5138c2ecf20Sopenharmony_ci
5148c2ecf20Sopenharmony_ci#define S_MC_CS1_PAGE		    16
5158c2ecf20Sopenharmony_ci#define M_MC_CS1_PAGE		    _SB_MAKEMASK(2, S_MC_CS1_PAGE)
5168c2ecf20Sopenharmony_ci#define V_MC_CS1_PAGE(x)	    _SB_MAKEVALUE(x, S_MC_CS1_PAGE)
5178c2ecf20Sopenharmony_ci#define G_MC_CS1_PAGE(x)	    _SB_GETVALUE(x, S_MC_CS1_PAGE, M_MC_CS1_PAGE)
5188c2ecf20Sopenharmony_ci
5198c2ecf20Sopenharmony_ci#define S_MC_CS2_PAGE		    32
5208c2ecf20Sopenharmony_ci#define M_MC_CS2_PAGE		    _SB_MAKEMASK(2, S_MC_CS2_PAGE)
5218c2ecf20Sopenharmony_ci#define V_MC_CS2_PAGE(x)	    _SB_MAKEVALUE(x, S_MC_CS2_PAGE)
5228c2ecf20Sopenharmony_ci#define G_MC_CS2_PAGE(x)	    _SB_GETVALUE(x, S_MC_CS2_PAGE, M_MC_CS2_PAGE)
5238c2ecf20Sopenharmony_ci
5248c2ecf20Sopenharmony_ci#define S_MC_CS3_PAGE		    48
5258c2ecf20Sopenharmony_ci#define M_MC_CS3_PAGE		    _SB_MAKEMASK(2, S_MC_CS3_PAGE)
5268c2ecf20Sopenharmony_ci#define V_MC_CS3_PAGE(x)	    _SB_MAKEVALUE(x, S_MC_CS3_PAGE)
5278c2ecf20Sopenharmony_ci#define G_MC_CS3_PAGE(x)	    _SB_GETVALUE(x, S_MC_CS3_PAGE, M_MC_CS3_PAGE)
5288c2ecf20Sopenharmony_ci
5298c2ecf20Sopenharmony_ci/*
5308c2ecf20Sopenharmony_ci * ECC Test ECC Register (Table 6-25)
5318c2ecf20Sopenharmony_ci */
5328c2ecf20Sopenharmony_ci
5338c2ecf20Sopenharmony_ci#define S_MC_ECC_INVERT		    0
5348c2ecf20Sopenharmony_ci#define M_MC_ECC_INVERT		    _SB_MAKEMASK(8, S_MC_ECC_INVERT)
5358c2ecf20Sopenharmony_ci
5368c2ecf20Sopenharmony_ci
5378c2ecf20Sopenharmony_ci#endif
538