mirror of
https://github.com/smaeul/u-boot.git
synced 2025-09-15 06:26:07 +01:00
Pin lists and mux values were taken from the Linux drivers. Signed-off-by: Samuel Holland <samuel@sholland.org>
54 lines
1.3 KiB
C
54 lines
1.3 KiB
C
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#include <dm.h>
|
|
#include <dm/pinctrl.h>
|
|
#include <asm/gpio.h>
|
|
|
|
#include "pinctrl-sunxi.h"
|
|
|
|
static const struct sunxi_pinctrl_function sun5i_a13_pinctrl_functions[] = {
|
|
{ "emac", 2 }, /* PA0-PA17 */
|
|
{ "gpio_in", 0 },
|
|
{ "gpio_out", 1 },
|
|
{ "i2c0", 2 }, /* PB0-PB1 */
|
|
{ "i2c1", 2 }, /* PB15-PB16 */
|
|
{ "mmc0", 2 }, /* PF0-PF5 */
|
|
{ "mmc1", 2 }, /* PG3-PG8 */
|
|
{ "mmc2", 3 }, /* PC6-PC15 */
|
|
{ "spi0", 3 }, /* PC0-PC3 */
|
|
#if IS_ENABLED(CONFIG_UART0_PORT_F)
|
|
{ "uart0", 4 }, /* PF2-PF4 */
|
|
#else
|
|
{ "uart0", 2 }, /* PB19-PB20 */
|
|
#endif
|
|
{ "uart1", 4 }, /* PG3-PG4 */
|
|
};
|
|
|
|
static const struct sunxi_pinctrl_desc sun5i_a13_pinctrl_desc = {
|
|
.functions = sun5i_a13_pinctrl_functions,
|
|
.num_functions = ARRAY_SIZE(sun5i_a13_pinctrl_functions),
|
|
.first_bank = SUNXI_GPIO_A,
|
|
.num_banks = 7,
|
|
};
|
|
|
|
static const struct udevice_id sun5i_a13_pinctrl_ids[] = {
|
|
{
|
|
.compatible = "allwinner,sun5i-a10s-pinctrl",
|
|
.data = (ulong)&sun5i_a13_pinctrl_desc,
|
|
},
|
|
{
|
|
.compatible = "allwinner,sun5i-a13-pinctrl",
|
|
.data = (ulong)&sun5i_a13_pinctrl_desc,
|
|
},
|
|
{}
|
|
};
|
|
|
|
U_BOOT_DRIVER(sun5i_a13_pinctrl) = {
|
|
.name = "sun5i-a13-pinctrl",
|
|
.id = UCLASS_PINCTRL,
|
|
.of_match = sun5i_a13_pinctrl_ids,
|
|
.bind = sunxi_pinctrl_bind,
|
|
.plat_auto = sizeof(struct sunxi_pinctrl_plat),
|
|
.ops = &sunxi_pinctrl_ops,
|
|
};
|