162306a36Sopenharmony_ci/* 262306a36Sopenharmony_ci * Driver for the ST Microelectronics SPEAr3xx pinmux 362306a36Sopenharmony_ci * 462306a36Sopenharmony_ci * Copyright (C) 2012 ST Microelectronics 562306a36Sopenharmony_ci * Viresh Kumar <vireshk@kernel.org> 662306a36Sopenharmony_ci * 762306a36Sopenharmony_ci * This file is licensed under the terms of the GNU General Public 862306a36Sopenharmony_ci * License version 2. This program is licensed "as is" without any 962306a36Sopenharmony_ci * warranty of any kind, whether express or implied. 1062306a36Sopenharmony_ci */ 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_ci#include <linux/pinctrl/pinctrl.h> 1362306a36Sopenharmony_ci 1462306a36Sopenharmony_ci#include "pinctrl-spear3xx.h" 1562306a36Sopenharmony_ci 1662306a36Sopenharmony_ci/* pins */ 1762306a36Sopenharmony_cistatic const struct pinctrl_pin_desc spear3xx_pins[] = { 1862306a36Sopenharmony_ci SPEAR_PIN_0_TO_101, 1962306a36Sopenharmony_ci}; 2062306a36Sopenharmony_ci 2162306a36Sopenharmony_ci/* firda_pins */ 2262306a36Sopenharmony_cistatic const unsigned firda_pins[] = { 0, 1 }; 2362306a36Sopenharmony_cistatic struct spear_muxreg firda_muxreg[] = { 2462306a36Sopenharmony_ci { 2562306a36Sopenharmony_ci .reg = -1, 2662306a36Sopenharmony_ci .mask = PMX_FIRDA_MASK, 2762306a36Sopenharmony_ci .val = PMX_FIRDA_MASK, 2862306a36Sopenharmony_ci }, 2962306a36Sopenharmony_ci}; 3062306a36Sopenharmony_ci 3162306a36Sopenharmony_cistatic struct spear_modemux firda_modemux[] = { 3262306a36Sopenharmony_ci { 3362306a36Sopenharmony_ci .modes = ~0, 3462306a36Sopenharmony_ci .muxregs = firda_muxreg, 3562306a36Sopenharmony_ci .nmuxregs = ARRAY_SIZE(firda_muxreg), 3662306a36Sopenharmony_ci }, 3762306a36Sopenharmony_ci}; 3862306a36Sopenharmony_ci 3962306a36Sopenharmony_cistruct spear_pingroup spear3xx_firda_pingroup = { 4062306a36Sopenharmony_ci .name = "firda_grp", 4162306a36Sopenharmony_ci .pins = firda_pins, 4262306a36Sopenharmony_ci .npins = ARRAY_SIZE(firda_pins), 4362306a36Sopenharmony_ci .modemuxs = firda_modemux, 4462306a36Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(firda_modemux), 4562306a36Sopenharmony_ci}; 4662306a36Sopenharmony_ci 4762306a36Sopenharmony_cistatic const char *const firda_grps[] = { "firda_grp" }; 4862306a36Sopenharmony_cistruct spear_function spear3xx_firda_function = { 4962306a36Sopenharmony_ci .name = "firda", 5062306a36Sopenharmony_ci .groups = firda_grps, 5162306a36Sopenharmony_ci .ngroups = ARRAY_SIZE(firda_grps), 5262306a36Sopenharmony_ci}; 5362306a36Sopenharmony_ci 5462306a36Sopenharmony_ci/* i2c_pins */ 5562306a36Sopenharmony_cistatic const unsigned i2c_pins[] = { 4, 5 }; 5662306a36Sopenharmony_cistatic struct spear_muxreg i2c_muxreg[] = { 5762306a36Sopenharmony_ci { 5862306a36Sopenharmony_ci .reg = -1, 5962306a36Sopenharmony_ci .mask = PMX_I2C_MASK, 6062306a36Sopenharmony_ci .val = PMX_I2C_MASK, 6162306a36Sopenharmony_ci }, 6262306a36Sopenharmony_ci}; 6362306a36Sopenharmony_ci 6462306a36Sopenharmony_cistatic struct spear_modemux i2c_modemux[] = { 6562306a36Sopenharmony_ci { 6662306a36Sopenharmony_ci .modes = ~0, 6762306a36Sopenharmony_ci .muxregs = i2c_muxreg, 6862306a36Sopenharmony_ci .nmuxregs = ARRAY_SIZE(i2c_muxreg), 6962306a36Sopenharmony_ci }, 7062306a36Sopenharmony_ci}; 7162306a36Sopenharmony_ci 7262306a36Sopenharmony_cistruct spear_pingroup spear3xx_i2c_pingroup = { 7362306a36Sopenharmony_ci .name = "i2c0_grp", 7462306a36Sopenharmony_ci .pins = i2c_pins, 7562306a36Sopenharmony_ci .npins = ARRAY_SIZE(i2c_pins), 7662306a36Sopenharmony_ci .modemuxs = i2c_modemux, 7762306a36Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(i2c_modemux), 7862306a36Sopenharmony_ci}; 7962306a36Sopenharmony_ci 8062306a36Sopenharmony_cistatic const char *const i2c_grps[] = { "i2c0_grp" }; 8162306a36Sopenharmony_cistruct spear_function spear3xx_i2c_function = { 8262306a36Sopenharmony_ci .name = "i2c0", 8362306a36Sopenharmony_ci .groups = i2c_grps, 8462306a36Sopenharmony_ci .ngroups = ARRAY_SIZE(i2c_grps), 8562306a36Sopenharmony_ci}; 8662306a36Sopenharmony_ci 8762306a36Sopenharmony_ci/* ssp_cs_pins */ 8862306a36Sopenharmony_cistatic const unsigned ssp_cs_pins[] = { 34, 35, 36 }; 8962306a36Sopenharmony_cistatic struct spear_muxreg ssp_cs_muxreg[] = { 9062306a36Sopenharmony_ci { 9162306a36Sopenharmony_ci .reg = -1, 9262306a36Sopenharmony_ci .mask = PMX_SSP_CS_MASK, 9362306a36Sopenharmony_ci .val = PMX_SSP_CS_MASK, 9462306a36Sopenharmony_ci }, 9562306a36Sopenharmony_ci}; 9662306a36Sopenharmony_ci 9762306a36Sopenharmony_cistatic struct spear_modemux ssp_cs_modemux[] = { 9862306a36Sopenharmony_ci { 9962306a36Sopenharmony_ci .modes = ~0, 10062306a36Sopenharmony_ci .muxregs = ssp_cs_muxreg, 10162306a36Sopenharmony_ci .nmuxregs = ARRAY_SIZE(ssp_cs_muxreg), 10262306a36Sopenharmony_ci }, 10362306a36Sopenharmony_ci}; 10462306a36Sopenharmony_ci 10562306a36Sopenharmony_cistruct spear_pingroup spear3xx_ssp_cs_pingroup = { 10662306a36Sopenharmony_ci .name = "ssp_cs_grp", 10762306a36Sopenharmony_ci .pins = ssp_cs_pins, 10862306a36Sopenharmony_ci .npins = ARRAY_SIZE(ssp_cs_pins), 10962306a36Sopenharmony_ci .modemuxs = ssp_cs_modemux, 11062306a36Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(ssp_cs_modemux), 11162306a36Sopenharmony_ci}; 11262306a36Sopenharmony_ci 11362306a36Sopenharmony_cistatic const char *const ssp_cs_grps[] = { "ssp_cs_grp" }; 11462306a36Sopenharmony_cistruct spear_function spear3xx_ssp_cs_function = { 11562306a36Sopenharmony_ci .name = "ssp_cs", 11662306a36Sopenharmony_ci .groups = ssp_cs_grps, 11762306a36Sopenharmony_ci .ngroups = ARRAY_SIZE(ssp_cs_grps), 11862306a36Sopenharmony_ci}; 11962306a36Sopenharmony_ci 12062306a36Sopenharmony_ci/* ssp_pins */ 12162306a36Sopenharmony_cistatic const unsigned ssp_pins[] = { 6, 7, 8, 9 }; 12262306a36Sopenharmony_cistatic struct spear_muxreg ssp_muxreg[] = { 12362306a36Sopenharmony_ci { 12462306a36Sopenharmony_ci .reg = -1, 12562306a36Sopenharmony_ci .mask = PMX_SSP_MASK, 12662306a36Sopenharmony_ci .val = PMX_SSP_MASK, 12762306a36Sopenharmony_ci }, 12862306a36Sopenharmony_ci}; 12962306a36Sopenharmony_ci 13062306a36Sopenharmony_cistatic struct spear_modemux ssp_modemux[] = { 13162306a36Sopenharmony_ci { 13262306a36Sopenharmony_ci .modes = ~0, 13362306a36Sopenharmony_ci .muxregs = ssp_muxreg, 13462306a36Sopenharmony_ci .nmuxregs = ARRAY_SIZE(ssp_muxreg), 13562306a36Sopenharmony_ci }, 13662306a36Sopenharmony_ci}; 13762306a36Sopenharmony_ci 13862306a36Sopenharmony_cistruct spear_pingroup spear3xx_ssp_pingroup = { 13962306a36Sopenharmony_ci .name = "ssp0_grp", 14062306a36Sopenharmony_ci .pins = ssp_pins, 14162306a36Sopenharmony_ci .npins = ARRAY_SIZE(ssp_pins), 14262306a36Sopenharmony_ci .modemuxs = ssp_modemux, 14362306a36Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(ssp_modemux), 14462306a36Sopenharmony_ci}; 14562306a36Sopenharmony_ci 14662306a36Sopenharmony_cistatic const char *const ssp_grps[] = { "ssp0_grp" }; 14762306a36Sopenharmony_cistruct spear_function spear3xx_ssp_function = { 14862306a36Sopenharmony_ci .name = "ssp0", 14962306a36Sopenharmony_ci .groups = ssp_grps, 15062306a36Sopenharmony_ci .ngroups = ARRAY_SIZE(ssp_grps), 15162306a36Sopenharmony_ci}; 15262306a36Sopenharmony_ci 15362306a36Sopenharmony_ci/* mii_pins */ 15462306a36Sopenharmony_cistatic const unsigned mii_pins[] = { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 15562306a36Sopenharmony_ci 21, 22, 23, 24, 25, 26, 27 }; 15662306a36Sopenharmony_cistatic struct spear_muxreg mii_muxreg[] = { 15762306a36Sopenharmony_ci { 15862306a36Sopenharmony_ci .reg = -1, 15962306a36Sopenharmony_ci .mask = PMX_MII_MASK, 16062306a36Sopenharmony_ci .val = PMX_MII_MASK, 16162306a36Sopenharmony_ci }, 16262306a36Sopenharmony_ci}; 16362306a36Sopenharmony_ci 16462306a36Sopenharmony_cistatic struct spear_modemux mii_modemux[] = { 16562306a36Sopenharmony_ci { 16662306a36Sopenharmony_ci .modes = ~0, 16762306a36Sopenharmony_ci .muxregs = mii_muxreg, 16862306a36Sopenharmony_ci .nmuxregs = ARRAY_SIZE(mii_muxreg), 16962306a36Sopenharmony_ci }, 17062306a36Sopenharmony_ci}; 17162306a36Sopenharmony_ci 17262306a36Sopenharmony_cistruct spear_pingroup spear3xx_mii_pingroup = { 17362306a36Sopenharmony_ci .name = "mii0_grp", 17462306a36Sopenharmony_ci .pins = mii_pins, 17562306a36Sopenharmony_ci .npins = ARRAY_SIZE(mii_pins), 17662306a36Sopenharmony_ci .modemuxs = mii_modemux, 17762306a36Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(mii_modemux), 17862306a36Sopenharmony_ci}; 17962306a36Sopenharmony_ci 18062306a36Sopenharmony_cistatic const char *const mii_grps[] = { "mii0_grp" }; 18162306a36Sopenharmony_cistruct spear_function spear3xx_mii_function = { 18262306a36Sopenharmony_ci .name = "mii0", 18362306a36Sopenharmony_ci .groups = mii_grps, 18462306a36Sopenharmony_ci .ngroups = ARRAY_SIZE(mii_grps), 18562306a36Sopenharmony_ci}; 18662306a36Sopenharmony_ci 18762306a36Sopenharmony_ci/* gpio0_pin0_pins */ 18862306a36Sopenharmony_cistatic const unsigned gpio0_pin0_pins[] = { 28 }; 18962306a36Sopenharmony_cistatic struct spear_muxreg gpio0_pin0_muxreg[] = { 19062306a36Sopenharmony_ci { 19162306a36Sopenharmony_ci .reg = -1, 19262306a36Sopenharmony_ci .mask = PMX_GPIO_PIN0_MASK, 19362306a36Sopenharmony_ci .val = PMX_GPIO_PIN0_MASK, 19462306a36Sopenharmony_ci }, 19562306a36Sopenharmony_ci}; 19662306a36Sopenharmony_ci 19762306a36Sopenharmony_cistatic struct spear_modemux gpio0_pin0_modemux[] = { 19862306a36Sopenharmony_ci { 19962306a36Sopenharmony_ci .modes = ~0, 20062306a36Sopenharmony_ci .muxregs = gpio0_pin0_muxreg, 20162306a36Sopenharmony_ci .nmuxregs = ARRAY_SIZE(gpio0_pin0_muxreg), 20262306a36Sopenharmony_ci }, 20362306a36Sopenharmony_ci}; 20462306a36Sopenharmony_ci 20562306a36Sopenharmony_cistruct spear_pingroup spear3xx_gpio0_pin0_pingroup = { 20662306a36Sopenharmony_ci .name = "gpio0_pin0_grp", 20762306a36Sopenharmony_ci .pins = gpio0_pin0_pins, 20862306a36Sopenharmony_ci .npins = ARRAY_SIZE(gpio0_pin0_pins), 20962306a36Sopenharmony_ci .modemuxs = gpio0_pin0_modemux, 21062306a36Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(gpio0_pin0_modemux), 21162306a36Sopenharmony_ci}; 21262306a36Sopenharmony_ci 21362306a36Sopenharmony_ci/* gpio0_pin1_pins */ 21462306a36Sopenharmony_cistatic const unsigned gpio0_pin1_pins[] = { 29 }; 21562306a36Sopenharmony_cistatic struct spear_muxreg gpio0_pin1_muxreg[] = { 21662306a36Sopenharmony_ci { 21762306a36Sopenharmony_ci .reg = -1, 21862306a36Sopenharmony_ci .mask = PMX_GPIO_PIN1_MASK, 21962306a36Sopenharmony_ci .val = PMX_GPIO_PIN1_MASK, 22062306a36Sopenharmony_ci }, 22162306a36Sopenharmony_ci}; 22262306a36Sopenharmony_ci 22362306a36Sopenharmony_cistatic struct spear_modemux gpio0_pin1_modemux[] = { 22462306a36Sopenharmony_ci { 22562306a36Sopenharmony_ci .modes = ~0, 22662306a36Sopenharmony_ci .muxregs = gpio0_pin1_muxreg, 22762306a36Sopenharmony_ci .nmuxregs = ARRAY_SIZE(gpio0_pin1_muxreg), 22862306a36Sopenharmony_ci }, 22962306a36Sopenharmony_ci}; 23062306a36Sopenharmony_ci 23162306a36Sopenharmony_cistruct spear_pingroup spear3xx_gpio0_pin1_pingroup = { 23262306a36Sopenharmony_ci .name = "gpio0_pin1_grp", 23362306a36Sopenharmony_ci .pins = gpio0_pin1_pins, 23462306a36Sopenharmony_ci .npins = ARRAY_SIZE(gpio0_pin1_pins), 23562306a36Sopenharmony_ci .modemuxs = gpio0_pin1_modemux, 23662306a36Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(gpio0_pin1_modemux), 23762306a36Sopenharmony_ci}; 23862306a36Sopenharmony_ci 23962306a36Sopenharmony_ci/* gpio0_pin2_pins */ 24062306a36Sopenharmony_cistatic const unsigned gpio0_pin2_pins[] = { 30 }; 24162306a36Sopenharmony_cistatic struct spear_muxreg gpio0_pin2_muxreg[] = { 24262306a36Sopenharmony_ci { 24362306a36Sopenharmony_ci .reg = -1, 24462306a36Sopenharmony_ci .mask = PMX_GPIO_PIN2_MASK, 24562306a36Sopenharmony_ci .val = PMX_GPIO_PIN2_MASK, 24662306a36Sopenharmony_ci }, 24762306a36Sopenharmony_ci}; 24862306a36Sopenharmony_ci 24962306a36Sopenharmony_cistatic struct spear_modemux gpio0_pin2_modemux[] = { 25062306a36Sopenharmony_ci { 25162306a36Sopenharmony_ci .modes = ~0, 25262306a36Sopenharmony_ci .muxregs = gpio0_pin2_muxreg, 25362306a36Sopenharmony_ci .nmuxregs = ARRAY_SIZE(gpio0_pin2_muxreg), 25462306a36Sopenharmony_ci }, 25562306a36Sopenharmony_ci}; 25662306a36Sopenharmony_ci 25762306a36Sopenharmony_cistruct spear_pingroup spear3xx_gpio0_pin2_pingroup = { 25862306a36Sopenharmony_ci .name = "gpio0_pin2_grp", 25962306a36Sopenharmony_ci .pins = gpio0_pin2_pins, 26062306a36Sopenharmony_ci .npins = ARRAY_SIZE(gpio0_pin2_pins), 26162306a36Sopenharmony_ci .modemuxs = gpio0_pin2_modemux, 26262306a36Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(gpio0_pin2_modemux), 26362306a36Sopenharmony_ci}; 26462306a36Sopenharmony_ci 26562306a36Sopenharmony_ci/* gpio0_pin3_pins */ 26662306a36Sopenharmony_cistatic const unsigned gpio0_pin3_pins[] = { 31 }; 26762306a36Sopenharmony_cistatic struct spear_muxreg gpio0_pin3_muxreg[] = { 26862306a36Sopenharmony_ci { 26962306a36Sopenharmony_ci .reg = -1, 27062306a36Sopenharmony_ci .mask = PMX_GPIO_PIN3_MASK, 27162306a36Sopenharmony_ci .val = PMX_GPIO_PIN3_MASK, 27262306a36Sopenharmony_ci }, 27362306a36Sopenharmony_ci}; 27462306a36Sopenharmony_ci 27562306a36Sopenharmony_cistatic struct spear_modemux gpio0_pin3_modemux[] = { 27662306a36Sopenharmony_ci { 27762306a36Sopenharmony_ci .modes = ~0, 27862306a36Sopenharmony_ci .muxregs = gpio0_pin3_muxreg, 27962306a36Sopenharmony_ci .nmuxregs = ARRAY_SIZE(gpio0_pin3_muxreg), 28062306a36Sopenharmony_ci }, 28162306a36Sopenharmony_ci}; 28262306a36Sopenharmony_ci 28362306a36Sopenharmony_cistruct spear_pingroup spear3xx_gpio0_pin3_pingroup = { 28462306a36Sopenharmony_ci .name = "gpio0_pin3_grp", 28562306a36Sopenharmony_ci .pins = gpio0_pin3_pins, 28662306a36Sopenharmony_ci .npins = ARRAY_SIZE(gpio0_pin3_pins), 28762306a36Sopenharmony_ci .modemuxs = gpio0_pin3_modemux, 28862306a36Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(gpio0_pin3_modemux), 28962306a36Sopenharmony_ci}; 29062306a36Sopenharmony_ci 29162306a36Sopenharmony_ci/* gpio0_pin4_pins */ 29262306a36Sopenharmony_cistatic const unsigned gpio0_pin4_pins[] = { 32 }; 29362306a36Sopenharmony_cistatic struct spear_muxreg gpio0_pin4_muxreg[] = { 29462306a36Sopenharmony_ci { 29562306a36Sopenharmony_ci .reg = -1, 29662306a36Sopenharmony_ci .mask = PMX_GPIO_PIN4_MASK, 29762306a36Sopenharmony_ci .val = PMX_GPIO_PIN4_MASK, 29862306a36Sopenharmony_ci }, 29962306a36Sopenharmony_ci}; 30062306a36Sopenharmony_ci 30162306a36Sopenharmony_cistatic struct spear_modemux gpio0_pin4_modemux[] = { 30262306a36Sopenharmony_ci { 30362306a36Sopenharmony_ci .modes = ~0, 30462306a36Sopenharmony_ci .muxregs = gpio0_pin4_muxreg, 30562306a36Sopenharmony_ci .nmuxregs = ARRAY_SIZE(gpio0_pin4_muxreg), 30662306a36Sopenharmony_ci }, 30762306a36Sopenharmony_ci}; 30862306a36Sopenharmony_ci 30962306a36Sopenharmony_cistruct spear_pingroup spear3xx_gpio0_pin4_pingroup = { 31062306a36Sopenharmony_ci .name = "gpio0_pin4_grp", 31162306a36Sopenharmony_ci .pins = gpio0_pin4_pins, 31262306a36Sopenharmony_ci .npins = ARRAY_SIZE(gpio0_pin4_pins), 31362306a36Sopenharmony_ci .modemuxs = gpio0_pin4_modemux, 31462306a36Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(gpio0_pin4_modemux), 31562306a36Sopenharmony_ci}; 31662306a36Sopenharmony_ci 31762306a36Sopenharmony_ci/* gpio0_pin5_pins */ 31862306a36Sopenharmony_cistatic const unsigned gpio0_pin5_pins[] = { 33 }; 31962306a36Sopenharmony_cistatic struct spear_muxreg gpio0_pin5_muxreg[] = { 32062306a36Sopenharmony_ci { 32162306a36Sopenharmony_ci .reg = -1, 32262306a36Sopenharmony_ci .mask = PMX_GPIO_PIN5_MASK, 32362306a36Sopenharmony_ci .val = PMX_GPIO_PIN5_MASK, 32462306a36Sopenharmony_ci }, 32562306a36Sopenharmony_ci}; 32662306a36Sopenharmony_ci 32762306a36Sopenharmony_cistatic struct spear_modemux gpio0_pin5_modemux[] = { 32862306a36Sopenharmony_ci { 32962306a36Sopenharmony_ci .modes = ~0, 33062306a36Sopenharmony_ci .muxregs = gpio0_pin5_muxreg, 33162306a36Sopenharmony_ci .nmuxregs = ARRAY_SIZE(gpio0_pin5_muxreg), 33262306a36Sopenharmony_ci }, 33362306a36Sopenharmony_ci}; 33462306a36Sopenharmony_ci 33562306a36Sopenharmony_cistruct spear_pingroup spear3xx_gpio0_pin5_pingroup = { 33662306a36Sopenharmony_ci .name = "gpio0_pin5_grp", 33762306a36Sopenharmony_ci .pins = gpio0_pin5_pins, 33862306a36Sopenharmony_ci .npins = ARRAY_SIZE(gpio0_pin5_pins), 33962306a36Sopenharmony_ci .modemuxs = gpio0_pin5_modemux, 34062306a36Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(gpio0_pin5_modemux), 34162306a36Sopenharmony_ci}; 34262306a36Sopenharmony_ci 34362306a36Sopenharmony_cistatic const char *const gpio0_grps[] = { "gpio0_pin0_grp", "gpio0_pin1_grp", 34462306a36Sopenharmony_ci "gpio0_pin2_grp", "gpio0_pin3_grp", "gpio0_pin4_grp", "gpio0_pin5_grp", 34562306a36Sopenharmony_ci}; 34662306a36Sopenharmony_cistruct spear_function spear3xx_gpio0_function = { 34762306a36Sopenharmony_ci .name = "gpio0", 34862306a36Sopenharmony_ci .groups = gpio0_grps, 34962306a36Sopenharmony_ci .ngroups = ARRAY_SIZE(gpio0_grps), 35062306a36Sopenharmony_ci}; 35162306a36Sopenharmony_ci 35262306a36Sopenharmony_ci/* uart0_ext_pins */ 35362306a36Sopenharmony_cistatic const unsigned uart0_ext_pins[] = { 37, 38, 39, 40, 41, 42 }; 35462306a36Sopenharmony_cistatic struct spear_muxreg uart0_ext_muxreg[] = { 35562306a36Sopenharmony_ci { 35662306a36Sopenharmony_ci .reg = -1, 35762306a36Sopenharmony_ci .mask = PMX_UART0_MODEM_MASK, 35862306a36Sopenharmony_ci .val = PMX_UART0_MODEM_MASK, 35962306a36Sopenharmony_ci }, 36062306a36Sopenharmony_ci}; 36162306a36Sopenharmony_ci 36262306a36Sopenharmony_cistatic struct spear_modemux uart0_ext_modemux[] = { 36362306a36Sopenharmony_ci { 36462306a36Sopenharmony_ci .modes = ~0, 36562306a36Sopenharmony_ci .muxregs = uart0_ext_muxreg, 36662306a36Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart0_ext_muxreg), 36762306a36Sopenharmony_ci }, 36862306a36Sopenharmony_ci}; 36962306a36Sopenharmony_ci 37062306a36Sopenharmony_cistruct spear_pingroup spear3xx_uart0_ext_pingroup = { 37162306a36Sopenharmony_ci .name = "uart0_ext_grp", 37262306a36Sopenharmony_ci .pins = uart0_ext_pins, 37362306a36Sopenharmony_ci .npins = ARRAY_SIZE(uart0_ext_pins), 37462306a36Sopenharmony_ci .modemuxs = uart0_ext_modemux, 37562306a36Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(uart0_ext_modemux), 37662306a36Sopenharmony_ci}; 37762306a36Sopenharmony_ci 37862306a36Sopenharmony_cistatic const char *const uart0_ext_grps[] = { "uart0_ext_grp" }; 37962306a36Sopenharmony_cistruct spear_function spear3xx_uart0_ext_function = { 38062306a36Sopenharmony_ci .name = "uart0_ext", 38162306a36Sopenharmony_ci .groups = uart0_ext_grps, 38262306a36Sopenharmony_ci .ngroups = ARRAY_SIZE(uart0_ext_grps), 38362306a36Sopenharmony_ci}; 38462306a36Sopenharmony_ci 38562306a36Sopenharmony_ci/* uart0_pins */ 38662306a36Sopenharmony_cistatic const unsigned uart0_pins[] = { 2, 3 }; 38762306a36Sopenharmony_cistatic struct spear_muxreg uart0_muxreg[] = { 38862306a36Sopenharmony_ci { 38962306a36Sopenharmony_ci .reg = -1, 39062306a36Sopenharmony_ci .mask = PMX_UART0_MASK, 39162306a36Sopenharmony_ci .val = PMX_UART0_MASK, 39262306a36Sopenharmony_ci }, 39362306a36Sopenharmony_ci}; 39462306a36Sopenharmony_ci 39562306a36Sopenharmony_cistatic struct spear_modemux uart0_modemux[] = { 39662306a36Sopenharmony_ci { 39762306a36Sopenharmony_ci .modes = ~0, 39862306a36Sopenharmony_ci .muxregs = uart0_muxreg, 39962306a36Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart0_muxreg), 40062306a36Sopenharmony_ci }, 40162306a36Sopenharmony_ci}; 40262306a36Sopenharmony_ci 40362306a36Sopenharmony_cistruct spear_pingroup spear3xx_uart0_pingroup = { 40462306a36Sopenharmony_ci .name = "uart0_grp", 40562306a36Sopenharmony_ci .pins = uart0_pins, 40662306a36Sopenharmony_ci .npins = ARRAY_SIZE(uart0_pins), 40762306a36Sopenharmony_ci .modemuxs = uart0_modemux, 40862306a36Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(uart0_modemux), 40962306a36Sopenharmony_ci}; 41062306a36Sopenharmony_ci 41162306a36Sopenharmony_cistatic const char *const uart0_grps[] = { "uart0_grp" }; 41262306a36Sopenharmony_cistruct spear_function spear3xx_uart0_function = { 41362306a36Sopenharmony_ci .name = "uart0", 41462306a36Sopenharmony_ci .groups = uart0_grps, 41562306a36Sopenharmony_ci .ngroups = ARRAY_SIZE(uart0_grps), 41662306a36Sopenharmony_ci}; 41762306a36Sopenharmony_ci 41862306a36Sopenharmony_ci/* timer_0_1_pins */ 41962306a36Sopenharmony_cistatic const unsigned timer_0_1_pins[] = { 43, 44, 47, 48 }; 42062306a36Sopenharmony_cistatic struct spear_muxreg timer_0_1_muxreg[] = { 42162306a36Sopenharmony_ci { 42262306a36Sopenharmony_ci .reg = -1, 42362306a36Sopenharmony_ci .mask = PMX_TIMER_0_1_MASK, 42462306a36Sopenharmony_ci .val = PMX_TIMER_0_1_MASK, 42562306a36Sopenharmony_ci }, 42662306a36Sopenharmony_ci}; 42762306a36Sopenharmony_ci 42862306a36Sopenharmony_cistatic struct spear_modemux timer_0_1_modemux[] = { 42962306a36Sopenharmony_ci { 43062306a36Sopenharmony_ci .modes = ~0, 43162306a36Sopenharmony_ci .muxregs = timer_0_1_muxreg, 43262306a36Sopenharmony_ci .nmuxregs = ARRAY_SIZE(timer_0_1_muxreg), 43362306a36Sopenharmony_ci }, 43462306a36Sopenharmony_ci}; 43562306a36Sopenharmony_ci 43662306a36Sopenharmony_cistruct spear_pingroup spear3xx_timer_0_1_pingroup = { 43762306a36Sopenharmony_ci .name = "timer_0_1_grp", 43862306a36Sopenharmony_ci .pins = timer_0_1_pins, 43962306a36Sopenharmony_ci .npins = ARRAY_SIZE(timer_0_1_pins), 44062306a36Sopenharmony_ci .modemuxs = timer_0_1_modemux, 44162306a36Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(timer_0_1_modemux), 44262306a36Sopenharmony_ci}; 44362306a36Sopenharmony_ci 44462306a36Sopenharmony_cistatic const char *const timer_0_1_grps[] = { "timer_0_1_grp" }; 44562306a36Sopenharmony_cistruct spear_function spear3xx_timer_0_1_function = { 44662306a36Sopenharmony_ci .name = "timer_0_1", 44762306a36Sopenharmony_ci .groups = timer_0_1_grps, 44862306a36Sopenharmony_ci .ngroups = ARRAY_SIZE(timer_0_1_grps), 44962306a36Sopenharmony_ci}; 45062306a36Sopenharmony_ci 45162306a36Sopenharmony_ci/* timer_2_3_pins */ 45262306a36Sopenharmony_cistatic const unsigned timer_2_3_pins[] = { 45, 46, 49, 50 }; 45362306a36Sopenharmony_cistatic struct spear_muxreg timer_2_3_muxreg[] = { 45462306a36Sopenharmony_ci { 45562306a36Sopenharmony_ci .reg = -1, 45662306a36Sopenharmony_ci .mask = PMX_TIMER_2_3_MASK, 45762306a36Sopenharmony_ci .val = PMX_TIMER_2_3_MASK, 45862306a36Sopenharmony_ci }, 45962306a36Sopenharmony_ci}; 46062306a36Sopenharmony_ci 46162306a36Sopenharmony_cistatic struct spear_modemux timer_2_3_modemux[] = { 46262306a36Sopenharmony_ci { 46362306a36Sopenharmony_ci .modes = ~0, 46462306a36Sopenharmony_ci .muxregs = timer_2_3_muxreg, 46562306a36Sopenharmony_ci .nmuxregs = ARRAY_SIZE(timer_2_3_muxreg), 46662306a36Sopenharmony_ci }, 46762306a36Sopenharmony_ci}; 46862306a36Sopenharmony_ci 46962306a36Sopenharmony_cistruct spear_pingroup spear3xx_timer_2_3_pingroup = { 47062306a36Sopenharmony_ci .name = "timer_2_3_grp", 47162306a36Sopenharmony_ci .pins = timer_2_3_pins, 47262306a36Sopenharmony_ci .npins = ARRAY_SIZE(timer_2_3_pins), 47362306a36Sopenharmony_ci .modemuxs = timer_2_3_modemux, 47462306a36Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(timer_2_3_modemux), 47562306a36Sopenharmony_ci}; 47662306a36Sopenharmony_ci 47762306a36Sopenharmony_cistatic const char *const timer_2_3_grps[] = { "timer_2_3_grp" }; 47862306a36Sopenharmony_cistruct spear_function spear3xx_timer_2_3_function = { 47962306a36Sopenharmony_ci .name = "timer_2_3", 48062306a36Sopenharmony_ci .groups = timer_2_3_grps, 48162306a36Sopenharmony_ci .ngroups = ARRAY_SIZE(timer_2_3_grps), 48262306a36Sopenharmony_ci}; 48362306a36Sopenharmony_ci 48462306a36Sopenharmony_ci/* Define muxreg arrays */ 48562306a36Sopenharmony_ciDEFINE_MUXREG(firda_pins, 0, PMX_FIRDA_MASK, 0); 48662306a36Sopenharmony_ciDEFINE_MUXREG(i2c_pins, 0, PMX_I2C_MASK, 0); 48762306a36Sopenharmony_ciDEFINE_MUXREG(ssp_cs_pins, 0, PMX_SSP_CS_MASK, 0); 48862306a36Sopenharmony_ciDEFINE_MUXREG(ssp_pins, 0, PMX_SSP_MASK, 0); 48962306a36Sopenharmony_ciDEFINE_MUXREG(mii_pins, 0, PMX_MII_MASK, 0); 49062306a36Sopenharmony_ciDEFINE_MUXREG(gpio0_pin0_pins, 0, PMX_GPIO_PIN0_MASK, 0); 49162306a36Sopenharmony_ciDEFINE_MUXREG(gpio0_pin1_pins, 0, PMX_GPIO_PIN1_MASK, 0); 49262306a36Sopenharmony_ciDEFINE_MUXREG(gpio0_pin2_pins, 0, PMX_GPIO_PIN2_MASK, 0); 49362306a36Sopenharmony_ciDEFINE_MUXREG(gpio0_pin3_pins, 0, PMX_GPIO_PIN3_MASK, 0); 49462306a36Sopenharmony_ciDEFINE_MUXREG(gpio0_pin4_pins, 0, PMX_GPIO_PIN4_MASK, 0); 49562306a36Sopenharmony_ciDEFINE_MUXREG(gpio0_pin5_pins, 0, PMX_GPIO_PIN5_MASK, 0); 49662306a36Sopenharmony_ciDEFINE_MUXREG(uart0_ext_pins, 0, PMX_UART0_MODEM_MASK, 0); 49762306a36Sopenharmony_ciDEFINE_MUXREG(uart0_pins, 0, PMX_UART0_MASK, 0); 49862306a36Sopenharmony_ciDEFINE_MUXREG(timer_0_1_pins, 0, PMX_TIMER_0_1_MASK, 0); 49962306a36Sopenharmony_ciDEFINE_MUXREG(timer_2_3_pins, 0, PMX_TIMER_2_3_MASK, 0); 50062306a36Sopenharmony_ci 50162306a36Sopenharmony_cistatic struct spear_gpio_pingroup spear3xx_gpio_pingroup[] = { 50262306a36Sopenharmony_ci GPIO_PINGROUP(firda_pins), 50362306a36Sopenharmony_ci GPIO_PINGROUP(i2c_pins), 50462306a36Sopenharmony_ci GPIO_PINGROUP(ssp_cs_pins), 50562306a36Sopenharmony_ci GPIO_PINGROUP(ssp_pins), 50662306a36Sopenharmony_ci GPIO_PINGROUP(mii_pins), 50762306a36Sopenharmony_ci GPIO_PINGROUP(gpio0_pin0_pins), 50862306a36Sopenharmony_ci GPIO_PINGROUP(gpio0_pin1_pins), 50962306a36Sopenharmony_ci GPIO_PINGROUP(gpio0_pin2_pins), 51062306a36Sopenharmony_ci GPIO_PINGROUP(gpio0_pin3_pins), 51162306a36Sopenharmony_ci GPIO_PINGROUP(gpio0_pin4_pins), 51262306a36Sopenharmony_ci GPIO_PINGROUP(gpio0_pin5_pins), 51362306a36Sopenharmony_ci GPIO_PINGROUP(uart0_ext_pins), 51462306a36Sopenharmony_ci GPIO_PINGROUP(uart0_pins), 51562306a36Sopenharmony_ci GPIO_PINGROUP(timer_0_1_pins), 51662306a36Sopenharmony_ci GPIO_PINGROUP(timer_2_3_pins), 51762306a36Sopenharmony_ci}; 51862306a36Sopenharmony_ci 51962306a36Sopenharmony_cistruct spear_pinctrl_machdata spear3xx_machdata = { 52062306a36Sopenharmony_ci .pins = spear3xx_pins, 52162306a36Sopenharmony_ci .npins = ARRAY_SIZE(spear3xx_pins), 52262306a36Sopenharmony_ci .gpio_pingroups = spear3xx_gpio_pingroup, 52362306a36Sopenharmony_ci .ngpio_pingroups = ARRAY_SIZE(spear3xx_gpio_pingroup), 52462306a36Sopenharmony_ci}; 525