3 #ifndef _DENVERTON_NS_GPIO_H_
4 #define _DENVERTON_NS_GPIO_H_
6 #include <soc/gpio_defs.h>
38 #define NO_REGISTER_FOR_PROPERTY (~0u)
43 #define GPIO_CONF_PAD_MODE_MASK 0xF
44 #define GPIO_CONF_PAD_MODE_BIT_POS 0
45 #define GPIO_CONF_HOST_OWN_MASK 0x3
46 #define GPIO_CONF_HOST_OWN_BIT_POS 0
47 #define GPIO_CONF_DIR_MASK 0x7
48 #define GPIO_CONF_DIR_BIT_POS 0
49 #define GPIO_CONF_INV_MASK 0x18
50 #define GPIO_CONF_INV_BIT_POS 3
51 #define GPIO_CONF_OUTPUT_MASK 0x3
52 #define GPIO_CONF_OUTPUT_BIT_POS 0
53 #define GPIO_CONF_INT_ROUTE_MASK 0x1F
54 #define GPIO_CONF_INT_ROUTE_BIT_POS 0
55 #define GPIO_CONF_INT_TRIG_MASK 0xE0
56 #define GPIO_CONF_INT_TRIG_BIT_POS 5
57 #define GPIO_CONF_RESET_MASK 0x7
58 #define GPIO_CONF_RESET_BIT_POS 0
59 #define GPIO_CONF_TERM_MASK 0x1F
60 #define GPIO_CONF_TERM_BIT_POS 0
61 #define GPIO_CONF_PADTOL_MASK 0x60
62 #define GPIO_CONF_PADTOL_BIT_POS 5
63 #define GPIO_CONF_LOCK_MASK 0x7
64 #define GPIO_CONF_LOCK_BIT_POS 0
65 #define GPIO_CONF_RXRAW_MASK 0x3
66 #define GPIO_CONF_RXRAW_BIT_POS 0
136 } __attribute__((packed));
GPIO_RESET_CONFIG
GPIO Power Configuration GPIO_RESET_CONFIG allows to set GPIO Reset (used to reset the specified Pad ...
@ GpioResetNormal
GPIO Reset.
@ GpioResetDefault
Leave value of pad reset unmodified.
@ GpioResetDeep
Deep GPIO Reset.
@ GpioResetPwrGood
Powergood reset.
@ GpioResetResume
Resume Reset (applicable only for GPD group)
GPIO_DIRECTION
GPIO Direction.
@ GpioDirInInvOut
Set pad for both output and input with inversion.
@ GpioDirIn
Set pad for input only.
@ GpioDirNone
Disable both output and input.
@ GpioDirOut
Set pad for output only.
@ GpioDirInInv
Set pad for input with inversion.
@ GpioDirInOut
Set pad for both output and input.
@ GpioDirDefault
Leave pad direction setting unmodified.
GPIO_HOSTSW_OWN
Host Software Pad Ownership modes.
@ GpioHostOwnGpio
Set HOST ownership to GPIO.
@ GpioHostOwnAcpi
Set HOST ownership to ACPI.
@ GpioHostOwnDefault
Leave ownership value unmodified.
GPIO_ELECTRICAL_CONFIG
GPIO Electrical Configuration Set GPIO termination and Pad Tolerance (applicable only for some pads) ...
@ GpioTermWpu5K
5kOhm weak pull-up
@ GpioTolerance1v8
Enable 1.8V pad tolerance.
@ GpioTermWpu20K
20kOhm weak pull-up
@ GpioTermDefault
Leave termination setting unmodified.
@ GpioTermWpu1K
1kOhm weak pull-up
@ GpioTermWpu2K
2kOhm weak pull-up
@ GpioTermWpd5K
5kOhm weak pull-down
@ GpioTermNative
Native function controls pads termination.
@ GpioTermWpu1K2K
1kOhm & 2kOhm weak pull-up
@ GpioNoTolerance1v8
Disable 1.8V pad tolerance.
@ GpioTermWpd20K
20kOhm weak pull-down
GPIO_OTHER_CONFIG
Other GPIO Configuration GPIO_OTHER_CONFIG is used for less often settings and for future extensions ...
@ GpioRxRaw1Default
Use default input override value.
@ GpioRxRaw1En
Override input to '1'.
@ GpioRxRaw1Dis
Don't override input.
GPIO_OUTPUT_STATE
GPIO Output State.
@ GpioOutHigh
Set output to high.
@ GpioOutDefault
Leave output value unmodified.
@ GpioOutLow
Set output to low.
GPIO_PAD_MODE
GPIO Pad Mode.
void gpio_configure_dnv_pads(const struct dnv_pad_config *gpio, size_t num)
GPIO_LOCK_CONFIG
GPIO LockConfiguration Set GPIO configuration lock and output state lock GpioLockPadConfig and GpioLo...
@ GpioPadConfigLock
Lock Pad Configuration.
@ GpioLockDefault
Leave lock setting unmodified.
@ GpioOutputStateLock
Lock GPIO pad output value.
GPIO_INT_CONFIG
GPIO interrupt configuration This setting is applicable only if GPIO is in input mode.
@ GpioIntSci
Enable SCI interrupt only.
@ GpioIntLevel
Set interrupt as level triggered.
@ GpioIntDefault
Leave value of interrupt routing unmodified.
@ GpioIntLvlEdgDis
Disable interrupt trigger.
@ GpioIntEdge
Set interrupt as edge triggered (type of edge depends on input inversion)
@ GpioIntNmi
Enable NMI interrupt only.
@ GpioIntDis
Disable IOxAPIC/SCI/SMI/NMI interrupt generation.
@ GpioIntBothEdge
Set interrupt as both edge triggered.
@ GpioIntApic
Enable IOxAPIC interrupt only.
@ GpioIntSmi
Enable SMI interrupt only.
GPIO configuration structure used for pin programming.
uint32_t HostSoftPadOwn
Host Software Pad Ownership Set pad to ACPI mode or GPIO Driver Mode.
uint32_t OutputState
Output State Set Pad output value.
uint32_t PadMode
Pad Mode Pad can be set as GPIO or one of its native functions.
uint32_t ElectricalConfig
GPIO Electrical Configuration This setting controls pads termination and voltage tolerance.
uint32_t PowerConfig
GPIO Power Configuration.
uint32_t RsvdBits
Reserved bits for future extension.
uint32_t InterruptConfig
GPIO Interrupt Configuration Set Pad to cause one of interrupts (IOxAPIC/SCI/SMI/NMI).
uint32_t OtherSettings
Additional GPIO configuration Refer to definition of GPIO_OTHER_CONFIG for supported settings.
uint32_t LockConfig
GPIO Lock Configuration This setting controls pads lock.
uint32_t Direction
GPIO Direction Can choose between In, In with inversion Out, both In and Out, both In with inversion ...
uint32_t PadCfgLockOffset
uint32_t PadCfgLockTxOffset
struct GPIO_CONFIG GpioConfig