<div class="socmaildefaultfont" dir="ltr" style="font-family:Arial, Helvetica, sans-serif;font-size:10pt" ><div dir="ltr" ><tt><font size="3" face="" >> Ok cool. This returns 'starthbb' at the point I was at. Question, is</font></tt></div>
<div dir="ltr" >The 'starthbb' is the last thing HBBL boots into the reg before it jumps to Hostboot proper. Once the kernel boots, hostboot will write in 'hostboot' (see kernel.C).</div>
<div class="mail-signature-container" dir="ltr" ><br>--<br>Dan Crowell<br>Senior Software Engineer - Power Systems Enablement Firmware<br>IBM Rochester: t/l 553-2987<br>dcrowell@us.ibm.com</div>
<div dir="ltr" > </div>
<div dir="ltr" > </div>
<blockquote data-history-content-modified="1" data-history-expanded="1" dir="ltr" style="border-left:solid #aaaaaa 2px; margin-left:5px; padding-left:5px; direction:ltr; margin-right:0px" >----- Original message -----<br>From: "Dean Sanner" <dsanner@us.ibm.com><br>Sent by: "OpenPower-Firmware" <openpower-firmware-bounces+dcrowell=us.ibm.com@lists.ozlabs.org><br>To: "Marty E. Plummer" <hanetzer@startmail.com><br>Cc: Amit J Tendolkar <amit.tendolkar@in.ibm.com>, Alistair Popple <apopple@linux.ibm.com>, openpower-firmware@lists.ozlabs.org, Sachin Gupta24 <sgupta2m@in.ibm.com>, Raja Das1 <rajadas2@in.ibm.com><br>Subject: [EXTERNAL] Re: [OpenPower-Firmware] A few questions about early hostboot<br>Date: Fri, Sep 27, 2019 7:28 AM<br>
<p><tt><font size="3" face="" >> > This is the output from Cronus when Hostboot is running:<br>> > p9n.c k0:n0:s0:p00:c2 0000000000000000: 686F7374 626F6F74 [hostboot]<br>> ><br>> Ok cool. This returns 'starthbb' at the point I was at. Question, is<br>> there some way to translate MMIO_SCRATCH_HOSTBOOT_ACTIVE = 0x18 to that<br>> scom address, or is it one of those things you 'just know' from a table<br>> or something?</font></tt><br><br><tt><font size="3" face="" >Little of both :( Technically it used to be documented in the Chip Pervasive </font></tt><br><tt><font size="3" face="" >spec -- however I couldn't find it in P8 or P9 pervasive specs.</font></tt><br><br><tt><font size="3" face="" >The scom def however has just enough information to piece it together:</font></tt><br><br><tt><font size="3" face="" >From src/kernel/misc.C, </font></tt><tt><font size="3" face="" >updateScratchReg:</font></tt><br><br><tt><font size="3" face="" >// See EX07.EC.CC.PCC0.COMMON.SPR_COMMON.SCOMC in scomdef for</font></tt><br><tt><font size="3" face="" >// info on this offset - MODE_CX_SCOMC: 0000xxx = SCRATCH xx SPR</font></tt><br><tt><font size="3" face="" >// It's 0 for P9 so just pass through scratch reg offset</font></tt><br><br><tt><font size="3" face="" >From the scomdef:</font></tt><br> </p>
<table cellspacing="0" cellpadding="0" border="0" > <tbody> <tr valign="top" > <td width="46" valign="middle" bgcolor="#FFFFFF" > <div align="center" ><b>Addr:</b></div> </td> <td width="378" valign="middle" bgcolor="#FFFFFF" >0000000020010A80 (SCOM)</td> </tr> <tr valign="top" > <td width="46" valign="middle" bgcolor="#FFFFFF" > <div align="center" ><b>Name:</b></div> </td> <td width="378" valign="middle" bgcolor="#FFFFFF" >EXP.EC.CC.PCC0.COMMON.SPR_COMMON.SCOMC</td> </tr> </tbody></table><font size="2" >Bits 54:60</font><br><font size="2" >MODE_CX_SCOMC:</font><br><font size="2" >0000xxx = SCRATCH xx SPR <-------------- This one<br>0001xxx = TFMR xx SPR<br>0010xxx = PURR xx SPR<br>0011xxx = SPURR xx SPR<br>0100xxx = DEC xx SPR<br>0111000 = SPR_MODE<br>0111001 = AVP Output Pin<br>0111010 = Core Checkstop req<br>0111011 = SPATTN SPR<br>0111100 = Core Thread State<br>1xxxxxx = Emmpath Counters </font><br><br><tt><font size="3" face="" >The Scomdef "</font></tt>Scratch Register 0" has the SPRD value of:<br>Scratch Register 0 == 0000000020000000 (SPRD)<br>Scratch Register 1 == 0000000020000001 (SPRD)<br>Scratch Register 2 == 0000000020000002 (SPRD)<br>Scratch Register 3 == 0000000020000003 (SPRD)<br><br><tt><font size="3" face="" >The scratch reg constants are 0x0, 0x8, 0x10, 0x18 and in BE</font></tt><br><tt><font size="3" face="" >that is counting bit 59:60 through 0, 1, 2, 3:</font></tt><br><br><tt><font size="3" face="" > 1 2 3 4 5 6</font></tt><br><tt><font size="3" face="" >0123456789012345678901234567890123456789012345678901234567890123</font></tt><br><tt><font size="3" face="" >0000000000000000000000000000000000000000000000000000000000011000</font></tt><br><tt><font size="3" face="" >0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 8</font></tt><br><br><br><tt><font size="3" face="" >So what is happening is the scratch reg number is being set into </font></tt><br><tt><font size="3" face="" >SPRC bits 54:60, which correlates to the 0000xxx, which ties to</font></tt><br><tt><font size="3" face="" >the SPRD value in the scomdef.</font></tt><br><br><br><tt><font size="3" face="" >Absolutely crystal clear -- not! :(</font></tt><br><br><tt><font size="3" face="" >Does that make sense?</font></tt><br><br><font size="2" >Dean Sanner<br>dsanner@us.ibm.com</font><br>
<div><font size="2" face="Default Monospace,Courier New,Courier,monospace" >_______________________________________________<br>OpenPower-Firmware mailing list<br>OpenPower-Firmware@lists.ozlabs.org<br><a href="https://lists.ozlabs.org/listinfo/openpower-firmware" target="_blank">https://lists.ozlabs.org/listinfo/openpower-firmware</a> </font></div></blockquote>
<div dir="ltr" > </div></div><BR>