introduction to omap4 pad configuration
DESCRIPTION
Introduction to omap4 pad configurationTRANSCRIPT
Introduction to OMAP4 Pad Configuration
Jiahe Jou
2012/12/13
RevisionsDATE AUTHOUR DESCRIPTION
2012/12/03 Jiahe Jou Draft.
Outline● Overview
● Pad Configuration
● Off Mode Control
● Wake Up Detection
● Power Optimization
● Configuration How To
● Case Study - Talos7
Overview● Configure pads to desired values according to device configuration
● Two sets of 32-bit pad configuration register
○ CORE power domain
○ WKUP power domain
● Each register has two pads with five fields functional bits
○ MUXMODE (3 bits)
○ PULL (2 bits)
○ INPUT ENABLE (1 bits)
○ OFF MODE VALUE (5 bits)
○ WAKE UP (2 bits)
Overview● Pad configuration register
2
Pad Configuration● Mode selection
○ MUXMODE (3 bits), 0b000 ~ 0b111
○ Functional modes, 0b000 ~ 0b110
MUXMODE Selected Mode
0b000 Mode 0, primary mode
0b001 Mode 1
0b010 Mode 2
0b011 Mode 3
0b100 Mode 4
0b101 Mode 5
0b110 Mode 6
0b111 Mode 7, safe mode
Pad Configuration● Examples
Pad Configuration● Pull selection
○ PULL (2 bits), 0b00 ~ 0b11
PULLBehavior
PULL TYPE PULL ENABLE
0b0 0b0 Pull Down, Not Activated
0b0 0b1 Pull Down, Activated
0b1 0b0 Pull Up, Not Activated
0b1 0b1 Pull Up, Activated
● Input enable
○ 0, input disable, output mode
○ 1, input enable, bidirectional mode
Pad Configuration● Off mode value
○ OFFMODEENABLE, off mode override control, 1 enable 0 disable
○ OFFMODEOUTENABLE, off mode output enable, 0 enable 1 disable
○ OFFMODEOUTVALUE, off mode output value
○ OFFMODEPULLUDENABLE, off mode pull up/down enable
○ OFFMODEPULLTYPESELECT, off mode pull type select
● Wake Up
○ WAKEUPENABLE, wake up detect enable
○ WAKEUPEVENT, wake up event status
Pad Configuration
Off Mode Control● Off mode selected
○ PRM_DEVICE_OFF_CTRL[0] DEVICE_OFF_ENABLE
○ CONTROL_PADCONF_GLOBAL[31] FORCE_OFFMODE_ENABLE
Wake Up Dectection● Wake up enabled
○ PRM_IO_PMCTRL[16]GLOBAL_WUEN
Power Optimization● Pin types
● Avoid unconnected or incorrectly pulled pins
○ For input, use pull up/down when possible
○ For output, avoid pull conflicts
○ For bi-direction, reconfigure the pin as an output driving 0
Power Optimization
Pad Configuration● Avoid unconnected pin (1)
○ If not driven externally, pull up/down is required
● Avoid pull conflict (2)
○ Prevent different pulls on the same line
● Avoid logic conflict (3)
○ if no external device drive the line, set the value as 0
○ else same value must
Pad Configuration● Recommended configuration for unconnected pads
Pad Configuration● Ball Characteristics
Configuration How To● Boot-loader
struct pad_conf_entry {
u16 offset;
u16 val;
};
● Kernel/* omap_mux_init_gpio - initialize a signal based on the GPIO number */
int omap_mux_init_gpio(int gpio, int val);
/* omap_mux_init_signal - initialize a signal based on the signal name */
int omap_mux_init_signal(const char *muxname, int val);
Configuration How To● Kernel
/* Centralized control for pad init, suspend and shutdown */
struct omap_pad_state_description {
char *init_mux_name;
u16 init_config;
char *suspend_mux_name;
u16 suspend_config;
char *shutdown_mux_name;
u16 shutdown_config;
u8 flags;
};
Case Study - Talos7
{GPMC_AD0, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)}, /* sdmmc2_dat0: eMMC_AD0 */
{GPMC_AD1, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)}, /* sdmmc2_dat1: eMMC_AD1 */
{GPMC_AD2, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)}, /* sdmmc2_dat2: eMMC_AD2 */
{GPMC_AD3, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)}, /* sdmmc2_dat3: eMMC_AD3 */
{GPMC_AD4, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)}, /* sdmmc2_dat4: eMMC_AD4 */
{GPMC_AD5, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)}, /* sdmmc2_dat5: eMMC_AD5 */
{GPMC_AD6, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)}, /* sdmmc2_dat6: eMMC_AD6 */
{GPMC_AD7, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)}, /* sdmmc2_dat7: eMMC_AD7 */
Case Study - Talos7
{SDMMC1_DAT4, (PTD | IDIS | M7)}, /* sdmmc1_dat4: NC: SafeMode */
{SDMMC1_DAT5, (PTD | IDIS | M7)}, /* sdmmc1_dat5: NC: SafeMode */
{SDMMC1_DAT6, (PTD | IDIS | M7)}, /* sdmmc1_dat6: NC: SafeMode */
{SDMMC1_DAT7, (PTD | IDIS | M7)}, /* sdmmc1_dat7: NC: SafeMode */
Case Study - Talos7omap_mux_init_gpio(GPIO_WIFI_IRQ, OMAP_PIN_INPUT | OMAP_PIN_OFF_WAKEUPENABLE);
omap_mux_init_gpio(GPIO_WIFI_PMENA, OMAP_PIN_OUTPUT);
omap_mux_init_signal("sdmmc5_cmd", OMAP_PIN_INPUT_PULLUP);
omap_mux_init_signal("sdmmc5_clk", OMAP_PIN_INPUT_PULLUP);
omap_mux_init_signal("sdmmc5_dat0", OMAP_PIN_INPUT_PULLUP);
omap_mux_init_signal("sdmmc5_dat1", OMAP_PIN_INPUT_PULLUP);
omap_mux_init_signal("sdmmc5_dat2", OMAP_PIN_INPUT_PULLUP);
omap_mux_init_signal("sdmmc5_dat3", OMAP_PIN_INPUT_PULLUP);
Case Study - Talos7static struct omap_pad_state_description talos_dynamic_pads[] __initdata = {
...
/*sdmmc2_clk */
{
.init_mux_name = "gpmc_noe.sdmmc2_clk",
.init_config = OMAP_PIN_INPUT_PULLUP,
},
/*sdmmc2_cmd */
{
.init_mux_name = "gpmc_nwe.sdmmc2_cmd",
.init_config = OMAP_PIN_INPUT_PULLUP,
}
...
}
Q&A
The End