18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * Driver for the ST Microelectronics SPEAr3xx pinmux 38c2ecf20Sopenharmony_ci * 48c2ecf20Sopenharmony_ci * Copyright (C) 2012 ST Microelectronics 58c2ecf20Sopenharmony_ci * Viresh Kumar <vireshk@kernel.org> 68c2ecf20Sopenharmony_ci * 78c2ecf20Sopenharmony_ci * This file is licensed under the terms of the GNU General Public 88c2ecf20Sopenharmony_ci * License version 2. This program is licensed "as is" without any 98c2ecf20Sopenharmony_ci * warranty of any kind, whether express or implied. 108c2ecf20Sopenharmony_ci */ 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci#include <linux/pinctrl/pinctrl.h> 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci#include "pinctrl-spear3xx.h" 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci/* pins */ 178c2ecf20Sopenharmony_cistatic const struct pinctrl_pin_desc spear3xx_pins[] = { 188c2ecf20Sopenharmony_ci SPEAR_PIN_0_TO_101, 198c2ecf20Sopenharmony_ci}; 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ci/* firda_pins */ 228c2ecf20Sopenharmony_cistatic const unsigned firda_pins[] = { 0, 1 }; 238c2ecf20Sopenharmony_cistatic struct spear_muxreg firda_muxreg[] = { 248c2ecf20Sopenharmony_ci { 258c2ecf20Sopenharmony_ci .reg = -1, 268c2ecf20Sopenharmony_ci .mask = PMX_FIRDA_MASK, 278c2ecf20Sopenharmony_ci .val = PMX_FIRDA_MASK, 288c2ecf20Sopenharmony_ci }, 298c2ecf20Sopenharmony_ci}; 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_cistatic struct spear_modemux firda_modemux[] = { 328c2ecf20Sopenharmony_ci { 338c2ecf20Sopenharmony_ci .modes = ~0, 348c2ecf20Sopenharmony_ci .muxregs = firda_muxreg, 358c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(firda_muxreg), 368c2ecf20Sopenharmony_ci }, 378c2ecf20Sopenharmony_ci}; 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_cistruct spear_pingroup spear3xx_firda_pingroup = { 408c2ecf20Sopenharmony_ci .name = "firda_grp", 418c2ecf20Sopenharmony_ci .pins = firda_pins, 428c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(firda_pins), 438c2ecf20Sopenharmony_ci .modemuxs = firda_modemux, 448c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(firda_modemux), 458c2ecf20Sopenharmony_ci}; 468c2ecf20Sopenharmony_ci 478c2ecf20Sopenharmony_cistatic const char *const firda_grps[] = { "firda_grp" }; 488c2ecf20Sopenharmony_cistruct spear_function spear3xx_firda_function = { 498c2ecf20Sopenharmony_ci .name = "firda", 508c2ecf20Sopenharmony_ci .groups = firda_grps, 518c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(firda_grps), 528c2ecf20Sopenharmony_ci}; 538c2ecf20Sopenharmony_ci 548c2ecf20Sopenharmony_ci/* i2c_pins */ 558c2ecf20Sopenharmony_cistatic const unsigned i2c_pins[] = { 4, 5 }; 568c2ecf20Sopenharmony_cistatic struct spear_muxreg i2c_muxreg[] = { 578c2ecf20Sopenharmony_ci { 588c2ecf20Sopenharmony_ci .reg = -1, 598c2ecf20Sopenharmony_ci .mask = PMX_I2C_MASK, 608c2ecf20Sopenharmony_ci .val = PMX_I2C_MASK, 618c2ecf20Sopenharmony_ci }, 628c2ecf20Sopenharmony_ci}; 638c2ecf20Sopenharmony_ci 648c2ecf20Sopenharmony_cistatic struct spear_modemux i2c_modemux[] = { 658c2ecf20Sopenharmony_ci { 668c2ecf20Sopenharmony_ci .modes = ~0, 678c2ecf20Sopenharmony_ci .muxregs = i2c_muxreg, 688c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(i2c_muxreg), 698c2ecf20Sopenharmony_ci }, 708c2ecf20Sopenharmony_ci}; 718c2ecf20Sopenharmony_ci 728c2ecf20Sopenharmony_cistruct spear_pingroup spear3xx_i2c_pingroup = { 738c2ecf20Sopenharmony_ci .name = "i2c0_grp", 748c2ecf20Sopenharmony_ci .pins = i2c_pins, 758c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(i2c_pins), 768c2ecf20Sopenharmony_ci .modemuxs = i2c_modemux, 778c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(i2c_modemux), 788c2ecf20Sopenharmony_ci}; 798c2ecf20Sopenharmony_ci 808c2ecf20Sopenharmony_cistatic const char *const i2c_grps[] = { "i2c0_grp" }; 818c2ecf20Sopenharmony_cistruct spear_function spear3xx_i2c_function = { 828c2ecf20Sopenharmony_ci .name = "i2c0", 838c2ecf20Sopenharmony_ci .groups = i2c_grps, 848c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(i2c_grps), 858c2ecf20Sopenharmony_ci}; 868c2ecf20Sopenharmony_ci 878c2ecf20Sopenharmony_ci/* ssp_cs_pins */ 888c2ecf20Sopenharmony_cistatic const unsigned ssp_cs_pins[] = { 34, 35, 36 }; 898c2ecf20Sopenharmony_cistatic struct spear_muxreg ssp_cs_muxreg[] = { 908c2ecf20Sopenharmony_ci { 918c2ecf20Sopenharmony_ci .reg = -1, 928c2ecf20Sopenharmony_ci .mask = PMX_SSP_CS_MASK, 938c2ecf20Sopenharmony_ci .val = PMX_SSP_CS_MASK, 948c2ecf20Sopenharmony_ci }, 958c2ecf20Sopenharmony_ci}; 968c2ecf20Sopenharmony_ci 978c2ecf20Sopenharmony_cistatic struct spear_modemux ssp_cs_modemux[] = { 988c2ecf20Sopenharmony_ci { 998c2ecf20Sopenharmony_ci .modes = ~0, 1008c2ecf20Sopenharmony_ci .muxregs = ssp_cs_muxreg, 1018c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(ssp_cs_muxreg), 1028c2ecf20Sopenharmony_ci }, 1038c2ecf20Sopenharmony_ci}; 1048c2ecf20Sopenharmony_ci 1058c2ecf20Sopenharmony_cistruct spear_pingroup spear3xx_ssp_cs_pingroup = { 1068c2ecf20Sopenharmony_ci .name = "ssp_cs_grp", 1078c2ecf20Sopenharmony_ci .pins = ssp_cs_pins, 1088c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(ssp_cs_pins), 1098c2ecf20Sopenharmony_ci .modemuxs = ssp_cs_modemux, 1108c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(ssp_cs_modemux), 1118c2ecf20Sopenharmony_ci}; 1128c2ecf20Sopenharmony_ci 1138c2ecf20Sopenharmony_cistatic const char *const ssp_cs_grps[] = { "ssp_cs_grp" }; 1148c2ecf20Sopenharmony_cistruct spear_function spear3xx_ssp_cs_function = { 1158c2ecf20Sopenharmony_ci .name = "ssp_cs", 1168c2ecf20Sopenharmony_ci .groups = ssp_cs_grps, 1178c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(ssp_cs_grps), 1188c2ecf20Sopenharmony_ci}; 1198c2ecf20Sopenharmony_ci 1208c2ecf20Sopenharmony_ci/* ssp_pins */ 1218c2ecf20Sopenharmony_cistatic const unsigned ssp_pins[] = { 6, 7, 8, 9 }; 1228c2ecf20Sopenharmony_cistatic struct spear_muxreg ssp_muxreg[] = { 1238c2ecf20Sopenharmony_ci { 1248c2ecf20Sopenharmony_ci .reg = -1, 1258c2ecf20Sopenharmony_ci .mask = PMX_SSP_MASK, 1268c2ecf20Sopenharmony_ci .val = PMX_SSP_MASK, 1278c2ecf20Sopenharmony_ci }, 1288c2ecf20Sopenharmony_ci}; 1298c2ecf20Sopenharmony_ci 1308c2ecf20Sopenharmony_cistatic struct spear_modemux ssp_modemux[] = { 1318c2ecf20Sopenharmony_ci { 1328c2ecf20Sopenharmony_ci .modes = ~0, 1338c2ecf20Sopenharmony_ci .muxregs = ssp_muxreg, 1348c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(ssp_muxreg), 1358c2ecf20Sopenharmony_ci }, 1368c2ecf20Sopenharmony_ci}; 1378c2ecf20Sopenharmony_ci 1388c2ecf20Sopenharmony_cistruct spear_pingroup spear3xx_ssp_pingroup = { 1398c2ecf20Sopenharmony_ci .name = "ssp0_grp", 1408c2ecf20Sopenharmony_ci .pins = ssp_pins, 1418c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(ssp_pins), 1428c2ecf20Sopenharmony_ci .modemuxs = ssp_modemux, 1438c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(ssp_modemux), 1448c2ecf20Sopenharmony_ci}; 1458c2ecf20Sopenharmony_ci 1468c2ecf20Sopenharmony_cistatic const char *const ssp_grps[] = { "ssp0_grp" }; 1478c2ecf20Sopenharmony_cistruct spear_function spear3xx_ssp_function = { 1488c2ecf20Sopenharmony_ci .name = "ssp0", 1498c2ecf20Sopenharmony_ci .groups = ssp_grps, 1508c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(ssp_grps), 1518c2ecf20Sopenharmony_ci}; 1528c2ecf20Sopenharmony_ci 1538c2ecf20Sopenharmony_ci/* mii_pins */ 1548c2ecf20Sopenharmony_cistatic const unsigned mii_pins[] = { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 1558c2ecf20Sopenharmony_ci 21, 22, 23, 24, 25, 26, 27 }; 1568c2ecf20Sopenharmony_cistatic struct spear_muxreg mii_muxreg[] = { 1578c2ecf20Sopenharmony_ci { 1588c2ecf20Sopenharmony_ci .reg = -1, 1598c2ecf20Sopenharmony_ci .mask = PMX_MII_MASK, 1608c2ecf20Sopenharmony_ci .val = PMX_MII_MASK, 1618c2ecf20Sopenharmony_ci }, 1628c2ecf20Sopenharmony_ci}; 1638c2ecf20Sopenharmony_ci 1648c2ecf20Sopenharmony_cistatic struct spear_modemux mii_modemux[] = { 1658c2ecf20Sopenharmony_ci { 1668c2ecf20Sopenharmony_ci .modes = ~0, 1678c2ecf20Sopenharmony_ci .muxregs = mii_muxreg, 1688c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(mii_muxreg), 1698c2ecf20Sopenharmony_ci }, 1708c2ecf20Sopenharmony_ci}; 1718c2ecf20Sopenharmony_ci 1728c2ecf20Sopenharmony_cistruct spear_pingroup spear3xx_mii_pingroup = { 1738c2ecf20Sopenharmony_ci .name = "mii0_grp", 1748c2ecf20Sopenharmony_ci .pins = mii_pins, 1758c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(mii_pins), 1768c2ecf20Sopenharmony_ci .modemuxs = mii_modemux, 1778c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(mii_modemux), 1788c2ecf20Sopenharmony_ci}; 1798c2ecf20Sopenharmony_ci 1808c2ecf20Sopenharmony_cistatic const char *const mii_grps[] = { "mii0_grp" }; 1818c2ecf20Sopenharmony_cistruct spear_function spear3xx_mii_function = { 1828c2ecf20Sopenharmony_ci .name = "mii0", 1838c2ecf20Sopenharmony_ci .groups = mii_grps, 1848c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(mii_grps), 1858c2ecf20Sopenharmony_ci}; 1868c2ecf20Sopenharmony_ci 1878c2ecf20Sopenharmony_ci/* gpio0_pin0_pins */ 1888c2ecf20Sopenharmony_cistatic const unsigned gpio0_pin0_pins[] = { 28 }; 1898c2ecf20Sopenharmony_cistatic struct spear_muxreg gpio0_pin0_muxreg[] = { 1908c2ecf20Sopenharmony_ci { 1918c2ecf20Sopenharmony_ci .reg = -1, 1928c2ecf20Sopenharmony_ci .mask = PMX_GPIO_PIN0_MASK, 1938c2ecf20Sopenharmony_ci .val = PMX_GPIO_PIN0_MASK, 1948c2ecf20Sopenharmony_ci }, 1958c2ecf20Sopenharmony_ci}; 1968c2ecf20Sopenharmony_ci 1978c2ecf20Sopenharmony_cistatic struct spear_modemux gpio0_pin0_modemux[] = { 1988c2ecf20Sopenharmony_ci { 1998c2ecf20Sopenharmony_ci .modes = ~0, 2008c2ecf20Sopenharmony_ci .muxregs = gpio0_pin0_muxreg, 2018c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(gpio0_pin0_muxreg), 2028c2ecf20Sopenharmony_ci }, 2038c2ecf20Sopenharmony_ci}; 2048c2ecf20Sopenharmony_ci 2058c2ecf20Sopenharmony_cistruct spear_pingroup spear3xx_gpio0_pin0_pingroup = { 2068c2ecf20Sopenharmony_ci .name = "gpio0_pin0_grp", 2078c2ecf20Sopenharmony_ci .pins = gpio0_pin0_pins, 2088c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(gpio0_pin0_pins), 2098c2ecf20Sopenharmony_ci .modemuxs = gpio0_pin0_modemux, 2108c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(gpio0_pin0_modemux), 2118c2ecf20Sopenharmony_ci}; 2128c2ecf20Sopenharmony_ci 2138c2ecf20Sopenharmony_ci/* gpio0_pin1_pins */ 2148c2ecf20Sopenharmony_cistatic const unsigned gpio0_pin1_pins[] = { 29 }; 2158c2ecf20Sopenharmony_cistatic struct spear_muxreg gpio0_pin1_muxreg[] = { 2168c2ecf20Sopenharmony_ci { 2178c2ecf20Sopenharmony_ci .reg = -1, 2188c2ecf20Sopenharmony_ci .mask = PMX_GPIO_PIN1_MASK, 2198c2ecf20Sopenharmony_ci .val = PMX_GPIO_PIN1_MASK, 2208c2ecf20Sopenharmony_ci }, 2218c2ecf20Sopenharmony_ci}; 2228c2ecf20Sopenharmony_ci 2238c2ecf20Sopenharmony_cistatic struct spear_modemux gpio0_pin1_modemux[] = { 2248c2ecf20Sopenharmony_ci { 2258c2ecf20Sopenharmony_ci .modes = ~0, 2268c2ecf20Sopenharmony_ci .muxregs = gpio0_pin1_muxreg, 2278c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(gpio0_pin1_muxreg), 2288c2ecf20Sopenharmony_ci }, 2298c2ecf20Sopenharmony_ci}; 2308c2ecf20Sopenharmony_ci 2318c2ecf20Sopenharmony_cistruct spear_pingroup spear3xx_gpio0_pin1_pingroup = { 2328c2ecf20Sopenharmony_ci .name = "gpio0_pin1_grp", 2338c2ecf20Sopenharmony_ci .pins = gpio0_pin1_pins, 2348c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(gpio0_pin1_pins), 2358c2ecf20Sopenharmony_ci .modemuxs = gpio0_pin1_modemux, 2368c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(gpio0_pin1_modemux), 2378c2ecf20Sopenharmony_ci}; 2388c2ecf20Sopenharmony_ci 2398c2ecf20Sopenharmony_ci/* gpio0_pin2_pins */ 2408c2ecf20Sopenharmony_cistatic const unsigned gpio0_pin2_pins[] = { 30 }; 2418c2ecf20Sopenharmony_cistatic struct spear_muxreg gpio0_pin2_muxreg[] = { 2428c2ecf20Sopenharmony_ci { 2438c2ecf20Sopenharmony_ci .reg = -1, 2448c2ecf20Sopenharmony_ci .mask = PMX_GPIO_PIN2_MASK, 2458c2ecf20Sopenharmony_ci .val = PMX_GPIO_PIN2_MASK, 2468c2ecf20Sopenharmony_ci }, 2478c2ecf20Sopenharmony_ci}; 2488c2ecf20Sopenharmony_ci 2498c2ecf20Sopenharmony_cistatic struct spear_modemux gpio0_pin2_modemux[] = { 2508c2ecf20Sopenharmony_ci { 2518c2ecf20Sopenharmony_ci .modes = ~0, 2528c2ecf20Sopenharmony_ci .muxregs = gpio0_pin2_muxreg, 2538c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(gpio0_pin2_muxreg), 2548c2ecf20Sopenharmony_ci }, 2558c2ecf20Sopenharmony_ci}; 2568c2ecf20Sopenharmony_ci 2578c2ecf20Sopenharmony_cistruct spear_pingroup spear3xx_gpio0_pin2_pingroup = { 2588c2ecf20Sopenharmony_ci .name = "gpio0_pin2_grp", 2598c2ecf20Sopenharmony_ci .pins = gpio0_pin2_pins, 2608c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(gpio0_pin2_pins), 2618c2ecf20Sopenharmony_ci .modemuxs = gpio0_pin2_modemux, 2628c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(gpio0_pin2_modemux), 2638c2ecf20Sopenharmony_ci}; 2648c2ecf20Sopenharmony_ci 2658c2ecf20Sopenharmony_ci/* gpio0_pin3_pins */ 2668c2ecf20Sopenharmony_cistatic const unsigned gpio0_pin3_pins[] = { 31 }; 2678c2ecf20Sopenharmony_cistatic struct spear_muxreg gpio0_pin3_muxreg[] = { 2688c2ecf20Sopenharmony_ci { 2698c2ecf20Sopenharmony_ci .reg = -1, 2708c2ecf20Sopenharmony_ci .mask = PMX_GPIO_PIN3_MASK, 2718c2ecf20Sopenharmony_ci .val = PMX_GPIO_PIN3_MASK, 2728c2ecf20Sopenharmony_ci }, 2738c2ecf20Sopenharmony_ci}; 2748c2ecf20Sopenharmony_ci 2758c2ecf20Sopenharmony_cistatic struct spear_modemux gpio0_pin3_modemux[] = { 2768c2ecf20Sopenharmony_ci { 2778c2ecf20Sopenharmony_ci .modes = ~0, 2788c2ecf20Sopenharmony_ci .muxregs = gpio0_pin3_muxreg, 2798c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(gpio0_pin3_muxreg), 2808c2ecf20Sopenharmony_ci }, 2818c2ecf20Sopenharmony_ci}; 2828c2ecf20Sopenharmony_ci 2838c2ecf20Sopenharmony_cistruct spear_pingroup spear3xx_gpio0_pin3_pingroup = { 2848c2ecf20Sopenharmony_ci .name = "gpio0_pin3_grp", 2858c2ecf20Sopenharmony_ci .pins = gpio0_pin3_pins, 2868c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(gpio0_pin3_pins), 2878c2ecf20Sopenharmony_ci .modemuxs = gpio0_pin3_modemux, 2888c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(gpio0_pin3_modemux), 2898c2ecf20Sopenharmony_ci}; 2908c2ecf20Sopenharmony_ci 2918c2ecf20Sopenharmony_ci/* gpio0_pin4_pins */ 2928c2ecf20Sopenharmony_cistatic const unsigned gpio0_pin4_pins[] = { 32 }; 2938c2ecf20Sopenharmony_cistatic struct spear_muxreg gpio0_pin4_muxreg[] = { 2948c2ecf20Sopenharmony_ci { 2958c2ecf20Sopenharmony_ci .reg = -1, 2968c2ecf20Sopenharmony_ci .mask = PMX_GPIO_PIN4_MASK, 2978c2ecf20Sopenharmony_ci .val = PMX_GPIO_PIN4_MASK, 2988c2ecf20Sopenharmony_ci }, 2998c2ecf20Sopenharmony_ci}; 3008c2ecf20Sopenharmony_ci 3018c2ecf20Sopenharmony_cistatic struct spear_modemux gpio0_pin4_modemux[] = { 3028c2ecf20Sopenharmony_ci { 3038c2ecf20Sopenharmony_ci .modes = ~0, 3048c2ecf20Sopenharmony_ci .muxregs = gpio0_pin4_muxreg, 3058c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(gpio0_pin4_muxreg), 3068c2ecf20Sopenharmony_ci }, 3078c2ecf20Sopenharmony_ci}; 3088c2ecf20Sopenharmony_ci 3098c2ecf20Sopenharmony_cistruct spear_pingroup spear3xx_gpio0_pin4_pingroup = { 3108c2ecf20Sopenharmony_ci .name = "gpio0_pin4_grp", 3118c2ecf20Sopenharmony_ci .pins = gpio0_pin4_pins, 3128c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(gpio0_pin4_pins), 3138c2ecf20Sopenharmony_ci .modemuxs = gpio0_pin4_modemux, 3148c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(gpio0_pin4_modemux), 3158c2ecf20Sopenharmony_ci}; 3168c2ecf20Sopenharmony_ci 3178c2ecf20Sopenharmony_ci/* gpio0_pin5_pins */ 3188c2ecf20Sopenharmony_cistatic const unsigned gpio0_pin5_pins[] = { 33 }; 3198c2ecf20Sopenharmony_cistatic struct spear_muxreg gpio0_pin5_muxreg[] = { 3208c2ecf20Sopenharmony_ci { 3218c2ecf20Sopenharmony_ci .reg = -1, 3228c2ecf20Sopenharmony_ci .mask = PMX_GPIO_PIN5_MASK, 3238c2ecf20Sopenharmony_ci .val = PMX_GPIO_PIN5_MASK, 3248c2ecf20Sopenharmony_ci }, 3258c2ecf20Sopenharmony_ci}; 3268c2ecf20Sopenharmony_ci 3278c2ecf20Sopenharmony_cistatic struct spear_modemux gpio0_pin5_modemux[] = { 3288c2ecf20Sopenharmony_ci { 3298c2ecf20Sopenharmony_ci .modes = ~0, 3308c2ecf20Sopenharmony_ci .muxregs = gpio0_pin5_muxreg, 3318c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(gpio0_pin5_muxreg), 3328c2ecf20Sopenharmony_ci }, 3338c2ecf20Sopenharmony_ci}; 3348c2ecf20Sopenharmony_ci 3358c2ecf20Sopenharmony_cistruct spear_pingroup spear3xx_gpio0_pin5_pingroup = { 3368c2ecf20Sopenharmony_ci .name = "gpio0_pin5_grp", 3378c2ecf20Sopenharmony_ci .pins = gpio0_pin5_pins, 3388c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(gpio0_pin5_pins), 3398c2ecf20Sopenharmony_ci .modemuxs = gpio0_pin5_modemux, 3408c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(gpio0_pin5_modemux), 3418c2ecf20Sopenharmony_ci}; 3428c2ecf20Sopenharmony_ci 3438c2ecf20Sopenharmony_cistatic const char *const gpio0_grps[] = { "gpio0_pin0_grp", "gpio0_pin1_grp", 3448c2ecf20Sopenharmony_ci "gpio0_pin2_grp", "gpio0_pin3_grp", "gpio0_pin4_grp", "gpio0_pin5_grp", 3458c2ecf20Sopenharmony_ci}; 3468c2ecf20Sopenharmony_cistruct spear_function spear3xx_gpio0_function = { 3478c2ecf20Sopenharmony_ci .name = "gpio0", 3488c2ecf20Sopenharmony_ci .groups = gpio0_grps, 3498c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(gpio0_grps), 3508c2ecf20Sopenharmony_ci}; 3518c2ecf20Sopenharmony_ci 3528c2ecf20Sopenharmony_ci/* uart0_ext_pins */ 3538c2ecf20Sopenharmony_cistatic const unsigned uart0_ext_pins[] = { 37, 38, 39, 40, 41, 42 }; 3548c2ecf20Sopenharmony_cistatic struct spear_muxreg uart0_ext_muxreg[] = { 3558c2ecf20Sopenharmony_ci { 3568c2ecf20Sopenharmony_ci .reg = -1, 3578c2ecf20Sopenharmony_ci .mask = PMX_UART0_MODEM_MASK, 3588c2ecf20Sopenharmony_ci .val = PMX_UART0_MODEM_MASK, 3598c2ecf20Sopenharmony_ci }, 3608c2ecf20Sopenharmony_ci}; 3618c2ecf20Sopenharmony_ci 3628c2ecf20Sopenharmony_cistatic struct spear_modemux uart0_ext_modemux[] = { 3638c2ecf20Sopenharmony_ci { 3648c2ecf20Sopenharmony_ci .modes = ~0, 3658c2ecf20Sopenharmony_ci .muxregs = uart0_ext_muxreg, 3668c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart0_ext_muxreg), 3678c2ecf20Sopenharmony_ci }, 3688c2ecf20Sopenharmony_ci}; 3698c2ecf20Sopenharmony_ci 3708c2ecf20Sopenharmony_cistruct spear_pingroup spear3xx_uart0_ext_pingroup = { 3718c2ecf20Sopenharmony_ci .name = "uart0_ext_grp", 3728c2ecf20Sopenharmony_ci .pins = uart0_ext_pins, 3738c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(uart0_ext_pins), 3748c2ecf20Sopenharmony_ci .modemuxs = uart0_ext_modemux, 3758c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(uart0_ext_modemux), 3768c2ecf20Sopenharmony_ci}; 3778c2ecf20Sopenharmony_ci 3788c2ecf20Sopenharmony_cistatic const char *const uart0_ext_grps[] = { "uart0_ext_grp" }; 3798c2ecf20Sopenharmony_cistruct spear_function spear3xx_uart0_ext_function = { 3808c2ecf20Sopenharmony_ci .name = "uart0_ext", 3818c2ecf20Sopenharmony_ci .groups = uart0_ext_grps, 3828c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(uart0_ext_grps), 3838c2ecf20Sopenharmony_ci}; 3848c2ecf20Sopenharmony_ci 3858c2ecf20Sopenharmony_ci/* uart0_pins */ 3868c2ecf20Sopenharmony_cistatic const unsigned uart0_pins[] = { 2, 3 }; 3878c2ecf20Sopenharmony_cistatic struct spear_muxreg uart0_muxreg[] = { 3888c2ecf20Sopenharmony_ci { 3898c2ecf20Sopenharmony_ci .reg = -1, 3908c2ecf20Sopenharmony_ci .mask = PMX_UART0_MASK, 3918c2ecf20Sopenharmony_ci .val = PMX_UART0_MASK, 3928c2ecf20Sopenharmony_ci }, 3938c2ecf20Sopenharmony_ci}; 3948c2ecf20Sopenharmony_ci 3958c2ecf20Sopenharmony_cistatic struct spear_modemux uart0_modemux[] = { 3968c2ecf20Sopenharmony_ci { 3978c2ecf20Sopenharmony_ci .modes = ~0, 3988c2ecf20Sopenharmony_ci .muxregs = uart0_muxreg, 3998c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart0_muxreg), 4008c2ecf20Sopenharmony_ci }, 4018c2ecf20Sopenharmony_ci}; 4028c2ecf20Sopenharmony_ci 4038c2ecf20Sopenharmony_cistruct spear_pingroup spear3xx_uart0_pingroup = { 4048c2ecf20Sopenharmony_ci .name = "uart0_grp", 4058c2ecf20Sopenharmony_ci .pins = uart0_pins, 4068c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(uart0_pins), 4078c2ecf20Sopenharmony_ci .modemuxs = uart0_modemux, 4088c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(uart0_modemux), 4098c2ecf20Sopenharmony_ci}; 4108c2ecf20Sopenharmony_ci 4118c2ecf20Sopenharmony_cistatic const char *const uart0_grps[] = { "uart0_grp" }; 4128c2ecf20Sopenharmony_cistruct spear_function spear3xx_uart0_function = { 4138c2ecf20Sopenharmony_ci .name = "uart0", 4148c2ecf20Sopenharmony_ci .groups = uart0_grps, 4158c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(uart0_grps), 4168c2ecf20Sopenharmony_ci}; 4178c2ecf20Sopenharmony_ci 4188c2ecf20Sopenharmony_ci/* timer_0_1_pins */ 4198c2ecf20Sopenharmony_cistatic const unsigned timer_0_1_pins[] = { 43, 44, 47, 48 }; 4208c2ecf20Sopenharmony_cistatic struct spear_muxreg timer_0_1_muxreg[] = { 4218c2ecf20Sopenharmony_ci { 4228c2ecf20Sopenharmony_ci .reg = -1, 4238c2ecf20Sopenharmony_ci .mask = PMX_TIMER_0_1_MASK, 4248c2ecf20Sopenharmony_ci .val = PMX_TIMER_0_1_MASK, 4258c2ecf20Sopenharmony_ci }, 4268c2ecf20Sopenharmony_ci}; 4278c2ecf20Sopenharmony_ci 4288c2ecf20Sopenharmony_cistatic struct spear_modemux timer_0_1_modemux[] = { 4298c2ecf20Sopenharmony_ci { 4308c2ecf20Sopenharmony_ci .modes = ~0, 4318c2ecf20Sopenharmony_ci .muxregs = timer_0_1_muxreg, 4328c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(timer_0_1_muxreg), 4338c2ecf20Sopenharmony_ci }, 4348c2ecf20Sopenharmony_ci}; 4358c2ecf20Sopenharmony_ci 4368c2ecf20Sopenharmony_cistruct spear_pingroup spear3xx_timer_0_1_pingroup = { 4378c2ecf20Sopenharmony_ci .name = "timer_0_1_grp", 4388c2ecf20Sopenharmony_ci .pins = timer_0_1_pins, 4398c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(timer_0_1_pins), 4408c2ecf20Sopenharmony_ci .modemuxs = timer_0_1_modemux, 4418c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(timer_0_1_modemux), 4428c2ecf20Sopenharmony_ci}; 4438c2ecf20Sopenharmony_ci 4448c2ecf20Sopenharmony_cistatic const char *const timer_0_1_grps[] = { "timer_0_1_grp" }; 4458c2ecf20Sopenharmony_cistruct spear_function spear3xx_timer_0_1_function = { 4468c2ecf20Sopenharmony_ci .name = "timer_0_1", 4478c2ecf20Sopenharmony_ci .groups = timer_0_1_grps, 4488c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(timer_0_1_grps), 4498c2ecf20Sopenharmony_ci}; 4508c2ecf20Sopenharmony_ci 4518c2ecf20Sopenharmony_ci/* timer_2_3_pins */ 4528c2ecf20Sopenharmony_cistatic const unsigned timer_2_3_pins[] = { 45, 46, 49, 50 }; 4538c2ecf20Sopenharmony_cistatic struct spear_muxreg timer_2_3_muxreg[] = { 4548c2ecf20Sopenharmony_ci { 4558c2ecf20Sopenharmony_ci .reg = -1, 4568c2ecf20Sopenharmony_ci .mask = PMX_TIMER_2_3_MASK, 4578c2ecf20Sopenharmony_ci .val = PMX_TIMER_2_3_MASK, 4588c2ecf20Sopenharmony_ci }, 4598c2ecf20Sopenharmony_ci}; 4608c2ecf20Sopenharmony_ci 4618c2ecf20Sopenharmony_cistatic struct spear_modemux timer_2_3_modemux[] = { 4628c2ecf20Sopenharmony_ci { 4638c2ecf20Sopenharmony_ci .modes = ~0, 4648c2ecf20Sopenharmony_ci .muxregs = timer_2_3_muxreg, 4658c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(timer_2_3_muxreg), 4668c2ecf20Sopenharmony_ci }, 4678c2ecf20Sopenharmony_ci}; 4688c2ecf20Sopenharmony_ci 4698c2ecf20Sopenharmony_cistruct spear_pingroup spear3xx_timer_2_3_pingroup = { 4708c2ecf20Sopenharmony_ci .name = "timer_2_3_grp", 4718c2ecf20Sopenharmony_ci .pins = timer_2_3_pins, 4728c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(timer_2_3_pins), 4738c2ecf20Sopenharmony_ci .modemuxs = timer_2_3_modemux, 4748c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(timer_2_3_modemux), 4758c2ecf20Sopenharmony_ci}; 4768c2ecf20Sopenharmony_ci 4778c2ecf20Sopenharmony_cistatic const char *const timer_2_3_grps[] = { "timer_2_3_grp" }; 4788c2ecf20Sopenharmony_cistruct spear_function spear3xx_timer_2_3_function = { 4798c2ecf20Sopenharmony_ci .name = "timer_2_3", 4808c2ecf20Sopenharmony_ci .groups = timer_2_3_grps, 4818c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(timer_2_3_grps), 4828c2ecf20Sopenharmony_ci}; 4838c2ecf20Sopenharmony_ci 4848c2ecf20Sopenharmony_ci/* Define muxreg arrays */ 4858c2ecf20Sopenharmony_ciDEFINE_MUXREG(firda_pins, 0, PMX_FIRDA_MASK, 0); 4868c2ecf20Sopenharmony_ciDEFINE_MUXREG(i2c_pins, 0, PMX_I2C_MASK, 0); 4878c2ecf20Sopenharmony_ciDEFINE_MUXREG(ssp_cs_pins, 0, PMX_SSP_CS_MASK, 0); 4888c2ecf20Sopenharmony_ciDEFINE_MUXREG(ssp_pins, 0, PMX_SSP_MASK, 0); 4898c2ecf20Sopenharmony_ciDEFINE_MUXREG(mii_pins, 0, PMX_MII_MASK, 0); 4908c2ecf20Sopenharmony_ciDEFINE_MUXREG(gpio0_pin0_pins, 0, PMX_GPIO_PIN0_MASK, 0); 4918c2ecf20Sopenharmony_ciDEFINE_MUXREG(gpio0_pin1_pins, 0, PMX_GPIO_PIN1_MASK, 0); 4928c2ecf20Sopenharmony_ciDEFINE_MUXREG(gpio0_pin2_pins, 0, PMX_GPIO_PIN2_MASK, 0); 4938c2ecf20Sopenharmony_ciDEFINE_MUXREG(gpio0_pin3_pins, 0, PMX_GPIO_PIN3_MASK, 0); 4948c2ecf20Sopenharmony_ciDEFINE_MUXREG(gpio0_pin4_pins, 0, PMX_GPIO_PIN4_MASK, 0); 4958c2ecf20Sopenharmony_ciDEFINE_MUXREG(gpio0_pin5_pins, 0, PMX_GPIO_PIN5_MASK, 0); 4968c2ecf20Sopenharmony_ciDEFINE_MUXREG(uart0_ext_pins, 0, PMX_UART0_MODEM_MASK, 0); 4978c2ecf20Sopenharmony_ciDEFINE_MUXREG(uart0_pins, 0, PMX_UART0_MASK, 0); 4988c2ecf20Sopenharmony_ciDEFINE_MUXREG(timer_0_1_pins, 0, PMX_TIMER_0_1_MASK, 0); 4998c2ecf20Sopenharmony_ciDEFINE_MUXREG(timer_2_3_pins, 0, PMX_TIMER_2_3_MASK, 0); 5008c2ecf20Sopenharmony_ci 5018c2ecf20Sopenharmony_cistatic struct spear_gpio_pingroup spear3xx_gpio_pingroup[] = { 5028c2ecf20Sopenharmony_ci GPIO_PINGROUP(firda_pins), 5038c2ecf20Sopenharmony_ci GPIO_PINGROUP(i2c_pins), 5048c2ecf20Sopenharmony_ci GPIO_PINGROUP(ssp_cs_pins), 5058c2ecf20Sopenharmony_ci GPIO_PINGROUP(ssp_pins), 5068c2ecf20Sopenharmony_ci GPIO_PINGROUP(mii_pins), 5078c2ecf20Sopenharmony_ci GPIO_PINGROUP(gpio0_pin0_pins), 5088c2ecf20Sopenharmony_ci GPIO_PINGROUP(gpio0_pin1_pins), 5098c2ecf20Sopenharmony_ci GPIO_PINGROUP(gpio0_pin2_pins), 5108c2ecf20Sopenharmony_ci GPIO_PINGROUP(gpio0_pin3_pins), 5118c2ecf20Sopenharmony_ci GPIO_PINGROUP(gpio0_pin4_pins), 5128c2ecf20Sopenharmony_ci GPIO_PINGROUP(gpio0_pin5_pins), 5138c2ecf20Sopenharmony_ci GPIO_PINGROUP(uart0_ext_pins), 5148c2ecf20Sopenharmony_ci GPIO_PINGROUP(uart0_pins), 5158c2ecf20Sopenharmony_ci GPIO_PINGROUP(timer_0_1_pins), 5168c2ecf20Sopenharmony_ci GPIO_PINGROUP(timer_2_3_pins), 5178c2ecf20Sopenharmony_ci}; 5188c2ecf20Sopenharmony_ci 5198c2ecf20Sopenharmony_cistruct spear_pinctrl_machdata spear3xx_machdata = { 5208c2ecf20Sopenharmony_ci .pins = spear3xx_pins, 5218c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(spear3xx_pins), 5228c2ecf20Sopenharmony_ci .gpio_pingroups = spear3xx_gpio_pingroup, 5238c2ecf20Sopenharmony_ci .ngpio_pingroups = ARRAY_SIZE(spear3xx_gpio_pingroup), 5248c2ecf20Sopenharmony_ci}; 525