| 1 | package register |
| 2 | |
| 3 | import "review.coreboot.org/coreboot.git/util/intelp2m/platforms/common/register/bits" |
| 4 | |
| 5 | type DW0 struct { |
| 6 | Register |
| 7 | } |
| 8 | |
| 9 | // getResetConfig() returns type reset source for corresponding pad |
| 10 | // PADRSTCFG field in PAD_CFG_DW0 register |
| 11 | func (dw0 *DW0) GetResetConfig() uint32 { |
| 12 | return dw0.GetFieldVal(bits.DW0, bits.DW0PadRstCfg) |
| 13 | } |
| 14 | |
| 15 | // getRXPadStateSelect() returns RX Pad State (RXINV) |
| 16 | // 0 = Raw RX pad state directly from RX buffer |
| 17 | // 1 = Internal RX pad state |
| 18 | func (dw0 *DW0) GetRXPadStateSelect() uint32 { |
| 19 | return dw0.GetFieldVal(bits.DW0, bits.DW0RxPadStateSelect) |
| 20 | } |
| 21 | |
| 22 | // getRXRawOverrideStatus() returns 1 if the selected pad state is being |
| 23 | // overridden to '1' (RXRAW1 field) |
| 24 | func (dw0 *DW0) GetRXRawOverrideStatus() uint32 { |
| 25 | return dw0.GetFieldVal(bits.DW0, bits.DW0RxRawOverrideTo1) |
| 26 | } |
| 27 | |
| 28 | // getRXLevelEdgeConfiguration() returns RX Level/Edge Configuration (RXEVCFG) |
| 29 | // 0h = Level, 1h = Edge, 2h = Drive '0', 3h = Reserved (implement as setting 0h) |
| 30 | func (dw0 *DW0) GetRXLevelEdgeConfiguration() uint32 { |
| 31 | return dw0.GetFieldVal(bits.DW0, bits.DW0RxLevelEdgeConfiguration) |
| 32 | } |
| 33 | |
| 34 | // GetRxInvert() returns RX Invert state (RXINV) |
| 35 | // 1 - Inversion, 0 - No inversion |
| 36 | func (dw0 *DW0) GetRxInvert() uint32 { |
| 37 | return dw0.GetFieldVal(bits.DW0, bits.DW0RxInvert) |
| 38 | } |
| 39 | |
| 40 | // getRxTxEnableConfig() returns RX/TX Enable Config (RXTXENCFG) |
| 41 | // 0 = Function defined in Pad Mode controls TX and RX Enables |
| 42 | // 1 = Function controls TX Enable and RX Disabled with RX drive 0 internally |
| 43 | // 2 = Function controls TX Enable and RX Disabled with RX drive 1 internally |
| 44 | // 3 = Function controls TX Enabled and RX is always enabled |
| 45 | func (dw0 *DW0) GetRxTxEnableConfig() uint32 { |
| 46 | return dw0.GetFieldVal(bits.DW0, bits.DW0RxTxEnableConfig) |
| 47 | } |
| 48 | |
| 49 | // getGPIOInputRouteIOxAPIC() returns 1 if the pad can be routed to cause |
| 50 | // peripheral IRQ when configured in GPIO input mode. |
| 51 | func (dw0 *DW0) GetGPIOInputRouteIOxAPIC() uint32 { |
| 52 | return dw0.GetFieldVal(bits.DW0, bits.DW0InputRouteIOxApic) |
| 53 | } |
| 54 | |
| 55 | // getGPIOInputRouteSCI() returns 1 if the pad can be routed to cause SCI when |
| 56 | // configured in GPIO input mode. |
| 57 | func (dw0 *DW0) GetGPIOInputRouteSCI() uint32 { |
| 58 | return dw0.GetFieldVal(bits.DW0, bits.DW0InputRouteSCI) |
| 59 | } |
| 60 | |
| 61 | // getGPIOInputRouteSMI() returns 1 if the pad can be routed to cause SMI when |
| 62 | // configured in GPIO input mode |
| 63 | func (dw0 *DW0) GetGPIOInputRouteSMI() uint32 { |
| 64 | return dw0.GetFieldVal(bits.DW0, bits.DW0InputRouteSMI) |
| 65 | } |
| 66 | |
| 67 | // getGPIOInputRouteNMI() returns 1 if the pad can be routed to cause NMI when |
| 68 | // configured in GPIO input mode |
| 69 | func (dw0 *DW0) GetGPIOInputRouteNMI() uint32 { |
| 70 | return dw0.GetFieldVal(bits.DW0, bits.DW0InputRouteNMI) |
| 71 | } |
| 72 | |
| 73 | // getPadMode() reutrns pad mode or one of the native functions |
| 74 | // 0h = GPIO control the Pad. |
| 75 | // 1h = native function 1, if applicable, controls the Pad |
| 76 | // 2h = native function 2, if applicable, controls the Pad |
| 77 | // 3h = native function 3, if applicable, controls the Pad |
| 78 | // 4h = enable GPIO blink/PWM capability if applicable |
| 79 | func (dw0 *DW0) GetPadMode() uint32 { |
| 80 | return dw0.GetFieldVal(bits.DW0, bits.DW0PadMode) |
| 81 | } |
| 82 | |
| 83 | // getGPIORxTxDisableStatus() returns GPIO RX/TX buffer state (GPIORXDIS | GPIOTXDIS) |
| 84 | // 0 - both are enabled, 1 - TX Disable, 2 - RX Disable, 3 - both are disabled |
| 85 | func (dw0 *DW0) GetGPIORxTxDisableStatus() uint32 { |
| 86 | return dw0.GetFieldVal(bits.DW0, bits.DW0RxTxBufDisable) |
| 87 | } |
| 88 | |
| 89 | // getGPIORXState() returns GPIO RX State (GPIORXSTATE) |
| 90 | func (dw0 *DW0) GetGPIORXState() uint32 { |
| 91 | return dw0.GetFieldVal(bits.DW0, bits.DW0RxState) |
| 92 | } |
| 93 | |
| 94 | // getGPIOTXState() returns GPIO TX State (GPIOTXSTATE) |
| 95 | func (dw0 *DW0) GetGPIOTXState() uint32 { |
| 96 | return dw0.GetFieldVal(bits.DW0, 0) |
| 97 | } |