162306a36Sopenharmony_ci/*
262306a36Sopenharmony_ci * Driver for the ST Microelectronics SPEAr320 pinmux
362306a36Sopenharmony_ci *
462306a36Sopenharmony_ci * Copyright (C) 2012 ST Microelectronics
562306a36Sopenharmony_ci * Viresh Kumar <vireshk@kernel.org>
662306a36Sopenharmony_ci *
762306a36Sopenharmony_ci * This file is licensed under the terms of the GNU General Public
862306a36Sopenharmony_ci * License version 2. This program is licensed "as is" without any
962306a36Sopenharmony_ci * warranty of any kind, whether express or implied.
1062306a36Sopenharmony_ci */
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci#include <linux/err.h>
1362306a36Sopenharmony_ci#include <linux/init.h>
1462306a36Sopenharmony_ci#include <linux/mod_devicetable.h>
1562306a36Sopenharmony_ci#include <linux/platform_device.h>
1662306a36Sopenharmony_ci#include "pinctrl-spear3xx.h"
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci#define DRIVER_NAME "spear320-pinmux"
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_ci/* addresses */
2162306a36Sopenharmony_ci#define PMX_CONFIG_REG			0x0C
2262306a36Sopenharmony_ci#define MODE_CONFIG_REG			0x10
2362306a36Sopenharmony_ci#define MODE_EXT_CONFIG_REG		0x18
2462306a36Sopenharmony_ci
2562306a36Sopenharmony_ci/* modes */
2662306a36Sopenharmony_ci#define AUTO_NET_SMII_MODE	(1 << 0)
2762306a36Sopenharmony_ci#define AUTO_NET_MII_MODE	(1 << 1)
2862306a36Sopenharmony_ci#define AUTO_EXP_MODE		(1 << 2)
2962306a36Sopenharmony_ci#define SMALL_PRINTERS_MODE	(1 << 3)
3062306a36Sopenharmony_ci#define EXTENDED_MODE		(1 << 4)
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_cistatic struct spear_pmx_mode pmx_mode_auto_net_smii = {
3362306a36Sopenharmony_ci	.name = "Automation Networking SMII mode",
3462306a36Sopenharmony_ci	.mode = AUTO_NET_SMII_MODE,
3562306a36Sopenharmony_ci	.reg = MODE_CONFIG_REG,
3662306a36Sopenharmony_ci	.mask = 0x00000007,
3762306a36Sopenharmony_ci	.val = 0x0,
3862306a36Sopenharmony_ci};
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_cistatic struct spear_pmx_mode pmx_mode_auto_net_mii = {
4162306a36Sopenharmony_ci	.name = "Automation Networking MII mode",
4262306a36Sopenharmony_ci	.mode = AUTO_NET_MII_MODE,
4362306a36Sopenharmony_ci	.reg = MODE_CONFIG_REG,
4462306a36Sopenharmony_ci	.mask = 0x00000007,
4562306a36Sopenharmony_ci	.val = 0x1,
4662306a36Sopenharmony_ci};
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_cistatic struct spear_pmx_mode pmx_mode_auto_exp = {
4962306a36Sopenharmony_ci	.name = "Automation Expanded mode",
5062306a36Sopenharmony_ci	.mode = AUTO_EXP_MODE,
5162306a36Sopenharmony_ci	.reg = MODE_CONFIG_REG,
5262306a36Sopenharmony_ci	.mask = 0x00000007,
5362306a36Sopenharmony_ci	.val = 0x2,
5462306a36Sopenharmony_ci};
5562306a36Sopenharmony_ci
5662306a36Sopenharmony_cistatic struct spear_pmx_mode pmx_mode_small_printers = {
5762306a36Sopenharmony_ci	.name = "Small Printers mode",
5862306a36Sopenharmony_ci	.mode = SMALL_PRINTERS_MODE,
5962306a36Sopenharmony_ci	.reg = MODE_CONFIG_REG,
6062306a36Sopenharmony_ci	.mask = 0x00000007,
6162306a36Sopenharmony_ci	.val = 0x3,
6262306a36Sopenharmony_ci};
6362306a36Sopenharmony_ci
6462306a36Sopenharmony_cistatic struct spear_pmx_mode pmx_mode_extended = {
6562306a36Sopenharmony_ci	.name = "extended mode",
6662306a36Sopenharmony_ci	.mode = EXTENDED_MODE,
6762306a36Sopenharmony_ci	.reg = MODE_EXT_CONFIG_REG,
6862306a36Sopenharmony_ci	.mask = 0x00000001,
6962306a36Sopenharmony_ci	.val = 0x1,
7062306a36Sopenharmony_ci};
7162306a36Sopenharmony_ci
7262306a36Sopenharmony_cistatic struct spear_pmx_mode *spear320_pmx_modes[] = {
7362306a36Sopenharmony_ci	&pmx_mode_auto_net_smii,
7462306a36Sopenharmony_ci	&pmx_mode_auto_net_mii,
7562306a36Sopenharmony_ci	&pmx_mode_auto_exp,
7662306a36Sopenharmony_ci	&pmx_mode_small_printers,
7762306a36Sopenharmony_ci	&pmx_mode_extended,
7862306a36Sopenharmony_ci};
7962306a36Sopenharmony_ci
8062306a36Sopenharmony_ci/* Extended mode registers and their offsets */
8162306a36Sopenharmony_ci#define EXT_CTRL_REG				0x0018
8262306a36Sopenharmony_ci	#define MII_MDIO_MASK			(1 << 4)
8362306a36Sopenharmony_ci	#define MII_MDIO_10_11_VAL		0
8462306a36Sopenharmony_ci	#define MII_MDIO_81_VAL			(1 << 4)
8562306a36Sopenharmony_ci	#define EMI_FSMC_DYNAMIC_MUX_MASK	(1 << 5)
8662306a36Sopenharmony_ci	#define MAC_MODE_MII			0
8762306a36Sopenharmony_ci	#define MAC_MODE_RMII			1
8862306a36Sopenharmony_ci	#define MAC_MODE_SMII			2
8962306a36Sopenharmony_ci	#define MAC_MODE_SS_SMII		3
9062306a36Sopenharmony_ci	#define MAC_MODE_MASK			0x3
9162306a36Sopenharmony_ci	#define MAC1_MODE_SHIFT			16
9262306a36Sopenharmony_ci	#define MAC2_MODE_SHIFT			18
9362306a36Sopenharmony_ci
9462306a36Sopenharmony_ci#define IP_SEL_PAD_0_9_REG			0x00A4
9562306a36Sopenharmony_ci	#define PMX_PL_0_1_MASK			(0x3F << 0)
9662306a36Sopenharmony_ci	#define PMX_UART2_PL_0_1_VAL		0x0
9762306a36Sopenharmony_ci	#define PMX_I2C2_PL_0_1_VAL		(0x4 | (0x4 << 3))
9862306a36Sopenharmony_ci
9962306a36Sopenharmony_ci	#define PMX_PL_2_3_MASK			(0x3F << 6)
10062306a36Sopenharmony_ci	#define PMX_I2C2_PL_2_3_VAL		0x0
10162306a36Sopenharmony_ci	#define PMX_UART6_PL_2_3_VAL		((0x1 << 6) | (0x1 << 9))
10262306a36Sopenharmony_ci	#define PMX_UART1_ENH_PL_2_3_VAL	((0x4 << 6) | (0x4 << 9))
10362306a36Sopenharmony_ci
10462306a36Sopenharmony_ci	#define PMX_PL_4_5_MASK			(0x3F << 12)
10562306a36Sopenharmony_ci	#define PMX_UART5_PL_4_5_VAL		((0x1 << 12) | (0x1 << 15))
10662306a36Sopenharmony_ci	#define PMX_UART1_ENH_PL_4_5_VAL	((0x4 << 12) | (0x4 << 15))
10762306a36Sopenharmony_ci	#define PMX_PL_5_MASK			(0x7 << 15)
10862306a36Sopenharmony_ci	#define PMX_TOUCH_Y_PL_5_VAL		0x0
10962306a36Sopenharmony_ci
11062306a36Sopenharmony_ci	#define PMX_PL_6_7_MASK			(0x3F << 18)
11162306a36Sopenharmony_ci	#define PMX_PL_6_MASK			(0x7 << 18)
11262306a36Sopenharmony_ci	#define PMX_PL_7_MASK			(0x7 << 21)
11362306a36Sopenharmony_ci	#define PMX_UART4_PL_6_7_VAL		((0x1 << 18) | (0x1 << 21))
11462306a36Sopenharmony_ci	#define PMX_PWM_3_PL_6_VAL		(0x2 << 18)
11562306a36Sopenharmony_ci	#define PMX_PWM_2_PL_7_VAL		(0x2 << 21)
11662306a36Sopenharmony_ci	#define PMX_UART1_ENH_PL_6_7_VAL	((0x4 << 18) | (0x4 << 21))
11762306a36Sopenharmony_ci
11862306a36Sopenharmony_ci	#define PMX_PL_8_9_MASK			(0x3F << 24)
11962306a36Sopenharmony_ci	#define PMX_UART3_PL_8_9_VAL		((0x1 << 24) | (0x1 << 27))
12062306a36Sopenharmony_ci	#define PMX_PWM_0_1_PL_8_9_VAL		((0x2 << 24) | (0x2 << 27))
12162306a36Sopenharmony_ci	#define PMX_I2C1_PL_8_9_VAL		((0x4 << 24) | (0x4 << 27))
12262306a36Sopenharmony_ci
12362306a36Sopenharmony_ci#define IP_SEL_PAD_10_19_REG			0x00A8
12462306a36Sopenharmony_ci	#define PMX_PL_10_11_MASK		(0x3F << 0)
12562306a36Sopenharmony_ci	#define PMX_SMII_PL_10_11_VAL		0
12662306a36Sopenharmony_ci	#define PMX_RMII_PL_10_11_VAL		((0x4 << 0) | (0x4 << 3))
12762306a36Sopenharmony_ci
12862306a36Sopenharmony_ci	#define PMX_PL_12_MASK			(0x7 << 6)
12962306a36Sopenharmony_ci	#define PMX_PWM3_PL_12_VAL		0
13062306a36Sopenharmony_ci	#define PMX_SDHCI_CD_PL_12_VAL		(0x4 << 6)
13162306a36Sopenharmony_ci
13262306a36Sopenharmony_ci	#define PMX_PL_13_14_MASK		(0x3F << 9)
13362306a36Sopenharmony_ci	#define PMX_PL_13_MASK			(0x7 << 9)
13462306a36Sopenharmony_ci	#define PMX_PL_14_MASK			(0x7 << 12)
13562306a36Sopenharmony_ci	#define PMX_SSP2_PL_13_14_15_16_VAL	0
13662306a36Sopenharmony_ci	#define PMX_UART4_PL_13_14_VAL		((0x1 << 9) | (0x1 << 12))
13762306a36Sopenharmony_ci	#define PMX_RMII_PL_13_14_VAL		((0x4 << 9) | (0x4 << 12))
13862306a36Sopenharmony_ci	#define PMX_PWM2_PL_13_VAL		(0x2 << 9)
13962306a36Sopenharmony_ci	#define PMX_PWM1_PL_14_VAL		(0x2 << 12)
14062306a36Sopenharmony_ci
14162306a36Sopenharmony_ci	#define PMX_PL_15_MASK			(0x7 << 15)
14262306a36Sopenharmony_ci	#define PMX_PWM0_PL_15_VAL		(0x2 << 15)
14362306a36Sopenharmony_ci	#define PMX_PL_15_16_MASK		(0x3F << 15)
14462306a36Sopenharmony_ci	#define PMX_UART3_PL_15_16_VAL		((0x1 << 15) | (0x1 << 18))
14562306a36Sopenharmony_ci	#define PMX_RMII_PL_15_16_VAL		((0x4 << 15) | (0x4 << 18))
14662306a36Sopenharmony_ci
14762306a36Sopenharmony_ci	#define PMX_PL_17_18_MASK		(0x3F << 21)
14862306a36Sopenharmony_ci	#define PMX_SSP1_PL_17_18_19_20_VAL	0
14962306a36Sopenharmony_ci	#define PMX_RMII_PL_17_18_VAL		((0x4 << 21) | (0x4 << 24))
15062306a36Sopenharmony_ci
15162306a36Sopenharmony_ci	#define PMX_PL_19_MASK			(0x7 << 27)
15262306a36Sopenharmony_ci	#define PMX_I2C2_PL_19_VAL		(0x1 << 27)
15362306a36Sopenharmony_ci	#define PMX_RMII_PL_19_VAL		(0x4 << 27)
15462306a36Sopenharmony_ci
15562306a36Sopenharmony_ci#define IP_SEL_PAD_20_29_REG			0x00AC
15662306a36Sopenharmony_ci	#define PMX_PL_20_MASK			(0x7 << 0)
15762306a36Sopenharmony_ci	#define PMX_I2C2_PL_20_VAL		(0x1 << 0)
15862306a36Sopenharmony_ci	#define PMX_RMII_PL_20_VAL		(0x4 << 0)
15962306a36Sopenharmony_ci
16062306a36Sopenharmony_ci	#define PMX_PL_21_TO_27_MASK		(0x1FFFFF << 3)
16162306a36Sopenharmony_ci	#define PMX_SMII_PL_21_TO_27_VAL	0
16262306a36Sopenharmony_ci	#define PMX_RMII_PL_21_TO_27_VAL	((0x4 << 3) | (0x4 << 6) | (0x4 << 9) | (0x4 << 12) | (0x4 << 15) | (0x4 << 18) | (0x4 << 21))
16362306a36Sopenharmony_ci
16462306a36Sopenharmony_ci	#define PMX_PL_28_29_MASK		(0x3F << 24)
16562306a36Sopenharmony_ci	#define PMX_PL_28_MASK			(0x7 << 24)
16662306a36Sopenharmony_ci	#define PMX_PL_29_MASK			(0x7 << 27)
16762306a36Sopenharmony_ci	#define PMX_UART1_PL_28_29_VAL		0
16862306a36Sopenharmony_ci	#define PMX_PWM_3_PL_28_VAL		(0x4 << 24)
16962306a36Sopenharmony_ci	#define PMX_PWM_2_PL_29_VAL		(0x4 << 27)
17062306a36Sopenharmony_ci
17162306a36Sopenharmony_ci#define IP_SEL_PAD_30_39_REG			0x00B0
17262306a36Sopenharmony_ci	#define PMX_PL_30_31_MASK		(0x3F << 0)
17362306a36Sopenharmony_ci	#define PMX_CAN1_PL_30_31_VAL		(0)
17462306a36Sopenharmony_ci	#define PMX_PL_30_MASK			(0x7 << 0)
17562306a36Sopenharmony_ci	#define PMX_PL_31_MASK			(0x7 << 3)
17662306a36Sopenharmony_ci	#define PMX_PWM1_EXT_PL_30_VAL		(0x4 << 0)
17762306a36Sopenharmony_ci	#define PMX_PWM0_EXT_PL_31_VAL		(0x4 << 3)
17862306a36Sopenharmony_ci	#define PMX_UART1_ENH_PL_31_VAL		(0x3 << 3)
17962306a36Sopenharmony_ci
18062306a36Sopenharmony_ci	#define PMX_PL_32_33_MASK		(0x3F << 6)
18162306a36Sopenharmony_ci	#define PMX_CAN0_PL_32_33_VAL		0
18262306a36Sopenharmony_ci	#define PMX_UART1_ENH_PL_32_33_VAL	((0x3 << 6) | (0x3 << 9))
18362306a36Sopenharmony_ci	#define PMX_SSP2_PL_32_33_VAL		((0x4 << 6) | (0x4 << 9))
18462306a36Sopenharmony_ci
18562306a36Sopenharmony_ci	#define PMX_PL_34_MASK			(0x7 << 12)
18662306a36Sopenharmony_ci	#define PMX_PWM2_PL_34_VAL		0
18762306a36Sopenharmony_ci	#define PMX_UART1_ENH_PL_34_VAL		(0x2 << 12)
18862306a36Sopenharmony_ci	#define PMX_SSP2_PL_34_VAL		(0x4 << 12)
18962306a36Sopenharmony_ci
19062306a36Sopenharmony_ci	#define PMX_PL_35_MASK			(0x7 << 15)
19162306a36Sopenharmony_ci	#define PMX_I2S_REF_CLK_PL_35_VAL	0
19262306a36Sopenharmony_ci	#define PMX_UART1_ENH_PL_35_VAL		(0x2 << 15)
19362306a36Sopenharmony_ci	#define PMX_SSP2_PL_35_VAL		(0x4 << 15)
19462306a36Sopenharmony_ci
19562306a36Sopenharmony_ci	#define PMX_PL_36_MASK			(0x7 << 18)
19662306a36Sopenharmony_ci	#define PMX_TOUCH_X_PL_36_VAL		0
19762306a36Sopenharmony_ci	#define PMX_UART1_ENH_PL_36_VAL		(0x2 << 18)
19862306a36Sopenharmony_ci	#define PMX_SSP1_PL_36_VAL		(0x4 << 18)
19962306a36Sopenharmony_ci
20062306a36Sopenharmony_ci	#define PMX_PL_37_38_MASK		(0x3F << 21)
20162306a36Sopenharmony_ci	#define PMX_PWM0_1_PL_37_38_VAL		0
20262306a36Sopenharmony_ci	#define PMX_UART5_PL_37_38_VAL		((0x2 << 21) | (0x2 << 24))
20362306a36Sopenharmony_ci	#define PMX_SSP1_PL_37_38_VAL		((0x4 << 21) | (0x4 << 24))
20462306a36Sopenharmony_ci
20562306a36Sopenharmony_ci	#define PMX_PL_39_MASK			(0x7 << 27)
20662306a36Sopenharmony_ci	#define PMX_I2S_PL_39_VAL		0
20762306a36Sopenharmony_ci	#define PMX_UART4_PL_39_VAL		(0x2 << 27)
20862306a36Sopenharmony_ci	#define PMX_SSP1_PL_39_VAL		(0x4 << 27)
20962306a36Sopenharmony_ci
21062306a36Sopenharmony_ci#define IP_SEL_PAD_40_49_REG			0x00B4
21162306a36Sopenharmony_ci	#define PMX_PL_40_MASK			(0x7 << 0)
21262306a36Sopenharmony_ci	#define PMX_I2S_PL_40_VAL		0
21362306a36Sopenharmony_ci	#define PMX_UART4_PL_40_VAL		(0x2 << 0)
21462306a36Sopenharmony_ci	#define PMX_PWM3_PL_40_VAL		(0x4 << 0)
21562306a36Sopenharmony_ci
21662306a36Sopenharmony_ci	#define PMX_PL_41_42_MASK		(0x3F << 3)
21762306a36Sopenharmony_ci	#define PMX_PL_41_MASK			(0x7 << 3)
21862306a36Sopenharmony_ci	#define PMX_PL_42_MASK			(0x7 << 6)
21962306a36Sopenharmony_ci	#define PMX_I2S_PL_41_42_VAL		0
22062306a36Sopenharmony_ci	#define PMX_UART3_PL_41_42_VAL		((0x2 << 3) | (0x2 << 6))
22162306a36Sopenharmony_ci	#define PMX_PWM2_PL_41_VAL		(0x4 << 3)
22262306a36Sopenharmony_ci	#define PMX_PWM1_PL_42_VAL		(0x4 << 6)
22362306a36Sopenharmony_ci
22462306a36Sopenharmony_ci	#define PMX_PL_43_MASK			(0x7 << 9)
22562306a36Sopenharmony_ci	#define PMX_SDHCI_PL_43_VAL		0
22662306a36Sopenharmony_ci	#define PMX_UART1_ENH_PL_43_VAL		(0x2 << 9)
22762306a36Sopenharmony_ci	#define PMX_PWM0_PL_43_VAL		(0x4 << 9)
22862306a36Sopenharmony_ci
22962306a36Sopenharmony_ci	#define PMX_PL_44_45_MASK		(0x3F << 12)
23062306a36Sopenharmony_ci	#define PMX_SDHCI_PL_44_45_VAL	0
23162306a36Sopenharmony_ci	#define PMX_UART1_ENH_PL_44_45_VAL	((0x2 << 12) | (0x2 << 15))
23262306a36Sopenharmony_ci	#define PMX_SSP2_PL_44_45_VAL		((0x4 << 12) | (0x4 << 15))
23362306a36Sopenharmony_ci
23462306a36Sopenharmony_ci	#define PMX_PL_46_47_MASK		(0x3F << 18)
23562306a36Sopenharmony_ci	#define PMX_SDHCI_PL_46_47_VAL	0
23662306a36Sopenharmony_ci	#define PMX_FSMC_EMI_PL_46_47_VAL	((0x2 << 18) | (0x2 << 21))
23762306a36Sopenharmony_ci	#define PMX_SSP2_PL_46_47_VAL		((0x4 << 18) | (0x4 << 21))
23862306a36Sopenharmony_ci
23962306a36Sopenharmony_ci	#define PMX_PL_48_49_MASK		(0x3F << 24)
24062306a36Sopenharmony_ci	#define PMX_SDHCI_PL_48_49_VAL	0
24162306a36Sopenharmony_ci	#define PMX_FSMC_EMI_PL_48_49_VAL	((0x2 << 24) | (0x2 << 27))
24262306a36Sopenharmony_ci	#define PMX_SSP1_PL_48_49_VAL		((0x4 << 24) | (0x4 << 27))
24362306a36Sopenharmony_ci
24462306a36Sopenharmony_ci#define IP_SEL_PAD_50_59_REG			0x00B8
24562306a36Sopenharmony_ci	#define PMX_PL_50_51_MASK		(0x3F << 0)
24662306a36Sopenharmony_ci	#define PMX_EMI_PL_50_51_VAL		((0x2 << 0) | (0x2 << 3))
24762306a36Sopenharmony_ci	#define PMX_SSP1_PL_50_51_VAL		((0x4 << 0) | (0x4 << 3))
24862306a36Sopenharmony_ci	#define PMX_PL_50_MASK			(0x7 << 0)
24962306a36Sopenharmony_ci	#define PMX_PL_51_MASK			(0x7 << 3)
25062306a36Sopenharmony_ci	#define PMX_SDHCI_PL_50_VAL		0
25162306a36Sopenharmony_ci	#define PMX_SDHCI_CD_PL_51_VAL		0
25262306a36Sopenharmony_ci
25362306a36Sopenharmony_ci	#define PMX_PL_52_53_MASK		(0x3F << 6)
25462306a36Sopenharmony_ci	#define PMX_FSMC_PL_52_53_VAL		0
25562306a36Sopenharmony_ci	#define PMX_EMI_PL_52_53_VAL		((0x2 << 6) | (0x2 << 9))
25662306a36Sopenharmony_ci	#define PMX_UART3_PL_52_53_VAL		((0x4 << 6) | (0x4 << 9))
25762306a36Sopenharmony_ci
25862306a36Sopenharmony_ci	#define PMX_PL_54_55_56_MASK		(0x1FF << 12)
25962306a36Sopenharmony_ci	#define PMX_FSMC_EMI_PL_54_55_56_VAL	((0x2 << 12) | (0x2 << 15) | (0x2 << 18))
26062306a36Sopenharmony_ci
26162306a36Sopenharmony_ci	#define PMX_PL_57_MASK			(0x7 << 21)
26262306a36Sopenharmony_ci	#define PMX_FSMC_PL_57_VAL		0
26362306a36Sopenharmony_ci	#define PMX_PWM3_PL_57_VAL		(0x4 << 21)
26462306a36Sopenharmony_ci
26562306a36Sopenharmony_ci	#define PMX_PL_58_59_MASK		(0x3F << 24)
26662306a36Sopenharmony_ci	#define PMX_PL_58_MASK			(0x7 << 24)
26762306a36Sopenharmony_ci	#define PMX_PL_59_MASK			(0x7 << 27)
26862306a36Sopenharmony_ci	#define PMX_FSMC_EMI_PL_58_59_VAL	((0x2 << 24) | (0x2 << 27))
26962306a36Sopenharmony_ci	#define PMX_PWM2_PL_58_VAL		(0x4 << 24)
27062306a36Sopenharmony_ci	#define PMX_PWM1_PL_59_VAL		(0x4 << 27)
27162306a36Sopenharmony_ci
27262306a36Sopenharmony_ci#define IP_SEL_PAD_60_69_REG			0x00BC
27362306a36Sopenharmony_ci	#define PMX_PL_60_MASK			(0x7 << 0)
27462306a36Sopenharmony_ci	#define PMX_FSMC_PL_60_VAL		0
27562306a36Sopenharmony_ci	#define PMX_PWM0_PL_60_VAL		(0x4 << 0)
27662306a36Sopenharmony_ci
27762306a36Sopenharmony_ci	#define PMX_PL_61_TO_64_MASK		(0xFFF << 3)
27862306a36Sopenharmony_ci	#define PMX_FSMC_PL_61_TO_64_VAL	((0x2 << 3) | (0x2 << 6) | (0x2 << 9) | (0x2 << 12))
27962306a36Sopenharmony_ci	#define PMX_SSP2_PL_61_TO_64_VAL	((0x4 << 3) | (0x4 << 6) | (0x4 << 9) | (0x4 << 12))
28062306a36Sopenharmony_ci
28162306a36Sopenharmony_ci	#define PMX_PL_65_TO_68_MASK		(0xFFF << 15)
28262306a36Sopenharmony_ci	#define PMX_FSMC_PL_65_TO_68_VAL	((0x2 << 15) | (0x2 << 18) | (0x2 << 21) | (0x2 << 24))
28362306a36Sopenharmony_ci	#define PMX_SSP1_PL_65_TO_68_VAL	((0x4 << 15) | (0x4 << 18) | (0x4 << 21) | (0x4 << 24))
28462306a36Sopenharmony_ci
28562306a36Sopenharmony_ci	#define PMX_PL_69_MASK			(0x7 << 27)
28662306a36Sopenharmony_ci	#define PMX_CLCD_PL_69_VAL		(0)
28762306a36Sopenharmony_ci	#define PMX_EMI_PL_69_VAL		(0x2 << 27)
28862306a36Sopenharmony_ci	#define PMX_SPP_PL_69_VAL		(0x3 << 27)
28962306a36Sopenharmony_ci	#define PMX_UART5_PL_69_VAL		(0x4 << 27)
29062306a36Sopenharmony_ci
29162306a36Sopenharmony_ci#define IP_SEL_PAD_70_79_REG			0x00C0
29262306a36Sopenharmony_ci	#define PMX_PL_70_MASK			(0x7 << 0)
29362306a36Sopenharmony_ci	#define PMX_CLCD_PL_70_VAL		(0)
29462306a36Sopenharmony_ci	#define PMX_FSMC_EMI_PL_70_VAL		(0x2 << 0)
29562306a36Sopenharmony_ci	#define PMX_SPP_PL_70_VAL		(0x3 << 0)
29662306a36Sopenharmony_ci	#define PMX_UART5_PL_70_VAL		(0x4 << 0)
29762306a36Sopenharmony_ci
29862306a36Sopenharmony_ci	#define PMX_PL_71_72_MASK		(0x3F << 3)
29962306a36Sopenharmony_ci	#define PMX_CLCD_PL_71_72_VAL		(0)
30062306a36Sopenharmony_ci	#define PMX_FSMC_EMI_PL_71_72_VAL	((0x2 << 3) | (0x2 << 6))
30162306a36Sopenharmony_ci	#define PMX_SPP_PL_71_72_VAL		((0x3 << 3) | (0x3 << 6))
30262306a36Sopenharmony_ci	#define PMX_UART4_PL_71_72_VAL		((0x4 << 3) | (0x4 << 6))
30362306a36Sopenharmony_ci
30462306a36Sopenharmony_ci	#define PMX_PL_73_MASK			(0x7 << 9)
30562306a36Sopenharmony_ci	#define PMX_CLCD_PL_73_VAL		(0)
30662306a36Sopenharmony_ci	#define PMX_FSMC_EMI_PL_73_VAL		(0x2 << 9)
30762306a36Sopenharmony_ci	#define PMX_SPP_PL_73_VAL		(0x3 << 9)
30862306a36Sopenharmony_ci	#define PMX_UART3_PL_73_VAL		(0x4 << 9)
30962306a36Sopenharmony_ci
31062306a36Sopenharmony_ci	#define PMX_PL_74_MASK			(0x7 << 12)
31162306a36Sopenharmony_ci	#define PMX_CLCD_PL_74_VAL		(0)
31262306a36Sopenharmony_ci	#define PMX_EMI_PL_74_VAL		(0x2 << 12)
31362306a36Sopenharmony_ci	#define PMX_SPP_PL_74_VAL		(0x3 << 12)
31462306a36Sopenharmony_ci	#define PMX_UART3_PL_74_VAL		(0x4 << 12)
31562306a36Sopenharmony_ci
31662306a36Sopenharmony_ci	#define PMX_PL_75_76_MASK		(0x3F << 15)
31762306a36Sopenharmony_ci	#define PMX_CLCD_PL_75_76_VAL		(0)
31862306a36Sopenharmony_ci	#define PMX_EMI_PL_75_76_VAL		((0x2 << 15) | (0x2 << 18))
31962306a36Sopenharmony_ci	#define PMX_SPP_PL_75_76_VAL		((0x3 << 15) | (0x3 << 18))
32062306a36Sopenharmony_ci	#define PMX_I2C2_PL_75_76_VAL		((0x4 << 15) | (0x4 << 18))
32162306a36Sopenharmony_ci
32262306a36Sopenharmony_ci	#define PMX_PL_77_78_79_MASK		(0x1FF << 21)
32362306a36Sopenharmony_ci	#define PMX_CLCD_PL_77_78_79_VAL	(0)
32462306a36Sopenharmony_ci	#define PMX_EMI_PL_77_78_79_VAL		((0x2 << 21) | (0x2 << 24) | (0x2 << 27))
32562306a36Sopenharmony_ci	#define PMX_SPP_PL_77_78_79_VAL		((0x3 << 21) | (0x3 << 24) | (0x3 << 27))
32662306a36Sopenharmony_ci	#define PMX_RS485_PL_77_78_79_VAL	((0x4 << 21) | (0x4 << 24) | (0x4 << 27))
32762306a36Sopenharmony_ci
32862306a36Sopenharmony_ci#define IP_SEL_PAD_80_89_REG			0x00C4
32962306a36Sopenharmony_ci	#define PMX_PL_80_TO_85_MASK		(0x3FFFF << 0)
33062306a36Sopenharmony_ci	#define PMX_CLCD_PL_80_TO_85_VAL	0
33162306a36Sopenharmony_ci	#define PMX_MII2_PL_80_TO_85_VAL	((0x1 << 0) | (0x1 << 3) | (0x1 << 6) | (0x1 << 9) | (0x1 << 12) | (0x1 << 15))
33262306a36Sopenharmony_ci	#define PMX_EMI_PL_80_TO_85_VAL		((0x2 << 0) | (0x2 << 3) | (0x2 << 6) | (0x2 << 9) | (0x2 << 12) | (0x2 << 15))
33362306a36Sopenharmony_ci	#define PMX_SPP_PL_80_TO_85_VAL		((0x3 << 0) | (0x3 << 3) | (0x3 << 6) | (0x3 << 9) | (0x3 << 12) | (0x3 << 15))
33462306a36Sopenharmony_ci	#define PMX_UART1_ENH_PL_80_TO_85_VAL	((0x4 << 0) | (0x4 << 3) | (0x4 << 6) | (0x4 << 9) | (0x4 << 12) | (0x4 << 15))
33562306a36Sopenharmony_ci
33662306a36Sopenharmony_ci	#define PMX_PL_86_87_MASK		(0x3F << 18)
33762306a36Sopenharmony_ci	#define PMX_PL_86_MASK			(0x7 << 18)
33862306a36Sopenharmony_ci	#define PMX_PL_87_MASK			(0x7 << 21)
33962306a36Sopenharmony_ci	#define PMX_CLCD_PL_86_87_VAL		0
34062306a36Sopenharmony_ci	#define PMX_MII2_PL_86_87_VAL		((0x1 << 18) | (0x1 << 21))
34162306a36Sopenharmony_ci	#define PMX_EMI_PL_86_87_VAL		((0x2 << 18) | (0x2 << 21))
34262306a36Sopenharmony_ci	#define PMX_PWM3_PL_86_VAL		(0x4 << 18)
34362306a36Sopenharmony_ci	#define PMX_PWM2_PL_87_VAL		(0x4 << 21)
34462306a36Sopenharmony_ci
34562306a36Sopenharmony_ci	#define PMX_PL_88_89_MASK		(0x3F << 24)
34662306a36Sopenharmony_ci	#define PMX_CLCD_PL_88_89_VAL		0
34762306a36Sopenharmony_ci	#define PMX_MII2_PL_88_89_VAL		((0x1 << 24) | (0x1 << 27))
34862306a36Sopenharmony_ci	#define PMX_EMI_PL_88_89_VAL		((0x2 << 24) | (0x2 << 27))
34962306a36Sopenharmony_ci	#define PMX_UART6_PL_88_89_VAL		((0x3 << 24) | (0x3 << 27))
35062306a36Sopenharmony_ci	#define PMX_PWM0_1_PL_88_89_VAL		((0x4 << 24) | (0x4 << 27))
35162306a36Sopenharmony_ci
35262306a36Sopenharmony_ci#define IP_SEL_PAD_90_99_REG			0x00C8
35362306a36Sopenharmony_ci	#define PMX_PL_90_91_MASK		(0x3F << 0)
35462306a36Sopenharmony_ci	#define PMX_CLCD_PL_90_91_VAL		0
35562306a36Sopenharmony_ci	#define PMX_MII2_PL_90_91_VAL		((0x1 << 0) | (0x1 << 3))
35662306a36Sopenharmony_ci	#define PMX_EMI1_PL_90_91_VAL		((0x2 << 0) | (0x2 << 3))
35762306a36Sopenharmony_ci	#define PMX_UART5_PL_90_91_VAL		((0x3 << 0) | (0x3 << 3))
35862306a36Sopenharmony_ci	#define PMX_SSP2_PL_90_91_VAL		((0x4 << 0) | (0x4 << 3))
35962306a36Sopenharmony_ci
36062306a36Sopenharmony_ci	#define PMX_PL_92_93_MASK		(0x3F << 6)
36162306a36Sopenharmony_ci	#define PMX_CLCD_PL_92_93_VAL		0
36262306a36Sopenharmony_ci	#define PMX_MII2_PL_92_93_VAL		((0x1 << 6) | (0x1 << 9))
36362306a36Sopenharmony_ci	#define PMX_EMI1_PL_92_93_VAL		((0x2 << 6) | (0x2 << 9))
36462306a36Sopenharmony_ci	#define PMX_UART4_PL_92_93_VAL		((0x3 << 6) | (0x3 << 9))
36562306a36Sopenharmony_ci	#define PMX_SSP2_PL_92_93_VAL		((0x4 << 6) | (0x4 << 9))
36662306a36Sopenharmony_ci
36762306a36Sopenharmony_ci	#define PMX_PL_94_95_MASK		(0x3F << 12)
36862306a36Sopenharmony_ci	#define PMX_CLCD_PL_94_95_VAL		0
36962306a36Sopenharmony_ci	#define PMX_MII2_PL_94_95_VAL		((0x1 << 12) | (0x1 << 15))
37062306a36Sopenharmony_ci	#define PMX_EMI1_PL_94_95_VAL		((0x2 << 12) | (0x2 << 15))
37162306a36Sopenharmony_ci	#define PMX_UART3_PL_94_95_VAL		((0x3 << 12) | (0x3 << 15))
37262306a36Sopenharmony_ci	#define PMX_SSP1_PL_94_95_VAL		((0x4 << 12) | (0x4 << 15))
37362306a36Sopenharmony_ci
37462306a36Sopenharmony_ci	#define PMX_PL_96_97_MASK		(0x3F << 18)
37562306a36Sopenharmony_ci	#define PMX_CLCD_PL_96_97_VAL		0
37662306a36Sopenharmony_ci	#define PMX_MII2_PL_96_97_VAL		((0x1 << 18) | (0x1 << 21))
37762306a36Sopenharmony_ci	#define PMX_EMI1_PL_96_97_VAL		((0x2 << 18) | (0x2 << 21))
37862306a36Sopenharmony_ci	#define PMX_I2C2_PL_96_97_VAL		((0x3 << 18) | (0x3 << 21))
37962306a36Sopenharmony_ci	#define PMX_SSP1_PL_96_97_VAL		((0x4 << 18) | (0x4 << 21))
38062306a36Sopenharmony_ci
38162306a36Sopenharmony_ci	#define PMX_PL_98_MASK			(0x7 << 24)
38262306a36Sopenharmony_ci	#define PMX_CLCD_PL_98_VAL		0
38362306a36Sopenharmony_ci	#define PMX_I2C1_PL_98_VAL		(0x2 << 24)
38462306a36Sopenharmony_ci	#define PMX_UART3_PL_98_VAL		(0x4 << 24)
38562306a36Sopenharmony_ci
38662306a36Sopenharmony_ci	#define PMX_PL_99_MASK			(0x7 << 27)
38762306a36Sopenharmony_ci	#define PMX_SDHCI_PL_99_VAL		0
38862306a36Sopenharmony_ci	#define PMX_I2C1_PL_99_VAL		(0x2 << 27)
38962306a36Sopenharmony_ci	#define PMX_UART3_PL_99_VAL		(0x4 << 27)
39062306a36Sopenharmony_ci
39162306a36Sopenharmony_ci#define IP_SEL_MIX_PAD_REG			0x00CC
39262306a36Sopenharmony_ci	#define PMX_PL_100_101_MASK		(0x3F << 0)
39362306a36Sopenharmony_ci	#define PMX_SDHCI_PL_100_101_VAL	0
39462306a36Sopenharmony_ci	#define PMX_UART4_PL_100_101_VAL	((0x4 << 0) | (0x4 << 3))
39562306a36Sopenharmony_ci
39662306a36Sopenharmony_ci	#define PMX_SSP1_PORT_SEL_MASK		(0x7 << 8)
39762306a36Sopenharmony_ci	#define PMX_SSP1_PORT_94_TO_97_VAL	0
39862306a36Sopenharmony_ci	#define PMX_SSP1_PORT_65_TO_68_VAL	(0x1 << 8)
39962306a36Sopenharmony_ci	#define PMX_SSP1_PORT_48_TO_51_VAL	(0x2 << 8)
40062306a36Sopenharmony_ci	#define PMX_SSP1_PORT_36_TO_39_VAL	(0x3 << 8)
40162306a36Sopenharmony_ci	#define PMX_SSP1_PORT_17_TO_20_VAL	(0x4 << 8)
40262306a36Sopenharmony_ci
40362306a36Sopenharmony_ci	#define PMX_SSP2_PORT_SEL_MASK		(0x7 << 11)
40462306a36Sopenharmony_ci	#define PMX_SSP2_PORT_90_TO_93_VAL	0
40562306a36Sopenharmony_ci	#define PMX_SSP2_PORT_61_TO_64_VAL	(0x1 << 11)
40662306a36Sopenharmony_ci	#define PMX_SSP2_PORT_44_TO_47_VAL	(0x2 << 11)
40762306a36Sopenharmony_ci	#define PMX_SSP2_PORT_32_TO_35_VAL	(0x3 << 11)
40862306a36Sopenharmony_ci	#define PMX_SSP2_PORT_13_TO_16_VAL	(0x4 << 11)
40962306a36Sopenharmony_ci
41062306a36Sopenharmony_ci	#define PMX_UART1_ENH_PORT_SEL_MASK		(0x3 << 14)
41162306a36Sopenharmony_ci	#define PMX_UART1_ENH_PORT_81_TO_85_VAL		0
41262306a36Sopenharmony_ci	#define PMX_UART1_ENH_PORT_44_45_34_36_VAL	(0x1 << 14)
41362306a36Sopenharmony_ci	#define PMX_UART1_ENH_PORT_32_TO_34_36_VAL	(0x2 << 14)
41462306a36Sopenharmony_ci	#define PMX_UART1_ENH_PORT_3_TO_5_7_VAL		(0x3 << 14)
41562306a36Sopenharmony_ci
41662306a36Sopenharmony_ci	#define PMX_UART3_PORT_SEL_MASK		(0x7 << 16)
41762306a36Sopenharmony_ci	#define PMX_UART3_PORT_94_VAL		0
41862306a36Sopenharmony_ci	#define PMX_UART3_PORT_73_VAL		(0x1 << 16)
41962306a36Sopenharmony_ci	#define PMX_UART3_PORT_52_VAL		(0x2 << 16)
42062306a36Sopenharmony_ci	#define PMX_UART3_PORT_41_VAL		(0x3 << 16)
42162306a36Sopenharmony_ci	#define PMX_UART3_PORT_15_VAL		(0x4 << 16)
42262306a36Sopenharmony_ci	#define PMX_UART3_PORT_8_VAL		(0x5 << 16)
42362306a36Sopenharmony_ci	#define PMX_UART3_PORT_99_VAL		(0x6 << 16)
42462306a36Sopenharmony_ci
42562306a36Sopenharmony_ci	#define PMX_UART4_PORT_SEL_MASK		(0x7 << 19)
42662306a36Sopenharmony_ci	#define PMX_UART4_PORT_92_VAL		0
42762306a36Sopenharmony_ci	#define PMX_UART4_PORT_71_VAL		(0x1 << 19)
42862306a36Sopenharmony_ci	#define PMX_UART4_PORT_39_VAL		(0x2 << 19)
42962306a36Sopenharmony_ci	#define PMX_UART4_PORT_13_VAL		(0x3 << 19)
43062306a36Sopenharmony_ci	#define PMX_UART4_PORT_6_VAL		(0x4 << 19)
43162306a36Sopenharmony_ci	#define PMX_UART4_PORT_101_VAL		(0x5 << 19)
43262306a36Sopenharmony_ci
43362306a36Sopenharmony_ci	#define PMX_UART5_PORT_SEL_MASK		(0x3 << 22)
43462306a36Sopenharmony_ci	#define PMX_UART5_PORT_90_VAL		0
43562306a36Sopenharmony_ci	#define PMX_UART5_PORT_69_VAL		(0x1 << 22)
43662306a36Sopenharmony_ci	#define PMX_UART5_PORT_37_VAL		(0x2 << 22)
43762306a36Sopenharmony_ci	#define PMX_UART5_PORT_4_VAL		(0x3 << 22)
43862306a36Sopenharmony_ci
43962306a36Sopenharmony_ci	#define PMX_UART6_PORT_SEL_MASK		(0x1 << 24)
44062306a36Sopenharmony_ci	#define PMX_UART6_PORT_88_VAL		0
44162306a36Sopenharmony_ci	#define PMX_UART6_PORT_2_VAL		(0x1 << 24)
44262306a36Sopenharmony_ci
44362306a36Sopenharmony_ci	#define PMX_I2C1_PORT_SEL_MASK		(0x1 << 25)
44462306a36Sopenharmony_ci	#define PMX_I2C1_PORT_8_9_VAL		0
44562306a36Sopenharmony_ci	#define PMX_I2C1_PORT_98_99_VAL		(0x1 << 25)
44662306a36Sopenharmony_ci
44762306a36Sopenharmony_ci	#define PMX_I2C2_PORT_SEL_MASK		(0x3 << 26)
44862306a36Sopenharmony_ci	#define PMX_I2C2_PORT_96_97_VAL		0
44962306a36Sopenharmony_ci	#define PMX_I2C2_PORT_75_76_VAL		(0x1 << 26)
45062306a36Sopenharmony_ci	#define PMX_I2C2_PORT_19_20_VAL		(0x2 << 26)
45162306a36Sopenharmony_ci	#define PMX_I2C2_PORT_2_3_VAL		(0x3 << 26)
45262306a36Sopenharmony_ci	#define PMX_I2C2_PORT_0_1_VAL		(0x4 << 26)
45362306a36Sopenharmony_ci
45462306a36Sopenharmony_ci	#define PMX_SDHCI_CD_PORT_SEL_MASK	(0x1 << 29)
45562306a36Sopenharmony_ci	#define PMX_SDHCI_CD_PORT_12_VAL	0
45662306a36Sopenharmony_ci	#define PMX_SDHCI_CD_PORT_51_VAL	(0x1 << 29)
45762306a36Sopenharmony_ci
45862306a36Sopenharmony_ci/* Pad multiplexing for CLCD device */
45962306a36Sopenharmony_cistatic const unsigned clcd_pins[] = { 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
46062306a36Sopenharmony_ci	79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
46162306a36Sopenharmony_ci	97 };
46262306a36Sopenharmony_cistatic struct spear_muxreg clcd_muxreg[] = {
46362306a36Sopenharmony_ci	{
46462306a36Sopenharmony_ci		.reg = IP_SEL_PAD_60_69_REG,
46562306a36Sopenharmony_ci		.mask = PMX_PL_69_MASK,
46662306a36Sopenharmony_ci		.val = PMX_CLCD_PL_69_VAL,
46762306a36Sopenharmony_ci	}, {
46862306a36Sopenharmony_ci		.reg = IP_SEL_PAD_70_79_REG,
46962306a36Sopenharmony_ci		.mask = PMX_PL_70_MASK | PMX_PL_71_72_MASK | PMX_PL_73_MASK |
47062306a36Sopenharmony_ci			PMX_PL_74_MASK | PMX_PL_75_76_MASK |
47162306a36Sopenharmony_ci			PMX_PL_77_78_79_MASK,
47262306a36Sopenharmony_ci		.val = PMX_CLCD_PL_70_VAL | PMX_CLCD_PL_71_72_VAL |
47362306a36Sopenharmony_ci			PMX_CLCD_PL_73_VAL | PMX_CLCD_PL_74_VAL |
47462306a36Sopenharmony_ci			PMX_CLCD_PL_75_76_VAL | PMX_CLCD_PL_77_78_79_VAL,
47562306a36Sopenharmony_ci	}, {
47662306a36Sopenharmony_ci		.reg = IP_SEL_PAD_80_89_REG,
47762306a36Sopenharmony_ci		.mask = PMX_PL_80_TO_85_MASK | PMX_PL_86_87_MASK |
47862306a36Sopenharmony_ci			PMX_PL_88_89_MASK,
47962306a36Sopenharmony_ci		.val = PMX_CLCD_PL_80_TO_85_VAL | PMX_CLCD_PL_86_87_VAL |
48062306a36Sopenharmony_ci			PMX_CLCD_PL_88_89_VAL,
48162306a36Sopenharmony_ci	}, {
48262306a36Sopenharmony_ci		.reg = IP_SEL_PAD_90_99_REG,
48362306a36Sopenharmony_ci		.mask = PMX_PL_90_91_MASK | PMX_PL_92_93_MASK |
48462306a36Sopenharmony_ci			PMX_PL_94_95_MASK | PMX_PL_96_97_MASK | PMX_PL_98_MASK,
48562306a36Sopenharmony_ci		.val = PMX_CLCD_PL_90_91_VAL | PMX_CLCD_PL_92_93_VAL |
48662306a36Sopenharmony_ci			PMX_CLCD_PL_94_95_VAL | PMX_CLCD_PL_96_97_VAL |
48762306a36Sopenharmony_ci			PMX_CLCD_PL_98_VAL,
48862306a36Sopenharmony_ci	},
48962306a36Sopenharmony_ci};
49062306a36Sopenharmony_ci
49162306a36Sopenharmony_cistatic struct spear_modemux clcd_modemux[] = {
49262306a36Sopenharmony_ci	{
49362306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
49462306a36Sopenharmony_ci		.muxregs = clcd_muxreg,
49562306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(clcd_muxreg),
49662306a36Sopenharmony_ci	},
49762306a36Sopenharmony_ci};
49862306a36Sopenharmony_ci
49962306a36Sopenharmony_cistatic struct spear_pingroup clcd_pingroup = {
50062306a36Sopenharmony_ci	.name = "clcd_grp",
50162306a36Sopenharmony_ci	.pins = clcd_pins,
50262306a36Sopenharmony_ci	.npins = ARRAY_SIZE(clcd_pins),
50362306a36Sopenharmony_ci	.modemuxs = clcd_modemux,
50462306a36Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(clcd_modemux),
50562306a36Sopenharmony_ci};
50662306a36Sopenharmony_ci
50762306a36Sopenharmony_cistatic const char *const clcd_grps[] = { "clcd_grp" };
50862306a36Sopenharmony_cistatic struct spear_function clcd_function = {
50962306a36Sopenharmony_ci	.name = "clcd",
51062306a36Sopenharmony_ci	.groups = clcd_grps,
51162306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(clcd_grps),
51262306a36Sopenharmony_ci};
51362306a36Sopenharmony_ci
51462306a36Sopenharmony_ci/* Pad multiplexing for EMI (Parallel NOR flash) device */
51562306a36Sopenharmony_cistatic const unsigned emi_pins[] = { 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
51662306a36Sopenharmony_ci	57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
51762306a36Sopenharmony_ci	75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
51862306a36Sopenharmony_ci	93, 94, 95, 96, 97 };
51962306a36Sopenharmony_cistatic struct spear_muxreg emi_muxreg[] = {
52062306a36Sopenharmony_ci	{
52162306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
52262306a36Sopenharmony_ci		.mask = PMX_TIMER_0_1_MASK | PMX_TIMER_2_3_MASK,
52362306a36Sopenharmony_ci		.val = 0,
52462306a36Sopenharmony_ci	},
52562306a36Sopenharmony_ci};
52662306a36Sopenharmony_ci
52762306a36Sopenharmony_cistatic struct spear_muxreg emi_ext_muxreg[] = {
52862306a36Sopenharmony_ci	{
52962306a36Sopenharmony_ci		.reg = IP_SEL_PAD_40_49_REG,
53062306a36Sopenharmony_ci		.mask = PMX_PL_46_47_MASK | PMX_PL_48_49_MASK,
53162306a36Sopenharmony_ci		.val = PMX_FSMC_EMI_PL_46_47_VAL | PMX_FSMC_EMI_PL_48_49_VAL,
53262306a36Sopenharmony_ci	}, {
53362306a36Sopenharmony_ci		.reg = IP_SEL_PAD_50_59_REG,
53462306a36Sopenharmony_ci		.mask = PMX_PL_50_51_MASK | PMX_PL_52_53_MASK |
53562306a36Sopenharmony_ci			PMX_PL_54_55_56_MASK | PMX_PL_58_59_MASK,
53662306a36Sopenharmony_ci		.val = PMX_EMI_PL_50_51_VAL | PMX_EMI_PL_52_53_VAL |
53762306a36Sopenharmony_ci			PMX_FSMC_EMI_PL_54_55_56_VAL |
53862306a36Sopenharmony_ci			PMX_FSMC_EMI_PL_58_59_VAL,
53962306a36Sopenharmony_ci	}, {
54062306a36Sopenharmony_ci		.reg = IP_SEL_PAD_60_69_REG,
54162306a36Sopenharmony_ci		.mask = PMX_PL_69_MASK,
54262306a36Sopenharmony_ci		.val = PMX_EMI_PL_69_VAL,
54362306a36Sopenharmony_ci	}, {
54462306a36Sopenharmony_ci		.reg = IP_SEL_PAD_70_79_REG,
54562306a36Sopenharmony_ci		.mask = PMX_PL_70_MASK | PMX_PL_71_72_MASK | PMX_PL_73_MASK |
54662306a36Sopenharmony_ci			PMX_PL_74_MASK | PMX_PL_75_76_MASK |
54762306a36Sopenharmony_ci			PMX_PL_77_78_79_MASK,
54862306a36Sopenharmony_ci		.val = PMX_FSMC_EMI_PL_70_VAL | PMX_FSMC_EMI_PL_71_72_VAL |
54962306a36Sopenharmony_ci			PMX_FSMC_EMI_PL_73_VAL | PMX_EMI_PL_74_VAL |
55062306a36Sopenharmony_ci			PMX_EMI_PL_75_76_VAL | PMX_EMI_PL_77_78_79_VAL,
55162306a36Sopenharmony_ci	}, {
55262306a36Sopenharmony_ci		.reg = IP_SEL_PAD_80_89_REG,
55362306a36Sopenharmony_ci		.mask = PMX_PL_80_TO_85_MASK | PMX_PL_86_87_MASK |
55462306a36Sopenharmony_ci			PMX_PL_88_89_MASK,
55562306a36Sopenharmony_ci		.val = PMX_EMI_PL_80_TO_85_VAL | PMX_EMI_PL_86_87_VAL |
55662306a36Sopenharmony_ci			PMX_EMI_PL_88_89_VAL,
55762306a36Sopenharmony_ci	}, {
55862306a36Sopenharmony_ci		.reg = IP_SEL_PAD_90_99_REG,
55962306a36Sopenharmony_ci		.mask = PMX_PL_90_91_MASK | PMX_PL_92_93_MASK |
56062306a36Sopenharmony_ci			PMX_PL_94_95_MASK | PMX_PL_96_97_MASK,
56162306a36Sopenharmony_ci		.val = PMX_EMI1_PL_90_91_VAL | PMX_EMI1_PL_92_93_VAL |
56262306a36Sopenharmony_ci			PMX_EMI1_PL_94_95_VAL | PMX_EMI1_PL_96_97_VAL,
56362306a36Sopenharmony_ci	}, {
56462306a36Sopenharmony_ci		.reg = EXT_CTRL_REG,
56562306a36Sopenharmony_ci		.mask = EMI_FSMC_DYNAMIC_MUX_MASK,
56662306a36Sopenharmony_ci		.val = EMI_FSMC_DYNAMIC_MUX_MASK,
56762306a36Sopenharmony_ci	},
56862306a36Sopenharmony_ci};
56962306a36Sopenharmony_ci
57062306a36Sopenharmony_cistatic struct spear_modemux emi_modemux[] = {
57162306a36Sopenharmony_ci	{
57262306a36Sopenharmony_ci		.modes = AUTO_EXP_MODE | EXTENDED_MODE,
57362306a36Sopenharmony_ci		.muxregs = emi_muxreg,
57462306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(emi_muxreg),
57562306a36Sopenharmony_ci	}, {
57662306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
57762306a36Sopenharmony_ci		.muxregs = emi_ext_muxreg,
57862306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(emi_ext_muxreg),
57962306a36Sopenharmony_ci	},
58062306a36Sopenharmony_ci};
58162306a36Sopenharmony_ci
58262306a36Sopenharmony_cistatic struct spear_pingroup emi_pingroup = {
58362306a36Sopenharmony_ci	.name = "emi_grp",
58462306a36Sopenharmony_ci	.pins = emi_pins,
58562306a36Sopenharmony_ci	.npins = ARRAY_SIZE(emi_pins),
58662306a36Sopenharmony_ci	.modemuxs = emi_modemux,
58762306a36Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(emi_modemux),
58862306a36Sopenharmony_ci};
58962306a36Sopenharmony_ci
59062306a36Sopenharmony_cistatic const char *const emi_grps[] = { "emi_grp" };
59162306a36Sopenharmony_cistatic struct spear_function emi_function = {
59262306a36Sopenharmony_ci	.name = "emi",
59362306a36Sopenharmony_ci	.groups = emi_grps,
59462306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(emi_grps),
59562306a36Sopenharmony_ci};
59662306a36Sopenharmony_ci
59762306a36Sopenharmony_ci/* Pad multiplexing for FSMC (NAND flash) device */
59862306a36Sopenharmony_cistatic const unsigned fsmc_8bit_pins[] = { 52, 53, 54, 55, 56, 57, 58, 59, 60,
59962306a36Sopenharmony_ci	61, 62, 63, 64, 65, 66, 67, 68 };
60062306a36Sopenharmony_cistatic struct spear_muxreg fsmc_8bit_muxreg[] = {
60162306a36Sopenharmony_ci	{
60262306a36Sopenharmony_ci		.reg = IP_SEL_PAD_50_59_REG,
60362306a36Sopenharmony_ci		.mask = PMX_PL_52_53_MASK | PMX_PL_54_55_56_MASK |
60462306a36Sopenharmony_ci			PMX_PL_57_MASK | PMX_PL_58_59_MASK,
60562306a36Sopenharmony_ci		.val = PMX_FSMC_PL_52_53_VAL | PMX_FSMC_EMI_PL_54_55_56_VAL |
60662306a36Sopenharmony_ci			PMX_FSMC_PL_57_VAL | PMX_FSMC_EMI_PL_58_59_VAL,
60762306a36Sopenharmony_ci	}, {
60862306a36Sopenharmony_ci		.reg = IP_SEL_PAD_60_69_REG,
60962306a36Sopenharmony_ci		.mask = PMX_PL_60_MASK | PMX_PL_61_TO_64_MASK |
61062306a36Sopenharmony_ci			PMX_PL_65_TO_68_MASK,
61162306a36Sopenharmony_ci		.val = PMX_FSMC_PL_60_VAL | PMX_FSMC_PL_61_TO_64_VAL |
61262306a36Sopenharmony_ci			PMX_FSMC_PL_65_TO_68_VAL,
61362306a36Sopenharmony_ci	}, {
61462306a36Sopenharmony_ci		.reg = EXT_CTRL_REG,
61562306a36Sopenharmony_ci		.mask = EMI_FSMC_DYNAMIC_MUX_MASK,
61662306a36Sopenharmony_ci		.val = EMI_FSMC_DYNAMIC_MUX_MASK,
61762306a36Sopenharmony_ci	},
61862306a36Sopenharmony_ci};
61962306a36Sopenharmony_ci
62062306a36Sopenharmony_cistatic struct spear_modemux fsmc_8bit_modemux[] = {
62162306a36Sopenharmony_ci	{
62262306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
62362306a36Sopenharmony_ci		.muxregs = fsmc_8bit_muxreg,
62462306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(fsmc_8bit_muxreg),
62562306a36Sopenharmony_ci	},
62662306a36Sopenharmony_ci};
62762306a36Sopenharmony_ci
62862306a36Sopenharmony_cistatic struct spear_pingroup fsmc_8bit_pingroup = {
62962306a36Sopenharmony_ci	.name = "fsmc_8bit_grp",
63062306a36Sopenharmony_ci	.pins = fsmc_8bit_pins,
63162306a36Sopenharmony_ci	.npins = ARRAY_SIZE(fsmc_8bit_pins),
63262306a36Sopenharmony_ci	.modemuxs = fsmc_8bit_modemux,
63362306a36Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(fsmc_8bit_modemux),
63462306a36Sopenharmony_ci};
63562306a36Sopenharmony_ci
63662306a36Sopenharmony_cistatic const unsigned fsmc_16bit_pins[] = { 46, 47, 48, 49, 52, 53, 54, 55, 56,
63762306a36Sopenharmony_ci	57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 70, 71, 72, 73 };
63862306a36Sopenharmony_cistatic struct spear_muxreg fsmc_16bit_autoexp_muxreg[] = {
63962306a36Sopenharmony_ci	{
64062306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
64162306a36Sopenharmony_ci		.mask = PMX_TIMER_0_1_MASK | PMX_TIMER_2_3_MASK,
64262306a36Sopenharmony_ci		.val = 0,
64362306a36Sopenharmony_ci	},
64462306a36Sopenharmony_ci};
64562306a36Sopenharmony_ci
64662306a36Sopenharmony_cistatic struct spear_muxreg fsmc_16bit_muxreg[] = {
64762306a36Sopenharmony_ci	{
64862306a36Sopenharmony_ci		.reg = IP_SEL_PAD_40_49_REG,
64962306a36Sopenharmony_ci		.mask = PMX_PL_46_47_MASK | PMX_PL_48_49_MASK,
65062306a36Sopenharmony_ci		.val = PMX_FSMC_EMI_PL_46_47_VAL | PMX_FSMC_EMI_PL_48_49_VAL,
65162306a36Sopenharmony_ci	}, {
65262306a36Sopenharmony_ci		.reg = IP_SEL_PAD_70_79_REG,
65362306a36Sopenharmony_ci		.mask = PMX_PL_70_MASK | PMX_PL_71_72_MASK | PMX_PL_73_MASK,
65462306a36Sopenharmony_ci		.val = PMX_FSMC_EMI_PL_70_VAL | PMX_FSMC_EMI_PL_71_72_VAL |
65562306a36Sopenharmony_ci			PMX_FSMC_EMI_PL_73_VAL,
65662306a36Sopenharmony_ci	}
65762306a36Sopenharmony_ci};
65862306a36Sopenharmony_ci
65962306a36Sopenharmony_cistatic struct spear_modemux fsmc_16bit_modemux[] = {
66062306a36Sopenharmony_ci	{
66162306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
66262306a36Sopenharmony_ci		.muxregs = fsmc_8bit_muxreg,
66362306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(fsmc_8bit_muxreg),
66462306a36Sopenharmony_ci	}, {
66562306a36Sopenharmony_ci		.modes = AUTO_EXP_MODE | EXTENDED_MODE,
66662306a36Sopenharmony_ci		.muxregs = fsmc_16bit_autoexp_muxreg,
66762306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(fsmc_16bit_autoexp_muxreg),
66862306a36Sopenharmony_ci	}, {
66962306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
67062306a36Sopenharmony_ci		.muxregs = fsmc_16bit_muxreg,
67162306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(fsmc_16bit_muxreg),
67262306a36Sopenharmony_ci	},
67362306a36Sopenharmony_ci};
67462306a36Sopenharmony_ci
67562306a36Sopenharmony_cistatic struct spear_pingroup fsmc_16bit_pingroup = {
67662306a36Sopenharmony_ci	.name = "fsmc_16bit_grp",
67762306a36Sopenharmony_ci	.pins = fsmc_16bit_pins,
67862306a36Sopenharmony_ci	.npins = ARRAY_SIZE(fsmc_16bit_pins),
67962306a36Sopenharmony_ci	.modemuxs = fsmc_16bit_modemux,
68062306a36Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(fsmc_16bit_modemux),
68162306a36Sopenharmony_ci};
68262306a36Sopenharmony_ci
68362306a36Sopenharmony_cistatic const char *const fsmc_grps[] = { "fsmc_8bit_grp", "fsmc_16bit_grp" };
68462306a36Sopenharmony_cistatic struct spear_function fsmc_function = {
68562306a36Sopenharmony_ci	.name = "fsmc",
68662306a36Sopenharmony_ci	.groups = fsmc_grps,
68762306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(fsmc_grps),
68862306a36Sopenharmony_ci};
68962306a36Sopenharmony_ci
69062306a36Sopenharmony_ci/* Pad multiplexing for SPP device */
69162306a36Sopenharmony_cistatic const unsigned spp_pins[] = { 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
69262306a36Sopenharmony_ci	80, 81, 82, 83, 84, 85 };
69362306a36Sopenharmony_cistatic struct spear_muxreg spp_muxreg[] = {
69462306a36Sopenharmony_ci	{
69562306a36Sopenharmony_ci		.reg = IP_SEL_PAD_60_69_REG,
69662306a36Sopenharmony_ci		.mask = PMX_PL_69_MASK,
69762306a36Sopenharmony_ci		.val = PMX_SPP_PL_69_VAL,
69862306a36Sopenharmony_ci	}, {
69962306a36Sopenharmony_ci		.reg = IP_SEL_PAD_70_79_REG,
70062306a36Sopenharmony_ci		.mask = PMX_PL_70_MASK | PMX_PL_71_72_MASK | PMX_PL_73_MASK |
70162306a36Sopenharmony_ci			PMX_PL_74_MASK | PMX_PL_75_76_MASK |
70262306a36Sopenharmony_ci			PMX_PL_77_78_79_MASK,
70362306a36Sopenharmony_ci		.val = PMX_SPP_PL_70_VAL | PMX_SPP_PL_71_72_VAL |
70462306a36Sopenharmony_ci			PMX_SPP_PL_73_VAL | PMX_SPP_PL_74_VAL |
70562306a36Sopenharmony_ci			PMX_SPP_PL_75_76_VAL | PMX_SPP_PL_77_78_79_VAL,
70662306a36Sopenharmony_ci	}, {
70762306a36Sopenharmony_ci		.reg = IP_SEL_PAD_80_89_REG,
70862306a36Sopenharmony_ci		.mask = PMX_PL_80_TO_85_MASK,
70962306a36Sopenharmony_ci		.val = PMX_SPP_PL_80_TO_85_VAL,
71062306a36Sopenharmony_ci	},
71162306a36Sopenharmony_ci};
71262306a36Sopenharmony_ci
71362306a36Sopenharmony_cistatic struct spear_modemux spp_modemux[] = {
71462306a36Sopenharmony_ci	{
71562306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
71662306a36Sopenharmony_ci		.muxregs = spp_muxreg,
71762306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(spp_muxreg),
71862306a36Sopenharmony_ci	},
71962306a36Sopenharmony_ci};
72062306a36Sopenharmony_ci
72162306a36Sopenharmony_cistatic struct spear_pingroup spp_pingroup = {
72262306a36Sopenharmony_ci	.name = "spp_grp",
72362306a36Sopenharmony_ci	.pins = spp_pins,
72462306a36Sopenharmony_ci	.npins = ARRAY_SIZE(spp_pins),
72562306a36Sopenharmony_ci	.modemuxs = spp_modemux,
72662306a36Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(spp_modemux),
72762306a36Sopenharmony_ci};
72862306a36Sopenharmony_ci
72962306a36Sopenharmony_cistatic const char *const spp_grps[] = { "spp_grp" };
73062306a36Sopenharmony_cistatic struct spear_function spp_function = {
73162306a36Sopenharmony_ci	.name = "spp",
73262306a36Sopenharmony_ci	.groups = spp_grps,
73362306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(spp_grps),
73462306a36Sopenharmony_ci};
73562306a36Sopenharmony_ci
73662306a36Sopenharmony_ci/* Pad multiplexing for SDHCI device */
73762306a36Sopenharmony_cistatic const unsigned sdhci_led_pins[] = { 34 };
73862306a36Sopenharmony_cistatic struct spear_muxreg sdhci_led_muxreg[] = {
73962306a36Sopenharmony_ci	{
74062306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
74162306a36Sopenharmony_ci		.mask = PMX_SSP_CS_MASK,
74262306a36Sopenharmony_ci		.val = 0,
74362306a36Sopenharmony_ci	},
74462306a36Sopenharmony_ci};
74562306a36Sopenharmony_ci
74662306a36Sopenharmony_cistatic struct spear_muxreg sdhci_led_ext_muxreg[] = {
74762306a36Sopenharmony_ci	{
74862306a36Sopenharmony_ci		.reg = IP_SEL_PAD_30_39_REG,
74962306a36Sopenharmony_ci		.mask = PMX_PL_34_MASK,
75062306a36Sopenharmony_ci		.val = PMX_PWM2_PL_34_VAL,
75162306a36Sopenharmony_ci	},
75262306a36Sopenharmony_ci};
75362306a36Sopenharmony_ci
75462306a36Sopenharmony_cistatic struct spear_modemux sdhci_led_modemux[] = {
75562306a36Sopenharmony_ci	{
75662306a36Sopenharmony_ci		.modes = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE | EXTENDED_MODE,
75762306a36Sopenharmony_ci		.muxregs = sdhci_led_muxreg,
75862306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(sdhci_led_muxreg),
75962306a36Sopenharmony_ci	}, {
76062306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
76162306a36Sopenharmony_ci		.muxregs = sdhci_led_ext_muxreg,
76262306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(sdhci_led_ext_muxreg),
76362306a36Sopenharmony_ci	},
76462306a36Sopenharmony_ci};
76562306a36Sopenharmony_ci
76662306a36Sopenharmony_cistatic struct spear_pingroup sdhci_led_pingroup = {
76762306a36Sopenharmony_ci	.name = "sdhci_led_grp",
76862306a36Sopenharmony_ci	.pins = sdhci_led_pins,
76962306a36Sopenharmony_ci	.npins = ARRAY_SIZE(sdhci_led_pins),
77062306a36Sopenharmony_ci	.modemuxs = sdhci_led_modemux,
77162306a36Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(sdhci_led_modemux),
77262306a36Sopenharmony_ci};
77362306a36Sopenharmony_ci
77462306a36Sopenharmony_cistatic const unsigned sdhci_cd_12_pins[] = { 12, 43, 44, 45, 46, 47, 48, 49,
77562306a36Sopenharmony_ci	50};
77662306a36Sopenharmony_cistatic const unsigned sdhci_cd_51_pins[] = { 43, 44, 45, 46, 47, 48, 49, 50, 51
77762306a36Sopenharmony_ci};
77862306a36Sopenharmony_cistatic struct spear_muxreg sdhci_muxreg[] = {
77962306a36Sopenharmony_ci	{
78062306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
78162306a36Sopenharmony_ci		.mask = PMX_TIMER_0_1_MASK | PMX_TIMER_2_3_MASK,
78262306a36Sopenharmony_ci		.val = 0,
78362306a36Sopenharmony_ci	},
78462306a36Sopenharmony_ci};
78562306a36Sopenharmony_ci
78662306a36Sopenharmony_cistatic struct spear_muxreg sdhci_ext_muxreg[] = {
78762306a36Sopenharmony_ci	{
78862306a36Sopenharmony_ci		.reg = IP_SEL_PAD_40_49_REG,
78962306a36Sopenharmony_ci		.mask = PMX_PL_43_MASK | PMX_PL_44_45_MASK | PMX_PL_46_47_MASK |
79062306a36Sopenharmony_ci			PMX_PL_48_49_MASK,
79162306a36Sopenharmony_ci		.val = PMX_SDHCI_PL_43_VAL | PMX_SDHCI_PL_44_45_VAL |
79262306a36Sopenharmony_ci			PMX_SDHCI_PL_46_47_VAL | PMX_SDHCI_PL_48_49_VAL,
79362306a36Sopenharmony_ci	}, {
79462306a36Sopenharmony_ci		.reg = IP_SEL_PAD_50_59_REG,
79562306a36Sopenharmony_ci		.mask = PMX_PL_50_MASK,
79662306a36Sopenharmony_ci		.val = PMX_SDHCI_PL_50_VAL,
79762306a36Sopenharmony_ci	}, {
79862306a36Sopenharmony_ci		.reg = IP_SEL_PAD_90_99_REG,
79962306a36Sopenharmony_ci		.mask = PMX_PL_99_MASK,
80062306a36Sopenharmony_ci		.val = PMX_SDHCI_PL_99_VAL,
80162306a36Sopenharmony_ci	}, {
80262306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
80362306a36Sopenharmony_ci		.mask = PMX_PL_100_101_MASK,
80462306a36Sopenharmony_ci		.val = PMX_SDHCI_PL_100_101_VAL,
80562306a36Sopenharmony_ci	},
80662306a36Sopenharmony_ci};
80762306a36Sopenharmony_ci
80862306a36Sopenharmony_cistatic struct spear_muxreg sdhci_cd_12_muxreg[] = {
80962306a36Sopenharmony_ci	{
81062306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
81162306a36Sopenharmony_ci		.mask = PMX_MII_MASK,
81262306a36Sopenharmony_ci		.val = 0,
81362306a36Sopenharmony_ci	}, {
81462306a36Sopenharmony_ci		.reg = IP_SEL_PAD_10_19_REG,
81562306a36Sopenharmony_ci		.mask = PMX_PL_12_MASK,
81662306a36Sopenharmony_ci		.val = PMX_SDHCI_CD_PL_12_VAL,
81762306a36Sopenharmony_ci	}, {
81862306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
81962306a36Sopenharmony_ci		.mask = PMX_SDHCI_CD_PORT_SEL_MASK,
82062306a36Sopenharmony_ci		.val = PMX_SDHCI_CD_PORT_12_VAL,
82162306a36Sopenharmony_ci	},
82262306a36Sopenharmony_ci};
82362306a36Sopenharmony_ci
82462306a36Sopenharmony_cistatic struct spear_muxreg sdhci_cd_51_muxreg[] = {
82562306a36Sopenharmony_ci	{
82662306a36Sopenharmony_ci		.reg = IP_SEL_PAD_50_59_REG,
82762306a36Sopenharmony_ci		.mask = PMX_PL_51_MASK,
82862306a36Sopenharmony_ci		.val = PMX_SDHCI_CD_PL_51_VAL,
82962306a36Sopenharmony_ci	}, {
83062306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
83162306a36Sopenharmony_ci		.mask = PMX_SDHCI_CD_PORT_SEL_MASK,
83262306a36Sopenharmony_ci		.val = PMX_SDHCI_CD_PORT_51_VAL,
83362306a36Sopenharmony_ci	},
83462306a36Sopenharmony_ci};
83562306a36Sopenharmony_ci
83662306a36Sopenharmony_ci#define pmx_sdhci_common_modemux					\
83762306a36Sopenharmony_ci	{								\
83862306a36Sopenharmony_ci		.modes = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE |	\
83962306a36Sopenharmony_ci			SMALL_PRINTERS_MODE | EXTENDED_MODE,		\
84062306a36Sopenharmony_ci		.muxregs = sdhci_muxreg,				\
84162306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(sdhci_muxreg),			\
84262306a36Sopenharmony_ci	}, {								\
84362306a36Sopenharmony_ci		.modes = EXTENDED_MODE,					\
84462306a36Sopenharmony_ci		.muxregs = sdhci_ext_muxreg,				\
84562306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(sdhci_ext_muxreg),		\
84662306a36Sopenharmony_ci	}
84762306a36Sopenharmony_ci
84862306a36Sopenharmony_cistatic struct spear_modemux sdhci_modemux[][3] = {
84962306a36Sopenharmony_ci	{
85062306a36Sopenharmony_ci		/* select pin 12 for cd */
85162306a36Sopenharmony_ci		pmx_sdhci_common_modemux,
85262306a36Sopenharmony_ci		{
85362306a36Sopenharmony_ci			.modes = EXTENDED_MODE,
85462306a36Sopenharmony_ci			.muxregs = sdhci_cd_12_muxreg,
85562306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(sdhci_cd_12_muxreg),
85662306a36Sopenharmony_ci		},
85762306a36Sopenharmony_ci	}, {
85862306a36Sopenharmony_ci		/* select pin 51 for cd */
85962306a36Sopenharmony_ci		pmx_sdhci_common_modemux,
86062306a36Sopenharmony_ci		{
86162306a36Sopenharmony_ci			.modes = EXTENDED_MODE,
86262306a36Sopenharmony_ci			.muxregs = sdhci_cd_51_muxreg,
86362306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(sdhci_cd_51_muxreg),
86462306a36Sopenharmony_ci		},
86562306a36Sopenharmony_ci	}
86662306a36Sopenharmony_ci};
86762306a36Sopenharmony_ci
86862306a36Sopenharmony_cistatic struct spear_pingroup sdhci_pingroup[] = {
86962306a36Sopenharmony_ci	{
87062306a36Sopenharmony_ci		.name = "sdhci_cd_12_grp",
87162306a36Sopenharmony_ci		.pins = sdhci_cd_12_pins,
87262306a36Sopenharmony_ci		.npins = ARRAY_SIZE(sdhci_cd_12_pins),
87362306a36Sopenharmony_ci		.modemuxs = sdhci_modemux[0],
87462306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(sdhci_modemux[0]),
87562306a36Sopenharmony_ci	}, {
87662306a36Sopenharmony_ci		.name = "sdhci_cd_51_grp",
87762306a36Sopenharmony_ci		.pins = sdhci_cd_51_pins,
87862306a36Sopenharmony_ci		.npins = ARRAY_SIZE(sdhci_cd_51_pins),
87962306a36Sopenharmony_ci		.modemuxs = sdhci_modemux[1],
88062306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(sdhci_modemux[1]),
88162306a36Sopenharmony_ci	},
88262306a36Sopenharmony_ci};
88362306a36Sopenharmony_ci
88462306a36Sopenharmony_cistatic const char *const sdhci_grps[] = { "sdhci_cd_12_grp", "sdhci_cd_51_grp",
88562306a36Sopenharmony_ci	"sdhci_led_grp" };
88662306a36Sopenharmony_ci
88762306a36Sopenharmony_cistatic struct spear_function sdhci_function = {
88862306a36Sopenharmony_ci	.name = "sdhci",
88962306a36Sopenharmony_ci	.groups = sdhci_grps,
89062306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(sdhci_grps),
89162306a36Sopenharmony_ci};
89262306a36Sopenharmony_ci
89362306a36Sopenharmony_ci/* Pad multiplexing for I2S device */
89462306a36Sopenharmony_cistatic const unsigned i2s_pins[] = { 35, 39, 40, 41, 42 };
89562306a36Sopenharmony_cistatic struct spear_muxreg i2s_muxreg[] = {
89662306a36Sopenharmony_ci	{
89762306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
89862306a36Sopenharmony_ci		.mask = PMX_SSP_CS_MASK,
89962306a36Sopenharmony_ci		.val = 0,
90062306a36Sopenharmony_ci	}, {
90162306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
90262306a36Sopenharmony_ci		.mask = PMX_UART0_MODEM_MASK,
90362306a36Sopenharmony_ci		.val = 0,
90462306a36Sopenharmony_ci	},
90562306a36Sopenharmony_ci};
90662306a36Sopenharmony_ci
90762306a36Sopenharmony_cistatic struct spear_muxreg i2s_ext_muxreg[] = {
90862306a36Sopenharmony_ci	{
90962306a36Sopenharmony_ci		.reg = IP_SEL_PAD_30_39_REG,
91062306a36Sopenharmony_ci		.mask = PMX_PL_35_MASK | PMX_PL_39_MASK,
91162306a36Sopenharmony_ci		.val = PMX_I2S_REF_CLK_PL_35_VAL | PMX_I2S_PL_39_VAL,
91262306a36Sopenharmony_ci	}, {
91362306a36Sopenharmony_ci		.reg = IP_SEL_PAD_40_49_REG,
91462306a36Sopenharmony_ci		.mask = PMX_PL_40_MASK | PMX_PL_41_42_MASK,
91562306a36Sopenharmony_ci		.val = PMX_I2S_PL_40_VAL | PMX_I2S_PL_41_42_VAL,
91662306a36Sopenharmony_ci	},
91762306a36Sopenharmony_ci};
91862306a36Sopenharmony_ci
91962306a36Sopenharmony_cistatic struct spear_modemux i2s_modemux[] = {
92062306a36Sopenharmony_ci	{
92162306a36Sopenharmony_ci		.modes = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE | EXTENDED_MODE,
92262306a36Sopenharmony_ci		.muxregs = i2s_muxreg,
92362306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(i2s_muxreg),
92462306a36Sopenharmony_ci	}, {
92562306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
92662306a36Sopenharmony_ci		.muxregs = i2s_ext_muxreg,
92762306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(i2s_ext_muxreg),
92862306a36Sopenharmony_ci	},
92962306a36Sopenharmony_ci};
93062306a36Sopenharmony_ci
93162306a36Sopenharmony_cistatic struct spear_pingroup i2s_pingroup = {
93262306a36Sopenharmony_ci	.name = "i2s_grp",
93362306a36Sopenharmony_ci	.pins = i2s_pins,
93462306a36Sopenharmony_ci	.npins = ARRAY_SIZE(i2s_pins),
93562306a36Sopenharmony_ci	.modemuxs = i2s_modemux,
93662306a36Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(i2s_modemux),
93762306a36Sopenharmony_ci};
93862306a36Sopenharmony_ci
93962306a36Sopenharmony_cistatic const char *const i2s_grps[] = { "i2s_grp" };
94062306a36Sopenharmony_cistatic struct spear_function i2s_function = {
94162306a36Sopenharmony_ci	.name = "i2s",
94262306a36Sopenharmony_ci	.groups = i2s_grps,
94362306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(i2s_grps),
94462306a36Sopenharmony_ci};
94562306a36Sopenharmony_ci
94662306a36Sopenharmony_ci/* Pad multiplexing for UART1 device */
94762306a36Sopenharmony_cistatic const unsigned uart1_pins[] = { 28, 29 };
94862306a36Sopenharmony_cistatic struct spear_muxreg uart1_muxreg[] = {
94962306a36Sopenharmony_ci	{
95062306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
95162306a36Sopenharmony_ci		.mask = PMX_GPIO_PIN0_MASK | PMX_GPIO_PIN1_MASK,
95262306a36Sopenharmony_ci		.val = 0,
95362306a36Sopenharmony_ci	},
95462306a36Sopenharmony_ci};
95562306a36Sopenharmony_ci
95662306a36Sopenharmony_cistatic struct spear_muxreg uart1_ext_muxreg[] = {
95762306a36Sopenharmony_ci	{
95862306a36Sopenharmony_ci		.reg = IP_SEL_PAD_20_29_REG,
95962306a36Sopenharmony_ci		.mask = PMX_PL_28_29_MASK,
96062306a36Sopenharmony_ci		.val = PMX_UART1_PL_28_29_VAL,
96162306a36Sopenharmony_ci	},
96262306a36Sopenharmony_ci};
96362306a36Sopenharmony_ci
96462306a36Sopenharmony_cistatic struct spear_modemux uart1_modemux[] = {
96562306a36Sopenharmony_ci	{
96662306a36Sopenharmony_ci		.modes = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE | AUTO_EXP_MODE
96762306a36Sopenharmony_ci			| SMALL_PRINTERS_MODE | EXTENDED_MODE,
96862306a36Sopenharmony_ci		.muxregs = uart1_muxreg,
96962306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(uart1_muxreg),
97062306a36Sopenharmony_ci	}, {
97162306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
97262306a36Sopenharmony_ci		.muxregs = uart1_ext_muxreg,
97362306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(uart1_ext_muxreg),
97462306a36Sopenharmony_ci	},
97562306a36Sopenharmony_ci};
97662306a36Sopenharmony_ci
97762306a36Sopenharmony_cistatic struct spear_pingroup uart1_pingroup = {
97862306a36Sopenharmony_ci	.name = "uart1_grp",
97962306a36Sopenharmony_ci	.pins = uart1_pins,
98062306a36Sopenharmony_ci	.npins = ARRAY_SIZE(uart1_pins),
98162306a36Sopenharmony_ci	.modemuxs = uart1_modemux,
98262306a36Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(uart1_modemux),
98362306a36Sopenharmony_ci};
98462306a36Sopenharmony_ci
98562306a36Sopenharmony_cistatic const char *const uart1_grps[] = { "uart1_grp" };
98662306a36Sopenharmony_cistatic struct spear_function uart1_function = {
98762306a36Sopenharmony_ci	.name = "uart1",
98862306a36Sopenharmony_ci	.groups = uart1_grps,
98962306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(uart1_grps),
99062306a36Sopenharmony_ci};
99162306a36Sopenharmony_ci
99262306a36Sopenharmony_ci/* Pad multiplexing for UART1 Modem device */
99362306a36Sopenharmony_cistatic const unsigned uart1_modem_2_to_7_pins[] = { 2, 3, 4, 5, 6, 7 };
99462306a36Sopenharmony_cistatic const unsigned uart1_modem_31_to_36_pins[] = { 31, 32, 33, 34, 35, 36 };
99562306a36Sopenharmony_cistatic const unsigned uart1_modem_34_to_45_pins[] = { 34, 35, 36, 43, 44, 45 };
99662306a36Sopenharmony_cistatic const unsigned uart1_modem_80_to_85_pins[] = { 80, 81, 82, 83, 84, 85 };
99762306a36Sopenharmony_ci
99862306a36Sopenharmony_cistatic struct spear_muxreg uart1_modem_ext_2_to_7_muxreg[] = {
99962306a36Sopenharmony_ci	{
100062306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
100162306a36Sopenharmony_ci		.mask = PMX_UART0_MASK | PMX_I2C_MASK | PMX_SSP_MASK,
100262306a36Sopenharmony_ci		.val = 0,
100362306a36Sopenharmony_ci	}, {
100462306a36Sopenharmony_ci		.reg = IP_SEL_PAD_0_9_REG,
100562306a36Sopenharmony_ci		.mask = PMX_PL_2_3_MASK | PMX_PL_6_7_MASK,
100662306a36Sopenharmony_ci		.val = PMX_UART1_ENH_PL_2_3_VAL | PMX_UART1_ENH_PL_4_5_VAL |
100762306a36Sopenharmony_ci			PMX_UART1_ENH_PL_6_7_VAL,
100862306a36Sopenharmony_ci	}, {
100962306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
101062306a36Sopenharmony_ci		.mask = PMX_UART1_ENH_PORT_SEL_MASK,
101162306a36Sopenharmony_ci		.val = PMX_UART1_ENH_PORT_3_TO_5_7_VAL,
101262306a36Sopenharmony_ci	},
101362306a36Sopenharmony_ci};
101462306a36Sopenharmony_ci
101562306a36Sopenharmony_cistatic struct spear_muxreg uart1_modem_31_to_36_muxreg[] = {
101662306a36Sopenharmony_ci	{
101762306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
101862306a36Sopenharmony_ci		.mask = PMX_GPIO_PIN3_MASK | PMX_GPIO_PIN4_MASK |
101962306a36Sopenharmony_ci			PMX_GPIO_PIN5_MASK | PMX_SSP_CS_MASK,
102062306a36Sopenharmony_ci		.val = 0,
102162306a36Sopenharmony_ci	},
102262306a36Sopenharmony_ci};
102362306a36Sopenharmony_ci
102462306a36Sopenharmony_cistatic struct spear_muxreg uart1_modem_ext_31_to_36_muxreg[] = {
102562306a36Sopenharmony_ci	{
102662306a36Sopenharmony_ci		.reg = IP_SEL_PAD_30_39_REG,
102762306a36Sopenharmony_ci		.mask = PMX_PL_31_MASK | PMX_PL_32_33_MASK | PMX_PL_34_MASK |
102862306a36Sopenharmony_ci			PMX_PL_35_MASK | PMX_PL_36_MASK,
102962306a36Sopenharmony_ci		.val = PMX_UART1_ENH_PL_31_VAL | PMX_UART1_ENH_PL_32_33_VAL |
103062306a36Sopenharmony_ci			PMX_UART1_ENH_PL_34_VAL | PMX_UART1_ENH_PL_35_VAL |
103162306a36Sopenharmony_ci			PMX_UART1_ENH_PL_36_VAL,
103262306a36Sopenharmony_ci	}, {
103362306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
103462306a36Sopenharmony_ci		.mask = PMX_UART1_ENH_PORT_SEL_MASK,
103562306a36Sopenharmony_ci		.val = PMX_UART1_ENH_PORT_32_TO_34_36_VAL,
103662306a36Sopenharmony_ci	},
103762306a36Sopenharmony_ci};
103862306a36Sopenharmony_ci
103962306a36Sopenharmony_cistatic struct spear_muxreg uart1_modem_34_to_45_muxreg[] = {
104062306a36Sopenharmony_ci	{
104162306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
104262306a36Sopenharmony_ci		.mask = PMX_TIMER_0_1_MASK | PMX_TIMER_2_3_MASK |
104362306a36Sopenharmony_ci			PMX_SSP_CS_MASK,
104462306a36Sopenharmony_ci		.val = 0,
104562306a36Sopenharmony_ci	},
104662306a36Sopenharmony_ci};
104762306a36Sopenharmony_ci
104862306a36Sopenharmony_cistatic struct spear_muxreg uart1_modem_ext_34_to_45_muxreg[] = {
104962306a36Sopenharmony_ci	{
105062306a36Sopenharmony_ci		.reg = IP_SEL_PAD_30_39_REG,
105162306a36Sopenharmony_ci		.mask = PMX_PL_34_MASK | PMX_PL_35_MASK | PMX_PL_36_MASK,
105262306a36Sopenharmony_ci		.val = PMX_UART1_ENH_PL_34_VAL | PMX_UART1_ENH_PL_35_VAL |
105362306a36Sopenharmony_ci			PMX_UART1_ENH_PL_36_VAL,
105462306a36Sopenharmony_ci	}, {
105562306a36Sopenharmony_ci		.reg = IP_SEL_PAD_40_49_REG,
105662306a36Sopenharmony_ci		.mask = PMX_PL_43_MASK | PMX_PL_44_45_MASK,
105762306a36Sopenharmony_ci		.val = PMX_UART1_ENH_PL_43_VAL | PMX_UART1_ENH_PL_44_45_VAL,
105862306a36Sopenharmony_ci	}, {
105962306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
106062306a36Sopenharmony_ci		.mask = PMX_UART1_ENH_PORT_SEL_MASK,
106162306a36Sopenharmony_ci		.val = PMX_UART1_ENH_PORT_44_45_34_36_VAL,
106262306a36Sopenharmony_ci	},
106362306a36Sopenharmony_ci};
106462306a36Sopenharmony_ci
106562306a36Sopenharmony_cistatic struct spear_muxreg uart1_modem_ext_80_to_85_muxreg[] = {
106662306a36Sopenharmony_ci	{
106762306a36Sopenharmony_ci		.reg = IP_SEL_PAD_80_89_REG,
106862306a36Sopenharmony_ci		.mask = PMX_PL_80_TO_85_MASK,
106962306a36Sopenharmony_ci		.val = PMX_UART1_ENH_PL_80_TO_85_VAL,
107062306a36Sopenharmony_ci	}, {
107162306a36Sopenharmony_ci		.reg = IP_SEL_PAD_40_49_REG,
107262306a36Sopenharmony_ci		.mask = PMX_PL_43_MASK | PMX_PL_44_45_MASK,
107362306a36Sopenharmony_ci		.val = PMX_UART1_ENH_PL_43_VAL | PMX_UART1_ENH_PL_44_45_VAL,
107462306a36Sopenharmony_ci	}, {
107562306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
107662306a36Sopenharmony_ci		.mask = PMX_UART1_ENH_PORT_SEL_MASK,
107762306a36Sopenharmony_ci		.val = PMX_UART1_ENH_PORT_81_TO_85_VAL,
107862306a36Sopenharmony_ci	},
107962306a36Sopenharmony_ci};
108062306a36Sopenharmony_ci
108162306a36Sopenharmony_cistatic struct spear_modemux uart1_modem_2_to_7_modemux[] = {
108262306a36Sopenharmony_ci	{
108362306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
108462306a36Sopenharmony_ci		.muxregs = uart1_modem_ext_2_to_7_muxreg,
108562306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(uart1_modem_ext_2_to_7_muxreg),
108662306a36Sopenharmony_ci	},
108762306a36Sopenharmony_ci};
108862306a36Sopenharmony_ci
108962306a36Sopenharmony_cistatic struct spear_modemux uart1_modem_31_to_36_modemux[] = {
109062306a36Sopenharmony_ci	{
109162306a36Sopenharmony_ci		.modes = SMALL_PRINTERS_MODE | EXTENDED_MODE,
109262306a36Sopenharmony_ci		.muxregs = uart1_modem_31_to_36_muxreg,
109362306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(uart1_modem_31_to_36_muxreg),
109462306a36Sopenharmony_ci	}, {
109562306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
109662306a36Sopenharmony_ci		.muxregs = uart1_modem_ext_31_to_36_muxreg,
109762306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(uart1_modem_ext_31_to_36_muxreg),
109862306a36Sopenharmony_ci	},
109962306a36Sopenharmony_ci};
110062306a36Sopenharmony_ci
110162306a36Sopenharmony_cistatic struct spear_modemux uart1_modem_34_to_45_modemux[] = {
110262306a36Sopenharmony_ci	{
110362306a36Sopenharmony_ci		.modes = AUTO_EXP_MODE | EXTENDED_MODE,
110462306a36Sopenharmony_ci		.muxregs = uart1_modem_34_to_45_muxreg,
110562306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(uart1_modem_34_to_45_muxreg),
110662306a36Sopenharmony_ci	}, {
110762306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
110862306a36Sopenharmony_ci		.muxregs = uart1_modem_ext_34_to_45_muxreg,
110962306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(uart1_modem_ext_34_to_45_muxreg),
111062306a36Sopenharmony_ci	},
111162306a36Sopenharmony_ci};
111262306a36Sopenharmony_ci
111362306a36Sopenharmony_cistatic struct spear_modemux uart1_modem_80_to_85_modemux[] = {
111462306a36Sopenharmony_ci	{
111562306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
111662306a36Sopenharmony_ci		.muxregs = uart1_modem_ext_80_to_85_muxreg,
111762306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(uart1_modem_ext_80_to_85_muxreg),
111862306a36Sopenharmony_ci	},
111962306a36Sopenharmony_ci};
112062306a36Sopenharmony_ci
112162306a36Sopenharmony_cistatic struct spear_pingroup uart1_modem_pingroup[] = {
112262306a36Sopenharmony_ci	{
112362306a36Sopenharmony_ci		.name = "uart1_modem_2_to_7_grp",
112462306a36Sopenharmony_ci		.pins = uart1_modem_2_to_7_pins,
112562306a36Sopenharmony_ci		.npins = ARRAY_SIZE(uart1_modem_2_to_7_pins),
112662306a36Sopenharmony_ci		.modemuxs = uart1_modem_2_to_7_modemux,
112762306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(uart1_modem_2_to_7_modemux),
112862306a36Sopenharmony_ci	}, {
112962306a36Sopenharmony_ci		.name = "uart1_modem_31_to_36_grp",
113062306a36Sopenharmony_ci		.pins = uart1_modem_31_to_36_pins,
113162306a36Sopenharmony_ci		.npins = ARRAY_SIZE(uart1_modem_31_to_36_pins),
113262306a36Sopenharmony_ci		.modemuxs = uart1_modem_31_to_36_modemux,
113362306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(uart1_modem_31_to_36_modemux),
113462306a36Sopenharmony_ci	}, {
113562306a36Sopenharmony_ci		.name = "uart1_modem_34_to_45_grp",
113662306a36Sopenharmony_ci		.pins = uart1_modem_34_to_45_pins,
113762306a36Sopenharmony_ci		.npins = ARRAY_SIZE(uart1_modem_34_to_45_pins),
113862306a36Sopenharmony_ci		.modemuxs = uart1_modem_34_to_45_modemux,
113962306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(uart1_modem_34_to_45_modemux),
114062306a36Sopenharmony_ci	}, {
114162306a36Sopenharmony_ci		.name = "uart1_modem_80_to_85_grp",
114262306a36Sopenharmony_ci		.pins = uart1_modem_80_to_85_pins,
114362306a36Sopenharmony_ci		.npins = ARRAY_SIZE(uart1_modem_80_to_85_pins),
114462306a36Sopenharmony_ci		.modemuxs = uart1_modem_80_to_85_modemux,
114562306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(uart1_modem_80_to_85_modemux),
114662306a36Sopenharmony_ci	},
114762306a36Sopenharmony_ci};
114862306a36Sopenharmony_ci
114962306a36Sopenharmony_cistatic const char *const uart1_modem_grps[] = { "uart1_modem_2_to_7_grp",
115062306a36Sopenharmony_ci	"uart1_modem_31_to_36_grp", "uart1_modem_34_to_45_grp",
115162306a36Sopenharmony_ci	"uart1_modem_80_to_85_grp" };
115262306a36Sopenharmony_cistatic struct spear_function uart1_modem_function = {
115362306a36Sopenharmony_ci	.name = "uart1_modem",
115462306a36Sopenharmony_ci	.groups = uart1_modem_grps,
115562306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(uart1_modem_grps),
115662306a36Sopenharmony_ci};
115762306a36Sopenharmony_ci
115862306a36Sopenharmony_ci/* Pad multiplexing for UART2 device */
115962306a36Sopenharmony_cistatic const unsigned uart2_pins[] = { 0, 1 };
116062306a36Sopenharmony_cistatic struct spear_muxreg uart2_muxreg[] = {
116162306a36Sopenharmony_ci	{
116262306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
116362306a36Sopenharmony_ci		.mask = PMX_FIRDA_MASK,
116462306a36Sopenharmony_ci		.val = 0,
116562306a36Sopenharmony_ci	},
116662306a36Sopenharmony_ci};
116762306a36Sopenharmony_ci
116862306a36Sopenharmony_cistatic struct spear_muxreg uart2_ext_muxreg[] = {
116962306a36Sopenharmony_ci	{
117062306a36Sopenharmony_ci		.reg = IP_SEL_PAD_0_9_REG,
117162306a36Sopenharmony_ci		.mask = PMX_PL_0_1_MASK,
117262306a36Sopenharmony_ci		.val = PMX_UART2_PL_0_1_VAL,
117362306a36Sopenharmony_ci	},
117462306a36Sopenharmony_ci};
117562306a36Sopenharmony_ci
117662306a36Sopenharmony_cistatic struct spear_modemux uart2_modemux[] = {
117762306a36Sopenharmony_ci	{
117862306a36Sopenharmony_ci		.modes = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE | AUTO_EXP_MODE
117962306a36Sopenharmony_ci			| SMALL_PRINTERS_MODE | EXTENDED_MODE,
118062306a36Sopenharmony_ci		.muxregs = uart2_muxreg,
118162306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(uart2_muxreg),
118262306a36Sopenharmony_ci	}, {
118362306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
118462306a36Sopenharmony_ci		.muxregs = uart2_ext_muxreg,
118562306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(uart2_ext_muxreg),
118662306a36Sopenharmony_ci	},
118762306a36Sopenharmony_ci};
118862306a36Sopenharmony_ci
118962306a36Sopenharmony_cistatic struct spear_pingroup uart2_pingroup = {
119062306a36Sopenharmony_ci	.name = "uart2_grp",
119162306a36Sopenharmony_ci	.pins = uart2_pins,
119262306a36Sopenharmony_ci	.npins = ARRAY_SIZE(uart2_pins),
119362306a36Sopenharmony_ci	.modemuxs = uart2_modemux,
119462306a36Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(uart2_modemux),
119562306a36Sopenharmony_ci};
119662306a36Sopenharmony_ci
119762306a36Sopenharmony_cistatic const char *const uart2_grps[] = { "uart2_grp" };
119862306a36Sopenharmony_cistatic struct spear_function uart2_function = {
119962306a36Sopenharmony_ci	.name = "uart2",
120062306a36Sopenharmony_ci	.groups = uart2_grps,
120162306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(uart2_grps),
120262306a36Sopenharmony_ci};
120362306a36Sopenharmony_ci
120462306a36Sopenharmony_ci/* Pad multiplexing for uart3 device */
120562306a36Sopenharmony_cistatic const unsigned uart3_pins[][2] = { { 8, 9 }, { 15, 16 }, { 41, 42 },
120662306a36Sopenharmony_ci	{ 52, 53 }, { 73, 74 }, { 94, 95 }, { 98, 99 } };
120762306a36Sopenharmony_ci
120862306a36Sopenharmony_cistatic struct spear_muxreg uart3_ext_8_9_muxreg[] = {
120962306a36Sopenharmony_ci	{
121062306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
121162306a36Sopenharmony_ci		.mask = PMX_SSP_MASK,
121262306a36Sopenharmony_ci		.val = 0,
121362306a36Sopenharmony_ci	}, {
121462306a36Sopenharmony_ci		.reg = IP_SEL_PAD_0_9_REG,
121562306a36Sopenharmony_ci		.mask = PMX_PL_8_9_MASK,
121662306a36Sopenharmony_ci		.val = PMX_UART3_PL_8_9_VAL,
121762306a36Sopenharmony_ci	}, {
121862306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
121962306a36Sopenharmony_ci		.mask = PMX_UART3_PORT_SEL_MASK,
122062306a36Sopenharmony_ci		.val = PMX_UART3_PORT_8_VAL,
122162306a36Sopenharmony_ci	},
122262306a36Sopenharmony_ci};
122362306a36Sopenharmony_ci
122462306a36Sopenharmony_cistatic struct spear_muxreg uart3_ext_15_16_muxreg[] = {
122562306a36Sopenharmony_ci	{
122662306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
122762306a36Sopenharmony_ci		.mask = PMX_MII_MASK,
122862306a36Sopenharmony_ci		.val = 0,
122962306a36Sopenharmony_ci	}, {
123062306a36Sopenharmony_ci		.reg = IP_SEL_PAD_10_19_REG,
123162306a36Sopenharmony_ci		.mask = PMX_PL_15_16_MASK,
123262306a36Sopenharmony_ci		.val = PMX_UART3_PL_15_16_VAL,
123362306a36Sopenharmony_ci	}, {
123462306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
123562306a36Sopenharmony_ci		.mask = PMX_UART3_PORT_SEL_MASK,
123662306a36Sopenharmony_ci		.val = PMX_UART3_PORT_15_VAL,
123762306a36Sopenharmony_ci	},
123862306a36Sopenharmony_ci};
123962306a36Sopenharmony_ci
124062306a36Sopenharmony_cistatic struct spear_muxreg uart3_ext_41_42_muxreg[] = {
124162306a36Sopenharmony_ci	{
124262306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
124362306a36Sopenharmony_ci		.mask = PMX_UART0_MODEM_MASK,
124462306a36Sopenharmony_ci		.val = 0,
124562306a36Sopenharmony_ci	}, {
124662306a36Sopenharmony_ci		.reg = IP_SEL_PAD_40_49_REG,
124762306a36Sopenharmony_ci		.mask = PMX_PL_41_42_MASK,
124862306a36Sopenharmony_ci		.val = PMX_UART3_PL_41_42_VAL,
124962306a36Sopenharmony_ci	}, {
125062306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
125162306a36Sopenharmony_ci		.mask = PMX_UART3_PORT_SEL_MASK,
125262306a36Sopenharmony_ci		.val = PMX_UART3_PORT_41_VAL,
125362306a36Sopenharmony_ci	},
125462306a36Sopenharmony_ci};
125562306a36Sopenharmony_ci
125662306a36Sopenharmony_cistatic struct spear_muxreg uart3_ext_52_53_muxreg[] = {
125762306a36Sopenharmony_ci	{
125862306a36Sopenharmony_ci		.reg = IP_SEL_PAD_50_59_REG,
125962306a36Sopenharmony_ci		.mask = PMX_PL_52_53_MASK,
126062306a36Sopenharmony_ci		.val = PMX_UART3_PL_52_53_VAL,
126162306a36Sopenharmony_ci	}, {
126262306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
126362306a36Sopenharmony_ci		.mask = PMX_UART3_PORT_SEL_MASK,
126462306a36Sopenharmony_ci		.val = PMX_UART3_PORT_52_VAL,
126562306a36Sopenharmony_ci	},
126662306a36Sopenharmony_ci};
126762306a36Sopenharmony_ci
126862306a36Sopenharmony_cistatic struct spear_muxreg uart3_ext_73_74_muxreg[] = {
126962306a36Sopenharmony_ci	{
127062306a36Sopenharmony_ci		.reg = IP_SEL_PAD_70_79_REG,
127162306a36Sopenharmony_ci		.mask = PMX_PL_73_MASK | PMX_PL_74_MASK,
127262306a36Sopenharmony_ci		.val = PMX_UART3_PL_73_VAL | PMX_UART3_PL_74_VAL,
127362306a36Sopenharmony_ci	}, {
127462306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
127562306a36Sopenharmony_ci		.mask = PMX_UART3_PORT_SEL_MASK,
127662306a36Sopenharmony_ci		.val = PMX_UART3_PORT_73_VAL,
127762306a36Sopenharmony_ci	},
127862306a36Sopenharmony_ci};
127962306a36Sopenharmony_ci
128062306a36Sopenharmony_cistatic struct spear_muxreg uart3_ext_94_95_muxreg[] = {
128162306a36Sopenharmony_ci	{
128262306a36Sopenharmony_ci		.reg = IP_SEL_PAD_90_99_REG,
128362306a36Sopenharmony_ci		.mask = PMX_PL_94_95_MASK,
128462306a36Sopenharmony_ci		.val = PMX_UART3_PL_94_95_VAL,
128562306a36Sopenharmony_ci	}, {
128662306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
128762306a36Sopenharmony_ci		.mask = PMX_UART3_PORT_SEL_MASK,
128862306a36Sopenharmony_ci		.val = PMX_UART3_PORT_94_VAL,
128962306a36Sopenharmony_ci	},
129062306a36Sopenharmony_ci};
129162306a36Sopenharmony_ci
129262306a36Sopenharmony_cistatic struct spear_muxreg uart3_ext_98_99_muxreg[] = {
129362306a36Sopenharmony_ci	{
129462306a36Sopenharmony_ci		.reg = IP_SEL_PAD_90_99_REG,
129562306a36Sopenharmony_ci		.mask = PMX_PL_98_MASK | PMX_PL_99_MASK,
129662306a36Sopenharmony_ci		.val = PMX_UART3_PL_98_VAL | PMX_UART3_PL_99_VAL,
129762306a36Sopenharmony_ci	}, {
129862306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
129962306a36Sopenharmony_ci		.mask = PMX_UART3_PORT_SEL_MASK,
130062306a36Sopenharmony_ci		.val = PMX_UART3_PORT_99_VAL,
130162306a36Sopenharmony_ci	},
130262306a36Sopenharmony_ci};
130362306a36Sopenharmony_ci
130462306a36Sopenharmony_cistatic struct spear_modemux uart3_modemux[][1] = {
130562306a36Sopenharmony_ci	{
130662306a36Sopenharmony_ci		/* Select signals on pins 8_9 */
130762306a36Sopenharmony_ci		{
130862306a36Sopenharmony_ci			.modes = EXTENDED_MODE,
130962306a36Sopenharmony_ci			.muxregs = uart3_ext_8_9_muxreg,
131062306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(uart3_ext_8_9_muxreg),
131162306a36Sopenharmony_ci		},
131262306a36Sopenharmony_ci	}, {
131362306a36Sopenharmony_ci		/* Select signals on pins 15_16 */
131462306a36Sopenharmony_ci		{
131562306a36Sopenharmony_ci			.modes = EXTENDED_MODE,
131662306a36Sopenharmony_ci			.muxregs = uart3_ext_15_16_muxreg,
131762306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(uart3_ext_15_16_muxreg),
131862306a36Sopenharmony_ci		},
131962306a36Sopenharmony_ci	}, {
132062306a36Sopenharmony_ci		/* Select signals on pins 41_42 */
132162306a36Sopenharmony_ci		{
132262306a36Sopenharmony_ci			.modes = EXTENDED_MODE,
132362306a36Sopenharmony_ci			.muxregs = uart3_ext_41_42_muxreg,
132462306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(uart3_ext_41_42_muxreg),
132562306a36Sopenharmony_ci		},
132662306a36Sopenharmony_ci	}, {
132762306a36Sopenharmony_ci		/* Select signals on pins 52_53 */
132862306a36Sopenharmony_ci		{
132962306a36Sopenharmony_ci			.modes = EXTENDED_MODE,
133062306a36Sopenharmony_ci			.muxregs = uart3_ext_52_53_muxreg,
133162306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(uart3_ext_52_53_muxreg),
133262306a36Sopenharmony_ci		},
133362306a36Sopenharmony_ci	}, {
133462306a36Sopenharmony_ci		/* Select signals on pins 73_74 */
133562306a36Sopenharmony_ci		{
133662306a36Sopenharmony_ci			.modes = EXTENDED_MODE,
133762306a36Sopenharmony_ci			.muxregs = uart3_ext_73_74_muxreg,
133862306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(uart3_ext_73_74_muxreg),
133962306a36Sopenharmony_ci		},
134062306a36Sopenharmony_ci	}, {
134162306a36Sopenharmony_ci		/* Select signals on pins 94_95 */
134262306a36Sopenharmony_ci		{
134362306a36Sopenharmony_ci			.modes = EXTENDED_MODE,
134462306a36Sopenharmony_ci			.muxregs = uart3_ext_94_95_muxreg,
134562306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(uart3_ext_94_95_muxreg),
134662306a36Sopenharmony_ci		},
134762306a36Sopenharmony_ci	}, {
134862306a36Sopenharmony_ci		/* Select signals on pins 98_99 */
134962306a36Sopenharmony_ci		{
135062306a36Sopenharmony_ci			.modes = EXTENDED_MODE,
135162306a36Sopenharmony_ci			.muxregs = uart3_ext_98_99_muxreg,
135262306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(uart3_ext_98_99_muxreg),
135362306a36Sopenharmony_ci		},
135462306a36Sopenharmony_ci	},
135562306a36Sopenharmony_ci};
135662306a36Sopenharmony_ci
135762306a36Sopenharmony_cistatic struct spear_pingroup uart3_pingroup[] = {
135862306a36Sopenharmony_ci	{
135962306a36Sopenharmony_ci		.name = "uart3_8_9_grp",
136062306a36Sopenharmony_ci		.pins = uart3_pins[0],
136162306a36Sopenharmony_ci		.npins = ARRAY_SIZE(uart3_pins[0]),
136262306a36Sopenharmony_ci		.modemuxs = uart3_modemux[0],
136362306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(uart3_modemux[0]),
136462306a36Sopenharmony_ci	}, {
136562306a36Sopenharmony_ci		.name = "uart3_15_16_grp",
136662306a36Sopenharmony_ci		.pins = uart3_pins[1],
136762306a36Sopenharmony_ci		.npins = ARRAY_SIZE(uart3_pins[1]),
136862306a36Sopenharmony_ci		.modemuxs = uart3_modemux[1],
136962306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(uart3_modemux[1]),
137062306a36Sopenharmony_ci	}, {
137162306a36Sopenharmony_ci		.name = "uart3_41_42_grp",
137262306a36Sopenharmony_ci		.pins = uart3_pins[2],
137362306a36Sopenharmony_ci		.npins = ARRAY_SIZE(uart3_pins[2]),
137462306a36Sopenharmony_ci		.modemuxs = uart3_modemux[2],
137562306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(uart3_modemux[2]),
137662306a36Sopenharmony_ci	}, {
137762306a36Sopenharmony_ci		.name = "uart3_52_53_grp",
137862306a36Sopenharmony_ci		.pins = uart3_pins[3],
137962306a36Sopenharmony_ci		.npins = ARRAY_SIZE(uart3_pins[3]),
138062306a36Sopenharmony_ci		.modemuxs = uart3_modemux[3],
138162306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(uart3_modemux[3]),
138262306a36Sopenharmony_ci	}, {
138362306a36Sopenharmony_ci		.name = "uart3_73_74_grp",
138462306a36Sopenharmony_ci		.pins = uart3_pins[4],
138562306a36Sopenharmony_ci		.npins = ARRAY_SIZE(uart3_pins[4]),
138662306a36Sopenharmony_ci		.modemuxs = uart3_modemux[4],
138762306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(uart3_modemux[4]),
138862306a36Sopenharmony_ci	}, {
138962306a36Sopenharmony_ci		.name = "uart3_94_95_grp",
139062306a36Sopenharmony_ci		.pins = uart3_pins[5],
139162306a36Sopenharmony_ci		.npins = ARRAY_SIZE(uart3_pins[5]),
139262306a36Sopenharmony_ci		.modemuxs = uart3_modemux[5],
139362306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(uart3_modemux[5]),
139462306a36Sopenharmony_ci	}, {
139562306a36Sopenharmony_ci		.name = "uart3_98_99_grp",
139662306a36Sopenharmony_ci		.pins = uart3_pins[6],
139762306a36Sopenharmony_ci		.npins = ARRAY_SIZE(uart3_pins[6]),
139862306a36Sopenharmony_ci		.modemuxs = uart3_modemux[6],
139962306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(uart3_modemux[6]),
140062306a36Sopenharmony_ci	},
140162306a36Sopenharmony_ci};
140262306a36Sopenharmony_ci
140362306a36Sopenharmony_cistatic const char *const uart3_grps[] = { "uart3_8_9_grp", "uart3_15_16_grp",
140462306a36Sopenharmony_ci	"uart3_41_42_grp", "uart3_52_53_grp", "uart3_73_74_grp",
140562306a36Sopenharmony_ci	"uart3_94_95_grp", "uart3_98_99_grp" };
140662306a36Sopenharmony_ci
140762306a36Sopenharmony_cistatic struct spear_function uart3_function = {
140862306a36Sopenharmony_ci	.name = "uart3",
140962306a36Sopenharmony_ci	.groups = uart3_grps,
141062306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(uart3_grps),
141162306a36Sopenharmony_ci};
141262306a36Sopenharmony_ci
141362306a36Sopenharmony_ci/* Pad multiplexing for uart4 device */
141462306a36Sopenharmony_cistatic const unsigned uart4_pins[][2] = { { 6, 7 }, { 13, 14 }, { 39, 40 },
141562306a36Sopenharmony_ci	{ 71, 72 }, { 92, 93 }, { 100, 101 } };
141662306a36Sopenharmony_ci
141762306a36Sopenharmony_cistatic struct spear_muxreg uart4_ext_6_7_muxreg[] = {
141862306a36Sopenharmony_ci	{
141962306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
142062306a36Sopenharmony_ci		.mask = PMX_SSP_MASK,
142162306a36Sopenharmony_ci		.val = 0,
142262306a36Sopenharmony_ci	}, {
142362306a36Sopenharmony_ci		.reg = IP_SEL_PAD_0_9_REG,
142462306a36Sopenharmony_ci		.mask = PMX_PL_6_7_MASK,
142562306a36Sopenharmony_ci		.val = PMX_UART4_PL_6_7_VAL,
142662306a36Sopenharmony_ci	}, {
142762306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
142862306a36Sopenharmony_ci		.mask = PMX_UART4_PORT_SEL_MASK,
142962306a36Sopenharmony_ci		.val = PMX_UART4_PORT_6_VAL,
143062306a36Sopenharmony_ci	},
143162306a36Sopenharmony_ci};
143262306a36Sopenharmony_ci
143362306a36Sopenharmony_cistatic struct spear_muxreg uart4_ext_13_14_muxreg[] = {
143462306a36Sopenharmony_ci	{
143562306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
143662306a36Sopenharmony_ci		.mask = PMX_MII_MASK,
143762306a36Sopenharmony_ci		.val = 0,
143862306a36Sopenharmony_ci	}, {
143962306a36Sopenharmony_ci		.reg = IP_SEL_PAD_10_19_REG,
144062306a36Sopenharmony_ci		.mask = PMX_PL_13_14_MASK,
144162306a36Sopenharmony_ci		.val = PMX_UART4_PL_13_14_VAL,
144262306a36Sopenharmony_ci	}, {
144362306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
144462306a36Sopenharmony_ci		.mask = PMX_UART4_PORT_SEL_MASK,
144562306a36Sopenharmony_ci		.val = PMX_UART4_PORT_13_VAL,
144662306a36Sopenharmony_ci	},
144762306a36Sopenharmony_ci};
144862306a36Sopenharmony_ci
144962306a36Sopenharmony_cistatic struct spear_muxreg uart4_ext_39_40_muxreg[] = {
145062306a36Sopenharmony_ci	{
145162306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
145262306a36Sopenharmony_ci		.mask = PMX_UART0_MODEM_MASK,
145362306a36Sopenharmony_ci		.val = 0,
145462306a36Sopenharmony_ci	}, {
145562306a36Sopenharmony_ci		.reg = IP_SEL_PAD_30_39_REG,
145662306a36Sopenharmony_ci		.mask = PMX_PL_39_MASK,
145762306a36Sopenharmony_ci		.val = PMX_UART4_PL_39_VAL,
145862306a36Sopenharmony_ci	}, {
145962306a36Sopenharmony_ci		.reg = IP_SEL_PAD_40_49_REG,
146062306a36Sopenharmony_ci		.mask = PMX_PL_40_MASK,
146162306a36Sopenharmony_ci		.val = PMX_UART4_PL_40_VAL,
146262306a36Sopenharmony_ci	}, {
146362306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
146462306a36Sopenharmony_ci		.mask = PMX_UART4_PORT_SEL_MASK,
146562306a36Sopenharmony_ci		.val = PMX_UART4_PORT_39_VAL,
146662306a36Sopenharmony_ci	},
146762306a36Sopenharmony_ci};
146862306a36Sopenharmony_ci
146962306a36Sopenharmony_cistatic struct spear_muxreg uart4_ext_71_72_muxreg[] = {
147062306a36Sopenharmony_ci	{
147162306a36Sopenharmony_ci		.reg = IP_SEL_PAD_70_79_REG,
147262306a36Sopenharmony_ci		.mask = PMX_PL_71_72_MASK,
147362306a36Sopenharmony_ci		.val = PMX_UART4_PL_71_72_VAL,
147462306a36Sopenharmony_ci	}, {
147562306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
147662306a36Sopenharmony_ci		.mask = PMX_UART4_PORT_SEL_MASK,
147762306a36Sopenharmony_ci		.val = PMX_UART4_PORT_71_VAL,
147862306a36Sopenharmony_ci	},
147962306a36Sopenharmony_ci};
148062306a36Sopenharmony_ci
148162306a36Sopenharmony_cistatic struct spear_muxreg uart4_ext_92_93_muxreg[] = {
148262306a36Sopenharmony_ci	{
148362306a36Sopenharmony_ci		.reg = IP_SEL_PAD_90_99_REG,
148462306a36Sopenharmony_ci		.mask = PMX_PL_92_93_MASK,
148562306a36Sopenharmony_ci		.val = PMX_UART4_PL_92_93_VAL,
148662306a36Sopenharmony_ci	}, {
148762306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
148862306a36Sopenharmony_ci		.mask = PMX_UART4_PORT_SEL_MASK,
148962306a36Sopenharmony_ci		.val = PMX_UART4_PORT_92_VAL,
149062306a36Sopenharmony_ci	},
149162306a36Sopenharmony_ci};
149262306a36Sopenharmony_ci
149362306a36Sopenharmony_cistatic struct spear_muxreg uart4_ext_100_101_muxreg[] = {
149462306a36Sopenharmony_ci	{
149562306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
149662306a36Sopenharmony_ci		.mask = PMX_PL_100_101_MASK |
149762306a36Sopenharmony_ci			PMX_UART4_PORT_SEL_MASK,
149862306a36Sopenharmony_ci		.val = PMX_UART4_PL_100_101_VAL |
149962306a36Sopenharmony_ci			PMX_UART4_PORT_101_VAL,
150062306a36Sopenharmony_ci	},
150162306a36Sopenharmony_ci};
150262306a36Sopenharmony_ci
150362306a36Sopenharmony_cistatic struct spear_modemux uart4_modemux[][1] = {
150462306a36Sopenharmony_ci	{
150562306a36Sopenharmony_ci		/* Select signals on pins 6_7 */
150662306a36Sopenharmony_ci		{
150762306a36Sopenharmony_ci			.modes = EXTENDED_MODE,
150862306a36Sopenharmony_ci			.muxregs = uart4_ext_6_7_muxreg,
150962306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(uart4_ext_6_7_muxreg),
151062306a36Sopenharmony_ci		},
151162306a36Sopenharmony_ci	}, {
151262306a36Sopenharmony_ci		/* Select signals on pins 13_14 */
151362306a36Sopenharmony_ci		{
151462306a36Sopenharmony_ci			.modes = EXTENDED_MODE,
151562306a36Sopenharmony_ci			.muxregs = uart4_ext_13_14_muxreg,
151662306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(uart4_ext_13_14_muxreg),
151762306a36Sopenharmony_ci		},
151862306a36Sopenharmony_ci	}, {
151962306a36Sopenharmony_ci		/* Select signals on pins 39_40 */
152062306a36Sopenharmony_ci		{
152162306a36Sopenharmony_ci			.modes = EXTENDED_MODE,
152262306a36Sopenharmony_ci			.muxregs = uart4_ext_39_40_muxreg,
152362306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(uart4_ext_39_40_muxreg),
152462306a36Sopenharmony_ci		},
152562306a36Sopenharmony_ci	}, {
152662306a36Sopenharmony_ci		/* Select signals on pins 71_72 */
152762306a36Sopenharmony_ci		{
152862306a36Sopenharmony_ci			.modes = EXTENDED_MODE,
152962306a36Sopenharmony_ci			.muxregs = uart4_ext_71_72_muxreg,
153062306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(uart4_ext_71_72_muxreg),
153162306a36Sopenharmony_ci		},
153262306a36Sopenharmony_ci	}, {
153362306a36Sopenharmony_ci		/* Select signals on pins 92_93 */
153462306a36Sopenharmony_ci		{
153562306a36Sopenharmony_ci			.modes = EXTENDED_MODE,
153662306a36Sopenharmony_ci			.muxregs = uart4_ext_92_93_muxreg,
153762306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(uart4_ext_92_93_muxreg),
153862306a36Sopenharmony_ci		},
153962306a36Sopenharmony_ci	}, {
154062306a36Sopenharmony_ci		/* Select signals on pins 100_101_ */
154162306a36Sopenharmony_ci		{
154262306a36Sopenharmony_ci			.modes = EXTENDED_MODE,
154362306a36Sopenharmony_ci			.muxregs = uart4_ext_100_101_muxreg,
154462306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(uart4_ext_100_101_muxreg),
154562306a36Sopenharmony_ci		},
154662306a36Sopenharmony_ci	},
154762306a36Sopenharmony_ci};
154862306a36Sopenharmony_ci
154962306a36Sopenharmony_cistatic struct spear_pingroup uart4_pingroup[] = {
155062306a36Sopenharmony_ci	{
155162306a36Sopenharmony_ci		.name = "uart4_6_7_grp",
155262306a36Sopenharmony_ci		.pins = uart4_pins[0],
155362306a36Sopenharmony_ci		.npins = ARRAY_SIZE(uart4_pins[0]),
155462306a36Sopenharmony_ci		.modemuxs = uart4_modemux[0],
155562306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(uart4_modemux[0]),
155662306a36Sopenharmony_ci	}, {
155762306a36Sopenharmony_ci		.name = "uart4_13_14_grp",
155862306a36Sopenharmony_ci		.pins = uart4_pins[1],
155962306a36Sopenharmony_ci		.npins = ARRAY_SIZE(uart4_pins[1]),
156062306a36Sopenharmony_ci		.modemuxs = uart4_modemux[1],
156162306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(uart4_modemux[1]),
156262306a36Sopenharmony_ci	}, {
156362306a36Sopenharmony_ci		.name = "uart4_39_40_grp",
156462306a36Sopenharmony_ci		.pins = uart4_pins[2],
156562306a36Sopenharmony_ci		.npins = ARRAY_SIZE(uart4_pins[2]),
156662306a36Sopenharmony_ci		.modemuxs = uart4_modemux[2],
156762306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(uart4_modemux[2]),
156862306a36Sopenharmony_ci	}, {
156962306a36Sopenharmony_ci		.name = "uart4_71_72_grp",
157062306a36Sopenharmony_ci		.pins = uart4_pins[3],
157162306a36Sopenharmony_ci		.npins = ARRAY_SIZE(uart4_pins[3]),
157262306a36Sopenharmony_ci		.modemuxs = uart4_modemux[3],
157362306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(uart4_modemux[3]),
157462306a36Sopenharmony_ci	}, {
157562306a36Sopenharmony_ci		.name = "uart4_92_93_grp",
157662306a36Sopenharmony_ci		.pins = uart4_pins[4],
157762306a36Sopenharmony_ci		.npins = ARRAY_SIZE(uart4_pins[4]),
157862306a36Sopenharmony_ci		.modemuxs = uart4_modemux[4],
157962306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(uart4_modemux[4]),
158062306a36Sopenharmony_ci	}, {
158162306a36Sopenharmony_ci		.name = "uart4_100_101_grp",
158262306a36Sopenharmony_ci		.pins = uart4_pins[5],
158362306a36Sopenharmony_ci		.npins = ARRAY_SIZE(uart4_pins[5]),
158462306a36Sopenharmony_ci		.modemuxs = uart4_modemux[5],
158562306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(uart4_modemux[5]),
158662306a36Sopenharmony_ci	},
158762306a36Sopenharmony_ci};
158862306a36Sopenharmony_ci
158962306a36Sopenharmony_cistatic const char *const uart4_grps[] = { "uart4_6_7_grp", "uart4_13_14_grp",
159062306a36Sopenharmony_ci	"uart4_39_40_grp", "uart4_71_72_grp", "uart4_92_93_grp",
159162306a36Sopenharmony_ci	"uart4_100_101_grp" };
159262306a36Sopenharmony_ci
159362306a36Sopenharmony_cistatic struct spear_function uart4_function = {
159462306a36Sopenharmony_ci	.name = "uart4",
159562306a36Sopenharmony_ci	.groups = uart4_grps,
159662306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(uart4_grps),
159762306a36Sopenharmony_ci};
159862306a36Sopenharmony_ci
159962306a36Sopenharmony_ci/* Pad multiplexing for uart5 device */
160062306a36Sopenharmony_cistatic const unsigned uart5_pins[][2] = { { 4, 5 }, { 37, 38 }, { 69, 70 },
160162306a36Sopenharmony_ci	{ 90, 91 } };
160262306a36Sopenharmony_ci
160362306a36Sopenharmony_cistatic struct spear_muxreg uart5_ext_4_5_muxreg[] = {
160462306a36Sopenharmony_ci	{
160562306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
160662306a36Sopenharmony_ci		.mask = PMX_I2C_MASK,
160762306a36Sopenharmony_ci		.val = 0,
160862306a36Sopenharmony_ci	}, {
160962306a36Sopenharmony_ci		.reg = IP_SEL_PAD_0_9_REG,
161062306a36Sopenharmony_ci		.mask = PMX_PL_4_5_MASK,
161162306a36Sopenharmony_ci		.val = PMX_UART5_PL_4_5_VAL,
161262306a36Sopenharmony_ci	}, {
161362306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
161462306a36Sopenharmony_ci		.mask = PMX_UART5_PORT_SEL_MASK,
161562306a36Sopenharmony_ci		.val = PMX_UART5_PORT_4_VAL,
161662306a36Sopenharmony_ci	},
161762306a36Sopenharmony_ci};
161862306a36Sopenharmony_ci
161962306a36Sopenharmony_cistatic struct spear_muxreg uart5_ext_37_38_muxreg[] = {
162062306a36Sopenharmony_ci	{
162162306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
162262306a36Sopenharmony_ci		.mask = PMX_UART0_MODEM_MASK,
162362306a36Sopenharmony_ci		.val = 0,
162462306a36Sopenharmony_ci	}, {
162562306a36Sopenharmony_ci		.reg = IP_SEL_PAD_30_39_REG,
162662306a36Sopenharmony_ci		.mask = PMX_PL_37_38_MASK,
162762306a36Sopenharmony_ci		.val = PMX_UART5_PL_37_38_VAL,
162862306a36Sopenharmony_ci	}, {
162962306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
163062306a36Sopenharmony_ci		.mask = PMX_UART5_PORT_SEL_MASK,
163162306a36Sopenharmony_ci		.val = PMX_UART5_PORT_37_VAL,
163262306a36Sopenharmony_ci	},
163362306a36Sopenharmony_ci};
163462306a36Sopenharmony_ci
163562306a36Sopenharmony_cistatic struct spear_muxreg uart5_ext_69_70_muxreg[] = {
163662306a36Sopenharmony_ci	{
163762306a36Sopenharmony_ci		.reg = IP_SEL_PAD_60_69_REG,
163862306a36Sopenharmony_ci		.mask = PMX_PL_69_MASK,
163962306a36Sopenharmony_ci		.val = PMX_UART5_PL_69_VAL,
164062306a36Sopenharmony_ci	}, {
164162306a36Sopenharmony_ci		.reg = IP_SEL_PAD_70_79_REG,
164262306a36Sopenharmony_ci		.mask = PMX_PL_70_MASK,
164362306a36Sopenharmony_ci		.val = PMX_UART5_PL_70_VAL,
164462306a36Sopenharmony_ci	}, {
164562306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
164662306a36Sopenharmony_ci		.mask = PMX_UART5_PORT_SEL_MASK,
164762306a36Sopenharmony_ci		.val = PMX_UART5_PORT_69_VAL,
164862306a36Sopenharmony_ci	},
164962306a36Sopenharmony_ci};
165062306a36Sopenharmony_ci
165162306a36Sopenharmony_cistatic struct spear_muxreg uart5_ext_90_91_muxreg[] = {
165262306a36Sopenharmony_ci	{
165362306a36Sopenharmony_ci		.reg = IP_SEL_PAD_90_99_REG,
165462306a36Sopenharmony_ci		.mask = PMX_PL_90_91_MASK,
165562306a36Sopenharmony_ci		.val = PMX_UART5_PL_90_91_VAL,
165662306a36Sopenharmony_ci	}, {
165762306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
165862306a36Sopenharmony_ci		.mask = PMX_UART5_PORT_SEL_MASK,
165962306a36Sopenharmony_ci		.val = PMX_UART5_PORT_90_VAL,
166062306a36Sopenharmony_ci	},
166162306a36Sopenharmony_ci};
166262306a36Sopenharmony_ci
166362306a36Sopenharmony_cistatic struct spear_modemux uart5_modemux[][1] = {
166462306a36Sopenharmony_ci	{
166562306a36Sopenharmony_ci		/* Select signals on pins 4_5 */
166662306a36Sopenharmony_ci		{
166762306a36Sopenharmony_ci			.modes = EXTENDED_MODE,
166862306a36Sopenharmony_ci			.muxregs = uart5_ext_4_5_muxreg,
166962306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(uart5_ext_4_5_muxreg),
167062306a36Sopenharmony_ci		},
167162306a36Sopenharmony_ci	}, {
167262306a36Sopenharmony_ci		/* Select signals on pins 37_38 */
167362306a36Sopenharmony_ci		{
167462306a36Sopenharmony_ci			.modes = EXTENDED_MODE,
167562306a36Sopenharmony_ci			.muxregs = uart5_ext_37_38_muxreg,
167662306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(uart5_ext_37_38_muxreg),
167762306a36Sopenharmony_ci		},
167862306a36Sopenharmony_ci	}, {
167962306a36Sopenharmony_ci		/* Select signals on pins 69_70 */
168062306a36Sopenharmony_ci		{
168162306a36Sopenharmony_ci			.modes = EXTENDED_MODE,
168262306a36Sopenharmony_ci			.muxregs = uart5_ext_69_70_muxreg,
168362306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(uart5_ext_69_70_muxreg),
168462306a36Sopenharmony_ci		},
168562306a36Sopenharmony_ci	}, {
168662306a36Sopenharmony_ci		/* Select signals on pins 90_91 */
168762306a36Sopenharmony_ci		{
168862306a36Sopenharmony_ci			.modes = EXTENDED_MODE,
168962306a36Sopenharmony_ci			.muxregs = uart5_ext_90_91_muxreg,
169062306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(uart5_ext_90_91_muxreg),
169162306a36Sopenharmony_ci		},
169262306a36Sopenharmony_ci	},
169362306a36Sopenharmony_ci};
169462306a36Sopenharmony_ci
169562306a36Sopenharmony_cistatic struct spear_pingroup uart5_pingroup[] = {
169662306a36Sopenharmony_ci	{
169762306a36Sopenharmony_ci		.name = "uart5_4_5_grp",
169862306a36Sopenharmony_ci		.pins = uart5_pins[0],
169962306a36Sopenharmony_ci		.npins = ARRAY_SIZE(uart5_pins[0]),
170062306a36Sopenharmony_ci		.modemuxs = uart5_modemux[0],
170162306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(uart5_modemux[0]),
170262306a36Sopenharmony_ci	}, {
170362306a36Sopenharmony_ci		.name = "uart5_37_38_grp",
170462306a36Sopenharmony_ci		.pins = uart5_pins[1],
170562306a36Sopenharmony_ci		.npins = ARRAY_SIZE(uart5_pins[1]),
170662306a36Sopenharmony_ci		.modemuxs = uart5_modemux[1],
170762306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(uart5_modemux[1]),
170862306a36Sopenharmony_ci	}, {
170962306a36Sopenharmony_ci		.name = "uart5_69_70_grp",
171062306a36Sopenharmony_ci		.pins = uart5_pins[2],
171162306a36Sopenharmony_ci		.npins = ARRAY_SIZE(uart5_pins[2]),
171262306a36Sopenharmony_ci		.modemuxs = uart5_modemux[2],
171362306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(uart5_modemux[2]),
171462306a36Sopenharmony_ci	}, {
171562306a36Sopenharmony_ci		.name = "uart5_90_91_grp",
171662306a36Sopenharmony_ci		.pins = uart5_pins[3],
171762306a36Sopenharmony_ci		.npins = ARRAY_SIZE(uart5_pins[3]),
171862306a36Sopenharmony_ci		.modemuxs = uart5_modemux[3],
171962306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(uart5_modemux[3]),
172062306a36Sopenharmony_ci	},
172162306a36Sopenharmony_ci};
172262306a36Sopenharmony_ci
172362306a36Sopenharmony_cistatic const char *const uart5_grps[] = { "uart5_4_5_grp", "uart5_37_38_grp",
172462306a36Sopenharmony_ci	"uart5_69_70_grp", "uart5_90_91_grp" };
172562306a36Sopenharmony_cistatic struct spear_function uart5_function = {
172662306a36Sopenharmony_ci	.name = "uart5",
172762306a36Sopenharmony_ci	.groups = uart5_grps,
172862306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(uart5_grps),
172962306a36Sopenharmony_ci};
173062306a36Sopenharmony_ci
173162306a36Sopenharmony_ci/* Pad multiplexing for uart6 device */
173262306a36Sopenharmony_cistatic const unsigned uart6_pins[][2] = { { 2, 3 }, { 88, 89 } };
173362306a36Sopenharmony_cistatic struct spear_muxreg uart6_ext_2_3_muxreg[] = {
173462306a36Sopenharmony_ci	{
173562306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
173662306a36Sopenharmony_ci		.mask = PMX_UART0_MASK,
173762306a36Sopenharmony_ci		.val = 0,
173862306a36Sopenharmony_ci	}, {
173962306a36Sopenharmony_ci		.reg = IP_SEL_PAD_0_9_REG,
174062306a36Sopenharmony_ci		.mask = PMX_PL_2_3_MASK,
174162306a36Sopenharmony_ci		.val = PMX_UART6_PL_2_3_VAL,
174262306a36Sopenharmony_ci	}, {
174362306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
174462306a36Sopenharmony_ci		.mask = PMX_UART6_PORT_SEL_MASK,
174562306a36Sopenharmony_ci		.val = PMX_UART6_PORT_2_VAL,
174662306a36Sopenharmony_ci	},
174762306a36Sopenharmony_ci};
174862306a36Sopenharmony_ci
174962306a36Sopenharmony_cistatic struct spear_muxreg uart6_ext_88_89_muxreg[] = {
175062306a36Sopenharmony_ci	{
175162306a36Sopenharmony_ci		.reg = IP_SEL_PAD_80_89_REG,
175262306a36Sopenharmony_ci		.mask = PMX_PL_88_89_MASK,
175362306a36Sopenharmony_ci		.val = PMX_UART6_PL_88_89_VAL,
175462306a36Sopenharmony_ci	}, {
175562306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
175662306a36Sopenharmony_ci		.mask = PMX_UART6_PORT_SEL_MASK,
175762306a36Sopenharmony_ci		.val = PMX_UART6_PORT_88_VAL,
175862306a36Sopenharmony_ci	},
175962306a36Sopenharmony_ci};
176062306a36Sopenharmony_ci
176162306a36Sopenharmony_cistatic struct spear_modemux uart6_modemux[][1] = {
176262306a36Sopenharmony_ci	{
176362306a36Sopenharmony_ci		/* Select signals on pins 2_3 */
176462306a36Sopenharmony_ci		{
176562306a36Sopenharmony_ci			.modes = EXTENDED_MODE,
176662306a36Sopenharmony_ci			.muxregs = uart6_ext_2_3_muxreg,
176762306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(uart6_ext_2_3_muxreg),
176862306a36Sopenharmony_ci		},
176962306a36Sopenharmony_ci	}, {
177062306a36Sopenharmony_ci		/* Select signals on pins 88_89 */
177162306a36Sopenharmony_ci		{
177262306a36Sopenharmony_ci			.modes = EXTENDED_MODE,
177362306a36Sopenharmony_ci			.muxregs = uart6_ext_88_89_muxreg,
177462306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(uart6_ext_88_89_muxreg),
177562306a36Sopenharmony_ci		},
177662306a36Sopenharmony_ci	},
177762306a36Sopenharmony_ci};
177862306a36Sopenharmony_ci
177962306a36Sopenharmony_cistatic struct spear_pingroup uart6_pingroup[] = {
178062306a36Sopenharmony_ci	{
178162306a36Sopenharmony_ci		.name = "uart6_2_3_grp",
178262306a36Sopenharmony_ci		.pins = uart6_pins[0],
178362306a36Sopenharmony_ci		.npins = ARRAY_SIZE(uart6_pins[0]),
178462306a36Sopenharmony_ci		.modemuxs = uart6_modemux[0],
178562306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(uart6_modemux[0]),
178662306a36Sopenharmony_ci	}, {
178762306a36Sopenharmony_ci		.name = "uart6_88_89_grp",
178862306a36Sopenharmony_ci		.pins = uart6_pins[1],
178962306a36Sopenharmony_ci		.npins = ARRAY_SIZE(uart6_pins[1]),
179062306a36Sopenharmony_ci		.modemuxs = uart6_modemux[1],
179162306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(uart6_modemux[1]),
179262306a36Sopenharmony_ci	},
179362306a36Sopenharmony_ci};
179462306a36Sopenharmony_ci
179562306a36Sopenharmony_cistatic const char *const uart6_grps[] = { "uart6_2_3_grp", "uart6_88_89_grp" };
179662306a36Sopenharmony_cistatic struct spear_function uart6_function = {
179762306a36Sopenharmony_ci	.name = "uart6",
179862306a36Sopenharmony_ci	.groups = uart6_grps,
179962306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(uart6_grps),
180062306a36Sopenharmony_ci};
180162306a36Sopenharmony_ci
180262306a36Sopenharmony_ci/* UART - RS485 pmx */
180362306a36Sopenharmony_cistatic const unsigned rs485_pins[] = { 77, 78, 79 };
180462306a36Sopenharmony_cistatic struct spear_muxreg rs485_muxreg[] = {
180562306a36Sopenharmony_ci	{
180662306a36Sopenharmony_ci		.reg = IP_SEL_PAD_70_79_REG,
180762306a36Sopenharmony_ci		.mask = PMX_PL_77_78_79_MASK,
180862306a36Sopenharmony_ci		.val = PMX_RS485_PL_77_78_79_VAL,
180962306a36Sopenharmony_ci	},
181062306a36Sopenharmony_ci};
181162306a36Sopenharmony_ci
181262306a36Sopenharmony_cistatic struct spear_modemux rs485_modemux[] = {
181362306a36Sopenharmony_ci	{
181462306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
181562306a36Sopenharmony_ci		.muxregs = rs485_muxreg,
181662306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(rs485_muxreg),
181762306a36Sopenharmony_ci	},
181862306a36Sopenharmony_ci};
181962306a36Sopenharmony_ci
182062306a36Sopenharmony_cistatic struct spear_pingroup rs485_pingroup = {
182162306a36Sopenharmony_ci	.name = "rs485_grp",
182262306a36Sopenharmony_ci	.pins = rs485_pins,
182362306a36Sopenharmony_ci	.npins = ARRAY_SIZE(rs485_pins),
182462306a36Sopenharmony_ci	.modemuxs = rs485_modemux,
182562306a36Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(rs485_modemux),
182662306a36Sopenharmony_ci};
182762306a36Sopenharmony_ci
182862306a36Sopenharmony_cistatic const char *const rs485_grps[] = { "rs485_grp" };
182962306a36Sopenharmony_cistatic struct spear_function rs485_function = {
183062306a36Sopenharmony_ci	.name = "rs485",
183162306a36Sopenharmony_ci	.groups = rs485_grps,
183262306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(rs485_grps),
183362306a36Sopenharmony_ci};
183462306a36Sopenharmony_ci
183562306a36Sopenharmony_ci/* Pad multiplexing for Touchscreen device */
183662306a36Sopenharmony_cistatic const unsigned touchscreen_pins[] = { 5, 36 };
183762306a36Sopenharmony_cistatic struct spear_muxreg touchscreen_muxreg[] = {
183862306a36Sopenharmony_ci	{
183962306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
184062306a36Sopenharmony_ci		.mask = PMX_I2C_MASK | PMX_SSP_CS_MASK,
184162306a36Sopenharmony_ci		.val = 0,
184262306a36Sopenharmony_ci	},
184362306a36Sopenharmony_ci};
184462306a36Sopenharmony_ci
184562306a36Sopenharmony_cistatic struct spear_muxreg touchscreen_ext_muxreg[] = {
184662306a36Sopenharmony_ci	{
184762306a36Sopenharmony_ci		.reg = IP_SEL_PAD_0_9_REG,
184862306a36Sopenharmony_ci		.mask = PMX_PL_5_MASK,
184962306a36Sopenharmony_ci		.val = PMX_TOUCH_Y_PL_5_VAL,
185062306a36Sopenharmony_ci	}, {
185162306a36Sopenharmony_ci		.reg = IP_SEL_PAD_30_39_REG,
185262306a36Sopenharmony_ci		.mask = PMX_PL_36_MASK,
185362306a36Sopenharmony_ci		.val = PMX_TOUCH_X_PL_36_VAL,
185462306a36Sopenharmony_ci	},
185562306a36Sopenharmony_ci};
185662306a36Sopenharmony_ci
185762306a36Sopenharmony_cistatic struct spear_modemux touchscreen_modemux[] = {
185862306a36Sopenharmony_ci	{
185962306a36Sopenharmony_ci		.modes = AUTO_NET_SMII_MODE | EXTENDED_MODE,
186062306a36Sopenharmony_ci		.muxregs = touchscreen_muxreg,
186162306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(touchscreen_muxreg),
186262306a36Sopenharmony_ci	}, {
186362306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
186462306a36Sopenharmony_ci		.muxregs = touchscreen_ext_muxreg,
186562306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(touchscreen_ext_muxreg),
186662306a36Sopenharmony_ci	},
186762306a36Sopenharmony_ci};
186862306a36Sopenharmony_ci
186962306a36Sopenharmony_cistatic struct spear_pingroup touchscreen_pingroup = {
187062306a36Sopenharmony_ci	.name = "touchscreen_grp",
187162306a36Sopenharmony_ci	.pins = touchscreen_pins,
187262306a36Sopenharmony_ci	.npins = ARRAY_SIZE(touchscreen_pins),
187362306a36Sopenharmony_ci	.modemuxs = touchscreen_modemux,
187462306a36Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(touchscreen_modemux),
187562306a36Sopenharmony_ci};
187662306a36Sopenharmony_ci
187762306a36Sopenharmony_cistatic const char *const touchscreen_grps[] = { "touchscreen_grp" };
187862306a36Sopenharmony_cistatic struct spear_function touchscreen_function = {
187962306a36Sopenharmony_ci	.name = "touchscreen",
188062306a36Sopenharmony_ci	.groups = touchscreen_grps,
188162306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(touchscreen_grps),
188262306a36Sopenharmony_ci};
188362306a36Sopenharmony_ci
188462306a36Sopenharmony_ci/* Pad multiplexing for CAN device */
188562306a36Sopenharmony_cistatic const unsigned can0_pins[] = { 32, 33 };
188662306a36Sopenharmony_cistatic struct spear_muxreg can0_muxreg[] = {
188762306a36Sopenharmony_ci	{
188862306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
188962306a36Sopenharmony_ci		.mask = PMX_GPIO_PIN4_MASK | PMX_GPIO_PIN5_MASK,
189062306a36Sopenharmony_ci		.val = 0,
189162306a36Sopenharmony_ci	},
189262306a36Sopenharmony_ci};
189362306a36Sopenharmony_ci
189462306a36Sopenharmony_cistatic struct spear_muxreg can0_ext_muxreg[] = {
189562306a36Sopenharmony_ci	{
189662306a36Sopenharmony_ci		.reg = IP_SEL_PAD_30_39_REG,
189762306a36Sopenharmony_ci		.mask = PMX_PL_32_33_MASK,
189862306a36Sopenharmony_ci		.val = PMX_CAN0_PL_32_33_VAL,
189962306a36Sopenharmony_ci	},
190062306a36Sopenharmony_ci};
190162306a36Sopenharmony_ci
190262306a36Sopenharmony_cistatic struct spear_modemux can0_modemux[] = {
190362306a36Sopenharmony_ci	{
190462306a36Sopenharmony_ci		.modes = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE | AUTO_EXP_MODE
190562306a36Sopenharmony_ci			| EXTENDED_MODE,
190662306a36Sopenharmony_ci		.muxregs = can0_muxreg,
190762306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(can0_muxreg),
190862306a36Sopenharmony_ci	}, {
190962306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
191062306a36Sopenharmony_ci		.muxregs = can0_ext_muxreg,
191162306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(can0_ext_muxreg),
191262306a36Sopenharmony_ci	},
191362306a36Sopenharmony_ci};
191462306a36Sopenharmony_ci
191562306a36Sopenharmony_cistatic struct spear_pingroup can0_pingroup = {
191662306a36Sopenharmony_ci	.name = "can0_grp",
191762306a36Sopenharmony_ci	.pins = can0_pins,
191862306a36Sopenharmony_ci	.npins = ARRAY_SIZE(can0_pins),
191962306a36Sopenharmony_ci	.modemuxs = can0_modemux,
192062306a36Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(can0_modemux),
192162306a36Sopenharmony_ci};
192262306a36Sopenharmony_ci
192362306a36Sopenharmony_cistatic const char *const can0_grps[] = { "can0_grp" };
192462306a36Sopenharmony_cistatic struct spear_function can0_function = {
192562306a36Sopenharmony_ci	.name = "can0",
192662306a36Sopenharmony_ci	.groups = can0_grps,
192762306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(can0_grps),
192862306a36Sopenharmony_ci};
192962306a36Sopenharmony_ci
193062306a36Sopenharmony_cistatic const unsigned can1_pins[] = { 30, 31 };
193162306a36Sopenharmony_cistatic struct spear_muxreg can1_muxreg[] = {
193262306a36Sopenharmony_ci	{
193362306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
193462306a36Sopenharmony_ci		.mask = PMX_GPIO_PIN2_MASK | PMX_GPIO_PIN3_MASK,
193562306a36Sopenharmony_ci		.val = 0,
193662306a36Sopenharmony_ci	},
193762306a36Sopenharmony_ci};
193862306a36Sopenharmony_ci
193962306a36Sopenharmony_cistatic struct spear_muxreg can1_ext_muxreg[] = {
194062306a36Sopenharmony_ci	{
194162306a36Sopenharmony_ci		.reg = IP_SEL_PAD_30_39_REG,
194262306a36Sopenharmony_ci		.mask = PMX_PL_30_31_MASK,
194362306a36Sopenharmony_ci		.val = PMX_CAN1_PL_30_31_VAL,
194462306a36Sopenharmony_ci	},
194562306a36Sopenharmony_ci};
194662306a36Sopenharmony_ci
194762306a36Sopenharmony_cistatic struct spear_modemux can1_modemux[] = {
194862306a36Sopenharmony_ci	{
194962306a36Sopenharmony_ci		.modes = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE | AUTO_EXP_MODE
195062306a36Sopenharmony_ci			| EXTENDED_MODE,
195162306a36Sopenharmony_ci		.muxregs = can1_muxreg,
195262306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(can1_muxreg),
195362306a36Sopenharmony_ci	}, {
195462306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
195562306a36Sopenharmony_ci		.muxregs = can1_ext_muxreg,
195662306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(can1_ext_muxreg),
195762306a36Sopenharmony_ci	},
195862306a36Sopenharmony_ci};
195962306a36Sopenharmony_ci
196062306a36Sopenharmony_cistatic struct spear_pingroup can1_pingroup = {
196162306a36Sopenharmony_ci	.name = "can1_grp",
196262306a36Sopenharmony_ci	.pins = can1_pins,
196362306a36Sopenharmony_ci	.npins = ARRAY_SIZE(can1_pins),
196462306a36Sopenharmony_ci	.modemuxs = can1_modemux,
196562306a36Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(can1_modemux),
196662306a36Sopenharmony_ci};
196762306a36Sopenharmony_ci
196862306a36Sopenharmony_cistatic const char *const can1_grps[] = { "can1_grp" };
196962306a36Sopenharmony_cistatic struct spear_function can1_function = {
197062306a36Sopenharmony_ci	.name = "can1",
197162306a36Sopenharmony_ci	.groups = can1_grps,
197262306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(can1_grps),
197362306a36Sopenharmony_ci};
197462306a36Sopenharmony_ci
197562306a36Sopenharmony_ci/* Pad multiplexing for PWM0_1 device */
197662306a36Sopenharmony_cistatic const unsigned pwm0_1_pins[][2] = { { 37, 38 }, { 14, 15 }, { 8, 9 },
197762306a36Sopenharmony_ci	{ 30, 31 }, { 42, 43 }, { 59, 60 }, { 88, 89 } };
197862306a36Sopenharmony_ci
197962306a36Sopenharmony_cistatic struct spear_muxreg pwm0_1_pin_8_9_muxreg[] = {
198062306a36Sopenharmony_ci	{
198162306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
198262306a36Sopenharmony_ci		.mask = PMX_SSP_MASK,
198362306a36Sopenharmony_ci		.val = 0,
198462306a36Sopenharmony_ci	}, {
198562306a36Sopenharmony_ci		.reg = IP_SEL_PAD_0_9_REG,
198662306a36Sopenharmony_ci		.mask = PMX_PL_8_9_MASK,
198762306a36Sopenharmony_ci		.val = PMX_PWM_0_1_PL_8_9_VAL,
198862306a36Sopenharmony_ci	},
198962306a36Sopenharmony_ci};
199062306a36Sopenharmony_ci
199162306a36Sopenharmony_cistatic struct spear_muxreg pwm0_1_autoexpsmallpri_muxreg[] = {
199262306a36Sopenharmony_ci	{
199362306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
199462306a36Sopenharmony_ci		.mask = PMX_MII_MASK,
199562306a36Sopenharmony_ci		.val = 0,
199662306a36Sopenharmony_ci	},
199762306a36Sopenharmony_ci};
199862306a36Sopenharmony_ci
199962306a36Sopenharmony_cistatic struct spear_muxreg pwm0_1_pin_14_15_muxreg[] = {
200062306a36Sopenharmony_ci	{
200162306a36Sopenharmony_ci		.reg = IP_SEL_PAD_10_19_REG,
200262306a36Sopenharmony_ci		.mask = PMX_PL_14_MASK | PMX_PL_15_MASK,
200362306a36Sopenharmony_ci		.val = PMX_PWM1_PL_14_VAL | PMX_PWM0_PL_15_VAL,
200462306a36Sopenharmony_ci	},
200562306a36Sopenharmony_ci};
200662306a36Sopenharmony_ci
200762306a36Sopenharmony_cistatic struct spear_muxreg pwm0_1_pin_30_31_muxreg[] = {
200862306a36Sopenharmony_ci	{
200962306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
201062306a36Sopenharmony_ci		.mask = PMX_GPIO_PIN2_MASK | PMX_GPIO_PIN3_MASK,
201162306a36Sopenharmony_ci		.val = 0,
201262306a36Sopenharmony_ci	}, {
201362306a36Sopenharmony_ci		.reg = IP_SEL_PAD_30_39_REG,
201462306a36Sopenharmony_ci		.mask = PMX_PL_30_MASK | PMX_PL_31_MASK,
201562306a36Sopenharmony_ci		.val = PMX_PWM1_EXT_PL_30_VAL | PMX_PWM0_EXT_PL_31_VAL,
201662306a36Sopenharmony_ci	},
201762306a36Sopenharmony_ci};
201862306a36Sopenharmony_ci
201962306a36Sopenharmony_cistatic struct spear_muxreg pwm0_1_net_muxreg[] = {
202062306a36Sopenharmony_ci	{
202162306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
202262306a36Sopenharmony_ci		.mask = PMX_UART0_MODEM_MASK,
202362306a36Sopenharmony_ci		.val = 0,
202462306a36Sopenharmony_ci	},
202562306a36Sopenharmony_ci};
202662306a36Sopenharmony_ci
202762306a36Sopenharmony_cistatic struct spear_muxreg pwm0_1_pin_37_38_muxreg[] = {
202862306a36Sopenharmony_ci	{
202962306a36Sopenharmony_ci		.reg = IP_SEL_PAD_30_39_REG,
203062306a36Sopenharmony_ci		.mask = PMX_PL_37_38_MASK,
203162306a36Sopenharmony_ci		.val = PMX_PWM0_1_PL_37_38_VAL,
203262306a36Sopenharmony_ci	},
203362306a36Sopenharmony_ci};
203462306a36Sopenharmony_ci
203562306a36Sopenharmony_cistatic struct spear_muxreg pwm0_1_pin_42_43_muxreg[] = {
203662306a36Sopenharmony_ci	{
203762306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
203862306a36Sopenharmony_ci		.mask = PMX_UART0_MODEM_MASK | PMX_TIMER_0_1_MASK ,
203962306a36Sopenharmony_ci		.val = 0,
204062306a36Sopenharmony_ci	}, {
204162306a36Sopenharmony_ci		.reg = IP_SEL_PAD_40_49_REG,
204262306a36Sopenharmony_ci		.mask = PMX_PL_42_MASK | PMX_PL_43_MASK,
204362306a36Sopenharmony_ci		.val = PMX_PWM1_PL_42_VAL |
204462306a36Sopenharmony_ci			PMX_PWM0_PL_43_VAL,
204562306a36Sopenharmony_ci	},
204662306a36Sopenharmony_ci};
204762306a36Sopenharmony_ci
204862306a36Sopenharmony_cistatic struct spear_muxreg pwm0_1_pin_59_60_muxreg[] = {
204962306a36Sopenharmony_ci	{
205062306a36Sopenharmony_ci		.reg = IP_SEL_PAD_50_59_REG,
205162306a36Sopenharmony_ci		.mask = PMX_PL_59_MASK,
205262306a36Sopenharmony_ci		.val = PMX_PWM1_PL_59_VAL,
205362306a36Sopenharmony_ci	}, {
205462306a36Sopenharmony_ci		.reg = IP_SEL_PAD_60_69_REG,
205562306a36Sopenharmony_ci		.mask = PMX_PL_60_MASK,
205662306a36Sopenharmony_ci		.val = PMX_PWM0_PL_60_VAL,
205762306a36Sopenharmony_ci	},
205862306a36Sopenharmony_ci};
205962306a36Sopenharmony_ci
206062306a36Sopenharmony_cistatic struct spear_muxreg pwm0_1_pin_88_89_muxreg[] = {
206162306a36Sopenharmony_ci	{
206262306a36Sopenharmony_ci		.reg = IP_SEL_PAD_80_89_REG,
206362306a36Sopenharmony_ci		.mask = PMX_PL_88_89_MASK,
206462306a36Sopenharmony_ci		.val = PMX_PWM0_1_PL_88_89_VAL,
206562306a36Sopenharmony_ci	},
206662306a36Sopenharmony_ci};
206762306a36Sopenharmony_ci
206862306a36Sopenharmony_cistatic struct spear_modemux pwm0_1_pin_8_9_modemux[] = {
206962306a36Sopenharmony_ci	{
207062306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
207162306a36Sopenharmony_ci		.muxregs = pwm0_1_pin_8_9_muxreg,
207262306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(pwm0_1_pin_8_9_muxreg),
207362306a36Sopenharmony_ci	},
207462306a36Sopenharmony_ci};
207562306a36Sopenharmony_ci
207662306a36Sopenharmony_cistatic struct spear_modemux pwm0_1_pin_14_15_modemux[] = {
207762306a36Sopenharmony_ci	{
207862306a36Sopenharmony_ci		.modes = AUTO_EXP_MODE | SMALL_PRINTERS_MODE | EXTENDED_MODE,
207962306a36Sopenharmony_ci		.muxregs = pwm0_1_autoexpsmallpri_muxreg,
208062306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(pwm0_1_autoexpsmallpri_muxreg),
208162306a36Sopenharmony_ci	}, {
208262306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
208362306a36Sopenharmony_ci		.muxregs = pwm0_1_pin_14_15_muxreg,
208462306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(pwm0_1_pin_14_15_muxreg),
208562306a36Sopenharmony_ci	},
208662306a36Sopenharmony_ci};
208762306a36Sopenharmony_ci
208862306a36Sopenharmony_cistatic struct spear_modemux pwm0_1_pin_30_31_modemux[] = {
208962306a36Sopenharmony_ci	{
209062306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
209162306a36Sopenharmony_ci		.muxregs = pwm0_1_pin_30_31_muxreg,
209262306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(pwm0_1_pin_30_31_muxreg),
209362306a36Sopenharmony_ci	},
209462306a36Sopenharmony_ci};
209562306a36Sopenharmony_ci
209662306a36Sopenharmony_cistatic struct spear_modemux pwm0_1_pin_37_38_modemux[] = {
209762306a36Sopenharmony_ci	{
209862306a36Sopenharmony_ci		.modes = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE | EXTENDED_MODE,
209962306a36Sopenharmony_ci		.muxregs = pwm0_1_net_muxreg,
210062306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(pwm0_1_net_muxreg),
210162306a36Sopenharmony_ci	}, {
210262306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
210362306a36Sopenharmony_ci		.muxregs = pwm0_1_pin_37_38_muxreg,
210462306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(pwm0_1_pin_37_38_muxreg),
210562306a36Sopenharmony_ci	},
210662306a36Sopenharmony_ci};
210762306a36Sopenharmony_ci
210862306a36Sopenharmony_cistatic struct spear_modemux pwm0_1_pin_42_43_modemux[] = {
210962306a36Sopenharmony_ci	{
211062306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
211162306a36Sopenharmony_ci		.muxregs = pwm0_1_pin_42_43_muxreg,
211262306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(pwm0_1_pin_42_43_muxreg),
211362306a36Sopenharmony_ci	},
211462306a36Sopenharmony_ci};
211562306a36Sopenharmony_ci
211662306a36Sopenharmony_cistatic struct spear_modemux pwm0_1_pin_59_60_modemux[] = {
211762306a36Sopenharmony_ci	{
211862306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
211962306a36Sopenharmony_ci		.muxregs = pwm0_1_pin_59_60_muxreg,
212062306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(pwm0_1_pin_59_60_muxreg),
212162306a36Sopenharmony_ci	},
212262306a36Sopenharmony_ci};
212362306a36Sopenharmony_ci
212462306a36Sopenharmony_cistatic struct spear_modemux pwm0_1_pin_88_89_modemux[] = {
212562306a36Sopenharmony_ci	{
212662306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
212762306a36Sopenharmony_ci		.muxregs = pwm0_1_pin_88_89_muxreg,
212862306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(pwm0_1_pin_88_89_muxreg),
212962306a36Sopenharmony_ci	},
213062306a36Sopenharmony_ci};
213162306a36Sopenharmony_ci
213262306a36Sopenharmony_cistatic struct spear_pingroup pwm0_1_pingroup[] = {
213362306a36Sopenharmony_ci	{
213462306a36Sopenharmony_ci		.name = "pwm0_1_pin_8_9_grp",
213562306a36Sopenharmony_ci		.pins = pwm0_1_pins[0],
213662306a36Sopenharmony_ci		.npins = ARRAY_SIZE(pwm0_1_pins[0]),
213762306a36Sopenharmony_ci		.modemuxs = pwm0_1_pin_8_9_modemux,
213862306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(pwm0_1_pin_8_9_modemux),
213962306a36Sopenharmony_ci	}, {
214062306a36Sopenharmony_ci		.name = "pwm0_1_pin_14_15_grp",
214162306a36Sopenharmony_ci		.pins = pwm0_1_pins[1],
214262306a36Sopenharmony_ci		.npins = ARRAY_SIZE(pwm0_1_pins[1]),
214362306a36Sopenharmony_ci		.modemuxs = pwm0_1_pin_14_15_modemux,
214462306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(pwm0_1_pin_14_15_modemux),
214562306a36Sopenharmony_ci	}, {
214662306a36Sopenharmony_ci		.name = "pwm0_1_pin_30_31_grp",
214762306a36Sopenharmony_ci		.pins = pwm0_1_pins[2],
214862306a36Sopenharmony_ci		.npins = ARRAY_SIZE(pwm0_1_pins[2]),
214962306a36Sopenharmony_ci		.modemuxs = pwm0_1_pin_30_31_modemux,
215062306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(pwm0_1_pin_30_31_modemux),
215162306a36Sopenharmony_ci	}, {
215262306a36Sopenharmony_ci		.name = "pwm0_1_pin_37_38_grp",
215362306a36Sopenharmony_ci		.pins = pwm0_1_pins[3],
215462306a36Sopenharmony_ci		.npins = ARRAY_SIZE(pwm0_1_pins[3]),
215562306a36Sopenharmony_ci		.modemuxs = pwm0_1_pin_37_38_modemux,
215662306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(pwm0_1_pin_37_38_modemux),
215762306a36Sopenharmony_ci	}, {
215862306a36Sopenharmony_ci		.name = "pwm0_1_pin_42_43_grp",
215962306a36Sopenharmony_ci		.pins = pwm0_1_pins[4],
216062306a36Sopenharmony_ci		.npins = ARRAY_SIZE(pwm0_1_pins[4]),
216162306a36Sopenharmony_ci		.modemuxs = pwm0_1_pin_42_43_modemux,
216262306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(pwm0_1_pin_42_43_modemux),
216362306a36Sopenharmony_ci	}, {
216462306a36Sopenharmony_ci		.name = "pwm0_1_pin_59_60_grp",
216562306a36Sopenharmony_ci		.pins = pwm0_1_pins[5],
216662306a36Sopenharmony_ci		.npins = ARRAY_SIZE(pwm0_1_pins[5]),
216762306a36Sopenharmony_ci		.modemuxs = pwm0_1_pin_59_60_modemux,
216862306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(pwm0_1_pin_59_60_modemux),
216962306a36Sopenharmony_ci	}, {
217062306a36Sopenharmony_ci		.name = "pwm0_1_pin_88_89_grp",
217162306a36Sopenharmony_ci		.pins = pwm0_1_pins[6],
217262306a36Sopenharmony_ci		.npins = ARRAY_SIZE(pwm0_1_pins[6]),
217362306a36Sopenharmony_ci		.modemuxs = pwm0_1_pin_88_89_modemux,
217462306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(pwm0_1_pin_88_89_modemux),
217562306a36Sopenharmony_ci	},
217662306a36Sopenharmony_ci};
217762306a36Sopenharmony_ci
217862306a36Sopenharmony_cistatic const char *const pwm0_1_grps[] = { "pwm0_1_pin_8_9_grp",
217962306a36Sopenharmony_ci	"pwm0_1_pin_14_15_grp", "pwm0_1_pin_30_31_grp", "pwm0_1_pin_37_38_grp",
218062306a36Sopenharmony_ci	"pwm0_1_pin_42_43_grp", "pwm0_1_pin_59_60_grp", "pwm0_1_pin_88_89_grp"
218162306a36Sopenharmony_ci};
218262306a36Sopenharmony_ci
218362306a36Sopenharmony_cistatic struct spear_function pwm0_1_function = {
218462306a36Sopenharmony_ci	.name = "pwm0_1",
218562306a36Sopenharmony_ci	.groups = pwm0_1_grps,
218662306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(pwm0_1_grps),
218762306a36Sopenharmony_ci};
218862306a36Sopenharmony_ci
218962306a36Sopenharmony_ci/* Pad multiplexing for PWM2 device */
219062306a36Sopenharmony_cistatic const unsigned pwm2_pins[][1] = { { 7 }, { 13 }, { 29 }, { 34 }, { 41 },
219162306a36Sopenharmony_ci	{ 58 }, { 87 } };
219262306a36Sopenharmony_cistatic struct spear_muxreg pwm2_net_muxreg[] = {
219362306a36Sopenharmony_ci	{
219462306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
219562306a36Sopenharmony_ci		.mask = PMX_SSP_CS_MASK,
219662306a36Sopenharmony_ci		.val = 0,
219762306a36Sopenharmony_ci	},
219862306a36Sopenharmony_ci};
219962306a36Sopenharmony_ci
220062306a36Sopenharmony_cistatic struct spear_muxreg pwm2_pin_7_muxreg[] = {
220162306a36Sopenharmony_ci	{
220262306a36Sopenharmony_ci		.reg = IP_SEL_PAD_0_9_REG,
220362306a36Sopenharmony_ci		.mask = PMX_PL_7_MASK,
220462306a36Sopenharmony_ci		.val = PMX_PWM_2_PL_7_VAL,
220562306a36Sopenharmony_ci	},
220662306a36Sopenharmony_ci};
220762306a36Sopenharmony_ci
220862306a36Sopenharmony_cistatic struct spear_muxreg pwm2_autoexpsmallpri_muxreg[] = {
220962306a36Sopenharmony_ci	{
221062306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
221162306a36Sopenharmony_ci		.mask = PMX_MII_MASK,
221262306a36Sopenharmony_ci		.val = 0,
221362306a36Sopenharmony_ci	},
221462306a36Sopenharmony_ci};
221562306a36Sopenharmony_ci
221662306a36Sopenharmony_cistatic struct spear_muxreg pwm2_pin_13_muxreg[] = {
221762306a36Sopenharmony_ci	{
221862306a36Sopenharmony_ci		.reg = IP_SEL_PAD_10_19_REG,
221962306a36Sopenharmony_ci		.mask = PMX_PL_13_MASK,
222062306a36Sopenharmony_ci		.val = PMX_PWM2_PL_13_VAL,
222162306a36Sopenharmony_ci	},
222262306a36Sopenharmony_ci};
222362306a36Sopenharmony_ci
222462306a36Sopenharmony_cistatic struct spear_muxreg pwm2_pin_29_muxreg[] = {
222562306a36Sopenharmony_ci	{
222662306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
222762306a36Sopenharmony_ci		.mask = PMX_GPIO_PIN1_MASK,
222862306a36Sopenharmony_ci		.val = 0,
222962306a36Sopenharmony_ci	}, {
223062306a36Sopenharmony_ci		.reg = IP_SEL_PAD_20_29_REG,
223162306a36Sopenharmony_ci		.mask = PMX_PL_29_MASK,
223262306a36Sopenharmony_ci		.val = PMX_PWM_2_PL_29_VAL,
223362306a36Sopenharmony_ci	},
223462306a36Sopenharmony_ci};
223562306a36Sopenharmony_ci
223662306a36Sopenharmony_cistatic struct spear_muxreg pwm2_pin_34_muxreg[] = {
223762306a36Sopenharmony_ci	{
223862306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
223962306a36Sopenharmony_ci		.mask = PMX_SSP_CS_MASK,
224062306a36Sopenharmony_ci		.val = 0,
224162306a36Sopenharmony_ci	}, {
224262306a36Sopenharmony_ci		.reg = MODE_CONFIG_REG,
224362306a36Sopenharmony_ci		.mask = PMX_PWM_MASK,
224462306a36Sopenharmony_ci		.val = PMX_PWM_MASK,
224562306a36Sopenharmony_ci	}, {
224662306a36Sopenharmony_ci		.reg = IP_SEL_PAD_30_39_REG,
224762306a36Sopenharmony_ci		.mask = PMX_PL_34_MASK,
224862306a36Sopenharmony_ci		.val = PMX_PWM2_PL_34_VAL,
224962306a36Sopenharmony_ci	},
225062306a36Sopenharmony_ci};
225162306a36Sopenharmony_ci
225262306a36Sopenharmony_cistatic struct spear_muxreg pwm2_pin_41_muxreg[] = {
225362306a36Sopenharmony_ci	{
225462306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
225562306a36Sopenharmony_ci		.mask = PMX_UART0_MODEM_MASK,
225662306a36Sopenharmony_ci		.val = 0,
225762306a36Sopenharmony_ci	}, {
225862306a36Sopenharmony_ci		.reg = IP_SEL_PAD_40_49_REG,
225962306a36Sopenharmony_ci		.mask = PMX_PL_41_MASK,
226062306a36Sopenharmony_ci		.val = PMX_PWM2_PL_41_VAL,
226162306a36Sopenharmony_ci	},
226262306a36Sopenharmony_ci};
226362306a36Sopenharmony_ci
226462306a36Sopenharmony_cistatic struct spear_muxreg pwm2_pin_58_muxreg[] = {
226562306a36Sopenharmony_ci	{
226662306a36Sopenharmony_ci		.reg = IP_SEL_PAD_50_59_REG,
226762306a36Sopenharmony_ci		.mask = PMX_PL_58_MASK,
226862306a36Sopenharmony_ci		.val = PMX_PWM2_PL_58_VAL,
226962306a36Sopenharmony_ci	},
227062306a36Sopenharmony_ci};
227162306a36Sopenharmony_ci
227262306a36Sopenharmony_cistatic struct spear_muxreg pwm2_pin_87_muxreg[] = {
227362306a36Sopenharmony_ci	{
227462306a36Sopenharmony_ci		.reg = IP_SEL_PAD_80_89_REG,
227562306a36Sopenharmony_ci		.mask = PMX_PL_87_MASK,
227662306a36Sopenharmony_ci		.val = PMX_PWM2_PL_87_VAL,
227762306a36Sopenharmony_ci	},
227862306a36Sopenharmony_ci};
227962306a36Sopenharmony_ci
228062306a36Sopenharmony_cistatic struct spear_modemux pwm2_pin_7_modemux[] = {
228162306a36Sopenharmony_ci	{
228262306a36Sopenharmony_ci		.modes = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE | EXTENDED_MODE,
228362306a36Sopenharmony_ci		.muxregs = pwm2_net_muxreg,
228462306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(pwm2_net_muxreg),
228562306a36Sopenharmony_ci	}, {
228662306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
228762306a36Sopenharmony_ci		.muxregs = pwm2_pin_7_muxreg,
228862306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(pwm2_pin_7_muxreg),
228962306a36Sopenharmony_ci	},
229062306a36Sopenharmony_ci};
229162306a36Sopenharmony_cistatic struct spear_modemux pwm2_pin_13_modemux[] = {
229262306a36Sopenharmony_ci	{
229362306a36Sopenharmony_ci		.modes = AUTO_EXP_MODE | SMALL_PRINTERS_MODE | EXTENDED_MODE,
229462306a36Sopenharmony_ci		.muxregs = pwm2_autoexpsmallpri_muxreg,
229562306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(pwm2_autoexpsmallpri_muxreg),
229662306a36Sopenharmony_ci	}, {
229762306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
229862306a36Sopenharmony_ci		.muxregs = pwm2_pin_13_muxreg,
229962306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(pwm2_pin_13_muxreg),
230062306a36Sopenharmony_ci	},
230162306a36Sopenharmony_ci};
230262306a36Sopenharmony_cistatic struct spear_modemux pwm2_pin_29_modemux[] = {
230362306a36Sopenharmony_ci	{
230462306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
230562306a36Sopenharmony_ci		.muxregs = pwm2_pin_29_muxreg,
230662306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(pwm2_pin_29_muxreg),
230762306a36Sopenharmony_ci	},
230862306a36Sopenharmony_ci};
230962306a36Sopenharmony_cistatic struct spear_modemux pwm2_pin_34_modemux[] = {
231062306a36Sopenharmony_ci	{
231162306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
231262306a36Sopenharmony_ci		.muxregs = pwm2_pin_34_muxreg,
231362306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(pwm2_pin_34_muxreg),
231462306a36Sopenharmony_ci	},
231562306a36Sopenharmony_ci};
231662306a36Sopenharmony_ci
231762306a36Sopenharmony_cistatic struct spear_modemux pwm2_pin_41_modemux[] = {
231862306a36Sopenharmony_ci	{
231962306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
232062306a36Sopenharmony_ci		.muxregs = pwm2_pin_41_muxreg,
232162306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(pwm2_pin_41_muxreg),
232262306a36Sopenharmony_ci	},
232362306a36Sopenharmony_ci};
232462306a36Sopenharmony_ci
232562306a36Sopenharmony_cistatic struct spear_modemux pwm2_pin_58_modemux[] = {
232662306a36Sopenharmony_ci	{
232762306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
232862306a36Sopenharmony_ci		.muxregs = pwm2_pin_58_muxreg,
232962306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(pwm2_pin_58_muxreg),
233062306a36Sopenharmony_ci	},
233162306a36Sopenharmony_ci};
233262306a36Sopenharmony_ci
233362306a36Sopenharmony_cistatic struct spear_modemux pwm2_pin_87_modemux[] = {
233462306a36Sopenharmony_ci	{
233562306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
233662306a36Sopenharmony_ci		.muxregs = pwm2_pin_87_muxreg,
233762306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(pwm2_pin_87_muxreg),
233862306a36Sopenharmony_ci	},
233962306a36Sopenharmony_ci};
234062306a36Sopenharmony_ci
234162306a36Sopenharmony_cistatic struct spear_pingroup pwm2_pingroup[] = {
234262306a36Sopenharmony_ci	{
234362306a36Sopenharmony_ci		.name = "pwm2_pin_7_grp",
234462306a36Sopenharmony_ci		.pins = pwm2_pins[0],
234562306a36Sopenharmony_ci		.npins = ARRAY_SIZE(pwm2_pins[0]),
234662306a36Sopenharmony_ci		.modemuxs = pwm2_pin_7_modemux,
234762306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(pwm2_pin_7_modemux),
234862306a36Sopenharmony_ci	}, {
234962306a36Sopenharmony_ci		.name = "pwm2_pin_13_grp",
235062306a36Sopenharmony_ci		.pins = pwm2_pins[1],
235162306a36Sopenharmony_ci		.npins = ARRAY_SIZE(pwm2_pins[1]),
235262306a36Sopenharmony_ci		.modemuxs = pwm2_pin_13_modemux,
235362306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(pwm2_pin_13_modemux),
235462306a36Sopenharmony_ci	}, {
235562306a36Sopenharmony_ci		.name = "pwm2_pin_29_grp",
235662306a36Sopenharmony_ci		.pins = pwm2_pins[2],
235762306a36Sopenharmony_ci		.npins = ARRAY_SIZE(pwm2_pins[2]),
235862306a36Sopenharmony_ci		.modemuxs = pwm2_pin_29_modemux,
235962306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(pwm2_pin_29_modemux),
236062306a36Sopenharmony_ci	}, {
236162306a36Sopenharmony_ci		.name = "pwm2_pin_34_grp",
236262306a36Sopenharmony_ci		.pins = pwm2_pins[3],
236362306a36Sopenharmony_ci		.npins = ARRAY_SIZE(pwm2_pins[3]),
236462306a36Sopenharmony_ci		.modemuxs = pwm2_pin_34_modemux,
236562306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(pwm2_pin_34_modemux),
236662306a36Sopenharmony_ci	}, {
236762306a36Sopenharmony_ci		.name = "pwm2_pin_41_grp",
236862306a36Sopenharmony_ci		.pins = pwm2_pins[4],
236962306a36Sopenharmony_ci		.npins = ARRAY_SIZE(pwm2_pins[4]),
237062306a36Sopenharmony_ci		.modemuxs = pwm2_pin_41_modemux,
237162306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(pwm2_pin_41_modemux),
237262306a36Sopenharmony_ci	}, {
237362306a36Sopenharmony_ci		.name = "pwm2_pin_58_grp",
237462306a36Sopenharmony_ci		.pins = pwm2_pins[5],
237562306a36Sopenharmony_ci		.npins = ARRAY_SIZE(pwm2_pins[5]),
237662306a36Sopenharmony_ci		.modemuxs = pwm2_pin_58_modemux,
237762306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(pwm2_pin_58_modemux),
237862306a36Sopenharmony_ci	}, {
237962306a36Sopenharmony_ci		.name = "pwm2_pin_87_grp",
238062306a36Sopenharmony_ci		.pins = pwm2_pins[6],
238162306a36Sopenharmony_ci		.npins = ARRAY_SIZE(pwm2_pins[6]),
238262306a36Sopenharmony_ci		.modemuxs = pwm2_pin_87_modemux,
238362306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(pwm2_pin_87_modemux),
238462306a36Sopenharmony_ci	},
238562306a36Sopenharmony_ci};
238662306a36Sopenharmony_ci
238762306a36Sopenharmony_cistatic const char *const pwm2_grps[] = { "pwm2_pin_7_grp", "pwm2_pin_13_grp",
238862306a36Sopenharmony_ci	"pwm2_pin_29_grp", "pwm2_pin_34_grp", "pwm2_pin_41_grp",
238962306a36Sopenharmony_ci	"pwm2_pin_58_grp", "pwm2_pin_87_grp" };
239062306a36Sopenharmony_cistatic struct spear_function pwm2_function = {
239162306a36Sopenharmony_ci	.name = "pwm2",
239262306a36Sopenharmony_ci	.groups = pwm2_grps,
239362306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(pwm2_grps),
239462306a36Sopenharmony_ci};
239562306a36Sopenharmony_ci
239662306a36Sopenharmony_ci/* Pad multiplexing for PWM3 device */
239762306a36Sopenharmony_cistatic const unsigned pwm3_pins[][1] = { { 6 }, { 12 }, { 28 }, { 40 }, { 57 },
239862306a36Sopenharmony_ci	{ 86 } };
239962306a36Sopenharmony_cistatic struct spear_muxreg pwm3_pin_6_muxreg[] = {
240062306a36Sopenharmony_ci	{
240162306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
240262306a36Sopenharmony_ci		.mask = PMX_SSP_MASK,
240362306a36Sopenharmony_ci		.val = 0,
240462306a36Sopenharmony_ci	}, {
240562306a36Sopenharmony_ci		.reg = IP_SEL_PAD_0_9_REG,
240662306a36Sopenharmony_ci		.mask = PMX_PL_6_MASK,
240762306a36Sopenharmony_ci		.val = PMX_PWM_3_PL_6_VAL,
240862306a36Sopenharmony_ci	},
240962306a36Sopenharmony_ci};
241062306a36Sopenharmony_ci
241162306a36Sopenharmony_cistatic struct spear_muxreg pwm3_muxreg[] = {
241262306a36Sopenharmony_ci	{
241362306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
241462306a36Sopenharmony_ci		.mask = PMX_MII_MASK,
241562306a36Sopenharmony_ci		.val = 0,
241662306a36Sopenharmony_ci	},
241762306a36Sopenharmony_ci};
241862306a36Sopenharmony_ci
241962306a36Sopenharmony_cistatic struct spear_muxreg pwm3_pin_12_muxreg[] = {
242062306a36Sopenharmony_ci	{
242162306a36Sopenharmony_ci		.reg = IP_SEL_PAD_10_19_REG,
242262306a36Sopenharmony_ci		.mask = PMX_PL_12_MASK,
242362306a36Sopenharmony_ci		.val = PMX_PWM3_PL_12_VAL,
242462306a36Sopenharmony_ci	},
242562306a36Sopenharmony_ci};
242662306a36Sopenharmony_ci
242762306a36Sopenharmony_cistatic struct spear_muxreg pwm3_pin_28_muxreg[] = {
242862306a36Sopenharmony_ci	{
242962306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
243062306a36Sopenharmony_ci		.mask = PMX_GPIO_PIN0_MASK,
243162306a36Sopenharmony_ci		.val = 0,
243262306a36Sopenharmony_ci	}, {
243362306a36Sopenharmony_ci		.reg = IP_SEL_PAD_20_29_REG,
243462306a36Sopenharmony_ci		.mask = PMX_PL_28_MASK,
243562306a36Sopenharmony_ci		.val = PMX_PWM_3_PL_28_VAL,
243662306a36Sopenharmony_ci	},
243762306a36Sopenharmony_ci};
243862306a36Sopenharmony_ci
243962306a36Sopenharmony_cistatic struct spear_muxreg pwm3_pin_40_muxreg[] = {
244062306a36Sopenharmony_ci	{
244162306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
244262306a36Sopenharmony_ci		.mask = PMX_UART0_MODEM_MASK,
244362306a36Sopenharmony_ci		.val = 0,
244462306a36Sopenharmony_ci	}, {
244562306a36Sopenharmony_ci		.reg = IP_SEL_PAD_40_49_REG,
244662306a36Sopenharmony_ci		.mask = PMX_PL_40_MASK,
244762306a36Sopenharmony_ci		.val = PMX_PWM3_PL_40_VAL,
244862306a36Sopenharmony_ci	},
244962306a36Sopenharmony_ci};
245062306a36Sopenharmony_ci
245162306a36Sopenharmony_cistatic struct spear_muxreg pwm3_pin_57_muxreg[] = {
245262306a36Sopenharmony_ci	{
245362306a36Sopenharmony_ci		.reg = IP_SEL_PAD_50_59_REG,
245462306a36Sopenharmony_ci		.mask = PMX_PL_57_MASK,
245562306a36Sopenharmony_ci		.val = PMX_PWM3_PL_57_VAL,
245662306a36Sopenharmony_ci	},
245762306a36Sopenharmony_ci};
245862306a36Sopenharmony_ci
245962306a36Sopenharmony_cistatic struct spear_muxreg pwm3_pin_86_muxreg[] = {
246062306a36Sopenharmony_ci	{
246162306a36Sopenharmony_ci		.reg = IP_SEL_PAD_80_89_REG,
246262306a36Sopenharmony_ci		.mask = PMX_PL_86_MASK,
246362306a36Sopenharmony_ci		.val = PMX_PWM3_PL_86_VAL,
246462306a36Sopenharmony_ci	},
246562306a36Sopenharmony_ci};
246662306a36Sopenharmony_ci
246762306a36Sopenharmony_cistatic struct spear_modemux pwm3_pin_6_modemux[] = {
246862306a36Sopenharmony_ci	{
246962306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
247062306a36Sopenharmony_ci		.muxregs = pwm3_pin_6_muxreg,
247162306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(pwm3_pin_6_muxreg),
247262306a36Sopenharmony_ci	},
247362306a36Sopenharmony_ci};
247462306a36Sopenharmony_ci
247562306a36Sopenharmony_cistatic struct spear_modemux pwm3_pin_12_modemux[] = {
247662306a36Sopenharmony_ci	{
247762306a36Sopenharmony_ci		.modes = AUTO_EXP_MODE | SMALL_PRINTERS_MODE |
247862306a36Sopenharmony_ci			AUTO_NET_SMII_MODE | EXTENDED_MODE,
247962306a36Sopenharmony_ci		.muxregs = pwm3_muxreg,
248062306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(pwm3_muxreg),
248162306a36Sopenharmony_ci	}, {
248262306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
248362306a36Sopenharmony_ci		.muxregs = pwm3_pin_12_muxreg,
248462306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(pwm3_pin_12_muxreg),
248562306a36Sopenharmony_ci	},
248662306a36Sopenharmony_ci};
248762306a36Sopenharmony_ci
248862306a36Sopenharmony_cistatic struct spear_modemux pwm3_pin_28_modemux[] = {
248962306a36Sopenharmony_ci	{
249062306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
249162306a36Sopenharmony_ci		.muxregs = pwm3_pin_28_muxreg,
249262306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(pwm3_pin_28_muxreg),
249362306a36Sopenharmony_ci	},
249462306a36Sopenharmony_ci};
249562306a36Sopenharmony_ci
249662306a36Sopenharmony_cistatic struct spear_modemux pwm3_pin_40_modemux[] = {
249762306a36Sopenharmony_ci	{
249862306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
249962306a36Sopenharmony_ci		.muxregs = pwm3_pin_40_muxreg,
250062306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(pwm3_pin_40_muxreg),
250162306a36Sopenharmony_ci	},
250262306a36Sopenharmony_ci};
250362306a36Sopenharmony_ci
250462306a36Sopenharmony_cistatic struct spear_modemux pwm3_pin_57_modemux[] = {
250562306a36Sopenharmony_ci	{
250662306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
250762306a36Sopenharmony_ci		.muxregs = pwm3_pin_57_muxreg,
250862306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(pwm3_pin_57_muxreg),
250962306a36Sopenharmony_ci	},
251062306a36Sopenharmony_ci};
251162306a36Sopenharmony_ci
251262306a36Sopenharmony_cistatic struct spear_modemux pwm3_pin_86_modemux[] = {
251362306a36Sopenharmony_ci	{
251462306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
251562306a36Sopenharmony_ci		.muxregs = pwm3_pin_86_muxreg,
251662306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(pwm3_pin_86_muxreg),
251762306a36Sopenharmony_ci	},
251862306a36Sopenharmony_ci};
251962306a36Sopenharmony_ci
252062306a36Sopenharmony_cistatic struct spear_pingroup pwm3_pingroup[] = {
252162306a36Sopenharmony_ci	{
252262306a36Sopenharmony_ci		.name = "pwm3_pin_6_grp",
252362306a36Sopenharmony_ci		.pins = pwm3_pins[0],
252462306a36Sopenharmony_ci		.npins = ARRAY_SIZE(pwm3_pins[0]),
252562306a36Sopenharmony_ci		.modemuxs = pwm3_pin_6_modemux,
252662306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(pwm3_pin_6_modemux),
252762306a36Sopenharmony_ci	}, {
252862306a36Sopenharmony_ci		.name = "pwm3_pin_12_grp",
252962306a36Sopenharmony_ci		.pins = pwm3_pins[1],
253062306a36Sopenharmony_ci		.npins = ARRAY_SIZE(pwm3_pins[1]),
253162306a36Sopenharmony_ci		.modemuxs = pwm3_pin_12_modemux,
253262306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(pwm3_pin_12_modemux),
253362306a36Sopenharmony_ci	}, {
253462306a36Sopenharmony_ci		.name = "pwm3_pin_28_grp",
253562306a36Sopenharmony_ci		.pins = pwm3_pins[2],
253662306a36Sopenharmony_ci		.npins = ARRAY_SIZE(pwm3_pins[2]),
253762306a36Sopenharmony_ci		.modemuxs = pwm3_pin_28_modemux,
253862306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(pwm3_pin_28_modemux),
253962306a36Sopenharmony_ci	}, {
254062306a36Sopenharmony_ci		.name = "pwm3_pin_40_grp",
254162306a36Sopenharmony_ci		.pins = pwm3_pins[3],
254262306a36Sopenharmony_ci		.npins = ARRAY_SIZE(pwm3_pins[3]),
254362306a36Sopenharmony_ci		.modemuxs = pwm3_pin_40_modemux,
254462306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(pwm3_pin_40_modemux),
254562306a36Sopenharmony_ci	}, {
254662306a36Sopenharmony_ci		.name = "pwm3_pin_57_grp",
254762306a36Sopenharmony_ci		.pins = pwm3_pins[4],
254862306a36Sopenharmony_ci		.npins = ARRAY_SIZE(pwm3_pins[4]),
254962306a36Sopenharmony_ci		.modemuxs = pwm3_pin_57_modemux,
255062306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(pwm3_pin_57_modemux),
255162306a36Sopenharmony_ci	}, {
255262306a36Sopenharmony_ci		.name = "pwm3_pin_86_grp",
255362306a36Sopenharmony_ci		.pins = pwm3_pins[5],
255462306a36Sopenharmony_ci		.npins = ARRAY_SIZE(pwm3_pins[5]),
255562306a36Sopenharmony_ci		.modemuxs = pwm3_pin_86_modemux,
255662306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(pwm3_pin_86_modemux),
255762306a36Sopenharmony_ci	},
255862306a36Sopenharmony_ci};
255962306a36Sopenharmony_ci
256062306a36Sopenharmony_cistatic const char *const pwm3_grps[] = { "pwm3_pin_6_grp", "pwm3_pin_12_grp",
256162306a36Sopenharmony_ci	"pwm3_pin_28_grp", "pwm3_pin_40_grp", "pwm3_pin_57_grp",
256262306a36Sopenharmony_ci	"pwm3_pin_86_grp" };
256362306a36Sopenharmony_cistatic struct spear_function pwm3_function = {
256462306a36Sopenharmony_ci	.name = "pwm3",
256562306a36Sopenharmony_ci	.groups = pwm3_grps,
256662306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(pwm3_grps),
256762306a36Sopenharmony_ci};
256862306a36Sopenharmony_ci
256962306a36Sopenharmony_ci/* Pad multiplexing for SSP1 device */
257062306a36Sopenharmony_cistatic const unsigned ssp1_pins[][2] = { { 17, 20 }, { 36, 39 }, { 48, 51 },
257162306a36Sopenharmony_ci	{ 65, 68 }, { 94, 97 } };
257262306a36Sopenharmony_cistatic struct spear_muxreg ssp1_muxreg[] = {
257362306a36Sopenharmony_ci	{
257462306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
257562306a36Sopenharmony_ci		.mask = PMX_MII_MASK,
257662306a36Sopenharmony_ci		.val = 0,
257762306a36Sopenharmony_ci	},
257862306a36Sopenharmony_ci};
257962306a36Sopenharmony_ci
258062306a36Sopenharmony_cistatic struct spear_muxreg ssp1_ext_17_20_muxreg[] = {
258162306a36Sopenharmony_ci	{
258262306a36Sopenharmony_ci		.reg = IP_SEL_PAD_10_19_REG,
258362306a36Sopenharmony_ci		.mask = PMX_PL_17_18_MASK | PMX_PL_19_MASK,
258462306a36Sopenharmony_ci		.val = PMX_SSP1_PL_17_18_19_20_VAL,
258562306a36Sopenharmony_ci	}, {
258662306a36Sopenharmony_ci		.reg = IP_SEL_PAD_20_29_REG,
258762306a36Sopenharmony_ci		.mask = PMX_PL_20_MASK,
258862306a36Sopenharmony_ci		.val = PMX_SSP1_PL_17_18_19_20_VAL,
258962306a36Sopenharmony_ci	}, {
259062306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
259162306a36Sopenharmony_ci		.mask = PMX_SSP1_PORT_SEL_MASK,
259262306a36Sopenharmony_ci		.val = PMX_SSP1_PORT_17_TO_20_VAL,
259362306a36Sopenharmony_ci	},
259462306a36Sopenharmony_ci};
259562306a36Sopenharmony_ci
259662306a36Sopenharmony_cistatic struct spear_muxreg ssp1_ext_36_39_muxreg[] = {
259762306a36Sopenharmony_ci	{
259862306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
259962306a36Sopenharmony_ci		.mask = PMX_UART0_MODEM_MASK | PMX_SSP_CS_MASK,
260062306a36Sopenharmony_ci		.val = 0,
260162306a36Sopenharmony_ci	}, {
260262306a36Sopenharmony_ci		.reg = IP_SEL_PAD_30_39_REG,
260362306a36Sopenharmony_ci		.mask = PMX_PL_36_MASK | PMX_PL_37_38_MASK | PMX_PL_39_MASK,
260462306a36Sopenharmony_ci		.val = PMX_SSP1_PL_36_VAL | PMX_SSP1_PL_37_38_VAL |
260562306a36Sopenharmony_ci			PMX_SSP1_PL_39_VAL,
260662306a36Sopenharmony_ci	}, {
260762306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
260862306a36Sopenharmony_ci		.mask = PMX_SSP1_PORT_SEL_MASK,
260962306a36Sopenharmony_ci		.val = PMX_SSP1_PORT_36_TO_39_VAL,
261062306a36Sopenharmony_ci	},
261162306a36Sopenharmony_ci};
261262306a36Sopenharmony_ci
261362306a36Sopenharmony_cistatic struct spear_muxreg ssp1_ext_48_51_muxreg[] = {
261462306a36Sopenharmony_ci	{
261562306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
261662306a36Sopenharmony_ci		.mask = PMX_TIMER_0_1_MASK | PMX_TIMER_2_3_MASK,
261762306a36Sopenharmony_ci		.val = 0,
261862306a36Sopenharmony_ci	}, {
261962306a36Sopenharmony_ci		.reg = IP_SEL_PAD_40_49_REG,
262062306a36Sopenharmony_ci		.mask = PMX_PL_48_49_MASK,
262162306a36Sopenharmony_ci		.val = PMX_SSP1_PL_48_49_VAL,
262262306a36Sopenharmony_ci	}, {
262362306a36Sopenharmony_ci		.reg = IP_SEL_PAD_50_59_REG,
262462306a36Sopenharmony_ci		.mask = PMX_PL_50_51_MASK,
262562306a36Sopenharmony_ci		.val = PMX_SSP1_PL_50_51_VAL,
262662306a36Sopenharmony_ci	}, {
262762306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
262862306a36Sopenharmony_ci		.mask = PMX_SSP1_PORT_SEL_MASK,
262962306a36Sopenharmony_ci		.val = PMX_SSP1_PORT_48_TO_51_VAL,
263062306a36Sopenharmony_ci	},
263162306a36Sopenharmony_ci};
263262306a36Sopenharmony_ci
263362306a36Sopenharmony_cistatic struct spear_muxreg ssp1_ext_65_68_muxreg[] = {
263462306a36Sopenharmony_ci	{
263562306a36Sopenharmony_ci		.reg = IP_SEL_PAD_60_69_REG,
263662306a36Sopenharmony_ci		.mask = PMX_PL_65_TO_68_MASK,
263762306a36Sopenharmony_ci		.val = PMX_SSP1_PL_65_TO_68_VAL,
263862306a36Sopenharmony_ci	}, {
263962306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
264062306a36Sopenharmony_ci		.mask = PMX_SSP1_PORT_SEL_MASK,
264162306a36Sopenharmony_ci		.val = PMX_SSP1_PORT_65_TO_68_VAL,
264262306a36Sopenharmony_ci	},
264362306a36Sopenharmony_ci};
264462306a36Sopenharmony_ci
264562306a36Sopenharmony_cistatic struct spear_muxreg ssp1_ext_94_97_muxreg[] = {
264662306a36Sopenharmony_ci	{
264762306a36Sopenharmony_ci		.reg = IP_SEL_PAD_90_99_REG,
264862306a36Sopenharmony_ci		.mask = PMX_PL_94_95_MASK | PMX_PL_96_97_MASK,
264962306a36Sopenharmony_ci		.val = PMX_SSP1_PL_94_95_VAL | PMX_SSP1_PL_96_97_VAL,
265062306a36Sopenharmony_ci	}, {
265162306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
265262306a36Sopenharmony_ci		.mask = PMX_SSP1_PORT_SEL_MASK,
265362306a36Sopenharmony_ci		.val = PMX_SSP1_PORT_94_TO_97_VAL,
265462306a36Sopenharmony_ci	},
265562306a36Sopenharmony_ci};
265662306a36Sopenharmony_ci
265762306a36Sopenharmony_cistatic struct spear_modemux ssp1_17_20_modemux[] = {
265862306a36Sopenharmony_ci	{
265962306a36Sopenharmony_ci		.modes = SMALL_PRINTERS_MODE | AUTO_NET_SMII_MODE |
266062306a36Sopenharmony_ci			EXTENDED_MODE,
266162306a36Sopenharmony_ci		.muxregs = ssp1_muxreg,
266262306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(ssp1_muxreg),
266362306a36Sopenharmony_ci	}, {
266462306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
266562306a36Sopenharmony_ci		.muxregs = ssp1_ext_17_20_muxreg,
266662306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(ssp1_ext_17_20_muxreg),
266762306a36Sopenharmony_ci	},
266862306a36Sopenharmony_ci};
266962306a36Sopenharmony_ci
267062306a36Sopenharmony_cistatic struct spear_modemux ssp1_36_39_modemux[] = {
267162306a36Sopenharmony_ci	{
267262306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
267362306a36Sopenharmony_ci		.muxregs = ssp1_ext_36_39_muxreg,
267462306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(ssp1_ext_36_39_muxreg),
267562306a36Sopenharmony_ci	},
267662306a36Sopenharmony_ci};
267762306a36Sopenharmony_ci
267862306a36Sopenharmony_cistatic struct spear_modemux ssp1_48_51_modemux[] = {
267962306a36Sopenharmony_ci	{
268062306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
268162306a36Sopenharmony_ci		.muxregs = ssp1_ext_48_51_muxreg,
268262306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(ssp1_ext_48_51_muxreg),
268362306a36Sopenharmony_ci	},
268462306a36Sopenharmony_ci};
268562306a36Sopenharmony_cistatic struct spear_modemux ssp1_65_68_modemux[] = {
268662306a36Sopenharmony_ci	{
268762306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
268862306a36Sopenharmony_ci		.muxregs = ssp1_ext_65_68_muxreg,
268962306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(ssp1_ext_65_68_muxreg),
269062306a36Sopenharmony_ci	},
269162306a36Sopenharmony_ci};
269262306a36Sopenharmony_ci
269362306a36Sopenharmony_cistatic struct spear_modemux ssp1_94_97_modemux[] = {
269462306a36Sopenharmony_ci	{
269562306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
269662306a36Sopenharmony_ci		.muxregs = ssp1_ext_94_97_muxreg,
269762306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(ssp1_ext_94_97_muxreg),
269862306a36Sopenharmony_ci	},
269962306a36Sopenharmony_ci};
270062306a36Sopenharmony_ci
270162306a36Sopenharmony_cistatic struct spear_pingroup ssp1_pingroup[] = {
270262306a36Sopenharmony_ci	{
270362306a36Sopenharmony_ci		.name = "ssp1_17_20_grp",
270462306a36Sopenharmony_ci		.pins = ssp1_pins[0],
270562306a36Sopenharmony_ci		.npins = ARRAY_SIZE(ssp1_pins[0]),
270662306a36Sopenharmony_ci		.modemuxs = ssp1_17_20_modemux,
270762306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(ssp1_17_20_modemux),
270862306a36Sopenharmony_ci	}, {
270962306a36Sopenharmony_ci		.name = "ssp1_36_39_grp",
271062306a36Sopenharmony_ci		.pins = ssp1_pins[1],
271162306a36Sopenharmony_ci		.npins = ARRAY_SIZE(ssp1_pins[1]),
271262306a36Sopenharmony_ci		.modemuxs = ssp1_36_39_modemux,
271362306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(ssp1_36_39_modemux),
271462306a36Sopenharmony_ci	}, {
271562306a36Sopenharmony_ci		.name = "ssp1_48_51_grp",
271662306a36Sopenharmony_ci		.pins = ssp1_pins[2],
271762306a36Sopenharmony_ci		.npins = ARRAY_SIZE(ssp1_pins[2]),
271862306a36Sopenharmony_ci		.modemuxs = ssp1_48_51_modemux,
271962306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(ssp1_48_51_modemux),
272062306a36Sopenharmony_ci	}, {
272162306a36Sopenharmony_ci		.name = "ssp1_65_68_grp",
272262306a36Sopenharmony_ci		.pins = ssp1_pins[3],
272362306a36Sopenharmony_ci		.npins = ARRAY_SIZE(ssp1_pins[3]),
272462306a36Sopenharmony_ci		.modemuxs = ssp1_65_68_modemux,
272562306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(ssp1_65_68_modemux),
272662306a36Sopenharmony_ci	}, {
272762306a36Sopenharmony_ci		.name = "ssp1_94_97_grp",
272862306a36Sopenharmony_ci		.pins = ssp1_pins[4],
272962306a36Sopenharmony_ci		.npins = ARRAY_SIZE(ssp1_pins[4]),
273062306a36Sopenharmony_ci		.modemuxs = ssp1_94_97_modemux,
273162306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(ssp1_94_97_modemux),
273262306a36Sopenharmony_ci	},
273362306a36Sopenharmony_ci};
273462306a36Sopenharmony_ci
273562306a36Sopenharmony_cistatic const char *const ssp1_grps[] = { "ssp1_17_20_grp", "ssp1_36_39_grp",
273662306a36Sopenharmony_ci	"ssp1_48_51_grp", "ssp1_65_68_grp", "ssp1_94_97_grp"
273762306a36Sopenharmony_ci};
273862306a36Sopenharmony_cistatic struct spear_function ssp1_function = {
273962306a36Sopenharmony_ci	.name = "ssp1",
274062306a36Sopenharmony_ci	.groups = ssp1_grps,
274162306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(ssp1_grps),
274262306a36Sopenharmony_ci};
274362306a36Sopenharmony_ci
274462306a36Sopenharmony_ci/* Pad multiplexing for SSP2 device */
274562306a36Sopenharmony_cistatic const unsigned ssp2_pins[][2] = { { 13, 16 }, { 32, 35 }, { 44, 47 },
274662306a36Sopenharmony_ci	{ 61, 64 }, { 90, 93 } };
274762306a36Sopenharmony_cistatic struct spear_muxreg ssp2_muxreg[] = {
274862306a36Sopenharmony_ci	{
274962306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
275062306a36Sopenharmony_ci		.mask = PMX_MII_MASK,
275162306a36Sopenharmony_ci		.val = 0,
275262306a36Sopenharmony_ci	},
275362306a36Sopenharmony_ci};
275462306a36Sopenharmony_ci
275562306a36Sopenharmony_cistatic struct spear_muxreg ssp2_ext_13_16_muxreg[] = {
275662306a36Sopenharmony_ci	{
275762306a36Sopenharmony_ci		.reg = IP_SEL_PAD_10_19_REG,
275862306a36Sopenharmony_ci		.mask = PMX_PL_13_14_MASK | PMX_PL_15_16_MASK,
275962306a36Sopenharmony_ci		.val = PMX_SSP2_PL_13_14_15_16_VAL,
276062306a36Sopenharmony_ci	}, {
276162306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
276262306a36Sopenharmony_ci		.mask = PMX_SSP2_PORT_SEL_MASK,
276362306a36Sopenharmony_ci		.val = PMX_SSP2_PORT_13_TO_16_VAL,
276462306a36Sopenharmony_ci	},
276562306a36Sopenharmony_ci};
276662306a36Sopenharmony_ci
276762306a36Sopenharmony_cistatic struct spear_muxreg ssp2_ext_32_35_muxreg[] = {
276862306a36Sopenharmony_ci	{
276962306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
277062306a36Sopenharmony_ci		.mask = PMX_SSP_CS_MASK | PMX_GPIO_PIN4_MASK |
277162306a36Sopenharmony_ci			PMX_GPIO_PIN5_MASK,
277262306a36Sopenharmony_ci		.val = 0,
277362306a36Sopenharmony_ci	}, {
277462306a36Sopenharmony_ci		.reg = IP_SEL_PAD_30_39_REG,
277562306a36Sopenharmony_ci		.mask = PMX_PL_32_33_MASK | PMX_PL_34_MASK | PMX_PL_35_MASK,
277662306a36Sopenharmony_ci		.val = PMX_SSP2_PL_32_33_VAL | PMX_SSP2_PL_34_VAL |
277762306a36Sopenharmony_ci			PMX_SSP2_PL_35_VAL,
277862306a36Sopenharmony_ci	}, {
277962306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
278062306a36Sopenharmony_ci		.mask = PMX_SSP2_PORT_SEL_MASK,
278162306a36Sopenharmony_ci		.val = PMX_SSP2_PORT_32_TO_35_VAL,
278262306a36Sopenharmony_ci	},
278362306a36Sopenharmony_ci};
278462306a36Sopenharmony_ci
278562306a36Sopenharmony_cistatic struct spear_muxreg ssp2_ext_44_47_muxreg[] = {
278662306a36Sopenharmony_ci	{
278762306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
278862306a36Sopenharmony_ci		.mask = PMX_TIMER_0_1_MASK | PMX_TIMER_2_3_MASK,
278962306a36Sopenharmony_ci		.val = 0,
279062306a36Sopenharmony_ci	}, {
279162306a36Sopenharmony_ci		.reg = IP_SEL_PAD_40_49_REG,
279262306a36Sopenharmony_ci		.mask = PMX_PL_44_45_MASK | PMX_PL_46_47_MASK,
279362306a36Sopenharmony_ci		.val = PMX_SSP2_PL_44_45_VAL | PMX_SSP2_PL_46_47_VAL,
279462306a36Sopenharmony_ci	}, {
279562306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
279662306a36Sopenharmony_ci		.mask = PMX_SSP2_PORT_SEL_MASK,
279762306a36Sopenharmony_ci		.val = PMX_SSP2_PORT_44_TO_47_VAL,
279862306a36Sopenharmony_ci	},
279962306a36Sopenharmony_ci};
280062306a36Sopenharmony_ci
280162306a36Sopenharmony_cistatic struct spear_muxreg ssp2_ext_61_64_muxreg[] = {
280262306a36Sopenharmony_ci	{
280362306a36Sopenharmony_ci		.reg = IP_SEL_PAD_60_69_REG,
280462306a36Sopenharmony_ci		.mask = PMX_PL_61_TO_64_MASK,
280562306a36Sopenharmony_ci		.val = PMX_SSP2_PL_61_TO_64_VAL,
280662306a36Sopenharmony_ci	}, {
280762306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
280862306a36Sopenharmony_ci		.mask = PMX_SSP2_PORT_SEL_MASK,
280962306a36Sopenharmony_ci		.val = PMX_SSP2_PORT_61_TO_64_VAL,
281062306a36Sopenharmony_ci	},
281162306a36Sopenharmony_ci};
281262306a36Sopenharmony_ci
281362306a36Sopenharmony_cistatic struct spear_muxreg ssp2_ext_90_93_muxreg[] = {
281462306a36Sopenharmony_ci	{
281562306a36Sopenharmony_ci		.reg = IP_SEL_PAD_90_99_REG,
281662306a36Sopenharmony_ci		.mask = PMX_PL_90_91_MASK | PMX_PL_92_93_MASK,
281762306a36Sopenharmony_ci		.val = PMX_SSP2_PL_90_91_VAL | PMX_SSP2_PL_92_93_VAL,
281862306a36Sopenharmony_ci	}, {
281962306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
282062306a36Sopenharmony_ci		.mask = PMX_SSP2_PORT_SEL_MASK,
282162306a36Sopenharmony_ci		.val = PMX_SSP2_PORT_90_TO_93_VAL,
282262306a36Sopenharmony_ci	},
282362306a36Sopenharmony_ci};
282462306a36Sopenharmony_ci
282562306a36Sopenharmony_cistatic struct spear_modemux ssp2_13_16_modemux[] = {
282662306a36Sopenharmony_ci	{
282762306a36Sopenharmony_ci		.modes = AUTO_NET_SMII_MODE | EXTENDED_MODE,
282862306a36Sopenharmony_ci		.muxregs = ssp2_muxreg,
282962306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(ssp2_muxreg),
283062306a36Sopenharmony_ci	}, {
283162306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
283262306a36Sopenharmony_ci		.muxregs = ssp2_ext_13_16_muxreg,
283362306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(ssp2_ext_13_16_muxreg),
283462306a36Sopenharmony_ci	},
283562306a36Sopenharmony_ci};
283662306a36Sopenharmony_ci
283762306a36Sopenharmony_cistatic struct spear_modemux ssp2_32_35_modemux[] = {
283862306a36Sopenharmony_ci	{
283962306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
284062306a36Sopenharmony_ci		.muxregs = ssp2_ext_32_35_muxreg,
284162306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(ssp2_ext_32_35_muxreg),
284262306a36Sopenharmony_ci	},
284362306a36Sopenharmony_ci};
284462306a36Sopenharmony_ci
284562306a36Sopenharmony_cistatic struct spear_modemux ssp2_44_47_modemux[] = {
284662306a36Sopenharmony_ci	{
284762306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
284862306a36Sopenharmony_ci		.muxregs = ssp2_ext_44_47_muxreg,
284962306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(ssp2_ext_44_47_muxreg),
285062306a36Sopenharmony_ci	},
285162306a36Sopenharmony_ci};
285262306a36Sopenharmony_ci
285362306a36Sopenharmony_cistatic struct spear_modemux ssp2_61_64_modemux[] = {
285462306a36Sopenharmony_ci	{
285562306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
285662306a36Sopenharmony_ci		.muxregs = ssp2_ext_61_64_muxreg,
285762306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(ssp2_ext_61_64_muxreg),
285862306a36Sopenharmony_ci	},
285962306a36Sopenharmony_ci};
286062306a36Sopenharmony_ci
286162306a36Sopenharmony_cistatic struct spear_modemux ssp2_90_93_modemux[] = {
286262306a36Sopenharmony_ci	{
286362306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
286462306a36Sopenharmony_ci		.muxregs = ssp2_ext_90_93_muxreg,
286562306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(ssp2_ext_90_93_muxreg),
286662306a36Sopenharmony_ci	},
286762306a36Sopenharmony_ci};
286862306a36Sopenharmony_ci
286962306a36Sopenharmony_cistatic struct spear_pingroup ssp2_pingroup[] = {
287062306a36Sopenharmony_ci	{
287162306a36Sopenharmony_ci		.name = "ssp2_13_16_grp",
287262306a36Sopenharmony_ci		.pins = ssp2_pins[0],
287362306a36Sopenharmony_ci		.npins = ARRAY_SIZE(ssp2_pins[0]),
287462306a36Sopenharmony_ci		.modemuxs = ssp2_13_16_modemux,
287562306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(ssp2_13_16_modemux),
287662306a36Sopenharmony_ci	}, {
287762306a36Sopenharmony_ci		.name = "ssp2_32_35_grp",
287862306a36Sopenharmony_ci		.pins = ssp2_pins[1],
287962306a36Sopenharmony_ci		.npins = ARRAY_SIZE(ssp2_pins[1]),
288062306a36Sopenharmony_ci		.modemuxs = ssp2_32_35_modemux,
288162306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(ssp2_32_35_modemux),
288262306a36Sopenharmony_ci	}, {
288362306a36Sopenharmony_ci		.name = "ssp2_44_47_grp",
288462306a36Sopenharmony_ci		.pins = ssp2_pins[2],
288562306a36Sopenharmony_ci		.npins = ARRAY_SIZE(ssp2_pins[2]),
288662306a36Sopenharmony_ci		.modemuxs = ssp2_44_47_modemux,
288762306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(ssp2_44_47_modemux),
288862306a36Sopenharmony_ci	}, {
288962306a36Sopenharmony_ci		.name = "ssp2_61_64_grp",
289062306a36Sopenharmony_ci		.pins = ssp2_pins[3],
289162306a36Sopenharmony_ci		.npins = ARRAY_SIZE(ssp2_pins[3]),
289262306a36Sopenharmony_ci		.modemuxs = ssp2_61_64_modemux,
289362306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(ssp2_61_64_modemux),
289462306a36Sopenharmony_ci	}, {
289562306a36Sopenharmony_ci		.name = "ssp2_90_93_grp",
289662306a36Sopenharmony_ci		.pins = ssp2_pins[4],
289762306a36Sopenharmony_ci		.npins = ARRAY_SIZE(ssp2_pins[4]),
289862306a36Sopenharmony_ci		.modemuxs = ssp2_90_93_modemux,
289962306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(ssp2_90_93_modemux),
290062306a36Sopenharmony_ci	},
290162306a36Sopenharmony_ci};
290262306a36Sopenharmony_ci
290362306a36Sopenharmony_cistatic const char *const ssp2_grps[] = { "ssp2_13_16_grp", "ssp2_32_35_grp",
290462306a36Sopenharmony_ci	"ssp2_44_47_grp", "ssp2_61_64_grp", "ssp2_90_93_grp" };
290562306a36Sopenharmony_cistatic struct spear_function ssp2_function = {
290662306a36Sopenharmony_ci	.name = "ssp2",
290762306a36Sopenharmony_ci	.groups = ssp2_grps,
290862306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(ssp2_grps),
290962306a36Sopenharmony_ci};
291062306a36Sopenharmony_ci
291162306a36Sopenharmony_ci/* Pad multiplexing for cadence mii2 as mii device */
291262306a36Sopenharmony_cistatic const unsigned mii2_pins[] = { 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
291362306a36Sopenharmony_ci	90, 91, 92, 93, 94, 95, 96, 97 };
291462306a36Sopenharmony_cistatic struct spear_muxreg mii2_muxreg[] = {
291562306a36Sopenharmony_ci	{
291662306a36Sopenharmony_ci		.reg = IP_SEL_PAD_80_89_REG,
291762306a36Sopenharmony_ci		.mask = PMX_PL_80_TO_85_MASK | PMX_PL_86_87_MASK |
291862306a36Sopenharmony_ci			PMX_PL_88_89_MASK,
291962306a36Sopenharmony_ci		.val = PMX_MII2_PL_80_TO_85_VAL | PMX_MII2_PL_86_87_VAL |
292062306a36Sopenharmony_ci			PMX_MII2_PL_88_89_VAL,
292162306a36Sopenharmony_ci	}, {
292262306a36Sopenharmony_ci		.reg = IP_SEL_PAD_90_99_REG,
292362306a36Sopenharmony_ci		.mask = PMX_PL_90_91_MASK | PMX_PL_92_93_MASK |
292462306a36Sopenharmony_ci			PMX_PL_94_95_MASK | PMX_PL_96_97_MASK,
292562306a36Sopenharmony_ci		.val = PMX_MII2_PL_90_91_VAL | PMX_MII2_PL_92_93_VAL |
292662306a36Sopenharmony_ci			PMX_MII2_PL_94_95_VAL | PMX_MII2_PL_96_97_VAL,
292762306a36Sopenharmony_ci	}, {
292862306a36Sopenharmony_ci		.reg = EXT_CTRL_REG,
292962306a36Sopenharmony_ci		.mask = (MAC_MODE_MASK << MAC2_MODE_SHIFT) |
293062306a36Sopenharmony_ci			(MAC_MODE_MASK << MAC1_MODE_SHIFT) |
293162306a36Sopenharmony_ci			MII_MDIO_MASK,
293262306a36Sopenharmony_ci		.val = (MAC_MODE_MII << MAC2_MODE_SHIFT) |
293362306a36Sopenharmony_ci			(MAC_MODE_MII << MAC1_MODE_SHIFT) |
293462306a36Sopenharmony_ci			MII_MDIO_81_VAL,
293562306a36Sopenharmony_ci	},
293662306a36Sopenharmony_ci};
293762306a36Sopenharmony_ci
293862306a36Sopenharmony_cistatic struct spear_modemux mii2_modemux[] = {
293962306a36Sopenharmony_ci	{
294062306a36Sopenharmony_ci		.modes = EXTENDED_MODE,
294162306a36Sopenharmony_ci		.muxregs = mii2_muxreg,
294262306a36Sopenharmony_ci		.nmuxregs = ARRAY_SIZE(mii2_muxreg),
294362306a36Sopenharmony_ci	},
294462306a36Sopenharmony_ci};
294562306a36Sopenharmony_ci
294662306a36Sopenharmony_cistatic struct spear_pingroup mii2_pingroup = {
294762306a36Sopenharmony_ci	.name = "mii2_grp",
294862306a36Sopenharmony_ci	.pins = mii2_pins,
294962306a36Sopenharmony_ci	.npins = ARRAY_SIZE(mii2_pins),
295062306a36Sopenharmony_ci	.modemuxs = mii2_modemux,
295162306a36Sopenharmony_ci	.nmodemuxs = ARRAY_SIZE(mii2_modemux),
295262306a36Sopenharmony_ci};
295362306a36Sopenharmony_ci
295462306a36Sopenharmony_cistatic const char *const mii2_grps[] = { "mii2_grp" };
295562306a36Sopenharmony_cistatic struct spear_function mii2_function = {
295662306a36Sopenharmony_ci	.name = "mii2",
295762306a36Sopenharmony_ci	.groups = mii2_grps,
295862306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(mii2_grps),
295962306a36Sopenharmony_ci};
296062306a36Sopenharmony_ci
296162306a36Sopenharmony_ci/* Pad multiplexing for cadence mii 1_2 as smii or rmii device */
296262306a36Sopenharmony_cistatic const unsigned rmii0_1_pins[] = { 10, 11, 13, 14, 15, 16, 17, 18, 19, 20,
296362306a36Sopenharmony_ci	21, 22, 23, 24, 25, 26, 27 };
296462306a36Sopenharmony_cistatic const unsigned smii0_1_pins[] = { 10, 11, 21, 22, 23, 24, 25, 26, 27 };
296562306a36Sopenharmony_cistatic struct spear_muxreg mii0_1_muxreg[] = {
296662306a36Sopenharmony_ci	{
296762306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
296862306a36Sopenharmony_ci		.mask = PMX_MII_MASK,
296962306a36Sopenharmony_ci		.val = 0,
297062306a36Sopenharmony_ci	},
297162306a36Sopenharmony_ci};
297262306a36Sopenharmony_ci
297362306a36Sopenharmony_cistatic struct spear_muxreg smii0_1_ext_muxreg[] = {
297462306a36Sopenharmony_ci	{
297562306a36Sopenharmony_ci		.reg = IP_SEL_PAD_10_19_REG,
297662306a36Sopenharmony_ci		.mask = PMX_PL_10_11_MASK,
297762306a36Sopenharmony_ci		.val = PMX_SMII_PL_10_11_VAL,
297862306a36Sopenharmony_ci	}, {
297962306a36Sopenharmony_ci		.reg = IP_SEL_PAD_20_29_REG,
298062306a36Sopenharmony_ci		.mask = PMX_PL_21_TO_27_MASK,
298162306a36Sopenharmony_ci		.val = PMX_SMII_PL_21_TO_27_VAL,
298262306a36Sopenharmony_ci	}, {
298362306a36Sopenharmony_ci		.reg = EXT_CTRL_REG,
298462306a36Sopenharmony_ci		.mask = (MAC_MODE_MASK << MAC2_MODE_SHIFT) |
298562306a36Sopenharmony_ci			(MAC_MODE_MASK << MAC1_MODE_SHIFT) |
298662306a36Sopenharmony_ci			MII_MDIO_MASK,
298762306a36Sopenharmony_ci		.val = (MAC_MODE_SMII << MAC2_MODE_SHIFT)
298862306a36Sopenharmony_ci			| (MAC_MODE_SMII << MAC1_MODE_SHIFT)
298962306a36Sopenharmony_ci			| MII_MDIO_10_11_VAL,
299062306a36Sopenharmony_ci	},
299162306a36Sopenharmony_ci};
299262306a36Sopenharmony_ci
299362306a36Sopenharmony_cistatic struct spear_muxreg rmii0_1_ext_muxreg[] = {
299462306a36Sopenharmony_ci	{
299562306a36Sopenharmony_ci		.reg = IP_SEL_PAD_10_19_REG,
299662306a36Sopenharmony_ci		.mask = PMX_PL_10_11_MASK | PMX_PL_13_14_MASK |
299762306a36Sopenharmony_ci			PMX_PL_15_16_MASK | PMX_PL_17_18_MASK | PMX_PL_19_MASK,
299862306a36Sopenharmony_ci		.val = PMX_RMII_PL_10_11_VAL | PMX_RMII_PL_13_14_VAL |
299962306a36Sopenharmony_ci			PMX_RMII_PL_15_16_VAL | PMX_RMII_PL_17_18_VAL |
300062306a36Sopenharmony_ci			PMX_RMII_PL_19_VAL,
300162306a36Sopenharmony_ci	}, {
300262306a36Sopenharmony_ci		.reg = IP_SEL_PAD_20_29_REG,
300362306a36Sopenharmony_ci		.mask = PMX_PL_20_MASK | PMX_PL_21_TO_27_MASK,
300462306a36Sopenharmony_ci		.val = PMX_RMII_PL_20_VAL | PMX_RMII_PL_21_TO_27_VAL,
300562306a36Sopenharmony_ci	}, {
300662306a36Sopenharmony_ci		.reg = EXT_CTRL_REG,
300762306a36Sopenharmony_ci		.mask = (MAC_MODE_MASK << MAC2_MODE_SHIFT) |
300862306a36Sopenharmony_ci			(MAC_MODE_MASK << MAC1_MODE_SHIFT) |
300962306a36Sopenharmony_ci			MII_MDIO_MASK,
301062306a36Sopenharmony_ci		.val = (MAC_MODE_RMII << MAC2_MODE_SHIFT)
301162306a36Sopenharmony_ci			| (MAC_MODE_RMII << MAC1_MODE_SHIFT)
301262306a36Sopenharmony_ci			| MII_MDIO_10_11_VAL,
301362306a36Sopenharmony_ci	},
301462306a36Sopenharmony_ci};
301562306a36Sopenharmony_ci
301662306a36Sopenharmony_cistatic struct spear_modemux mii0_1_modemux[][2] = {
301762306a36Sopenharmony_ci	{
301862306a36Sopenharmony_ci		/* configure as smii */
301962306a36Sopenharmony_ci		{
302062306a36Sopenharmony_ci			.modes = AUTO_NET_SMII_MODE | AUTO_EXP_MODE |
302162306a36Sopenharmony_ci				SMALL_PRINTERS_MODE | EXTENDED_MODE,
302262306a36Sopenharmony_ci			.muxregs = mii0_1_muxreg,
302362306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(mii0_1_muxreg),
302462306a36Sopenharmony_ci		}, {
302562306a36Sopenharmony_ci			.modes = EXTENDED_MODE,
302662306a36Sopenharmony_ci			.muxregs = smii0_1_ext_muxreg,
302762306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(smii0_1_ext_muxreg),
302862306a36Sopenharmony_ci		},
302962306a36Sopenharmony_ci	}, {
303062306a36Sopenharmony_ci		/* configure as rmii */
303162306a36Sopenharmony_ci		{
303262306a36Sopenharmony_ci			.modes = AUTO_NET_SMII_MODE | AUTO_EXP_MODE |
303362306a36Sopenharmony_ci				SMALL_PRINTERS_MODE | EXTENDED_MODE,
303462306a36Sopenharmony_ci			.muxregs = mii0_1_muxreg,
303562306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(mii0_1_muxreg),
303662306a36Sopenharmony_ci		}, {
303762306a36Sopenharmony_ci			.modes = EXTENDED_MODE,
303862306a36Sopenharmony_ci			.muxregs = rmii0_1_ext_muxreg,
303962306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(rmii0_1_ext_muxreg),
304062306a36Sopenharmony_ci		},
304162306a36Sopenharmony_ci	},
304262306a36Sopenharmony_ci};
304362306a36Sopenharmony_ci
304462306a36Sopenharmony_cistatic struct spear_pingroup mii0_1_pingroup[] = {
304562306a36Sopenharmony_ci	{
304662306a36Sopenharmony_ci		.name = "smii0_1_grp",
304762306a36Sopenharmony_ci		.pins = smii0_1_pins,
304862306a36Sopenharmony_ci		.npins = ARRAY_SIZE(smii0_1_pins),
304962306a36Sopenharmony_ci		.modemuxs = mii0_1_modemux[0],
305062306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(mii0_1_modemux[0]),
305162306a36Sopenharmony_ci	}, {
305262306a36Sopenharmony_ci		.name = "rmii0_1_grp",
305362306a36Sopenharmony_ci		.pins = rmii0_1_pins,
305462306a36Sopenharmony_ci		.npins = ARRAY_SIZE(rmii0_1_pins),
305562306a36Sopenharmony_ci		.modemuxs = mii0_1_modemux[1],
305662306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(mii0_1_modemux[1]),
305762306a36Sopenharmony_ci	},
305862306a36Sopenharmony_ci};
305962306a36Sopenharmony_ci
306062306a36Sopenharmony_cistatic const char *const mii0_1_grps[] = { "smii0_1_grp", "rmii0_1_grp" };
306162306a36Sopenharmony_cistatic struct spear_function mii0_1_function = {
306262306a36Sopenharmony_ci	.name = "mii0_1",
306362306a36Sopenharmony_ci	.groups = mii0_1_grps,
306462306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(mii0_1_grps),
306562306a36Sopenharmony_ci};
306662306a36Sopenharmony_ci
306762306a36Sopenharmony_ci/* Pad multiplexing for i2c1 device */
306862306a36Sopenharmony_cistatic const unsigned i2c1_pins[][2] = { { 8, 9 }, { 98, 99 } };
306962306a36Sopenharmony_cistatic struct spear_muxreg i2c1_ext_8_9_muxreg[] = {
307062306a36Sopenharmony_ci	{
307162306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
307262306a36Sopenharmony_ci		.mask = PMX_SSP_CS_MASK,
307362306a36Sopenharmony_ci		.val = 0,
307462306a36Sopenharmony_ci	}, {
307562306a36Sopenharmony_ci		.reg = IP_SEL_PAD_0_9_REG,
307662306a36Sopenharmony_ci		.mask = PMX_PL_8_9_MASK,
307762306a36Sopenharmony_ci		.val = PMX_I2C1_PL_8_9_VAL,
307862306a36Sopenharmony_ci	}, {
307962306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
308062306a36Sopenharmony_ci		.mask = PMX_I2C1_PORT_SEL_MASK,
308162306a36Sopenharmony_ci		.val = PMX_I2C1_PORT_8_9_VAL,
308262306a36Sopenharmony_ci	},
308362306a36Sopenharmony_ci};
308462306a36Sopenharmony_ci
308562306a36Sopenharmony_cistatic struct spear_muxreg i2c1_ext_98_99_muxreg[] = {
308662306a36Sopenharmony_ci	{
308762306a36Sopenharmony_ci		.reg = IP_SEL_PAD_90_99_REG,
308862306a36Sopenharmony_ci		.mask = PMX_PL_98_MASK | PMX_PL_99_MASK,
308962306a36Sopenharmony_ci		.val = PMX_I2C1_PL_98_VAL | PMX_I2C1_PL_99_VAL,
309062306a36Sopenharmony_ci	}, {
309162306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
309262306a36Sopenharmony_ci		.mask = PMX_I2C1_PORT_SEL_MASK,
309362306a36Sopenharmony_ci		.val = PMX_I2C1_PORT_98_99_VAL,
309462306a36Sopenharmony_ci	},
309562306a36Sopenharmony_ci};
309662306a36Sopenharmony_ci
309762306a36Sopenharmony_cistatic struct spear_modemux i2c1_modemux[][1] = {
309862306a36Sopenharmony_ci	{
309962306a36Sopenharmony_ci		/* Select signals on pins 8-9 */
310062306a36Sopenharmony_ci		{
310162306a36Sopenharmony_ci			.modes = EXTENDED_MODE,
310262306a36Sopenharmony_ci			.muxregs = i2c1_ext_8_9_muxreg,
310362306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(i2c1_ext_8_9_muxreg),
310462306a36Sopenharmony_ci		},
310562306a36Sopenharmony_ci	}, {
310662306a36Sopenharmony_ci		/* Select signals on pins 98-99 */
310762306a36Sopenharmony_ci		{
310862306a36Sopenharmony_ci			.modes = EXTENDED_MODE,
310962306a36Sopenharmony_ci			.muxregs = i2c1_ext_98_99_muxreg,
311062306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(i2c1_ext_98_99_muxreg),
311162306a36Sopenharmony_ci		},
311262306a36Sopenharmony_ci	},
311362306a36Sopenharmony_ci};
311462306a36Sopenharmony_ci
311562306a36Sopenharmony_cistatic struct spear_pingroup i2c1_pingroup[] = {
311662306a36Sopenharmony_ci	{
311762306a36Sopenharmony_ci		.name = "i2c1_8_9_grp",
311862306a36Sopenharmony_ci		.pins = i2c1_pins[0],
311962306a36Sopenharmony_ci		.npins = ARRAY_SIZE(i2c1_pins[0]),
312062306a36Sopenharmony_ci		.modemuxs = i2c1_modemux[0],
312162306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(i2c1_modemux[0]),
312262306a36Sopenharmony_ci	}, {
312362306a36Sopenharmony_ci		.name = "i2c1_98_99_grp",
312462306a36Sopenharmony_ci		.pins = i2c1_pins[1],
312562306a36Sopenharmony_ci		.npins = ARRAY_SIZE(i2c1_pins[1]),
312662306a36Sopenharmony_ci		.modemuxs = i2c1_modemux[1],
312762306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(i2c1_modemux[1]),
312862306a36Sopenharmony_ci	},
312962306a36Sopenharmony_ci};
313062306a36Sopenharmony_ci
313162306a36Sopenharmony_cistatic const char *const i2c1_grps[] = { "i2c1_8_9_grp", "i2c1_98_99_grp" };
313262306a36Sopenharmony_cistatic struct spear_function i2c1_function = {
313362306a36Sopenharmony_ci	.name = "i2c1",
313462306a36Sopenharmony_ci	.groups = i2c1_grps,
313562306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(i2c1_grps),
313662306a36Sopenharmony_ci};
313762306a36Sopenharmony_ci
313862306a36Sopenharmony_ci/* Pad multiplexing for i2c2 device */
313962306a36Sopenharmony_cistatic const unsigned i2c2_pins[][2] = { { 0, 1 }, { 2, 3 }, { 19, 20 },
314062306a36Sopenharmony_ci	{ 75, 76 }, { 96, 97 } };
314162306a36Sopenharmony_cistatic struct spear_muxreg i2c2_ext_0_1_muxreg[] = {
314262306a36Sopenharmony_ci	{
314362306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
314462306a36Sopenharmony_ci		.mask = PMX_FIRDA_MASK,
314562306a36Sopenharmony_ci		.val = 0,
314662306a36Sopenharmony_ci	}, {
314762306a36Sopenharmony_ci		.reg = IP_SEL_PAD_0_9_REG,
314862306a36Sopenharmony_ci		.mask = PMX_PL_0_1_MASK,
314962306a36Sopenharmony_ci		.val = PMX_I2C2_PL_0_1_VAL,
315062306a36Sopenharmony_ci	}, {
315162306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
315262306a36Sopenharmony_ci		.mask = PMX_I2C2_PORT_SEL_MASK,
315362306a36Sopenharmony_ci		.val = PMX_I2C2_PORT_0_1_VAL,
315462306a36Sopenharmony_ci	},
315562306a36Sopenharmony_ci};
315662306a36Sopenharmony_ci
315762306a36Sopenharmony_cistatic struct spear_muxreg i2c2_ext_2_3_muxreg[] = {
315862306a36Sopenharmony_ci	{
315962306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
316062306a36Sopenharmony_ci		.mask = PMX_UART0_MASK,
316162306a36Sopenharmony_ci		.val = 0,
316262306a36Sopenharmony_ci	}, {
316362306a36Sopenharmony_ci		.reg = IP_SEL_PAD_0_9_REG,
316462306a36Sopenharmony_ci		.mask = PMX_PL_2_3_MASK,
316562306a36Sopenharmony_ci		.val = PMX_I2C2_PL_2_3_VAL,
316662306a36Sopenharmony_ci	}, {
316762306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
316862306a36Sopenharmony_ci		.mask = PMX_I2C2_PORT_SEL_MASK,
316962306a36Sopenharmony_ci		.val = PMX_I2C2_PORT_2_3_VAL,
317062306a36Sopenharmony_ci	},
317162306a36Sopenharmony_ci};
317262306a36Sopenharmony_ci
317362306a36Sopenharmony_cistatic struct spear_muxreg i2c2_ext_19_20_muxreg[] = {
317462306a36Sopenharmony_ci	{
317562306a36Sopenharmony_ci		.reg = PMX_CONFIG_REG,
317662306a36Sopenharmony_ci		.mask = PMX_MII_MASK,
317762306a36Sopenharmony_ci		.val = 0,
317862306a36Sopenharmony_ci	}, {
317962306a36Sopenharmony_ci		.reg = IP_SEL_PAD_10_19_REG,
318062306a36Sopenharmony_ci		.mask = PMX_PL_19_MASK,
318162306a36Sopenharmony_ci		.val = PMX_I2C2_PL_19_VAL,
318262306a36Sopenharmony_ci	}, {
318362306a36Sopenharmony_ci		.reg = IP_SEL_PAD_20_29_REG,
318462306a36Sopenharmony_ci		.mask = PMX_PL_20_MASK,
318562306a36Sopenharmony_ci		.val = PMX_I2C2_PL_20_VAL,
318662306a36Sopenharmony_ci	}, {
318762306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
318862306a36Sopenharmony_ci		.mask = PMX_I2C2_PORT_SEL_MASK,
318962306a36Sopenharmony_ci		.val = PMX_I2C2_PORT_19_20_VAL,
319062306a36Sopenharmony_ci	},
319162306a36Sopenharmony_ci};
319262306a36Sopenharmony_ci
319362306a36Sopenharmony_cistatic struct spear_muxreg i2c2_ext_75_76_muxreg[] = {
319462306a36Sopenharmony_ci	{
319562306a36Sopenharmony_ci		.reg = IP_SEL_PAD_70_79_REG,
319662306a36Sopenharmony_ci		.mask = PMX_PL_75_76_MASK,
319762306a36Sopenharmony_ci		.val = PMX_I2C2_PL_75_76_VAL,
319862306a36Sopenharmony_ci	}, {
319962306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
320062306a36Sopenharmony_ci		.mask = PMX_I2C2_PORT_SEL_MASK,
320162306a36Sopenharmony_ci		.val = PMX_I2C2_PORT_75_76_VAL,
320262306a36Sopenharmony_ci	},
320362306a36Sopenharmony_ci};
320462306a36Sopenharmony_ci
320562306a36Sopenharmony_cistatic struct spear_muxreg i2c2_ext_96_97_muxreg[] = {
320662306a36Sopenharmony_ci	{
320762306a36Sopenharmony_ci		.reg = IP_SEL_PAD_90_99_REG,
320862306a36Sopenharmony_ci		.mask = PMX_PL_96_97_MASK,
320962306a36Sopenharmony_ci		.val = PMX_I2C2_PL_96_97_VAL,
321062306a36Sopenharmony_ci	}, {
321162306a36Sopenharmony_ci		.reg = IP_SEL_MIX_PAD_REG,
321262306a36Sopenharmony_ci		.mask = PMX_I2C2_PORT_SEL_MASK,
321362306a36Sopenharmony_ci		.val = PMX_I2C2_PORT_96_97_VAL,
321462306a36Sopenharmony_ci	},
321562306a36Sopenharmony_ci};
321662306a36Sopenharmony_ci
321762306a36Sopenharmony_cistatic struct spear_modemux i2c2_modemux[][1] = {
321862306a36Sopenharmony_ci	{
321962306a36Sopenharmony_ci		/* Select signals on pins 0_1 */
322062306a36Sopenharmony_ci		{
322162306a36Sopenharmony_ci			.modes = EXTENDED_MODE,
322262306a36Sopenharmony_ci			.muxregs = i2c2_ext_0_1_muxreg,
322362306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(i2c2_ext_0_1_muxreg),
322462306a36Sopenharmony_ci		},
322562306a36Sopenharmony_ci	}, {
322662306a36Sopenharmony_ci		/* Select signals on pins 2_3 */
322762306a36Sopenharmony_ci		{
322862306a36Sopenharmony_ci			.modes = EXTENDED_MODE,
322962306a36Sopenharmony_ci			.muxregs = i2c2_ext_2_3_muxreg,
323062306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(i2c2_ext_2_3_muxreg),
323162306a36Sopenharmony_ci		},
323262306a36Sopenharmony_ci	}, {
323362306a36Sopenharmony_ci		/* Select signals on pins 19_20 */
323462306a36Sopenharmony_ci		{
323562306a36Sopenharmony_ci			.modes = EXTENDED_MODE,
323662306a36Sopenharmony_ci			.muxregs = i2c2_ext_19_20_muxreg,
323762306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(i2c2_ext_19_20_muxreg),
323862306a36Sopenharmony_ci		},
323962306a36Sopenharmony_ci	}, {
324062306a36Sopenharmony_ci		/* Select signals on pins 75_76 */
324162306a36Sopenharmony_ci		{
324262306a36Sopenharmony_ci			.modes = EXTENDED_MODE,
324362306a36Sopenharmony_ci			.muxregs = i2c2_ext_75_76_muxreg,
324462306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(i2c2_ext_75_76_muxreg),
324562306a36Sopenharmony_ci		},
324662306a36Sopenharmony_ci	}, {
324762306a36Sopenharmony_ci		/* Select signals on pins 96_97 */
324862306a36Sopenharmony_ci		{
324962306a36Sopenharmony_ci			.modes = EXTENDED_MODE,
325062306a36Sopenharmony_ci			.muxregs = i2c2_ext_96_97_muxreg,
325162306a36Sopenharmony_ci			.nmuxregs = ARRAY_SIZE(i2c2_ext_96_97_muxreg),
325262306a36Sopenharmony_ci		},
325362306a36Sopenharmony_ci	},
325462306a36Sopenharmony_ci};
325562306a36Sopenharmony_ci
325662306a36Sopenharmony_cistatic struct spear_pingroup i2c2_pingroup[] = {
325762306a36Sopenharmony_ci	{
325862306a36Sopenharmony_ci		.name = "i2c2_0_1_grp",
325962306a36Sopenharmony_ci		.pins = i2c2_pins[0],
326062306a36Sopenharmony_ci		.npins = ARRAY_SIZE(i2c2_pins[0]),
326162306a36Sopenharmony_ci		.modemuxs = i2c2_modemux[0],
326262306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(i2c2_modemux[0]),
326362306a36Sopenharmony_ci	}, {
326462306a36Sopenharmony_ci		.name = "i2c2_2_3_grp",
326562306a36Sopenharmony_ci		.pins = i2c2_pins[1],
326662306a36Sopenharmony_ci		.npins = ARRAY_SIZE(i2c2_pins[1]),
326762306a36Sopenharmony_ci		.modemuxs = i2c2_modemux[1],
326862306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(i2c2_modemux[1]),
326962306a36Sopenharmony_ci	}, {
327062306a36Sopenharmony_ci		.name = "i2c2_19_20_grp",
327162306a36Sopenharmony_ci		.pins = i2c2_pins[2],
327262306a36Sopenharmony_ci		.npins = ARRAY_SIZE(i2c2_pins[2]),
327362306a36Sopenharmony_ci		.modemuxs = i2c2_modemux[2],
327462306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(i2c2_modemux[2]),
327562306a36Sopenharmony_ci	}, {
327662306a36Sopenharmony_ci		.name = "i2c2_75_76_grp",
327762306a36Sopenharmony_ci		.pins = i2c2_pins[3],
327862306a36Sopenharmony_ci		.npins = ARRAY_SIZE(i2c2_pins[3]),
327962306a36Sopenharmony_ci		.modemuxs = i2c2_modemux[3],
328062306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(i2c2_modemux[3]),
328162306a36Sopenharmony_ci	}, {
328262306a36Sopenharmony_ci		.name = "i2c2_96_97_grp",
328362306a36Sopenharmony_ci		.pins = i2c2_pins[4],
328462306a36Sopenharmony_ci		.npins = ARRAY_SIZE(i2c2_pins[4]),
328562306a36Sopenharmony_ci		.modemuxs = i2c2_modemux[4],
328662306a36Sopenharmony_ci		.nmodemuxs = ARRAY_SIZE(i2c2_modemux[4]),
328762306a36Sopenharmony_ci	},
328862306a36Sopenharmony_ci};
328962306a36Sopenharmony_ci
329062306a36Sopenharmony_cistatic const char *const i2c2_grps[] = { "i2c2_0_1_grp", "i2c2_2_3_grp",
329162306a36Sopenharmony_ci	"i2c2_19_20_grp", "i2c2_75_76_grp", "i2c2_96_97_grp" };
329262306a36Sopenharmony_cistatic struct spear_function i2c2_function = {
329362306a36Sopenharmony_ci	.name = "i2c2",
329462306a36Sopenharmony_ci	.groups = i2c2_grps,
329562306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(i2c2_grps),
329662306a36Sopenharmony_ci};
329762306a36Sopenharmony_ci
329862306a36Sopenharmony_ci/* pingroups */
329962306a36Sopenharmony_cistatic struct spear_pingroup *spear320_pingroups[] = {
330062306a36Sopenharmony_ci	SPEAR3XX_COMMON_PINGROUPS,
330162306a36Sopenharmony_ci	&clcd_pingroup,
330262306a36Sopenharmony_ci	&emi_pingroup,
330362306a36Sopenharmony_ci	&fsmc_8bit_pingroup,
330462306a36Sopenharmony_ci	&fsmc_16bit_pingroup,
330562306a36Sopenharmony_ci	&spp_pingroup,
330662306a36Sopenharmony_ci	&sdhci_led_pingroup,
330762306a36Sopenharmony_ci	&sdhci_pingroup[0],
330862306a36Sopenharmony_ci	&sdhci_pingroup[1],
330962306a36Sopenharmony_ci	&i2s_pingroup,
331062306a36Sopenharmony_ci	&uart1_pingroup,
331162306a36Sopenharmony_ci	&uart1_modem_pingroup[0],
331262306a36Sopenharmony_ci	&uart1_modem_pingroup[1],
331362306a36Sopenharmony_ci	&uart1_modem_pingroup[2],
331462306a36Sopenharmony_ci	&uart1_modem_pingroup[3],
331562306a36Sopenharmony_ci	&uart2_pingroup,
331662306a36Sopenharmony_ci	&uart3_pingroup[0],
331762306a36Sopenharmony_ci	&uart3_pingroup[1],
331862306a36Sopenharmony_ci	&uart3_pingroup[2],
331962306a36Sopenharmony_ci	&uart3_pingroup[3],
332062306a36Sopenharmony_ci	&uart3_pingroup[4],
332162306a36Sopenharmony_ci	&uart3_pingroup[5],
332262306a36Sopenharmony_ci	&uart3_pingroup[6],
332362306a36Sopenharmony_ci	&uart4_pingroup[0],
332462306a36Sopenharmony_ci	&uart4_pingroup[1],
332562306a36Sopenharmony_ci	&uart4_pingroup[2],
332662306a36Sopenharmony_ci	&uart4_pingroup[3],
332762306a36Sopenharmony_ci	&uart4_pingroup[4],
332862306a36Sopenharmony_ci	&uart4_pingroup[5],
332962306a36Sopenharmony_ci	&uart5_pingroup[0],
333062306a36Sopenharmony_ci	&uart5_pingroup[1],
333162306a36Sopenharmony_ci	&uart5_pingroup[2],
333262306a36Sopenharmony_ci	&uart5_pingroup[3],
333362306a36Sopenharmony_ci	&uart6_pingroup[0],
333462306a36Sopenharmony_ci	&uart6_pingroup[1],
333562306a36Sopenharmony_ci	&rs485_pingroup,
333662306a36Sopenharmony_ci	&touchscreen_pingroup,
333762306a36Sopenharmony_ci	&can0_pingroup,
333862306a36Sopenharmony_ci	&can1_pingroup,
333962306a36Sopenharmony_ci	&pwm0_1_pingroup[0],
334062306a36Sopenharmony_ci	&pwm0_1_pingroup[1],
334162306a36Sopenharmony_ci	&pwm0_1_pingroup[2],
334262306a36Sopenharmony_ci	&pwm0_1_pingroup[3],
334362306a36Sopenharmony_ci	&pwm0_1_pingroup[4],
334462306a36Sopenharmony_ci	&pwm0_1_pingroup[5],
334562306a36Sopenharmony_ci	&pwm0_1_pingroup[6],
334662306a36Sopenharmony_ci	&pwm2_pingroup[0],
334762306a36Sopenharmony_ci	&pwm2_pingroup[1],
334862306a36Sopenharmony_ci	&pwm2_pingroup[2],
334962306a36Sopenharmony_ci	&pwm2_pingroup[3],
335062306a36Sopenharmony_ci	&pwm2_pingroup[4],
335162306a36Sopenharmony_ci	&pwm2_pingroup[5],
335262306a36Sopenharmony_ci	&pwm2_pingroup[6],
335362306a36Sopenharmony_ci	&pwm3_pingroup[0],
335462306a36Sopenharmony_ci	&pwm3_pingroup[1],
335562306a36Sopenharmony_ci	&pwm3_pingroup[2],
335662306a36Sopenharmony_ci	&pwm3_pingroup[3],
335762306a36Sopenharmony_ci	&pwm3_pingroup[4],
335862306a36Sopenharmony_ci	&pwm3_pingroup[5],
335962306a36Sopenharmony_ci	&ssp1_pingroup[0],
336062306a36Sopenharmony_ci	&ssp1_pingroup[1],
336162306a36Sopenharmony_ci	&ssp1_pingroup[2],
336262306a36Sopenharmony_ci	&ssp1_pingroup[3],
336362306a36Sopenharmony_ci	&ssp1_pingroup[4],
336462306a36Sopenharmony_ci	&ssp2_pingroup[0],
336562306a36Sopenharmony_ci	&ssp2_pingroup[1],
336662306a36Sopenharmony_ci	&ssp2_pingroup[2],
336762306a36Sopenharmony_ci	&ssp2_pingroup[3],
336862306a36Sopenharmony_ci	&ssp2_pingroup[4],
336962306a36Sopenharmony_ci	&mii2_pingroup,
337062306a36Sopenharmony_ci	&mii0_1_pingroup[0],
337162306a36Sopenharmony_ci	&mii0_1_pingroup[1],
337262306a36Sopenharmony_ci	&i2c1_pingroup[0],
337362306a36Sopenharmony_ci	&i2c1_pingroup[1],
337462306a36Sopenharmony_ci	&i2c2_pingroup[0],
337562306a36Sopenharmony_ci	&i2c2_pingroup[1],
337662306a36Sopenharmony_ci	&i2c2_pingroup[2],
337762306a36Sopenharmony_ci	&i2c2_pingroup[3],
337862306a36Sopenharmony_ci	&i2c2_pingroup[4],
337962306a36Sopenharmony_ci};
338062306a36Sopenharmony_ci
338162306a36Sopenharmony_ci/* functions */
338262306a36Sopenharmony_cistatic struct spear_function *spear320_functions[] = {
338362306a36Sopenharmony_ci	SPEAR3XX_COMMON_FUNCTIONS,
338462306a36Sopenharmony_ci	&clcd_function,
338562306a36Sopenharmony_ci	&emi_function,
338662306a36Sopenharmony_ci	&fsmc_function,
338762306a36Sopenharmony_ci	&spp_function,
338862306a36Sopenharmony_ci	&sdhci_function,
338962306a36Sopenharmony_ci	&i2s_function,
339062306a36Sopenharmony_ci	&uart1_function,
339162306a36Sopenharmony_ci	&uart1_modem_function,
339262306a36Sopenharmony_ci	&uart2_function,
339362306a36Sopenharmony_ci	&uart3_function,
339462306a36Sopenharmony_ci	&uart4_function,
339562306a36Sopenharmony_ci	&uart5_function,
339662306a36Sopenharmony_ci	&uart6_function,
339762306a36Sopenharmony_ci	&rs485_function,
339862306a36Sopenharmony_ci	&touchscreen_function,
339962306a36Sopenharmony_ci	&can0_function,
340062306a36Sopenharmony_ci	&can1_function,
340162306a36Sopenharmony_ci	&pwm0_1_function,
340262306a36Sopenharmony_ci	&pwm2_function,
340362306a36Sopenharmony_ci	&pwm3_function,
340462306a36Sopenharmony_ci	&ssp1_function,
340562306a36Sopenharmony_ci	&ssp2_function,
340662306a36Sopenharmony_ci	&mii2_function,
340762306a36Sopenharmony_ci	&mii0_1_function,
340862306a36Sopenharmony_ci	&i2c1_function,
340962306a36Sopenharmony_ci	&i2c2_function,
341062306a36Sopenharmony_ci};
341162306a36Sopenharmony_ci
341262306a36Sopenharmony_cistatic const struct of_device_id spear320_pinctrl_of_match[] = {
341362306a36Sopenharmony_ci	{
341462306a36Sopenharmony_ci		.compatible = "st,spear320-pinmux",
341562306a36Sopenharmony_ci	},
341662306a36Sopenharmony_ci	{},
341762306a36Sopenharmony_ci};
341862306a36Sopenharmony_ci
341962306a36Sopenharmony_cistatic int spear320_pinctrl_probe(struct platform_device *pdev)
342062306a36Sopenharmony_ci{
342162306a36Sopenharmony_ci	spear3xx_machdata.groups = spear320_pingroups;
342262306a36Sopenharmony_ci	spear3xx_machdata.ngroups = ARRAY_SIZE(spear320_pingroups);
342362306a36Sopenharmony_ci	spear3xx_machdata.functions = spear320_functions;
342462306a36Sopenharmony_ci	spear3xx_machdata.nfunctions = ARRAY_SIZE(spear320_functions);
342562306a36Sopenharmony_ci
342662306a36Sopenharmony_ci	spear3xx_machdata.modes_supported = true;
342762306a36Sopenharmony_ci	spear3xx_machdata.pmx_modes = spear320_pmx_modes;
342862306a36Sopenharmony_ci	spear3xx_machdata.npmx_modes = ARRAY_SIZE(spear320_pmx_modes);
342962306a36Sopenharmony_ci
343062306a36Sopenharmony_ci	pmx_init_addr(&spear3xx_machdata, PMX_CONFIG_REG);
343162306a36Sopenharmony_ci	pmx_init_gpio_pingroup_addr(spear3xx_machdata.gpio_pingroups,
343262306a36Sopenharmony_ci			spear3xx_machdata.ngpio_pingroups, PMX_CONFIG_REG);
343362306a36Sopenharmony_ci
343462306a36Sopenharmony_ci	return spear_pinctrl_probe(pdev, &spear3xx_machdata);
343562306a36Sopenharmony_ci}
343662306a36Sopenharmony_ci
343762306a36Sopenharmony_cistatic struct platform_driver spear320_pinctrl_driver = {
343862306a36Sopenharmony_ci	.driver = {
343962306a36Sopenharmony_ci		.name = DRIVER_NAME,
344062306a36Sopenharmony_ci		.of_match_table = spear320_pinctrl_of_match,
344162306a36Sopenharmony_ci	},
344262306a36Sopenharmony_ci	.probe = spear320_pinctrl_probe,
344362306a36Sopenharmony_ci};
344462306a36Sopenharmony_ci
344562306a36Sopenharmony_cistatic int __init spear320_pinctrl_init(void)
344662306a36Sopenharmony_ci{
344762306a36Sopenharmony_ci	return platform_driver_register(&spear320_pinctrl_driver);
344862306a36Sopenharmony_ci}
344962306a36Sopenharmony_ciarch_initcall(spear320_pinctrl_init);
3450