2 ** Copyright 2000, 2001 Broadcom Corporation
5 ** No portions of this material may be reproduced in any form
6 ** without the written permission of:
8 ** Broadcom Corporation
9 ** 5300 California Avenue
10 ** Irvine, California 92617
12 ** All information contained in this document is Broadcom
13 ** Corporation company private proprietary, and trade secret.
15 ** ----------------------------------------------------------
20 ** $Rev::file = : Global SVN Revision = 1780 $:
27 /* Define some default miscellaneous macros (to remove compiler's warning) */
32 /* Public declaration of the shmoo algorithm implementation
34 #include <shmoo_public.h>
36 /* Declaration of the low-level interface used by the shmoo algorithm.
37 * This interface may be implemented or redefined differently on different platforms,
38 * see platform specific platform_xxx.h and platform_xxx.c files
40 /* #include "platform_shmoo_priv.h" */
43 * Include API file with low-leval external API that need to be implemented for particular platform
46 #define uint32_t unsigned int
51 #define ARRAY_SIZE(A) (sizeof(A) / sizeof(A[0]))
55 * Redefine TIMEOUT_VAL const
58 #define TIMEOUT_VAL (9000)
62 * PHY_REG_OFFSET_PER_WL is the offset in address for the two identical registers in difference WL
63 * For BLAST, this difference is 0x200
64 * This is for support a loop to do the same procedures for different WL
66 #define PHY_REG_OFFSET_PER_WL 0x200
67 #define PHY_REG_OFFSET_PER_BL 0x0A0
71 * Define for "read eye" test
73 * 1 - build shmoo procedure application
74 * 0 - build "read eye" test application without shmoo.
75 * It is artifact of sharing code with another platform where there was not enough memory
76 * to build both shmoo and "read eye" applications.
77 * for the S2_A platform SHMOO_BUILD will always be 1
83 * Redefine function style cast that is used in the tinymt.* files
86 #define UINT32_C(V) ((uint32_t)(V))
89 #define UINT64_C(V) ((uint64_t)(V))
95 #define TRUE (!(FALSE))
99 * Include original RDB file
103 * PHY platform independent registers description
105 #include "ddr40_phy_registers.h"
108 * Output functions for 2-dimensional printing of the logs using Linux printk() function
114 * DRAM read/write functions
115 * Undefine existing macros
117 #undef SHMOO_DRAM_READ_32
118 #undef SHMOO_DRAM_WRITE_32
120 unsigned int SHMOO_DRAM_READ_32(ddr40_addr_t Address
);
121 void SHMOO_DRAM_WRITE_32(ddr40_addr_t Addres
, unsigned int Data
);
125 * Those defines are not used in S2_A platform because start address of the DRAM range
128 #undef SHMOO_DRAM_START_ADDR
129 #define SHMOO_DRAM_START_ADDR (0x80000000u)
131 #undef SHMOO_DRAM_END_ADDR
132 #define SHMOO_DRAM_END_ADDR (SHMOO_DRAM_START_ADDR + 0x00008000u)
136 * Registers read/write functions
137 * Undefine existing macros and replace them with the functions
142 unsigned int tb_r(ddr40_addr_t Address
);
143 void tb_w(ddr40_addr_t Addres
, unsigned int Data
);
146 * Undefine NL macro and replace it with the function
152 * Redefine macros from the PHY init code to use functions that will print
156 void PrintfLog(char * const ptFormatStr
, ...);
157 void PrintfErr(char * const ptFormatStr
, ...);
158 void PrintfFatal(char * const ptFormatStr
, ...);
160 #define print_log PrintfLog
161 #define error_log PrintfErr
162 #define fatal_log PrintfFatal
164 #define print_log(args...)
165 #define error_log(args...)
166 #define fatal_log(args...)
171 * It is 0 because DDR PHY RDB will have physical base address (not relative)
173 #define GLOBAL_REG_RBUS_START (0)
176 * This define is not necessary for the S2_A platform because it has other
179 #define MEMC_BASE_ADDR (0)
182 * This is the base address of the PHY registers.
183 * First block of the registers is control registers
184 * two following are WL 0 and WL 1 registers
186 #define PHY_CONTROL_BASE_ADDRESS (DDR_R_DDR40_PHY_ADDR_CTL_REVISION_MEMADDR)
190 * Verify some defines
192 #if defined(SHMOO_DRAM_START_ADDR)
193 #if (SHMOO_DRAM_START_ADDR == NOT_DEFINED)
194 #error DRAM start address is not redefined
197 #error DRAM start address is not defined
198 #endif /* defined(SHMOO_DRAM_START_ADDR) */
200 #if defined(SHMOO_DRAM_END_ADDR)
201 #if (SHMOO_DRAM_END_ADDR == NOT_DEFINED)
202 #error DRAM end address is not redefined
205 #error DRAM end address is not defined
206 #endif /* defined(SHMOO_DRAM_END_ADDR) */
208 #ifndef GLOBAL_REG_RBUS_START
209 #error Registers address is not defined
212 #ifndef PHY_CONTROL_BASE_ADDRESS
213 #error PHY Control registers base address is not defined
216 #ifndef MEMC_BASE_ADDR
217 #error MEMC base address is not defined
220 void timeout_ns(unsigned int nsec
);
221 #endif /* PLATFORM_H__ */