GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing doc.coreboot.org — Configuring a mainboard’s GPIOs in coreboot — coreboot 26.09-612-g66e704b166f documentation Configuring a mainboard’s GPIOs in corebootIntroductionEvery mainboard needs to appropriately configure its General Purpose Inputs / Outputs (GPIOs). There are many facets of this issue, including which boot stage a GPIO might need to be configured. Boot stagesTypically, coreboot does most of its non-memory related initialization work in ramstage, when DRAM is available for use. Hence, the bulk of a mainboard’s GPIOs are configured in this stage. However, some boards might need a few GPIOs configured before that; think of memory strapping pins which indicate what kind of DRAM is installed. These pins might need to be read before initializing the memory, so these GPIOs are then typically configured in bootblock or romstage. ConfigurationMost mainboards will have a Intel SoCsMany newer Intel SoCs share a common IP block for GPIOs, and that commonality
has been taken advantage of in coreboot, which has a large set of macros that
can be used to describe the configuration of each GPIO pad. This file lives in
Older Intel SoCsBaytrail and Braswell, for example, simply expect the mainboard to supply a
callback, AMD SoCsSome AMD SoCs use a list of Register detailsGPIO configuration registers typically control properties such as:
Configuring GPIOs for pre-ramstagecoreboot provides for several SoC-specific and mainboard-specific callbacks at
specific points in time, such as bootblock-early, bootblock, romstage entry,
pre-silicon init, pre-RAM init, or post-RAM init. The GPIOs that are
configured in either bootblock or romstage, depending on when they are needed,
are denoted the “early” GPIOs. Some mainboard will use
struct pad_config { /* offset of pad within community */ int pad; /* Pad config data corresponding to DW0, DW1,.... */ uint32_t pad_config[GPIO_NUM_PAD_CFG_REGS]; }; and will usually place these in an array, one for each pad to be configured. Mainboards using Intel SoCs can use a library which combines common configurations together into a set of macros, e.g., /* Native function configuration */ #define PAD_CFG_NF(pad, pull, rst, func) /* General purpose output, no pullup/down. */ #define PAD_CFG_GPO(pad, val, rst) /* General purpose output, with termination specified */ #define PAD_CFG_TERM_GPO(pad, val, pull, rst) /* General purpose output, no pullup/down. */ #define PAD_CFG_GPO_GPIO_DRIVER(pad, val, rst, pull) /* General purpose input */ #define PAD_CFG_GPI(pad, pull, rst) etc. Configuring GPIOs for ramstage and beyond…In ramstage, most mainboards will configure the rest of their GPIOs for the
function they will be performing while the device is active. The goal is the
same as above in bootblock; another In the baseboard/variant model described above, the baseboard will provide the configuration for the GPIOs which are configured identically between variants, and will provide a mechanism for a variant to override the baseboard’s configuration. This is usually done via two tables: the baseboard table and the variant’s override table. This configuration is often hooked into the mainboard’s Unconnected and unused padsIn digital electronics, it is generally recommended to tie unconnected GPIOs to a defined signal like VCC or GND by setting their direction to output, adding an external pull resistor or configuring an internal pull resistor. This is done to prevent floating of the pin state, which can cause various issues like EMI, higher power usage due to continuously switching logic, etc. On Intel PCHs from Sunrise Point onwards, termination of unconnected GPIOs is
explicitly not required, when the input buffer is disabled by setting the bit
In case there are no schematics available for a board and the vendor set a
pad to something like Unconnected pads defaulting to a native function (input and output) usually
don’t need to be configured as GPIO with the Some pads configured as native input function explicitly require external pull-ups when being unused, according to the PDGs:
When the board was designed correctly, nothing needs to be done for them
explicitly, while using Potential issues (gotchas!)There are a couple of configurations that you need to especially careful about, as they can have a large impact on your mainboard. The first is configuring a pin as an output, when it was designed to be an input. There is a real risk in this case of short-circuiting a component which could cause catastrophic failures, up to and including your mainboard! Intel SoCsAs per Intel Platform Controller Hub (PCH) EDS since Skylake, a GPIO PAD register supports four different types of GPIO reset as:
Each GPIO Community has a Pad Configuration Lock register for a GPP allowing locking specific register fields in the PAD configuration register. The Pad Config Lock registers reset type is default hardcoded to Power Good and
it’s not configurable by GPIO PAD DW0.PadRstCfg. Hence, it may appear that for a GPP,
the Pad Reset Config (DW0 Bit 31) is configured differently from This would create confusion where the Pad configuration is returned to its Hence, as per GPIO BIOS Writers Guide (BWG) it’s recommended to change the Pad Reset
Configuration for lock GPP as Soft StrapsSoft straps, that can be configured by the vendor in the Intel Flash Image Tool (FIT), can influence some pads’ default mode. It is possible to select either a native function or GPIO mode for some pads on non-server SoCs, while on server SoCs most pads can be controlled. Thus, it is generally recommended to always configure all pads and don’t just rely on the defaults mentioned in the datasheet(s) which might not reflect what the vendor configured. Pad-related known issues and workaroundsLPC_CLKRUNB blocks S0ix states when board uses eSPIWhen using eSPI, the pad implementing | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||