Software APIs
dt_lc_ctrl.h File Reference

Device Tables (DT) for IP lc_ctrl and top earlgrey. More...

#include "dt_api.h"
#include <stdint.h>

Go to the source code of this file.

Macros

#define OPENTITAN_LC_CTRL_HAS_STATE_RAW   1
 List of supported hardware features.
 
#define OPENTITAN_LC_CTRL_HAS_STATE_TEST_UNLOCKED   1
 
#define OPENTITAN_LC_CTRL_HAS_STATE_TEST_LOCKED   1
 
#define OPENTITAN_LC_CTRL_HAS_STATE_DEV   1
 
#define OPENTITAN_LC_CTRL_HAS_STATE_PROD   1
 
#define OPENTITAN_LC_CTRL_HAS_STATE_PROD_END   1
 
#define OPENTITAN_LC_CTRL_HAS_STATE_RMA   1
 
#define OPENTITAN_LC_CTRL_HAS_STATE_SCRAP   1
 
#define OPENTITAN_LC_CTRL_HAS_ACCESS_JTAG   1
 
#define OPENTITAN_LC_CTRL_HAS_ACCESS_EXT_CLK   1
 
#define OPENTITAN_LC_CTRL_HAS_AUTHENTICATED_TRANSITIONS   1
 
#define OPENTITAN_LC_CTRL_HAS_LOGICAL_SCRAP   1
 

Typedefs

typedef enum dt_lc_ctrl dt_lc_ctrl_t
 List of instances.
 
typedef enum dt_lc_ctrl_reg_block dt_lc_ctrl_reg_block_t
 List of register blocks.
 
typedef enum dt_lc_ctrl_alert dt_lc_ctrl_alert_t
 List of Alerts.
 
typedef enum dt_lc_ctrl_clock dt_lc_ctrl_clock_t
 List of clock ports.
 
typedef enum dt_lc_ctrl_reset dt_lc_ctrl_reset_t
 List of reset ports.
 

Enumerations

enum  dt_lc_ctrl {
  kDtLcCtrl = 0 ,
  kDtLcCtrlFirst = 0 ,
  kDtLcCtrlCount = 1
}
 List of instances. More...
 
enum  dt_lc_ctrl_reg_block {
  kDtLcCtrlRegBlockRegs = 0 ,
  kDtLcCtrlRegBlockDmi = 1 ,
  kDtLcCtrlRegBlockCount = 2
}
 List of register blocks. More...
 
enum  dt_lc_ctrl_alert {
  kDtLcCtrlAlertFatalProgError = 0 ,
  kDtLcCtrlAlertFatalStateError = 1 ,
  kDtLcCtrlAlertFatalBusIntegError = 2 ,
  kDtLcCtrlAlertCount = 3
}
 List of Alerts. More...
 
enum  dt_lc_ctrl_clock {
  kDtLcCtrlClockClk = 0 ,
  kDtLcCtrlClockKmac = 1 ,
  kDtLcCtrlClockCount = 2
}
 List of clock ports. More...
 
enum  dt_lc_ctrl_reset {
  kDtLcCtrlResetRst = 0 ,
  kDtLcCtrlResetKmac = 1 ,
  kDtLcCtrlResetCount = 2
}
 List of reset ports. More...
 

Functions

dt_lc_ctrl_t dt_lc_ctrl_from_instance_id (dt_instance_id_t inst_id)
 Get the lc_ctrl instance from an instance ID.
 
dt_instance_id_t dt_lc_ctrl_instance_id (dt_lc_ctrl_t dt)
 Get the instance ID of an instance.
 
uint32_t dt_lc_ctrl_reg_block (dt_lc_ctrl_t dt, dt_lc_ctrl_reg_block_t reg_block)
 Get the register base address of an instance.
 
dt_alert_id_t dt_lc_ctrl_alert_to_alert_id (dt_lc_ctrl_t dt, dt_lc_ctrl_alert_t alert)
 Get the alert ID of a lc_ctrl alert for a given instance.
 
dt_lc_ctrl_alert_t dt_lc_ctrl_alert_from_alert_id (dt_lc_ctrl_t dt, dt_alert_id_t alert)
 Convert a global alert ID to a local lc_ctrl alert type.
 
dt_clock_t dt_lc_ctrl_clock (dt_lc_ctrl_t dt, dt_lc_ctrl_clock_t clk)
 Get the clock signal connected to a clock port of an instance.
 
dt_reset_t dt_lc_ctrl_reset (dt_lc_ctrl_t dt, dt_lc_ctrl_reset_t rst)
 Get the reset signal connected to a reset port of an instance.
 

Detailed Description

Device Tables (DT) for IP lc_ctrl and top earlgrey.

This file contains the type definitions and global functions of the lc_ctrl.

Definition in file dt_lc_ctrl.h.

Macro Definition Documentation

◆ OPENTITAN_LC_CTRL_HAS_ACCESS_EXT_CLK

#define OPENTITAN_LC_CTRL_HAS_ACCESS_EXT_CLK   1

Definition at line 89 of file dt_lc_ctrl.h.

◆ OPENTITAN_LC_CTRL_HAS_ACCESS_JTAG

#define OPENTITAN_LC_CTRL_HAS_ACCESS_JTAG   1

Definition at line 88 of file dt_lc_ctrl.h.

◆ OPENTITAN_LC_CTRL_HAS_AUTHENTICATED_TRANSITIONS

#define OPENTITAN_LC_CTRL_HAS_AUTHENTICATED_TRANSITIONS   1

Definition at line 90 of file dt_lc_ctrl.h.

◆ OPENTITAN_LC_CTRL_HAS_LOGICAL_SCRAP

#define OPENTITAN_LC_CTRL_HAS_LOGICAL_SCRAP   1

Definition at line 91 of file dt_lc_ctrl.h.

◆ OPENTITAN_LC_CTRL_HAS_STATE_DEV

#define OPENTITAN_LC_CTRL_HAS_STATE_DEV   1

Definition at line 83 of file dt_lc_ctrl.h.

◆ OPENTITAN_LC_CTRL_HAS_STATE_PROD

#define OPENTITAN_LC_CTRL_HAS_STATE_PROD   1

Definition at line 84 of file dt_lc_ctrl.h.

◆ OPENTITAN_LC_CTRL_HAS_STATE_PROD_END

#define OPENTITAN_LC_CTRL_HAS_STATE_PROD_END   1

Definition at line 85 of file dt_lc_ctrl.h.

◆ OPENTITAN_LC_CTRL_HAS_STATE_RAW

#define OPENTITAN_LC_CTRL_HAS_STATE_RAW   1

List of supported hardware features.

Definition at line 80 of file dt_lc_ctrl.h.

◆ OPENTITAN_LC_CTRL_HAS_STATE_RMA

#define OPENTITAN_LC_CTRL_HAS_STATE_RMA   1

Definition at line 86 of file dt_lc_ctrl.h.

◆ OPENTITAN_LC_CTRL_HAS_STATE_SCRAP

#define OPENTITAN_LC_CTRL_HAS_STATE_SCRAP   1

Definition at line 87 of file dt_lc_ctrl.h.

◆ OPENTITAN_LC_CTRL_HAS_STATE_TEST_LOCKED

#define OPENTITAN_LC_CTRL_HAS_STATE_TEST_LOCKED   1

Definition at line 82 of file dt_lc_ctrl.h.

◆ OPENTITAN_LC_CTRL_HAS_STATE_TEST_UNLOCKED

#define OPENTITAN_LC_CTRL_HAS_STATE_TEST_UNLOCKED   1

Definition at line 81 of file dt_lc_ctrl.h.

Typedef Documentation

◆ dt_lc_ctrl_alert_t

List of Alerts.

Alerts are guaranteed to be numbered consecutively from 0.

◆ dt_lc_ctrl_clock_t

List of clock ports.

Clock ports are guaranteed to be numbered consecutively from 0.

◆ dt_lc_ctrl_reg_block_t

List of register blocks.

Register blocks are guaranteed to start at 0 and to be consecutively numbered.

◆ dt_lc_ctrl_reset_t

List of reset ports.

Reset ports are guaranteed to be numbered consecutively from 0.

Enumeration Type Documentation

◆ dt_lc_ctrl

enum dt_lc_ctrl

List of instances.

Enumerator
kDtLcCtrl 

lc_ctrl

Definition at line 23 of file dt_lc_ctrl.h.

◆ dt_lc_ctrl_alert

List of Alerts.

Alerts are guaranteed to be numbered consecutively from 0.

Enumerator
kDtLcCtrlAlertFatalProgError 

This alert triggers if an error occurred during an OTP programming operation.

kDtLcCtrlAlertFatalStateError 

This alert triggers if an error in the life cycle state or life cycle controller FSM is detected.

kDtLcCtrlAlertFatalBusIntegError 

This fatal alert is triggered when a fatal TL-UL bus integrity fault is detected.

Definition at line 48 of file dt_lc_ctrl.h.

◆ dt_lc_ctrl_clock

List of clock ports.

Clock ports are guaranteed to be numbered consecutively from 0.

Enumerator
kDtLcCtrlClockClk 

Clock port clk_i.

kDtLcCtrlClockKmac 

Clock port clk_kmac_i.

Definition at line 60 of file dt_lc_ctrl.h.

◆ dt_lc_ctrl_reg_block

List of register blocks.

Register blocks are guaranteed to start at 0 and to be consecutively numbered.

Definition at line 34 of file dt_lc_ctrl.h.

◆ dt_lc_ctrl_reset

List of reset ports.

Reset ports are guaranteed to be numbered consecutively from 0.

Enumerator
kDtLcCtrlResetRst 

Reset port rst_ni.

kDtLcCtrlResetKmac 

Reset port rst_kmac_ni.

Definition at line 71 of file dt_lc_ctrl.h.

Function Documentation

◆ dt_lc_ctrl_alert_from_alert_id()

dt_lc_ctrl_alert_t dt_lc_ctrl_alert_from_alert_id ( dt_lc_ctrl_t dt,
dt_alert_id_t alert )

Convert a global alert ID to a local lc_ctrl alert type.

Parameters
dtInstance of lc_ctrl.
alertA global alert ID that belongs to this instance.
Returns
The lc_ctrl alert, or kDtLcCtrlAlertCount.

Note: This function assumes that the global alert ID belongs to the instance of lc_ctrl passed in parameter. In other words, it must be the case that dt_lc_ctrl_instance_id(dt) == dt_alert_id_to_instance_id(alert). Otherwise, this function will return kDtLcCtrlAlertCount.

Definition at line 87 of file dt_lc_ctrl.c.

◆ dt_lc_ctrl_alert_to_alert_id()

dt_alert_id_t dt_lc_ctrl_alert_to_alert_id ( dt_lc_ctrl_t dt,
dt_lc_ctrl_alert_t alert )

Get the alert ID of a lc_ctrl alert for a given instance.

Note: This function only makes sense if the instance is connected to the Alert Handler. For any instances where the instance is not connected, the return value is unspecified.

Parameters
dtInstance of lc_ctrl.
alertA lc_ctrl alert.
Returns
The Alert Handler alert ID of the alert of this instance.

Definition at line 81 of file dt_lc_ctrl.c.

◆ dt_lc_ctrl_clock()

Get the clock signal connected to a clock port of an instance.

Parameters
dtInstance of lc_ctrl.
clkClock port.
Returns
Clock signal.

Definition at line 99 of file dt_lc_ctrl.c.

◆ dt_lc_ctrl_from_instance_id()

dt_lc_ctrl_t dt_lc_ctrl_from_instance_id ( dt_instance_id_t inst_id)

Get the lc_ctrl instance from an instance ID.

For example, dt_uart_from_instance_id(kDtInstanceIdUart3) == kDtUart3.

Parameters
inst_idInstance ID.
Returns
A lc_ctrl instance.

Note: This function only makes sense if the instance ID has device type lc_ctrl, otherwise the returned value is unspecified.

Definition at line 61 of file dt_lc_ctrl.c.

◆ dt_lc_ctrl_instance_id()

dt_instance_id_t dt_lc_ctrl_instance_id ( dt_lc_ctrl_t dt)

Get the instance ID of an instance.

Parameters
dtInstance of lc_ctrl.
Returns
The instance ID of that instance.

Definition at line 68 of file dt_lc_ctrl.c.

◆ dt_lc_ctrl_reg_block()

Get the register base address of an instance.

Parameters
dtInstance of lc_ctrl.
reg_blockThe register block requested.
Returns
The register base address of the requested block.

Definition at line 73 of file dt_lc_ctrl.c.

◆ dt_lc_ctrl_reset()

Get the reset signal connected to a reset port of an instance.

Parameters
dtInstance of lc_ctrl.
rstReset port.
Returns
Reset signal.

Definition at line 106 of file dt_lc_ctrl.c.