<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><font face="arial, sans-serif">Hi Stefan,</font></div><div dir="ltr"><font face="arial, sans-serif"><br></font><div><font face="arial, sans-serif">I'm working on new u-boot (2019.10) for this board, and would appreciate that I can have some advice about how to use SPL properly. I've only starting to read the SPL code for MVEBU recently.</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">Using the Clearfog as a starting point, I've completed a first cut of u-boot proper, with serdes_map, topology, mpp, .. extracted from Marvell GPL.</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">Then I've realized that we don't have DDR4 training code in the source tree yet. So I tried to use the bin_hdr from Marvell to build the u-boot-spl.kwb image.</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">With the ./<span style="color:rgb(0,0,0)">arch/arm/mach-mvebu/kwbimage.cfg </span>modified as followed:</font></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><font face="arial, sans-serif"><span style="font-variant-ligatures:no-common-ligatures">#</span><br><span style="font-variant-ligatures:no-common-ligatures"># Armada 38x uses version 1 image format</span><br><span style="font-variant-ligatures:no-common-ligatures">VERSION<span class="gmail-Apple-tab-span" style="white-space:pre">              </span>1</span><br><span style="font-variant-ligatures:no-common-ligatures"># Boot Media configurations</span><br><span style="font-variant-ligatures:no-common-ligatures">BOOT_FROM uart</span><br><span style="font-variant-ligatures:no-common-ligatures"># Binary Header (bin_hdr) with DDR3 training code</span><br><span style="font-variant-ligatures:no-common-ligatures">BINARY /usr/src/builds-thecus-n2350/marvell_bin_hdr/bin_hdr.bin 0000005b 00000068</span></font></blockquote>

<p style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(0,0,0);min-height:13px"><font face="arial, sans-serif"><span style="font-variant-ligatures:no-common-ligatures"></span></font></p>


<p style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(0,0,0);min-height:13px"><font face="arial, sans-serif">And then I manually built the image:<span style="font-variant-ligatures:no-common-ligatures"></span></font></p>


<p style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(0,0,0);min-height:13px"><font face="arial, sans-serif"><br><span style="font-variant-ligatures:no-common-ligatures"></span></font></p></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><font face="arial, sans-serif">./tools/mkimage -n ./arch/arm/mach-mvebu/kwbimage.cfg -T kwbimage -a 0x00800000 -e 0x00800000  -d u-boot.img u-boot-spl.kwb >/dev/null  && cat /dev/null </font></blockquote></div><div><span style="font-variant-ligatures:no-common-ligatures"><font face="arial, sans-serif"><br></font></span></div><div><span style="font-variant-ligatures:no-common-ligatures"><font face="arial, sans-serif">Then try with kwboot to load the image, it crashed during or after training. I used a pacth from Kevin Smith to implement a fallback in kwboot to be able to handshake with the BootROM. This patch is only relevant during the handshake to successfully catch a NAK to send boot message.</font></span></div><div><span style="font-variant-ligatures:no-common-ligatures"><font face="arial, sans-serif"><br></font></span></div><div><span style="font-variant-ligatures:no-common-ligatures"><font face="arial, sans-serif"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><font color="#000000">./kwboot -t -B 115200 /dev/ttyUSB0 -b <span style="caret-color: rgb(0, 0, 0);">u-boot-spl.kwb</span>  -f </font></blockquote>
<p style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><br></span></p><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span style="font-variant-ligatures:no-common-ligatures">Sending boot message. Please reboot the target...</span><br><span style="font-variant-ligatures:no-common-ligatures">Sending boot image...</span><br><span style="font-variant-ligatures:no-common-ligatures">  0 % [......................................................................]</span><br><span style="font-variant-ligatures:no-common-ligatures"> 24 % [......................................................................]</span><br><span style="font-variant-ligatures:no-common-ligatures"> 26 % [...............................</span><br><span style="font-variant-ligatures:no-common-ligatures">BootROM - 1.73</span><br><span style="font-variant-ligatures:no-common-ligatures">Booting from SPI flash</span><br><br><span style="font-variant-ligatures:no-common-ligatures">General initialization - Version: 1.0.0</span><br><span style="font-variant-ligatures:no-common-ligatures">AVS selection from EFUSE disabled (Skip reading EFUSE values)</span><br><span style="font-variant-ligatures:no-common-ligatures">Overriding default AVS value to: 0x23</span><br><span style="font-variant-ligatures:no-common-ligatures">Detected Device ID 6820</span><br><span style="font-variant-ligatures:no-common-ligatures">High speed PHY - Version: 2.0</span><br><span style="font-variant-ligatures:no-common-ligatures">Init Customer board board SerDes lanes topology details:</span><br><span style="font-variant-ligatures:no-common-ligatures"> | Lane # | Speed|    Type     |</span><br><span style="font-variant-ligatures:no-common-ligatures"> ------------------------------|</span><br><span style="font-variant-ligatures:no-common-ligatures"> |   0    |  0   |  SGMII0     |</span><br><span style="font-variant-ligatures:no-common-ligatures"> |   1    |  3   |  SATA0      |</span><br><span style="font-variant-ligatures:no-common-ligatures"> |   2    |  3   |  SATA1      |</span><br><span style="font-variant-ligatures:no-common-ligatures"> |   4    |  5   |  USB3 HOST0 |</span><br><span style="font-variant-ligatures:no-common-ligatures"> |   5    |  5   |  USB3 HOST1 |</span><br><span style="font-variant-ligatures:no-common-ligatures"> -------------------------------</span><br><span style="font-variant-ligatures:no-common-ligatures">High speed PHY - Ended Successfully</span><br><span style="font-variant-ligatures:no-common-ligatures">DDR4 Training Sequence - Ver TIP-0.23.(Sublib 0.8)0</span><br><span style="font-variant-ligatures:no-common-ligatures">+xmodem: Protocol error</span></blockquote>
<p style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(0,0,0);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span></p>


<p style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(0,0,0);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span></p>




<p style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(0,0,0);min-height:13px">Am I doing the right thing in building this image? In other words,  can the spl/u-boot-spl.bin be replaced by Marvell <span style="font-variant-ligatures:no-common-ligatures"></span>bin_hdr.bin like that?</p></font><font face="arial, sans-serif">





<p style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(0,0,0);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span></p>











<div><span style="font-variant-ligatures:no-common-ligatures">Thanks,</span></div><div><span style="font-variant-ligatures:no-common-ligatures">-bodhi</span></div></font></span></div><div><span style="font-variant-ligatures:no-common-ligatures"><br></span></div></div></div></div></div></div></div></div></div>