pinctrl: sunxi: Add support for the D1

Signed-off-by: Samuel Holland <samuel@sholland.org>
This commit is contained in:
Samuel Holland 2021-08-28 22:24:28 -05:00
parent 60dd27bcc8
commit aa27bb201b
2 changed files with 37 additions and 1 deletions

View File

@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
if ARCH_SUNXI if ARCH_SUNXI || TARGET_SUNXI
config PINCTRL_SUNXI config PINCTRL_SUNXI
select PINCTRL_FULL select PINCTRL_FULL
@ -89,6 +89,11 @@ config PINCTRL_SUN9I_A80_R
default MACH_SUN9I default MACH_SUN9I
select PINCTRL_SUNXI select PINCTRL_SUNXI
config PINCTRL_SUN20I_D1
bool "Support for the Allwinner D1 PIO"
default MACH_SUN20I
select PINCTRL_SUNXI
config PINCTRL_SUN50I_A64 config PINCTRL_SUN50I_A64
bool "Support for the Allwinner A64 PIO" bool "Support for the Allwinner A64 PIO"
default MACH_SUN50I default MACH_SUN50I

View File

@ -592,6 +592,31 @@ static const struct sunxi_pinctrl_desc __maybe_unused sun9i_a80_r_pinctrl_desc =
.num_banks = 3, .num_banks = 3,
}; };
static const struct sunxi_pinctrl_function sun20i_d1_pinctrl_functions[] = {
{ "emac", 8 }, /* PE0-PE15 */
{ "gpio_in", 0 },
{ "gpio_out", 1 },
{ "i2c0", 4 }, /* PB10-PB11 */
{ "mmc0", 2 }, /* PF0-PF5 */
{ "mmc1", 2 }, /* PG0-PG5 */
{ "mmc2", 3 }, /* PC2-PC7 */
{ "spi0", 2 }, /* PC2-PC7 */
#if IS_ENABLED(CONFIG_UART0_PORT_F)
{ "uart0", 3 }, /* PF2-PF4 */
#else
{ "uart0", 6 }, /* PB8-PB9 */
#endif
{ "uart1", 2 }, /* PG6-PG7 */
{ "uart2", 7 }, /* PB0-PB1 */
};
static const struct sunxi_pinctrl_desc __maybe_unused sun20i_d1_pinctrl_desc = {
.functions = sun20i_d1_pinctrl_functions,
.num_functions = ARRAY_SIZE(sun20i_d1_pinctrl_functions),
.first_bank = SUNXI_GPIO_A,
.num_banks = 7,
};
static const struct sunxi_pinctrl_function sun50i_a64_pinctrl_functions[] = { static const struct sunxi_pinctrl_function sun50i_a64_pinctrl_functions[] = {
{ "emac", 4 }, /* PD8-PD23 */ { "emac", 4 }, /* PD8-PD23 */
{ "gpio_in", 0 }, { "gpio_in", 0 },
@ -854,6 +879,12 @@ static const struct udevice_id sunxi_pinctrl_ids[] = {
.data = (ulong)&sun9i_a80_r_pinctrl_desc, .data = (ulong)&sun9i_a80_r_pinctrl_desc,
}, },
#endif #endif
#ifdef CONFIG_PINCTRL_SUN20I_D1
{
.compatible = "allwinner,sun20i-d1-pinctrl",
.data = (ulong)&sun20i_d1_pinctrl_desc,
},
#endif
#ifdef CONFIG_PINCTRL_SUN50I_A64 #ifdef CONFIG_PINCTRL_SUN50I_A64
{ {
.compatible = "allwinner,sun50i-a64-pinctrl", .compatible = "allwinner,sun50i-a64-pinctrl",