Module Name:    src
Committed By:   jmcneill
Date:           Thu Jul  6 22:10:14 UTC 2017

Modified Files:
        src/sys/arch/arm/sunxi: sunxi_ccu.h sunxi_ccu_nkmp.c sunxi_gpio.c
            sunxi_gpio.h sunxi_platform.c
        src/sys/arch/evbarm/conf: SUNXI
Added Files:
        src/sys/arch/arm/sunxi: sun8i_a83t_ccu.c sun8i_a83t_ccu.h
            sun8i_a83t_gpio.c

Log Message:
Add support for Allwinner A83T SoC.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/sunxi/sun8i_a83t_ccu.c \
    src/sys/arch/arm/sunxi/sun8i_a83t_ccu.h \
    src/sys/arch/arm/sunxi/sun8i_a83t_gpio.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/sunxi/sunxi_ccu.h \
    src/sys/arch/arm/sunxi/sunxi_gpio.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/sunxi/sunxi_ccu_nkmp.c \
    src/sys/arch/arm/sunxi/sunxi_platform.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/sunxi/sunxi_gpio.h
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/evbarm/conf/SUNXI

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/sunxi/sunxi_ccu.h
diff -u src/sys/arch/arm/sunxi/sunxi_ccu.h:1.5 src/sys/arch/arm/sunxi/sunxi_ccu.h:1.6
--- src/sys/arch/arm/sunxi/sunxi_ccu.h:1.5	Sun Jul  2 00:14:09 2017
+++ src/sys/arch/arm/sunxi/sunxi_ccu.h	Thu Jul  6 22:10:14 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_ccu.h,v 1.5 2017/07/02 00:14:09 jmcneill Exp $ */
+/* $NetBSD: sunxi_ccu.h,v 1.6 2017/07/06 22:10:14 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill <[email protected]>
@@ -96,6 +96,7 @@ struct sunxi_ccu_nkmp {
 	uint32_t	enable;
 	uint32_t	flags;
 #define	SUNXI_CCU_NKMP_DIVIDE_BY_TWO	__BIT(0)
+#define	SUNXI_CCU_NKMP_FACTOR_N_EXACT	__BIT(1)
 };
 
 int	sunxi_ccu_nkmp_enable(struct sunxi_ccu_softc *,
Index: src/sys/arch/arm/sunxi/sunxi_gpio.c
diff -u src/sys/arch/arm/sunxi/sunxi_gpio.c:1.5 src/sys/arch/arm/sunxi/sunxi_gpio.c:1.6
--- src/sys/arch/arm/sunxi/sunxi_gpio.c:1.5	Thu Jul  6 10:44:19 2017
+++ src/sys/arch/arm/sunxi/sunxi_gpio.c	Thu Jul  6 22:10:14 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_gpio.c,v 1.5 2017/07/06 10:44:19 jmcneill Exp $ */
+/* $NetBSD: sunxi_gpio.c,v 1.6 2017/07/06 22:10:14 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill <[email protected]>
@@ -29,7 +29,7 @@
 #include "opt_soc.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunxi_gpio.c,v 1.5 2017/07/06 10:44:19 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_gpio.c,v 1.6 2017/07/06 22:10:14 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -62,6 +62,10 @@ static const struct of_compat_data compa
 	{ "allwinner,sun6i-a31-pinctrl",	(uintptr_t)&sun6i_a31_padconf },
 	{ "allwinner,sun6i-a31-r-pinctrl",	(uintptr_t)&sun6i_a31_r_padconf },
 #endif
+#ifdef SOC_SUN8I_A83T
+	{ "allwinner,sun8i-a83t-pinctrl",	(uintptr_t)&sun8i_a83t_padconf },
+	{ "allwinner,sun8i-a83t-r-pinctrl",	(uintptr_t)&sun8i_a83t_r_padconf },
+#endif
 #ifdef SOC_SUN8I_H3
 	{ "allwinner,sun8i-h3-pinctrl",		(uintptr_t)&sun8i_h3_padconf },
 	{ "allwinner,sun8i-h3-r-pinctrl",	(uintptr_t)&sun8i_h3_r_padconf },

Index: src/sys/arch/arm/sunxi/sunxi_ccu_nkmp.c
diff -u src/sys/arch/arm/sunxi/sunxi_ccu_nkmp.c:1.3 src/sys/arch/arm/sunxi/sunxi_ccu_nkmp.c:1.4
--- src/sys/arch/arm/sunxi/sunxi_ccu_nkmp.c:1.3	Sun Jul  2 00:14:09 2017
+++ src/sys/arch/arm/sunxi/sunxi_ccu_nkmp.c	Thu Jul  6 22:10:14 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_ccu_nkmp.c,v 1.3 2017/07/02 00:14:09 jmcneill Exp $ */
+/* $NetBSD: sunxi_ccu_nkmp.c,v 1.4 2017/07/06 22:10:14 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill <[email protected]>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunxi_ccu_nkmp.c,v 1.3 2017/07/02 00:14:09 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_ccu_nkmp.c,v 1.4 2017/07/06 22:10:14 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -79,8 +79,14 @@ sunxi_ccu_nkmp_get_rate(struct sunxi_ccu
 		return 0;
 
 	val = CCU_READ(sc, nkmp->reg);
-	n = __SHIFTOUT(val, nkmp->n);
-	k = __SHIFTOUT(val, nkmp->k);
+	if (nkmp->n)
+		n = __SHIFTOUT(val, nkmp->n);
+	else
+		n = 0;
+	if (nkmp->k)
+		k = __SHIFTOUT(val, nkmp->k);
+	else
+		k = 0;
 	if (nkmp->m)
 		m = __SHIFTOUT(val, nkmp->m);
 	else
@@ -93,7 +99,8 @@ sunxi_ccu_nkmp_get_rate(struct sunxi_ccu
 	if (nkmp->enable && !(val & nkmp->enable))
 		return 0;
 
-	n++;
+	if ((nkmp->flags & SUNXI_CCU_NKMP_FACTOR_N_EXACT) == 0)
+		n++;
 	k++;
 	m++;
 	p++;
Index: src/sys/arch/arm/sunxi/sunxi_platform.c
diff -u src/sys/arch/arm/sunxi/sunxi_platform.c:1.3 src/sys/arch/arm/sunxi/sunxi_platform.c:1.4
--- src/sys/arch/arm/sunxi/sunxi_platform.c:1.3	Sun Jul  2 00:14:09 2017
+++ src/sys/arch/arm/sunxi/sunxi_platform.c	Thu Jul  6 22:10:14 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_platform.c,v 1.3 2017/07/02 00:14:09 jmcneill Exp $ */
+/* $NetBSD: sunxi_platform.c,v 1.4 2017/07/06 22:10:14 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill <[email protected]>
@@ -31,7 +31,7 @@
 #include "opt_fdt_arm.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunxi_platform.c,v 1.3 2017/07/02 00:14:09 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_platform.c,v 1.4 2017/07/06 22:10:14 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -154,6 +154,7 @@ static const struct arm_platform sun8i_p
 };
 
 ARM_PLATFORM(sun8i_h3, "allwinner,sun8i-h3", &sun8i_platform);
+ARM_PLATFORM(sun8i_a83t, "allwinner,sun8i-a83t", &sun8i_platform);
 
 static const struct arm_platform sun6i_platform = {
 	.devmap = sunxi_platform_devmap,

Index: src/sys/arch/arm/sunxi/sunxi_gpio.h
diff -u src/sys/arch/arm/sunxi/sunxi_gpio.h:1.2 src/sys/arch/arm/sunxi/sunxi_gpio.h:1.3
--- src/sys/arch/arm/sunxi/sunxi_gpio.h:1.2	Sun Jul  2 15:28:25 2017
+++ src/sys/arch/arm/sunxi/sunxi_gpio.h	Thu Jul  6 22:10:14 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_gpio.h,v 1.2 2017/07/02 15:28:25 jmcneill Exp $ */
+/* $NetBSD: sunxi_gpio.h,v 1.3 2017/07/06 22:10:14 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill <[email protected]>
@@ -55,6 +55,11 @@ extern const struct sunxi_gpio_padconf s
 extern const struct sunxi_gpio_padconf sun6i_a31_r_padconf;
 #endif
 
+#ifdef SOC_SUN8I_A83T
+extern const struct sunxi_gpio_padconf sun8i_a83t_padconf;
+extern const struct sunxi_gpio_padconf sun8i_a83t_r_padconf;
+#endif
+
 #ifdef SOC_SUN8I_H3
 extern const struct sunxi_gpio_padconf sun8i_h3_padconf;
 extern const struct sunxi_gpio_padconf sun8i_h3_r_padconf;

Index: src/sys/arch/evbarm/conf/SUNXI
diff -u src/sys/arch/evbarm/conf/SUNXI:1.11 src/sys/arch/evbarm/conf/SUNXI:1.12
--- src/sys/arch/evbarm/conf/SUNXI:1.11	Thu Jul  6 10:44:19 2017
+++ src/sys/arch/evbarm/conf/SUNXI	Thu Jul  6 22:10:14 2017
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: SUNXI,v 1.11 2017/07/06 10:44:19 jmcneill Exp $
+#	$NetBSD: SUNXI,v 1.12 2017/07/06 22:10:14 jmcneill Exp $
 #
 #	Allwinner sunxi family
 #
@@ -29,6 +29,7 @@ makeoptions	DTS="
 
 options 	CPU_CORTEXA7
 options 	SOC_SUN6I_A31
+options 	SOC_SUN8I_A83T
 options 	SOC_SUN8I_H3
 options 	MULTIPROCESSOR
 
@@ -61,6 +62,7 @@ psci*		at fdt?
 
 # Clock and reset controllers
 sun6ia31ccu*	at fdt? pass 4		# A31 CCU
+sun8ia83tccu*	at fdt? pass 4		# A83T CCU
 sun8ih3ccu*	at fdt? pass 4		# H3 CCU
 
 fclock*		at fdt? pass 3

Added files:

Index: src/sys/arch/arm/sunxi/sun8i_a83t_ccu.c
diff -u /dev/null src/sys/arch/arm/sunxi/sun8i_a83t_ccu.c:1.1
--- /dev/null	Thu Jul  6 22:10:14 2017
+++ src/sys/arch/arm/sunxi/sun8i_a83t_ccu.c	Thu Jul  6 22:10:14 2017
@@ -0,0 +1,285 @@
+/* $NetBSD: sun8i_a83t_ccu.c,v 1.1 2017/07/06 22:10:14 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2017 Jared McNeill <[email protected]>
+ * Copyright (c) 2017 Emmanuel Vadot <[email protected]>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+
+__KERNEL_RCSID(1, "$NetBSD: sun8i_a83t_ccu.c,v 1.1 2017/07/06 22:10:14 jmcneill Exp $");
+
+#include <sys/param.h>
+#include <sys/bus.h>
+#include <sys/device.h>
+#include <sys/systm.h>
+
+#include <dev/fdt/fdtvar.h>
+
+#include <arm/sunxi/sunxi_ccu.h>
+#include <arm/sunxi/sun8i_a83t_ccu.h>
+
+#define	PLL_PERIPH0_CTRL_REG	0x028
+#define	AHB1_APB1_CFG_REG	0x054
+#define	APB2_CFG_REG		0x058
+#define	BUS_CLK_GATING_REG0	0x060
+#define	BUS_CLK_GATING_REG2	0x068
+#define	BUS_CLK_GATING_REG3	0x06c
+#define	SDMMC0_CLK_REG		0x088
+#define	SDMMC1_CLK_REG		0x08c
+#define	SDMMC2_CLK_REG		0x090
+#define	USBPHY_CFG_REG		0x0cc
+#define	MBUS_RST_REG		0x0fc
+#define	BUS_SOFT_RST_REG0	0x2c0
+#define	BUS_SOFT_RST_REG1	0x2c4
+#define	BUS_SOFT_RST_REG2	0x2c8
+#define	BUS_SOFT_RST_REG3	0x2d0
+#define	BUS_SOFT_RST_REG4	0x2d8
+
+static int sun8i_a83t_ccu_match(device_t, cfdata_t, void *);
+static void sun8i_a83t_ccu_attach(device_t, device_t, void *);
+
+static const char * const compatible[] = {
+	"allwinner,sun8i-a83t-ccu",
+	NULL
+};
+
+CFATTACH_DECL_NEW(sunxi_a83t_ccu, sizeof(struct sunxi_ccu_softc),
+	sun8i_a83t_ccu_match, sun8i_a83t_ccu_attach, NULL, NULL);
+
+static struct sunxi_ccu_reset sun8i_a83t_ccu_resets[] = {
+	SUNXI_CCU_RESET(H3_RST_USB_PHY0, USBPHY_CFG_REG, 0),
+	SUNXI_CCU_RESET(H3_RST_USB_PHY1, USBPHY_CFG_REG, 1),
+	SUNXI_CCU_RESET(H3_RST_USB_PHY2, USBPHY_CFG_REG, 2),
+	SUNXI_CCU_RESET(H3_RST_USB_PHY3, USBPHY_CFG_REG, 3),
+
+	SUNXI_CCU_RESET(H3_RST_MBUS, MBUS_RST_REG, 31),
+
+	SUNXI_CCU_RESET(H3_RST_BUS_CE, BUS_SOFT_RST_REG0, 5),
+	SUNXI_CCU_RESET(H3_RST_BUS_DMA, BUS_SOFT_RST_REG0, 6),
+	SUNXI_CCU_RESET(H3_RST_BUS_MMC0, BUS_SOFT_RST_REG0, 8),
+	SUNXI_CCU_RESET(H3_RST_BUS_MMC1, BUS_SOFT_RST_REG0, 9),
+	SUNXI_CCU_RESET(H3_RST_BUS_MMC2, BUS_SOFT_RST_REG0, 10),
+	SUNXI_CCU_RESET(H3_RST_BUS_NAND, BUS_SOFT_RST_REG0, 13),
+	SUNXI_CCU_RESET(H3_RST_BUS_DRAM, BUS_SOFT_RST_REG0, 14),
+	SUNXI_CCU_RESET(H3_RST_BUS_EMAC, BUS_SOFT_RST_REG0, 17),
+	SUNXI_CCU_RESET(H3_RST_BUS_TS, BUS_SOFT_RST_REG0, 18),
+	SUNXI_CCU_RESET(H3_RST_BUS_HSTIMER, BUS_SOFT_RST_REG0, 19),
+	SUNXI_CCU_RESET(H3_RST_BUS_SPI0, BUS_SOFT_RST_REG0, 20),
+	SUNXI_CCU_RESET(H3_RST_BUS_SPI1, BUS_SOFT_RST_REG0, 21),
+	SUNXI_CCU_RESET(H3_RST_BUS_OTG, BUS_SOFT_RST_REG0, 23),
+	SUNXI_CCU_RESET(H3_RST_BUS_EHCI0, BUS_SOFT_RST_REG0, 24),
+	SUNXI_CCU_RESET(H3_RST_BUS_EHCI1, BUS_SOFT_RST_REG0, 25),
+	SUNXI_CCU_RESET(H3_RST_BUS_EHCI2, BUS_SOFT_RST_REG0, 26),
+	SUNXI_CCU_RESET(H3_RST_BUS_EHCI3, BUS_SOFT_RST_REG0, 27),
+	SUNXI_CCU_RESET(H3_RST_BUS_OHCI0, BUS_SOFT_RST_REG0, 28),
+	SUNXI_CCU_RESET(H3_RST_BUS_OHCI1, BUS_SOFT_RST_REG0, 29),
+	SUNXI_CCU_RESET(H3_RST_BUS_OHCI2, BUS_SOFT_RST_REG0, 30),
+	SUNXI_CCU_RESET(H3_RST_BUS_OHCI3, BUS_SOFT_RST_REG0, 31),
+        
+	SUNXI_CCU_RESET(H3_RST_BUS_VE, BUS_SOFT_RST_REG1, 0),
+	SUNXI_CCU_RESET(H3_RST_BUS_TCON0, BUS_SOFT_RST_REG1, 3),
+	SUNXI_CCU_RESET(H3_RST_BUS_TCON1, BUS_SOFT_RST_REG1, 4),
+	SUNXI_CCU_RESET(H3_RST_BUS_DEINTERLACE, BUS_SOFT_RST_REG1, 5),
+	SUNXI_CCU_RESET(H3_RST_BUS_CSI, BUS_SOFT_RST_REG1, 8),
+	SUNXI_CCU_RESET(H3_RST_BUS_TVE, BUS_SOFT_RST_REG1, 9),
+	SUNXI_CCU_RESET(H3_RST_BUS_HDMI0, BUS_SOFT_RST_REG1, 10),
+	SUNXI_CCU_RESET(H3_RST_BUS_HDMI1, BUS_SOFT_RST_REG1, 11),
+	SUNXI_CCU_RESET(H3_RST_BUS_DE, BUS_SOFT_RST_REG1, 12),
+	SUNXI_CCU_RESET(H3_RST_BUS_GPU, BUS_SOFT_RST_REG1, 20),
+	SUNXI_CCU_RESET(H3_RST_BUS_MSGBOX, BUS_SOFT_RST_REG1, 21),
+	SUNXI_CCU_RESET(H3_RST_BUS_SPINLOCK, BUS_SOFT_RST_REG1, 22),
+	SUNXI_CCU_RESET(H3_RST_BUS_DBG, BUS_SOFT_RST_REG1, 31),
+
+	SUNXI_CCU_RESET(H3_RST_BUS_EPHY, BUS_SOFT_RST_REG2, 2),
+
+	SUNXI_CCU_RESET(H3_RST_BUS_CODEC, BUS_SOFT_RST_REG3, 0),
+	SUNXI_CCU_RESET(H3_RST_BUS_SPDIF, BUS_SOFT_RST_REG3, 1),
+	SUNXI_CCU_RESET(H3_RST_BUS_THS, BUS_SOFT_RST_REG3, 8),
+	SUNXI_CCU_RESET(H3_RST_BUS_I2S0, BUS_SOFT_RST_REG3, 12),
+	SUNXI_CCU_RESET(H3_RST_BUS_I2S1, BUS_SOFT_RST_REG3, 13),
+	SUNXI_CCU_RESET(H3_RST_BUS_I2S2, BUS_SOFT_RST_REG3, 14),
+
+	SUNXI_CCU_RESET(H3_RST_BUS_I2C0, BUS_SOFT_RST_REG4, 0),
+	SUNXI_CCU_RESET(H3_RST_BUS_I2C1, BUS_SOFT_RST_REG4, 1),
+	SUNXI_CCU_RESET(H3_RST_BUS_I2C2, BUS_SOFT_RST_REG4, 2),
+	SUNXI_CCU_RESET(H3_RST_BUS_UART0, BUS_SOFT_RST_REG4, 16),
+	SUNXI_CCU_RESET(H3_RST_BUS_UART1, BUS_SOFT_RST_REG4, 17),
+	SUNXI_CCU_RESET(H3_RST_BUS_UART2, BUS_SOFT_RST_REG4, 18),
+	SUNXI_CCU_RESET(H3_RST_BUS_UART3, BUS_SOFT_RST_REG4, 19),
+	SUNXI_CCU_RESET(H3_RST_BUS_SCR, BUS_SOFT_RST_REG4, 20),
+};
+
+static const char *ahb1_parents[] = { "losc", "hosc", "pll_periph" };
+static const char *ahb2_parents[] = { "ahb1", "pll_periph" };
+static const char *apb1_parents[] = { "ahb1" };
+static const char *apb2_parents[] = { "losc", "hosc", "pll_periph" };
+static const char *mod_parents[] = { "hosc", "pll_periph" };
+
+static struct sunxi_ccu_clk sun8i_a83t_ccu_clks[] = {
+	SUNXI_CCU_NKMP(H3_CLK_PLL_PERIPH0, "pll_periph", "hosc",
+	    PLL_PERIPH0_CTRL_REG,	/* reg */
+	    __BITS(15,8),		/* n */
+	    0,		 		/* k */
+	    __BIT(18),			/* m */
+	    __BIT(16),			/* p */
+	    __BIT(31),			/* enable */
+	    SUNXI_CCU_NKMP_FACTOR_N_EXACT),
+
+	SUNXI_CCU_PREDIV(H3_CLK_AHB1, "ahb1", ahb1_parents,
+	    AHB1_APB1_CFG_REG,	/* reg */
+	    __BITS(7,6),	/* prediv */
+	    __BIT(3),		/* prediv_sel */
+	    __BITS(5,4),	/* div */
+	    __BITS(13,12),	/* sel */
+	    SUNXI_CCU_PREDIV_POWER_OF_TWO),
+
+	SUNXI_CCU_PREDIV(H3_CLK_AHB2, "ahb2", ahb2_parents,
+	    APB2_CFG_REG,	/* reg */
+	    0,			/* prediv */
+	    __BIT(1),		/* prediv_sel */
+	    0,			/* div */
+	    __BITS(1,0),	/* sel */
+	    SUNXI_CCU_PREDIV_DIVIDE_BY_TWO),
+
+	SUNXI_CCU_DIV(H3_CLK_APB1, "apb1", apb1_parents,
+	    AHB1_APB1_CFG_REG,	/* reg */
+	    __BITS(9,8),	/* div */
+	    0,			/* sel */
+	    SUNXI_CCU_DIV_POWER_OF_TWO|SUNXI_CCU_DIV_ZERO_IS_ONE),
+
+	SUNXI_CCU_NM(H3_CLK_APB2, "apb2", apb2_parents,
+	    APB2_CFG_REG,	/* reg */
+	    __BITS(17,16),	/* n */
+	    __BITS(4,0),	/* m */
+	    __BITS(25,24),	/* sel */
+	    0,			/* enable */
+	    SUNXI_CCU_NM_POWER_OF_TWO),
+
+	SUNXI_CCU_NM(H3_CLK_MMC0, "mmc0", mod_parents,
+	    SDMMC0_CLK_REG, __BITS(17, 16), __BITS(3,0), __BITS(25, 24), __BIT(31),
+	    SUNXI_CCU_NM_POWER_OF_TWO|SUNXI_CCU_NM_ROUND_DOWN),
+	SUNXI_CCU_NM(H3_CLK_MMC1, "mmc1", mod_parents,
+	    SDMMC1_CLK_REG, __BITS(17, 16), __BITS(3,0), __BITS(25, 24), __BIT(31),
+	    SUNXI_CCU_NM_POWER_OF_TWO|SUNXI_CCU_NM_ROUND_DOWN),
+	SUNXI_CCU_NM(H3_CLK_MMC2, "mmc2", mod_parents,
+	    SDMMC2_CLK_REG, __BITS(17, 16), __BITS(3,0), __BITS(25, 24), __BIT(31),
+	    SUNXI_CCU_NM_POWER_OF_TWO|SUNXI_CCU_NM_ROUND_DOWN),
+
+	SUNXI_CCU_GATE(H3_CLK_BUS_MMC0, "bus-mmc0", "ahb1",
+	    BUS_CLK_GATING_REG0, 8),
+	SUNXI_CCU_GATE(H3_CLK_BUS_MMC1, "bus-mmc1", "ahb1",
+	    BUS_CLK_GATING_REG0, 9),
+	SUNXI_CCU_GATE(H3_CLK_BUS_MMC2, "bus-mmc2", "ahb1",
+	    BUS_CLK_GATING_REG0, 10),
+	SUNXI_CCU_GATE(H3_CLK_BUS_EMAC, "bus-emac", "ahb2",
+	    BUS_CLK_GATING_REG0, 17),
+	SUNXI_CCU_GATE(H3_CLK_BUS_OTG, "bus-otg", "ahb1",
+	    BUS_CLK_GATING_REG0, 23),
+	SUNXI_CCU_GATE(H3_CLK_BUS_EHCI0, "bus-ehci0", "ahb1",
+	    BUS_CLK_GATING_REG0, 24),
+	SUNXI_CCU_GATE(H3_CLK_BUS_EHCI1, "bus-ehci1", "ahb2",
+	    BUS_CLK_GATING_REG0, 25),
+	SUNXI_CCU_GATE(H3_CLK_BUS_EHCI2, "bus-ehci2", "ahb2",
+	    BUS_CLK_GATING_REG0, 26),
+	SUNXI_CCU_GATE(H3_CLK_BUS_EHCI3, "bus-ehci3", "ahb2",
+	    BUS_CLK_GATING_REG0, 27),
+	SUNXI_CCU_GATE(H3_CLK_BUS_OHCI0, "bus-ohci0", "ahb1",
+	    BUS_CLK_GATING_REG0, 28),
+	SUNXI_CCU_GATE(H3_CLK_BUS_OHCI1, "bus-ohci1", "ahb2",
+	    BUS_CLK_GATING_REG0, 29),
+	SUNXI_CCU_GATE(H3_CLK_BUS_OHCI2, "bus-ohci2", "ahb2",
+	    BUS_CLK_GATING_REG0, 30),
+	SUNXI_CCU_GATE(H3_CLK_BUS_OHCI3, "bus-ohci3", "ahb2",
+	    BUS_CLK_GATING_REG0, 31),
+
+	SUNXI_CCU_GATE(H3_CLK_BUS_PIO, "bus-pio", "apb1",
+	    BUS_CLK_GATING_REG2, 5),
+
+	SUNXI_CCU_GATE(H3_CLK_BUS_I2C0, "bus-i2c0", "apb2",
+	    BUS_CLK_GATING_REG3, 0),
+	SUNXI_CCU_GATE(H3_CLK_BUS_I2C1, "bus-i2c1", "apb2",
+	    BUS_CLK_GATING_REG3, 1),
+	SUNXI_CCU_GATE(H3_CLK_BUS_I2C2, "bus-i2c2", "apb2",
+	    BUS_CLK_GATING_REG3, 2),
+	SUNXI_CCU_GATE(H3_CLK_BUS_UART0, "bus-uart0", "apb2",
+	    BUS_CLK_GATING_REG3, 16),
+	SUNXI_CCU_GATE(H3_CLK_BUS_UART1, "bus-uart1", "apb2",
+	    BUS_CLK_GATING_REG3, 17),
+	SUNXI_CCU_GATE(H3_CLK_BUS_UART2, "bus-uart2", "apb2",
+	    BUS_CLK_GATING_REG3, 18),
+	SUNXI_CCU_GATE(H3_CLK_BUS_UART3, "bus-uart3", "apb2",
+	    BUS_CLK_GATING_REG3, 19),
+
+	SUNXI_CCU_GATE(H3_CLK_USBPHY0, "usb-phy0", "hosc",
+	    USBPHY_CFG_REG, 8),
+	SUNXI_CCU_GATE(H3_CLK_USBPHY1, "usb-phy1", "hosc",
+	    USBPHY_CFG_REG, 9),
+	SUNXI_CCU_GATE(H3_CLK_USBPHY2, "usb-phy2", "hosc",
+	    USBPHY_CFG_REG, 10),
+	SUNXI_CCU_GATE(H3_CLK_USBPHY3, "usb-phy3", "hosc",
+	    USBPHY_CFG_REG, 11),
+	SUNXI_CCU_GATE(H3_CLK_USBOHCI0, "usb-ohci0", "hosc",
+	    USBPHY_CFG_REG, 16),
+	SUNXI_CCU_GATE(H3_CLK_USBOHCI1, "usb-ohci1", "hosc",
+	    USBPHY_CFG_REG, 17),
+	SUNXI_CCU_GATE(H3_CLK_USBOHCI2, "usb-ohci2", "hosc",
+	    USBPHY_CFG_REG, 18),
+	SUNXI_CCU_GATE(H3_CLK_USBOHCI3, "usb-ohci3", "hosc",
+	    USBPHY_CFG_REG, 19),
+};
+
+static int
+sun8i_a83t_ccu_match(device_t parent, cfdata_t cf, void *aux)
+{
+	struct fdt_attach_args * const faa = aux;
+
+	return of_match_compatible(faa->faa_phandle, compatible);
+}
+
+static void
+sun8i_a83t_ccu_attach(device_t parent, device_t self, void *aux)
+{
+	struct sunxi_ccu_softc * const sc = device_private(self);
+	struct fdt_attach_args * const faa = aux;
+
+	sc->sc_dev = self;
+	sc->sc_phandle = faa->faa_phandle;
+	sc->sc_bst = faa->faa_bst;
+
+	sc->sc_resets = sun8i_a83t_ccu_resets;
+	sc->sc_nresets = __arraycount(sun8i_a83t_ccu_resets);
+
+	sc->sc_clks = sun8i_a83t_ccu_clks;
+	sc->sc_nclks = __arraycount(sun8i_a83t_ccu_clks);
+
+	if (sunxi_ccu_attach(sc) != 0)
+		return;
+
+	aprint_naive("\n");
+	aprint_normal(": A83T CCU\n");
+
+	sunxi_ccu_print(sc);
+}
Index: src/sys/arch/arm/sunxi/sun8i_a83t_ccu.h
diff -u /dev/null src/sys/arch/arm/sunxi/sun8i_a83t_ccu.h:1.1
--- /dev/null	Thu Jul  6 22:10:14 2017
+++ src/sys/arch/arm/sunxi/sun8i_a83t_ccu.h	Thu Jul  6 22:10:14 2017
@@ -0,0 +1,34 @@
+/* $NetBSD: sun8i_a83t_ccu.h,v 1.1 2017/07/06 22:10:14 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2017 Jared McNeill <[email protected]>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _SUN8I_A83T_CCU_H
+#define _SUN8I_A83T_CCU_H
+
+#include <arm/sunxi/sun8i_h3_ccu.h>
+
+#endif /* !_SUN8I_A83T_CCU_H */
Index: src/sys/arch/arm/sunxi/sun8i_a83t_gpio.c
diff -u /dev/null src/sys/arch/arm/sunxi/sun8i_a83t_gpio.c:1.1
--- /dev/null	Thu Jul  6 22:10:14 2017
+++ src/sys/arch/arm/sunxi/sun8i_a83t_gpio.c	Thu Jul  6 22:10:14 2017
@@ -0,0 +1,181 @@
+/* $NetBSD: sun8i_a83t_gpio.c,v 1.1 2017/07/06 22:10:14 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2016-2017 Jared McNeill <[email protected]>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: sun8i_a83t_gpio.c,v 1.1 2017/07/06 22:10:14 jmcneill Exp $");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/types.h>
+
+#include <arm/sunxi/sunxi_gpio.h>
+
+static const struct sunxi_gpio_pins a83t_pins[] = {
+	{ "PB0",  1, 0,   { "gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "eint" } },
+	{ "PB1",  1, 1,   { "gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "eint" } },
+	{ "PB2",  1, 2,   { "gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "eint" } },
+	{ "PB3",  1, 3,   { "gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "eint" } },
+	{ "PB4",  1, 4,   { "gpio_in", "gpio_out", "i2s0", "tdm", NULL, NULL, "eint" } },
+	{ "PB5",  1, 5,   { "gpio_in", "gpio_out", "i2s0", "tdm", NULL, NULL, "eint" } },
+	{ "PB6",  1, 6,   { "gpio_in", "gpio_out", "i2s0", "tdm", NULL, NULL, "eint" } },
+	{ "PB7",  1, 7,   { "gpio_in", "gpio_out", "i2s0", "tdm", NULL, NULL, "eint" } },
+	{ "PB8",  1, 8,   { "gpio_in", "gpio_out", "i2s0", "tdm", NULL, NULL, "eint" } },
+	{ "PB9",  1, 9,   { "gpio_in", "gpio_out", "uart0", NULL, NULL, NULL, "eint" } },
+	{ "PB10", 1, 10,  { "gpio_in", "gpio_out", "uart0", NULL, NULL, NULL, "eint" } },
+
+	{ "PC0",  2, 0,   { "gpio_in", "gpio_out", "nand", "spi0" } },
+	{ "PC1",  2, 1,   { "gpio_in", "gpio_out", "nand", "spi0" } },
+	{ "PC2",  2, 2,   { "gpio_in", "gpio_out", "nand", "spi0" } },
+	{ "PC3",  2, 3,   { "gpio_in", "gpio_out", "nand", "spi0" } },
+	{ "PC4",  2, 4,   { "gpio_in", "gpio_out", "nand" } },
+	{ "PC5",  2, 5,   { "gpio_in", "gpio_out", "nand", "mmc2" } },
+	{ "PC6",  2, 6,   { "gpio_in", "gpio_out", "nand", "mmc2" } },
+	{ "PC7",  2, 7,   { "gpio_in", "gpio_out", "nand" } },
+	{ "PC8",  2, 8,   { "gpio_in", "gpio_out", "nand", "mmc2" } },
+	{ "PC9",  2, 9,   { "gpio_in", "gpio_out", "nand", "mmc2" } },
+	{ "PC10", 2, 10,  { "gpio_in", "gpio_out", "nand", "mmc2" } },
+	{ "PC11", 2, 11,  { "gpio_in", "gpio_out", "nand", "mmc2" } },
+	{ "PC12", 2, 12,  { "gpio_in", "gpio_out", "nand", "mmc2" } },
+	{ "PC13", 2, 13,  { "gpio_in", "gpio_out", "nand", "mmc2" } },
+	{ "PC14", 2, 14,  { "gpio_in", "gpio_out", "nand", "mmc2" } },
+	{ "PC15", 2, 15,  { "gpio_in", "gpio_out", "nand", "mmc2" } },
+	{ "PC16", 2, 16,  { "gpio_in", "gpio_out", "nand", "mmc2" } },
+	{ "PC17", 2, 17,  { "gpio_in", "gpio_out", "nand" } },
+	{ "PC18", 2, 18,  { "gpio_in", "gpio_out", "nand" } },
+
+	{ "PD2",  3, 2,   { "gpio_in", "gpio_out", "lcd", NULL, "emac" } },
+	{ "PD3",  3, 3,   { "gpio_in", "gpio_out", "lcd", NULL, "emac" } },
+	{ "PD4",  3, 4,   { "gpio_in", "gpio_out", "lcd", NULL, "emac" } },
+	{ "PD5",  3, 5,   { "gpio_in", "gpio_out", "lcd", NULL, "emac" } },
+	{ "PD6",  3, 6,   { "gpio_in", "gpio_out", "lcd", NULL, "emac" } },
+	{ "PD7",  3, 7,   { "gpio_in", "gpio_out", "lcd", NULL, "emac" } },
+	{ "PD10", 3, 10,  { "gpio_in", "gpio_out", "lcd", NULL, "emac" } },
+	{ "PD11", 3, 11,  { "gpio_in", "gpio_out", "lcd", NULL, "emac" } },
+	{ "PD12", 3, 12,  { "gpio_in", "gpio_out", "lcd", NULL, "emac" } },
+	{ "PD13", 3, 13,  { "gpio_in", "gpio_out", "lcd", NULL, "emac" } },
+	{ "PD14", 3, 14,  { "gpio_in", "gpio_out", "lcd", NULL, "emac" } },
+	{ "PD15", 3, 15,  { "gpio_in", "gpio_out", "lcd", NULL, "emac" } },
+	{ "PD18", 3, 18,  { "gpio_in", "gpio_out", "lcd", "lvds", "emac" } },
+	{ "PD19", 3, 19,  { "gpio_in", "gpio_out", "lcd", "lvds", "emac" } },
+	{ "PD20", 3, 20,  { "gpio_in", "gpio_out", "lcd", "lvds", "emac" } },
+	{ "PD21", 3, 21,  { "gpio_in", "gpio_out", "lcd", "lvds", "emac" } },
+	{ "PD22", 3, 22,  { "gpio_in", "gpio_out", "lcd", "lvds", "emac" } },
+	{ "PD23", 3, 23,  { "gpio_in", "gpio_out", "lcd", "lvds", "emac" } },
+	{ "PD24", 3, 24,  { "gpio_in", "gpio_out", "lcd", "lvds" } },
+	{ "PD25", 3, 25,  { "gpio_in", "gpio_out", "lcd", "lvds" } },
+	{ "PD26", 3, 26,  { "gpio_in", "gpio_out", "lcd", "lvds" } },
+	{ "PD27", 3, 27,  { "gpio_in", "gpio_out", "lcd", "lvds" } },
+	{ "PD28", 3, 28,  { "gpio_in", "gpio_out", "pwm" } },
+	{ "PD29", 3, 29,  { "gpio_in", "gpio_out" } },
+
+	{ "PE0",  4, 0,   { "gpio_in", "gpio_out", "csi", NULL, "ccir" } },
+	{ "PE1",  4, 1,   { "gpio_in", "gpio_out", "csi", NULL, "ccir" } },
+	{ "PE2",  4, 2,   { "gpio_in", "gpio_out", "csi", NULL, "ccir" } },
+	{ "PE3",  4, 3,   { "gpio_in", "gpio_out", "csi", NULL, "ccir" } },
+	{ "PE4",  4, 4,   { "gpio_in", "gpio_out", "csi" } },
+	{ "PE5",  4, 5,   { "gpio_in", "gpio_out", "csi" } },
+	{ "PE6",  4, 6,   { "gpio_in", "gpio_out", "csi", NULL, "ccir" } },
+	{ "PE7",  4, 7,   { "gpio_in", "gpio_out", "csi", NULL, "ccir" } },
+	{ "PE8",  4, 8,   { "gpio_in", "gpio_out", "csi", NULL, "ccir" } },
+	{ "PE9",  4, 9,   { "gpio_in", "gpio_out", "csi", NULL, "ccir" } },
+	{ "PE10", 4, 10,  { "gpio_in", "gpio_out", "csi", "uart4", "ccir" } },
+	{ "PE11", 4, 11,  { "gpio_in", "gpio_out", "csi", "uart4", "ccir" } },
+	{ "PE12", 4, 12,  { "gpio_in", "gpio_out", "csi", "uart4", "ccir" } },
+	{ "PE13", 4, 13,  { "gpio_in", "gpio_out", "csi", "uart4", "ccir" } },
+	{ "PE14", 4, 14,  { "gpio_in", "gpio_out", "csi", "twi2" } },
+	{ "PE15", 4, 15,  { "gpio_in", "gpio_out", "csi", "twi2" } },
+	{ "PE16", 4, 16,  { "gpio_in", "gpio_out" } },
+	{ "PE17", 4, 17,  { "gpio_in", "gpio_out" } },
+	{ "PE18", 4, 18,  { "gpio_in", "gpio_out", NULL, "owa" } },
+	{ "PE19", 4, 19,  { "gpio_in", "gpio_out" } },
+
+	{ "PF0",  5, 0,   { "gpio_in", "gpio_out", "mmc0", "jtag" } },
+	{ "PF1",  5, 1,   { "gpio_in", "gpio_out", "mmc0", "jtag" } },
+	{ "PF2",  5, 2,   { "gpio_in", "gpio_out", "mmc0", "uart0" } },
+	{ "PF3",  5, 3,   { "gpio_in", "gpio_out", "mmc0", "jtag" } },
+	{ "PF4",  5, 4,   { "gpio_in", "gpio_out", "mmc0", "uart0" } },
+	{ "PF5",  5, 5,   { "gpio_in", "gpio_out", "mmc0", "jtag" } },
+	{ "PF6",  5, 6,   { "gpio_in", "gpio_out" } },
+
+	{ "PG0",  6, 0,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "eint" } },
+	{ "PG1",  6, 1,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "eint" } },
+	{ "PG2",  6, 2,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "eint" } },
+	{ "PG3",  6, 3,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "eint" } },
+	{ "PG4",  6, 4,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "eint" } },
+	{ "PG5",  6, 5,   { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "eint" } },
+	{ "PG6",  6, 6,   { "gpio_in", "gpio_out", "uart1", "spi1", NULL, NULL, "eint" } },
+	{ "PG7",  6, 7,   { "gpio_in", "gpio_out", "uart1", "spi1", NULL, NULL, "eint" } },
+	{ "PG8",  6, 8,   { "gpio_in", "gpio_out", "uart1", "spi1", NULL, NULL, "eint" } },
+	{ "PG9",  6, 9,   { "gpio_in", "gpio_out", "uart1", "spi1", NULL, NULL, "eint" } },
+	{ "PG10", 6, 10,  { "gpio_in", "gpio_out", "i2s1", "uart3", NULL, NULL, "eint" } },
+	{ "PG11", 6, 11,  { "gpio_in", "gpio_out", "i2s1", "uart3", NULL, NULL, "eint" } },
+	{ "PG12", 6, 12,  { "gpio_in", "gpio_out", "i2s1", "uart3", NULL, NULL, "eint" } },
+	{ "PG13", 6, 13,  { "gpio_in", "gpio_out", "i2s1", "uart3", NULL, NULL, "eint" } },
+
+	{ "PH0",  7, 0,   { "gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, "eint" } },
+	{ "PH1",  7, 1,   { "gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, "eint" } },
+	{ "PH2",  7, 2,   { "gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, "eint" } },
+	{ "PH3",  7, 3,   { "gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, "eint" } },
+	{ "PH4",  7, 4,   { "gpio_in", "gpio_out", "i2c2", NULL, NULL, NULL, "eint" } },
+	{ "PH5",  7, 5,   { "gpio_in", "gpio_out", "i2c2", NULL, NULL, NULL, "eint" } },
+	{ "PH6",  7, 6,   { "gpio_in", "gpio_out", "hdmiddc", NULL, NULL, NULL, "eint" } },
+	{ "PH7",  7, 7,   { "gpio_in", "gpio_out", "hdmiddc", NULL, NULL, NULL, "eint" } },
+	{ "PH8",  7, 8,   { "gpio_in", "gpio_out", "hdmiddc", NULL, NULL, NULL, "eint" } },
+	{ "PH9",  7, 9,   { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "eint" } },
+	{ "PH10", 7, 10,  { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "eint" } },
+	{ "PH11", 7, 11,  { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "eint" } },
+};
+
+static const struct sunxi_gpio_pins a83t_r_pins[] = {
+	{ "PL0",   0, 0,  { "gpio_in", "gpio_out", "s_rsb", "s_i2c", NULL, NULL, "eint" } },
+	{ "PL1",   0, 1,  { "gpio_in", "gpio_out", "s_rsb", "s_i2c", NULL, NULL, "eint" } },
+	{ "PL2",   0, 2,  { "gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, "eint" } },
+	{ "PL3",   0, 3,  { "gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, "eint" } },
+	{ "PL4",   0, 4,  { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "eint" } },
+	{ "PL5",   0, 5,  { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "eint" } },
+	{ "PL6",   0, 6,  { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "eint" } },
+	{ "PL7",   0, 7,  { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "eint" } },
+	{ "PL8",   0, 8,  { "gpio_in", "gpio_out", "s_i2c", NULL, NULL, NULL, "eint" } },
+	{ "PL9",   0, 9,  { "gpio_in", "gpio_out", "s_i2c", NULL, NULL, NULL, "eint" } },
+	{ "PL10",  0, 10, { "gpio_in", "gpio_out", "s_pwm", NULL, NULL, NULL, "eint" } },
+	{ "PL11",  0, 11, { "gpio_in", "gpio_out", NULL, NULL, NULL, "eint" } },
+	{ "PL12",  0, 12, { "gpio_in", "gpio_out", "s_cir", NULL, NULL, NULL, "eint" } },
+};
+
+const struct sunxi_gpio_padconf sun8i_a83t_padconf = {
+	.npins = __arraycount(a83t_pins),
+	.pins = a83t_pins,
+};
+
+const struct sunxi_gpio_padconf sun8i_a83t_r_padconf = {
+	.npins = __arraycount(a83t_r_pins),
+	.pins = a83t_r_pins,
+};

Reply via email to