/* indicates the highest GPIO number */ #define AB8500_GPIO_MAX_NUMBER 42
/* * The names of the pins are denoted by GPIO number and ball name, even * though they can be used for other things than GPIO, this is the first * column in the table of the data sheet and often used on schematics and * such.
*/ staticconststruct pinctrl_pin_desc ab8500_pins[] = {
PINCTRL_PIN(AB8500_PIN_T10, "GPIO1_T10"),
PINCTRL_PIN(AB8500_PIN_T9, "GPIO2_T9"),
PINCTRL_PIN(AB8500_PIN_U9, "GPIO3_U9"),
PINCTRL_PIN(AB8500_PIN_W2, "GPIO4_W2"), /* hole */
PINCTRL_PIN(AB8500_PIN_Y18, "GPIO6_Y18"),
PINCTRL_PIN(AB8500_PIN_AA20, "GPIO7_AA20"),
PINCTRL_PIN(AB8500_PIN_W18, "GPIO8_W18"),
PINCTRL_PIN(AB8500_PIN_AA19, "GPIO9_AA19"),
PINCTRL_PIN(AB8500_PIN_U17, "GPIO10_U17"),
PINCTRL_PIN(AB8500_PIN_AA18, "GPIO11_AA18"),
PINCTRL_PIN(AB8500_PIN_U16, "GPIO12_U16"),
PINCTRL_PIN(AB8500_PIN_W17, "GPIO13_W17"),
PINCTRL_PIN(AB8500_PIN_F14, "GPIO14_F14"),
PINCTRL_PIN(AB8500_PIN_B17, "GPIO15_B17"),
PINCTRL_PIN(AB8500_PIN_F15, "GPIO16_F15"),
PINCTRL_PIN(AB8500_PIN_P5, "GPIO17_P5"),
PINCTRL_PIN(AB8500_PIN_R5, "GPIO18_R5"),
PINCTRL_PIN(AB8500_PIN_U5, "GPIO19_U5"),
PINCTRL_PIN(AB8500_PIN_T5, "GPIO20_T5"),
PINCTRL_PIN(AB8500_PIN_H19, "GPIO21_H19"),
PINCTRL_PIN(AB8500_PIN_G20, "GPIO22_G20"),
PINCTRL_PIN(AB8500_PIN_G19, "GPIO23_G19"),
PINCTRL_PIN(AB8500_PIN_T14, "GPIO24_T14"),
PINCTRL_PIN(AB8500_PIN_R16, "GPIO25_R16"),
PINCTRL_PIN(AB8500_PIN_M16, "GPIO26_M16"),
PINCTRL_PIN(AB8500_PIN_J6, "GPIO27_J6"),
PINCTRL_PIN(AB8500_PIN_K6, "GPIO28_K6"),
PINCTRL_PIN(AB8500_PIN_G6, "GPIO29_G6"),
PINCTRL_PIN(AB8500_PIN_H6, "GPIO30_H6"),
PINCTRL_PIN(AB8500_PIN_F5, "GPIO31_F5"),
PINCTRL_PIN(AB8500_PIN_G5, "GPIO32_G5"), /* hole */
PINCTRL_PIN(AB8500_PIN_R17, "GPIO34_R17"),
PINCTRL_PIN(AB8500_PIN_W15, "GPIO35_W15"),
PINCTRL_PIN(AB8500_PIN_A17, "GPIO36_A17"),
PINCTRL_PIN(AB8500_PIN_E15, "GPIO37_E15"),
PINCTRL_PIN(AB8500_PIN_C17, "GPIO38_C17"),
PINCTRL_PIN(AB8500_PIN_E16, "GPIO39_E16"),
PINCTRL_PIN(AB8500_PIN_T19, "GPIO40_T19"),
PINCTRL_PIN(AB8500_PIN_U19, "GPIO41_U19"),
PINCTRL_PIN(AB8500_PIN_U2, "GPIO42_U2"),
};
/* * Read the pin group names like this: * sysclkreq2_d_1 = first groups of pins for sysclkreq2 on default function * * The groups are arranged as sets per altfunction column, so we can * mux in one group at a time by selecting the same altfunction for them * all. When functions require pins on different altfunctions, you need * to combine several groups.
*/
/* We use this macro to define the groups applicable to a function */ #define AB8500_FUNC_GROUPS(a, b...) \ staticconstchar * const a##_groups[] = { b };
/* * this table translates what's is in the AB8500 specification regarding the * balls alternate functions (as for DB, default, ALT_A, ALT_B and ALT_C). * ALTERNATE_FUNCTIONS(GPIO_NUMBER, GPIOSEL bit, ALTERNATFUNC bit1, * ALTERNATEFUNC bit2, ALTA val, ALTB val, ALTC val), * * example : * * ALTERNATE_FUNCTIONS(13, 4, 3, 4, 0, 1 ,2), * means that pin AB8500_PIN_W17 (pin 13) supports 4 mux (default/ALT_A, * ALT_B and ALT_C), so GPIOSEL and ALTERNATFUNC registers are used to * select the mux. ALTA, ALTB and ALTC val indicates values to write in * ALTERNATFUNC register. We need to specifies these values as SOC * designers didn't apply the same logic on how to select mux in the * ABx500 family. * * As this pins supports at least ALT_B mux, default mux is * selected by writing 1 in GPIOSEL bit : * * | GPIOSEL bit=4 | alternatfunc bit2=4 | alternatfunc bit1=3 * default | 1 | 0 | 0 * alt_A | 0 | 0 | 0 * alt_B | 0 | 0 | 1 * alt_C | 0 | 1 | 0 * * ALTERNATE_FUNCTIONS(8, 7, UNUSED, UNUSED), * means that pin AB8500_PIN_W18 (pin 8) supports 2 mux, so only GPIOSEL * register is used to select the mux. As this pins doesn't support at * least ALT_B mux, default mux is by writing 0 in GPIOSEL bit : * * | GPIOSEL bit=7 | alternatfunc bit2= | alternatfunc bit1= * default | 0 | 0 | 0 * alt_A | 1 | 0 | 0
*/
staticstruct
alternate_functions ab8500_alternate_functions[AB8500_GPIO_MAX_NUMBER + 1] = {
ALTERNATE_FUNCTIONS(0, UNUSED, UNUSED, UNUSED, 0, 0, 0), /* no GPIO0 */
ALTERNATE_FUNCTIONS(1, 0, UNUSED, UNUSED, 0, 0, 0), /* GPIO1, altA controlled by bit 0 */
ALTERNATE_FUNCTIONS(2, 1, UNUSED, UNUSED, 0, 0, 0), /* GPIO2, altA controlled by bit 1 */
ALTERNATE_FUNCTIONS(3, 2, UNUSED, UNUSED, 0, 0, 0), /* GPIO3, altA controlled by bit 2*/
ALTERNATE_FUNCTIONS(4, 3, UNUSED, UNUSED, 0, 0, 0), /* GPIO4, altA controlled by bit 3*/ /* bit 4 reserved */
ALTERNATE_FUNCTIONS(5, UNUSED, UNUSED, UNUSED, 0, 0, 0), /* no GPIO5 */
ALTERNATE_FUNCTIONS(6, 5, UNUSED, UNUSED, 0, 0, 0), /* GPIO6, altA controlled by bit 5*/
ALTERNATE_FUNCTIONS(7, 6, UNUSED, UNUSED, 0, 0, 0), /* GPIO7, altA controlled by bit 6*/
ALTERNATE_FUNCTIONS(8, 7, UNUSED, UNUSED, 0, 0, 0), /* GPIO8, altA controlled by bit 7*/
ALTERNATE_FUNCTIONS(9, 0, UNUSED, UNUSED, 0, 0, 0), /* GPIO9, altA controlled by bit 0*/
ALTERNATE_FUNCTIONS(10, 1, 0, UNUSED, 0, 1, 0), /* GPIO10, altA and altB controlled by bit 0 */
ALTERNATE_FUNCTIONS(11, 2, 1, UNUSED, 0, 1, 0), /* GPIO11, altA and altB controlled by bit 1 */
ALTERNATE_FUNCTIONS(12, 3, 2, UNUSED, 0, 1, 0), /* GPIO12, altA and altB controlled by bit 2 */
ALTERNATE_FUNCTIONS(13, 4, 3, 4, 0, 1, 2), /* GPIO13, altA altB and altC controlled by bit 3 and 4 */
ALTERNATE_FUNCTIONS(14, 5, UNUSED, UNUSED, 0, 0, 0), /* GPIO14, altA controlled by bit 5 */
ALTERNATE_FUNCTIONS(15, 6, UNUSED, UNUSED, 0, 0, 0), /* GPIO15, altA controlled by bit 6 */
ALTERNATE_FUNCTIONS(16, 7, UNUSED, UNUSED, 0, 0, 0), /* GPIO16, altA controlled by bit 7 */ /* * pins 17 to 20 are special case, only bit 0 is used to select * alternate function for these 4 pins. * bits 1 to 3 are reserved
*/
ALTERNATE_FUNCTIONS(17, 0, UNUSED, UNUSED, 0, 0, 0), /* GPIO17, altA controlled by bit 0 */
ALTERNATE_FUNCTIONS(18, 0, UNUSED, UNUSED, 0, 0, 0), /* GPIO18, altA controlled by bit 0 */
ALTERNATE_FUNCTIONS(19, 0, UNUSED, UNUSED, 0, 0, 0), /* GPIO19, altA controlled by bit 0 */
ALTERNATE_FUNCTIONS(20, 0, UNUSED, UNUSED, 0, 0, 0), /* GPIO20, altA controlled by bit 0 */
ALTERNATE_FUNCTIONS(21, 4, UNUSED, UNUSED, 0, 0, 0), /* GPIO21, altA controlled by bit 4 */
ALTERNATE_FUNCTIONS(22, 5, UNUSED, UNUSED, 0, 0, 0), /* GPIO22, altA controlled by bit 5 */
ALTERNATE_FUNCTIONS(23, 6, UNUSED, UNUSED, 0, 0, 0), /* GPIO23, altA controlled by bit 6 */
ALTERNATE_FUNCTIONS(24, 7, UNUSED, UNUSED, 0, 0, 0), /* GPIO24, altA controlled by bit 7 */
ALTERNATE_FUNCTIONS(25, 0, UNUSED, UNUSED, 0, 0, 0), /* GPIO25, altA controlled by bit 0 */ /* pin 26 special case, no alternate function, bit 1 reserved */
ALTERNATE_FUNCTIONS(26, UNUSED, UNUSED, UNUSED, 0, 0, 0), /* GPIO26 */
ALTERNATE_FUNCTIONS(27, 2, UNUSED, UNUSED, 0, 0, 0), /* GPIO27, altA controlled by bit 2 */
ALTERNATE_FUNCTIONS(28, 3, UNUSED, UNUSED, 0, 0, 0), /* GPIO28, altA controlled by bit 3 */
ALTERNATE_FUNCTIONS(29, 4, UNUSED, UNUSED, 0, 0, 0), /* GPIO29, altA controlled by bit 4 */
ALTERNATE_FUNCTIONS(30, 5, UNUSED, UNUSED, 0, 0, 0), /* GPIO30, altA controlled by bit 5 */
ALTERNATE_FUNCTIONS(31, 6, UNUSED, UNUSED, 0, 0, 0), /* GPIO31, altA controlled by bit 6 */
ALTERNATE_FUNCTIONS(32, 7, UNUSED, UNUSED, 0, 0, 0), /* GPIO32, altA controlled by bit 7 */
ALTERNATE_FUNCTIONS(33, UNUSED, UNUSED, UNUSED, 0, 0, 0), /* no GPIO33 */
ALTERNATE_FUNCTIONS(34, 1, UNUSED, UNUSED, 0, 0, 0), /* GPIO34, altA controlled by bit 1 */ /* pin 35 special case, no alternate function, bit 2 reserved */
ALTERNATE_FUNCTIONS(35, UNUSED, UNUSED, UNUSED, 0, 0, 0), /* GPIO35 */
ALTERNATE_FUNCTIONS(36, 3, UNUSED, UNUSED, 0, 0, 0), /* GPIO36, altA controlled by bit 3 */
ALTERNATE_FUNCTIONS(37, 4, UNUSED, UNUSED, 0, 0, 0), /* GPIO37, altA controlled by bit 4 */
ALTERNATE_FUNCTIONS(38, 5, UNUSED, UNUSED, 0, 0, 0), /* GPIO38, altA controlled by bit 5 */
ALTERNATE_FUNCTIONS(39, 6, UNUSED, UNUSED, 0, 0, 0), /* GPIO39, altA controlled by bit 6 */
ALTERNATE_FUNCTIONS(40, 7, UNUSED, UNUSED, 0, 0, 0), /* GPIO40, altA controlled by bit 7 */
ALTERNATE_FUNCTIONS(41, 0, UNUSED, UNUSED, 0, 0, 0), /* GPIO41, altA controlled by bit 0 */
ALTERNATE_FUNCTIONS(42, 1, UNUSED, UNUSED, 0, 0, 0), /* GPIO42, altA controlled by bit 1 */
};
/* * Only some GPIOs are interrupt capable, and they are * organized in discontiguous clusters: * * GPIO6 to GPIO13 * GPIO24 and GPIO25 * GPIO36 to GPIO41
*/ staticstruct abx500_gpio_irq_cluster ab8500_gpio_irq_cluster[] = {
GPIO_IRQ_CLUSTER(6, 13, AB8500_INT_GPIO6R),
GPIO_IRQ_CLUSTER(24, 25, AB8500_INT_GPIO24R),
GPIO_IRQ_CLUSTER(36, 41, AB8500_INT_GPIO36R),
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.