coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
spr.h File Reference
#include <arch/byteorder.h>
#include <types.h>
Include dependency graph for spr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SPR_TB   0x10C
 
#define SPR_PVR   0x11F
 
#define SPR_PVR_REV_MASK   (PPC_BITMASK(52, 55) | PPC_BITMASK(60, 63))
 
#define SPR_PVR_REV(maj, min)   (PPC_SHIFT((maj), 55) | PPC_SHIFT((min), 63))
 
#define SPR_HSPRG0   0x130
 
#define SPR_HSPRG1   0x131
 
#define SPR_HRMOR   0x139
 
#define SPR_HMER   0x150
 
#define SPR_HMER_MALFUNCTION_ALERT   PPC_BIT(0)
 
#define SPR_HMER_PROC_RECV_DONE   PPC_BIT(2)
 
#define SPR_HMER_PROC_RECV_ERROR_MASKED   PPC_BIT(3)
 
#define SPR_HMER_TFAC_ERROR   PPC_BIT(4)
 
#define SPR_HMER_TFMR_PARITY_ERROR   PPC_BIT(5)
 
#define SPR_HMER_XSCOM_FAIL   PPC_BIT(8)
 
#define SPR_HMER_XSCOM_DONE   PPC_BIT(9)
 
#define SPR_HMER_PROC_RECV_AGAIN   PPC_BIT(11)
 
#define SPR_HMER_WARN_RISE   PPC_BIT(14)
 
#define SPR_HMER_WARN_FALL   PPC_BIT(15)
 
#define SPR_HMER_SCOM_FIR_HMI   PPC_BIT(16)
 
#define SPR_HMER_TRIG_FIR_HMI   PPC_BIT(17)
 
#define SPR_HMER_HYP_RESOURCE_ERR   PPC_BIT(20)
 
#define SPR_HMER_XSCOM_STATUS   PPC_BITMASK(21, 23)
 
#define SPR_HMER_XSCOM_OCCUPIED   PPC_BIT(23)
 

Functions

static uint64_t read_spr (int spr)
 
static void write_spr (int spr, uint64_t val)
 
static uint64_t read_hmer (void)
 
static void clear_hmer (void)
 
static uint64_t read_msr (void)
 
static uint64_t pvr_revision (void)
 

Macro Definition Documentation

◆ SPR_HMER

#define SPR_HMER   0x150

Definition at line 17 of file spr.h.

◆ SPR_HMER_HYP_RESOURCE_ERR

#define SPR_HMER_HYP_RESOURCE_ERR   PPC_BIT(20)

Definition at line 31 of file spr.h.

◆ SPR_HMER_MALFUNCTION_ALERT

#define SPR_HMER_MALFUNCTION_ALERT   PPC_BIT(0)

Definition at line 19 of file spr.h.

◆ SPR_HMER_PROC_RECV_AGAIN

#define SPR_HMER_PROC_RECV_AGAIN   PPC_BIT(11)

Definition at line 26 of file spr.h.

◆ SPR_HMER_PROC_RECV_DONE

#define SPR_HMER_PROC_RECV_DONE   PPC_BIT(2)

Definition at line 20 of file spr.h.

◆ SPR_HMER_PROC_RECV_ERROR_MASKED

#define SPR_HMER_PROC_RECV_ERROR_MASKED   PPC_BIT(3)

Definition at line 21 of file spr.h.

◆ SPR_HMER_SCOM_FIR_HMI

#define SPR_HMER_SCOM_FIR_HMI   PPC_BIT(16)

Definition at line 29 of file spr.h.

◆ SPR_HMER_TFAC_ERROR

#define SPR_HMER_TFAC_ERROR   PPC_BIT(4)

Definition at line 22 of file spr.h.

◆ SPR_HMER_TFMR_PARITY_ERROR

#define SPR_HMER_TFMR_PARITY_ERROR   PPC_BIT(5)

Definition at line 23 of file spr.h.

◆ SPR_HMER_TRIG_FIR_HMI

#define SPR_HMER_TRIG_FIR_HMI   PPC_BIT(17)

Definition at line 30 of file spr.h.

◆ SPR_HMER_WARN_FALL

#define SPR_HMER_WARN_FALL   PPC_BIT(15)

Definition at line 28 of file spr.h.

◆ SPR_HMER_WARN_RISE

#define SPR_HMER_WARN_RISE   PPC_BIT(14)

Definition at line 27 of file spr.h.

◆ SPR_HMER_XSCOM_DONE

#define SPR_HMER_XSCOM_DONE   PPC_BIT(9)

Definition at line 25 of file spr.h.

◆ SPR_HMER_XSCOM_FAIL

#define SPR_HMER_XSCOM_FAIL   PPC_BIT(8)

Definition at line 24 of file spr.h.

◆ SPR_HMER_XSCOM_OCCUPIED

#define SPR_HMER_XSCOM_OCCUPIED   PPC_BIT(23)

Definition at line 33 of file spr.h.

◆ SPR_HMER_XSCOM_STATUS

#define SPR_HMER_XSCOM_STATUS   PPC_BITMASK(21, 23)

Definition at line 32 of file spr.h.

◆ SPR_HRMOR

#define SPR_HRMOR   0x139

Definition at line 15 of file spr.h.

◆ SPR_HSPRG0

#define SPR_HSPRG0   0x130

Definition at line 12 of file spr.h.

◆ SPR_HSPRG1

#define SPR_HSPRG1   0x131

Definition at line 13 of file spr.h.

◆ SPR_PVR

#define SPR_PVR   0x11F

Definition at line 8 of file spr.h.

◆ SPR_PVR_REV

#define SPR_PVR_REV (   maj,
  min 
)    (PPC_SHIFT((maj), 55) | PPC_SHIFT((min), 63))

Definition at line 10 of file spr.h.

◆ SPR_PVR_REV_MASK

#define SPR_PVR_REV_MASK   (PPC_BITMASK(52, 55) | PPC_BITMASK(60, 63))

Definition at line 9 of file spr.h.

◆ SPR_TB

#define SPR_TB   0x10C

Definition at line 6 of file spr.h.

Function Documentation

◆ clear_hmer()

static void clear_hmer ( void  )
inlinestatic

Definition at line 55 of file spr.h.

References SPR_HMER, and write_spr().

Referenced by read_scom_direct(), reset_scom_engine(), and write_scom_direct().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pvr_revision()

static uint64_t pvr_revision ( void  )
inlinestatic

Definition at line 67 of file spr.h.

References read_spr(), SPR_PVR, and SPR_PVR_REV_MASK.

Here is the call graph for this function:

◆ read_hmer()

static uint64_t read_hmer ( void  )
inlinestatic

Definition at line 50 of file spr.h.

References read_spr(), and SPR_HMER.

Referenced by read_scom_direct(), and write_scom_direct().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_msr()

static uint64_t read_msr ( void  )
inlinestatic

Definition at line 60 of file spr.h.

References val.

◆ read_spr()

static uint64_t read_spr ( int  spr)
inlinestatic

Definition at line 38 of file spr.h.

References val.

Referenced by pvr_revision(), read_hmer(), stage_entry(), and timer_monotonic_get().

Here is the caller graph for this function:

◆ write_spr()

static void write_spr ( int  spr,
uint64_t  val 
)
inlinestatic

Definition at line 45 of file spr.h.

References val.

Referenced by clear_hmer(), and stage_entry().

Here is the caller graph for this function: