Commit b66a9383421805c705654ce9456ec28c202819fb

Authored by Rafal Jaworowski
1 parent 7b4fd36b03
Exists in master and in 55 other branches 8qm-imx_v2020.04_5.4.70_2.3.0, emb_lf_v2022.04, emb_lf_v2023.04, imx_v2015.04_4.1.15_1.0.0_ga, pitx_8mp_lf_v2020.04, smarc-8m-android-10.0.0_2.6.0, smarc-8m-android-11.0.0_2.0.0, smarc-8mp-android-11.0.0_2.0.0, smarc-emmc-imx_v2014.04_3.10.53_1.1.0_ga, smarc-emmc-imx_v2014.04_3.14.28_1.0.0_ga, smarc-imx-l5.0.0_1.0.0-ga, smarc-imx6_v2018.03_4.14.98_2.0.0_ga, smarc-imx7_v2017.03_4.9.11_1.0.0_ga, smarc-imx7_v2018.03_4.14.98_2.0.0_ga, smarc-imx_v2014.04_3.14.28_1.0.0_ga, smarc-imx_v2015.04_4.1.15_1.0.0_ga, smarc-imx_v2017.03_4.9.11_1.0.0_ga, smarc-imx_v2017.03_4.9.88_2.0.0_ga, smarc-imx_v2017.03_o8.1.0_1.3.0_8m, smarc-imx_v2018.03_4.14.78_1.0.0_ga, smarc-m6.0.1_2.1.0-ga, smarc-n7.1.2_2.0.0-ga, smarc-rel_imx_4.1.15_2.0.0_ga, smarc_8m-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8m-imx_v2019.04_4.19.35_1.1.0, smarc_8m_00d0-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8mm-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8mm-imx_v2019.04_4.19.35_1.1.0, smarc_8mm-imx_v2020.04_5.4.24_2.1.0, smarc_8mp_lf_v2020.04, smarc_8mq-imx_v2020.04_5.4.24_2.1.0, smarc_8mq_lf_v2020.04, ti-u-boot-2015.07, u-boot-2013.01.y, v2013.10, v2013.10-smarct33, v2013.10-smartmen, v2014.01, v2014.04, v2014.04-smarct33, v2014.04-smarct33-emmc, v2014.04-smartmen, v2014.07, v2014.07-smarct33, v2014.07-smartmen, v2015.07-smarct33, v2015.07-smarct33-emmc, v2015.07-smarct4x, v2016.05-dlt, v2016.05-smarct3x, v2016.05-smarct3x-emmc, v2016.05-smarct4x, v2017.01-smarct3x, v2017.01-smarct3x-emmc, v2017.01-smarct4x

Set SDelay register in the DDR controller for the MPC5200B chip.

Showing 4 changed files with 32 additions and 8 deletions Side-by-side Diff

board/icecube/icecube.c
... ... @@ -27,6 +27,7 @@
27 27 #include <common.h>
28 28 #include <mpc5xxx.h>
29 29 #include <pci.h>
  30 +#include <asm/processor.h>
30 31  
31 32 #if defined(CONFIG_LITE5200B)
32 33 #include "mt46v32m16.h"
... ... @@ -89,6 +90,8 @@
89 90 {
90 91 ulong dramsize = 0;
91 92 ulong dramsize2 = 0;
  93 + uint svr, pvr;
  94 +
92 95 #ifndef CFG_RAMBOOT
93 96 ulong test1, test2;
94 97  
... ... @@ -182,6 +185,24 @@
182 185 }
183 186  
184 187 #endif /* CFG_RAMBOOT */
  188 +
  189 + /*
  190 + * On MPC5200B we need to set the special configuration delay in the
  191 + * DDR controller. Please refer to Freescale's AN3221 "MPC5200B SDRAM
  192 + * Initialization and Configuration", 3.3.1 SDelay--MBAR + 0x0190:
  193 + *
  194 + * "The SDelay should be written to a value of 0x00000004. It is
  195 + * required to account for changes caused by normal wafer processing
  196 + * parameters."
  197 + */
  198 + svr = get_svr();
  199 + pvr = get_pvr();
  200 + if ((SVR_MJREV(svr) >= 2) &&
  201 + (PVR_MAJ(pvr) == 1) && (PVR_MIN(pvr) == 4)) {
  202 +
  203 + *(vu_long *)MPC5XXX_SDRAM_SDELAY = 0x04;
  204 + __asm__ volatile ("sync");
  205 + }
185 206  
186 207 return dramsize + dramsize2;
187 208 }
... ... @@ -38,7 +38,7 @@
38 38 ulong clock = gd->cpu_clk;
39 39 char buf[32];
40 40 #ifndef CONFIG_MGT5100
41   - uint svr;
  41 + uint svr, pvr;
42 42 #endif
43 43  
44 44 puts ("CPU: ");
... ... @@ -47,7 +47,8 @@
47 47 puts (CPU_ID_STR);
48 48 printf (" (JTAG ID %08lx)", *(vu_long *)MPC5XXX_CDM_JTAGID);
49 49 #else
50   - svr = get_svr ();
  50 + svr = get_svr();
  51 + pvr = get_pvr();
51 52 switch (SVR_VER (svr)) {
52 53 case SVR_MPC5200:
53 54 printf ("MPC5200");
54 55  
55 56  
... ... @@ -57,11 +58,10 @@
57 58 break;
58 59 }
59 60  
60   - printf (" v%d.%d", SVR_MJREV (svr), SVR_MNREV (svr));
  61 + printf (" v%d.%d, Core v%d.%d", SVR_MJREV (svr), SVR_MNREV (svr),
  62 + PVR_MAJ(pvr), PVR_MIN(pvr));
61 63 #endif
62   -
63 64 printf (" at %s MHz\n", strmhz (buf, clock));
64   -
65 65 return 0;
66 66 }
67 67  
include/configs/IceCube.h
... ... @@ -56,7 +56,9 @@
56 56 * 0x40000000 - 0x4fffffff - PCI Memory
57 57 * 0x50000000 - 0x50ffffff - PCI IO Space
58 58 */
59   -#define CONFIG_PCI 1
  59 +#define CONFIG_PCI
  60 +
  61 +#if defined(CONFIG_PCI)
60 62 #define CONFIG_PCI_PNP 1
61 63 #define CONFIG_PCI_SCAN_SHOW 1
62 64  
... ... @@ -67,6 +69,8 @@
67 69 #define CONFIG_PCI_IO_BUS 0x50000000
68 70 #define CONFIG_PCI_IO_PHYS CONFIG_PCI_IO_BUS
69 71 #define CONFIG_PCI_IO_SIZE 0x01000000
  72 +#define ADD_PCI_CMD CFG_CMD_PCI
  73 +#endif
70 74  
71 75 #define CFG_XLB_PIPELINING 1
72 76  
... ... @@ -75,8 +79,6 @@
75 79 #define CONFIG_EEPRO100 1
76 80 #define CFG_RX_ETH_BUFFER 8 /* use 8 rx buffer on eepro100 */
77 81 #define CONFIG_NS8382X 1
78   -
79   -#define ADD_PCI_CMD CFG_CMD_PCI
80 82  
81 83 #else /* MPC5100 */
82 84  
... ... @@ -131,6 +131,7 @@
131 131 #if defined(CONFIG_MGT5100)
132 132 #define MPC5XXX_SDRAM_XLBSEL (MPC5XXX_SDRAM + 0x0010)
133 133 #endif
  134 +#define MPC5XXX_SDRAM_SDELAY (MPC5XXX_SDRAM + 0x0090)
134 135  
135 136 /* Clock Distribution Module */
136 137 #define MPC5XXX_CDM_JTAGID (MPC5XXX_CDM + 0x0000)