[Skiboot] port 80h for skiboot

Stewart Smith stewart at linux.ibm.com
Fri Dec 7 17:10:54 AEDT 2018


One of the things we've been discussing a bit is on how to output boot
progress/failure to port 80h across the firmware stack.

For those who don't know, one byte written to IO port 80h on the IBM PC
would show up on a dual 7 segment display if such a debug card was
plugged in. This let you "debug" hardware/firmware problems that occured
before you had fancy things like a display.

This is still common in the x86 world, e.g.
https://www.intel.com.au/content/www/au/en/support/articles/000005500/boards-and-kits.html

The Zaius machine has a physical display like the one in the article
above, and for workstations, having a physical display could be a good
idea, especially if something isn't connected to the BMC (or there isn't
a BMC).

So, what do we write to port 80h?

Currently, the Hostboot implementation starts at 0x30 and adds 1 for
each istep executed.. So we want to steer clear away from that.

So, my idea is to have skiboot just emit codes with the MSB set,
i.e. start at 0x80.

We already have code scattered around OPAL that does op_display() to
throw things at the FSP operator panel on IBM FSP based machines
(i.e. Tuleta and ZZ).

For an initial implementation, I was thinking of just repurposing these
calls to be mapped into the lower 7 bits of what we write to port 80h.

Something like this, with the idea being if we go down assert() or
abort(), we flip the least significant bit, so that you get whatever was
previously set in the event of a random abort()/assert().

/*                                                                                                             
 * Convert our detailed op_display() call into 1 byte for LPC port 80h                                         
 *                                                                                                             
 * Our layout looks like this:                                                                                 
 * MSB (bit 7): 1 = Comes from OPAL                                                                            
 *      bit 6 : 0 = OP_MOD_INIT (the main one), 1 = (see bit 5)                                                
 *      bit 5432 : (if bit 6=0, low nibble of op-panel code)                                                   
 *      bit 5432 : (if bit 6=1, other OP_MOD_ values in bits 54:                                               
 *                              00b=OP_MOD_CPU, 01b=OP_MOD_LOCK,                                               
 *                              10b=OP_MOD_MEM, 11b=OP_MOD_CHIPTOD                                             
 *                  bits 0,1 from code in bits 32)                                                             
 *                                                                                                             
 *      bit 1,0: 00b=OP_LOG, 10b=OP_WARN, 01b=OP_ERROR, 11b=OP_FATAL                                           
 *               i.e. bit 0 indicates ERROR or FATAL.                                                          
 *                                                                                                             
 * If port 80h number has the MSB and LSB set, then you died in OPAL.                                          
 * Any *odd* number with the MSB set (i.e. > 0x80) indicates error.                                            
 */
static inline uint8_t op_display_to_port_80(enum op_severity s, enum op_module m, uint16_t c)


Thoughts?

-- 
Stewart Smith
OPAL Architect, IBM.



More information about the Skiboot mailing list