18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * Driver for the ST Microelectronics SPEAr320 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/err.h> 138c2ecf20Sopenharmony_ci#include <linux/init.h> 148c2ecf20Sopenharmony_ci#include <linux/of_device.h> 158c2ecf20Sopenharmony_ci#include <linux/platform_device.h> 168c2ecf20Sopenharmony_ci#include "pinctrl-spear3xx.h" 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci#define DRIVER_NAME "spear320-pinmux" 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci/* addresses */ 218c2ecf20Sopenharmony_ci#define PMX_CONFIG_REG 0x0C 228c2ecf20Sopenharmony_ci#define MODE_CONFIG_REG 0x10 238c2ecf20Sopenharmony_ci#define MODE_EXT_CONFIG_REG 0x18 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ci/* modes */ 268c2ecf20Sopenharmony_ci#define AUTO_NET_SMII_MODE (1 << 0) 278c2ecf20Sopenharmony_ci#define AUTO_NET_MII_MODE (1 << 1) 288c2ecf20Sopenharmony_ci#define AUTO_EXP_MODE (1 << 2) 298c2ecf20Sopenharmony_ci#define SMALL_PRINTERS_MODE (1 << 3) 308c2ecf20Sopenharmony_ci#define EXTENDED_MODE (1 << 4) 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_cistatic struct spear_pmx_mode pmx_mode_auto_net_smii = { 338c2ecf20Sopenharmony_ci .name = "Automation Networking SMII mode", 348c2ecf20Sopenharmony_ci .mode = AUTO_NET_SMII_MODE, 358c2ecf20Sopenharmony_ci .reg = MODE_CONFIG_REG, 368c2ecf20Sopenharmony_ci .mask = 0x00000007, 378c2ecf20Sopenharmony_ci .val = 0x0, 388c2ecf20Sopenharmony_ci}; 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_cistatic struct spear_pmx_mode pmx_mode_auto_net_mii = { 418c2ecf20Sopenharmony_ci .name = "Automation Networking MII mode", 428c2ecf20Sopenharmony_ci .mode = AUTO_NET_MII_MODE, 438c2ecf20Sopenharmony_ci .reg = MODE_CONFIG_REG, 448c2ecf20Sopenharmony_ci .mask = 0x00000007, 458c2ecf20Sopenharmony_ci .val = 0x1, 468c2ecf20Sopenharmony_ci}; 478c2ecf20Sopenharmony_ci 488c2ecf20Sopenharmony_cistatic struct spear_pmx_mode pmx_mode_auto_exp = { 498c2ecf20Sopenharmony_ci .name = "Automation Expanded mode", 508c2ecf20Sopenharmony_ci .mode = AUTO_EXP_MODE, 518c2ecf20Sopenharmony_ci .reg = MODE_CONFIG_REG, 528c2ecf20Sopenharmony_ci .mask = 0x00000007, 538c2ecf20Sopenharmony_ci .val = 0x2, 548c2ecf20Sopenharmony_ci}; 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_cistatic struct spear_pmx_mode pmx_mode_small_printers = { 578c2ecf20Sopenharmony_ci .name = "Small Printers mode", 588c2ecf20Sopenharmony_ci .mode = SMALL_PRINTERS_MODE, 598c2ecf20Sopenharmony_ci .reg = MODE_CONFIG_REG, 608c2ecf20Sopenharmony_ci .mask = 0x00000007, 618c2ecf20Sopenharmony_ci .val = 0x3, 628c2ecf20Sopenharmony_ci}; 638c2ecf20Sopenharmony_ci 648c2ecf20Sopenharmony_cistatic struct spear_pmx_mode pmx_mode_extended = { 658c2ecf20Sopenharmony_ci .name = "extended mode", 668c2ecf20Sopenharmony_ci .mode = EXTENDED_MODE, 678c2ecf20Sopenharmony_ci .reg = MODE_EXT_CONFIG_REG, 688c2ecf20Sopenharmony_ci .mask = 0x00000001, 698c2ecf20Sopenharmony_ci .val = 0x1, 708c2ecf20Sopenharmony_ci}; 718c2ecf20Sopenharmony_ci 728c2ecf20Sopenharmony_cistatic struct spear_pmx_mode *spear320_pmx_modes[] = { 738c2ecf20Sopenharmony_ci &pmx_mode_auto_net_smii, 748c2ecf20Sopenharmony_ci &pmx_mode_auto_net_mii, 758c2ecf20Sopenharmony_ci &pmx_mode_auto_exp, 768c2ecf20Sopenharmony_ci &pmx_mode_small_printers, 778c2ecf20Sopenharmony_ci &pmx_mode_extended, 788c2ecf20Sopenharmony_ci}; 798c2ecf20Sopenharmony_ci 808c2ecf20Sopenharmony_ci/* Extended mode registers and their offsets */ 818c2ecf20Sopenharmony_ci#define EXT_CTRL_REG 0x0018 828c2ecf20Sopenharmony_ci #define MII_MDIO_MASK (1 << 4) 838c2ecf20Sopenharmony_ci #define MII_MDIO_10_11_VAL 0 848c2ecf20Sopenharmony_ci #define MII_MDIO_81_VAL (1 << 4) 858c2ecf20Sopenharmony_ci #define EMI_FSMC_DYNAMIC_MUX_MASK (1 << 5) 868c2ecf20Sopenharmony_ci #define MAC_MODE_MII 0 878c2ecf20Sopenharmony_ci #define MAC_MODE_RMII 1 888c2ecf20Sopenharmony_ci #define MAC_MODE_SMII 2 898c2ecf20Sopenharmony_ci #define MAC_MODE_SS_SMII 3 908c2ecf20Sopenharmony_ci #define MAC_MODE_MASK 0x3 918c2ecf20Sopenharmony_ci #define MAC1_MODE_SHIFT 16 928c2ecf20Sopenharmony_ci #define MAC2_MODE_SHIFT 18 938c2ecf20Sopenharmony_ci 948c2ecf20Sopenharmony_ci#define IP_SEL_PAD_0_9_REG 0x00A4 958c2ecf20Sopenharmony_ci #define PMX_PL_0_1_MASK (0x3F << 0) 968c2ecf20Sopenharmony_ci #define PMX_UART2_PL_0_1_VAL 0x0 978c2ecf20Sopenharmony_ci #define PMX_I2C2_PL_0_1_VAL (0x4 | (0x4 << 3)) 988c2ecf20Sopenharmony_ci 998c2ecf20Sopenharmony_ci #define PMX_PL_2_3_MASK (0x3F << 6) 1008c2ecf20Sopenharmony_ci #define PMX_I2C2_PL_2_3_VAL 0x0 1018c2ecf20Sopenharmony_ci #define PMX_UART6_PL_2_3_VAL ((0x1 << 6) | (0x1 << 9)) 1028c2ecf20Sopenharmony_ci #define PMX_UART1_ENH_PL_2_3_VAL ((0x4 << 6) | (0x4 << 9)) 1038c2ecf20Sopenharmony_ci 1048c2ecf20Sopenharmony_ci #define PMX_PL_4_5_MASK (0x3F << 12) 1058c2ecf20Sopenharmony_ci #define PMX_UART5_PL_4_5_VAL ((0x1 << 12) | (0x1 << 15)) 1068c2ecf20Sopenharmony_ci #define PMX_UART1_ENH_PL_4_5_VAL ((0x4 << 12) | (0x4 << 15)) 1078c2ecf20Sopenharmony_ci #define PMX_PL_5_MASK (0x7 << 15) 1088c2ecf20Sopenharmony_ci #define PMX_TOUCH_Y_PL_5_VAL 0x0 1098c2ecf20Sopenharmony_ci 1108c2ecf20Sopenharmony_ci #define PMX_PL_6_7_MASK (0x3F << 18) 1118c2ecf20Sopenharmony_ci #define PMX_PL_6_MASK (0x7 << 18) 1128c2ecf20Sopenharmony_ci #define PMX_PL_7_MASK (0x7 << 21) 1138c2ecf20Sopenharmony_ci #define PMX_UART4_PL_6_7_VAL ((0x1 << 18) | (0x1 << 21)) 1148c2ecf20Sopenharmony_ci #define PMX_PWM_3_PL_6_VAL (0x2 << 18) 1158c2ecf20Sopenharmony_ci #define PMX_PWM_2_PL_7_VAL (0x2 << 21) 1168c2ecf20Sopenharmony_ci #define PMX_UART1_ENH_PL_6_7_VAL ((0x4 << 18) | (0x4 << 21)) 1178c2ecf20Sopenharmony_ci 1188c2ecf20Sopenharmony_ci #define PMX_PL_8_9_MASK (0x3F << 24) 1198c2ecf20Sopenharmony_ci #define PMX_UART3_PL_8_9_VAL ((0x1 << 24) | (0x1 << 27)) 1208c2ecf20Sopenharmony_ci #define PMX_PWM_0_1_PL_8_9_VAL ((0x2 << 24) | (0x2 << 27)) 1218c2ecf20Sopenharmony_ci #define PMX_I2C1_PL_8_9_VAL ((0x4 << 24) | (0x4 << 27)) 1228c2ecf20Sopenharmony_ci 1238c2ecf20Sopenharmony_ci#define IP_SEL_PAD_10_19_REG 0x00A8 1248c2ecf20Sopenharmony_ci #define PMX_PL_10_11_MASK (0x3F << 0) 1258c2ecf20Sopenharmony_ci #define PMX_SMII_PL_10_11_VAL 0 1268c2ecf20Sopenharmony_ci #define PMX_RMII_PL_10_11_VAL ((0x4 << 0) | (0x4 << 3)) 1278c2ecf20Sopenharmony_ci 1288c2ecf20Sopenharmony_ci #define PMX_PL_12_MASK (0x7 << 6) 1298c2ecf20Sopenharmony_ci #define PMX_PWM3_PL_12_VAL 0 1308c2ecf20Sopenharmony_ci #define PMX_SDHCI_CD_PL_12_VAL (0x4 << 6) 1318c2ecf20Sopenharmony_ci 1328c2ecf20Sopenharmony_ci #define PMX_PL_13_14_MASK (0x3F << 9) 1338c2ecf20Sopenharmony_ci #define PMX_PL_13_MASK (0x7 << 9) 1348c2ecf20Sopenharmony_ci #define PMX_PL_14_MASK (0x7 << 12) 1358c2ecf20Sopenharmony_ci #define PMX_SSP2_PL_13_14_15_16_VAL 0 1368c2ecf20Sopenharmony_ci #define PMX_UART4_PL_13_14_VAL ((0x1 << 9) | (0x1 << 12)) 1378c2ecf20Sopenharmony_ci #define PMX_RMII_PL_13_14_VAL ((0x4 << 9) | (0x4 << 12)) 1388c2ecf20Sopenharmony_ci #define PMX_PWM2_PL_13_VAL (0x2 << 9) 1398c2ecf20Sopenharmony_ci #define PMX_PWM1_PL_14_VAL (0x2 << 12) 1408c2ecf20Sopenharmony_ci 1418c2ecf20Sopenharmony_ci #define PMX_PL_15_MASK (0x7 << 15) 1428c2ecf20Sopenharmony_ci #define PMX_PWM0_PL_15_VAL (0x2 << 15) 1438c2ecf20Sopenharmony_ci #define PMX_PL_15_16_MASK (0x3F << 15) 1448c2ecf20Sopenharmony_ci #define PMX_UART3_PL_15_16_VAL ((0x1 << 15) | (0x1 << 18)) 1458c2ecf20Sopenharmony_ci #define PMX_RMII_PL_15_16_VAL ((0x4 << 15) | (0x4 << 18)) 1468c2ecf20Sopenharmony_ci 1478c2ecf20Sopenharmony_ci #define PMX_PL_17_18_MASK (0x3F << 21) 1488c2ecf20Sopenharmony_ci #define PMX_SSP1_PL_17_18_19_20_VAL 0 1498c2ecf20Sopenharmony_ci #define PMX_RMII_PL_17_18_VAL ((0x4 << 21) | (0x4 << 24)) 1508c2ecf20Sopenharmony_ci 1518c2ecf20Sopenharmony_ci #define PMX_PL_19_MASK (0x7 << 27) 1528c2ecf20Sopenharmony_ci #define PMX_I2C2_PL_19_VAL (0x1 << 27) 1538c2ecf20Sopenharmony_ci #define PMX_RMII_PL_19_VAL (0x4 << 27) 1548c2ecf20Sopenharmony_ci 1558c2ecf20Sopenharmony_ci#define IP_SEL_PAD_20_29_REG 0x00AC 1568c2ecf20Sopenharmony_ci #define PMX_PL_20_MASK (0x7 << 0) 1578c2ecf20Sopenharmony_ci #define PMX_I2C2_PL_20_VAL (0x1 << 0) 1588c2ecf20Sopenharmony_ci #define PMX_RMII_PL_20_VAL (0x4 << 0) 1598c2ecf20Sopenharmony_ci 1608c2ecf20Sopenharmony_ci #define PMX_PL_21_TO_27_MASK (0x1FFFFF << 3) 1618c2ecf20Sopenharmony_ci #define PMX_SMII_PL_21_TO_27_VAL 0 1628c2ecf20Sopenharmony_ci #define PMX_RMII_PL_21_TO_27_VAL ((0x4 << 3) | (0x4 << 6) | (0x4 << 9) | (0x4 << 12) | (0x4 << 15) | (0x4 << 18) | (0x4 << 21)) 1638c2ecf20Sopenharmony_ci 1648c2ecf20Sopenharmony_ci #define PMX_PL_28_29_MASK (0x3F << 24) 1658c2ecf20Sopenharmony_ci #define PMX_PL_28_MASK (0x7 << 24) 1668c2ecf20Sopenharmony_ci #define PMX_PL_29_MASK (0x7 << 27) 1678c2ecf20Sopenharmony_ci #define PMX_UART1_PL_28_29_VAL 0 1688c2ecf20Sopenharmony_ci #define PMX_PWM_3_PL_28_VAL (0x4 << 24) 1698c2ecf20Sopenharmony_ci #define PMX_PWM_2_PL_29_VAL (0x4 << 27) 1708c2ecf20Sopenharmony_ci 1718c2ecf20Sopenharmony_ci#define IP_SEL_PAD_30_39_REG 0x00B0 1728c2ecf20Sopenharmony_ci #define PMX_PL_30_31_MASK (0x3F << 0) 1738c2ecf20Sopenharmony_ci #define PMX_CAN1_PL_30_31_VAL (0) 1748c2ecf20Sopenharmony_ci #define PMX_PL_30_MASK (0x7 << 0) 1758c2ecf20Sopenharmony_ci #define PMX_PL_31_MASK (0x7 << 3) 1768c2ecf20Sopenharmony_ci #define PMX_PWM1_EXT_PL_30_VAL (0x4 << 0) 1778c2ecf20Sopenharmony_ci #define PMX_PWM0_EXT_PL_31_VAL (0x4 << 3) 1788c2ecf20Sopenharmony_ci #define PMX_UART1_ENH_PL_31_VAL (0x3 << 3) 1798c2ecf20Sopenharmony_ci 1808c2ecf20Sopenharmony_ci #define PMX_PL_32_33_MASK (0x3F << 6) 1818c2ecf20Sopenharmony_ci #define PMX_CAN0_PL_32_33_VAL 0 1828c2ecf20Sopenharmony_ci #define PMX_UART1_ENH_PL_32_33_VAL ((0x3 << 6) | (0x3 << 9)) 1838c2ecf20Sopenharmony_ci #define PMX_SSP2_PL_32_33_VAL ((0x4 << 6) | (0x4 << 9)) 1848c2ecf20Sopenharmony_ci 1858c2ecf20Sopenharmony_ci #define PMX_PL_34_MASK (0x7 << 12) 1868c2ecf20Sopenharmony_ci #define PMX_PWM2_PL_34_VAL 0 1878c2ecf20Sopenharmony_ci #define PMX_UART1_ENH_PL_34_VAL (0x2 << 12) 1888c2ecf20Sopenharmony_ci #define PMX_SSP2_PL_34_VAL (0x4 << 12) 1898c2ecf20Sopenharmony_ci 1908c2ecf20Sopenharmony_ci #define PMX_PL_35_MASK (0x7 << 15) 1918c2ecf20Sopenharmony_ci #define PMX_I2S_REF_CLK_PL_35_VAL 0 1928c2ecf20Sopenharmony_ci #define PMX_UART1_ENH_PL_35_VAL (0x2 << 15) 1938c2ecf20Sopenharmony_ci #define PMX_SSP2_PL_35_VAL (0x4 << 15) 1948c2ecf20Sopenharmony_ci 1958c2ecf20Sopenharmony_ci #define PMX_PL_36_MASK (0x7 << 18) 1968c2ecf20Sopenharmony_ci #define PMX_TOUCH_X_PL_36_VAL 0 1978c2ecf20Sopenharmony_ci #define PMX_UART1_ENH_PL_36_VAL (0x2 << 18) 1988c2ecf20Sopenharmony_ci #define PMX_SSP1_PL_36_VAL (0x4 << 18) 1998c2ecf20Sopenharmony_ci 2008c2ecf20Sopenharmony_ci #define PMX_PL_37_38_MASK (0x3F << 21) 2018c2ecf20Sopenharmony_ci #define PMX_PWM0_1_PL_37_38_VAL 0 2028c2ecf20Sopenharmony_ci #define PMX_UART5_PL_37_38_VAL ((0x2 << 21) | (0x2 << 24)) 2038c2ecf20Sopenharmony_ci #define PMX_SSP1_PL_37_38_VAL ((0x4 << 21) | (0x4 << 24)) 2048c2ecf20Sopenharmony_ci 2058c2ecf20Sopenharmony_ci #define PMX_PL_39_MASK (0x7 << 27) 2068c2ecf20Sopenharmony_ci #define PMX_I2S_PL_39_VAL 0 2078c2ecf20Sopenharmony_ci #define PMX_UART4_PL_39_VAL (0x2 << 27) 2088c2ecf20Sopenharmony_ci #define PMX_SSP1_PL_39_VAL (0x4 << 27) 2098c2ecf20Sopenharmony_ci 2108c2ecf20Sopenharmony_ci#define IP_SEL_PAD_40_49_REG 0x00B4 2118c2ecf20Sopenharmony_ci #define PMX_PL_40_MASK (0x7 << 0) 2128c2ecf20Sopenharmony_ci #define PMX_I2S_PL_40_VAL 0 2138c2ecf20Sopenharmony_ci #define PMX_UART4_PL_40_VAL (0x2 << 0) 2148c2ecf20Sopenharmony_ci #define PMX_PWM3_PL_40_VAL (0x4 << 0) 2158c2ecf20Sopenharmony_ci 2168c2ecf20Sopenharmony_ci #define PMX_PL_41_42_MASK (0x3F << 3) 2178c2ecf20Sopenharmony_ci #define PMX_PL_41_MASK (0x7 << 3) 2188c2ecf20Sopenharmony_ci #define PMX_PL_42_MASK (0x7 << 6) 2198c2ecf20Sopenharmony_ci #define PMX_I2S_PL_41_42_VAL 0 2208c2ecf20Sopenharmony_ci #define PMX_UART3_PL_41_42_VAL ((0x2 << 3) | (0x2 << 6)) 2218c2ecf20Sopenharmony_ci #define PMX_PWM2_PL_41_VAL (0x4 << 3) 2228c2ecf20Sopenharmony_ci #define PMX_PWM1_PL_42_VAL (0x4 << 6) 2238c2ecf20Sopenharmony_ci 2248c2ecf20Sopenharmony_ci #define PMX_PL_43_MASK (0x7 << 9) 2258c2ecf20Sopenharmony_ci #define PMX_SDHCI_PL_43_VAL 0 2268c2ecf20Sopenharmony_ci #define PMX_UART1_ENH_PL_43_VAL (0x2 << 9) 2278c2ecf20Sopenharmony_ci #define PMX_PWM0_PL_43_VAL (0x4 << 9) 2288c2ecf20Sopenharmony_ci 2298c2ecf20Sopenharmony_ci #define PMX_PL_44_45_MASK (0x3F << 12) 2308c2ecf20Sopenharmony_ci #define PMX_SDHCI_PL_44_45_VAL 0 2318c2ecf20Sopenharmony_ci #define PMX_UART1_ENH_PL_44_45_VAL ((0x2 << 12) | (0x2 << 15)) 2328c2ecf20Sopenharmony_ci #define PMX_SSP2_PL_44_45_VAL ((0x4 << 12) | (0x4 << 15)) 2338c2ecf20Sopenharmony_ci 2348c2ecf20Sopenharmony_ci #define PMX_PL_46_47_MASK (0x3F << 18) 2358c2ecf20Sopenharmony_ci #define PMX_SDHCI_PL_46_47_VAL 0 2368c2ecf20Sopenharmony_ci #define PMX_FSMC_EMI_PL_46_47_VAL ((0x2 << 18) | (0x2 << 21)) 2378c2ecf20Sopenharmony_ci #define PMX_SSP2_PL_46_47_VAL ((0x4 << 18) | (0x4 << 21)) 2388c2ecf20Sopenharmony_ci 2398c2ecf20Sopenharmony_ci #define PMX_PL_48_49_MASK (0x3F << 24) 2408c2ecf20Sopenharmony_ci #define PMX_SDHCI_PL_48_49_VAL 0 2418c2ecf20Sopenharmony_ci #define PMX_FSMC_EMI_PL_48_49_VAL ((0x2 << 24) | (0x2 << 27)) 2428c2ecf20Sopenharmony_ci #define PMX_SSP1_PL_48_49_VAL ((0x4 << 24) | (0x4 << 27)) 2438c2ecf20Sopenharmony_ci 2448c2ecf20Sopenharmony_ci#define IP_SEL_PAD_50_59_REG 0x00B8 2458c2ecf20Sopenharmony_ci #define PMX_PL_50_51_MASK (0x3F << 0) 2468c2ecf20Sopenharmony_ci #define PMX_EMI_PL_50_51_VAL ((0x2 << 0) | (0x2 << 3)) 2478c2ecf20Sopenharmony_ci #define PMX_SSP1_PL_50_51_VAL ((0x4 << 0) | (0x4 << 3)) 2488c2ecf20Sopenharmony_ci #define PMX_PL_50_MASK (0x7 << 0) 2498c2ecf20Sopenharmony_ci #define PMX_PL_51_MASK (0x7 << 3) 2508c2ecf20Sopenharmony_ci #define PMX_SDHCI_PL_50_VAL 0 2518c2ecf20Sopenharmony_ci #define PMX_SDHCI_CD_PL_51_VAL 0 2528c2ecf20Sopenharmony_ci 2538c2ecf20Sopenharmony_ci #define PMX_PL_52_53_MASK (0x3F << 6) 2548c2ecf20Sopenharmony_ci #define PMX_FSMC_PL_52_53_VAL 0 2558c2ecf20Sopenharmony_ci #define PMX_EMI_PL_52_53_VAL ((0x2 << 6) | (0x2 << 9)) 2568c2ecf20Sopenharmony_ci #define PMX_UART3_PL_52_53_VAL ((0x4 << 6) | (0x4 << 9)) 2578c2ecf20Sopenharmony_ci 2588c2ecf20Sopenharmony_ci #define PMX_PL_54_55_56_MASK (0x1FF << 12) 2598c2ecf20Sopenharmony_ci #define PMX_FSMC_EMI_PL_54_55_56_VAL ((0x2 << 12) | (0x2 << 15) | (0x2 << 18)) 2608c2ecf20Sopenharmony_ci 2618c2ecf20Sopenharmony_ci #define PMX_PL_57_MASK (0x7 << 21) 2628c2ecf20Sopenharmony_ci #define PMX_FSMC_PL_57_VAL 0 2638c2ecf20Sopenharmony_ci #define PMX_PWM3_PL_57_VAL (0x4 << 21) 2648c2ecf20Sopenharmony_ci 2658c2ecf20Sopenharmony_ci #define PMX_PL_58_59_MASK (0x3F << 24) 2668c2ecf20Sopenharmony_ci #define PMX_PL_58_MASK (0x7 << 24) 2678c2ecf20Sopenharmony_ci #define PMX_PL_59_MASK (0x7 << 27) 2688c2ecf20Sopenharmony_ci #define PMX_FSMC_EMI_PL_58_59_VAL ((0x2 << 24) | (0x2 << 27)) 2698c2ecf20Sopenharmony_ci #define PMX_PWM2_PL_58_VAL (0x4 << 24) 2708c2ecf20Sopenharmony_ci #define PMX_PWM1_PL_59_VAL (0x4 << 27) 2718c2ecf20Sopenharmony_ci 2728c2ecf20Sopenharmony_ci#define IP_SEL_PAD_60_69_REG 0x00BC 2738c2ecf20Sopenharmony_ci #define PMX_PL_60_MASK (0x7 << 0) 2748c2ecf20Sopenharmony_ci #define PMX_FSMC_PL_60_VAL 0 2758c2ecf20Sopenharmony_ci #define PMX_PWM0_PL_60_VAL (0x4 << 0) 2768c2ecf20Sopenharmony_ci 2778c2ecf20Sopenharmony_ci #define PMX_PL_61_TO_64_MASK (0xFFF << 3) 2788c2ecf20Sopenharmony_ci #define PMX_FSMC_PL_61_TO_64_VAL ((0x2 << 3) | (0x2 << 6) | (0x2 << 9) | (0x2 << 12)) 2798c2ecf20Sopenharmony_ci #define PMX_SSP2_PL_61_TO_64_VAL ((0x4 << 3) | (0x4 << 6) | (0x4 << 9) | (0x4 << 12)) 2808c2ecf20Sopenharmony_ci 2818c2ecf20Sopenharmony_ci #define PMX_PL_65_TO_68_MASK (0xFFF << 15) 2828c2ecf20Sopenharmony_ci #define PMX_FSMC_PL_65_TO_68_VAL ((0x2 << 15) | (0x2 << 18) | (0x2 << 21) | (0x2 << 24)) 2838c2ecf20Sopenharmony_ci #define PMX_SSP1_PL_65_TO_68_VAL ((0x4 << 15) | (0x4 << 18) | (0x4 << 21) | (0x4 << 24)) 2848c2ecf20Sopenharmony_ci 2858c2ecf20Sopenharmony_ci #define PMX_PL_69_MASK (0x7 << 27) 2868c2ecf20Sopenharmony_ci #define PMX_CLCD_PL_69_VAL (0) 2878c2ecf20Sopenharmony_ci #define PMX_EMI_PL_69_VAL (0x2 << 27) 2888c2ecf20Sopenharmony_ci #define PMX_SPP_PL_69_VAL (0x3 << 27) 2898c2ecf20Sopenharmony_ci #define PMX_UART5_PL_69_VAL (0x4 << 27) 2908c2ecf20Sopenharmony_ci 2918c2ecf20Sopenharmony_ci#define IP_SEL_PAD_70_79_REG 0x00C0 2928c2ecf20Sopenharmony_ci #define PMX_PL_70_MASK (0x7 << 0) 2938c2ecf20Sopenharmony_ci #define PMX_CLCD_PL_70_VAL (0) 2948c2ecf20Sopenharmony_ci #define PMX_FSMC_EMI_PL_70_VAL (0x2 << 0) 2958c2ecf20Sopenharmony_ci #define PMX_SPP_PL_70_VAL (0x3 << 0) 2968c2ecf20Sopenharmony_ci #define PMX_UART5_PL_70_VAL (0x4 << 0) 2978c2ecf20Sopenharmony_ci 2988c2ecf20Sopenharmony_ci #define PMX_PL_71_72_MASK (0x3F << 3) 2998c2ecf20Sopenharmony_ci #define PMX_CLCD_PL_71_72_VAL (0) 3008c2ecf20Sopenharmony_ci #define PMX_FSMC_EMI_PL_71_72_VAL ((0x2 << 3) | (0x2 << 6)) 3018c2ecf20Sopenharmony_ci #define PMX_SPP_PL_71_72_VAL ((0x3 << 3) | (0x3 << 6)) 3028c2ecf20Sopenharmony_ci #define PMX_UART4_PL_71_72_VAL ((0x4 << 3) | (0x4 << 6)) 3038c2ecf20Sopenharmony_ci 3048c2ecf20Sopenharmony_ci #define PMX_PL_73_MASK (0x7 << 9) 3058c2ecf20Sopenharmony_ci #define PMX_CLCD_PL_73_VAL (0) 3068c2ecf20Sopenharmony_ci #define PMX_FSMC_EMI_PL_73_VAL (0x2 << 9) 3078c2ecf20Sopenharmony_ci #define PMX_SPP_PL_73_VAL (0x3 << 9) 3088c2ecf20Sopenharmony_ci #define PMX_UART3_PL_73_VAL (0x4 << 9) 3098c2ecf20Sopenharmony_ci 3108c2ecf20Sopenharmony_ci #define PMX_PL_74_MASK (0x7 << 12) 3118c2ecf20Sopenharmony_ci #define PMX_CLCD_PL_74_VAL (0) 3128c2ecf20Sopenharmony_ci #define PMX_EMI_PL_74_VAL (0x2 << 12) 3138c2ecf20Sopenharmony_ci #define PMX_SPP_PL_74_VAL (0x3 << 12) 3148c2ecf20Sopenharmony_ci #define PMX_UART3_PL_74_VAL (0x4 << 12) 3158c2ecf20Sopenharmony_ci 3168c2ecf20Sopenharmony_ci #define PMX_PL_75_76_MASK (0x3F << 15) 3178c2ecf20Sopenharmony_ci #define PMX_CLCD_PL_75_76_VAL (0) 3188c2ecf20Sopenharmony_ci #define PMX_EMI_PL_75_76_VAL ((0x2 << 15) | (0x2 << 18)) 3198c2ecf20Sopenharmony_ci #define PMX_SPP_PL_75_76_VAL ((0x3 << 15) | (0x3 << 18)) 3208c2ecf20Sopenharmony_ci #define PMX_I2C2_PL_75_76_VAL ((0x4 << 15) | (0x4 << 18)) 3218c2ecf20Sopenharmony_ci 3228c2ecf20Sopenharmony_ci #define PMX_PL_77_78_79_MASK (0x1FF << 21) 3238c2ecf20Sopenharmony_ci #define PMX_CLCD_PL_77_78_79_VAL (0) 3248c2ecf20Sopenharmony_ci #define PMX_EMI_PL_77_78_79_VAL ((0x2 << 21) | (0x2 << 24) | (0x2 << 27)) 3258c2ecf20Sopenharmony_ci #define PMX_SPP_PL_77_78_79_VAL ((0x3 << 21) | (0x3 << 24) | (0x3 << 27)) 3268c2ecf20Sopenharmony_ci #define PMX_RS485_PL_77_78_79_VAL ((0x4 << 21) | (0x4 << 24) | (0x4 << 27)) 3278c2ecf20Sopenharmony_ci 3288c2ecf20Sopenharmony_ci#define IP_SEL_PAD_80_89_REG 0x00C4 3298c2ecf20Sopenharmony_ci #define PMX_PL_80_TO_85_MASK (0x3FFFF << 0) 3308c2ecf20Sopenharmony_ci #define PMX_CLCD_PL_80_TO_85_VAL 0 3318c2ecf20Sopenharmony_ci #define PMX_MII2_PL_80_TO_85_VAL ((0x1 << 0) | (0x1 << 3) | (0x1 << 6) | (0x1 << 9) | (0x1 << 12) | (0x1 << 15)) 3328c2ecf20Sopenharmony_ci #define PMX_EMI_PL_80_TO_85_VAL ((0x2 << 0) | (0x2 << 3) | (0x2 << 6) | (0x2 << 9) | (0x2 << 12) | (0x2 << 15)) 3338c2ecf20Sopenharmony_ci #define PMX_SPP_PL_80_TO_85_VAL ((0x3 << 0) | (0x3 << 3) | (0x3 << 6) | (0x3 << 9) | (0x3 << 12) | (0x3 << 15)) 3348c2ecf20Sopenharmony_ci #define PMX_UART1_ENH_PL_80_TO_85_VAL ((0x4 << 0) | (0x4 << 3) | (0x4 << 6) | (0x4 << 9) | (0x4 << 12) | (0x4 << 15)) 3358c2ecf20Sopenharmony_ci 3368c2ecf20Sopenharmony_ci #define PMX_PL_86_87_MASK (0x3F << 18) 3378c2ecf20Sopenharmony_ci #define PMX_PL_86_MASK (0x7 << 18) 3388c2ecf20Sopenharmony_ci #define PMX_PL_87_MASK (0x7 << 21) 3398c2ecf20Sopenharmony_ci #define PMX_CLCD_PL_86_87_VAL 0 3408c2ecf20Sopenharmony_ci #define PMX_MII2_PL_86_87_VAL ((0x1 << 18) | (0x1 << 21)) 3418c2ecf20Sopenharmony_ci #define PMX_EMI_PL_86_87_VAL ((0x2 << 18) | (0x2 << 21)) 3428c2ecf20Sopenharmony_ci #define PMX_PWM3_PL_86_VAL (0x4 << 18) 3438c2ecf20Sopenharmony_ci #define PMX_PWM2_PL_87_VAL (0x4 << 21) 3448c2ecf20Sopenharmony_ci 3458c2ecf20Sopenharmony_ci #define PMX_PL_88_89_MASK (0x3F << 24) 3468c2ecf20Sopenharmony_ci #define PMX_CLCD_PL_88_89_VAL 0 3478c2ecf20Sopenharmony_ci #define PMX_MII2_PL_88_89_VAL ((0x1 << 24) | (0x1 << 27)) 3488c2ecf20Sopenharmony_ci #define PMX_EMI_PL_88_89_VAL ((0x2 << 24) | (0x2 << 27)) 3498c2ecf20Sopenharmony_ci #define PMX_UART6_PL_88_89_VAL ((0x3 << 24) | (0x3 << 27)) 3508c2ecf20Sopenharmony_ci #define PMX_PWM0_1_PL_88_89_VAL ((0x4 << 24) | (0x4 << 27)) 3518c2ecf20Sopenharmony_ci 3528c2ecf20Sopenharmony_ci#define IP_SEL_PAD_90_99_REG 0x00C8 3538c2ecf20Sopenharmony_ci #define PMX_PL_90_91_MASK (0x3F << 0) 3548c2ecf20Sopenharmony_ci #define PMX_CLCD_PL_90_91_VAL 0 3558c2ecf20Sopenharmony_ci #define PMX_MII2_PL_90_91_VAL ((0x1 << 0) | (0x1 << 3)) 3568c2ecf20Sopenharmony_ci #define PMX_EMI1_PL_90_91_VAL ((0x2 << 0) | (0x2 << 3)) 3578c2ecf20Sopenharmony_ci #define PMX_UART5_PL_90_91_VAL ((0x3 << 0) | (0x3 << 3)) 3588c2ecf20Sopenharmony_ci #define PMX_SSP2_PL_90_91_VAL ((0x4 << 0) | (0x4 << 3)) 3598c2ecf20Sopenharmony_ci 3608c2ecf20Sopenharmony_ci #define PMX_PL_92_93_MASK (0x3F << 6) 3618c2ecf20Sopenharmony_ci #define PMX_CLCD_PL_92_93_VAL 0 3628c2ecf20Sopenharmony_ci #define PMX_MII2_PL_92_93_VAL ((0x1 << 6) | (0x1 << 9)) 3638c2ecf20Sopenharmony_ci #define PMX_EMI1_PL_92_93_VAL ((0x2 << 6) | (0x2 << 9)) 3648c2ecf20Sopenharmony_ci #define PMX_UART4_PL_92_93_VAL ((0x3 << 6) | (0x3 << 9)) 3658c2ecf20Sopenharmony_ci #define PMX_SSP2_PL_92_93_VAL ((0x4 << 6) | (0x4 << 9)) 3668c2ecf20Sopenharmony_ci 3678c2ecf20Sopenharmony_ci #define PMX_PL_94_95_MASK (0x3F << 12) 3688c2ecf20Sopenharmony_ci #define PMX_CLCD_PL_94_95_VAL 0 3698c2ecf20Sopenharmony_ci #define PMX_MII2_PL_94_95_VAL ((0x1 << 12) | (0x1 << 15)) 3708c2ecf20Sopenharmony_ci #define PMX_EMI1_PL_94_95_VAL ((0x2 << 12) | (0x2 << 15)) 3718c2ecf20Sopenharmony_ci #define PMX_UART3_PL_94_95_VAL ((0x3 << 12) | (0x3 << 15)) 3728c2ecf20Sopenharmony_ci #define PMX_SSP1_PL_94_95_VAL ((0x4 << 12) | (0x4 << 15)) 3738c2ecf20Sopenharmony_ci 3748c2ecf20Sopenharmony_ci #define PMX_PL_96_97_MASK (0x3F << 18) 3758c2ecf20Sopenharmony_ci #define PMX_CLCD_PL_96_97_VAL 0 3768c2ecf20Sopenharmony_ci #define PMX_MII2_PL_96_97_VAL ((0x1 << 18) | (0x1 << 21)) 3778c2ecf20Sopenharmony_ci #define PMX_EMI1_PL_96_97_VAL ((0x2 << 18) | (0x2 << 21)) 3788c2ecf20Sopenharmony_ci #define PMX_I2C2_PL_96_97_VAL ((0x3 << 18) | (0x3 << 21)) 3798c2ecf20Sopenharmony_ci #define PMX_SSP1_PL_96_97_VAL ((0x4 << 18) | (0x4 << 21)) 3808c2ecf20Sopenharmony_ci 3818c2ecf20Sopenharmony_ci #define PMX_PL_98_MASK (0x7 << 24) 3828c2ecf20Sopenharmony_ci #define PMX_CLCD_PL_98_VAL 0 3838c2ecf20Sopenharmony_ci #define PMX_I2C1_PL_98_VAL (0x2 << 24) 3848c2ecf20Sopenharmony_ci #define PMX_UART3_PL_98_VAL (0x4 << 24) 3858c2ecf20Sopenharmony_ci 3868c2ecf20Sopenharmony_ci #define PMX_PL_99_MASK (0x7 << 27) 3878c2ecf20Sopenharmony_ci #define PMX_SDHCI_PL_99_VAL 0 3888c2ecf20Sopenharmony_ci #define PMX_I2C1_PL_99_VAL (0x2 << 27) 3898c2ecf20Sopenharmony_ci #define PMX_UART3_PL_99_VAL (0x4 << 27) 3908c2ecf20Sopenharmony_ci 3918c2ecf20Sopenharmony_ci#define IP_SEL_MIX_PAD_REG 0x00CC 3928c2ecf20Sopenharmony_ci #define PMX_PL_100_101_MASK (0x3F << 0) 3938c2ecf20Sopenharmony_ci #define PMX_SDHCI_PL_100_101_VAL 0 3948c2ecf20Sopenharmony_ci #define PMX_UART4_PL_100_101_VAL ((0x4 << 0) | (0x4 << 3)) 3958c2ecf20Sopenharmony_ci 3968c2ecf20Sopenharmony_ci #define PMX_SSP1_PORT_SEL_MASK (0x7 << 8) 3978c2ecf20Sopenharmony_ci #define PMX_SSP1_PORT_94_TO_97_VAL 0 3988c2ecf20Sopenharmony_ci #define PMX_SSP1_PORT_65_TO_68_VAL (0x1 << 8) 3998c2ecf20Sopenharmony_ci #define PMX_SSP1_PORT_48_TO_51_VAL (0x2 << 8) 4008c2ecf20Sopenharmony_ci #define PMX_SSP1_PORT_36_TO_39_VAL (0x3 << 8) 4018c2ecf20Sopenharmony_ci #define PMX_SSP1_PORT_17_TO_20_VAL (0x4 << 8) 4028c2ecf20Sopenharmony_ci 4038c2ecf20Sopenharmony_ci #define PMX_SSP2_PORT_SEL_MASK (0x7 << 11) 4048c2ecf20Sopenharmony_ci #define PMX_SSP2_PORT_90_TO_93_VAL 0 4058c2ecf20Sopenharmony_ci #define PMX_SSP2_PORT_61_TO_64_VAL (0x1 << 11) 4068c2ecf20Sopenharmony_ci #define PMX_SSP2_PORT_44_TO_47_VAL (0x2 << 11) 4078c2ecf20Sopenharmony_ci #define PMX_SSP2_PORT_32_TO_35_VAL (0x3 << 11) 4088c2ecf20Sopenharmony_ci #define PMX_SSP2_PORT_13_TO_16_VAL (0x4 << 11) 4098c2ecf20Sopenharmony_ci 4108c2ecf20Sopenharmony_ci #define PMX_UART1_ENH_PORT_SEL_MASK (0x3 << 14) 4118c2ecf20Sopenharmony_ci #define PMX_UART1_ENH_PORT_81_TO_85_VAL 0 4128c2ecf20Sopenharmony_ci #define PMX_UART1_ENH_PORT_44_45_34_36_VAL (0x1 << 14) 4138c2ecf20Sopenharmony_ci #define PMX_UART1_ENH_PORT_32_TO_34_36_VAL (0x2 << 14) 4148c2ecf20Sopenharmony_ci #define PMX_UART1_ENH_PORT_3_TO_5_7_VAL (0x3 << 14) 4158c2ecf20Sopenharmony_ci 4168c2ecf20Sopenharmony_ci #define PMX_UART3_PORT_SEL_MASK (0x7 << 16) 4178c2ecf20Sopenharmony_ci #define PMX_UART3_PORT_94_VAL 0 4188c2ecf20Sopenharmony_ci #define PMX_UART3_PORT_73_VAL (0x1 << 16) 4198c2ecf20Sopenharmony_ci #define PMX_UART3_PORT_52_VAL (0x2 << 16) 4208c2ecf20Sopenharmony_ci #define PMX_UART3_PORT_41_VAL (0x3 << 16) 4218c2ecf20Sopenharmony_ci #define PMX_UART3_PORT_15_VAL (0x4 << 16) 4228c2ecf20Sopenharmony_ci #define PMX_UART3_PORT_8_VAL (0x5 << 16) 4238c2ecf20Sopenharmony_ci #define PMX_UART3_PORT_99_VAL (0x6 << 16) 4248c2ecf20Sopenharmony_ci 4258c2ecf20Sopenharmony_ci #define PMX_UART4_PORT_SEL_MASK (0x7 << 19) 4268c2ecf20Sopenharmony_ci #define PMX_UART4_PORT_92_VAL 0 4278c2ecf20Sopenharmony_ci #define PMX_UART4_PORT_71_VAL (0x1 << 19) 4288c2ecf20Sopenharmony_ci #define PMX_UART4_PORT_39_VAL (0x2 << 19) 4298c2ecf20Sopenharmony_ci #define PMX_UART4_PORT_13_VAL (0x3 << 19) 4308c2ecf20Sopenharmony_ci #define PMX_UART4_PORT_6_VAL (0x4 << 19) 4318c2ecf20Sopenharmony_ci #define PMX_UART4_PORT_101_VAL (0x5 << 19) 4328c2ecf20Sopenharmony_ci 4338c2ecf20Sopenharmony_ci #define PMX_UART5_PORT_SEL_MASK (0x3 << 22) 4348c2ecf20Sopenharmony_ci #define PMX_UART5_PORT_90_VAL 0 4358c2ecf20Sopenharmony_ci #define PMX_UART5_PORT_69_VAL (0x1 << 22) 4368c2ecf20Sopenharmony_ci #define PMX_UART5_PORT_37_VAL (0x2 << 22) 4378c2ecf20Sopenharmony_ci #define PMX_UART5_PORT_4_VAL (0x3 << 22) 4388c2ecf20Sopenharmony_ci 4398c2ecf20Sopenharmony_ci #define PMX_UART6_PORT_SEL_MASK (0x1 << 24) 4408c2ecf20Sopenharmony_ci #define PMX_UART6_PORT_88_VAL 0 4418c2ecf20Sopenharmony_ci #define PMX_UART6_PORT_2_VAL (0x1 << 24) 4428c2ecf20Sopenharmony_ci 4438c2ecf20Sopenharmony_ci #define PMX_I2C1_PORT_SEL_MASK (0x1 << 25) 4448c2ecf20Sopenharmony_ci #define PMX_I2C1_PORT_8_9_VAL 0 4458c2ecf20Sopenharmony_ci #define PMX_I2C1_PORT_98_99_VAL (0x1 << 25) 4468c2ecf20Sopenharmony_ci 4478c2ecf20Sopenharmony_ci #define PMX_I2C2_PORT_SEL_MASK (0x3 << 26) 4488c2ecf20Sopenharmony_ci #define PMX_I2C2_PORT_96_97_VAL 0 4498c2ecf20Sopenharmony_ci #define PMX_I2C2_PORT_75_76_VAL (0x1 << 26) 4508c2ecf20Sopenharmony_ci #define PMX_I2C2_PORT_19_20_VAL (0x2 << 26) 4518c2ecf20Sopenharmony_ci #define PMX_I2C2_PORT_2_3_VAL (0x3 << 26) 4528c2ecf20Sopenharmony_ci #define PMX_I2C2_PORT_0_1_VAL (0x4 << 26) 4538c2ecf20Sopenharmony_ci 4548c2ecf20Sopenharmony_ci #define PMX_SDHCI_CD_PORT_SEL_MASK (0x1 << 29) 4558c2ecf20Sopenharmony_ci #define PMX_SDHCI_CD_PORT_12_VAL 0 4568c2ecf20Sopenharmony_ci #define PMX_SDHCI_CD_PORT_51_VAL (0x1 << 29) 4578c2ecf20Sopenharmony_ci 4588c2ecf20Sopenharmony_ci/* Pad multiplexing for CLCD device */ 4598c2ecf20Sopenharmony_cistatic const unsigned clcd_pins[] = { 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 4608c2ecf20Sopenharmony_ci 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 4618c2ecf20Sopenharmony_ci 97 }; 4628c2ecf20Sopenharmony_cistatic struct spear_muxreg clcd_muxreg[] = { 4638c2ecf20Sopenharmony_ci { 4648c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_60_69_REG, 4658c2ecf20Sopenharmony_ci .mask = PMX_PL_69_MASK, 4668c2ecf20Sopenharmony_ci .val = PMX_CLCD_PL_69_VAL, 4678c2ecf20Sopenharmony_ci }, { 4688c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_70_79_REG, 4698c2ecf20Sopenharmony_ci .mask = PMX_PL_70_MASK | PMX_PL_71_72_MASK | PMX_PL_73_MASK | 4708c2ecf20Sopenharmony_ci PMX_PL_74_MASK | PMX_PL_75_76_MASK | 4718c2ecf20Sopenharmony_ci PMX_PL_77_78_79_MASK, 4728c2ecf20Sopenharmony_ci .val = PMX_CLCD_PL_70_VAL | PMX_CLCD_PL_71_72_VAL | 4738c2ecf20Sopenharmony_ci PMX_CLCD_PL_73_VAL | PMX_CLCD_PL_74_VAL | 4748c2ecf20Sopenharmony_ci PMX_CLCD_PL_75_76_VAL | PMX_CLCD_PL_77_78_79_VAL, 4758c2ecf20Sopenharmony_ci }, { 4768c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_80_89_REG, 4778c2ecf20Sopenharmony_ci .mask = PMX_PL_80_TO_85_MASK | PMX_PL_86_87_MASK | 4788c2ecf20Sopenharmony_ci PMX_PL_88_89_MASK, 4798c2ecf20Sopenharmony_ci .val = PMX_CLCD_PL_80_TO_85_VAL | PMX_CLCD_PL_86_87_VAL | 4808c2ecf20Sopenharmony_ci PMX_CLCD_PL_88_89_VAL, 4818c2ecf20Sopenharmony_ci }, { 4828c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_90_99_REG, 4838c2ecf20Sopenharmony_ci .mask = PMX_PL_90_91_MASK | PMX_PL_92_93_MASK | 4848c2ecf20Sopenharmony_ci PMX_PL_94_95_MASK | PMX_PL_96_97_MASK | PMX_PL_98_MASK, 4858c2ecf20Sopenharmony_ci .val = PMX_CLCD_PL_90_91_VAL | PMX_CLCD_PL_92_93_VAL | 4868c2ecf20Sopenharmony_ci PMX_CLCD_PL_94_95_VAL | PMX_CLCD_PL_96_97_VAL | 4878c2ecf20Sopenharmony_ci PMX_CLCD_PL_98_VAL, 4888c2ecf20Sopenharmony_ci }, 4898c2ecf20Sopenharmony_ci}; 4908c2ecf20Sopenharmony_ci 4918c2ecf20Sopenharmony_cistatic struct spear_modemux clcd_modemux[] = { 4928c2ecf20Sopenharmony_ci { 4938c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 4948c2ecf20Sopenharmony_ci .muxregs = clcd_muxreg, 4958c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(clcd_muxreg), 4968c2ecf20Sopenharmony_ci }, 4978c2ecf20Sopenharmony_ci}; 4988c2ecf20Sopenharmony_ci 4998c2ecf20Sopenharmony_cistatic struct spear_pingroup clcd_pingroup = { 5008c2ecf20Sopenharmony_ci .name = "clcd_grp", 5018c2ecf20Sopenharmony_ci .pins = clcd_pins, 5028c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(clcd_pins), 5038c2ecf20Sopenharmony_ci .modemuxs = clcd_modemux, 5048c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(clcd_modemux), 5058c2ecf20Sopenharmony_ci}; 5068c2ecf20Sopenharmony_ci 5078c2ecf20Sopenharmony_cistatic const char *const clcd_grps[] = { "clcd_grp" }; 5088c2ecf20Sopenharmony_cistatic struct spear_function clcd_function = { 5098c2ecf20Sopenharmony_ci .name = "clcd", 5108c2ecf20Sopenharmony_ci .groups = clcd_grps, 5118c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(clcd_grps), 5128c2ecf20Sopenharmony_ci}; 5138c2ecf20Sopenharmony_ci 5148c2ecf20Sopenharmony_ci/* Pad multiplexing for EMI (Parallel NOR flash) device */ 5158c2ecf20Sopenharmony_cistatic const unsigned emi_pins[] = { 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 5168c2ecf20Sopenharmony_ci 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 5178c2ecf20Sopenharmony_ci 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 5188c2ecf20Sopenharmony_ci 93, 94, 95, 96, 97 }; 5198c2ecf20Sopenharmony_cistatic struct spear_muxreg emi_muxreg[] = { 5208c2ecf20Sopenharmony_ci { 5218c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 5228c2ecf20Sopenharmony_ci .mask = PMX_TIMER_0_1_MASK | PMX_TIMER_2_3_MASK, 5238c2ecf20Sopenharmony_ci .val = 0, 5248c2ecf20Sopenharmony_ci }, 5258c2ecf20Sopenharmony_ci}; 5268c2ecf20Sopenharmony_ci 5278c2ecf20Sopenharmony_cistatic struct spear_muxreg emi_ext_muxreg[] = { 5288c2ecf20Sopenharmony_ci { 5298c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_40_49_REG, 5308c2ecf20Sopenharmony_ci .mask = PMX_PL_46_47_MASK | PMX_PL_48_49_MASK, 5318c2ecf20Sopenharmony_ci .val = PMX_FSMC_EMI_PL_46_47_VAL | PMX_FSMC_EMI_PL_48_49_VAL, 5328c2ecf20Sopenharmony_ci }, { 5338c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_50_59_REG, 5348c2ecf20Sopenharmony_ci .mask = PMX_PL_50_51_MASK | PMX_PL_52_53_MASK | 5358c2ecf20Sopenharmony_ci PMX_PL_54_55_56_MASK | PMX_PL_58_59_MASK, 5368c2ecf20Sopenharmony_ci .val = PMX_EMI_PL_50_51_VAL | PMX_EMI_PL_52_53_VAL | 5378c2ecf20Sopenharmony_ci PMX_FSMC_EMI_PL_54_55_56_VAL | 5388c2ecf20Sopenharmony_ci PMX_FSMC_EMI_PL_58_59_VAL, 5398c2ecf20Sopenharmony_ci }, { 5408c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_60_69_REG, 5418c2ecf20Sopenharmony_ci .mask = PMX_PL_69_MASK, 5428c2ecf20Sopenharmony_ci .val = PMX_EMI_PL_69_VAL, 5438c2ecf20Sopenharmony_ci }, { 5448c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_70_79_REG, 5458c2ecf20Sopenharmony_ci .mask = PMX_PL_70_MASK | PMX_PL_71_72_MASK | PMX_PL_73_MASK | 5468c2ecf20Sopenharmony_ci PMX_PL_74_MASK | PMX_PL_75_76_MASK | 5478c2ecf20Sopenharmony_ci PMX_PL_77_78_79_MASK, 5488c2ecf20Sopenharmony_ci .val = PMX_FSMC_EMI_PL_70_VAL | PMX_FSMC_EMI_PL_71_72_VAL | 5498c2ecf20Sopenharmony_ci PMX_FSMC_EMI_PL_73_VAL | PMX_EMI_PL_74_VAL | 5508c2ecf20Sopenharmony_ci PMX_EMI_PL_75_76_VAL | PMX_EMI_PL_77_78_79_VAL, 5518c2ecf20Sopenharmony_ci }, { 5528c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_80_89_REG, 5538c2ecf20Sopenharmony_ci .mask = PMX_PL_80_TO_85_MASK | PMX_PL_86_87_MASK | 5548c2ecf20Sopenharmony_ci PMX_PL_88_89_MASK, 5558c2ecf20Sopenharmony_ci .val = PMX_EMI_PL_80_TO_85_VAL | PMX_EMI_PL_86_87_VAL | 5568c2ecf20Sopenharmony_ci PMX_EMI_PL_88_89_VAL, 5578c2ecf20Sopenharmony_ci }, { 5588c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_90_99_REG, 5598c2ecf20Sopenharmony_ci .mask = PMX_PL_90_91_MASK | PMX_PL_92_93_MASK | 5608c2ecf20Sopenharmony_ci PMX_PL_94_95_MASK | PMX_PL_96_97_MASK, 5618c2ecf20Sopenharmony_ci .val = PMX_EMI1_PL_90_91_VAL | PMX_EMI1_PL_92_93_VAL | 5628c2ecf20Sopenharmony_ci PMX_EMI1_PL_94_95_VAL | PMX_EMI1_PL_96_97_VAL, 5638c2ecf20Sopenharmony_ci }, { 5648c2ecf20Sopenharmony_ci .reg = EXT_CTRL_REG, 5658c2ecf20Sopenharmony_ci .mask = EMI_FSMC_DYNAMIC_MUX_MASK, 5668c2ecf20Sopenharmony_ci .val = EMI_FSMC_DYNAMIC_MUX_MASK, 5678c2ecf20Sopenharmony_ci }, 5688c2ecf20Sopenharmony_ci}; 5698c2ecf20Sopenharmony_ci 5708c2ecf20Sopenharmony_cistatic struct spear_modemux emi_modemux[] = { 5718c2ecf20Sopenharmony_ci { 5728c2ecf20Sopenharmony_ci .modes = AUTO_EXP_MODE | EXTENDED_MODE, 5738c2ecf20Sopenharmony_ci .muxregs = emi_muxreg, 5748c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(emi_muxreg), 5758c2ecf20Sopenharmony_ci }, { 5768c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 5778c2ecf20Sopenharmony_ci .muxregs = emi_ext_muxreg, 5788c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(emi_ext_muxreg), 5798c2ecf20Sopenharmony_ci }, 5808c2ecf20Sopenharmony_ci}; 5818c2ecf20Sopenharmony_ci 5828c2ecf20Sopenharmony_cistatic struct spear_pingroup emi_pingroup = { 5838c2ecf20Sopenharmony_ci .name = "emi_grp", 5848c2ecf20Sopenharmony_ci .pins = emi_pins, 5858c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(emi_pins), 5868c2ecf20Sopenharmony_ci .modemuxs = emi_modemux, 5878c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(emi_modemux), 5888c2ecf20Sopenharmony_ci}; 5898c2ecf20Sopenharmony_ci 5908c2ecf20Sopenharmony_cistatic const char *const emi_grps[] = { "emi_grp" }; 5918c2ecf20Sopenharmony_cistatic struct spear_function emi_function = { 5928c2ecf20Sopenharmony_ci .name = "emi", 5938c2ecf20Sopenharmony_ci .groups = emi_grps, 5948c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(emi_grps), 5958c2ecf20Sopenharmony_ci}; 5968c2ecf20Sopenharmony_ci 5978c2ecf20Sopenharmony_ci/* Pad multiplexing for FSMC (NAND flash) device */ 5988c2ecf20Sopenharmony_cistatic const unsigned fsmc_8bit_pins[] = { 52, 53, 54, 55, 56, 57, 58, 59, 60, 5998c2ecf20Sopenharmony_ci 61, 62, 63, 64, 65, 66, 67, 68 }; 6008c2ecf20Sopenharmony_cistatic struct spear_muxreg fsmc_8bit_muxreg[] = { 6018c2ecf20Sopenharmony_ci { 6028c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_50_59_REG, 6038c2ecf20Sopenharmony_ci .mask = PMX_PL_52_53_MASK | PMX_PL_54_55_56_MASK | 6048c2ecf20Sopenharmony_ci PMX_PL_57_MASK | PMX_PL_58_59_MASK, 6058c2ecf20Sopenharmony_ci .val = PMX_FSMC_PL_52_53_VAL | PMX_FSMC_EMI_PL_54_55_56_VAL | 6068c2ecf20Sopenharmony_ci PMX_FSMC_PL_57_VAL | PMX_FSMC_EMI_PL_58_59_VAL, 6078c2ecf20Sopenharmony_ci }, { 6088c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_60_69_REG, 6098c2ecf20Sopenharmony_ci .mask = PMX_PL_60_MASK | PMX_PL_61_TO_64_MASK | 6108c2ecf20Sopenharmony_ci PMX_PL_65_TO_68_MASK, 6118c2ecf20Sopenharmony_ci .val = PMX_FSMC_PL_60_VAL | PMX_FSMC_PL_61_TO_64_VAL | 6128c2ecf20Sopenharmony_ci PMX_FSMC_PL_65_TO_68_VAL, 6138c2ecf20Sopenharmony_ci }, { 6148c2ecf20Sopenharmony_ci .reg = EXT_CTRL_REG, 6158c2ecf20Sopenharmony_ci .mask = EMI_FSMC_DYNAMIC_MUX_MASK, 6168c2ecf20Sopenharmony_ci .val = EMI_FSMC_DYNAMIC_MUX_MASK, 6178c2ecf20Sopenharmony_ci }, 6188c2ecf20Sopenharmony_ci}; 6198c2ecf20Sopenharmony_ci 6208c2ecf20Sopenharmony_cistatic struct spear_modemux fsmc_8bit_modemux[] = { 6218c2ecf20Sopenharmony_ci { 6228c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 6238c2ecf20Sopenharmony_ci .muxregs = fsmc_8bit_muxreg, 6248c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(fsmc_8bit_muxreg), 6258c2ecf20Sopenharmony_ci }, 6268c2ecf20Sopenharmony_ci}; 6278c2ecf20Sopenharmony_ci 6288c2ecf20Sopenharmony_cistatic struct spear_pingroup fsmc_8bit_pingroup = { 6298c2ecf20Sopenharmony_ci .name = "fsmc_8bit_grp", 6308c2ecf20Sopenharmony_ci .pins = fsmc_8bit_pins, 6318c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(fsmc_8bit_pins), 6328c2ecf20Sopenharmony_ci .modemuxs = fsmc_8bit_modemux, 6338c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(fsmc_8bit_modemux), 6348c2ecf20Sopenharmony_ci}; 6358c2ecf20Sopenharmony_ci 6368c2ecf20Sopenharmony_cistatic const unsigned fsmc_16bit_pins[] = { 46, 47, 48, 49, 52, 53, 54, 55, 56, 6378c2ecf20Sopenharmony_ci 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 70, 71, 72, 73 }; 6388c2ecf20Sopenharmony_cistatic struct spear_muxreg fsmc_16bit_autoexp_muxreg[] = { 6398c2ecf20Sopenharmony_ci { 6408c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 6418c2ecf20Sopenharmony_ci .mask = PMX_TIMER_0_1_MASK | PMX_TIMER_2_3_MASK, 6428c2ecf20Sopenharmony_ci .val = 0, 6438c2ecf20Sopenharmony_ci }, 6448c2ecf20Sopenharmony_ci}; 6458c2ecf20Sopenharmony_ci 6468c2ecf20Sopenharmony_cistatic struct spear_muxreg fsmc_16bit_muxreg[] = { 6478c2ecf20Sopenharmony_ci { 6488c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_40_49_REG, 6498c2ecf20Sopenharmony_ci .mask = PMX_PL_46_47_MASK | PMX_PL_48_49_MASK, 6508c2ecf20Sopenharmony_ci .val = PMX_FSMC_EMI_PL_46_47_VAL | PMX_FSMC_EMI_PL_48_49_VAL, 6518c2ecf20Sopenharmony_ci }, { 6528c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_70_79_REG, 6538c2ecf20Sopenharmony_ci .mask = PMX_PL_70_MASK | PMX_PL_71_72_MASK | PMX_PL_73_MASK, 6548c2ecf20Sopenharmony_ci .val = PMX_FSMC_EMI_PL_70_VAL | PMX_FSMC_EMI_PL_71_72_VAL | 6558c2ecf20Sopenharmony_ci PMX_FSMC_EMI_PL_73_VAL, 6568c2ecf20Sopenharmony_ci } 6578c2ecf20Sopenharmony_ci}; 6588c2ecf20Sopenharmony_ci 6598c2ecf20Sopenharmony_cistatic struct spear_modemux fsmc_16bit_modemux[] = { 6608c2ecf20Sopenharmony_ci { 6618c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 6628c2ecf20Sopenharmony_ci .muxregs = fsmc_8bit_muxreg, 6638c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(fsmc_8bit_muxreg), 6648c2ecf20Sopenharmony_ci }, { 6658c2ecf20Sopenharmony_ci .modes = AUTO_EXP_MODE | EXTENDED_MODE, 6668c2ecf20Sopenharmony_ci .muxregs = fsmc_16bit_autoexp_muxreg, 6678c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(fsmc_16bit_autoexp_muxreg), 6688c2ecf20Sopenharmony_ci }, { 6698c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 6708c2ecf20Sopenharmony_ci .muxregs = fsmc_16bit_muxreg, 6718c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(fsmc_16bit_muxreg), 6728c2ecf20Sopenharmony_ci }, 6738c2ecf20Sopenharmony_ci}; 6748c2ecf20Sopenharmony_ci 6758c2ecf20Sopenharmony_cistatic struct spear_pingroup fsmc_16bit_pingroup = { 6768c2ecf20Sopenharmony_ci .name = "fsmc_16bit_grp", 6778c2ecf20Sopenharmony_ci .pins = fsmc_16bit_pins, 6788c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(fsmc_16bit_pins), 6798c2ecf20Sopenharmony_ci .modemuxs = fsmc_16bit_modemux, 6808c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(fsmc_16bit_modemux), 6818c2ecf20Sopenharmony_ci}; 6828c2ecf20Sopenharmony_ci 6838c2ecf20Sopenharmony_cistatic const char *const fsmc_grps[] = { "fsmc_8bit_grp", "fsmc_16bit_grp" }; 6848c2ecf20Sopenharmony_cistatic struct spear_function fsmc_function = { 6858c2ecf20Sopenharmony_ci .name = "fsmc", 6868c2ecf20Sopenharmony_ci .groups = fsmc_grps, 6878c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(fsmc_grps), 6888c2ecf20Sopenharmony_ci}; 6898c2ecf20Sopenharmony_ci 6908c2ecf20Sopenharmony_ci/* Pad multiplexing for SPP device */ 6918c2ecf20Sopenharmony_cistatic const unsigned spp_pins[] = { 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 6928c2ecf20Sopenharmony_ci 80, 81, 82, 83, 84, 85 }; 6938c2ecf20Sopenharmony_cistatic struct spear_muxreg spp_muxreg[] = { 6948c2ecf20Sopenharmony_ci { 6958c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_60_69_REG, 6968c2ecf20Sopenharmony_ci .mask = PMX_PL_69_MASK, 6978c2ecf20Sopenharmony_ci .val = PMX_SPP_PL_69_VAL, 6988c2ecf20Sopenharmony_ci }, { 6998c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_70_79_REG, 7008c2ecf20Sopenharmony_ci .mask = PMX_PL_70_MASK | PMX_PL_71_72_MASK | PMX_PL_73_MASK | 7018c2ecf20Sopenharmony_ci PMX_PL_74_MASK | PMX_PL_75_76_MASK | 7028c2ecf20Sopenharmony_ci PMX_PL_77_78_79_MASK, 7038c2ecf20Sopenharmony_ci .val = PMX_SPP_PL_70_VAL | PMX_SPP_PL_71_72_VAL | 7048c2ecf20Sopenharmony_ci PMX_SPP_PL_73_VAL | PMX_SPP_PL_74_VAL | 7058c2ecf20Sopenharmony_ci PMX_SPP_PL_75_76_VAL | PMX_SPP_PL_77_78_79_VAL, 7068c2ecf20Sopenharmony_ci }, { 7078c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_80_89_REG, 7088c2ecf20Sopenharmony_ci .mask = PMX_PL_80_TO_85_MASK, 7098c2ecf20Sopenharmony_ci .val = PMX_SPP_PL_80_TO_85_VAL, 7108c2ecf20Sopenharmony_ci }, 7118c2ecf20Sopenharmony_ci}; 7128c2ecf20Sopenharmony_ci 7138c2ecf20Sopenharmony_cistatic struct spear_modemux spp_modemux[] = { 7148c2ecf20Sopenharmony_ci { 7158c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 7168c2ecf20Sopenharmony_ci .muxregs = spp_muxreg, 7178c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(spp_muxreg), 7188c2ecf20Sopenharmony_ci }, 7198c2ecf20Sopenharmony_ci}; 7208c2ecf20Sopenharmony_ci 7218c2ecf20Sopenharmony_cistatic struct spear_pingroup spp_pingroup = { 7228c2ecf20Sopenharmony_ci .name = "spp_grp", 7238c2ecf20Sopenharmony_ci .pins = spp_pins, 7248c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(spp_pins), 7258c2ecf20Sopenharmony_ci .modemuxs = spp_modemux, 7268c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(spp_modemux), 7278c2ecf20Sopenharmony_ci}; 7288c2ecf20Sopenharmony_ci 7298c2ecf20Sopenharmony_cistatic const char *const spp_grps[] = { "spp_grp" }; 7308c2ecf20Sopenharmony_cistatic struct spear_function spp_function = { 7318c2ecf20Sopenharmony_ci .name = "spp", 7328c2ecf20Sopenharmony_ci .groups = spp_grps, 7338c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(spp_grps), 7348c2ecf20Sopenharmony_ci}; 7358c2ecf20Sopenharmony_ci 7368c2ecf20Sopenharmony_ci/* Pad multiplexing for SDHCI device */ 7378c2ecf20Sopenharmony_cistatic const unsigned sdhci_led_pins[] = { 34 }; 7388c2ecf20Sopenharmony_cistatic struct spear_muxreg sdhci_led_muxreg[] = { 7398c2ecf20Sopenharmony_ci { 7408c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 7418c2ecf20Sopenharmony_ci .mask = PMX_SSP_CS_MASK, 7428c2ecf20Sopenharmony_ci .val = 0, 7438c2ecf20Sopenharmony_ci }, 7448c2ecf20Sopenharmony_ci}; 7458c2ecf20Sopenharmony_ci 7468c2ecf20Sopenharmony_cistatic struct spear_muxreg sdhci_led_ext_muxreg[] = { 7478c2ecf20Sopenharmony_ci { 7488c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_30_39_REG, 7498c2ecf20Sopenharmony_ci .mask = PMX_PL_34_MASK, 7508c2ecf20Sopenharmony_ci .val = PMX_PWM2_PL_34_VAL, 7518c2ecf20Sopenharmony_ci }, 7528c2ecf20Sopenharmony_ci}; 7538c2ecf20Sopenharmony_ci 7548c2ecf20Sopenharmony_cistatic struct spear_modemux sdhci_led_modemux[] = { 7558c2ecf20Sopenharmony_ci { 7568c2ecf20Sopenharmony_ci .modes = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE | EXTENDED_MODE, 7578c2ecf20Sopenharmony_ci .muxregs = sdhci_led_muxreg, 7588c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(sdhci_led_muxreg), 7598c2ecf20Sopenharmony_ci }, { 7608c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 7618c2ecf20Sopenharmony_ci .muxregs = sdhci_led_ext_muxreg, 7628c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(sdhci_led_ext_muxreg), 7638c2ecf20Sopenharmony_ci }, 7648c2ecf20Sopenharmony_ci}; 7658c2ecf20Sopenharmony_ci 7668c2ecf20Sopenharmony_cistatic struct spear_pingroup sdhci_led_pingroup = { 7678c2ecf20Sopenharmony_ci .name = "sdhci_led_grp", 7688c2ecf20Sopenharmony_ci .pins = sdhci_led_pins, 7698c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(sdhci_led_pins), 7708c2ecf20Sopenharmony_ci .modemuxs = sdhci_led_modemux, 7718c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(sdhci_led_modemux), 7728c2ecf20Sopenharmony_ci}; 7738c2ecf20Sopenharmony_ci 7748c2ecf20Sopenharmony_cistatic const unsigned sdhci_cd_12_pins[] = { 12, 43, 44, 45, 46, 47, 48, 49, 7758c2ecf20Sopenharmony_ci 50}; 7768c2ecf20Sopenharmony_cistatic const unsigned sdhci_cd_51_pins[] = { 43, 44, 45, 46, 47, 48, 49, 50, 51 7778c2ecf20Sopenharmony_ci}; 7788c2ecf20Sopenharmony_cistatic struct spear_muxreg sdhci_muxreg[] = { 7798c2ecf20Sopenharmony_ci { 7808c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 7818c2ecf20Sopenharmony_ci .mask = PMX_TIMER_0_1_MASK | PMX_TIMER_2_3_MASK, 7828c2ecf20Sopenharmony_ci .val = 0, 7838c2ecf20Sopenharmony_ci }, 7848c2ecf20Sopenharmony_ci}; 7858c2ecf20Sopenharmony_ci 7868c2ecf20Sopenharmony_cistatic struct spear_muxreg sdhci_ext_muxreg[] = { 7878c2ecf20Sopenharmony_ci { 7888c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_40_49_REG, 7898c2ecf20Sopenharmony_ci .mask = PMX_PL_43_MASK | PMX_PL_44_45_MASK | PMX_PL_46_47_MASK | 7908c2ecf20Sopenharmony_ci PMX_PL_48_49_MASK, 7918c2ecf20Sopenharmony_ci .val = PMX_SDHCI_PL_43_VAL | PMX_SDHCI_PL_44_45_VAL | 7928c2ecf20Sopenharmony_ci PMX_SDHCI_PL_46_47_VAL | PMX_SDHCI_PL_48_49_VAL, 7938c2ecf20Sopenharmony_ci }, { 7948c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_50_59_REG, 7958c2ecf20Sopenharmony_ci .mask = PMX_PL_50_MASK, 7968c2ecf20Sopenharmony_ci .val = PMX_SDHCI_PL_50_VAL, 7978c2ecf20Sopenharmony_ci }, { 7988c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_90_99_REG, 7998c2ecf20Sopenharmony_ci .mask = PMX_PL_99_MASK, 8008c2ecf20Sopenharmony_ci .val = PMX_SDHCI_PL_99_VAL, 8018c2ecf20Sopenharmony_ci }, { 8028c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 8038c2ecf20Sopenharmony_ci .mask = PMX_PL_100_101_MASK, 8048c2ecf20Sopenharmony_ci .val = PMX_SDHCI_PL_100_101_VAL, 8058c2ecf20Sopenharmony_ci }, 8068c2ecf20Sopenharmony_ci}; 8078c2ecf20Sopenharmony_ci 8088c2ecf20Sopenharmony_cistatic struct spear_muxreg sdhci_cd_12_muxreg[] = { 8098c2ecf20Sopenharmony_ci { 8108c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 8118c2ecf20Sopenharmony_ci .mask = PMX_MII_MASK, 8128c2ecf20Sopenharmony_ci .val = 0, 8138c2ecf20Sopenharmony_ci }, { 8148c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_10_19_REG, 8158c2ecf20Sopenharmony_ci .mask = PMX_PL_12_MASK, 8168c2ecf20Sopenharmony_ci .val = PMX_SDHCI_CD_PL_12_VAL, 8178c2ecf20Sopenharmony_ci }, { 8188c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 8198c2ecf20Sopenharmony_ci .mask = PMX_SDHCI_CD_PORT_SEL_MASK, 8208c2ecf20Sopenharmony_ci .val = PMX_SDHCI_CD_PORT_12_VAL, 8218c2ecf20Sopenharmony_ci }, 8228c2ecf20Sopenharmony_ci}; 8238c2ecf20Sopenharmony_ci 8248c2ecf20Sopenharmony_cistatic struct spear_muxreg sdhci_cd_51_muxreg[] = { 8258c2ecf20Sopenharmony_ci { 8268c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_50_59_REG, 8278c2ecf20Sopenharmony_ci .mask = PMX_PL_51_MASK, 8288c2ecf20Sopenharmony_ci .val = PMX_SDHCI_CD_PL_51_VAL, 8298c2ecf20Sopenharmony_ci }, { 8308c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 8318c2ecf20Sopenharmony_ci .mask = PMX_SDHCI_CD_PORT_SEL_MASK, 8328c2ecf20Sopenharmony_ci .val = PMX_SDHCI_CD_PORT_51_VAL, 8338c2ecf20Sopenharmony_ci }, 8348c2ecf20Sopenharmony_ci}; 8358c2ecf20Sopenharmony_ci 8368c2ecf20Sopenharmony_ci#define pmx_sdhci_common_modemux \ 8378c2ecf20Sopenharmony_ci { \ 8388c2ecf20Sopenharmony_ci .modes = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE | \ 8398c2ecf20Sopenharmony_ci SMALL_PRINTERS_MODE | EXTENDED_MODE, \ 8408c2ecf20Sopenharmony_ci .muxregs = sdhci_muxreg, \ 8418c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(sdhci_muxreg), \ 8428c2ecf20Sopenharmony_ci }, { \ 8438c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, \ 8448c2ecf20Sopenharmony_ci .muxregs = sdhci_ext_muxreg, \ 8458c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(sdhci_ext_muxreg), \ 8468c2ecf20Sopenharmony_ci } 8478c2ecf20Sopenharmony_ci 8488c2ecf20Sopenharmony_cistatic struct spear_modemux sdhci_modemux[][3] = { 8498c2ecf20Sopenharmony_ci { 8508c2ecf20Sopenharmony_ci /* select pin 12 for cd */ 8518c2ecf20Sopenharmony_ci pmx_sdhci_common_modemux, 8528c2ecf20Sopenharmony_ci { 8538c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 8548c2ecf20Sopenharmony_ci .muxregs = sdhci_cd_12_muxreg, 8558c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(sdhci_cd_12_muxreg), 8568c2ecf20Sopenharmony_ci }, 8578c2ecf20Sopenharmony_ci }, { 8588c2ecf20Sopenharmony_ci /* select pin 51 for cd */ 8598c2ecf20Sopenharmony_ci pmx_sdhci_common_modemux, 8608c2ecf20Sopenharmony_ci { 8618c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 8628c2ecf20Sopenharmony_ci .muxregs = sdhci_cd_51_muxreg, 8638c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(sdhci_cd_51_muxreg), 8648c2ecf20Sopenharmony_ci }, 8658c2ecf20Sopenharmony_ci } 8668c2ecf20Sopenharmony_ci}; 8678c2ecf20Sopenharmony_ci 8688c2ecf20Sopenharmony_cistatic struct spear_pingroup sdhci_pingroup[] = { 8698c2ecf20Sopenharmony_ci { 8708c2ecf20Sopenharmony_ci .name = "sdhci_cd_12_grp", 8718c2ecf20Sopenharmony_ci .pins = sdhci_cd_12_pins, 8728c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(sdhci_cd_12_pins), 8738c2ecf20Sopenharmony_ci .modemuxs = sdhci_modemux[0], 8748c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(sdhci_modemux[0]), 8758c2ecf20Sopenharmony_ci }, { 8768c2ecf20Sopenharmony_ci .name = "sdhci_cd_51_grp", 8778c2ecf20Sopenharmony_ci .pins = sdhci_cd_51_pins, 8788c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(sdhci_cd_51_pins), 8798c2ecf20Sopenharmony_ci .modemuxs = sdhci_modemux[1], 8808c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(sdhci_modemux[1]), 8818c2ecf20Sopenharmony_ci }, 8828c2ecf20Sopenharmony_ci}; 8838c2ecf20Sopenharmony_ci 8848c2ecf20Sopenharmony_cistatic const char *const sdhci_grps[] = { "sdhci_cd_12_grp", "sdhci_cd_51_grp", 8858c2ecf20Sopenharmony_ci "sdhci_led_grp" }; 8868c2ecf20Sopenharmony_ci 8878c2ecf20Sopenharmony_cistatic struct spear_function sdhci_function = { 8888c2ecf20Sopenharmony_ci .name = "sdhci", 8898c2ecf20Sopenharmony_ci .groups = sdhci_grps, 8908c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(sdhci_grps), 8918c2ecf20Sopenharmony_ci}; 8928c2ecf20Sopenharmony_ci 8938c2ecf20Sopenharmony_ci/* Pad multiplexing for I2S device */ 8948c2ecf20Sopenharmony_cistatic const unsigned i2s_pins[] = { 35, 39, 40, 41, 42 }; 8958c2ecf20Sopenharmony_cistatic struct spear_muxreg i2s_muxreg[] = { 8968c2ecf20Sopenharmony_ci { 8978c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 8988c2ecf20Sopenharmony_ci .mask = PMX_SSP_CS_MASK, 8998c2ecf20Sopenharmony_ci .val = 0, 9008c2ecf20Sopenharmony_ci }, { 9018c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 9028c2ecf20Sopenharmony_ci .mask = PMX_UART0_MODEM_MASK, 9038c2ecf20Sopenharmony_ci .val = 0, 9048c2ecf20Sopenharmony_ci }, 9058c2ecf20Sopenharmony_ci}; 9068c2ecf20Sopenharmony_ci 9078c2ecf20Sopenharmony_cistatic struct spear_muxreg i2s_ext_muxreg[] = { 9088c2ecf20Sopenharmony_ci { 9098c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_30_39_REG, 9108c2ecf20Sopenharmony_ci .mask = PMX_PL_35_MASK | PMX_PL_39_MASK, 9118c2ecf20Sopenharmony_ci .val = PMX_I2S_REF_CLK_PL_35_VAL | PMX_I2S_PL_39_VAL, 9128c2ecf20Sopenharmony_ci }, { 9138c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_40_49_REG, 9148c2ecf20Sopenharmony_ci .mask = PMX_PL_40_MASK | PMX_PL_41_42_MASK, 9158c2ecf20Sopenharmony_ci .val = PMX_I2S_PL_40_VAL | PMX_I2S_PL_41_42_VAL, 9168c2ecf20Sopenharmony_ci }, 9178c2ecf20Sopenharmony_ci}; 9188c2ecf20Sopenharmony_ci 9198c2ecf20Sopenharmony_cistatic struct spear_modemux i2s_modemux[] = { 9208c2ecf20Sopenharmony_ci { 9218c2ecf20Sopenharmony_ci .modes = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE | EXTENDED_MODE, 9228c2ecf20Sopenharmony_ci .muxregs = i2s_muxreg, 9238c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(i2s_muxreg), 9248c2ecf20Sopenharmony_ci }, { 9258c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 9268c2ecf20Sopenharmony_ci .muxregs = i2s_ext_muxreg, 9278c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(i2s_ext_muxreg), 9288c2ecf20Sopenharmony_ci }, 9298c2ecf20Sopenharmony_ci}; 9308c2ecf20Sopenharmony_ci 9318c2ecf20Sopenharmony_cistatic struct spear_pingroup i2s_pingroup = { 9328c2ecf20Sopenharmony_ci .name = "i2s_grp", 9338c2ecf20Sopenharmony_ci .pins = i2s_pins, 9348c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(i2s_pins), 9358c2ecf20Sopenharmony_ci .modemuxs = i2s_modemux, 9368c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(i2s_modemux), 9378c2ecf20Sopenharmony_ci}; 9388c2ecf20Sopenharmony_ci 9398c2ecf20Sopenharmony_cistatic const char *const i2s_grps[] = { "i2s_grp" }; 9408c2ecf20Sopenharmony_cistatic struct spear_function i2s_function = { 9418c2ecf20Sopenharmony_ci .name = "i2s", 9428c2ecf20Sopenharmony_ci .groups = i2s_grps, 9438c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(i2s_grps), 9448c2ecf20Sopenharmony_ci}; 9458c2ecf20Sopenharmony_ci 9468c2ecf20Sopenharmony_ci/* Pad multiplexing for UART1 device */ 9478c2ecf20Sopenharmony_cistatic const unsigned uart1_pins[] = { 28, 29 }; 9488c2ecf20Sopenharmony_cistatic struct spear_muxreg uart1_muxreg[] = { 9498c2ecf20Sopenharmony_ci { 9508c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 9518c2ecf20Sopenharmony_ci .mask = PMX_GPIO_PIN0_MASK | PMX_GPIO_PIN1_MASK, 9528c2ecf20Sopenharmony_ci .val = 0, 9538c2ecf20Sopenharmony_ci }, 9548c2ecf20Sopenharmony_ci}; 9558c2ecf20Sopenharmony_ci 9568c2ecf20Sopenharmony_cistatic struct spear_muxreg uart1_ext_muxreg[] = { 9578c2ecf20Sopenharmony_ci { 9588c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_20_29_REG, 9598c2ecf20Sopenharmony_ci .mask = PMX_PL_28_29_MASK, 9608c2ecf20Sopenharmony_ci .val = PMX_UART1_PL_28_29_VAL, 9618c2ecf20Sopenharmony_ci }, 9628c2ecf20Sopenharmony_ci}; 9638c2ecf20Sopenharmony_ci 9648c2ecf20Sopenharmony_cistatic struct spear_modemux uart1_modemux[] = { 9658c2ecf20Sopenharmony_ci { 9668c2ecf20Sopenharmony_ci .modes = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE | AUTO_EXP_MODE 9678c2ecf20Sopenharmony_ci | SMALL_PRINTERS_MODE | EXTENDED_MODE, 9688c2ecf20Sopenharmony_ci .muxregs = uart1_muxreg, 9698c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart1_muxreg), 9708c2ecf20Sopenharmony_ci }, { 9718c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 9728c2ecf20Sopenharmony_ci .muxregs = uart1_ext_muxreg, 9738c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart1_ext_muxreg), 9748c2ecf20Sopenharmony_ci }, 9758c2ecf20Sopenharmony_ci}; 9768c2ecf20Sopenharmony_ci 9778c2ecf20Sopenharmony_cistatic struct spear_pingroup uart1_pingroup = { 9788c2ecf20Sopenharmony_ci .name = "uart1_grp", 9798c2ecf20Sopenharmony_ci .pins = uart1_pins, 9808c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(uart1_pins), 9818c2ecf20Sopenharmony_ci .modemuxs = uart1_modemux, 9828c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(uart1_modemux), 9838c2ecf20Sopenharmony_ci}; 9848c2ecf20Sopenharmony_ci 9858c2ecf20Sopenharmony_cistatic const char *const uart1_grps[] = { "uart1_grp" }; 9868c2ecf20Sopenharmony_cistatic struct spear_function uart1_function = { 9878c2ecf20Sopenharmony_ci .name = "uart1", 9888c2ecf20Sopenharmony_ci .groups = uart1_grps, 9898c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(uart1_grps), 9908c2ecf20Sopenharmony_ci}; 9918c2ecf20Sopenharmony_ci 9928c2ecf20Sopenharmony_ci/* Pad multiplexing for UART1 Modem device */ 9938c2ecf20Sopenharmony_cistatic const unsigned uart1_modem_2_to_7_pins[] = { 2, 3, 4, 5, 6, 7 }; 9948c2ecf20Sopenharmony_cistatic const unsigned uart1_modem_31_to_36_pins[] = { 31, 32, 33, 34, 35, 36 }; 9958c2ecf20Sopenharmony_cistatic const unsigned uart1_modem_34_to_45_pins[] = { 34, 35, 36, 43, 44, 45 }; 9968c2ecf20Sopenharmony_cistatic const unsigned uart1_modem_80_to_85_pins[] = { 80, 81, 82, 83, 84, 85 }; 9978c2ecf20Sopenharmony_ci 9988c2ecf20Sopenharmony_cistatic struct spear_muxreg uart1_modem_ext_2_to_7_muxreg[] = { 9998c2ecf20Sopenharmony_ci { 10008c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 10018c2ecf20Sopenharmony_ci .mask = PMX_UART0_MASK | PMX_I2C_MASK | PMX_SSP_MASK, 10028c2ecf20Sopenharmony_ci .val = 0, 10038c2ecf20Sopenharmony_ci }, { 10048c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_0_9_REG, 10058c2ecf20Sopenharmony_ci .mask = PMX_PL_2_3_MASK | PMX_PL_6_7_MASK, 10068c2ecf20Sopenharmony_ci .val = PMX_UART1_ENH_PL_2_3_VAL | PMX_UART1_ENH_PL_4_5_VAL | 10078c2ecf20Sopenharmony_ci PMX_UART1_ENH_PL_6_7_VAL, 10088c2ecf20Sopenharmony_ci }, { 10098c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 10108c2ecf20Sopenharmony_ci .mask = PMX_UART1_ENH_PORT_SEL_MASK, 10118c2ecf20Sopenharmony_ci .val = PMX_UART1_ENH_PORT_3_TO_5_7_VAL, 10128c2ecf20Sopenharmony_ci }, 10138c2ecf20Sopenharmony_ci}; 10148c2ecf20Sopenharmony_ci 10158c2ecf20Sopenharmony_cistatic struct spear_muxreg uart1_modem_31_to_36_muxreg[] = { 10168c2ecf20Sopenharmony_ci { 10178c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 10188c2ecf20Sopenharmony_ci .mask = PMX_GPIO_PIN3_MASK | PMX_GPIO_PIN4_MASK | 10198c2ecf20Sopenharmony_ci PMX_GPIO_PIN5_MASK | PMX_SSP_CS_MASK, 10208c2ecf20Sopenharmony_ci .val = 0, 10218c2ecf20Sopenharmony_ci }, 10228c2ecf20Sopenharmony_ci}; 10238c2ecf20Sopenharmony_ci 10248c2ecf20Sopenharmony_cistatic struct spear_muxreg uart1_modem_ext_31_to_36_muxreg[] = { 10258c2ecf20Sopenharmony_ci { 10268c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_30_39_REG, 10278c2ecf20Sopenharmony_ci .mask = PMX_PL_31_MASK | PMX_PL_32_33_MASK | PMX_PL_34_MASK | 10288c2ecf20Sopenharmony_ci PMX_PL_35_MASK | PMX_PL_36_MASK, 10298c2ecf20Sopenharmony_ci .val = PMX_UART1_ENH_PL_31_VAL | PMX_UART1_ENH_PL_32_33_VAL | 10308c2ecf20Sopenharmony_ci PMX_UART1_ENH_PL_34_VAL | PMX_UART1_ENH_PL_35_VAL | 10318c2ecf20Sopenharmony_ci PMX_UART1_ENH_PL_36_VAL, 10328c2ecf20Sopenharmony_ci }, { 10338c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 10348c2ecf20Sopenharmony_ci .mask = PMX_UART1_ENH_PORT_SEL_MASK, 10358c2ecf20Sopenharmony_ci .val = PMX_UART1_ENH_PORT_32_TO_34_36_VAL, 10368c2ecf20Sopenharmony_ci }, 10378c2ecf20Sopenharmony_ci}; 10388c2ecf20Sopenharmony_ci 10398c2ecf20Sopenharmony_cistatic struct spear_muxreg uart1_modem_34_to_45_muxreg[] = { 10408c2ecf20Sopenharmony_ci { 10418c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 10428c2ecf20Sopenharmony_ci .mask = PMX_TIMER_0_1_MASK | PMX_TIMER_2_3_MASK | 10438c2ecf20Sopenharmony_ci PMX_SSP_CS_MASK, 10448c2ecf20Sopenharmony_ci .val = 0, 10458c2ecf20Sopenharmony_ci }, 10468c2ecf20Sopenharmony_ci}; 10478c2ecf20Sopenharmony_ci 10488c2ecf20Sopenharmony_cistatic struct spear_muxreg uart1_modem_ext_34_to_45_muxreg[] = { 10498c2ecf20Sopenharmony_ci { 10508c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_30_39_REG, 10518c2ecf20Sopenharmony_ci .mask = PMX_PL_34_MASK | PMX_PL_35_MASK | PMX_PL_36_MASK, 10528c2ecf20Sopenharmony_ci .val = PMX_UART1_ENH_PL_34_VAL | PMX_UART1_ENH_PL_35_VAL | 10538c2ecf20Sopenharmony_ci PMX_UART1_ENH_PL_36_VAL, 10548c2ecf20Sopenharmony_ci }, { 10558c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_40_49_REG, 10568c2ecf20Sopenharmony_ci .mask = PMX_PL_43_MASK | PMX_PL_44_45_MASK, 10578c2ecf20Sopenharmony_ci .val = PMX_UART1_ENH_PL_43_VAL | PMX_UART1_ENH_PL_44_45_VAL, 10588c2ecf20Sopenharmony_ci }, { 10598c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 10608c2ecf20Sopenharmony_ci .mask = PMX_UART1_ENH_PORT_SEL_MASK, 10618c2ecf20Sopenharmony_ci .val = PMX_UART1_ENH_PORT_44_45_34_36_VAL, 10628c2ecf20Sopenharmony_ci }, 10638c2ecf20Sopenharmony_ci}; 10648c2ecf20Sopenharmony_ci 10658c2ecf20Sopenharmony_cistatic struct spear_muxreg uart1_modem_ext_80_to_85_muxreg[] = { 10668c2ecf20Sopenharmony_ci { 10678c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_80_89_REG, 10688c2ecf20Sopenharmony_ci .mask = PMX_PL_80_TO_85_MASK, 10698c2ecf20Sopenharmony_ci .val = PMX_UART1_ENH_PL_80_TO_85_VAL, 10708c2ecf20Sopenharmony_ci }, { 10718c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_40_49_REG, 10728c2ecf20Sopenharmony_ci .mask = PMX_PL_43_MASK | PMX_PL_44_45_MASK, 10738c2ecf20Sopenharmony_ci .val = PMX_UART1_ENH_PL_43_VAL | PMX_UART1_ENH_PL_44_45_VAL, 10748c2ecf20Sopenharmony_ci }, { 10758c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 10768c2ecf20Sopenharmony_ci .mask = PMX_UART1_ENH_PORT_SEL_MASK, 10778c2ecf20Sopenharmony_ci .val = PMX_UART1_ENH_PORT_81_TO_85_VAL, 10788c2ecf20Sopenharmony_ci }, 10798c2ecf20Sopenharmony_ci}; 10808c2ecf20Sopenharmony_ci 10818c2ecf20Sopenharmony_cistatic struct spear_modemux uart1_modem_2_to_7_modemux[] = { 10828c2ecf20Sopenharmony_ci { 10838c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 10848c2ecf20Sopenharmony_ci .muxregs = uart1_modem_ext_2_to_7_muxreg, 10858c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart1_modem_ext_2_to_7_muxreg), 10868c2ecf20Sopenharmony_ci }, 10878c2ecf20Sopenharmony_ci}; 10888c2ecf20Sopenharmony_ci 10898c2ecf20Sopenharmony_cistatic struct spear_modemux uart1_modem_31_to_36_modemux[] = { 10908c2ecf20Sopenharmony_ci { 10918c2ecf20Sopenharmony_ci .modes = SMALL_PRINTERS_MODE | EXTENDED_MODE, 10928c2ecf20Sopenharmony_ci .muxregs = uart1_modem_31_to_36_muxreg, 10938c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart1_modem_31_to_36_muxreg), 10948c2ecf20Sopenharmony_ci }, { 10958c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 10968c2ecf20Sopenharmony_ci .muxregs = uart1_modem_ext_31_to_36_muxreg, 10978c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart1_modem_ext_31_to_36_muxreg), 10988c2ecf20Sopenharmony_ci }, 10998c2ecf20Sopenharmony_ci}; 11008c2ecf20Sopenharmony_ci 11018c2ecf20Sopenharmony_cistatic struct spear_modemux uart1_modem_34_to_45_modemux[] = { 11028c2ecf20Sopenharmony_ci { 11038c2ecf20Sopenharmony_ci .modes = AUTO_EXP_MODE | EXTENDED_MODE, 11048c2ecf20Sopenharmony_ci .muxregs = uart1_modem_34_to_45_muxreg, 11058c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart1_modem_34_to_45_muxreg), 11068c2ecf20Sopenharmony_ci }, { 11078c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 11088c2ecf20Sopenharmony_ci .muxregs = uart1_modem_ext_34_to_45_muxreg, 11098c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart1_modem_ext_34_to_45_muxreg), 11108c2ecf20Sopenharmony_ci }, 11118c2ecf20Sopenharmony_ci}; 11128c2ecf20Sopenharmony_ci 11138c2ecf20Sopenharmony_cistatic struct spear_modemux uart1_modem_80_to_85_modemux[] = { 11148c2ecf20Sopenharmony_ci { 11158c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 11168c2ecf20Sopenharmony_ci .muxregs = uart1_modem_ext_80_to_85_muxreg, 11178c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart1_modem_ext_80_to_85_muxreg), 11188c2ecf20Sopenharmony_ci }, 11198c2ecf20Sopenharmony_ci}; 11208c2ecf20Sopenharmony_ci 11218c2ecf20Sopenharmony_cistatic struct spear_pingroup uart1_modem_pingroup[] = { 11228c2ecf20Sopenharmony_ci { 11238c2ecf20Sopenharmony_ci .name = "uart1_modem_2_to_7_grp", 11248c2ecf20Sopenharmony_ci .pins = uart1_modem_2_to_7_pins, 11258c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(uart1_modem_2_to_7_pins), 11268c2ecf20Sopenharmony_ci .modemuxs = uart1_modem_2_to_7_modemux, 11278c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(uart1_modem_2_to_7_modemux), 11288c2ecf20Sopenharmony_ci }, { 11298c2ecf20Sopenharmony_ci .name = "uart1_modem_31_to_36_grp", 11308c2ecf20Sopenharmony_ci .pins = uart1_modem_31_to_36_pins, 11318c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(uart1_modem_31_to_36_pins), 11328c2ecf20Sopenharmony_ci .modemuxs = uart1_modem_31_to_36_modemux, 11338c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(uart1_modem_31_to_36_modemux), 11348c2ecf20Sopenharmony_ci }, { 11358c2ecf20Sopenharmony_ci .name = "uart1_modem_34_to_45_grp", 11368c2ecf20Sopenharmony_ci .pins = uart1_modem_34_to_45_pins, 11378c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(uart1_modem_34_to_45_pins), 11388c2ecf20Sopenharmony_ci .modemuxs = uart1_modem_34_to_45_modemux, 11398c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(uart1_modem_34_to_45_modemux), 11408c2ecf20Sopenharmony_ci }, { 11418c2ecf20Sopenharmony_ci .name = "uart1_modem_80_to_85_grp", 11428c2ecf20Sopenharmony_ci .pins = uart1_modem_80_to_85_pins, 11438c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(uart1_modem_80_to_85_pins), 11448c2ecf20Sopenharmony_ci .modemuxs = uart1_modem_80_to_85_modemux, 11458c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(uart1_modem_80_to_85_modemux), 11468c2ecf20Sopenharmony_ci }, 11478c2ecf20Sopenharmony_ci}; 11488c2ecf20Sopenharmony_ci 11498c2ecf20Sopenharmony_cistatic const char *const uart1_modem_grps[] = { "uart1_modem_2_to_7_grp", 11508c2ecf20Sopenharmony_ci "uart1_modem_31_to_36_grp", "uart1_modem_34_to_45_grp", 11518c2ecf20Sopenharmony_ci "uart1_modem_80_to_85_grp" }; 11528c2ecf20Sopenharmony_cistatic struct spear_function uart1_modem_function = { 11538c2ecf20Sopenharmony_ci .name = "uart1_modem", 11548c2ecf20Sopenharmony_ci .groups = uart1_modem_grps, 11558c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(uart1_modem_grps), 11568c2ecf20Sopenharmony_ci}; 11578c2ecf20Sopenharmony_ci 11588c2ecf20Sopenharmony_ci/* Pad multiplexing for UART2 device */ 11598c2ecf20Sopenharmony_cistatic const unsigned uart2_pins[] = { 0, 1 }; 11608c2ecf20Sopenharmony_cistatic struct spear_muxreg uart2_muxreg[] = { 11618c2ecf20Sopenharmony_ci { 11628c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 11638c2ecf20Sopenharmony_ci .mask = PMX_FIRDA_MASK, 11648c2ecf20Sopenharmony_ci .val = 0, 11658c2ecf20Sopenharmony_ci }, 11668c2ecf20Sopenharmony_ci}; 11678c2ecf20Sopenharmony_ci 11688c2ecf20Sopenharmony_cistatic struct spear_muxreg uart2_ext_muxreg[] = { 11698c2ecf20Sopenharmony_ci { 11708c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_0_9_REG, 11718c2ecf20Sopenharmony_ci .mask = PMX_PL_0_1_MASK, 11728c2ecf20Sopenharmony_ci .val = PMX_UART2_PL_0_1_VAL, 11738c2ecf20Sopenharmony_ci }, 11748c2ecf20Sopenharmony_ci}; 11758c2ecf20Sopenharmony_ci 11768c2ecf20Sopenharmony_cistatic struct spear_modemux uart2_modemux[] = { 11778c2ecf20Sopenharmony_ci { 11788c2ecf20Sopenharmony_ci .modes = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE | AUTO_EXP_MODE 11798c2ecf20Sopenharmony_ci | SMALL_PRINTERS_MODE | EXTENDED_MODE, 11808c2ecf20Sopenharmony_ci .muxregs = uart2_muxreg, 11818c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart2_muxreg), 11828c2ecf20Sopenharmony_ci }, { 11838c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 11848c2ecf20Sopenharmony_ci .muxregs = uart2_ext_muxreg, 11858c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart2_ext_muxreg), 11868c2ecf20Sopenharmony_ci }, 11878c2ecf20Sopenharmony_ci}; 11888c2ecf20Sopenharmony_ci 11898c2ecf20Sopenharmony_cistatic struct spear_pingroup uart2_pingroup = { 11908c2ecf20Sopenharmony_ci .name = "uart2_grp", 11918c2ecf20Sopenharmony_ci .pins = uart2_pins, 11928c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(uart2_pins), 11938c2ecf20Sopenharmony_ci .modemuxs = uart2_modemux, 11948c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(uart2_modemux), 11958c2ecf20Sopenharmony_ci}; 11968c2ecf20Sopenharmony_ci 11978c2ecf20Sopenharmony_cistatic const char *const uart2_grps[] = { "uart2_grp" }; 11988c2ecf20Sopenharmony_cistatic struct spear_function uart2_function = { 11998c2ecf20Sopenharmony_ci .name = "uart2", 12008c2ecf20Sopenharmony_ci .groups = uart2_grps, 12018c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(uart2_grps), 12028c2ecf20Sopenharmony_ci}; 12038c2ecf20Sopenharmony_ci 12048c2ecf20Sopenharmony_ci/* Pad multiplexing for uart3 device */ 12058c2ecf20Sopenharmony_cistatic const unsigned uart3_pins[][2] = { { 8, 9 }, { 15, 16 }, { 41, 42 }, 12068c2ecf20Sopenharmony_ci { 52, 53 }, { 73, 74 }, { 94, 95 }, { 98, 99 } }; 12078c2ecf20Sopenharmony_ci 12088c2ecf20Sopenharmony_cistatic struct spear_muxreg uart3_ext_8_9_muxreg[] = { 12098c2ecf20Sopenharmony_ci { 12108c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 12118c2ecf20Sopenharmony_ci .mask = PMX_SSP_MASK, 12128c2ecf20Sopenharmony_ci .val = 0, 12138c2ecf20Sopenharmony_ci }, { 12148c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_0_9_REG, 12158c2ecf20Sopenharmony_ci .mask = PMX_PL_8_9_MASK, 12168c2ecf20Sopenharmony_ci .val = PMX_UART3_PL_8_9_VAL, 12178c2ecf20Sopenharmony_ci }, { 12188c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 12198c2ecf20Sopenharmony_ci .mask = PMX_UART3_PORT_SEL_MASK, 12208c2ecf20Sopenharmony_ci .val = PMX_UART3_PORT_8_VAL, 12218c2ecf20Sopenharmony_ci }, 12228c2ecf20Sopenharmony_ci}; 12238c2ecf20Sopenharmony_ci 12248c2ecf20Sopenharmony_cistatic struct spear_muxreg uart3_ext_15_16_muxreg[] = { 12258c2ecf20Sopenharmony_ci { 12268c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 12278c2ecf20Sopenharmony_ci .mask = PMX_MII_MASK, 12288c2ecf20Sopenharmony_ci .val = 0, 12298c2ecf20Sopenharmony_ci }, { 12308c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_10_19_REG, 12318c2ecf20Sopenharmony_ci .mask = PMX_PL_15_16_MASK, 12328c2ecf20Sopenharmony_ci .val = PMX_UART3_PL_15_16_VAL, 12338c2ecf20Sopenharmony_ci }, { 12348c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 12358c2ecf20Sopenharmony_ci .mask = PMX_UART3_PORT_SEL_MASK, 12368c2ecf20Sopenharmony_ci .val = PMX_UART3_PORT_15_VAL, 12378c2ecf20Sopenharmony_ci }, 12388c2ecf20Sopenharmony_ci}; 12398c2ecf20Sopenharmony_ci 12408c2ecf20Sopenharmony_cistatic struct spear_muxreg uart3_ext_41_42_muxreg[] = { 12418c2ecf20Sopenharmony_ci { 12428c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 12438c2ecf20Sopenharmony_ci .mask = PMX_UART0_MODEM_MASK, 12448c2ecf20Sopenharmony_ci .val = 0, 12458c2ecf20Sopenharmony_ci }, { 12468c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_40_49_REG, 12478c2ecf20Sopenharmony_ci .mask = PMX_PL_41_42_MASK, 12488c2ecf20Sopenharmony_ci .val = PMX_UART3_PL_41_42_VAL, 12498c2ecf20Sopenharmony_ci }, { 12508c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 12518c2ecf20Sopenharmony_ci .mask = PMX_UART3_PORT_SEL_MASK, 12528c2ecf20Sopenharmony_ci .val = PMX_UART3_PORT_41_VAL, 12538c2ecf20Sopenharmony_ci }, 12548c2ecf20Sopenharmony_ci}; 12558c2ecf20Sopenharmony_ci 12568c2ecf20Sopenharmony_cistatic struct spear_muxreg uart3_ext_52_53_muxreg[] = { 12578c2ecf20Sopenharmony_ci { 12588c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_50_59_REG, 12598c2ecf20Sopenharmony_ci .mask = PMX_PL_52_53_MASK, 12608c2ecf20Sopenharmony_ci .val = PMX_UART3_PL_52_53_VAL, 12618c2ecf20Sopenharmony_ci }, { 12628c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 12638c2ecf20Sopenharmony_ci .mask = PMX_UART3_PORT_SEL_MASK, 12648c2ecf20Sopenharmony_ci .val = PMX_UART3_PORT_52_VAL, 12658c2ecf20Sopenharmony_ci }, 12668c2ecf20Sopenharmony_ci}; 12678c2ecf20Sopenharmony_ci 12688c2ecf20Sopenharmony_cistatic struct spear_muxreg uart3_ext_73_74_muxreg[] = { 12698c2ecf20Sopenharmony_ci { 12708c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_70_79_REG, 12718c2ecf20Sopenharmony_ci .mask = PMX_PL_73_MASK | PMX_PL_74_MASK, 12728c2ecf20Sopenharmony_ci .val = PMX_UART3_PL_73_VAL | PMX_UART3_PL_74_VAL, 12738c2ecf20Sopenharmony_ci }, { 12748c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 12758c2ecf20Sopenharmony_ci .mask = PMX_UART3_PORT_SEL_MASK, 12768c2ecf20Sopenharmony_ci .val = PMX_UART3_PORT_73_VAL, 12778c2ecf20Sopenharmony_ci }, 12788c2ecf20Sopenharmony_ci}; 12798c2ecf20Sopenharmony_ci 12808c2ecf20Sopenharmony_cistatic struct spear_muxreg uart3_ext_94_95_muxreg[] = { 12818c2ecf20Sopenharmony_ci { 12828c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_90_99_REG, 12838c2ecf20Sopenharmony_ci .mask = PMX_PL_94_95_MASK, 12848c2ecf20Sopenharmony_ci .val = PMX_UART3_PL_94_95_VAL, 12858c2ecf20Sopenharmony_ci }, { 12868c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 12878c2ecf20Sopenharmony_ci .mask = PMX_UART3_PORT_SEL_MASK, 12888c2ecf20Sopenharmony_ci .val = PMX_UART3_PORT_94_VAL, 12898c2ecf20Sopenharmony_ci }, 12908c2ecf20Sopenharmony_ci}; 12918c2ecf20Sopenharmony_ci 12928c2ecf20Sopenharmony_cistatic struct spear_muxreg uart3_ext_98_99_muxreg[] = { 12938c2ecf20Sopenharmony_ci { 12948c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_90_99_REG, 12958c2ecf20Sopenharmony_ci .mask = PMX_PL_98_MASK | PMX_PL_99_MASK, 12968c2ecf20Sopenharmony_ci .val = PMX_UART3_PL_98_VAL | PMX_UART3_PL_99_VAL, 12978c2ecf20Sopenharmony_ci }, { 12988c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 12998c2ecf20Sopenharmony_ci .mask = PMX_UART3_PORT_SEL_MASK, 13008c2ecf20Sopenharmony_ci .val = PMX_UART3_PORT_99_VAL, 13018c2ecf20Sopenharmony_ci }, 13028c2ecf20Sopenharmony_ci}; 13038c2ecf20Sopenharmony_ci 13048c2ecf20Sopenharmony_cistatic struct spear_modemux uart3_modemux[][1] = { 13058c2ecf20Sopenharmony_ci { 13068c2ecf20Sopenharmony_ci /* Select signals on pins 8_9 */ 13078c2ecf20Sopenharmony_ci { 13088c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 13098c2ecf20Sopenharmony_ci .muxregs = uart3_ext_8_9_muxreg, 13108c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart3_ext_8_9_muxreg), 13118c2ecf20Sopenharmony_ci }, 13128c2ecf20Sopenharmony_ci }, { 13138c2ecf20Sopenharmony_ci /* Select signals on pins 15_16 */ 13148c2ecf20Sopenharmony_ci { 13158c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 13168c2ecf20Sopenharmony_ci .muxregs = uart3_ext_15_16_muxreg, 13178c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart3_ext_15_16_muxreg), 13188c2ecf20Sopenharmony_ci }, 13198c2ecf20Sopenharmony_ci }, { 13208c2ecf20Sopenharmony_ci /* Select signals on pins 41_42 */ 13218c2ecf20Sopenharmony_ci { 13228c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 13238c2ecf20Sopenharmony_ci .muxregs = uart3_ext_41_42_muxreg, 13248c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart3_ext_41_42_muxreg), 13258c2ecf20Sopenharmony_ci }, 13268c2ecf20Sopenharmony_ci }, { 13278c2ecf20Sopenharmony_ci /* Select signals on pins 52_53 */ 13288c2ecf20Sopenharmony_ci { 13298c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 13308c2ecf20Sopenharmony_ci .muxregs = uart3_ext_52_53_muxreg, 13318c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart3_ext_52_53_muxreg), 13328c2ecf20Sopenharmony_ci }, 13338c2ecf20Sopenharmony_ci }, { 13348c2ecf20Sopenharmony_ci /* Select signals on pins 73_74 */ 13358c2ecf20Sopenharmony_ci { 13368c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 13378c2ecf20Sopenharmony_ci .muxregs = uart3_ext_73_74_muxreg, 13388c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart3_ext_73_74_muxreg), 13398c2ecf20Sopenharmony_ci }, 13408c2ecf20Sopenharmony_ci }, { 13418c2ecf20Sopenharmony_ci /* Select signals on pins 94_95 */ 13428c2ecf20Sopenharmony_ci { 13438c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 13448c2ecf20Sopenharmony_ci .muxregs = uart3_ext_94_95_muxreg, 13458c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart3_ext_94_95_muxreg), 13468c2ecf20Sopenharmony_ci }, 13478c2ecf20Sopenharmony_ci }, { 13488c2ecf20Sopenharmony_ci /* Select signals on pins 98_99 */ 13498c2ecf20Sopenharmony_ci { 13508c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 13518c2ecf20Sopenharmony_ci .muxregs = uart3_ext_98_99_muxreg, 13528c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart3_ext_98_99_muxreg), 13538c2ecf20Sopenharmony_ci }, 13548c2ecf20Sopenharmony_ci }, 13558c2ecf20Sopenharmony_ci}; 13568c2ecf20Sopenharmony_ci 13578c2ecf20Sopenharmony_cistatic struct spear_pingroup uart3_pingroup[] = { 13588c2ecf20Sopenharmony_ci { 13598c2ecf20Sopenharmony_ci .name = "uart3_8_9_grp", 13608c2ecf20Sopenharmony_ci .pins = uart3_pins[0], 13618c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(uart3_pins[0]), 13628c2ecf20Sopenharmony_ci .modemuxs = uart3_modemux[0], 13638c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(uart3_modemux[0]), 13648c2ecf20Sopenharmony_ci }, { 13658c2ecf20Sopenharmony_ci .name = "uart3_15_16_grp", 13668c2ecf20Sopenharmony_ci .pins = uart3_pins[1], 13678c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(uart3_pins[1]), 13688c2ecf20Sopenharmony_ci .modemuxs = uart3_modemux[1], 13698c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(uart3_modemux[1]), 13708c2ecf20Sopenharmony_ci }, { 13718c2ecf20Sopenharmony_ci .name = "uart3_41_42_grp", 13728c2ecf20Sopenharmony_ci .pins = uart3_pins[2], 13738c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(uart3_pins[2]), 13748c2ecf20Sopenharmony_ci .modemuxs = uart3_modemux[2], 13758c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(uart3_modemux[2]), 13768c2ecf20Sopenharmony_ci }, { 13778c2ecf20Sopenharmony_ci .name = "uart3_52_53_grp", 13788c2ecf20Sopenharmony_ci .pins = uart3_pins[3], 13798c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(uart3_pins[3]), 13808c2ecf20Sopenharmony_ci .modemuxs = uart3_modemux[3], 13818c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(uart3_modemux[3]), 13828c2ecf20Sopenharmony_ci }, { 13838c2ecf20Sopenharmony_ci .name = "uart3_73_74_grp", 13848c2ecf20Sopenharmony_ci .pins = uart3_pins[4], 13858c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(uart3_pins[4]), 13868c2ecf20Sopenharmony_ci .modemuxs = uart3_modemux[4], 13878c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(uart3_modemux[4]), 13888c2ecf20Sopenharmony_ci }, { 13898c2ecf20Sopenharmony_ci .name = "uart3_94_95_grp", 13908c2ecf20Sopenharmony_ci .pins = uart3_pins[5], 13918c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(uart3_pins[5]), 13928c2ecf20Sopenharmony_ci .modemuxs = uart3_modemux[5], 13938c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(uart3_modemux[5]), 13948c2ecf20Sopenharmony_ci }, { 13958c2ecf20Sopenharmony_ci .name = "uart3_98_99_grp", 13968c2ecf20Sopenharmony_ci .pins = uart3_pins[6], 13978c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(uart3_pins[6]), 13988c2ecf20Sopenharmony_ci .modemuxs = uart3_modemux[6], 13998c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(uart3_modemux[6]), 14008c2ecf20Sopenharmony_ci }, 14018c2ecf20Sopenharmony_ci}; 14028c2ecf20Sopenharmony_ci 14038c2ecf20Sopenharmony_cistatic const char *const uart3_grps[] = { "uart3_8_9_grp", "uart3_15_16_grp", 14048c2ecf20Sopenharmony_ci "uart3_41_42_grp", "uart3_52_53_grp", "uart3_73_74_grp", 14058c2ecf20Sopenharmony_ci "uart3_94_95_grp", "uart3_98_99_grp" }; 14068c2ecf20Sopenharmony_ci 14078c2ecf20Sopenharmony_cistatic struct spear_function uart3_function = { 14088c2ecf20Sopenharmony_ci .name = "uart3", 14098c2ecf20Sopenharmony_ci .groups = uart3_grps, 14108c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(uart3_grps), 14118c2ecf20Sopenharmony_ci}; 14128c2ecf20Sopenharmony_ci 14138c2ecf20Sopenharmony_ci/* Pad multiplexing for uart4 device */ 14148c2ecf20Sopenharmony_cistatic const unsigned uart4_pins[][2] = { { 6, 7 }, { 13, 14 }, { 39, 40 }, 14158c2ecf20Sopenharmony_ci { 71, 72 }, { 92, 93 }, { 100, 101 } }; 14168c2ecf20Sopenharmony_ci 14178c2ecf20Sopenharmony_cistatic struct spear_muxreg uart4_ext_6_7_muxreg[] = { 14188c2ecf20Sopenharmony_ci { 14198c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 14208c2ecf20Sopenharmony_ci .mask = PMX_SSP_MASK, 14218c2ecf20Sopenharmony_ci .val = 0, 14228c2ecf20Sopenharmony_ci }, { 14238c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_0_9_REG, 14248c2ecf20Sopenharmony_ci .mask = PMX_PL_6_7_MASK, 14258c2ecf20Sopenharmony_ci .val = PMX_UART4_PL_6_7_VAL, 14268c2ecf20Sopenharmony_ci }, { 14278c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 14288c2ecf20Sopenharmony_ci .mask = PMX_UART4_PORT_SEL_MASK, 14298c2ecf20Sopenharmony_ci .val = PMX_UART4_PORT_6_VAL, 14308c2ecf20Sopenharmony_ci }, 14318c2ecf20Sopenharmony_ci}; 14328c2ecf20Sopenharmony_ci 14338c2ecf20Sopenharmony_cistatic struct spear_muxreg uart4_ext_13_14_muxreg[] = { 14348c2ecf20Sopenharmony_ci { 14358c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 14368c2ecf20Sopenharmony_ci .mask = PMX_MII_MASK, 14378c2ecf20Sopenharmony_ci .val = 0, 14388c2ecf20Sopenharmony_ci }, { 14398c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_10_19_REG, 14408c2ecf20Sopenharmony_ci .mask = PMX_PL_13_14_MASK, 14418c2ecf20Sopenharmony_ci .val = PMX_UART4_PL_13_14_VAL, 14428c2ecf20Sopenharmony_ci }, { 14438c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 14448c2ecf20Sopenharmony_ci .mask = PMX_UART4_PORT_SEL_MASK, 14458c2ecf20Sopenharmony_ci .val = PMX_UART4_PORT_13_VAL, 14468c2ecf20Sopenharmony_ci }, 14478c2ecf20Sopenharmony_ci}; 14488c2ecf20Sopenharmony_ci 14498c2ecf20Sopenharmony_cistatic struct spear_muxreg uart4_ext_39_40_muxreg[] = { 14508c2ecf20Sopenharmony_ci { 14518c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 14528c2ecf20Sopenharmony_ci .mask = PMX_UART0_MODEM_MASK, 14538c2ecf20Sopenharmony_ci .val = 0, 14548c2ecf20Sopenharmony_ci }, { 14558c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_30_39_REG, 14568c2ecf20Sopenharmony_ci .mask = PMX_PL_39_MASK, 14578c2ecf20Sopenharmony_ci .val = PMX_UART4_PL_39_VAL, 14588c2ecf20Sopenharmony_ci }, { 14598c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_40_49_REG, 14608c2ecf20Sopenharmony_ci .mask = PMX_PL_40_MASK, 14618c2ecf20Sopenharmony_ci .val = PMX_UART4_PL_40_VAL, 14628c2ecf20Sopenharmony_ci }, { 14638c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 14648c2ecf20Sopenharmony_ci .mask = PMX_UART4_PORT_SEL_MASK, 14658c2ecf20Sopenharmony_ci .val = PMX_UART4_PORT_39_VAL, 14668c2ecf20Sopenharmony_ci }, 14678c2ecf20Sopenharmony_ci}; 14688c2ecf20Sopenharmony_ci 14698c2ecf20Sopenharmony_cistatic struct spear_muxreg uart4_ext_71_72_muxreg[] = { 14708c2ecf20Sopenharmony_ci { 14718c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_70_79_REG, 14728c2ecf20Sopenharmony_ci .mask = PMX_PL_71_72_MASK, 14738c2ecf20Sopenharmony_ci .val = PMX_UART4_PL_71_72_VAL, 14748c2ecf20Sopenharmony_ci }, { 14758c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 14768c2ecf20Sopenharmony_ci .mask = PMX_UART4_PORT_SEL_MASK, 14778c2ecf20Sopenharmony_ci .val = PMX_UART4_PORT_71_VAL, 14788c2ecf20Sopenharmony_ci }, 14798c2ecf20Sopenharmony_ci}; 14808c2ecf20Sopenharmony_ci 14818c2ecf20Sopenharmony_cistatic struct spear_muxreg uart4_ext_92_93_muxreg[] = { 14828c2ecf20Sopenharmony_ci { 14838c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_90_99_REG, 14848c2ecf20Sopenharmony_ci .mask = PMX_PL_92_93_MASK, 14858c2ecf20Sopenharmony_ci .val = PMX_UART4_PL_92_93_VAL, 14868c2ecf20Sopenharmony_ci }, { 14878c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 14888c2ecf20Sopenharmony_ci .mask = PMX_UART4_PORT_SEL_MASK, 14898c2ecf20Sopenharmony_ci .val = PMX_UART4_PORT_92_VAL, 14908c2ecf20Sopenharmony_ci }, 14918c2ecf20Sopenharmony_ci}; 14928c2ecf20Sopenharmony_ci 14938c2ecf20Sopenharmony_cistatic struct spear_muxreg uart4_ext_100_101_muxreg[] = { 14948c2ecf20Sopenharmony_ci { 14958c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 14968c2ecf20Sopenharmony_ci .mask = PMX_PL_100_101_MASK | 14978c2ecf20Sopenharmony_ci PMX_UART4_PORT_SEL_MASK, 14988c2ecf20Sopenharmony_ci .val = PMX_UART4_PL_100_101_VAL | 14998c2ecf20Sopenharmony_ci PMX_UART4_PORT_101_VAL, 15008c2ecf20Sopenharmony_ci }, 15018c2ecf20Sopenharmony_ci}; 15028c2ecf20Sopenharmony_ci 15038c2ecf20Sopenharmony_cistatic struct spear_modemux uart4_modemux[][1] = { 15048c2ecf20Sopenharmony_ci { 15058c2ecf20Sopenharmony_ci /* Select signals on pins 6_7 */ 15068c2ecf20Sopenharmony_ci { 15078c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 15088c2ecf20Sopenharmony_ci .muxregs = uart4_ext_6_7_muxreg, 15098c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart4_ext_6_7_muxreg), 15108c2ecf20Sopenharmony_ci }, 15118c2ecf20Sopenharmony_ci }, { 15128c2ecf20Sopenharmony_ci /* Select signals on pins 13_14 */ 15138c2ecf20Sopenharmony_ci { 15148c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 15158c2ecf20Sopenharmony_ci .muxregs = uart4_ext_13_14_muxreg, 15168c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart4_ext_13_14_muxreg), 15178c2ecf20Sopenharmony_ci }, 15188c2ecf20Sopenharmony_ci }, { 15198c2ecf20Sopenharmony_ci /* Select signals on pins 39_40 */ 15208c2ecf20Sopenharmony_ci { 15218c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 15228c2ecf20Sopenharmony_ci .muxregs = uart4_ext_39_40_muxreg, 15238c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart4_ext_39_40_muxreg), 15248c2ecf20Sopenharmony_ci }, 15258c2ecf20Sopenharmony_ci }, { 15268c2ecf20Sopenharmony_ci /* Select signals on pins 71_72 */ 15278c2ecf20Sopenharmony_ci { 15288c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 15298c2ecf20Sopenharmony_ci .muxregs = uart4_ext_71_72_muxreg, 15308c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart4_ext_71_72_muxreg), 15318c2ecf20Sopenharmony_ci }, 15328c2ecf20Sopenharmony_ci }, { 15338c2ecf20Sopenharmony_ci /* Select signals on pins 92_93 */ 15348c2ecf20Sopenharmony_ci { 15358c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 15368c2ecf20Sopenharmony_ci .muxregs = uart4_ext_92_93_muxreg, 15378c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart4_ext_92_93_muxreg), 15388c2ecf20Sopenharmony_ci }, 15398c2ecf20Sopenharmony_ci }, { 15408c2ecf20Sopenharmony_ci /* Select signals on pins 100_101_ */ 15418c2ecf20Sopenharmony_ci { 15428c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 15438c2ecf20Sopenharmony_ci .muxregs = uart4_ext_100_101_muxreg, 15448c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart4_ext_100_101_muxreg), 15458c2ecf20Sopenharmony_ci }, 15468c2ecf20Sopenharmony_ci }, 15478c2ecf20Sopenharmony_ci}; 15488c2ecf20Sopenharmony_ci 15498c2ecf20Sopenharmony_cistatic struct spear_pingroup uart4_pingroup[] = { 15508c2ecf20Sopenharmony_ci { 15518c2ecf20Sopenharmony_ci .name = "uart4_6_7_grp", 15528c2ecf20Sopenharmony_ci .pins = uart4_pins[0], 15538c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(uart4_pins[0]), 15548c2ecf20Sopenharmony_ci .modemuxs = uart4_modemux[0], 15558c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(uart4_modemux[0]), 15568c2ecf20Sopenharmony_ci }, { 15578c2ecf20Sopenharmony_ci .name = "uart4_13_14_grp", 15588c2ecf20Sopenharmony_ci .pins = uart4_pins[1], 15598c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(uart4_pins[1]), 15608c2ecf20Sopenharmony_ci .modemuxs = uart4_modemux[1], 15618c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(uart4_modemux[1]), 15628c2ecf20Sopenharmony_ci }, { 15638c2ecf20Sopenharmony_ci .name = "uart4_39_40_grp", 15648c2ecf20Sopenharmony_ci .pins = uart4_pins[2], 15658c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(uart4_pins[2]), 15668c2ecf20Sopenharmony_ci .modemuxs = uart4_modemux[2], 15678c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(uart4_modemux[2]), 15688c2ecf20Sopenharmony_ci }, { 15698c2ecf20Sopenharmony_ci .name = "uart4_71_72_grp", 15708c2ecf20Sopenharmony_ci .pins = uart4_pins[3], 15718c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(uart4_pins[3]), 15728c2ecf20Sopenharmony_ci .modemuxs = uart4_modemux[3], 15738c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(uart4_modemux[3]), 15748c2ecf20Sopenharmony_ci }, { 15758c2ecf20Sopenharmony_ci .name = "uart4_92_93_grp", 15768c2ecf20Sopenharmony_ci .pins = uart4_pins[4], 15778c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(uart4_pins[4]), 15788c2ecf20Sopenharmony_ci .modemuxs = uart4_modemux[4], 15798c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(uart4_modemux[4]), 15808c2ecf20Sopenharmony_ci }, { 15818c2ecf20Sopenharmony_ci .name = "uart4_100_101_grp", 15828c2ecf20Sopenharmony_ci .pins = uart4_pins[5], 15838c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(uart4_pins[5]), 15848c2ecf20Sopenharmony_ci .modemuxs = uart4_modemux[5], 15858c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(uart4_modemux[5]), 15868c2ecf20Sopenharmony_ci }, 15878c2ecf20Sopenharmony_ci}; 15888c2ecf20Sopenharmony_ci 15898c2ecf20Sopenharmony_cistatic const char *const uart4_grps[] = { "uart4_6_7_grp", "uart4_13_14_grp", 15908c2ecf20Sopenharmony_ci "uart4_39_40_grp", "uart4_71_72_grp", "uart4_92_93_grp", 15918c2ecf20Sopenharmony_ci "uart4_100_101_grp" }; 15928c2ecf20Sopenharmony_ci 15938c2ecf20Sopenharmony_cistatic struct spear_function uart4_function = { 15948c2ecf20Sopenharmony_ci .name = "uart4", 15958c2ecf20Sopenharmony_ci .groups = uart4_grps, 15968c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(uart4_grps), 15978c2ecf20Sopenharmony_ci}; 15988c2ecf20Sopenharmony_ci 15998c2ecf20Sopenharmony_ci/* Pad multiplexing for uart5 device */ 16008c2ecf20Sopenharmony_cistatic const unsigned uart5_pins[][2] = { { 4, 5 }, { 37, 38 }, { 69, 70 }, 16018c2ecf20Sopenharmony_ci { 90, 91 } }; 16028c2ecf20Sopenharmony_ci 16038c2ecf20Sopenharmony_cistatic struct spear_muxreg uart5_ext_4_5_muxreg[] = { 16048c2ecf20Sopenharmony_ci { 16058c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 16068c2ecf20Sopenharmony_ci .mask = PMX_I2C_MASK, 16078c2ecf20Sopenharmony_ci .val = 0, 16088c2ecf20Sopenharmony_ci }, { 16098c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_0_9_REG, 16108c2ecf20Sopenharmony_ci .mask = PMX_PL_4_5_MASK, 16118c2ecf20Sopenharmony_ci .val = PMX_UART5_PL_4_5_VAL, 16128c2ecf20Sopenharmony_ci }, { 16138c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 16148c2ecf20Sopenharmony_ci .mask = PMX_UART5_PORT_SEL_MASK, 16158c2ecf20Sopenharmony_ci .val = PMX_UART5_PORT_4_VAL, 16168c2ecf20Sopenharmony_ci }, 16178c2ecf20Sopenharmony_ci}; 16188c2ecf20Sopenharmony_ci 16198c2ecf20Sopenharmony_cistatic struct spear_muxreg uart5_ext_37_38_muxreg[] = { 16208c2ecf20Sopenharmony_ci { 16218c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 16228c2ecf20Sopenharmony_ci .mask = PMX_UART0_MODEM_MASK, 16238c2ecf20Sopenharmony_ci .val = 0, 16248c2ecf20Sopenharmony_ci }, { 16258c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_30_39_REG, 16268c2ecf20Sopenharmony_ci .mask = PMX_PL_37_38_MASK, 16278c2ecf20Sopenharmony_ci .val = PMX_UART5_PL_37_38_VAL, 16288c2ecf20Sopenharmony_ci }, { 16298c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 16308c2ecf20Sopenharmony_ci .mask = PMX_UART5_PORT_SEL_MASK, 16318c2ecf20Sopenharmony_ci .val = PMX_UART5_PORT_37_VAL, 16328c2ecf20Sopenharmony_ci }, 16338c2ecf20Sopenharmony_ci}; 16348c2ecf20Sopenharmony_ci 16358c2ecf20Sopenharmony_cistatic struct spear_muxreg uart5_ext_69_70_muxreg[] = { 16368c2ecf20Sopenharmony_ci { 16378c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_60_69_REG, 16388c2ecf20Sopenharmony_ci .mask = PMX_PL_69_MASK, 16398c2ecf20Sopenharmony_ci .val = PMX_UART5_PL_69_VAL, 16408c2ecf20Sopenharmony_ci }, { 16418c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_70_79_REG, 16428c2ecf20Sopenharmony_ci .mask = PMX_PL_70_MASK, 16438c2ecf20Sopenharmony_ci .val = PMX_UART5_PL_70_VAL, 16448c2ecf20Sopenharmony_ci }, { 16458c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 16468c2ecf20Sopenharmony_ci .mask = PMX_UART5_PORT_SEL_MASK, 16478c2ecf20Sopenharmony_ci .val = PMX_UART5_PORT_69_VAL, 16488c2ecf20Sopenharmony_ci }, 16498c2ecf20Sopenharmony_ci}; 16508c2ecf20Sopenharmony_ci 16518c2ecf20Sopenharmony_cistatic struct spear_muxreg uart5_ext_90_91_muxreg[] = { 16528c2ecf20Sopenharmony_ci { 16538c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_90_99_REG, 16548c2ecf20Sopenharmony_ci .mask = PMX_PL_90_91_MASK, 16558c2ecf20Sopenharmony_ci .val = PMX_UART5_PL_90_91_VAL, 16568c2ecf20Sopenharmony_ci }, { 16578c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 16588c2ecf20Sopenharmony_ci .mask = PMX_UART5_PORT_SEL_MASK, 16598c2ecf20Sopenharmony_ci .val = PMX_UART5_PORT_90_VAL, 16608c2ecf20Sopenharmony_ci }, 16618c2ecf20Sopenharmony_ci}; 16628c2ecf20Sopenharmony_ci 16638c2ecf20Sopenharmony_cistatic struct spear_modemux uart5_modemux[][1] = { 16648c2ecf20Sopenharmony_ci { 16658c2ecf20Sopenharmony_ci /* Select signals on pins 4_5 */ 16668c2ecf20Sopenharmony_ci { 16678c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 16688c2ecf20Sopenharmony_ci .muxregs = uart5_ext_4_5_muxreg, 16698c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart5_ext_4_5_muxreg), 16708c2ecf20Sopenharmony_ci }, 16718c2ecf20Sopenharmony_ci }, { 16728c2ecf20Sopenharmony_ci /* Select signals on pins 37_38 */ 16738c2ecf20Sopenharmony_ci { 16748c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 16758c2ecf20Sopenharmony_ci .muxregs = uart5_ext_37_38_muxreg, 16768c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart5_ext_37_38_muxreg), 16778c2ecf20Sopenharmony_ci }, 16788c2ecf20Sopenharmony_ci }, { 16798c2ecf20Sopenharmony_ci /* Select signals on pins 69_70 */ 16808c2ecf20Sopenharmony_ci { 16818c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 16828c2ecf20Sopenharmony_ci .muxregs = uart5_ext_69_70_muxreg, 16838c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart5_ext_69_70_muxreg), 16848c2ecf20Sopenharmony_ci }, 16858c2ecf20Sopenharmony_ci }, { 16868c2ecf20Sopenharmony_ci /* Select signals on pins 90_91 */ 16878c2ecf20Sopenharmony_ci { 16888c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 16898c2ecf20Sopenharmony_ci .muxregs = uart5_ext_90_91_muxreg, 16908c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart5_ext_90_91_muxreg), 16918c2ecf20Sopenharmony_ci }, 16928c2ecf20Sopenharmony_ci }, 16938c2ecf20Sopenharmony_ci}; 16948c2ecf20Sopenharmony_ci 16958c2ecf20Sopenharmony_cistatic struct spear_pingroup uart5_pingroup[] = { 16968c2ecf20Sopenharmony_ci { 16978c2ecf20Sopenharmony_ci .name = "uart5_4_5_grp", 16988c2ecf20Sopenharmony_ci .pins = uart5_pins[0], 16998c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(uart5_pins[0]), 17008c2ecf20Sopenharmony_ci .modemuxs = uart5_modemux[0], 17018c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(uart5_modemux[0]), 17028c2ecf20Sopenharmony_ci }, { 17038c2ecf20Sopenharmony_ci .name = "uart5_37_38_grp", 17048c2ecf20Sopenharmony_ci .pins = uart5_pins[1], 17058c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(uart5_pins[1]), 17068c2ecf20Sopenharmony_ci .modemuxs = uart5_modemux[1], 17078c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(uart5_modemux[1]), 17088c2ecf20Sopenharmony_ci }, { 17098c2ecf20Sopenharmony_ci .name = "uart5_69_70_grp", 17108c2ecf20Sopenharmony_ci .pins = uart5_pins[2], 17118c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(uart5_pins[2]), 17128c2ecf20Sopenharmony_ci .modemuxs = uart5_modemux[2], 17138c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(uart5_modemux[2]), 17148c2ecf20Sopenharmony_ci }, { 17158c2ecf20Sopenharmony_ci .name = "uart5_90_91_grp", 17168c2ecf20Sopenharmony_ci .pins = uart5_pins[3], 17178c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(uart5_pins[3]), 17188c2ecf20Sopenharmony_ci .modemuxs = uart5_modemux[3], 17198c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(uart5_modemux[3]), 17208c2ecf20Sopenharmony_ci }, 17218c2ecf20Sopenharmony_ci}; 17228c2ecf20Sopenharmony_ci 17238c2ecf20Sopenharmony_cistatic const char *const uart5_grps[] = { "uart5_4_5_grp", "uart5_37_38_grp", 17248c2ecf20Sopenharmony_ci "uart5_69_70_grp", "uart5_90_91_grp" }; 17258c2ecf20Sopenharmony_cistatic struct spear_function uart5_function = { 17268c2ecf20Sopenharmony_ci .name = "uart5", 17278c2ecf20Sopenharmony_ci .groups = uart5_grps, 17288c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(uart5_grps), 17298c2ecf20Sopenharmony_ci}; 17308c2ecf20Sopenharmony_ci 17318c2ecf20Sopenharmony_ci/* Pad multiplexing for uart6 device */ 17328c2ecf20Sopenharmony_cistatic const unsigned uart6_pins[][2] = { { 2, 3 }, { 88, 89 } }; 17338c2ecf20Sopenharmony_cistatic struct spear_muxreg uart6_ext_2_3_muxreg[] = { 17348c2ecf20Sopenharmony_ci { 17358c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 17368c2ecf20Sopenharmony_ci .mask = PMX_UART0_MASK, 17378c2ecf20Sopenharmony_ci .val = 0, 17388c2ecf20Sopenharmony_ci }, { 17398c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_0_9_REG, 17408c2ecf20Sopenharmony_ci .mask = PMX_PL_2_3_MASK, 17418c2ecf20Sopenharmony_ci .val = PMX_UART6_PL_2_3_VAL, 17428c2ecf20Sopenharmony_ci }, { 17438c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 17448c2ecf20Sopenharmony_ci .mask = PMX_UART6_PORT_SEL_MASK, 17458c2ecf20Sopenharmony_ci .val = PMX_UART6_PORT_2_VAL, 17468c2ecf20Sopenharmony_ci }, 17478c2ecf20Sopenharmony_ci}; 17488c2ecf20Sopenharmony_ci 17498c2ecf20Sopenharmony_cistatic struct spear_muxreg uart6_ext_88_89_muxreg[] = { 17508c2ecf20Sopenharmony_ci { 17518c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_80_89_REG, 17528c2ecf20Sopenharmony_ci .mask = PMX_PL_88_89_MASK, 17538c2ecf20Sopenharmony_ci .val = PMX_UART6_PL_88_89_VAL, 17548c2ecf20Sopenharmony_ci }, { 17558c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 17568c2ecf20Sopenharmony_ci .mask = PMX_UART6_PORT_SEL_MASK, 17578c2ecf20Sopenharmony_ci .val = PMX_UART6_PORT_88_VAL, 17588c2ecf20Sopenharmony_ci }, 17598c2ecf20Sopenharmony_ci}; 17608c2ecf20Sopenharmony_ci 17618c2ecf20Sopenharmony_cistatic struct spear_modemux uart6_modemux[][1] = { 17628c2ecf20Sopenharmony_ci { 17638c2ecf20Sopenharmony_ci /* Select signals on pins 2_3 */ 17648c2ecf20Sopenharmony_ci { 17658c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 17668c2ecf20Sopenharmony_ci .muxregs = uart6_ext_2_3_muxreg, 17678c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart6_ext_2_3_muxreg), 17688c2ecf20Sopenharmony_ci }, 17698c2ecf20Sopenharmony_ci }, { 17708c2ecf20Sopenharmony_ci /* Select signals on pins 88_89 */ 17718c2ecf20Sopenharmony_ci { 17728c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 17738c2ecf20Sopenharmony_ci .muxregs = uart6_ext_88_89_muxreg, 17748c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(uart6_ext_88_89_muxreg), 17758c2ecf20Sopenharmony_ci }, 17768c2ecf20Sopenharmony_ci }, 17778c2ecf20Sopenharmony_ci}; 17788c2ecf20Sopenharmony_ci 17798c2ecf20Sopenharmony_cistatic struct spear_pingroup uart6_pingroup[] = { 17808c2ecf20Sopenharmony_ci { 17818c2ecf20Sopenharmony_ci .name = "uart6_2_3_grp", 17828c2ecf20Sopenharmony_ci .pins = uart6_pins[0], 17838c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(uart6_pins[0]), 17848c2ecf20Sopenharmony_ci .modemuxs = uart6_modemux[0], 17858c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(uart6_modemux[0]), 17868c2ecf20Sopenharmony_ci }, { 17878c2ecf20Sopenharmony_ci .name = "uart6_88_89_grp", 17888c2ecf20Sopenharmony_ci .pins = uart6_pins[1], 17898c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(uart6_pins[1]), 17908c2ecf20Sopenharmony_ci .modemuxs = uart6_modemux[1], 17918c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(uart6_modemux[1]), 17928c2ecf20Sopenharmony_ci }, 17938c2ecf20Sopenharmony_ci}; 17948c2ecf20Sopenharmony_ci 17958c2ecf20Sopenharmony_cistatic const char *const uart6_grps[] = { "uart6_2_3_grp", "uart6_88_89_grp" }; 17968c2ecf20Sopenharmony_cistatic struct spear_function uart6_function = { 17978c2ecf20Sopenharmony_ci .name = "uart6", 17988c2ecf20Sopenharmony_ci .groups = uart6_grps, 17998c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(uart6_grps), 18008c2ecf20Sopenharmony_ci}; 18018c2ecf20Sopenharmony_ci 18028c2ecf20Sopenharmony_ci/* UART - RS485 pmx */ 18038c2ecf20Sopenharmony_cistatic const unsigned rs485_pins[] = { 77, 78, 79 }; 18048c2ecf20Sopenharmony_cistatic struct spear_muxreg rs485_muxreg[] = { 18058c2ecf20Sopenharmony_ci { 18068c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_70_79_REG, 18078c2ecf20Sopenharmony_ci .mask = PMX_PL_77_78_79_MASK, 18088c2ecf20Sopenharmony_ci .val = PMX_RS485_PL_77_78_79_VAL, 18098c2ecf20Sopenharmony_ci }, 18108c2ecf20Sopenharmony_ci}; 18118c2ecf20Sopenharmony_ci 18128c2ecf20Sopenharmony_cistatic struct spear_modemux rs485_modemux[] = { 18138c2ecf20Sopenharmony_ci { 18148c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 18158c2ecf20Sopenharmony_ci .muxregs = rs485_muxreg, 18168c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(rs485_muxreg), 18178c2ecf20Sopenharmony_ci }, 18188c2ecf20Sopenharmony_ci}; 18198c2ecf20Sopenharmony_ci 18208c2ecf20Sopenharmony_cistatic struct spear_pingroup rs485_pingroup = { 18218c2ecf20Sopenharmony_ci .name = "rs485_grp", 18228c2ecf20Sopenharmony_ci .pins = rs485_pins, 18238c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(rs485_pins), 18248c2ecf20Sopenharmony_ci .modemuxs = rs485_modemux, 18258c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(rs485_modemux), 18268c2ecf20Sopenharmony_ci}; 18278c2ecf20Sopenharmony_ci 18288c2ecf20Sopenharmony_cistatic const char *const rs485_grps[] = { "rs485_grp" }; 18298c2ecf20Sopenharmony_cistatic struct spear_function rs485_function = { 18308c2ecf20Sopenharmony_ci .name = "rs485", 18318c2ecf20Sopenharmony_ci .groups = rs485_grps, 18328c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(rs485_grps), 18338c2ecf20Sopenharmony_ci}; 18348c2ecf20Sopenharmony_ci 18358c2ecf20Sopenharmony_ci/* Pad multiplexing for Touchscreen device */ 18368c2ecf20Sopenharmony_cistatic const unsigned touchscreen_pins[] = { 5, 36 }; 18378c2ecf20Sopenharmony_cistatic struct spear_muxreg touchscreen_muxreg[] = { 18388c2ecf20Sopenharmony_ci { 18398c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 18408c2ecf20Sopenharmony_ci .mask = PMX_I2C_MASK | PMX_SSP_CS_MASK, 18418c2ecf20Sopenharmony_ci .val = 0, 18428c2ecf20Sopenharmony_ci }, 18438c2ecf20Sopenharmony_ci}; 18448c2ecf20Sopenharmony_ci 18458c2ecf20Sopenharmony_cistatic struct spear_muxreg touchscreen_ext_muxreg[] = { 18468c2ecf20Sopenharmony_ci { 18478c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_0_9_REG, 18488c2ecf20Sopenharmony_ci .mask = PMX_PL_5_MASK, 18498c2ecf20Sopenharmony_ci .val = PMX_TOUCH_Y_PL_5_VAL, 18508c2ecf20Sopenharmony_ci }, { 18518c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_30_39_REG, 18528c2ecf20Sopenharmony_ci .mask = PMX_PL_36_MASK, 18538c2ecf20Sopenharmony_ci .val = PMX_TOUCH_X_PL_36_VAL, 18548c2ecf20Sopenharmony_ci }, 18558c2ecf20Sopenharmony_ci}; 18568c2ecf20Sopenharmony_ci 18578c2ecf20Sopenharmony_cistatic struct spear_modemux touchscreen_modemux[] = { 18588c2ecf20Sopenharmony_ci { 18598c2ecf20Sopenharmony_ci .modes = AUTO_NET_SMII_MODE | EXTENDED_MODE, 18608c2ecf20Sopenharmony_ci .muxregs = touchscreen_muxreg, 18618c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(touchscreen_muxreg), 18628c2ecf20Sopenharmony_ci }, { 18638c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 18648c2ecf20Sopenharmony_ci .muxregs = touchscreen_ext_muxreg, 18658c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(touchscreen_ext_muxreg), 18668c2ecf20Sopenharmony_ci }, 18678c2ecf20Sopenharmony_ci}; 18688c2ecf20Sopenharmony_ci 18698c2ecf20Sopenharmony_cistatic struct spear_pingroup touchscreen_pingroup = { 18708c2ecf20Sopenharmony_ci .name = "touchscreen_grp", 18718c2ecf20Sopenharmony_ci .pins = touchscreen_pins, 18728c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(touchscreen_pins), 18738c2ecf20Sopenharmony_ci .modemuxs = touchscreen_modemux, 18748c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(touchscreen_modemux), 18758c2ecf20Sopenharmony_ci}; 18768c2ecf20Sopenharmony_ci 18778c2ecf20Sopenharmony_cistatic const char *const touchscreen_grps[] = { "touchscreen_grp" }; 18788c2ecf20Sopenharmony_cistatic struct spear_function touchscreen_function = { 18798c2ecf20Sopenharmony_ci .name = "touchscreen", 18808c2ecf20Sopenharmony_ci .groups = touchscreen_grps, 18818c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(touchscreen_grps), 18828c2ecf20Sopenharmony_ci}; 18838c2ecf20Sopenharmony_ci 18848c2ecf20Sopenharmony_ci/* Pad multiplexing for CAN device */ 18858c2ecf20Sopenharmony_cistatic const unsigned can0_pins[] = { 32, 33 }; 18868c2ecf20Sopenharmony_cistatic struct spear_muxreg can0_muxreg[] = { 18878c2ecf20Sopenharmony_ci { 18888c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 18898c2ecf20Sopenharmony_ci .mask = PMX_GPIO_PIN4_MASK | PMX_GPIO_PIN5_MASK, 18908c2ecf20Sopenharmony_ci .val = 0, 18918c2ecf20Sopenharmony_ci }, 18928c2ecf20Sopenharmony_ci}; 18938c2ecf20Sopenharmony_ci 18948c2ecf20Sopenharmony_cistatic struct spear_muxreg can0_ext_muxreg[] = { 18958c2ecf20Sopenharmony_ci { 18968c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_30_39_REG, 18978c2ecf20Sopenharmony_ci .mask = PMX_PL_32_33_MASK, 18988c2ecf20Sopenharmony_ci .val = PMX_CAN0_PL_32_33_VAL, 18998c2ecf20Sopenharmony_ci }, 19008c2ecf20Sopenharmony_ci}; 19018c2ecf20Sopenharmony_ci 19028c2ecf20Sopenharmony_cistatic struct spear_modemux can0_modemux[] = { 19038c2ecf20Sopenharmony_ci { 19048c2ecf20Sopenharmony_ci .modes = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE | AUTO_EXP_MODE 19058c2ecf20Sopenharmony_ci | EXTENDED_MODE, 19068c2ecf20Sopenharmony_ci .muxregs = can0_muxreg, 19078c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(can0_muxreg), 19088c2ecf20Sopenharmony_ci }, { 19098c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 19108c2ecf20Sopenharmony_ci .muxregs = can0_ext_muxreg, 19118c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(can0_ext_muxreg), 19128c2ecf20Sopenharmony_ci }, 19138c2ecf20Sopenharmony_ci}; 19148c2ecf20Sopenharmony_ci 19158c2ecf20Sopenharmony_cistatic struct spear_pingroup can0_pingroup = { 19168c2ecf20Sopenharmony_ci .name = "can0_grp", 19178c2ecf20Sopenharmony_ci .pins = can0_pins, 19188c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(can0_pins), 19198c2ecf20Sopenharmony_ci .modemuxs = can0_modemux, 19208c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(can0_modemux), 19218c2ecf20Sopenharmony_ci}; 19228c2ecf20Sopenharmony_ci 19238c2ecf20Sopenharmony_cistatic const char *const can0_grps[] = { "can0_grp" }; 19248c2ecf20Sopenharmony_cistatic struct spear_function can0_function = { 19258c2ecf20Sopenharmony_ci .name = "can0", 19268c2ecf20Sopenharmony_ci .groups = can0_grps, 19278c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(can0_grps), 19288c2ecf20Sopenharmony_ci}; 19298c2ecf20Sopenharmony_ci 19308c2ecf20Sopenharmony_cistatic const unsigned can1_pins[] = { 30, 31 }; 19318c2ecf20Sopenharmony_cistatic struct spear_muxreg can1_muxreg[] = { 19328c2ecf20Sopenharmony_ci { 19338c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 19348c2ecf20Sopenharmony_ci .mask = PMX_GPIO_PIN2_MASK | PMX_GPIO_PIN3_MASK, 19358c2ecf20Sopenharmony_ci .val = 0, 19368c2ecf20Sopenharmony_ci }, 19378c2ecf20Sopenharmony_ci}; 19388c2ecf20Sopenharmony_ci 19398c2ecf20Sopenharmony_cistatic struct spear_muxreg can1_ext_muxreg[] = { 19408c2ecf20Sopenharmony_ci { 19418c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_30_39_REG, 19428c2ecf20Sopenharmony_ci .mask = PMX_PL_30_31_MASK, 19438c2ecf20Sopenharmony_ci .val = PMX_CAN1_PL_30_31_VAL, 19448c2ecf20Sopenharmony_ci }, 19458c2ecf20Sopenharmony_ci}; 19468c2ecf20Sopenharmony_ci 19478c2ecf20Sopenharmony_cistatic struct spear_modemux can1_modemux[] = { 19488c2ecf20Sopenharmony_ci { 19498c2ecf20Sopenharmony_ci .modes = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE | AUTO_EXP_MODE 19508c2ecf20Sopenharmony_ci | EXTENDED_MODE, 19518c2ecf20Sopenharmony_ci .muxregs = can1_muxreg, 19528c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(can1_muxreg), 19538c2ecf20Sopenharmony_ci }, { 19548c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 19558c2ecf20Sopenharmony_ci .muxregs = can1_ext_muxreg, 19568c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(can1_ext_muxreg), 19578c2ecf20Sopenharmony_ci }, 19588c2ecf20Sopenharmony_ci}; 19598c2ecf20Sopenharmony_ci 19608c2ecf20Sopenharmony_cistatic struct spear_pingroup can1_pingroup = { 19618c2ecf20Sopenharmony_ci .name = "can1_grp", 19628c2ecf20Sopenharmony_ci .pins = can1_pins, 19638c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(can1_pins), 19648c2ecf20Sopenharmony_ci .modemuxs = can1_modemux, 19658c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(can1_modemux), 19668c2ecf20Sopenharmony_ci}; 19678c2ecf20Sopenharmony_ci 19688c2ecf20Sopenharmony_cistatic const char *const can1_grps[] = { "can1_grp" }; 19698c2ecf20Sopenharmony_cistatic struct spear_function can1_function = { 19708c2ecf20Sopenharmony_ci .name = "can1", 19718c2ecf20Sopenharmony_ci .groups = can1_grps, 19728c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(can1_grps), 19738c2ecf20Sopenharmony_ci}; 19748c2ecf20Sopenharmony_ci 19758c2ecf20Sopenharmony_ci/* Pad multiplexing for PWM0_1 device */ 19768c2ecf20Sopenharmony_cistatic const unsigned pwm0_1_pins[][2] = { { 37, 38 }, { 14, 15 }, { 8, 9 }, 19778c2ecf20Sopenharmony_ci { 30, 31 }, { 42, 43 }, { 59, 60 }, { 88, 89 } }; 19788c2ecf20Sopenharmony_ci 19798c2ecf20Sopenharmony_cistatic struct spear_muxreg pwm0_1_pin_8_9_muxreg[] = { 19808c2ecf20Sopenharmony_ci { 19818c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 19828c2ecf20Sopenharmony_ci .mask = PMX_SSP_MASK, 19838c2ecf20Sopenharmony_ci .val = 0, 19848c2ecf20Sopenharmony_ci }, { 19858c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_0_9_REG, 19868c2ecf20Sopenharmony_ci .mask = PMX_PL_8_9_MASK, 19878c2ecf20Sopenharmony_ci .val = PMX_PWM_0_1_PL_8_9_VAL, 19888c2ecf20Sopenharmony_ci }, 19898c2ecf20Sopenharmony_ci}; 19908c2ecf20Sopenharmony_ci 19918c2ecf20Sopenharmony_cistatic struct spear_muxreg pwm0_1_autoexpsmallpri_muxreg[] = { 19928c2ecf20Sopenharmony_ci { 19938c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 19948c2ecf20Sopenharmony_ci .mask = PMX_MII_MASK, 19958c2ecf20Sopenharmony_ci .val = 0, 19968c2ecf20Sopenharmony_ci }, 19978c2ecf20Sopenharmony_ci}; 19988c2ecf20Sopenharmony_ci 19998c2ecf20Sopenharmony_cistatic struct spear_muxreg pwm0_1_pin_14_15_muxreg[] = { 20008c2ecf20Sopenharmony_ci { 20018c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_10_19_REG, 20028c2ecf20Sopenharmony_ci .mask = PMX_PL_14_MASK | PMX_PL_15_MASK, 20038c2ecf20Sopenharmony_ci .val = PMX_PWM1_PL_14_VAL | PMX_PWM0_PL_15_VAL, 20048c2ecf20Sopenharmony_ci }, 20058c2ecf20Sopenharmony_ci}; 20068c2ecf20Sopenharmony_ci 20078c2ecf20Sopenharmony_cistatic struct spear_muxreg pwm0_1_pin_30_31_muxreg[] = { 20088c2ecf20Sopenharmony_ci { 20098c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 20108c2ecf20Sopenharmony_ci .mask = PMX_GPIO_PIN2_MASK | PMX_GPIO_PIN3_MASK, 20118c2ecf20Sopenharmony_ci .val = 0, 20128c2ecf20Sopenharmony_ci }, { 20138c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_30_39_REG, 20148c2ecf20Sopenharmony_ci .mask = PMX_PL_30_MASK | PMX_PL_31_MASK, 20158c2ecf20Sopenharmony_ci .val = PMX_PWM1_EXT_PL_30_VAL | PMX_PWM0_EXT_PL_31_VAL, 20168c2ecf20Sopenharmony_ci }, 20178c2ecf20Sopenharmony_ci}; 20188c2ecf20Sopenharmony_ci 20198c2ecf20Sopenharmony_cistatic struct spear_muxreg pwm0_1_net_muxreg[] = { 20208c2ecf20Sopenharmony_ci { 20218c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 20228c2ecf20Sopenharmony_ci .mask = PMX_UART0_MODEM_MASK, 20238c2ecf20Sopenharmony_ci .val = 0, 20248c2ecf20Sopenharmony_ci }, 20258c2ecf20Sopenharmony_ci}; 20268c2ecf20Sopenharmony_ci 20278c2ecf20Sopenharmony_cistatic struct spear_muxreg pwm0_1_pin_37_38_muxreg[] = { 20288c2ecf20Sopenharmony_ci { 20298c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_30_39_REG, 20308c2ecf20Sopenharmony_ci .mask = PMX_PL_37_38_MASK, 20318c2ecf20Sopenharmony_ci .val = PMX_PWM0_1_PL_37_38_VAL, 20328c2ecf20Sopenharmony_ci }, 20338c2ecf20Sopenharmony_ci}; 20348c2ecf20Sopenharmony_ci 20358c2ecf20Sopenharmony_cistatic struct spear_muxreg pwm0_1_pin_42_43_muxreg[] = { 20368c2ecf20Sopenharmony_ci { 20378c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 20388c2ecf20Sopenharmony_ci .mask = PMX_UART0_MODEM_MASK | PMX_TIMER_0_1_MASK , 20398c2ecf20Sopenharmony_ci .val = 0, 20408c2ecf20Sopenharmony_ci }, { 20418c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_40_49_REG, 20428c2ecf20Sopenharmony_ci .mask = PMX_PL_42_MASK | PMX_PL_43_MASK, 20438c2ecf20Sopenharmony_ci .val = PMX_PWM1_PL_42_VAL | 20448c2ecf20Sopenharmony_ci PMX_PWM0_PL_43_VAL, 20458c2ecf20Sopenharmony_ci }, 20468c2ecf20Sopenharmony_ci}; 20478c2ecf20Sopenharmony_ci 20488c2ecf20Sopenharmony_cistatic struct spear_muxreg pwm0_1_pin_59_60_muxreg[] = { 20498c2ecf20Sopenharmony_ci { 20508c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_50_59_REG, 20518c2ecf20Sopenharmony_ci .mask = PMX_PL_59_MASK, 20528c2ecf20Sopenharmony_ci .val = PMX_PWM1_PL_59_VAL, 20538c2ecf20Sopenharmony_ci }, { 20548c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_60_69_REG, 20558c2ecf20Sopenharmony_ci .mask = PMX_PL_60_MASK, 20568c2ecf20Sopenharmony_ci .val = PMX_PWM0_PL_60_VAL, 20578c2ecf20Sopenharmony_ci }, 20588c2ecf20Sopenharmony_ci}; 20598c2ecf20Sopenharmony_ci 20608c2ecf20Sopenharmony_cistatic struct spear_muxreg pwm0_1_pin_88_89_muxreg[] = { 20618c2ecf20Sopenharmony_ci { 20628c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_80_89_REG, 20638c2ecf20Sopenharmony_ci .mask = PMX_PL_88_89_MASK, 20648c2ecf20Sopenharmony_ci .val = PMX_PWM0_1_PL_88_89_VAL, 20658c2ecf20Sopenharmony_ci }, 20668c2ecf20Sopenharmony_ci}; 20678c2ecf20Sopenharmony_ci 20688c2ecf20Sopenharmony_cistatic struct spear_modemux pwm0_1_pin_8_9_modemux[] = { 20698c2ecf20Sopenharmony_ci { 20708c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 20718c2ecf20Sopenharmony_ci .muxregs = pwm0_1_pin_8_9_muxreg, 20728c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(pwm0_1_pin_8_9_muxreg), 20738c2ecf20Sopenharmony_ci }, 20748c2ecf20Sopenharmony_ci}; 20758c2ecf20Sopenharmony_ci 20768c2ecf20Sopenharmony_cistatic struct spear_modemux pwm0_1_pin_14_15_modemux[] = { 20778c2ecf20Sopenharmony_ci { 20788c2ecf20Sopenharmony_ci .modes = AUTO_EXP_MODE | SMALL_PRINTERS_MODE | EXTENDED_MODE, 20798c2ecf20Sopenharmony_ci .muxregs = pwm0_1_autoexpsmallpri_muxreg, 20808c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(pwm0_1_autoexpsmallpri_muxreg), 20818c2ecf20Sopenharmony_ci }, { 20828c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 20838c2ecf20Sopenharmony_ci .muxregs = pwm0_1_pin_14_15_muxreg, 20848c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(pwm0_1_pin_14_15_muxreg), 20858c2ecf20Sopenharmony_ci }, 20868c2ecf20Sopenharmony_ci}; 20878c2ecf20Sopenharmony_ci 20888c2ecf20Sopenharmony_cistatic struct spear_modemux pwm0_1_pin_30_31_modemux[] = { 20898c2ecf20Sopenharmony_ci { 20908c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 20918c2ecf20Sopenharmony_ci .muxregs = pwm0_1_pin_30_31_muxreg, 20928c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(pwm0_1_pin_30_31_muxreg), 20938c2ecf20Sopenharmony_ci }, 20948c2ecf20Sopenharmony_ci}; 20958c2ecf20Sopenharmony_ci 20968c2ecf20Sopenharmony_cistatic struct spear_modemux pwm0_1_pin_37_38_modemux[] = { 20978c2ecf20Sopenharmony_ci { 20988c2ecf20Sopenharmony_ci .modes = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE | EXTENDED_MODE, 20998c2ecf20Sopenharmony_ci .muxregs = pwm0_1_net_muxreg, 21008c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(pwm0_1_net_muxreg), 21018c2ecf20Sopenharmony_ci }, { 21028c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 21038c2ecf20Sopenharmony_ci .muxregs = pwm0_1_pin_37_38_muxreg, 21048c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(pwm0_1_pin_37_38_muxreg), 21058c2ecf20Sopenharmony_ci }, 21068c2ecf20Sopenharmony_ci}; 21078c2ecf20Sopenharmony_ci 21088c2ecf20Sopenharmony_cistatic struct spear_modemux pwm0_1_pin_42_43_modemux[] = { 21098c2ecf20Sopenharmony_ci { 21108c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 21118c2ecf20Sopenharmony_ci .muxregs = pwm0_1_pin_42_43_muxreg, 21128c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(pwm0_1_pin_42_43_muxreg), 21138c2ecf20Sopenharmony_ci }, 21148c2ecf20Sopenharmony_ci}; 21158c2ecf20Sopenharmony_ci 21168c2ecf20Sopenharmony_cistatic struct spear_modemux pwm0_1_pin_59_60_modemux[] = { 21178c2ecf20Sopenharmony_ci { 21188c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 21198c2ecf20Sopenharmony_ci .muxregs = pwm0_1_pin_59_60_muxreg, 21208c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(pwm0_1_pin_59_60_muxreg), 21218c2ecf20Sopenharmony_ci }, 21228c2ecf20Sopenharmony_ci}; 21238c2ecf20Sopenharmony_ci 21248c2ecf20Sopenharmony_cistatic struct spear_modemux pwm0_1_pin_88_89_modemux[] = { 21258c2ecf20Sopenharmony_ci { 21268c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 21278c2ecf20Sopenharmony_ci .muxregs = pwm0_1_pin_88_89_muxreg, 21288c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(pwm0_1_pin_88_89_muxreg), 21298c2ecf20Sopenharmony_ci }, 21308c2ecf20Sopenharmony_ci}; 21318c2ecf20Sopenharmony_ci 21328c2ecf20Sopenharmony_cistatic struct spear_pingroup pwm0_1_pingroup[] = { 21338c2ecf20Sopenharmony_ci { 21348c2ecf20Sopenharmony_ci .name = "pwm0_1_pin_8_9_grp", 21358c2ecf20Sopenharmony_ci .pins = pwm0_1_pins[0], 21368c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(pwm0_1_pins[0]), 21378c2ecf20Sopenharmony_ci .modemuxs = pwm0_1_pin_8_9_modemux, 21388c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(pwm0_1_pin_8_9_modemux), 21398c2ecf20Sopenharmony_ci }, { 21408c2ecf20Sopenharmony_ci .name = "pwm0_1_pin_14_15_grp", 21418c2ecf20Sopenharmony_ci .pins = pwm0_1_pins[1], 21428c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(pwm0_1_pins[1]), 21438c2ecf20Sopenharmony_ci .modemuxs = pwm0_1_pin_14_15_modemux, 21448c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(pwm0_1_pin_14_15_modemux), 21458c2ecf20Sopenharmony_ci }, { 21468c2ecf20Sopenharmony_ci .name = "pwm0_1_pin_30_31_grp", 21478c2ecf20Sopenharmony_ci .pins = pwm0_1_pins[2], 21488c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(pwm0_1_pins[2]), 21498c2ecf20Sopenharmony_ci .modemuxs = pwm0_1_pin_30_31_modemux, 21508c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(pwm0_1_pin_30_31_modemux), 21518c2ecf20Sopenharmony_ci }, { 21528c2ecf20Sopenharmony_ci .name = "pwm0_1_pin_37_38_grp", 21538c2ecf20Sopenharmony_ci .pins = pwm0_1_pins[3], 21548c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(pwm0_1_pins[3]), 21558c2ecf20Sopenharmony_ci .modemuxs = pwm0_1_pin_37_38_modemux, 21568c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(pwm0_1_pin_37_38_modemux), 21578c2ecf20Sopenharmony_ci }, { 21588c2ecf20Sopenharmony_ci .name = "pwm0_1_pin_42_43_grp", 21598c2ecf20Sopenharmony_ci .pins = pwm0_1_pins[4], 21608c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(pwm0_1_pins[4]), 21618c2ecf20Sopenharmony_ci .modemuxs = pwm0_1_pin_42_43_modemux, 21628c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(pwm0_1_pin_42_43_modemux), 21638c2ecf20Sopenharmony_ci }, { 21648c2ecf20Sopenharmony_ci .name = "pwm0_1_pin_59_60_grp", 21658c2ecf20Sopenharmony_ci .pins = pwm0_1_pins[5], 21668c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(pwm0_1_pins[5]), 21678c2ecf20Sopenharmony_ci .modemuxs = pwm0_1_pin_59_60_modemux, 21688c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(pwm0_1_pin_59_60_modemux), 21698c2ecf20Sopenharmony_ci }, { 21708c2ecf20Sopenharmony_ci .name = "pwm0_1_pin_88_89_grp", 21718c2ecf20Sopenharmony_ci .pins = pwm0_1_pins[6], 21728c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(pwm0_1_pins[6]), 21738c2ecf20Sopenharmony_ci .modemuxs = pwm0_1_pin_88_89_modemux, 21748c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(pwm0_1_pin_88_89_modemux), 21758c2ecf20Sopenharmony_ci }, 21768c2ecf20Sopenharmony_ci}; 21778c2ecf20Sopenharmony_ci 21788c2ecf20Sopenharmony_cistatic const char *const pwm0_1_grps[] = { "pwm0_1_pin_8_9_grp", 21798c2ecf20Sopenharmony_ci "pwm0_1_pin_14_15_grp", "pwm0_1_pin_30_31_grp", "pwm0_1_pin_37_38_grp", 21808c2ecf20Sopenharmony_ci "pwm0_1_pin_42_43_grp", "pwm0_1_pin_59_60_grp", "pwm0_1_pin_88_89_grp" 21818c2ecf20Sopenharmony_ci}; 21828c2ecf20Sopenharmony_ci 21838c2ecf20Sopenharmony_cistatic struct spear_function pwm0_1_function = { 21848c2ecf20Sopenharmony_ci .name = "pwm0_1", 21858c2ecf20Sopenharmony_ci .groups = pwm0_1_grps, 21868c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(pwm0_1_grps), 21878c2ecf20Sopenharmony_ci}; 21888c2ecf20Sopenharmony_ci 21898c2ecf20Sopenharmony_ci/* Pad multiplexing for PWM2 device */ 21908c2ecf20Sopenharmony_cistatic const unsigned pwm2_pins[][1] = { { 7 }, { 13 }, { 29 }, { 34 }, { 41 }, 21918c2ecf20Sopenharmony_ci { 58 }, { 87 } }; 21928c2ecf20Sopenharmony_cistatic struct spear_muxreg pwm2_net_muxreg[] = { 21938c2ecf20Sopenharmony_ci { 21948c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 21958c2ecf20Sopenharmony_ci .mask = PMX_SSP_CS_MASK, 21968c2ecf20Sopenharmony_ci .val = 0, 21978c2ecf20Sopenharmony_ci }, 21988c2ecf20Sopenharmony_ci}; 21998c2ecf20Sopenharmony_ci 22008c2ecf20Sopenharmony_cistatic struct spear_muxreg pwm2_pin_7_muxreg[] = { 22018c2ecf20Sopenharmony_ci { 22028c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_0_9_REG, 22038c2ecf20Sopenharmony_ci .mask = PMX_PL_7_MASK, 22048c2ecf20Sopenharmony_ci .val = PMX_PWM_2_PL_7_VAL, 22058c2ecf20Sopenharmony_ci }, 22068c2ecf20Sopenharmony_ci}; 22078c2ecf20Sopenharmony_ci 22088c2ecf20Sopenharmony_cistatic struct spear_muxreg pwm2_autoexpsmallpri_muxreg[] = { 22098c2ecf20Sopenharmony_ci { 22108c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 22118c2ecf20Sopenharmony_ci .mask = PMX_MII_MASK, 22128c2ecf20Sopenharmony_ci .val = 0, 22138c2ecf20Sopenharmony_ci }, 22148c2ecf20Sopenharmony_ci}; 22158c2ecf20Sopenharmony_ci 22168c2ecf20Sopenharmony_cistatic struct spear_muxreg pwm2_pin_13_muxreg[] = { 22178c2ecf20Sopenharmony_ci { 22188c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_10_19_REG, 22198c2ecf20Sopenharmony_ci .mask = PMX_PL_13_MASK, 22208c2ecf20Sopenharmony_ci .val = PMX_PWM2_PL_13_VAL, 22218c2ecf20Sopenharmony_ci }, 22228c2ecf20Sopenharmony_ci}; 22238c2ecf20Sopenharmony_ci 22248c2ecf20Sopenharmony_cistatic struct spear_muxreg pwm2_pin_29_muxreg[] = { 22258c2ecf20Sopenharmony_ci { 22268c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 22278c2ecf20Sopenharmony_ci .mask = PMX_GPIO_PIN1_MASK, 22288c2ecf20Sopenharmony_ci .val = 0, 22298c2ecf20Sopenharmony_ci }, { 22308c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_20_29_REG, 22318c2ecf20Sopenharmony_ci .mask = PMX_PL_29_MASK, 22328c2ecf20Sopenharmony_ci .val = PMX_PWM_2_PL_29_VAL, 22338c2ecf20Sopenharmony_ci }, 22348c2ecf20Sopenharmony_ci}; 22358c2ecf20Sopenharmony_ci 22368c2ecf20Sopenharmony_cistatic struct spear_muxreg pwm2_pin_34_muxreg[] = { 22378c2ecf20Sopenharmony_ci { 22388c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 22398c2ecf20Sopenharmony_ci .mask = PMX_SSP_CS_MASK, 22408c2ecf20Sopenharmony_ci .val = 0, 22418c2ecf20Sopenharmony_ci }, { 22428c2ecf20Sopenharmony_ci .reg = MODE_CONFIG_REG, 22438c2ecf20Sopenharmony_ci .mask = PMX_PWM_MASK, 22448c2ecf20Sopenharmony_ci .val = PMX_PWM_MASK, 22458c2ecf20Sopenharmony_ci }, { 22468c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_30_39_REG, 22478c2ecf20Sopenharmony_ci .mask = PMX_PL_34_MASK, 22488c2ecf20Sopenharmony_ci .val = PMX_PWM2_PL_34_VAL, 22498c2ecf20Sopenharmony_ci }, 22508c2ecf20Sopenharmony_ci}; 22518c2ecf20Sopenharmony_ci 22528c2ecf20Sopenharmony_cistatic struct spear_muxreg pwm2_pin_41_muxreg[] = { 22538c2ecf20Sopenharmony_ci { 22548c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 22558c2ecf20Sopenharmony_ci .mask = PMX_UART0_MODEM_MASK, 22568c2ecf20Sopenharmony_ci .val = 0, 22578c2ecf20Sopenharmony_ci }, { 22588c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_40_49_REG, 22598c2ecf20Sopenharmony_ci .mask = PMX_PL_41_MASK, 22608c2ecf20Sopenharmony_ci .val = PMX_PWM2_PL_41_VAL, 22618c2ecf20Sopenharmony_ci }, 22628c2ecf20Sopenharmony_ci}; 22638c2ecf20Sopenharmony_ci 22648c2ecf20Sopenharmony_cistatic struct spear_muxreg pwm2_pin_58_muxreg[] = { 22658c2ecf20Sopenharmony_ci { 22668c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_50_59_REG, 22678c2ecf20Sopenharmony_ci .mask = PMX_PL_58_MASK, 22688c2ecf20Sopenharmony_ci .val = PMX_PWM2_PL_58_VAL, 22698c2ecf20Sopenharmony_ci }, 22708c2ecf20Sopenharmony_ci}; 22718c2ecf20Sopenharmony_ci 22728c2ecf20Sopenharmony_cistatic struct spear_muxreg pwm2_pin_87_muxreg[] = { 22738c2ecf20Sopenharmony_ci { 22748c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_80_89_REG, 22758c2ecf20Sopenharmony_ci .mask = PMX_PL_87_MASK, 22768c2ecf20Sopenharmony_ci .val = PMX_PWM2_PL_87_VAL, 22778c2ecf20Sopenharmony_ci }, 22788c2ecf20Sopenharmony_ci}; 22798c2ecf20Sopenharmony_ci 22808c2ecf20Sopenharmony_cistatic struct spear_modemux pwm2_pin_7_modemux[] = { 22818c2ecf20Sopenharmony_ci { 22828c2ecf20Sopenharmony_ci .modes = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE | EXTENDED_MODE, 22838c2ecf20Sopenharmony_ci .muxregs = pwm2_net_muxreg, 22848c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(pwm2_net_muxreg), 22858c2ecf20Sopenharmony_ci }, { 22868c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 22878c2ecf20Sopenharmony_ci .muxregs = pwm2_pin_7_muxreg, 22888c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(pwm2_pin_7_muxreg), 22898c2ecf20Sopenharmony_ci }, 22908c2ecf20Sopenharmony_ci}; 22918c2ecf20Sopenharmony_cistatic struct spear_modemux pwm2_pin_13_modemux[] = { 22928c2ecf20Sopenharmony_ci { 22938c2ecf20Sopenharmony_ci .modes = AUTO_EXP_MODE | SMALL_PRINTERS_MODE | EXTENDED_MODE, 22948c2ecf20Sopenharmony_ci .muxregs = pwm2_autoexpsmallpri_muxreg, 22958c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(pwm2_autoexpsmallpri_muxreg), 22968c2ecf20Sopenharmony_ci }, { 22978c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 22988c2ecf20Sopenharmony_ci .muxregs = pwm2_pin_13_muxreg, 22998c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(pwm2_pin_13_muxreg), 23008c2ecf20Sopenharmony_ci }, 23018c2ecf20Sopenharmony_ci}; 23028c2ecf20Sopenharmony_cistatic struct spear_modemux pwm2_pin_29_modemux[] = { 23038c2ecf20Sopenharmony_ci { 23048c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 23058c2ecf20Sopenharmony_ci .muxregs = pwm2_pin_29_muxreg, 23068c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(pwm2_pin_29_muxreg), 23078c2ecf20Sopenharmony_ci }, 23088c2ecf20Sopenharmony_ci}; 23098c2ecf20Sopenharmony_cistatic struct spear_modemux pwm2_pin_34_modemux[] = { 23108c2ecf20Sopenharmony_ci { 23118c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 23128c2ecf20Sopenharmony_ci .muxregs = pwm2_pin_34_muxreg, 23138c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(pwm2_pin_34_muxreg), 23148c2ecf20Sopenharmony_ci }, 23158c2ecf20Sopenharmony_ci}; 23168c2ecf20Sopenharmony_ci 23178c2ecf20Sopenharmony_cistatic struct spear_modemux pwm2_pin_41_modemux[] = { 23188c2ecf20Sopenharmony_ci { 23198c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 23208c2ecf20Sopenharmony_ci .muxregs = pwm2_pin_41_muxreg, 23218c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(pwm2_pin_41_muxreg), 23228c2ecf20Sopenharmony_ci }, 23238c2ecf20Sopenharmony_ci}; 23248c2ecf20Sopenharmony_ci 23258c2ecf20Sopenharmony_cistatic struct spear_modemux pwm2_pin_58_modemux[] = { 23268c2ecf20Sopenharmony_ci { 23278c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 23288c2ecf20Sopenharmony_ci .muxregs = pwm2_pin_58_muxreg, 23298c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(pwm2_pin_58_muxreg), 23308c2ecf20Sopenharmony_ci }, 23318c2ecf20Sopenharmony_ci}; 23328c2ecf20Sopenharmony_ci 23338c2ecf20Sopenharmony_cistatic struct spear_modemux pwm2_pin_87_modemux[] = { 23348c2ecf20Sopenharmony_ci { 23358c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 23368c2ecf20Sopenharmony_ci .muxregs = pwm2_pin_87_muxreg, 23378c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(pwm2_pin_87_muxreg), 23388c2ecf20Sopenharmony_ci }, 23398c2ecf20Sopenharmony_ci}; 23408c2ecf20Sopenharmony_ci 23418c2ecf20Sopenharmony_cistatic struct spear_pingroup pwm2_pingroup[] = { 23428c2ecf20Sopenharmony_ci { 23438c2ecf20Sopenharmony_ci .name = "pwm2_pin_7_grp", 23448c2ecf20Sopenharmony_ci .pins = pwm2_pins[0], 23458c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(pwm2_pins[0]), 23468c2ecf20Sopenharmony_ci .modemuxs = pwm2_pin_7_modemux, 23478c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(pwm2_pin_7_modemux), 23488c2ecf20Sopenharmony_ci }, { 23498c2ecf20Sopenharmony_ci .name = "pwm2_pin_13_grp", 23508c2ecf20Sopenharmony_ci .pins = pwm2_pins[1], 23518c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(pwm2_pins[1]), 23528c2ecf20Sopenharmony_ci .modemuxs = pwm2_pin_13_modemux, 23538c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(pwm2_pin_13_modemux), 23548c2ecf20Sopenharmony_ci }, { 23558c2ecf20Sopenharmony_ci .name = "pwm2_pin_29_grp", 23568c2ecf20Sopenharmony_ci .pins = pwm2_pins[2], 23578c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(pwm2_pins[2]), 23588c2ecf20Sopenharmony_ci .modemuxs = pwm2_pin_29_modemux, 23598c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(pwm2_pin_29_modemux), 23608c2ecf20Sopenharmony_ci }, { 23618c2ecf20Sopenharmony_ci .name = "pwm2_pin_34_grp", 23628c2ecf20Sopenharmony_ci .pins = pwm2_pins[3], 23638c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(pwm2_pins[3]), 23648c2ecf20Sopenharmony_ci .modemuxs = pwm2_pin_34_modemux, 23658c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(pwm2_pin_34_modemux), 23668c2ecf20Sopenharmony_ci }, { 23678c2ecf20Sopenharmony_ci .name = "pwm2_pin_41_grp", 23688c2ecf20Sopenharmony_ci .pins = pwm2_pins[4], 23698c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(pwm2_pins[4]), 23708c2ecf20Sopenharmony_ci .modemuxs = pwm2_pin_41_modemux, 23718c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(pwm2_pin_41_modemux), 23728c2ecf20Sopenharmony_ci }, { 23738c2ecf20Sopenharmony_ci .name = "pwm2_pin_58_grp", 23748c2ecf20Sopenharmony_ci .pins = pwm2_pins[5], 23758c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(pwm2_pins[5]), 23768c2ecf20Sopenharmony_ci .modemuxs = pwm2_pin_58_modemux, 23778c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(pwm2_pin_58_modemux), 23788c2ecf20Sopenharmony_ci }, { 23798c2ecf20Sopenharmony_ci .name = "pwm2_pin_87_grp", 23808c2ecf20Sopenharmony_ci .pins = pwm2_pins[6], 23818c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(pwm2_pins[6]), 23828c2ecf20Sopenharmony_ci .modemuxs = pwm2_pin_87_modemux, 23838c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(pwm2_pin_87_modemux), 23848c2ecf20Sopenharmony_ci }, 23858c2ecf20Sopenharmony_ci}; 23868c2ecf20Sopenharmony_ci 23878c2ecf20Sopenharmony_cistatic const char *const pwm2_grps[] = { "pwm2_pin_7_grp", "pwm2_pin_13_grp", 23888c2ecf20Sopenharmony_ci "pwm2_pin_29_grp", "pwm2_pin_34_grp", "pwm2_pin_41_grp", 23898c2ecf20Sopenharmony_ci "pwm2_pin_58_grp", "pwm2_pin_87_grp" }; 23908c2ecf20Sopenharmony_cistatic struct spear_function pwm2_function = { 23918c2ecf20Sopenharmony_ci .name = "pwm2", 23928c2ecf20Sopenharmony_ci .groups = pwm2_grps, 23938c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(pwm2_grps), 23948c2ecf20Sopenharmony_ci}; 23958c2ecf20Sopenharmony_ci 23968c2ecf20Sopenharmony_ci/* Pad multiplexing for PWM3 device */ 23978c2ecf20Sopenharmony_cistatic const unsigned pwm3_pins[][1] = { { 6 }, { 12 }, { 28 }, { 40 }, { 57 }, 23988c2ecf20Sopenharmony_ci { 86 } }; 23998c2ecf20Sopenharmony_cistatic struct spear_muxreg pwm3_pin_6_muxreg[] = { 24008c2ecf20Sopenharmony_ci { 24018c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 24028c2ecf20Sopenharmony_ci .mask = PMX_SSP_MASK, 24038c2ecf20Sopenharmony_ci .val = 0, 24048c2ecf20Sopenharmony_ci }, { 24058c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_0_9_REG, 24068c2ecf20Sopenharmony_ci .mask = PMX_PL_6_MASK, 24078c2ecf20Sopenharmony_ci .val = PMX_PWM_3_PL_6_VAL, 24088c2ecf20Sopenharmony_ci }, 24098c2ecf20Sopenharmony_ci}; 24108c2ecf20Sopenharmony_ci 24118c2ecf20Sopenharmony_cistatic struct spear_muxreg pwm3_muxreg[] = { 24128c2ecf20Sopenharmony_ci { 24138c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 24148c2ecf20Sopenharmony_ci .mask = PMX_MII_MASK, 24158c2ecf20Sopenharmony_ci .val = 0, 24168c2ecf20Sopenharmony_ci }, 24178c2ecf20Sopenharmony_ci}; 24188c2ecf20Sopenharmony_ci 24198c2ecf20Sopenharmony_cistatic struct spear_muxreg pwm3_pin_12_muxreg[] = { 24208c2ecf20Sopenharmony_ci { 24218c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_10_19_REG, 24228c2ecf20Sopenharmony_ci .mask = PMX_PL_12_MASK, 24238c2ecf20Sopenharmony_ci .val = PMX_PWM3_PL_12_VAL, 24248c2ecf20Sopenharmony_ci }, 24258c2ecf20Sopenharmony_ci}; 24268c2ecf20Sopenharmony_ci 24278c2ecf20Sopenharmony_cistatic struct spear_muxreg pwm3_pin_28_muxreg[] = { 24288c2ecf20Sopenharmony_ci { 24298c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 24308c2ecf20Sopenharmony_ci .mask = PMX_GPIO_PIN0_MASK, 24318c2ecf20Sopenharmony_ci .val = 0, 24328c2ecf20Sopenharmony_ci }, { 24338c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_20_29_REG, 24348c2ecf20Sopenharmony_ci .mask = PMX_PL_28_MASK, 24358c2ecf20Sopenharmony_ci .val = PMX_PWM_3_PL_28_VAL, 24368c2ecf20Sopenharmony_ci }, 24378c2ecf20Sopenharmony_ci}; 24388c2ecf20Sopenharmony_ci 24398c2ecf20Sopenharmony_cistatic struct spear_muxreg pwm3_pin_40_muxreg[] = { 24408c2ecf20Sopenharmony_ci { 24418c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 24428c2ecf20Sopenharmony_ci .mask = PMX_UART0_MODEM_MASK, 24438c2ecf20Sopenharmony_ci .val = 0, 24448c2ecf20Sopenharmony_ci }, { 24458c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_40_49_REG, 24468c2ecf20Sopenharmony_ci .mask = PMX_PL_40_MASK, 24478c2ecf20Sopenharmony_ci .val = PMX_PWM3_PL_40_VAL, 24488c2ecf20Sopenharmony_ci }, 24498c2ecf20Sopenharmony_ci}; 24508c2ecf20Sopenharmony_ci 24518c2ecf20Sopenharmony_cistatic struct spear_muxreg pwm3_pin_57_muxreg[] = { 24528c2ecf20Sopenharmony_ci { 24538c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_50_59_REG, 24548c2ecf20Sopenharmony_ci .mask = PMX_PL_57_MASK, 24558c2ecf20Sopenharmony_ci .val = PMX_PWM3_PL_57_VAL, 24568c2ecf20Sopenharmony_ci }, 24578c2ecf20Sopenharmony_ci}; 24588c2ecf20Sopenharmony_ci 24598c2ecf20Sopenharmony_cistatic struct spear_muxreg pwm3_pin_86_muxreg[] = { 24608c2ecf20Sopenharmony_ci { 24618c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_80_89_REG, 24628c2ecf20Sopenharmony_ci .mask = PMX_PL_86_MASK, 24638c2ecf20Sopenharmony_ci .val = PMX_PWM3_PL_86_VAL, 24648c2ecf20Sopenharmony_ci }, 24658c2ecf20Sopenharmony_ci}; 24668c2ecf20Sopenharmony_ci 24678c2ecf20Sopenharmony_cistatic struct spear_modemux pwm3_pin_6_modemux[] = { 24688c2ecf20Sopenharmony_ci { 24698c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 24708c2ecf20Sopenharmony_ci .muxregs = pwm3_pin_6_muxreg, 24718c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(pwm3_pin_6_muxreg), 24728c2ecf20Sopenharmony_ci }, 24738c2ecf20Sopenharmony_ci}; 24748c2ecf20Sopenharmony_ci 24758c2ecf20Sopenharmony_cistatic struct spear_modemux pwm3_pin_12_modemux[] = { 24768c2ecf20Sopenharmony_ci { 24778c2ecf20Sopenharmony_ci .modes = AUTO_EXP_MODE | SMALL_PRINTERS_MODE | 24788c2ecf20Sopenharmony_ci AUTO_NET_SMII_MODE | EXTENDED_MODE, 24798c2ecf20Sopenharmony_ci .muxregs = pwm3_muxreg, 24808c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(pwm3_muxreg), 24818c2ecf20Sopenharmony_ci }, { 24828c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 24838c2ecf20Sopenharmony_ci .muxregs = pwm3_pin_12_muxreg, 24848c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(pwm3_pin_12_muxreg), 24858c2ecf20Sopenharmony_ci }, 24868c2ecf20Sopenharmony_ci}; 24878c2ecf20Sopenharmony_ci 24888c2ecf20Sopenharmony_cistatic struct spear_modemux pwm3_pin_28_modemux[] = { 24898c2ecf20Sopenharmony_ci { 24908c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 24918c2ecf20Sopenharmony_ci .muxregs = pwm3_pin_28_muxreg, 24928c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(pwm3_pin_28_muxreg), 24938c2ecf20Sopenharmony_ci }, 24948c2ecf20Sopenharmony_ci}; 24958c2ecf20Sopenharmony_ci 24968c2ecf20Sopenharmony_cistatic struct spear_modemux pwm3_pin_40_modemux[] = { 24978c2ecf20Sopenharmony_ci { 24988c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 24998c2ecf20Sopenharmony_ci .muxregs = pwm3_pin_40_muxreg, 25008c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(pwm3_pin_40_muxreg), 25018c2ecf20Sopenharmony_ci }, 25028c2ecf20Sopenharmony_ci}; 25038c2ecf20Sopenharmony_ci 25048c2ecf20Sopenharmony_cistatic struct spear_modemux pwm3_pin_57_modemux[] = { 25058c2ecf20Sopenharmony_ci { 25068c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 25078c2ecf20Sopenharmony_ci .muxregs = pwm3_pin_57_muxreg, 25088c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(pwm3_pin_57_muxreg), 25098c2ecf20Sopenharmony_ci }, 25108c2ecf20Sopenharmony_ci}; 25118c2ecf20Sopenharmony_ci 25128c2ecf20Sopenharmony_cistatic struct spear_modemux pwm3_pin_86_modemux[] = { 25138c2ecf20Sopenharmony_ci { 25148c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 25158c2ecf20Sopenharmony_ci .muxregs = pwm3_pin_86_muxreg, 25168c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(pwm3_pin_86_muxreg), 25178c2ecf20Sopenharmony_ci }, 25188c2ecf20Sopenharmony_ci}; 25198c2ecf20Sopenharmony_ci 25208c2ecf20Sopenharmony_cistatic struct spear_pingroup pwm3_pingroup[] = { 25218c2ecf20Sopenharmony_ci { 25228c2ecf20Sopenharmony_ci .name = "pwm3_pin_6_grp", 25238c2ecf20Sopenharmony_ci .pins = pwm3_pins[0], 25248c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(pwm3_pins[0]), 25258c2ecf20Sopenharmony_ci .modemuxs = pwm3_pin_6_modemux, 25268c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(pwm3_pin_6_modemux), 25278c2ecf20Sopenharmony_ci }, { 25288c2ecf20Sopenharmony_ci .name = "pwm3_pin_12_grp", 25298c2ecf20Sopenharmony_ci .pins = pwm3_pins[1], 25308c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(pwm3_pins[1]), 25318c2ecf20Sopenharmony_ci .modemuxs = pwm3_pin_12_modemux, 25328c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(pwm3_pin_12_modemux), 25338c2ecf20Sopenharmony_ci }, { 25348c2ecf20Sopenharmony_ci .name = "pwm3_pin_28_grp", 25358c2ecf20Sopenharmony_ci .pins = pwm3_pins[2], 25368c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(pwm3_pins[2]), 25378c2ecf20Sopenharmony_ci .modemuxs = pwm3_pin_28_modemux, 25388c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(pwm3_pin_28_modemux), 25398c2ecf20Sopenharmony_ci }, { 25408c2ecf20Sopenharmony_ci .name = "pwm3_pin_40_grp", 25418c2ecf20Sopenharmony_ci .pins = pwm3_pins[3], 25428c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(pwm3_pins[3]), 25438c2ecf20Sopenharmony_ci .modemuxs = pwm3_pin_40_modemux, 25448c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(pwm3_pin_40_modemux), 25458c2ecf20Sopenharmony_ci }, { 25468c2ecf20Sopenharmony_ci .name = "pwm3_pin_57_grp", 25478c2ecf20Sopenharmony_ci .pins = pwm3_pins[4], 25488c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(pwm3_pins[4]), 25498c2ecf20Sopenharmony_ci .modemuxs = pwm3_pin_57_modemux, 25508c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(pwm3_pin_57_modemux), 25518c2ecf20Sopenharmony_ci }, { 25528c2ecf20Sopenharmony_ci .name = "pwm3_pin_86_grp", 25538c2ecf20Sopenharmony_ci .pins = pwm3_pins[5], 25548c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(pwm3_pins[5]), 25558c2ecf20Sopenharmony_ci .modemuxs = pwm3_pin_86_modemux, 25568c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(pwm3_pin_86_modemux), 25578c2ecf20Sopenharmony_ci }, 25588c2ecf20Sopenharmony_ci}; 25598c2ecf20Sopenharmony_ci 25608c2ecf20Sopenharmony_cistatic const char *const pwm3_grps[] = { "pwm3_pin_6_grp", "pwm3_pin_12_grp", 25618c2ecf20Sopenharmony_ci "pwm3_pin_28_grp", "pwm3_pin_40_grp", "pwm3_pin_57_grp", 25628c2ecf20Sopenharmony_ci "pwm3_pin_86_grp" }; 25638c2ecf20Sopenharmony_cistatic struct spear_function pwm3_function = { 25648c2ecf20Sopenharmony_ci .name = "pwm3", 25658c2ecf20Sopenharmony_ci .groups = pwm3_grps, 25668c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(pwm3_grps), 25678c2ecf20Sopenharmony_ci}; 25688c2ecf20Sopenharmony_ci 25698c2ecf20Sopenharmony_ci/* Pad multiplexing for SSP1 device */ 25708c2ecf20Sopenharmony_cistatic const unsigned ssp1_pins[][2] = { { 17, 20 }, { 36, 39 }, { 48, 51 }, 25718c2ecf20Sopenharmony_ci { 65, 68 }, { 94, 97 } }; 25728c2ecf20Sopenharmony_cistatic struct spear_muxreg ssp1_muxreg[] = { 25738c2ecf20Sopenharmony_ci { 25748c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 25758c2ecf20Sopenharmony_ci .mask = PMX_MII_MASK, 25768c2ecf20Sopenharmony_ci .val = 0, 25778c2ecf20Sopenharmony_ci }, 25788c2ecf20Sopenharmony_ci}; 25798c2ecf20Sopenharmony_ci 25808c2ecf20Sopenharmony_cistatic struct spear_muxreg ssp1_ext_17_20_muxreg[] = { 25818c2ecf20Sopenharmony_ci { 25828c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_10_19_REG, 25838c2ecf20Sopenharmony_ci .mask = PMX_PL_17_18_MASK | PMX_PL_19_MASK, 25848c2ecf20Sopenharmony_ci .val = PMX_SSP1_PL_17_18_19_20_VAL, 25858c2ecf20Sopenharmony_ci }, { 25868c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_20_29_REG, 25878c2ecf20Sopenharmony_ci .mask = PMX_PL_20_MASK, 25888c2ecf20Sopenharmony_ci .val = PMX_SSP1_PL_17_18_19_20_VAL, 25898c2ecf20Sopenharmony_ci }, { 25908c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 25918c2ecf20Sopenharmony_ci .mask = PMX_SSP1_PORT_SEL_MASK, 25928c2ecf20Sopenharmony_ci .val = PMX_SSP1_PORT_17_TO_20_VAL, 25938c2ecf20Sopenharmony_ci }, 25948c2ecf20Sopenharmony_ci}; 25958c2ecf20Sopenharmony_ci 25968c2ecf20Sopenharmony_cistatic struct spear_muxreg ssp1_ext_36_39_muxreg[] = { 25978c2ecf20Sopenharmony_ci { 25988c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 25998c2ecf20Sopenharmony_ci .mask = PMX_UART0_MODEM_MASK | PMX_SSP_CS_MASK, 26008c2ecf20Sopenharmony_ci .val = 0, 26018c2ecf20Sopenharmony_ci }, { 26028c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_30_39_REG, 26038c2ecf20Sopenharmony_ci .mask = PMX_PL_36_MASK | PMX_PL_37_38_MASK | PMX_PL_39_MASK, 26048c2ecf20Sopenharmony_ci .val = PMX_SSP1_PL_36_VAL | PMX_SSP1_PL_37_38_VAL | 26058c2ecf20Sopenharmony_ci PMX_SSP1_PL_39_VAL, 26068c2ecf20Sopenharmony_ci }, { 26078c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 26088c2ecf20Sopenharmony_ci .mask = PMX_SSP1_PORT_SEL_MASK, 26098c2ecf20Sopenharmony_ci .val = PMX_SSP1_PORT_36_TO_39_VAL, 26108c2ecf20Sopenharmony_ci }, 26118c2ecf20Sopenharmony_ci}; 26128c2ecf20Sopenharmony_ci 26138c2ecf20Sopenharmony_cistatic struct spear_muxreg ssp1_ext_48_51_muxreg[] = { 26148c2ecf20Sopenharmony_ci { 26158c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 26168c2ecf20Sopenharmony_ci .mask = PMX_TIMER_0_1_MASK | PMX_TIMER_2_3_MASK, 26178c2ecf20Sopenharmony_ci .val = 0, 26188c2ecf20Sopenharmony_ci }, { 26198c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_40_49_REG, 26208c2ecf20Sopenharmony_ci .mask = PMX_PL_48_49_MASK, 26218c2ecf20Sopenharmony_ci .val = PMX_SSP1_PL_48_49_VAL, 26228c2ecf20Sopenharmony_ci }, { 26238c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_50_59_REG, 26248c2ecf20Sopenharmony_ci .mask = PMX_PL_50_51_MASK, 26258c2ecf20Sopenharmony_ci .val = PMX_SSP1_PL_50_51_VAL, 26268c2ecf20Sopenharmony_ci }, { 26278c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 26288c2ecf20Sopenharmony_ci .mask = PMX_SSP1_PORT_SEL_MASK, 26298c2ecf20Sopenharmony_ci .val = PMX_SSP1_PORT_48_TO_51_VAL, 26308c2ecf20Sopenharmony_ci }, 26318c2ecf20Sopenharmony_ci}; 26328c2ecf20Sopenharmony_ci 26338c2ecf20Sopenharmony_cistatic struct spear_muxreg ssp1_ext_65_68_muxreg[] = { 26348c2ecf20Sopenharmony_ci { 26358c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_60_69_REG, 26368c2ecf20Sopenharmony_ci .mask = PMX_PL_65_TO_68_MASK, 26378c2ecf20Sopenharmony_ci .val = PMX_SSP1_PL_65_TO_68_VAL, 26388c2ecf20Sopenharmony_ci }, { 26398c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 26408c2ecf20Sopenharmony_ci .mask = PMX_SSP1_PORT_SEL_MASK, 26418c2ecf20Sopenharmony_ci .val = PMX_SSP1_PORT_65_TO_68_VAL, 26428c2ecf20Sopenharmony_ci }, 26438c2ecf20Sopenharmony_ci}; 26448c2ecf20Sopenharmony_ci 26458c2ecf20Sopenharmony_cistatic struct spear_muxreg ssp1_ext_94_97_muxreg[] = { 26468c2ecf20Sopenharmony_ci { 26478c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_90_99_REG, 26488c2ecf20Sopenharmony_ci .mask = PMX_PL_94_95_MASK | PMX_PL_96_97_MASK, 26498c2ecf20Sopenharmony_ci .val = PMX_SSP1_PL_94_95_VAL | PMX_SSP1_PL_96_97_VAL, 26508c2ecf20Sopenharmony_ci }, { 26518c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 26528c2ecf20Sopenharmony_ci .mask = PMX_SSP1_PORT_SEL_MASK, 26538c2ecf20Sopenharmony_ci .val = PMX_SSP1_PORT_94_TO_97_VAL, 26548c2ecf20Sopenharmony_ci }, 26558c2ecf20Sopenharmony_ci}; 26568c2ecf20Sopenharmony_ci 26578c2ecf20Sopenharmony_cistatic struct spear_modemux ssp1_17_20_modemux[] = { 26588c2ecf20Sopenharmony_ci { 26598c2ecf20Sopenharmony_ci .modes = SMALL_PRINTERS_MODE | AUTO_NET_SMII_MODE | 26608c2ecf20Sopenharmony_ci EXTENDED_MODE, 26618c2ecf20Sopenharmony_ci .muxregs = ssp1_muxreg, 26628c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(ssp1_muxreg), 26638c2ecf20Sopenharmony_ci }, { 26648c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 26658c2ecf20Sopenharmony_ci .muxregs = ssp1_ext_17_20_muxreg, 26668c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(ssp1_ext_17_20_muxreg), 26678c2ecf20Sopenharmony_ci }, 26688c2ecf20Sopenharmony_ci}; 26698c2ecf20Sopenharmony_ci 26708c2ecf20Sopenharmony_cistatic struct spear_modemux ssp1_36_39_modemux[] = { 26718c2ecf20Sopenharmony_ci { 26728c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 26738c2ecf20Sopenharmony_ci .muxregs = ssp1_ext_36_39_muxreg, 26748c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(ssp1_ext_36_39_muxreg), 26758c2ecf20Sopenharmony_ci }, 26768c2ecf20Sopenharmony_ci}; 26778c2ecf20Sopenharmony_ci 26788c2ecf20Sopenharmony_cistatic struct spear_modemux ssp1_48_51_modemux[] = { 26798c2ecf20Sopenharmony_ci { 26808c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 26818c2ecf20Sopenharmony_ci .muxregs = ssp1_ext_48_51_muxreg, 26828c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(ssp1_ext_48_51_muxreg), 26838c2ecf20Sopenharmony_ci }, 26848c2ecf20Sopenharmony_ci}; 26858c2ecf20Sopenharmony_cistatic struct spear_modemux ssp1_65_68_modemux[] = { 26868c2ecf20Sopenharmony_ci { 26878c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 26888c2ecf20Sopenharmony_ci .muxregs = ssp1_ext_65_68_muxreg, 26898c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(ssp1_ext_65_68_muxreg), 26908c2ecf20Sopenharmony_ci }, 26918c2ecf20Sopenharmony_ci}; 26928c2ecf20Sopenharmony_ci 26938c2ecf20Sopenharmony_cistatic struct spear_modemux ssp1_94_97_modemux[] = { 26948c2ecf20Sopenharmony_ci { 26958c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 26968c2ecf20Sopenharmony_ci .muxregs = ssp1_ext_94_97_muxreg, 26978c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(ssp1_ext_94_97_muxreg), 26988c2ecf20Sopenharmony_ci }, 26998c2ecf20Sopenharmony_ci}; 27008c2ecf20Sopenharmony_ci 27018c2ecf20Sopenharmony_cistatic struct spear_pingroup ssp1_pingroup[] = { 27028c2ecf20Sopenharmony_ci { 27038c2ecf20Sopenharmony_ci .name = "ssp1_17_20_grp", 27048c2ecf20Sopenharmony_ci .pins = ssp1_pins[0], 27058c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(ssp1_pins[0]), 27068c2ecf20Sopenharmony_ci .modemuxs = ssp1_17_20_modemux, 27078c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(ssp1_17_20_modemux), 27088c2ecf20Sopenharmony_ci }, { 27098c2ecf20Sopenharmony_ci .name = "ssp1_36_39_grp", 27108c2ecf20Sopenharmony_ci .pins = ssp1_pins[1], 27118c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(ssp1_pins[1]), 27128c2ecf20Sopenharmony_ci .modemuxs = ssp1_36_39_modemux, 27138c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(ssp1_36_39_modemux), 27148c2ecf20Sopenharmony_ci }, { 27158c2ecf20Sopenharmony_ci .name = "ssp1_48_51_grp", 27168c2ecf20Sopenharmony_ci .pins = ssp1_pins[2], 27178c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(ssp1_pins[2]), 27188c2ecf20Sopenharmony_ci .modemuxs = ssp1_48_51_modemux, 27198c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(ssp1_48_51_modemux), 27208c2ecf20Sopenharmony_ci }, { 27218c2ecf20Sopenharmony_ci .name = "ssp1_65_68_grp", 27228c2ecf20Sopenharmony_ci .pins = ssp1_pins[3], 27238c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(ssp1_pins[3]), 27248c2ecf20Sopenharmony_ci .modemuxs = ssp1_65_68_modemux, 27258c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(ssp1_65_68_modemux), 27268c2ecf20Sopenharmony_ci }, { 27278c2ecf20Sopenharmony_ci .name = "ssp1_94_97_grp", 27288c2ecf20Sopenharmony_ci .pins = ssp1_pins[4], 27298c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(ssp1_pins[4]), 27308c2ecf20Sopenharmony_ci .modemuxs = ssp1_94_97_modemux, 27318c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(ssp1_94_97_modemux), 27328c2ecf20Sopenharmony_ci }, 27338c2ecf20Sopenharmony_ci}; 27348c2ecf20Sopenharmony_ci 27358c2ecf20Sopenharmony_cistatic const char *const ssp1_grps[] = { "ssp1_17_20_grp", "ssp1_36_39_grp", 27368c2ecf20Sopenharmony_ci "ssp1_48_51_grp", "ssp1_65_68_grp", "ssp1_94_97_grp" 27378c2ecf20Sopenharmony_ci}; 27388c2ecf20Sopenharmony_cistatic struct spear_function ssp1_function = { 27398c2ecf20Sopenharmony_ci .name = "ssp1", 27408c2ecf20Sopenharmony_ci .groups = ssp1_grps, 27418c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(ssp1_grps), 27428c2ecf20Sopenharmony_ci}; 27438c2ecf20Sopenharmony_ci 27448c2ecf20Sopenharmony_ci/* Pad multiplexing for SSP2 device */ 27458c2ecf20Sopenharmony_cistatic const unsigned ssp2_pins[][2] = { { 13, 16 }, { 32, 35 }, { 44, 47 }, 27468c2ecf20Sopenharmony_ci { 61, 64 }, { 90, 93 } }; 27478c2ecf20Sopenharmony_cistatic struct spear_muxreg ssp2_muxreg[] = { 27488c2ecf20Sopenharmony_ci { 27498c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 27508c2ecf20Sopenharmony_ci .mask = PMX_MII_MASK, 27518c2ecf20Sopenharmony_ci .val = 0, 27528c2ecf20Sopenharmony_ci }, 27538c2ecf20Sopenharmony_ci}; 27548c2ecf20Sopenharmony_ci 27558c2ecf20Sopenharmony_cistatic struct spear_muxreg ssp2_ext_13_16_muxreg[] = { 27568c2ecf20Sopenharmony_ci { 27578c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_10_19_REG, 27588c2ecf20Sopenharmony_ci .mask = PMX_PL_13_14_MASK | PMX_PL_15_16_MASK, 27598c2ecf20Sopenharmony_ci .val = PMX_SSP2_PL_13_14_15_16_VAL, 27608c2ecf20Sopenharmony_ci }, { 27618c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 27628c2ecf20Sopenharmony_ci .mask = PMX_SSP2_PORT_SEL_MASK, 27638c2ecf20Sopenharmony_ci .val = PMX_SSP2_PORT_13_TO_16_VAL, 27648c2ecf20Sopenharmony_ci }, 27658c2ecf20Sopenharmony_ci}; 27668c2ecf20Sopenharmony_ci 27678c2ecf20Sopenharmony_cistatic struct spear_muxreg ssp2_ext_32_35_muxreg[] = { 27688c2ecf20Sopenharmony_ci { 27698c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 27708c2ecf20Sopenharmony_ci .mask = PMX_SSP_CS_MASK | PMX_GPIO_PIN4_MASK | 27718c2ecf20Sopenharmony_ci PMX_GPIO_PIN5_MASK, 27728c2ecf20Sopenharmony_ci .val = 0, 27738c2ecf20Sopenharmony_ci }, { 27748c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_30_39_REG, 27758c2ecf20Sopenharmony_ci .mask = PMX_PL_32_33_MASK | PMX_PL_34_MASK | PMX_PL_35_MASK, 27768c2ecf20Sopenharmony_ci .val = PMX_SSP2_PL_32_33_VAL | PMX_SSP2_PL_34_VAL | 27778c2ecf20Sopenharmony_ci PMX_SSP2_PL_35_VAL, 27788c2ecf20Sopenharmony_ci }, { 27798c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 27808c2ecf20Sopenharmony_ci .mask = PMX_SSP2_PORT_SEL_MASK, 27818c2ecf20Sopenharmony_ci .val = PMX_SSP2_PORT_32_TO_35_VAL, 27828c2ecf20Sopenharmony_ci }, 27838c2ecf20Sopenharmony_ci}; 27848c2ecf20Sopenharmony_ci 27858c2ecf20Sopenharmony_cistatic struct spear_muxreg ssp2_ext_44_47_muxreg[] = { 27868c2ecf20Sopenharmony_ci { 27878c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 27888c2ecf20Sopenharmony_ci .mask = PMX_TIMER_0_1_MASK | PMX_TIMER_2_3_MASK, 27898c2ecf20Sopenharmony_ci .val = 0, 27908c2ecf20Sopenharmony_ci }, { 27918c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_40_49_REG, 27928c2ecf20Sopenharmony_ci .mask = PMX_PL_44_45_MASK | PMX_PL_46_47_MASK, 27938c2ecf20Sopenharmony_ci .val = PMX_SSP2_PL_44_45_VAL | PMX_SSP2_PL_46_47_VAL, 27948c2ecf20Sopenharmony_ci }, { 27958c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 27968c2ecf20Sopenharmony_ci .mask = PMX_SSP2_PORT_SEL_MASK, 27978c2ecf20Sopenharmony_ci .val = PMX_SSP2_PORT_44_TO_47_VAL, 27988c2ecf20Sopenharmony_ci }, 27998c2ecf20Sopenharmony_ci}; 28008c2ecf20Sopenharmony_ci 28018c2ecf20Sopenharmony_cistatic struct spear_muxreg ssp2_ext_61_64_muxreg[] = { 28028c2ecf20Sopenharmony_ci { 28038c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_60_69_REG, 28048c2ecf20Sopenharmony_ci .mask = PMX_PL_61_TO_64_MASK, 28058c2ecf20Sopenharmony_ci .val = PMX_SSP2_PL_61_TO_64_VAL, 28068c2ecf20Sopenharmony_ci }, { 28078c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 28088c2ecf20Sopenharmony_ci .mask = PMX_SSP2_PORT_SEL_MASK, 28098c2ecf20Sopenharmony_ci .val = PMX_SSP2_PORT_61_TO_64_VAL, 28108c2ecf20Sopenharmony_ci }, 28118c2ecf20Sopenharmony_ci}; 28128c2ecf20Sopenharmony_ci 28138c2ecf20Sopenharmony_cistatic struct spear_muxreg ssp2_ext_90_93_muxreg[] = { 28148c2ecf20Sopenharmony_ci { 28158c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_90_99_REG, 28168c2ecf20Sopenharmony_ci .mask = PMX_PL_90_91_MASK | PMX_PL_92_93_MASK, 28178c2ecf20Sopenharmony_ci .val = PMX_SSP2_PL_90_91_VAL | PMX_SSP2_PL_92_93_VAL, 28188c2ecf20Sopenharmony_ci }, { 28198c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 28208c2ecf20Sopenharmony_ci .mask = PMX_SSP2_PORT_SEL_MASK, 28218c2ecf20Sopenharmony_ci .val = PMX_SSP2_PORT_90_TO_93_VAL, 28228c2ecf20Sopenharmony_ci }, 28238c2ecf20Sopenharmony_ci}; 28248c2ecf20Sopenharmony_ci 28258c2ecf20Sopenharmony_cistatic struct spear_modemux ssp2_13_16_modemux[] = { 28268c2ecf20Sopenharmony_ci { 28278c2ecf20Sopenharmony_ci .modes = AUTO_NET_SMII_MODE | EXTENDED_MODE, 28288c2ecf20Sopenharmony_ci .muxregs = ssp2_muxreg, 28298c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(ssp2_muxreg), 28308c2ecf20Sopenharmony_ci }, { 28318c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 28328c2ecf20Sopenharmony_ci .muxregs = ssp2_ext_13_16_muxreg, 28338c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(ssp2_ext_13_16_muxreg), 28348c2ecf20Sopenharmony_ci }, 28358c2ecf20Sopenharmony_ci}; 28368c2ecf20Sopenharmony_ci 28378c2ecf20Sopenharmony_cistatic struct spear_modemux ssp2_32_35_modemux[] = { 28388c2ecf20Sopenharmony_ci { 28398c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 28408c2ecf20Sopenharmony_ci .muxregs = ssp2_ext_32_35_muxreg, 28418c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(ssp2_ext_32_35_muxreg), 28428c2ecf20Sopenharmony_ci }, 28438c2ecf20Sopenharmony_ci}; 28448c2ecf20Sopenharmony_ci 28458c2ecf20Sopenharmony_cistatic struct spear_modemux ssp2_44_47_modemux[] = { 28468c2ecf20Sopenharmony_ci { 28478c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 28488c2ecf20Sopenharmony_ci .muxregs = ssp2_ext_44_47_muxreg, 28498c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(ssp2_ext_44_47_muxreg), 28508c2ecf20Sopenharmony_ci }, 28518c2ecf20Sopenharmony_ci}; 28528c2ecf20Sopenharmony_ci 28538c2ecf20Sopenharmony_cistatic struct spear_modemux ssp2_61_64_modemux[] = { 28548c2ecf20Sopenharmony_ci { 28558c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 28568c2ecf20Sopenharmony_ci .muxregs = ssp2_ext_61_64_muxreg, 28578c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(ssp2_ext_61_64_muxreg), 28588c2ecf20Sopenharmony_ci }, 28598c2ecf20Sopenharmony_ci}; 28608c2ecf20Sopenharmony_ci 28618c2ecf20Sopenharmony_cistatic struct spear_modemux ssp2_90_93_modemux[] = { 28628c2ecf20Sopenharmony_ci { 28638c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 28648c2ecf20Sopenharmony_ci .muxregs = ssp2_ext_90_93_muxreg, 28658c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(ssp2_ext_90_93_muxreg), 28668c2ecf20Sopenharmony_ci }, 28678c2ecf20Sopenharmony_ci}; 28688c2ecf20Sopenharmony_ci 28698c2ecf20Sopenharmony_cistatic struct spear_pingroup ssp2_pingroup[] = { 28708c2ecf20Sopenharmony_ci { 28718c2ecf20Sopenharmony_ci .name = "ssp2_13_16_grp", 28728c2ecf20Sopenharmony_ci .pins = ssp2_pins[0], 28738c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(ssp2_pins[0]), 28748c2ecf20Sopenharmony_ci .modemuxs = ssp2_13_16_modemux, 28758c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(ssp2_13_16_modemux), 28768c2ecf20Sopenharmony_ci }, { 28778c2ecf20Sopenharmony_ci .name = "ssp2_32_35_grp", 28788c2ecf20Sopenharmony_ci .pins = ssp2_pins[1], 28798c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(ssp2_pins[1]), 28808c2ecf20Sopenharmony_ci .modemuxs = ssp2_32_35_modemux, 28818c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(ssp2_32_35_modemux), 28828c2ecf20Sopenharmony_ci }, { 28838c2ecf20Sopenharmony_ci .name = "ssp2_44_47_grp", 28848c2ecf20Sopenharmony_ci .pins = ssp2_pins[2], 28858c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(ssp2_pins[2]), 28868c2ecf20Sopenharmony_ci .modemuxs = ssp2_44_47_modemux, 28878c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(ssp2_44_47_modemux), 28888c2ecf20Sopenharmony_ci }, { 28898c2ecf20Sopenharmony_ci .name = "ssp2_61_64_grp", 28908c2ecf20Sopenharmony_ci .pins = ssp2_pins[3], 28918c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(ssp2_pins[3]), 28928c2ecf20Sopenharmony_ci .modemuxs = ssp2_61_64_modemux, 28938c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(ssp2_61_64_modemux), 28948c2ecf20Sopenharmony_ci }, { 28958c2ecf20Sopenharmony_ci .name = "ssp2_90_93_grp", 28968c2ecf20Sopenharmony_ci .pins = ssp2_pins[4], 28978c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(ssp2_pins[4]), 28988c2ecf20Sopenharmony_ci .modemuxs = ssp2_90_93_modemux, 28998c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(ssp2_90_93_modemux), 29008c2ecf20Sopenharmony_ci }, 29018c2ecf20Sopenharmony_ci}; 29028c2ecf20Sopenharmony_ci 29038c2ecf20Sopenharmony_cistatic const char *const ssp2_grps[] = { "ssp2_13_16_grp", "ssp2_32_35_grp", 29048c2ecf20Sopenharmony_ci "ssp2_44_47_grp", "ssp2_61_64_grp", "ssp2_90_93_grp" }; 29058c2ecf20Sopenharmony_cistatic struct spear_function ssp2_function = { 29068c2ecf20Sopenharmony_ci .name = "ssp2", 29078c2ecf20Sopenharmony_ci .groups = ssp2_grps, 29088c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(ssp2_grps), 29098c2ecf20Sopenharmony_ci}; 29108c2ecf20Sopenharmony_ci 29118c2ecf20Sopenharmony_ci/* Pad multiplexing for cadence mii2 as mii device */ 29128c2ecf20Sopenharmony_cistatic const unsigned mii2_pins[] = { 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 29138c2ecf20Sopenharmony_ci 90, 91, 92, 93, 94, 95, 96, 97 }; 29148c2ecf20Sopenharmony_cistatic struct spear_muxreg mii2_muxreg[] = { 29158c2ecf20Sopenharmony_ci { 29168c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_80_89_REG, 29178c2ecf20Sopenharmony_ci .mask = PMX_PL_80_TO_85_MASK | PMX_PL_86_87_MASK | 29188c2ecf20Sopenharmony_ci PMX_PL_88_89_MASK, 29198c2ecf20Sopenharmony_ci .val = PMX_MII2_PL_80_TO_85_VAL | PMX_MII2_PL_86_87_VAL | 29208c2ecf20Sopenharmony_ci PMX_MII2_PL_88_89_VAL, 29218c2ecf20Sopenharmony_ci }, { 29228c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_90_99_REG, 29238c2ecf20Sopenharmony_ci .mask = PMX_PL_90_91_MASK | PMX_PL_92_93_MASK | 29248c2ecf20Sopenharmony_ci PMX_PL_94_95_MASK | PMX_PL_96_97_MASK, 29258c2ecf20Sopenharmony_ci .val = PMX_MII2_PL_90_91_VAL | PMX_MII2_PL_92_93_VAL | 29268c2ecf20Sopenharmony_ci PMX_MII2_PL_94_95_VAL | PMX_MII2_PL_96_97_VAL, 29278c2ecf20Sopenharmony_ci }, { 29288c2ecf20Sopenharmony_ci .reg = EXT_CTRL_REG, 29298c2ecf20Sopenharmony_ci .mask = (MAC_MODE_MASK << MAC2_MODE_SHIFT) | 29308c2ecf20Sopenharmony_ci (MAC_MODE_MASK << MAC1_MODE_SHIFT) | 29318c2ecf20Sopenharmony_ci MII_MDIO_MASK, 29328c2ecf20Sopenharmony_ci .val = (MAC_MODE_MII << MAC2_MODE_SHIFT) | 29338c2ecf20Sopenharmony_ci (MAC_MODE_MII << MAC1_MODE_SHIFT) | 29348c2ecf20Sopenharmony_ci MII_MDIO_81_VAL, 29358c2ecf20Sopenharmony_ci }, 29368c2ecf20Sopenharmony_ci}; 29378c2ecf20Sopenharmony_ci 29388c2ecf20Sopenharmony_cistatic struct spear_modemux mii2_modemux[] = { 29398c2ecf20Sopenharmony_ci { 29408c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 29418c2ecf20Sopenharmony_ci .muxregs = mii2_muxreg, 29428c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(mii2_muxreg), 29438c2ecf20Sopenharmony_ci }, 29448c2ecf20Sopenharmony_ci}; 29458c2ecf20Sopenharmony_ci 29468c2ecf20Sopenharmony_cistatic struct spear_pingroup mii2_pingroup = { 29478c2ecf20Sopenharmony_ci .name = "mii2_grp", 29488c2ecf20Sopenharmony_ci .pins = mii2_pins, 29498c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(mii2_pins), 29508c2ecf20Sopenharmony_ci .modemuxs = mii2_modemux, 29518c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(mii2_modemux), 29528c2ecf20Sopenharmony_ci}; 29538c2ecf20Sopenharmony_ci 29548c2ecf20Sopenharmony_cistatic const char *const mii2_grps[] = { "mii2_grp" }; 29558c2ecf20Sopenharmony_cistatic struct spear_function mii2_function = { 29568c2ecf20Sopenharmony_ci .name = "mii2", 29578c2ecf20Sopenharmony_ci .groups = mii2_grps, 29588c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(mii2_grps), 29598c2ecf20Sopenharmony_ci}; 29608c2ecf20Sopenharmony_ci 29618c2ecf20Sopenharmony_ci/* Pad multiplexing for cadence mii 1_2 as smii or rmii device */ 29628c2ecf20Sopenharmony_cistatic const unsigned rmii0_1_pins[] = { 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 29638c2ecf20Sopenharmony_ci 21, 22, 23, 24, 25, 26, 27 }; 29648c2ecf20Sopenharmony_cistatic const unsigned smii0_1_pins[] = { 10, 11, 21, 22, 23, 24, 25, 26, 27 }; 29658c2ecf20Sopenharmony_cistatic struct spear_muxreg mii0_1_muxreg[] = { 29668c2ecf20Sopenharmony_ci { 29678c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 29688c2ecf20Sopenharmony_ci .mask = PMX_MII_MASK, 29698c2ecf20Sopenharmony_ci .val = 0, 29708c2ecf20Sopenharmony_ci }, 29718c2ecf20Sopenharmony_ci}; 29728c2ecf20Sopenharmony_ci 29738c2ecf20Sopenharmony_cistatic struct spear_muxreg smii0_1_ext_muxreg[] = { 29748c2ecf20Sopenharmony_ci { 29758c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_10_19_REG, 29768c2ecf20Sopenharmony_ci .mask = PMX_PL_10_11_MASK, 29778c2ecf20Sopenharmony_ci .val = PMX_SMII_PL_10_11_VAL, 29788c2ecf20Sopenharmony_ci }, { 29798c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_20_29_REG, 29808c2ecf20Sopenharmony_ci .mask = PMX_PL_21_TO_27_MASK, 29818c2ecf20Sopenharmony_ci .val = PMX_SMII_PL_21_TO_27_VAL, 29828c2ecf20Sopenharmony_ci }, { 29838c2ecf20Sopenharmony_ci .reg = EXT_CTRL_REG, 29848c2ecf20Sopenharmony_ci .mask = (MAC_MODE_MASK << MAC2_MODE_SHIFT) | 29858c2ecf20Sopenharmony_ci (MAC_MODE_MASK << MAC1_MODE_SHIFT) | 29868c2ecf20Sopenharmony_ci MII_MDIO_MASK, 29878c2ecf20Sopenharmony_ci .val = (MAC_MODE_SMII << MAC2_MODE_SHIFT) 29888c2ecf20Sopenharmony_ci | (MAC_MODE_SMII << MAC1_MODE_SHIFT) 29898c2ecf20Sopenharmony_ci | MII_MDIO_10_11_VAL, 29908c2ecf20Sopenharmony_ci }, 29918c2ecf20Sopenharmony_ci}; 29928c2ecf20Sopenharmony_ci 29938c2ecf20Sopenharmony_cistatic struct spear_muxreg rmii0_1_ext_muxreg[] = { 29948c2ecf20Sopenharmony_ci { 29958c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_10_19_REG, 29968c2ecf20Sopenharmony_ci .mask = PMX_PL_10_11_MASK | PMX_PL_13_14_MASK | 29978c2ecf20Sopenharmony_ci PMX_PL_15_16_MASK | PMX_PL_17_18_MASK | PMX_PL_19_MASK, 29988c2ecf20Sopenharmony_ci .val = PMX_RMII_PL_10_11_VAL | PMX_RMII_PL_13_14_VAL | 29998c2ecf20Sopenharmony_ci PMX_RMII_PL_15_16_VAL | PMX_RMII_PL_17_18_VAL | 30008c2ecf20Sopenharmony_ci PMX_RMII_PL_19_VAL, 30018c2ecf20Sopenharmony_ci }, { 30028c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_20_29_REG, 30038c2ecf20Sopenharmony_ci .mask = PMX_PL_20_MASK | PMX_PL_21_TO_27_MASK, 30048c2ecf20Sopenharmony_ci .val = PMX_RMII_PL_20_VAL | PMX_RMII_PL_21_TO_27_VAL, 30058c2ecf20Sopenharmony_ci }, { 30068c2ecf20Sopenharmony_ci .reg = EXT_CTRL_REG, 30078c2ecf20Sopenharmony_ci .mask = (MAC_MODE_MASK << MAC2_MODE_SHIFT) | 30088c2ecf20Sopenharmony_ci (MAC_MODE_MASK << MAC1_MODE_SHIFT) | 30098c2ecf20Sopenharmony_ci MII_MDIO_MASK, 30108c2ecf20Sopenharmony_ci .val = (MAC_MODE_RMII << MAC2_MODE_SHIFT) 30118c2ecf20Sopenharmony_ci | (MAC_MODE_RMII << MAC1_MODE_SHIFT) 30128c2ecf20Sopenharmony_ci | MII_MDIO_10_11_VAL, 30138c2ecf20Sopenharmony_ci }, 30148c2ecf20Sopenharmony_ci}; 30158c2ecf20Sopenharmony_ci 30168c2ecf20Sopenharmony_cistatic struct spear_modemux mii0_1_modemux[][2] = { 30178c2ecf20Sopenharmony_ci { 30188c2ecf20Sopenharmony_ci /* configure as smii */ 30198c2ecf20Sopenharmony_ci { 30208c2ecf20Sopenharmony_ci .modes = AUTO_NET_SMII_MODE | AUTO_EXP_MODE | 30218c2ecf20Sopenharmony_ci SMALL_PRINTERS_MODE | EXTENDED_MODE, 30228c2ecf20Sopenharmony_ci .muxregs = mii0_1_muxreg, 30238c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(mii0_1_muxreg), 30248c2ecf20Sopenharmony_ci }, { 30258c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 30268c2ecf20Sopenharmony_ci .muxregs = smii0_1_ext_muxreg, 30278c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(smii0_1_ext_muxreg), 30288c2ecf20Sopenharmony_ci }, 30298c2ecf20Sopenharmony_ci }, { 30308c2ecf20Sopenharmony_ci /* configure as rmii */ 30318c2ecf20Sopenharmony_ci { 30328c2ecf20Sopenharmony_ci .modes = AUTO_NET_SMII_MODE | AUTO_EXP_MODE | 30338c2ecf20Sopenharmony_ci SMALL_PRINTERS_MODE | EXTENDED_MODE, 30348c2ecf20Sopenharmony_ci .muxregs = mii0_1_muxreg, 30358c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(mii0_1_muxreg), 30368c2ecf20Sopenharmony_ci }, { 30378c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 30388c2ecf20Sopenharmony_ci .muxregs = rmii0_1_ext_muxreg, 30398c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(rmii0_1_ext_muxreg), 30408c2ecf20Sopenharmony_ci }, 30418c2ecf20Sopenharmony_ci }, 30428c2ecf20Sopenharmony_ci}; 30438c2ecf20Sopenharmony_ci 30448c2ecf20Sopenharmony_cistatic struct spear_pingroup mii0_1_pingroup[] = { 30458c2ecf20Sopenharmony_ci { 30468c2ecf20Sopenharmony_ci .name = "smii0_1_grp", 30478c2ecf20Sopenharmony_ci .pins = smii0_1_pins, 30488c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(smii0_1_pins), 30498c2ecf20Sopenharmony_ci .modemuxs = mii0_1_modemux[0], 30508c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(mii0_1_modemux[0]), 30518c2ecf20Sopenharmony_ci }, { 30528c2ecf20Sopenharmony_ci .name = "rmii0_1_grp", 30538c2ecf20Sopenharmony_ci .pins = rmii0_1_pins, 30548c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(rmii0_1_pins), 30558c2ecf20Sopenharmony_ci .modemuxs = mii0_1_modemux[1], 30568c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(mii0_1_modemux[1]), 30578c2ecf20Sopenharmony_ci }, 30588c2ecf20Sopenharmony_ci}; 30598c2ecf20Sopenharmony_ci 30608c2ecf20Sopenharmony_cistatic const char *const mii0_1_grps[] = { "smii0_1_grp", "rmii0_1_grp" }; 30618c2ecf20Sopenharmony_cistatic struct spear_function mii0_1_function = { 30628c2ecf20Sopenharmony_ci .name = "mii0_1", 30638c2ecf20Sopenharmony_ci .groups = mii0_1_grps, 30648c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(mii0_1_grps), 30658c2ecf20Sopenharmony_ci}; 30668c2ecf20Sopenharmony_ci 30678c2ecf20Sopenharmony_ci/* Pad multiplexing for i2c1 device */ 30688c2ecf20Sopenharmony_cistatic const unsigned i2c1_pins[][2] = { { 8, 9 }, { 98, 99 } }; 30698c2ecf20Sopenharmony_cistatic struct spear_muxreg i2c1_ext_8_9_muxreg[] = { 30708c2ecf20Sopenharmony_ci { 30718c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 30728c2ecf20Sopenharmony_ci .mask = PMX_SSP_CS_MASK, 30738c2ecf20Sopenharmony_ci .val = 0, 30748c2ecf20Sopenharmony_ci }, { 30758c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_0_9_REG, 30768c2ecf20Sopenharmony_ci .mask = PMX_PL_8_9_MASK, 30778c2ecf20Sopenharmony_ci .val = PMX_I2C1_PL_8_9_VAL, 30788c2ecf20Sopenharmony_ci }, { 30798c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 30808c2ecf20Sopenharmony_ci .mask = PMX_I2C1_PORT_SEL_MASK, 30818c2ecf20Sopenharmony_ci .val = PMX_I2C1_PORT_8_9_VAL, 30828c2ecf20Sopenharmony_ci }, 30838c2ecf20Sopenharmony_ci}; 30848c2ecf20Sopenharmony_ci 30858c2ecf20Sopenharmony_cistatic struct spear_muxreg i2c1_ext_98_99_muxreg[] = { 30868c2ecf20Sopenharmony_ci { 30878c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_90_99_REG, 30888c2ecf20Sopenharmony_ci .mask = PMX_PL_98_MASK | PMX_PL_99_MASK, 30898c2ecf20Sopenharmony_ci .val = PMX_I2C1_PL_98_VAL | PMX_I2C1_PL_99_VAL, 30908c2ecf20Sopenharmony_ci }, { 30918c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 30928c2ecf20Sopenharmony_ci .mask = PMX_I2C1_PORT_SEL_MASK, 30938c2ecf20Sopenharmony_ci .val = PMX_I2C1_PORT_98_99_VAL, 30948c2ecf20Sopenharmony_ci }, 30958c2ecf20Sopenharmony_ci}; 30968c2ecf20Sopenharmony_ci 30978c2ecf20Sopenharmony_cistatic struct spear_modemux i2c1_modemux[][1] = { 30988c2ecf20Sopenharmony_ci { 30998c2ecf20Sopenharmony_ci /* Select signals on pins 8-9 */ 31008c2ecf20Sopenharmony_ci { 31018c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 31028c2ecf20Sopenharmony_ci .muxregs = i2c1_ext_8_9_muxreg, 31038c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(i2c1_ext_8_9_muxreg), 31048c2ecf20Sopenharmony_ci }, 31058c2ecf20Sopenharmony_ci }, { 31068c2ecf20Sopenharmony_ci /* Select signals on pins 98-99 */ 31078c2ecf20Sopenharmony_ci { 31088c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 31098c2ecf20Sopenharmony_ci .muxregs = i2c1_ext_98_99_muxreg, 31108c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(i2c1_ext_98_99_muxreg), 31118c2ecf20Sopenharmony_ci }, 31128c2ecf20Sopenharmony_ci }, 31138c2ecf20Sopenharmony_ci}; 31148c2ecf20Sopenharmony_ci 31158c2ecf20Sopenharmony_cistatic struct spear_pingroup i2c1_pingroup[] = { 31168c2ecf20Sopenharmony_ci { 31178c2ecf20Sopenharmony_ci .name = "i2c1_8_9_grp", 31188c2ecf20Sopenharmony_ci .pins = i2c1_pins[0], 31198c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(i2c1_pins[0]), 31208c2ecf20Sopenharmony_ci .modemuxs = i2c1_modemux[0], 31218c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(i2c1_modemux[0]), 31228c2ecf20Sopenharmony_ci }, { 31238c2ecf20Sopenharmony_ci .name = "i2c1_98_99_grp", 31248c2ecf20Sopenharmony_ci .pins = i2c1_pins[1], 31258c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(i2c1_pins[1]), 31268c2ecf20Sopenharmony_ci .modemuxs = i2c1_modemux[1], 31278c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(i2c1_modemux[1]), 31288c2ecf20Sopenharmony_ci }, 31298c2ecf20Sopenharmony_ci}; 31308c2ecf20Sopenharmony_ci 31318c2ecf20Sopenharmony_cistatic const char *const i2c1_grps[] = { "i2c1_8_9_grp", "i2c1_98_99_grp" }; 31328c2ecf20Sopenharmony_cistatic struct spear_function i2c1_function = { 31338c2ecf20Sopenharmony_ci .name = "i2c1", 31348c2ecf20Sopenharmony_ci .groups = i2c1_grps, 31358c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(i2c1_grps), 31368c2ecf20Sopenharmony_ci}; 31378c2ecf20Sopenharmony_ci 31388c2ecf20Sopenharmony_ci/* Pad multiplexing for i2c2 device */ 31398c2ecf20Sopenharmony_cistatic const unsigned i2c2_pins[][2] = { { 0, 1 }, { 2, 3 }, { 19, 20 }, 31408c2ecf20Sopenharmony_ci { 75, 76 }, { 96, 97 } }; 31418c2ecf20Sopenharmony_cistatic struct spear_muxreg i2c2_ext_0_1_muxreg[] = { 31428c2ecf20Sopenharmony_ci { 31438c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 31448c2ecf20Sopenharmony_ci .mask = PMX_FIRDA_MASK, 31458c2ecf20Sopenharmony_ci .val = 0, 31468c2ecf20Sopenharmony_ci }, { 31478c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_0_9_REG, 31488c2ecf20Sopenharmony_ci .mask = PMX_PL_0_1_MASK, 31498c2ecf20Sopenharmony_ci .val = PMX_I2C2_PL_0_1_VAL, 31508c2ecf20Sopenharmony_ci }, { 31518c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 31528c2ecf20Sopenharmony_ci .mask = PMX_I2C2_PORT_SEL_MASK, 31538c2ecf20Sopenharmony_ci .val = PMX_I2C2_PORT_0_1_VAL, 31548c2ecf20Sopenharmony_ci }, 31558c2ecf20Sopenharmony_ci}; 31568c2ecf20Sopenharmony_ci 31578c2ecf20Sopenharmony_cistatic struct spear_muxreg i2c2_ext_2_3_muxreg[] = { 31588c2ecf20Sopenharmony_ci { 31598c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 31608c2ecf20Sopenharmony_ci .mask = PMX_UART0_MASK, 31618c2ecf20Sopenharmony_ci .val = 0, 31628c2ecf20Sopenharmony_ci }, { 31638c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_0_9_REG, 31648c2ecf20Sopenharmony_ci .mask = PMX_PL_2_3_MASK, 31658c2ecf20Sopenharmony_ci .val = PMX_I2C2_PL_2_3_VAL, 31668c2ecf20Sopenharmony_ci }, { 31678c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 31688c2ecf20Sopenharmony_ci .mask = PMX_I2C2_PORT_SEL_MASK, 31698c2ecf20Sopenharmony_ci .val = PMX_I2C2_PORT_2_3_VAL, 31708c2ecf20Sopenharmony_ci }, 31718c2ecf20Sopenharmony_ci}; 31728c2ecf20Sopenharmony_ci 31738c2ecf20Sopenharmony_cistatic struct spear_muxreg i2c2_ext_19_20_muxreg[] = { 31748c2ecf20Sopenharmony_ci { 31758c2ecf20Sopenharmony_ci .reg = PMX_CONFIG_REG, 31768c2ecf20Sopenharmony_ci .mask = PMX_MII_MASK, 31778c2ecf20Sopenharmony_ci .val = 0, 31788c2ecf20Sopenharmony_ci }, { 31798c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_10_19_REG, 31808c2ecf20Sopenharmony_ci .mask = PMX_PL_19_MASK, 31818c2ecf20Sopenharmony_ci .val = PMX_I2C2_PL_19_VAL, 31828c2ecf20Sopenharmony_ci }, { 31838c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_20_29_REG, 31848c2ecf20Sopenharmony_ci .mask = PMX_PL_20_MASK, 31858c2ecf20Sopenharmony_ci .val = PMX_I2C2_PL_20_VAL, 31868c2ecf20Sopenharmony_ci }, { 31878c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 31888c2ecf20Sopenharmony_ci .mask = PMX_I2C2_PORT_SEL_MASK, 31898c2ecf20Sopenharmony_ci .val = PMX_I2C2_PORT_19_20_VAL, 31908c2ecf20Sopenharmony_ci }, 31918c2ecf20Sopenharmony_ci}; 31928c2ecf20Sopenharmony_ci 31938c2ecf20Sopenharmony_cistatic struct spear_muxreg i2c2_ext_75_76_muxreg[] = { 31948c2ecf20Sopenharmony_ci { 31958c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_70_79_REG, 31968c2ecf20Sopenharmony_ci .mask = PMX_PL_75_76_MASK, 31978c2ecf20Sopenharmony_ci .val = PMX_I2C2_PL_75_76_VAL, 31988c2ecf20Sopenharmony_ci }, { 31998c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 32008c2ecf20Sopenharmony_ci .mask = PMX_I2C2_PORT_SEL_MASK, 32018c2ecf20Sopenharmony_ci .val = PMX_I2C2_PORT_75_76_VAL, 32028c2ecf20Sopenharmony_ci }, 32038c2ecf20Sopenharmony_ci}; 32048c2ecf20Sopenharmony_ci 32058c2ecf20Sopenharmony_cistatic struct spear_muxreg i2c2_ext_96_97_muxreg[] = { 32068c2ecf20Sopenharmony_ci { 32078c2ecf20Sopenharmony_ci .reg = IP_SEL_PAD_90_99_REG, 32088c2ecf20Sopenharmony_ci .mask = PMX_PL_96_97_MASK, 32098c2ecf20Sopenharmony_ci .val = PMX_I2C2_PL_96_97_VAL, 32108c2ecf20Sopenharmony_ci }, { 32118c2ecf20Sopenharmony_ci .reg = IP_SEL_MIX_PAD_REG, 32128c2ecf20Sopenharmony_ci .mask = PMX_I2C2_PORT_SEL_MASK, 32138c2ecf20Sopenharmony_ci .val = PMX_I2C2_PORT_96_97_VAL, 32148c2ecf20Sopenharmony_ci }, 32158c2ecf20Sopenharmony_ci}; 32168c2ecf20Sopenharmony_ci 32178c2ecf20Sopenharmony_cistatic struct spear_modemux i2c2_modemux[][1] = { 32188c2ecf20Sopenharmony_ci { 32198c2ecf20Sopenharmony_ci /* Select signals on pins 0_1 */ 32208c2ecf20Sopenharmony_ci { 32218c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 32228c2ecf20Sopenharmony_ci .muxregs = i2c2_ext_0_1_muxreg, 32238c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(i2c2_ext_0_1_muxreg), 32248c2ecf20Sopenharmony_ci }, 32258c2ecf20Sopenharmony_ci }, { 32268c2ecf20Sopenharmony_ci /* Select signals on pins 2_3 */ 32278c2ecf20Sopenharmony_ci { 32288c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 32298c2ecf20Sopenharmony_ci .muxregs = i2c2_ext_2_3_muxreg, 32308c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(i2c2_ext_2_3_muxreg), 32318c2ecf20Sopenharmony_ci }, 32328c2ecf20Sopenharmony_ci }, { 32338c2ecf20Sopenharmony_ci /* Select signals on pins 19_20 */ 32348c2ecf20Sopenharmony_ci { 32358c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 32368c2ecf20Sopenharmony_ci .muxregs = i2c2_ext_19_20_muxreg, 32378c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(i2c2_ext_19_20_muxreg), 32388c2ecf20Sopenharmony_ci }, 32398c2ecf20Sopenharmony_ci }, { 32408c2ecf20Sopenharmony_ci /* Select signals on pins 75_76 */ 32418c2ecf20Sopenharmony_ci { 32428c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 32438c2ecf20Sopenharmony_ci .muxregs = i2c2_ext_75_76_muxreg, 32448c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(i2c2_ext_75_76_muxreg), 32458c2ecf20Sopenharmony_ci }, 32468c2ecf20Sopenharmony_ci }, { 32478c2ecf20Sopenharmony_ci /* Select signals on pins 96_97 */ 32488c2ecf20Sopenharmony_ci { 32498c2ecf20Sopenharmony_ci .modes = EXTENDED_MODE, 32508c2ecf20Sopenharmony_ci .muxregs = i2c2_ext_96_97_muxreg, 32518c2ecf20Sopenharmony_ci .nmuxregs = ARRAY_SIZE(i2c2_ext_96_97_muxreg), 32528c2ecf20Sopenharmony_ci }, 32538c2ecf20Sopenharmony_ci }, 32548c2ecf20Sopenharmony_ci}; 32558c2ecf20Sopenharmony_ci 32568c2ecf20Sopenharmony_cistatic struct spear_pingroup i2c2_pingroup[] = { 32578c2ecf20Sopenharmony_ci { 32588c2ecf20Sopenharmony_ci .name = "i2c2_0_1_grp", 32598c2ecf20Sopenharmony_ci .pins = i2c2_pins[0], 32608c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(i2c2_pins[0]), 32618c2ecf20Sopenharmony_ci .modemuxs = i2c2_modemux[0], 32628c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(i2c2_modemux[0]), 32638c2ecf20Sopenharmony_ci }, { 32648c2ecf20Sopenharmony_ci .name = "i2c2_2_3_grp", 32658c2ecf20Sopenharmony_ci .pins = i2c2_pins[1], 32668c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(i2c2_pins[1]), 32678c2ecf20Sopenharmony_ci .modemuxs = i2c2_modemux[1], 32688c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(i2c2_modemux[1]), 32698c2ecf20Sopenharmony_ci }, { 32708c2ecf20Sopenharmony_ci .name = "i2c2_19_20_grp", 32718c2ecf20Sopenharmony_ci .pins = i2c2_pins[2], 32728c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(i2c2_pins[2]), 32738c2ecf20Sopenharmony_ci .modemuxs = i2c2_modemux[2], 32748c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(i2c2_modemux[2]), 32758c2ecf20Sopenharmony_ci }, { 32768c2ecf20Sopenharmony_ci .name = "i2c2_75_76_grp", 32778c2ecf20Sopenharmony_ci .pins = i2c2_pins[3], 32788c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(i2c2_pins[3]), 32798c2ecf20Sopenharmony_ci .modemuxs = i2c2_modemux[3], 32808c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(i2c2_modemux[3]), 32818c2ecf20Sopenharmony_ci }, { 32828c2ecf20Sopenharmony_ci .name = "i2c2_96_97_grp", 32838c2ecf20Sopenharmony_ci .pins = i2c2_pins[4], 32848c2ecf20Sopenharmony_ci .npins = ARRAY_SIZE(i2c2_pins[4]), 32858c2ecf20Sopenharmony_ci .modemuxs = i2c2_modemux[4], 32868c2ecf20Sopenharmony_ci .nmodemuxs = ARRAY_SIZE(i2c2_modemux[4]), 32878c2ecf20Sopenharmony_ci }, 32888c2ecf20Sopenharmony_ci}; 32898c2ecf20Sopenharmony_ci 32908c2ecf20Sopenharmony_cistatic const char *const i2c2_grps[] = { "i2c2_0_1_grp", "i2c2_2_3_grp", 32918c2ecf20Sopenharmony_ci "i2c2_19_20_grp", "i2c2_75_76_grp", "i2c2_96_97_grp" }; 32928c2ecf20Sopenharmony_cistatic struct spear_function i2c2_function = { 32938c2ecf20Sopenharmony_ci .name = "i2c2", 32948c2ecf20Sopenharmony_ci .groups = i2c2_grps, 32958c2ecf20Sopenharmony_ci .ngroups = ARRAY_SIZE(i2c2_grps), 32968c2ecf20Sopenharmony_ci}; 32978c2ecf20Sopenharmony_ci 32988c2ecf20Sopenharmony_ci/* pingroups */ 32998c2ecf20Sopenharmony_cistatic struct spear_pingroup *spear320_pingroups[] = { 33008c2ecf20Sopenharmony_ci SPEAR3XX_COMMON_PINGROUPS, 33018c2ecf20Sopenharmony_ci &clcd_pingroup, 33028c2ecf20Sopenharmony_ci &emi_pingroup, 33038c2ecf20Sopenharmony_ci &fsmc_8bit_pingroup, 33048c2ecf20Sopenharmony_ci &fsmc_16bit_pingroup, 33058c2ecf20Sopenharmony_ci &spp_pingroup, 33068c2ecf20Sopenharmony_ci &sdhci_led_pingroup, 33078c2ecf20Sopenharmony_ci &sdhci_pingroup[0], 33088c2ecf20Sopenharmony_ci &sdhci_pingroup[1], 33098c2ecf20Sopenharmony_ci &i2s_pingroup, 33108c2ecf20Sopenharmony_ci &uart1_pingroup, 33118c2ecf20Sopenharmony_ci &uart1_modem_pingroup[0], 33128c2ecf20Sopenharmony_ci &uart1_modem_pingroup[1], 33138c2ecf20Sopenharmony_ci &uart1_modem_pingroup[2], 33148c2ecf20Sopenharmony_ci &uart1_modem_pingroup[3], 33158c2ecf20Sopenharmony_ci &uart2_pingroup, 33168c2ecf20Sopenharmony_ci &uart3_pingroup[0], 33178c2ecf20Sopenharmony_ci &uart3_pingroup[1], 33188c2ecf20Sopenharmony_ci &uart3_pingroup[2], 33198c2ecf20Sopenharmony_ci &uart3_pingroup[3], 33208c2ecf20Sopenharmony_ci &uart3_pingroup[4], 33218c2ecf20Sopenharmony_ci &uart3_pingroup[5], 33228c2ecf20Sopenharmony_ci &uart3_pingroup[6], 33238c2ecf20Sopenharmony_ci &uart4_pingroup[0], 33248c2ecf20Sopenharmony_ci &uart4_pingroup[1], 33258c2ecf20Sopenharmony_ci &uart4_pingroup[2], 33268c2ecf20Sopenharmony_ci &uart4_pingroup[3], 33278c2ecf20Sopenharmony_ci &uart4_pingroup[4], 33288c2ecf20Sopenharmony_ci &uart4_pingroup[5], 33298c2ecf20Sopenharmony_ci &uart5_pingroup[0], 33308c2ecf20Sopenharmony_ci &uart5_pingroup[1], 33318c2ecf20Sopenharmony_ci &uart5_pingroup[2], 33328c2ecf20Sopenharmony_ci &uart5_pingroup[3], 33338c2ecf20Sopenharmony_ci &uart6_pingroup[0], 33348c2ecf20Sopenharmony_ci &uart6_pingroup[1], 33358c2ecf20Sopenharmony_ci &rs485_pingroup, 33368c2ecf20Sopenharmony_ci &touchscreen_pingroup, 33378c2ecf20Sopenharmony_ci &can0_pingroup, 33388c2ecf20Sopenharmony_ci &can1_pingroup, 33398c2ecf20Sopenharmony_ci &pwm0_1_pingroup[0], 33408c2ecf20Sopenharmony_ci &pwm0_1_pingroup[1], 33418c2ecf20Sopenharmony_ci &pwm0_1_pingroup[2], 33428c2ecf20Sopenharmony_ci &pwm0_1_pingroup[3], 33438c2ecf20Sopenharmony_ci &pwm0_1_pingroup[4], 33448c2ecf20Sopenharmony_ci &pwm0_1_pingroup[5], 33458c2ecf20Sopenharmony_ci &pwm0_1_pingroup[6], 33468c2ecf20Sopenharmony_ci &pwm2_pingroup[0], 33478c2ecf20Sopenharmony_ci &pwm2_pingroup[1], 33488c2ecf20Sopenharmony_ci &pwm2_pingroup[2], 33498c2ecf20Sopenharmony_ci &pwm2_pingroup[3], 33508c2ecf20Sopenharmony_ci &pwm2_pingroup[4], 33518c2ecf20Sopenharmony_ci &pwm2_pingroup[5], 33528c2ecf20Sopenharmony_ci &pwm2_pingroup[6], 33538c2ecf20Sopenharmony_ci &pwm3_pingroup[0], 33548c2ecf20Sopenharmony_ci &pwm3_pingroup[1], 33558c2ecf20Sopenharmony_ci &pwm3_pingroup[2], 33568c2ecf20Sopenharmony_ci &pwm3_pingroup[3], 33578c2ecf20Sopenharmony_ci &pwm3_pingroup[4], 33588c2ecf20Sopenharmony_ci &pwm3_pingroup[5], 33598c2ecf20Sopenharmony_ci &ssp1_pingroup[0], 33608c2ecf20Sopenharmony_ci &ssp1_pingroup[1], 33618c2ecf20Sopenharmony_ci &ssp1_pingroup[2], 33628c2ecf20Sopenharmony_ci &ssp1_pingroup[3], 33638c2ecf20Sopenharmony_ci &ssp1_pingroup[4], 33648c2ecf20Sopenharmony_ci &ssp2_pingroup[0], 33658c2ecf20Sopenharmony_ci &ssp2_pingroup[1], 33668c2ecf20Sopenharmony_ci &ssp2_pingroup[2], 33678c2ecf20Sopenharmony_ci &ssp2_pingroup[3], 33688c2ecf20Sopenharmony_ci &ssp2_pingroup[4], 33698c2ecf20Sopenharmony_ci &mii2_pingroup, 33708c2ecf20Sopenharmony_ci &mii0_1_pingroup[0], 33718c2ecf20Sopenharmony_ci &mii0_1_pingroup[1], 33728c2ecf20Sopenharmony_ci &i2c1_pingroup[0], 33738c2ecf20Sopenharmony_ci &i2c1_pingroup[1], 33748c2ecf20Sopenharmony_ci &i2c2_pingroup[0], 33758c2ecf20Sopenharmony_ci &i2c2_pingroup[1], 33768c2ecf20Sopenharmony_ci &i2c2_pingroup[2], 33778c2ecf20Sopenharmony_ci &i2c2_pingroup[3], 33788c2ecf20Sopenharmony_ci &i2c2_pingroup[4], 33798c2ecf20Sopenharmony_ci}; 33808c2ecf20Sopenharmony_ci 33818c2ecf20Sopenharmony_ci/* functions */ 33828c2ecf20Sopenharmony_cistatic struct spear_function *spear320_functions[] = { 33838c2ecf20Sopenharmony_ci SPEAR3XX_COMMON_FUNCTIONS, 33848c2ecf20Sopenharmony_ci &clcd_function, 33858c2ecf20Sopenharmony_ci &emi_function, 33868c2ecf20Sopenharmony_ci &fsmc_function, 33878c2ecf20Sopenharmony_ci &spp_function, 33888c2ecf20Sopenharmony_ci &sdhci_function, 33898c2ecf20Sopenharmony_ci &i2s_function, 33908c2ecf20Sopenharmony_ci &uart1_function, 33918c2ecf20Sopenharmony_ci &uart1_modem_function, 33928c2ecf20Sopenharmony_ci &uart2_function, 33938c2ecf20Sopenharmony_ci &uart3_function, 33948c2ecf20Sopenharmony_ci &uart4_function, 33958c2ecf20Sopenharmony_ci &uart5_function, 33968c2ecf20Sopenharmony_ci &uart6_function, 33978c2ecf20Sopenharmony_ci &rs485_function, 33988c2ecf20Sopenharmony_ci &touchscreen_function, 33998c2ecf20Sopenharmony_ci &can0_function, 34008c2ecf20Sopenharmony_ci &can1_function, 34018c2ecf20Sopenharmony_ci &pwm0_1_function, 34028c2ecf20Sopenharmony_ci &pwm2_function, 34038c2ecf20Sopenharmony_ci &pwm3_function, 34048c2ecf20Sopenharmony_ci &ssp1_function, 34058c2ecf20Sopenharmony_ci &ssp2_function, 34068c2ecf20Sopenharmony_ci &mii2_function, 34078c2ecf20Sopenharmony_ci &mii0_1_function, 34088c2ecf20Sopenharmony_ci &i2c1_function, 34098c2ecf20Sopenharmony_ci &i2c2_function, 34108c2ecf20Sopenharmony_ci}; 34118c2ecf20Sopenharmony_ci 34128c2ecf20Sopenharmony_cistatic const struct of_device_id spear320_pinctrl_of_match[] = { 34138c2ecf20Sopenharmony_ci { 34148c2ecf20Sopenharmony_ci .compatible = "st,spear320-pinmux", 34158c2ecf20Sopenharmony_ci }, 34168c2ecf20Sopenharmony_ci {}, 34178c2ecf20Sopenharmony_ci}; 34188c2ecf20Sopenharmony_ci 34198c2ecf20Sopenharmony_cistatic int spear320_pinctrl_probe(struct platform_device *pdev) 34208c2ecf20Sopenharmony_ci{ 34218c2ecf20Sopenharmony_ci spear3xx_machdata.groups = spear320_pingroups; 34228c2ecf20Sopenharmony_ci spear3xx_machdata.ngroups = ARRAY_SIZE(spear320_pingroups); 34238c2ecf20Sopenharmony_ci spear3xx_machdata.functions = spear320_functions; 34248c2ecf20Sopenharmony_ci spear3xx_machdata.nfunctions = ARRAY_SIZE(spear320_functions); 34258c2ecf20Sopenharmony_ci 34268c2ecf20Sopenharmony_ci spear3xx_machdata.modes_supported = true; 34278c2ecf20Sopenharmony_ci spear3xx_machdata.pmx_modes = spear320_pmx_modes; 34288c2ecf20Sopenharmony_ci spear3xx_machdata.npmx_modes = ARRAY_SIZE(spear320_pmx_modes); 34298c2ecf20Sopenharmony_ci 34308c2ecf20Sopenharmony_ci pmx_init_addr(&spear3xx_machdata, PMX_CONFIG_REG); 34318c2ecf20Sopenharmony_ci pmx_init_gpio_pingroup_addr(spear3xx_machdata.gpio_pingroups, 34328c2ecf20Sopenharmony_ci spear3xx_machdata.ngpio_pingroups, PMX_CONFIG_REG); 34338c2ecf20Sopenharmony_ci 34348c2ecf20Sopenharmony_ci return spear_pinctrl_probe(pdev, &spear3xx_machdata); 34358c2ecf20Sopenharmony_ci} 34368c2ecf20Sopenharmony_ci 34378c2ecf20Sopenharmony_cistatic struct platform_driver spear320_pinctrl_driver = { 34388c2ecf20Sopenharmony_ci .driver = { 34398c2ecf20Sopenharmony_ci .name = DRIVER_NAME, 34408c2ecf20Sopenharmony_ci .of_match_table = spear320_pinctrl_of_match, 34418c2ecf20Sopenharmony_ci }, 34428c2ecf20Sopenharmony_ci .probe = spear320_pinctrl_probe, 34438c2ecf20Sopenharmony_ci}; 34448c2ecf20Sopenharmony_ci 34458c2ecf20Sopenharmony_cistatic int __init spear320_pinctrl_init(void) 34468c2ecf20Sopenharmony_ci{ 34478c2ecf20Sopenharmony_ci return platform_driver_register(&spear320_pinctrl_driver); 34488c2ecf20Sopenharmony_ci} 34498c2ecf20Sopenharmony_ciarch_initcall(spear320_pinctrl_init); 3450