Skip to contentSkip to conversation

dt-bindings: clock: add Allwinner B288 CCU

PATCH Superseded Pablo Mazzini 4 participants 25 messages Sep 23 – Sep 28

Subsystems (13)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/11 dt-bindings: clock: add Allwinner B288 CCU

The B288 (sun8iw10p1) is a dual Cortex-A7 SoC used in e-book readers.

---
 .../clock/allwinner,sun8i-b288-ccu.yaml       | 55 ++++++++++++
 include/dt-bindings/clock/sun8i-b288-ccu.h    | 90 +++++++++++++++++++
 include/dt-bindings/reset/sun8i-b288-ccu.h    | 45 ++++++++++
 3 files changed, 190 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/allwinner,sun8i-b288-ccu.yaml
 create mode 100644 include/dt-bindings/clock/sun8i-b288-ccu.h
 create mode 100644 include/dt-bindings/reset/sun8i-b288-ccu.h
Documentation/devicetree/bindings/clock/allwinner,sun8i-b288-ccu.yaml new file +55 -0
new file mode 100644
index 000000000000..22b59d5b652c
@@ -0,0 +1,55 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/allwinner,sun8i-b288-ccu.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Allwinner B288 Clock Control Unit
+
+maintainers:
+  - Chen-Yu Tsai <[email protected]>
+  - Maxime Ripard <[email protected]>
+
+properties:
+  "#clock-cells":
+    const: 1
+
+  "#reset-cells":
+    const: 1
+
+  compatible:
+    const: allwinner,sun8i-b288-ccu
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: High Frequency Oscillator
+      - description: Low Frequency Oscillator
+
+  clock-names:
+    items:
+      - const: hosc
+      - const: losc
+
+required:
+  - "#clock-cells"
+  - "#reset-cells"
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+
+additionalProperties: false
+
+examples:
+  - |
+    ccu: clock-controller@1c20000 {
+        compatible = "allwinner,sun8i-b288-ccu";
+        reg = <0x01c20000 0x400>;
+        clocks = <&osc24M>, <&osc32k>;
+        clock-names = "hosc", "losc";
+        #clock-cells = <1>;
+        #reset-cells = <1>;
+    };
include/dt-bindings/clock/sun8i-b288-ccu.h new file +90 -0

90 lines not on this page · raw message

include/dt-bindings/reset/sun8i-b288-ccu.h new file +45 -0

45 lines not on this page · raw message

Signature · 1 line
2.53.0
#1 lore raw

PATCH 2/11 clk: sunxi-ng: add Allwinner B288 CCU driver

Covers the PLLs, the CPU/AHB/APB tree, the module clocks and the bus gates and resets.

---
 drivers/clk/sunxi-ng/Kconfig          |   5 +
 drivers/clk/sunxi-ng/Makefile         |   1 +
 drivers/clk/sunxi-ng/ccu-sun8i-b288.c | 669 ++++++++++++++++++++++++++
 drivers/clk/sunxi-ng/ccu-sun8i-b288.h |  10 +
 4 files changed, 685 insertions(+)
 create mode 100644 drivers/clk/sunxi-ng/ccu-sun8i-b288.c
 create mode 100644 drivers/clk/sunxi-ng/ccu-sun8i-b288.h
drivers/clk/sunxi-ng/Kconfig +5 -0
index 6af2d020e03e..5bdfb8574794 100644
@@ -88,6 +88,11 @@ config SUN6I_RTC_CCU
 	default ARCH_SUNXI
 	depends on MACH_SUN8I || ARM64 || RISCV || COMPILE_TEST
 
+config SUN8I_B288_CCU
+	tristate "Support for the Allwinner B288 CCU"
+	default ARCH_SUNXI
+	depends on MACH_SUN8I || COMPILE_TEST
+
 config SUN8I_A23_CCU
 	tristate "Support for the Allwinner A23 CCU"
 	default ARCH_SUNXI
drivers/clk/sunxi-ng/Makefile +1 -0
index a1c4087d7241..dcc377a09ccc 100644
@@ -40,6 +40,7 @@ obj-$(CONFIG_SUN4I_A10_CCU)	+= sun4i-a10-ccu.o
 obj-$(CONFIG_SUN5I_CCU)		+= sun5i-ccu.o
 obj-$(CONFIG_SUN6I_A31_CCU)	+= sun6i-a31-ccu.o
 obj-$(CONFIG_SUN6I_RTC_CCU)	+= sun6i-rtc-ccu.o
+obj-$(CONFIG_SUN8I_B288_CCU)	+= ccu-sun8i-b288.o
 obj-$(CONFIG_SUN8I_A23_CCU)	+= sun8i-a23-ccu.o
 obj-$(CONFIG_SUN8I_A33_CCU)	+= sun8i-a33-ccu.o
 obj-$(CONFIG_SUN8I_A83T_CCU)	+= sun8i-a83t-ccu.o
drivers/clk/sunxi-ng/ccu-sun8i-b288.c new file +669 -0

669 lines not on this page · raw message

drivers/clk/sunxi-ng/ccu-sun8i-b288.h new file +10 -0
new file mode 100644
index 000000000000..805df2d6d99c
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _CCU_SUN8I_B288_H_
+#define _CCU_SUN8I_B288_H_
+
+#include <dt-bindings/clock/sun8i-b288-ccu.h>
+#include <dt-bindings/reset/sun8i-b288-ccu.h>
+
+#define CLK_NUMBER		(CLK_MMC1_OUTPUT + 1)
+
+#endif /* _CCU_SUN8I_B288_H_ */
Signature · 1 line
2.53.0
#3 lore raw

PATCH 3/11 dt-bindings: pinctrl: add Allwinner B288 pin controller

In reply to Pablo Mazzini

One controller at 0x01c20800 with four external interrupt banks.

---
 .../pinctrl/allwinner,sun8i-b288-pinctrl.yaml | 108 ++++++++++++++++++
 1 file changed, 108 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/allwinner,sun8i-b288-pinctrl.yaml
Documentation/devicetree/bindings/pinctrl/allwinner,sun8i-b288-pinctrl.yaml new file +108 -0
new file mode 100644
index 000000000000..806da97ab708
@@ -0,0 +1,108 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/allwinner,sun8i-b288-pinctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Allwinner B288 Pin Controller
+
+maintainers:
+  - Chen-Yu Tsai <[email protected]>
+  - Jernej Skrabec <[email protected]>
+
+properties:
+  compatible:
+    const: allwinner,sun8i-b288-pinctrl
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    description:
+      One interrupt per bank of external interrupt capable pins.
+    maxItems: 4
+
+  clocks:
+    items:
+      - description: Bus Clock
+      - description: High Frequency Oscillator
+      - description: Low Frequency Oscillator
+
+  clock-names:
+    items:
+      - const: apb
+      - const: hosc
+      - const: losc
+
+  gpio-controller: true
+  interrupt-controller: true
+  gpio-line-names: true
+
+  "#gpio-cells":
+    const: 3
+
+  "#interrupt-cells":
+    const: 3
+
+patternProperties:
+  "-pins$":
+    type: object
+    $ref: /schemas/pinctrl/pincfg-node.yaml#
+    additionalProperties: false
+
+    properties:
+      pins: true
+      function: true
+      bias-pull-up: true
+      bias-pull-down: true
+      bias-disable: true
+      drive-strength:
+        enum: [10, 20, 30, 40]
+
+    required:
+      - pins
+      - function
+
+  "^vcc-p[bcdfg]-supply$":
+    description:
+      Power supplies for pin banks.
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+  - gpio-controller
+  - "#gpio-cells"
+  - interrupt-controller
+  - "#interrupt-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/sun8i-b288-ccu.h>
+
+    pio: pinctrl@1c20800 {
+        compatible = "allwinner,sun8i-b288-pinctrl";
+        reg = <0x01c20800 0x400>;
+        interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
+        clocks = <&ccu CLK_BUS_PIO>, <&osc24M>, <&osc32k>;
+        clock-names = "apb", "hosc", "losc";
+        gpio-controller;
+        #gpio-cells = <3>;
+        interrupt-controller;
+        #interrupt-cells = <3>;
+
+        mmc0_pins: mmc0-pins {
+            pins = "PF0", "PF1", "PF2", "PF3", "PF4", "PF5";
+            function = "sdc0";
+            drive-strength = <30>;
+            bias-pull-up;
+        };
+    };
Signature · 1 line
2.53.0
#7 lore raw

PATCH 4/11 pinctrl: sunxi: add Allwinner B288 pin controller driver

In reply to Pablo Mazzini

78 pins across ports B, C, D, F and G. PH0 is BSP FPGA-only and omitted.

---
 drivers/pinctrl/sunxi/Kconfig              |  10 +
 drivers/pinctrl/sunxi/Makefile             |   1 +
 drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c | 623 +++++++++++++++++++++
 3 files changed, 634 insertions(+)
 create mode 100644 drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c
drivers/pinctrl/sunxi/Kconfig +10 -0
index dc62eba96348..a08186133090 100644
@@ -56,6 +56,16 @@ config PINCTRL_SUN8I_A23_R
 	default MACH_SUN8I
 	select PINCTRL_SUNXI
 
+config PINCTRL_SUN8I_B288
+	bool "Support for the Allwinner B288 PIO"
+	default MACH_SUN8I
+	select PINCTRL_SUNXI
+	help
+	  Say Y here to enable pin controller and GPIO support for the
+	  Allwinner B288 (sun8iw10p1) SoC, as used in e-book readers such
+	  as the PocketBook Verse. This covers ports B, C, D, F and G,
+	  including the four banks of external interrupt capable pins.
+
 config PINCTRL_SUN8I_H3
 	bool "Support for the Allwinner H3 PIO"
 	default MACH_SUN8I
drivers/pinctrl/sunxi/Makefile +1 -0
index 951b3f1e4b4f..5129c0f19f3e 100644
@@ -18,6 +18,7 @@ obj-$(CONFIG_PINCTRL_SUN50I_A100)	+= pinctrl-sun50i-a100.o
 obj-$(CONFIG_PINCTRL_SUN50I_A100_R)	+= pinctrl-sun50i-a100-r.o
 obj-$(CONFIG_PINCTRL_SUN8I_A83T)	+= pinctrl-sun8i-a83t.o
 obj-$(CONFIG_PINCTRL_SUN8I_A83T_R)	+= pinctrl-sun8i-a83t-r.o
+obj-$(CONFIG_PINCTRL_SUN8I_B288)	+= pinctrl-sun8i-b288.o
 obj-$(CONFIG_PINCTRL_SUN8I_H3)		+= pinctrl-sun8i-h3.o
 obj-$(CONFIG_PINCTRL_SUN8I_H3_R)	+= pinctrl-sun8i-h3-r.o
 obj-$(CONFIG_PINCTRL_SUN8I_V3S)		+= pinctrl-sun8i-v3s.o
drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c new file +623 -0

623 lines not on this page · raw message

Signature · 1 line
2.53.0
#12 lore raw

PATCH 5/11 dt-bindings: rtc: sun6i-a31: add Allwinner B288

In reply to Pablo Mazzini

The B288 RTC wires one alarm interrupt, not two.

---
 .../devicetree/bindings/rtc/allwinner,sun6i-a31-rtc.yaml        | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/rtc/allwinner,sun6i-a31-rtc.yaml +2 -0
index f2b91186ed37..1699e3576b91 100644
@@ -19,6 +19,7 @@ properties:
       - enum:
           - allwinner,sun6i-a31-rtc
           - allwinner,sun8i-a23-rtc
+          - allwinner,sun8i-b288-rtc
           - allwinner,sun8i-h3-rtc
           - allwinner,sun8i-r40-rtc
           - allwinner,sun8i-v3-rtc
@@ -162,6 +163,7 @@ allOf:
         compatible:
           contains:
             enum:
+              - allwinner,sun8i-b288-rtc
               - allwinner,sun8i-r40-rtc
               - allwinner,sun50i-h616-rtc
               - allwinner,sun50i-r329-rtc
Signature · 1 line
2.53.0
#14 lore raw

PATCH 6/11 rtc: sun6i: add Allwinner B288 compatible

In reply to Pablo Mazzini

The driver only uses one alarm interrupt, so no functional change.

---
 drivers/rtc/rtc-sun6i.c | 1 +
 1 file changed, 1 insertion(+)
drivers/rtc/rtc-sun6i.c +1 -0
index 7fc60880e409..cd6ac5bb20cd 100644
@@ -859,6 +859,7 @@ static int sun6i_rtc_probe(struct platform_device *pdev)
 static const struct of_device_id sun6i_rtc_dt_ids[] = {
 	{ .compatible = "allwinner,sun6i-a31-rtc" },
 	{ .compatible = "allwinner,sun8i-a23-rtc" },
+	{ .compatible = "allwinner,sun8i-b288-rtc" },
 	{ .compatible = "allwinner,sun8i-h3-rtc" },
 	{ .compatible = "allwinner,sun8i-r40-rtc" },
 	{ .compatible = "allwinner,sun8i-v3-rtc" },
Signature · 1 line
2.53.0
#16 lore raw

PATCH 7/11 dt-bindings: i2c: mv64xxx: add Allwinner B288

In reply to Pablo Mazzini

The B288 controller follows the existing Allwinner variant.

---
 Documentation/devicetree/bindings/i2c/marvell,mv64xxx-i2c.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/i2c/marvell,mv64xxx-i2c.yaml +1 -0
index c4efcef59133..d3b6f7668621 100644
@@ -21,6 +21,7 @@ properties:
           - enum:
               - allwinner,suniv-f1c100s-i2c
               - allwinner,sun8i-a23-i2c
+              - allwinner,sun8i-b288-i2c
               - allwinner,sun8i-a83t-i2c
               - allwinner,sun8i-v536-i2c
               - allwinner,sun50i-a64-i2c
Signature · 1 line
2.53.0
#17 lore raw

PATCH 8/11 dt-bindings: mmc: sun4i-a10-mmc: add Allwinner B288

In reply to Pablo Mazzini

Add the MMC and eMMC compatibles.

---
 .../devicetree/bindings/mmc/allwinner,sun4i-a10-mmc.yaml        | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/mmc/allwinner,sun4i-a10-mmc.yaml +2 -0
index 9e9610bb1eda..c2ec7151dccf 100644
@@ -32,10 +32,12 @@ properties:
       - items:
           - enum:
               - allwinner,sun8i-a83t-mmc
+              - allwinner,sun8i-b288-mmc
               - allwinner,suniv-f1c100s-mmc
           - const: allwinner,sun7i-a20-mmc
       - items:
           - enum:
+              - allwinner,sun8i-b288-emmc
               - allwinner,sun8i-r40-emmc
               - allwinner,sun50i-h5-emmc
               - allwinner,sun50i-h6-emmc
Signature · 1 line
2.53.0
#18 lore raw

PATCH 9/11 dt-bindings: interrupt-controller: add Allwinner B288 NMI

In reply to Pablo Mazzini

Same register layout as the sun9i-a80 NMI, like the V3s.

---
 .../interrupt-controller/allwinner,sun7i-a20-sc-nmi.yaml         | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/interrupt-controller/allwinner,sun7i-a20-sc-nmi.yaml +1 -0
index bb9273ec2457..179e7842bf46 100644
@@ -29,6 +29,7 @@ properties:
       - const: allwinner,sun55i-a523-nmi
       - items:
           - enum:
+              - allwinner,sun8i-b288-nmi
               - allwinner,sun8i-v3s-nmi
               - allwinner,sun50i-a100-nmi
               - allwinner,sun50i-h616-nmi
Signature · 1 line
2.53.0
#19 lore raw

PATCH 10/11 dt-bindings: arm: sunxi: add PocketBook Verse

In reply to Pablo Mazzini

A 6" e-book reader built around the Allwinner B288.

---
 Documentation/devicetree/bindings/arm/sunxi.yaml | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/arm/sunxi.yaml +5 -0
index f04db28c630a..f66c681d3788 100644
@@ -811,6 +811,11 @@ properties:
           - const: pocketbook,614-plus
           - const: allwinner,sun5i-a13
 
+      - description: PocketBook Verse (PB629)
+        items:
+          - const: pocketbook,verse
+          - const: allwinner,sun8i-b288
+
       - description: Point of View Protab2-IPS9
         items:
           - const: pov,protab2-ips9
Signature · 1 line
2.53.0
#21 lore raw

PATCH 11/11 ARM: sunxi: add B288 and the PocketBook Verse board

In reply to Pablo Mazzini

arm,cpu-registers-not-fw-configured is required: Allwinner's boot0 sets neither CNTFRQ nor CNTVOFF, so the virtual timer storms. Same reason as commit 121b96cd9d7e ("ARM: sun6i: Enable ARM arch timers").

The watchdog interrupt was measured on hardware via GICD_ISPENDR.

---
 arch/arm/boot/dts/allwinner/Makefile          |   1 +
 .../allwinner/sun8i-b288-pocketbook-verse.dts | 122 +++++++
 arch/arm/boot/dts/allwinner/sun8i-b288.dtsi   | 300 ++++++++++++++++++
 arch/arm/mach-sunxi/sunxi.c                   |   1 +
 4 files changed, 424 insertions(+)
 create mode 100644 arch/arm/boot/dts/allwinner/sun8i-b288-pocketbook-verse.dts
 create mode 100644 arch/arm/boot/dts/allwinner/sun8i-b288.dtsi
arch/arm/boot/dts/allwinner/Makefile +1 -0
index 75b2b6a2f7a6..2dfdc01e4825 100644
@@ -227,6 +227,7 @@ dtb-$(CONFIG_MACH_SUN8I) += \
 	sun8i-a83t-bananapi-m3.dtb \
 	sun8i-a83t-cubietruck-plus.dtb \
 	sun8i-a83t-tbs-a711.dtb \
+	sun8i-b288-pocketbook-verse.dtb \
 	sun8i-h2-plus-bananapi-m2-zero.dtb \
 	sun8i-h2-plus-libretech-all-h3-cc.dtb \
 	sun8i-h2-plus-orangepi-r1.dtb \
arch/arm/boot/dts/allwinner/sun8i-b288-pocketbook-verse.dts new file +122 -0

122 lines not on this page · raw message

arch/arm/boot/dts/allwinner/sun8i-b288.dtsi new file +300 -0

300 lines not on this page · raw message

arch/arm/mach-sunxi/sunxi.c +1 -0
index e1b7945aac99..c5b19d0e63f9 100644
@@ -61,6 +61,7 @@ MACHINE_END
 static const char * const sun8i_board_dt_compat[] = {
 	"allwinner,sun8i-a23",
 	"allwinner,sun8i-a33",
+	"allwinner,sun8i-b288",
 	"allwinner,sun8i-h2-plus",
 	"allwinner,sun8i-h3",
 	"allwinner,sun8i-r40",
Signature · 1 line
2.53.0
#13 lore raw

Re: [PATCH v1 05/11] dt-bindings: rtc: sun6i-a31: add Allwinner B288

In reply to Pablo Mazzini
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] dt-bindings: missing clock-output-names schema constraint for b288 --

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] dt-bindings: missing clock-output-names schema constraint for b288 --

commit d061a16a5e55b66a00315843c7f4655412cd0e5f
Author: Pablo Mazzini <[email protected]>

dt-bindings: rtc: sun6i-a31: add Allwinner B288

The B288 RTC wires one alarm interrupt, not two.

Quoted 12 lines
Documentation/devicetree/bindings/rtc/allwinner,sun6i-a31-rtc.yaml +1 -0
index f2b91186ed377..1699e3576b915 100644
@@ -19,6 +19,7 @@ properties:
       - enum:
           - allwinner,sun6i-a31-rtc
           - allwinner,sun8i-a23-rtc
+          - allwinner,sun8i-b288-rtc
           - allwinner,sun8i-h3-rtc
           - allwinner,sun8i-r40-rtc
           - allwinner,sun8i-v3-rtc

[ ... ]

Documentation/devicetree/bindings/rtc/allwinner,sun6i-a31-rtc.yaml allOf: · line 169

Quoted 8 lines
Documentation/devicetree/bindings/rtc/allwinner,sun6i-a31-rtc.yaml +1 -0
@@ -162,6 +163,7 @@ allOf:
         compatible:
           contains:
             enum:
+              - allwinner,sun8i-b288-rtc
               - allwinner,sun8i-r40-rtc
               - allwinner,sun50i-h616-rtc
               - allwinner,sun50i-r329-rtc

[Severity: Low]
Does this new b288 compatible string also need to be added to one of the clock-output-names conditional blocks?

It is added here for the interrupts constraint, but omitted from the if blocks managing clock-output-names. Without an explicit block for the b288, invalid device trees specifying the wrong number of clocks might silently pass validation due to the generic top-level fallback limits.

For example, other variants in this file are explicitly constrained:

allOf:
- if:
properties:
compatible:
contains:
enum:
- allwinner,sun8i-a23-rtc
- allwinner,sun8i-r40-rtc
- allwinner,sun8i-v3-rtc
then:
properties:
clock-output-names:
minItems: 2
maxItems: 2

Should a similar constraint (or false) be applied for the b288 variant?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5
#8 lore raw

Re: [PATCH v1 04/11] pinctrl: sunxi: add Allwinner B288 pin controller driver

In reply to Pablo Mazzini
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] pinctrl: sunxi: IRQ index collision for pin G3 --

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] pinctrl: sunxi: IRQ index collision for pin G3
--

commit fdee02e8823a26621c358b63abf2ff74202265b9
Author: Pablo Mazzini <[email protected]>

pinctrl: sunxi: add Allwinner B288 pin controller driver

This commit adds the pin controller and GPIO support for the Allwinner B288 SoC, covering 78 pins across ports B, C, D, F, and G, including four banks of external interrupt capable pins.

Quoted 4 lines
drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c new file +0 -0
new file mode 100644

[ ... ]

Quoted 17 lines
drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c new file +17 -0
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 1),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "pwm7"),
+		  SUNXI_FUNCTION(0x3, "dmic0"),
+		  SUNXI_FUNCTION(0x4, "spi1"),
+		  SUNXI_FUNCTION(0x5, "sdc1"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 1)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 2),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "twi1"),
+		  SUNXI_FUNCTION(0x3, "dmic0"),
+		  SUNXI_FUNCTION(0x4, "spi1"),
+		  SUNXI_FUNCTION(0x5, "sdc1"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),

drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c line 535

Quoted 10 lines
drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c new file +10 -0
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 2)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 3),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "twi1"),
+		  SUNXI_FUNCTION(0x3, "dmic0"),
+		  SUNXI_FUNCTION(0x4, "spi1"),
+		  SUNXI_FUNCTION(0x5, "sdc1"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 1)),

[Severity: Medium]
Does this incorrectly assign IRQ index 1 instead of 3 for pin G3?

It looks like SUNXI_FUNCTION_IRQ_BANK is assigning IRQ index 1 for pin G3 in the sun8i_b288_pins array, which collides with the IRQ mapping for pin G1 defined earlier. This could cause external interrupts on G3 to be incorrectly routed or to conflict with G1.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
#15 lore raw

Re: [PATCH v1 06/11] rtc: sun6i: add Allwinner B288 compatible

In reply to Pablo Mazzini
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 3 lines

The driver only uses one alarm interrupt, so no functional change.

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=6
#4 lore raw

Re: [PATCH v1 03/11] dt-bindings: pinctrl: add Allwinner B288 pin controller

In reply to Pablo Mazzini
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider: - [Medium] dt-bindings: pinctrl: missing reference to core pinctrl schema - [Medium] dt-bindings: pinctrl…

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Medium] dt-bindings: pinctrl: missing reference to core pinctrl schema
- [Medium] dt-bindings: pinctrl: missing input-debounce breaks sunxi standard feature
- [Low] dt-bindings: pinctrl: missing minItems: 4 for exact interrupt banks --

commit f5fef062c858980d1528aafec20b7e540cfb4cbb
Author: Pablo Mazzini <[email protected]>

dt-bindings: pinctrl: add Allwinner B288 pin controller

This commit introduces device tree bindings for the Allwinner B288 pin controller. It defines the required properties, clocks, interrupts, and provides an example node.

Documentation/devicetree/bindings/pinctrl/allwinner,sun8i-b288-pinctrl.yaml line 7

Quoted 13 lines
Documentation/devicetree/bindings/pinctrl/allwinner,sun8i-b288-pinctrl.yaml new file +7 -0
new file mode 100644
index 0000000000000..806da97ab708a
@@ -0,0 +1,108 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/allwinner,sun8i-b288-pinctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Allwinner B288 Pin Controller

[Severity: Medium]
Should this schema include an allOf block referencing the core pinctrl schema? Omitting the core schema reference while using
additionalProperties: false below causes schema validation to reject standard pinctrl properties (like pinctrl-names or pinctrl-0) on the provider node.

[ ... ]

Documentation/devicetree/bindings/pinctrl/allwinner,sun8i-b288-pinctrl.yaml line 23

Quoted 4 lines
Documentation/devicetree/bindings/pinctrl/allwinner,sun8i-b288-pinctrl.yaml new file +4 -0
+  interrupts:
+    description:
+      One interrupt per bank of external interrupt capable pins.
+    maxItems: 4

[Severity: Low]
Could this allow device trees with incomplete interrupt configurations (1 to 3 items) to silently pass validation? If the hardware requires exactly 4 interrupt banks, should there be a matching minItems: 4 constraint alongside maxItems: 4?

[ ... ]

Documentation/devicetree/bindings/pinctrl/allwinner,sun8i-b288-pinctrl.yaml line 81

Quoted 12 lines
Documentation/devicetree/bindings/pinctrl/allwinner,sun8i-b288-pinctrl.yaml new file +12 -0
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+  - gpio-controller
+  - "#gpio-cells"
+  - interrupt-controller
+  - "#interrupt-cells"
+
+additionalProperties: false

[Severity: Medium]
By setting additionalProperties: false here without defining input-debounce in the properties block, will this prevent device trees from configuring input debouncing? The sunxi pinctrl driver expects and parses this property for all SoC variants with external interrupts, but this schema will reject it.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
#22 lore raw

Re: [PATCH v1 11/11] ARM: sunxi: add B288 and the PocketBook Verse board

In reply to Pablo Mazzini
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [Medium] arm: sunxi: uart0 console missing pinctrl configuration - [Medium] arm: sunxi: missing…

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] arm: sunxi: uart0 console missing pinctrl configuration
- [Medium] arm: sunxi: missing enable-method and cpucfg node for Cortex-A7 SMP bringup --

commit fe74da2c07014471bb495768fef663601319d9c4
Author: Pablo Mazzini <[email protected]>

ARM: sunxi: add B288 and the PocketBook Verse board

This commit adds device tree support for the Allwinner B288 SoC and the PocketBook Verse (PB629) board. It explicitly notes that arm,cpu-registers-not-fw-configured is required due to the boot0 bootloader failing to set virtual timer registers.

Quoted 5 lines
arch/arm/boot/dts/allwinner/sun8i-b288-pocketbook-verse.dts new file +0 -0
new file mode 100644
index 0000000000000..91c89d5a097e6

[ ... ]

arch/arm/boot/dts/allwinner/sun8i-b288-pocketbook-verse.dts

Quoted 3 lines

+&uart0 {

arch/arm/boot/dts/allwinner/sun8i-b288-pocketbook-verse.dts new file +2 -0
+	status = "okay";
+};

[Severity: Medium]
Does this node need to reference the uart0_pb_pins pinctrl configuration?

The base sun8i-b288.dtsi defines uart0_pb_pins specifically to configure the pins for uart0, and this board file designates uart0 as the console UART.

Neither file assigns this pinctrl configuration to the uart0 node (for example, by adding pinctrl-names = "default"; pinctrl-0 = <&uart0_pb_pins>;).

Relying on the bootloader (like boot0 or U-Boot) to implicitly leave the pins correctly multiplexed can be brittle, and might cause the serial console to break across suspend/resume cycles where the pinctrl driver may reinitialize or power-cycle the pin banks.

[ ... ]

Quoted 5 lines
arch/arm/boot/dts/allwinner/sun8i-b288.dtsi new file +0 -0
new file mode 100644
index 0000000000000..58668d5813680

[ ... ]

Quoted 10 lines
arch/arm/boot/dts/allwinner/sun8i-b288.dtsi new file +10 -0
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		cpu0: cpu@0 {
+			compatible = "arm,cortex-a7";
+			device_type = "cpu";
+			reg = <0>;
+			clocks = <&ccu CLK_CPUX>;
+			clock-names = "cpu";

arch/arm/boot/dts/allwinner/sun8i-b288.dtsi line 53

Quoted 10 lines
arch/arm/boot/dts/allwinner/sun8i-b288.dtsi new file +10 -0
+		};
+
+		cpu1: cpu@1 {
+			compatible = "arm,cortex-a7";
+			device_type = "cpu";
+			reg = <1>;
+			clocks = <&ccu CLK_CPUX>;
+			clock-names = "cpu";
+		};
+	};

[Severity: Medium]
Will the kernel fail to bring up CPU1 without an enable-method and cpucfg node?

The commit message explicitly states the platform relies on Allwinner's proprietary boot0 bootloader, which implies it does not use TF-A and thus lacks PSCI firmware support.

On ARMv7, without PSCI, the kernel requires an enable-method property (e.g., enable-method = "allwinner,sun8i-a23") on the CPU nodes to route to the correct secondary core bringup routines in mach-sunxi/platsmp.c.

Additionally, legacy Allwinner SMP bringup requires a cpucfg hardware node to assert resets and power on the secondary cores.

Because both the enable-method property and the cpucfg node are omitted from this DT, will this degrade the dual-core SoC to a single-core system?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=11
#2 lore raw

Re: [PATCH v1 02/11] clk: sunxi-ng: add Allwinner B288 CCU driver

In reply to Pablo Mazzini
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] clk: sunxi-ng: shared gate conflict on csi bus clocks --

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] clk: sunxi-ng: shared gate conflict on csi bus clocks
--

commit ae2cfebe5340417fd7a0871fe9800b7e3353dc68
Author: Pablo Mazzini <[email protected]>

clk: sunxi-ng: add Allwinner B288 CCU driver

This commit introduces the clock control unit (CCU) driver for the Allwinner B288 SoC, covering the PLLs, CPU/AHB/APB trees, module clocks, and bus gates and resets.

Quoted 5 lines
drivers/clk/sunxi-ng/ccu-sun8i-b288.c new file +0 -0
new file mode 100644
index 0000000000000..4c3ce02878d25

[ ... ]

drivers/clk/sunxi-ng/ccu-sun8i-b288.c line 396

Quoted 9 lines
drivers/clk/sunxi-ng/ccu-sun8i-b288.c new file +9 -0
+static SUNXI_CCU_GATE(bus_tcon0_clk, "bus-tcon0", "ahb1",
+		      0x064, BIT(4), 0);
+static SUNXI_CCU_GATE(bus_csi_s_clk, "bus-csi-s", "ahb1",
+		      0x064, BIT(8), 0);
+static SUNXI_CCU_GATE(bus_csi_m_clk, "bus-csi-m", "ahb1",
+		      0x064, BIT(8), 0);
+static SUNXI_CCU_GATE(bus_csi_misc_clk, "bus-csi-misc", "ahb1",
+		      0x064, BIT(8), 0);
+static SUNXI_CCU_GATE(bus_adda_clk, "bus-adda", "apb1",

[Severity: High]
Does this create a shared gate conflict for the csi bus clocks?

These three distinct clock objects map to the exact same physical register (0x064) and gate bit (BIT(8)). Because they are declared as separate clocks, the Common Clock Framework tracks their reference counts independently.

If driver A enables the bus-csi-s clock and driver B enables the bus-csi-m clock, the shared gate will be turned on. However, if driver A subsequently disables bus-csi-s, the framework will clear the shared bit because the bus-csi-s reference count reached zero.

Could this abruptly disable the active clock for driver B, potentially causing hardware lockups, asynchronous external aborts, or device failure during standard device probe, unbind, or runtime PM sequences?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
#23 lore raw
In reply to Pablo Mazzini

Hi Pablo,

many thanks for sending this series, on a first glance this looks pretty good.
As a general comment: please add a cover letter (git format-patch ... --cover-letter, then edit the generated file), and explain a bit about the background of this work. This would be a good place to briefly describe what the B288 is, how it's related to other SoCs, how you came to all this information, the firmware story, and the existing limitations of this port.

One problem in general is the lack of access to a manual, I am not even sure we ever upstreamed SoC support without one. Especially the clock driver is quite tricky, we would love to compare the clock descriptions against some documentation.

Quoted 19 lines · Pablo Mazzini

The B288 (sun8iw10p1) is a dual Cortex-A7 SoC used in e-book readers.

---
  .../clock/allwinner,sun8i-b288-ccu.yaml       | 55 ++++++++++++
  include/dt-bindings/clock/sun8i-b288-ccu.h    | 90 +++++++++++++++++++
  include/dt-bindings/reset/sun8i-b288-ccu.h    | 45 ++++++++++
  3 files changed, 190 insertions(+)

create mode 100644 Documentation/devicetree/bindings/clock/allwinner,sun8i-b288-ccu.yaml create mode 100644 include/dt-bindings/clock/sun8i-b288-ccu.h
create mode 100644 include/dt-bindings/reset/sun8i-b288-ccu.h

Documentation/devicetree/bindings/clock/allwinner,sun8i-b288-ccu.yaml new file +1 -0
new file mode 100644
index 000000000000..22b59d5b652c
@@ -0,0 +1,55 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)

Documentation/devicetree/bindings/clock/allwinner,sun8i-b288-ccu.yaml line 11

Quoted 10 lines
Documentation/devicetree/bindings/clock/allwinner,sun8i-b288-ccu.yaml new file +10 -0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/allwinner,sun8i-b288-ccu.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Allwinner B288 Clock Control Unit
+
+maintainers:
+  - Chen-Yu Tsai <[email protected]>
+  - Maxime Ripard <[email protected]>

I am afraid you cannot push off the responsibility to other people, especially I think Maxime wouldn't be really interested any more ;-)

Actually, why do you need a separate binding? Wouldn't it be enough to just add the compatible string to the existing allwinner,sun4i-a10-ccu.yaml file? This one here looks like a subset of this, and would blend in there easily.

Cheers,
Andre

Quoted 191 lines
Documentation/devicetree/bindings/clock/allwinner,sun8i-b288-ccu.yaml new file +44 -0
+
+properties:
+  "#clock-cells":
+    const: 1
+
+  "#reset-cells":
+    const: 1
+
+  compatible:
+    const: allwinner,sun8i-b288-ccu
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: High Frequency Oscillator
+      - description: Low Frequency Oscillator
+
+  clock-names:
+    items:
+      - const: hosc
+      - const: losc
+
+required:
+  - "#clock-cells"
+  - "#reset-cells"
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+
+additionalProperties: false
+
+examples:
+  - |
+    ccu: clock-controller@1c20000 {
+        compatible = "allwinner,sun8i-b288-ccu";
+        reg = <0x01c20000 0x400>;
+        clocks = <&osc24M>, <&osc32k>;
+        clock-names = "hosc", "losc";
+        #clock-cells = <1>;
+        #reset-cells = <1>;
+    };
include/dt-bindings/clock/sun8i-b288-ccu.h new file +90 -0
new file mode 100644
index 000000000000..3dc1704d001e
@@ -0,0 +1,90 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
+#ifndef _DT_BINDINGS_CLK_SUN8I_B288_H_
+#define _DT_BINDINGS_CLK_SUN8I_B288_H_
+
+#define CLK_PLL_CPUX	0
+#define CLK_PLL_AUDIO_BASE	1
+#define CLK_PLL_VIDEO0	2
+#define CLK_PLL_DDR0	3
+#define CLK_PLL_PERIPH0	4
+#define CLK_PLL_VIDEO1	5
+#define CLK_PLL_24M	6
+#define CLK_PLL_PERIPH1	7
+#define CLK_PLL_DE	8
+#define CLK_PLL_DDR1	9
+
+#define CLK_PLL_PERIPH0_2X	10
+#define CLK_PLL_PERIPH1_2X	11
+#define CLK_CPUX	12
+#define CLK_AXI	13
+#define CLK_CPUAPB	14
+#define CLK_AHB1	15
+#define CLK_APB1	16
+#define CLK_APB2	17
+
+#define CLK_NAND	18
+#define CLK_MMC0	19
+#define CLK_MMC1	20
+#define CLK_MMC2	21
+#define CLK_MMC3	22
+#define CLK_SPI0	23
+#define CLK_SPI1	24
+#define CLK_SPI2	25
+#define CLK_DRAM	26
+#define CLK_DE	27
+#define CLK_EE	28
+#define CLK_EDMA	29
+#define CLK_TCON0	30
+#define CLK_MBUS	31
+
+#define CLK_BUS_THS	32
+#define CLK_BUS_NAND	33
+#define CLK_BUS_SDMMC0_BUS	34
+#define CLK_BUS_SDMMC1_BUS	35
+#define CLK_BUS_SDMMC2_BUS	36
+#define CLK_BUS_SDMMC3_BUS	37
+#define CLK_BUS_SPI0	38
+#define CLK_BUS_SPI1	39
+#define CLK_BUS_SPI2	40
+#define CLK_BUS_I2S0	41
+#define CLK_BUS_I2S1	42
+#define CLK_BUS_SPDIF	43
+#define CLK_BUS_DSD	44
+#define CLK_BUS_DMIC	45
+#define CLK_BUS_USBOHCI0	46
+#define CLK_BUS_USBEHCI0	47
+#define CLK_BUS_USBOTG	48
+#define CLK_BUS_DE	49
+#define CLK_BUS_EE	50
+#define CLK_BUS_TCON0	51
+#define CLK_BUS_CSI_S	52
+#define CLK_BUS_CSI_M	53
+#define CLK_BUS_CSI_MISC	54
+#define CLK_BUS_ADDA	55
+#define CLK_BUS_SDRAM	56
+#define CLK_BUS_PSRAM	57
+#define CLK_BUS_DMA	58
+#define CLK_BUS_UART0	59
+#define CLK_BUS_UART1	60
+#define CLK_BUS_UART2	61
+#define CLK_BUS_UART3	62
+#define CLK_BUS_UART4	63
+#define CLK_BUS_UART5	64
+#define CLK_BUS_TWI0	65
+#define CLK_BUS_TWI1	66
+#define CLK_BUS_TWI2	67
+#define CLK_BUS_PIO	68
+#define CLK_BUS_GPADC	69
+#define CLK_BUS_KEYADC	70
+
+/*
+ * mmc0 and mmc1 are v4p1x controllers driven in the old timing mode, which
+ * needs the sample and output phase clocks. mmc2 and mmc3 are newer blocks
+ * that do their own delay calibration and have none.
+ */
+#define CLK_MMC0_SAMPLE	71
+#define CLK_MMC0_OUTPUT	72
+#define CLK_MMC1_SAMPLE	73
+#define CLK_MMC1_OUTPUT	74
+
+#endif
include/dt-bindings/reset/sun8i-b288-ccu.h new file +45 -0
new file mode 100644
index 000000000000..675145654548
@@ -0,0 +1,45 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
+#ifndef _DT_BINDINGS_RST_SUN8I_B288_H_
+#define _DT_BINDINGS_RST_SUN8I_B288_H_
+
+#define RST_BUS_THS	0
+#define RST_BUS_NAND	1
+#define RST_BUS_MMC0	2
+#define RST_BUS_MMC1	3
+#define RST_BUS_MMC2	4
+#define RST_BUS_MMC3	5
+#define RST_BUS_SPI0	6
+#define RST_BUS_SPI1	7
+#define RST_BUS_SPI2	8
+#define RST_BUS_I2S0	9
+#define RST_BUS_I2S1	10
+#define RST_BUS_SPDIF	11
+#define RST_BUS_DSD	12
+#define RST_BUS_DMIC	13
+#define RST_USBPHY0	14
+#define RST_BUS_OHCI0	15
+#define RST_BUS_EHCI0	16
+#define RST_BUS_OTG	17
+#define RST_BUS_DE	18
+#define RST_BUS_EE	19
+#define RST_BUS_TCON0	20
+#define RST_BUS_CSI	21
+#define RST_BUS_ADDA	22
+#define RST_BUS_WLAN	23
+#define RST_MBUS	24
+#define RST_BUS_DRAM	25
+#define RST_BUS_PSRAM	26
+#define RST_BUS_DMA	27
+#define RST_BUS_UART0	28
+#define RST_BUS_UART1	29
+#define RST_BUS_UART2	30
+#define RST_BUS_UART3	31
+#define RST_BUS_UART4	32
+#define RST_BUS_UART5	33
+#define RST_BUS_I2C0	34
+#define RST_BUS_I2C1	35
+#define RST_BUS_I2C2	36
+#define RST_BUS_GPADC	37
+#define RST_BUS_KEYADC	38
+
+#endif
#5 lore raw

Re: [PATCH v1 03/11] dt-bindings: pinctrl: add Allwinner B288 pin controller

In reply to Pablo Mazzini

Hi Pablo,

Quoted 5 lines · Pablo Mazzini

One controller at 0x01c20800 with four external interrupt banks.

---
  .../pinctrl/allwinner,sun8i-b288-pinctrl.yaml | 108 ++++++++++++++++++

Why is this a new file? Can't you just add the new compatible string to the existing allwinner,sun4i-a10-pinctrl.yaml binding?

Cheers,
Andre

P.S. Since we have seen this a lot lately: please wait with a new version of your series for a few days, to allow other people to comment, and to allow discussions to settle down. Not everyone can respond quickly.

Quoted 117 lines
  1 file changed, 108 insertions(+)

create mode 100644 Documentation/devicetree/bindings/pinctrl/allwinner,sun8i-b288-pinctrl.yaml

Documentation/devicetree/bindings/pinctrl/allwinner,sun8i-b288-pinctrl.yaml new file +108 -0
new file mode 100644
index 000000000000..806da97ab708
@@ -0,0 +1,108 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/allwinner,sun8i-b288-pinctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Allwinner B288 Pin Controller
+
+maintainers:
+  - Chen-Yu Tsai <[email protected]>
+  - Jernej Skrabec <[email protected]>
+
+properties:
+  compatible:
+    const: allwinner,sun8i-b288-pinctrl
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    description:
+      One interrupt per bank of external interrupt capable pins.
+    maxItems: 4
+
+  clocks:
+    items:
+      - description: Bus Clock
+      - description: High Frequency Oscillator
+      - description: Low Frequency Oscillator
+
+  clock-names:
+    items:
+      - const: apb
+      - const: hosc
+      - const: losc
+
+  gpio-controller: true
+  interrupt-controller: true
+  gpio-line-names: true
+
+  "#gpio-cells":
+    const: 3
+
+  "#interrupt-cells":
+    const: 3
+
+patternProperties:
+  "-pins$":
+    type: object
+    $ref: /schemas/pinctrl/pincfg-node.yaml#
+    additionalProperties: false
+
+    properties:
+      pins: true
+      function: true
+      bias-pull-up: true
+      bias-pull-down: true
+      bias-disable: true
+      drive-strength:
+        enum: [10, 20, 30, 40]
+
+    required:
+      - pins
+      - function
+
+  "^vcc-p[bcdfg]-supply$":
+    description:
+      Power supplies for pin banks.
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+  - gpio-controller
+  - "#gpio-cells"
+  - interrupt-controller
+  - "#interrupt-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/sun8i-b288-ccu.h>
+
+    pio: pinctrl@1c20800 {
+        compatible = "allwinner,sun8i-b288-pinctrl";
+        reg = <0x01c20800 0x400>;
+        interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
+        clocks = <&ccu CLK_BUS_PIO>, <&osc24M>, <&osc32k>;
+        clock-names = "apb", "hosc", "losc";
+        gpio-controller;
+        #gpio-cells = <3>;
+        interrupt-controller;
+        #interrupt-cells = <3>;
+
+        mmc0_pins: mmc0-pins {
+            pins = "PF0", "PF1", "PF2", "PF3", "PF4", "PF5";
+            function = "sdc0";
+            drive-strength = <30>;
+            bias-pull-up;
+        };
+    };
#9 lore raw

Re: [PATCH v1 04/11] pinctrl: sunxi: add Allwinner B288 pin controller driver

In reply to Pablo Mazzini

Hi,

many thanks for going through the task of creating this table - though I think you wouldn't need to do this anymore, since we now have another way of describing pins, which avoids this lenghty table in the driver:
look at pinctrl-sun55i-a523.c for an example.

This would allow the "driver" to be a mere high level description, and leave the mux values to the DT.

That being said: it's good to have that info, for the lack of a manual.
Can you by any chance try to make a table out of it and put it into our wiki (https://linux-sunxi.org/B288)? That would then be the replacement for the manual. Maybe write a small tool to convert this data struct into Wiki table format.

Some general things inline ...

Quoted 65 lines · Pablo Mazzini

78 pins across ports B, C, D, F and G. PH0 is BSP FPGA-only and omitted.

---
  drivers/pinctrl/sunxi/Kconfig              |  10 +
  drivers/pinctrl/sunxi/Makefile             |   1 +
  drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c | 623 +++++++++++++++++++++
  3 files changed, 634 insertions(+)

create mode 100644 drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c

drivers/pinctrl/sunxi/Kconfig +10 -0
index dc62eba96348..a08186133090 100644
@@ -56,6 +56,16 @@ config PINCTRL_SUN8I_A23_R
  	default MACH_SUN8I
  	select PINCTRL_SUNXI
 
+config PINCTRL_SUN8I_B288
+	bool "Support for the Allwinner B288 PIO"
+	default MACH_SUN8I
+	select PINCTRL_SUNXI
+	help
+	  Say Y here to enable pin controller and GPIO support for the
+	  Allwinner B288 (sun8iw10p1) SoC, as used in e-book readers such
+	  as the PocketBook Verse. This covers ports B, C, D, F and G,
+	  including the four banks of external interrupt capable pins.
+
  config PINCTRL_SUN8I_H3
  	bool "Support for the Allwinner H3 PIO"
  	default MACH_SUN8I
drivers/pinctrl/sunxi/Makefile +1 -0
index 951b3f1e4b4f..5129c0f19f3e 100644
@@ -18,6 +18,7 @@ obj-$(CONFIG_PINCTRL_SUN50I_A100)	+= pinctrl-sun50i-a100.o
  obj-$(CONFIG_PINCTRL_SUN50I_A100_R)	+= pinctrl-sun50i-a100-r.o
  obj-$(CONFIG_PINCTRL_SUN8I_A83T)	+= pinctrl-sun8i-a83t.o
  obj-$(CONFIG_PINCTRL_SUN8I_A83T_R)	+= pinctrl-sun8i-a83t-r.o
+obj-$(CONFIG_PINCTRL_SUN8I_B288)	+= pinctrl-sun8i-b288.o
  obj-$(CONFIG_PINCTRL_SUN8I_H3)		+= pinctrl-sun8i-h3.o
  obj-$(CONFIG_PINCTRL_SUN8I_H3_R)	+= pinctrl-sun8i-h3-r.o
  obj-$(CONFIG_PINCTRL_SUN8I_V3S)		+= pinctrl-sun8i-v3s.o
drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c new file +16 -0
new file mode 100644
index 000000000000..ffd7eef68d19
@@ -0,0 +1,623 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Allwinner B288 (sun8iw10p1) SoC pinctrl driver.
+ *
+ * Derived from Allwinner's BSP driver pinctrl-sun8iw10p1.c, which is:
+ * Copyright (C) 2014 Jackie Hwang <[email protected]>
+ *
+ * Based on pinctrl-sun8i-a23.c, which is:
+ * Copyright (C) 2014 Chen-Yu Tsai <[email protected]>
+ * Copyright (C) 2014 Maxime Ripard <[email protected]>
+ */
+
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/of.h>
+#include <linux/pinctrl/pinctrl.h>

drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c line 26

Quoted 10 lines
drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c new file +10 -0
+
+#include "pinctrl-sunxi.h"
+
+static const struct sunxi_desc_pin sun8i_b288_pins[] = {
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 0),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "uart2"),
+		  SUNXI_FUNCTION(0x3, "jtag0"),
+		  SUNXI_FUNCTION(0x5, "vdevice"),

What's vdevice? I don't think we used to describe those weird functions.

drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c line 27

Quoted 1 line
drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c new file +1 -0
+		  SUNXI_FUNCTION(0x7, "io_disabled"),

I know Allwinner does this, but we do not describe the HighZ mux, it's all 1's anyway, and the same for all pins.

Those comments are probably irrelevant if you go with the new pinctrl driver style. Most of the settings there should be straightforward to figure out, just remember to add an IRQ map, to account for the missing interrupts on PortC.

Cheers,
Andre

Quoted 596 lines
drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c new file +596 -0
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 0)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 1),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "uart2"),
+		  SUNXI_FUNCTION(0x3, "jtag0"),
+		  SUNXI_FUNCTION(0x4, "spdif0"),
+		  SUNXI_FUNCTION(0x5, "vdevice"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 1)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 2),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "uart2"),
+		  SUNXI_FUNCTION(0x3, "jtag0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 2)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 3),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "uart2"),
+		  SUNXI_FUNCTION(0x3, "jtag0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 3)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 4),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "uart0"),
+		  SUNXI_FUNCTION(0x3, "pwm0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 4)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 5),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "uart0"),
+		  SUNXI_FUNCTION(0x3, "pwm1"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 5)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 6),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "twi0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 6)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 7),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "twi0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 7)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 10),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "spi1"),
+		  SUNXI_FUNCTION(0x3, "uart4"),
+		  SUNXI_FUNCTION(0x4, "pwm2"),
+		  SUNXI_FUNCTION(0x5, "wifi_uart0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 10)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 11),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "spi1"),
+		  SUNXI_FUNCTION(0x3, "uart4"),
+		  SUNXI_FUNCTION(0x4, "pwm3"),
+		  SUNXI_FUNCTION(0x5, "wifi_uart0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 11)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 12),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "i2s1"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 12)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 13),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "i2s1"),
+		  SUNXI_FUNCTION(0x4, "pwm4"),
+		  SUNXI_FUNCTION(0x5, "uart3"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 13)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 14),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "i2s1"),
+		  SUNXI_FUNCTION(0x4, "pwm5"),
+		  SUNXI_FUNCTION(0x5, "uart3"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 14)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 15),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "i2s1"),
+		  SUNXI_FUNCTION(0x3, "ac0"),
+		  SUNXI_FUNCTION(0x4, "twi1"),
+		  SUNXI_FUNCTION(0x5, "uart3"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 15)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 16),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "i2s1"),
+		  SUNXI_FUNCTION(0x3, "ac0"),
+		  SUNXI_FUNCTION(0x4, "twi1"),
+		  SUNXI_FUNCTION(0x5, "uart3"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 16)),
+	/*Hole*/
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 0),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "nand0"),
+		  SUNXI_FUNCTION(0x4, "spi0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled")),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 1),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "nand0"),
+		  SUNXI_FUNCTION(0x3, "sdc2"),
+		  SUNXI_FUNCTION(0x4, "spi0"),
+		  SUNXI_FUNCTION(0x5, "sdc3"),
+		  SUNXI_FUNCTION(0x7, "io_disabled")),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 2),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "nand0"),
+		  SUNXI_FUNCTION(0x4, "spi0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled")),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 3),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "nand0"),
+		  SUNXI_FUNCTION(0x4, "spi0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled")),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 4),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "nand0"),
+		  SUNXI_FUNCTION(0x3, "sdc2"),
+		  SUNXI_FUNCTION(0x5, "sdc3"),
+		  SUNXI_FUNCTION(0x7, "io_disabled")),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 5),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "nand0"),
+		  SUNXI_FUNCTION(0x3, "sdc2"),
+		  SUNXI_FUNCTION(0x5, "sdc3"),
+		  SUNXI_FUNCTION(0x7, "io_disabled")),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 6),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "nand0"),
+		  SUNXI_FUNCTION(0x3, "sdc2"),
+		  SUNXI_FUNCTION(0x4, "uart1"),
+		  SUNXI_FUNCTION(0x5, "sdc3"),
+		  SUNXI_FUNCTION(0x7, "io_disabled")),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 7),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "nand0"),
+		  SUNXI_FUNCTION(0x3, "sdc2"),
+		  SUNXI_FUNCTION(0x4, "uart1"),
+		  SUNXI_FUNCTION(0x5, "sdc3"),
+		  SUNXI_FUNCTION(0x7, "io_disabled")),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 8),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "nand0"),
+		  SUNXI_FUNCTION(0x3, "sdc2"),
+		  SUNXI_FUNCTION(0x4, "uart1"),
+		  SUNXI_FUNCTION(0x5, "sdc3"),
+		  SUNXI_FUNCTION(0x7, "io_disabled")),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 9),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "nand0"),
+		  SUNXI_FUNCTION(0x3, "sdc2"),
+		  SUNXI_FUNCTION(0x4, "uart1"),
+		  SUNXI_FUNCTION(0x5, "sdc3"),
+		  SUNXI_FUNCTION(0x7, "io_disabled")),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 10),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "nand0"),
+		  SUNXI_FUNCTION(0x3, "sdc2"),
+		  SUNXI_FUNCTION(0x4, "uart1"),
+		  SUNXI_FUNCTION(0x5, "sdc3"),
+		  SUNXI_FUNCTION(0x7, "io_disabled")),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 11),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "nand0"),
+		  SUNXI_FUNCTION(0x3, "sdc2"),
+		  SUNXI_FUNCTION(0x4, "uart1"),
+		  SUNXI_FUNCTION(0x5, "sdc3"),
+		  SUNXI_FUNCTION(0x7, "io_disabled")),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 12),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "nand0"),
+		  SUNXI_FUNCTION(0x3, "sdc2"),
+		  SUNXI_FUNCTION(0x4, "uart1"),
+		  SUNXI_FUNCTION(0x5, "sdc3"),
+		  SUNXI_FUNCTION(0x7, "io_disabled")),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 13),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "nand0"),
+		  SUNXI_FUNCTION(0x3, "sdc2"),
+		  SUNXI_FUNCTION(0x4, "uart1"),
+		  SUNXI_FUNCTION(0x5, "sdc3"),
+		  SUNXI_FUNCTION(0x7, "io_disabled")),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 14),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "nand0"),
+		  SUNXI_FUNCTION(0x3, "sdc2"),
+		  SUNXI_FUNCTION(0x5, "sdc3"),
+		  SUNXI_FUNCTION(0x7, "io_disabled")),
+	/* Hole */
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 0),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "lcd0"),
+		  SUNXI_FUNCTION(0x3, "uart1"),
+		  SUNXI_FUNCTION(0x4, "csi0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 0)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 1),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "lcd0"),
+		  SUNXI_FUNCTION(0x3, "uart1"),
+		  SUNXI_FUNCTION(0x4, "csi0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 1)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 2),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "lcd0"),
+		  SUNXI_FUNCTION(0x3, "uart5"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 2)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 3),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "lcd0"),
+		  SUNXI_FUNCTION(0x3, "uart5"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 3)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 4),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "lcd0"),
+		  SUNXI_FUNCTION(0x3, "uart5"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 4)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 5),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "lcd0"),
+		  SUNXI_FUNCTION(0x3, "uart5"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 5)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 6),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "lcd0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 6)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 7),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "lcd0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 7)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 8),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "lcd0"),
+		  SUNXI_FUNCTION(0x3, "uart1"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 8)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 9),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "lcd0"),
+		  SUNXI_FUNCTION(0x3, "uart1"),
+		  SUNXI_FUNCTION(0x4, "csi0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 9)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 10),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "lcd0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 10)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 11),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "lcd0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 11)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 12),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "lcd0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 12)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 13),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "lcd0"),
+		  SUNXI_FUNCTION(0x4, "csi0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 13)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 14),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "lcd0"),
+		  SUNXI_FUNCTION(0x4, "csi0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 14)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 15),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "lcd0"),
+		  SUNXI_FUNCTION(0x4, "csi0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 15)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 16),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "lcd0"),
+		  SUNXI_FUNCTION(0x4, "csi0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 16)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 17),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "lcd0"),
+		  SUNXI_FUNCTION(0x4, "csi0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 17)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 18),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "lcd0"),
+		  SUNXI_FUNCTION(0x4, "csi0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 18)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 19),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "lcd0"),
+		  SUNXI_FUNCTION(0x4, "csi0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 19)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 20),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "lcd0"),
+		  SUNXI_FUNCTION(0x4, "csi0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 20)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 21),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "lcd0"),
+		  SUNXI_FUNCTION(0x4, "csi0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 21)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 22),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "lcd0"),
+		  SUNXI_FUNCTION(0x4, "csi0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 22)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 23),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "lcd0"),
+		  SUNXI_FUNCTION(0x4, "csi0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 23)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 24),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "lcd0"),
+		  SUNXI_FUNCTION(0x3, "spi2"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 24)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 25),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "lcd0"),
+		  SUNXI_FUNCTION(0x3, "spi2"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 25)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 26),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "lcd0"),
+		  SUNXI_FUNCTION(0x3, "spi2"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 26)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 27),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "lcd0"),
+		  SUNXI_FUNCTION(0x3, "spi2"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 27)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 28),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "pwm0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 28)),
+
+	/* Hole */
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 0),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "sdc0"),
+		  SUNXI_FUNCTION(0x4, "jtag0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 0)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 1),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "sdc0"),
+		  SUNXI_FUNCTION(0x4, "jtag0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 1)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 2),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "sdc0"),
+		  SUNXI_FUNCTION(0x4, "uart0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 2)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 3),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "sdc0"),
+		  SUNXI_FUNCTION(0x4, "jtag0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 3)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 4),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "sdc0"),
+		  SUNXI_FUNCTION(0x4, "uart0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 4)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 5),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "sdc0"),
+		  SUNXI_FUNCTION(0x4, "jtag0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 5)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 6),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 6)),
+
+	/* Hole */
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 0),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "pwm6"),
+		  SUNXI_FUNCTION(0x3, "dmic0"),
+		  SUNXI_FUNCTION(0x4, "spi1"),
+		  SUNXI_FUNCTION(0x5, "sdc1"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 0)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 1),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "pwm7"),
+		  SUNXI_FUNCTION(0x3, "dmic0"),
+		  SUNXI_FUNCTION(0x4, "spi1"),
+		  SUNXI_FUNCTION(0x5, "sdc1"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 1)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 2),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "twi1"),
+		  SUNXI_FUNCTION(0x3, "dmic0"),
+		  SUNXI_FUNCTION(0x4, "spi1"),
+		  SUNXI_FUNCTION(0x5, "sdc1"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 2)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 3),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "twi1"),
+		  SUNXI_FUNCTION(0x3, "dmic0"),
+		  SUNXI_FUNCTION(0x4, "spi1"),
+		  SUNXI_FUNCTION(0x5, "sdc1"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 1)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 4),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "twi2"),
+		  SUNXI_FUNCTION(0x3, "dmic0"),
+		  SUNXI_FUNCTION(0x4, "spi1"),
+		  SUNXI_FUNCTION(0x5, "sdc1"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 4)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 5),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "twi2"),
+		  SUNXI_FUNCTION(0x4, "ac0"),
+		  SUNXI_FUNCTION(0x5, "sdc1"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 5)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 6),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "i2s0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 6)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 7),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "i2s0"),
+		  SUNXI_FUNCTION(0x3, "dsd0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 7)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 8),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "i2s0"),
+		  SUNXI_FUNCTION(0x3, "dsd0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 8)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 9),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "i2s0"),
+		  SUNXI_FUNCTION(0x3, "dsd0"),
+		  SUNXI_FUNCTION(0x4, "bist_result0"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 9)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 10),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "i2s0"),
+		  SUNXI_FUNCTION(0x3, "dsd0"),
+		  SUNXI_FUNCTION(0x4, "bist_result1"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 10)),
+	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 11),
+		  SUNXI_FUNCTION(0x0, "gpio_in"),
+		  SUNXI_FUNCTION(0x1, "gpio_out"),
+		  SUNXI_FUNCTION(0x2, "spdif0"),
+		  SUNXI_FUNCTION(0x4, "pll_lock_dbg"),
+		  SUNXI_FUNCTION(0x7, "io_disabled"),
+		  SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 11)),
+
+};
+
+static const struct sunxi_pinctrl_desc sun8i_b288_pinctrl_data = {
+	.pins = sun8i_b288_pins,
+	.npins = ARRAY_SIZE(sun8i_b288_pins),
+	.irq_banks = 4,
+};
+
+static int sun8i_b288_pinctrl_probe(struct platform_device *pdev)
+{
+	return sunxi_pinctrl_init(pdev,
+				  &sun8i_b288_pinctrl_data);
+}
+
+static const struct of_device_id sun8i_b288_pinctrl_match[] = {
+	{ .compatible = "allwinner,sun8i-b288-pinctrl", },
+	{}
+};
+
+static struct platform_driver sun8i_b288_pinctrl_driver = {
+	.probe	= sun8i_b288_pinctrl_probe,
+	.driver	= {
+		.name		= "sun8i-b288-pinctrl",
+		.of_match_table	= sun8i_b288_pinctrl_match,
+	},
+};
+builtin_platform_driver(sun8i_b288_pinctrl_driver);
#24 lore raw
In reply to Andre Przywara

Hi Andre,

thanks for the review.

Quoted 1 line

please add a cover letter

Done for v2.

Quoted 1 line

One problem in general is the lack of access to a manual [...]

The descriptions come from the BSP's clk-sun8iw10.{c,h}, cross-checked against ccu-sun50i-a64.c - nine of the eleven PLLs are bit-identical - and exercised on the device up to userspace.

Quoted 1 line

I am afraid you cannot push off the responsibility to other people

Copy-paste mistake, sorry. Moot now: folding both bindings into the existing files removes those entries.

Quoted 1 line

why do you need a separate binding?

You're right, it's a strict subset; v2 just adds the compatible to allwinner,sun4i-a10-ccu.yaml.

Thanks,
Pablo

Quoted 251 lines · Andre Przywara

Hi Pablo,

many thanks for sending this series, on a first glance this looks pretty good.
As a general comment: please add a cover letter (git format-patch ... --cover-letter, then edit the generated file), and explain a bit about the background of this work. This would be a good place to briefly describe what the B288 is, how it's related to other SoCs, how you came to all this information, the firmware story, and the existing limitations of this port.

One problem in general is the lack of access to a manual, I am not even sure we ever upstreamed SoC support without one. Especially the clock driver is quite tricky, we would love to compare the clock descriptions against some documentation.

Quoted 19 lines · Pablo Mazzini

The B288 (sun8iw10p1) is a dual Cortex-A7 SoC used in e-book readers.

---
  .../clock/allwinner,sun8i-b288-ccu.yaml       | 55 ++++++++++++
  include/dt-bindings/clock/sun8i-b288-ccu.h    | 90 +++++++++++++++++++
  include/dt-bindings/reset/sun8i-b288-ccu.h    | 45 ++++++++++
  3 files changed, 190 insertions(+)

create mode 100644 Documentation/devicetree/bindings/clock/allwinner,sun8i-b288-ccu.yaml create mode 100644 include/dt-bindings/clock/sun8i-b288-ccu.h
create mode 100644 include/dt-bindings/reset/sun8i-b288-ccu.h

Documentation/devicetree/bindings/clock/allwinner,sun8i-b288-ccu.yaml new file +1 -0
new file mode 100644
index 000000000000..22b59d5b652c
@@ -0,0 +1,55 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)

Documentation/devicetree/bindings/clock/allwinner,sun8i-b288-ccu.yaml line 11

Quoted 10 lines
Documentation/devicetree/bindings/clock/allwinner,sun8i-b288-ccu.yaml new file +10 -0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/allwinner,sun8i-b288-ccu.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Allwinner B288 Clock Control Unit
+
+maintainers:
+  - Chen-Yu Tsai <[email protected]>
+  - Maxime Ripard <[email protected]>

I am afraid you cannot push off the responsibility to other people, especially I think Maxime wouldn't be really interested any more ;-)

Actually, why do you need a separate binding? Wouldn't it be enough to just add the compatible string to the existing allwinner,sun4i-a10-ccu.yaml file? This one here looks like a subset of this, and would blend in there easily.

Cheers,
Andre

Quoted 191 lines
Documentation/devicetree/bindings/clock/allwinner,sun8i-b288-ccu.yaml new file +44 -0
+
+properties:
+  "#clock-cells":
+    const: 1
+
+  "#reset-cells":
+    const: 1
+
+  compatible:
+    const: allwinner,sun8i-b288-ccu
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: High Frequency Oscillator
+      - description: Low Frequency Oscillator
+
+  clock-names:
+    items:
+      - const: hosc
+      - const: losc
+
+required:
+  - "#clock-cells"
+  - "#reset-cells"
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+
+additionalProperties: false
+
+examples:
+  - |
+    ccu: clock-controller@1c20000 {
+        compatible = "allwinner,sun8i-b288-ccu";
+        reg = <0x01c20000 0x400>;
+        clocks = <&osc24M>, <&osc32k>;
+        clock-names = "hosc", "losc";
+        #clock-cells = <1>;
+        #reset-cells = <1>;
+    };
include/dt-bindings/clock/sun8i-b288-ccu.h new file +90 -0
new file mode 100644
index 000000000000..3dc1704d001e
@@ -0,0 +1,90 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
+#ifndef _DT_BINDINGS_CLK_SUN8I_B288_H_
+#define _DT_BINDINGS_CLK_SUN8I_B288_H_
+
+#define CLK_PLL_CPUX 0
+#define CLK_PLL_AUDIO_BASE   1
+#define CLK_PLL_VIDEO0       2
+#define CLK_PLL_DDR0 3
+#define CLK_PLL_PERIPH0      4
+#define CLK_PLL_VIDEO1       5
+#define CLK_PLL_24M  6
+#define CLK_PLL_PERIPH1      7
+#define CLK_PLL_DE   8
+#define CLK_PLL_DDR1 9
+
+#define CLK_PLL_PERIPH0_2X   10
+#define CLK_PLL_PERIPH1_2X   11
+#define CLK_CPUX     12
+#define CLK_AXI      13
+#define CLK_CPUAPB   14
+#define CLK_AHB1     15
+#define CLK_APB1     16
+#define CLK_APB2     17
+
+#define CLK_NAND     18
+#define CLK_MMC0     19
+#define CLK_MMC1     20
+#define CLK_MMC2     21
+#define CLK_MMC3     22
+#define CLK_SPI0     23
+#define CLK_SPI1     24
+#define CLK_SPI2     25
+#define CLK_DRAM     26
+#define CLK_DE       27
+#define CLK_EE       28
+#define CLK_EDMA     29
+#define CLK_TCON0    30
+#define CLK_MBUS     31
+
+#define CLK_BUS_THS  32
+#define CLK_BUS_NAND 33
+#define CLK_BUS_SDMMC0_BUS   34
+#define CLK_BUS_SDMMC1_BUS   35
+#define CLK_BUS_SDMMC2_BUS   36
+#define CLK_BUS_SDMMC3_BUS   37
+#define CLK_BUS_SPI0 38
+#define CLK_BUS_SPI1 39
+#define CLK_BUS_SPI2 40
+#define CLK_BUS_I2S0 41
+#define CLK_BUS_I2S1 42
+#define CLK_BUS_SPDIF        43
+#define CLK_BUS_DSD  44
+#define CLK_BUS_DMIC 45
+#define CLK_BUS_USBOHCI0     46
+#define CLK_BUS_USBEHCI0     47
+#define CLK_BUS_USBOTG       48
+#define CLK_BUS_DE   49
+#define CLK_BUS_EE   50
+#define CLK_BUS_TCON0        51
+#define CLK_BUS_CSI_S        52
+#define CLK_BUS_CSI_M        53
+#define CLK_BUS_CSI_MISC     54
+#define CLK_BUS_ADDA 55
+#define CLK_BUS_SDRAM        56
+#define CLK_BUS_PSRAM        57
+#define CLK_BUS_DMA  58
+#define CLK_BUS_UART0        59
+#define CLK_BUS_UART1        60
+#define CLK_BUS_UART2        61
+#define CLK_BUS_UART3        62
+#define CLK_BUS_UART4        63
+#define CLK_BUS_UART5        64
+#define CLK_BUS_TWI0 65
+#define CLK_BUS_TWI1 66
+#define CLK_BUS_TWI2 67
+#define CLK_BUS_PIO  68
+#define CLK_BUS_GPADC        69
+#define CLK_BUS_KEYADC       70
+
+/*
+ * mmc0 and mmc1 are v4p1x controllers driven in the old timing mode, which
+ * needs the sample and output phase clocks. mmc2 and mmc3 are newer blocks
+ * that do their own delay calibration and have none.
+ */
+#define CLK_MMC0_SAMPLE      71
+#define CLK_MMC0_OUTPUT      72
+#define CLK_MMC1_SAMPLE      73
+#define CLK_MMC1_OUTPUT      74
+
+#endif
include/dt-bindings/reset/sun8i-b288-ccu.h new file +45 -0
new file mode 100644
index 000000000000..675145654548
@@ -0,0 +1,45 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
+#ifndef _DT_BINDINGS_RST_SUN8I_B288_H_
+#define _DT_BINDINGS_RST_SUN8I_B288_H_
+
+#define RST_BUS_THS  0
+#define RST_BUS_NAND 1
+#define RST_BUS_MMC0 2
+#define RST_BUS_MMC1 3
+#define RST_BUS_MMC2 4
+#define RST_BUS_MMC3 5
+#define RST_BUS_SPI0 6
+#define RST_BUS_SPI1 7
+#define RST_BUS_SPI2 8
+#define RST_BUS_I2S0 9
+#define RST_BUS_I2S1 10
+#define RST_BUS_SPDIF        11
+#define RST_BUS_DSD  12
+#define RST_BUS_DMIC 13
+#define RST_USBPHY0  14
+#define RST_BUS_OHCI0        15
+#define RST_BUS_EHCI0        16
+#define RST_BUS_OTG  17
+#define RST_BUS_DE   18
+#define RST_BUS_EE   19
+#define RST_BUS_TCON0        20
+#define RST_BUS_CSI  21
+#define RST_BUS_ADDA 22
+#define RST_BUS_WLAN 23
+#define RST_MBUS     24
+#define RST_BUS_DRAM 25
+#define RST_BUS_PSRAM        26
+#define RST_BUS_DMA  27
+#define RST_BUS_UART0        28
+#define RST_BUS_UART1        29
+#define RST_BUS_UART2        30
+#define RST_BUS_UART3        31
+#define RST_BUS_UART4        32
+#define RST_BUS_UART5        33
+#define RST_BUS_I2C0 34
+#define RST_BUS_I2C1 35
+#define RST_BUS_I2C2 36
+#define RST_BUS_GPADC        37
+#define RST_BUS_KEYADC       38
+
+#endif
#6 lore raw

Re: [PATCH v1 03/11] dt-bindings: pinctrl: add Allwinner B288 pin controller

In reply to Andre Przywara

Hi Andre,

Quoted 2 lines

Can't you just add the new compatible string to the existing allwinner,sun4i-a10-pinctrl.yaml binding?

Done for v2.

Thanks,
Pablo

Quoted 138 lines · Andre Przywara

Hi Pablo,

Quoted 5 lines · Pablo Mazzini

One controller at 0x01c20800 with four external interrupt banks.

---
  .../pinctrl/allwinner,sun8i-b288-pinctrl.yaml | 108 ++++++++++++++++++

Why is this a new file? Can't you just add the new compatible string to the existing allwinner,sun4i-a10-pinctrl.yaml binding?

Cheers,
Andre

P.S. Since we have seen this a lot lately: please wait with a new version of your series for a few days, to allow other people to comment, and to allow discussions to settle down. Not everyone can respond quickly.

Quoted 117 lines
  1 file changed, 108 insertions(+)

create mode 100644 Documentation/devicetree/bindings/pinctrl/allwinner,sun8i-b288-pinctrl.yaml

Documentation/devicetree/bindings/pinctrl/allwinner,sun8i-b288-pinctrl.yaml new file +108 -0
new file mode 100644
index 000000000000..806da97ab708
@@ -0,0 +1,108 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/allwinner,sun8i-b288-pinctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Allwinner B288 Pin Controller
+
+maintainers:
+  - Chen-Yu Tsai <[email protected]>
+  - Jernej Skrabec <[email protected]>
+
+properties:
+  compatible:
+    const: allwinner,sun8i-b288-pinctrl
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    description:
+      One interrupt per bank of external interrupt capable pins.
+    maxItems: 4
+
+  clocks:
+    items:
+      - description: Bus Clock
+      - description: High Frequency Oscillator
+      - description: Low Frequency Oscillator
+
+  clock-names:
+    items:
+      - const: apb
+      - const: hosc
+      - const: losc
+
+  gpio-controller: true
+  interrupt-controller: true
+  gpio-line-names: true
+
+  "#gpio-cells":
+    const: 3
+
+  "#interrupt-cells":
+    const: 3
+
+patternProperties:
+  "-pins$":
+    type: object
+    $ref: /schemas/pinctrl/pincfg-node.yaml#
+    additionalProperties: false
+
+    properties:
+      pins: true
+      function: true
+      bias-pull-up: true
+      bias-pull-down: true
+      bias-disable: true
+      drive-strength:
+        enum: [10, 20, 30, 40]
+
+    required:
+      - pins
+      - function
+
+  "^vcc-p[bcdfg]-supply$":
+    description:
+      Power supplies for pin banks.
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+  - gpio-controller
+  - "#gpio-cells"
+  - interrupt-controller
+  - "#interrupt-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/sun8i-b288-ccu.h>
+
+    pio: pinctrl@1c20800 {
+        compatible = "allwinner,sun8i-b288-pinctrl";
+        reg = <0x01c20800 0x400>;
+        interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
+        clocks = <&ccu CLK_BUS_PIO>, <&osc24M>, <&osc32k>;
+        clock-names = "apb", "hosc", "losc";
+        gpio-controller;
+        #gpio-cells = <3>;
+        interrupt-controller;
+        #interrupt-cells = <3>;
+
+        mmc0_pins: mmc0-pins {
+            pins = "PF0", "PF1", "PF2", "PF3", "PF4", "PF5";
+            function = "sdc0";
+            drive-strength = <30>;
+            bias-pull-up;
+        };
+    };
#10 lore raw

Re: [PATCH v1 04/11] pinctrl: sunxi: add Allwinner B288 pin controller driver

In reply to Andre Przywara

Hi Andre,

Quoted 1 line

look at pinctrl-sun55i-a523.c for an example

Thanks for the pointer - much nicer. Converted for v2.

Quoted 1 line

Can you put it into our wiki

The page already has the table and it matches the BSP exactly.

Thanks,
Pablo

Quoted 708 lines · Andre Przywara

Hi,

many thanks for going through the task of creating this table - though I think you wouldn't need to do this anymore, since we now have another way of describing pins, which avoids this lenghty table in the driver:
look at pinctrl-sun55i-a523.c for an example.

This would allow the "driver" to be a mere high level description, and leave the mux values to the DT.

That being said: it's good to have that info, for the lack of a manual. Can you by any chance try to make a table out of it and put it into our wiki (https://linux-sunxi.org/B288)? That would then be the replacement for the manual. Maybe write a small tool to convert this data struct into Wiki table format.

Some general things inline ...

Quoted 65 lines · Pablo Mazzini

78 pins across ports B, C, D, F and G. PH0 is BSP FPGA-only and omitted.

---
  drivers/pinctrl/sunxi/Kconfig              |  10 +
  drivers/pinctrl/sunxi/Makefile             |   1 +
  drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c | 623 +++++++++++++++++++++
  3 files changed, 634 insertions(+)

create mode 100644 drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c

drivers/pinctrl/sunxi/Kconfig +10 -0
index dc62eba96348..a08186133090 100644
@@ -56,6 +56,16 @@ config PINCTRL_SUN8I_A23_R
      default MACH_SUN8I
      select PINCTRL_SUNXI
 
+config PINCTRL_SUN8I_B288
+     bool "Support for the Allwinner B288 PIO"
+     default MACH_SUN8I
+     select PINCTRL_SUNXI
+     help
+       Say Y here to enable pin controller and GPIO support for the
+       Allwinner B288 (sun8iw10p1) SoC, as used in e-book readers such
+       as the PocketBook Verse. This covers ports B, C, D, F and G,
+       including the four banks of external interrupt capable pins.
+
  config PINCTRL_SUN8I_H3
      bool "Support for the Allwinner H3 PIO"
      default MACH_SUN8I
drivers/pinctrl/sunxi/Makefile +1 -0
index 951b3f1e4b4f..5129c0f19f3e 100644
@@ -18,6 +18,7 @@ obj-$(CONFIG_PINCTRL_SUN50I_A100)   += pinctrl-sun50i-a100.o
  obj-$(CONFIG_PINCTRL_SUN50I_A100_R) += pinctrl-sun50i-a100-r.o
  obj-$(CONFIG_PINCTRL_SUN8I_A83T)    += pinctrl-sun8i-a83t.o
  obj-$(CONFIG_PINCTRL_SUN8I_A83T_R)  += pinctrl-sun8i-a83t-r.o
+obj-$(CONFIG_PINCTRL_SUN8I_B288)     += pinctrl-sun8i-b288.o
  obj-$(CONFIG_PINCTRL_SUN8I_H3)              += pinctrl-sun8i-h3.o
  obj-$(CONFIG_PINCTRL_SUN8I_H3_R)    += pinctrl-sun8i-h3-r.o
  obj-$(CONFIG_PINCTRL_SUN8I_V3S)             += pinctrl-sun8i-v3s.o
drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c new file +16 -0
new file mode 100644
index 000000000000..ffd7eef68d19
@@ -0,0 +1,623 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Allwinner B288 (sun8iw10p1) SoC pinctrl driver.
+ *
+ * Derived from Allwinner's BSP driver pinctrl-sun8iw10p1.c, which is:
+ * Copyright (C) 2014 Jackie Hwang <[email protected]>
+ *
+ * Based on pinctrl-sun8i-a23.c, which is:
+ * Copyright (C) 2014 Chen-Yu Tsai <[email protected]>
+ * Copyright (C) 2014 Maxime Ripard <[email protected]>
+ */
+
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/of.h>
+#include <linux/pinctrl/pinctrl.h>

drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c line 26

Quoted 10 lines
drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c new file +10 -0
+
+#include "pinctrl-sunxi.h"
+
+static const struct sunxi_desc_pin sun8i_b288_pins[] = {
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 0),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "uart2"),
+               SUNXI_FUNCTION(0x3, "jtag0"),
+               SUNXI_FUNCTION(0x5, "vdevice"),

What's vdevice? I don't think we used to describe those weird functions.

drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c line 27

Quoted 1 line
drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c new file +1 -0
+               SUNXI_FUNCTION(0x7, "io_disabled"),

I know Allwinner does this, but we do not describe the HighZ mux, it's all 1's anyway, and the same for all pins.

Those comments are probably irrelevant if you go with the new pinctrl driver style. Most of the settings there should be straightforward to figure out, just remember to add an IRQ map, to account for the missing interrupts on PortC.

Cheers,
Andre

Quoted 596 lines
drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c new file +596 -0
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 0)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 1),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "uart2"),
+               SUNXI_FUNCTION(0x3, "jtag0"),
+               SUNXI_FUNCTION(0x4, "spdif0"),
+               SUNXI_FUNCTION(0x5, "vdevice"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 1)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 2),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "uart2"),
+               SUNXI_FUNCTION(0x3, "jtag0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 2)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 3),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "uart2"),
+               SUNXI_FUNCTION(0x3, "jtag0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 3)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 4),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "uart0"),
+               SUNXI_FUNCTION(0x3, "pwm0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 4)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 5),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "uart0"),
+               SUNXI_FUNCTION(0x3, "pwm1"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 5)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 6),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "twi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 6)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 7),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "twi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 7)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 10),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "spi1"),
+               SUNXI_FUNCTION(0x3, "uart4"),
+               SUNXI_FUNCTION(0x4, "pwm2"),
+               SUNXI_FUNCTION(0x5, "wifi_uart0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 10)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 11),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "spi1"),
+               SUNXI_FUNCTION(0x3, "uart4"),
+               SUNXI_FUNCTION(0x4, "pwm3"),
+               SUNXI_FUNCTION(0x5, "wifi_uart0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 11)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 12),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "i2s1"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 12)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 13),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "i2s1"),
+               SUNXI_FUNCTION(0x4, "pwm4"),
+               SUNXI_FUNCTION(0x5, "uart3"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 13)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 14),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "i2s1"),
+               SUNXI_FUNCTION(0x4, "pwm5"),
+               SUNXI_FUNCTION(0x5, "uart3"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 14)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 15),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "i2s1"),
+               SUNXI_FUNCTION(0x3, "ac0"),
+               SUNXI_FUNCTION(0x4, "twi1"),
+               SUNXI_FUNCTION(0x5, "uart3"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 15)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 16),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "i2s1"),
+               SUNXI_FUNCTION(0x3, "ac0"),
+               SUNXI_FUNCTION(0x4, "twi1"),
+               SUNXI_FUNCTION(0x5, "uart3"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 16)),
+     /*Hole*/
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 0),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "nand0"),
+               SUNXI_FUNCTION(0x4, "spi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled")),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 1),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "nand0"),
+               SUNXI_FUNCTION(0x3, "sdc2"),
+               SUNXI_FUNCTION(0x4, "spi0"),
+               SUNXI_FUNCTION(0x5, "sdc3"),
+               SUNXI_FUNCTION(0x7, "io_disabled")),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 2),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "nand0"),
+               SUNXI_FUNCTION(0x4, "spi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled")),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 3),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "nand0"),
+               SUNXI_FUNCTION(0x4, "spi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled")),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 4),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "nand0"),
+               SUNXI_FUNCTION(0x3, "sdc2"),
+               SUNXI_FUNCTION(0x5, "sdc3"),
+               SUNXI_FUNCTION(0x7, "io_disabled")),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 5),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "nand0"),
+               SUNXI_FUNCTION(0x3, "sdc2"),
+               SUNXI_FUNCTION(0x5, "sdc3"),
+               SUNXI_FUNCTION(0x7, "io_disabled")),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 6),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "nand0"),
+               SUNXI_FUNCTION(0x3, "sdc2"),
+               SUNXI_FUNCTION(0x4, "uart1"),
+               SUNXI_FUNCTION(0x5, "sdc3"),
+               SUNXI_FUNCTION(0x7, "io_disabled")),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 7),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "nand0"),
+               SUNXI_FUNCTION(0x3, "sdc2"),
+               SUNXI_FUNCTION(0x4, "uart1"),
+               SUNXI_FUNCTION(0x5, "sdc3"),
+               SUNXI_FUNCTION(0x7, "io_disabled")),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 8),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "nand0"),
+               SUNXI_FUNCTION(0x3, "sdc2"),
+               SUNXI_FUNCTION(0x4, "uart1"),
+               SUNXI_FUNCTION(0x5, "sdc3"),
+               SUNXI_FUNCTION(0x7, "io_disabled")),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 9),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "nand0"),
+               SUNXI_FUNCTION(0x3, "sdc2"),
+               SUNXI_FUNCTION(0x4, "uart1"),
+               SUNXI_FUNCTION(0x5, "sdc3"),
+               SUNXI_FUNCTION(0x7, "io_disabled")),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 10),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "nand0"),
+               SUNXI_FUNCTION(0x3, "sdc2"),
+               SUNXI_FUNCTION(0x4, "uart1"),
+               SUNXI_FUNCTION(0x5, "sdc3"),
+               SUNXI_FUNCTION(0x7, "io_disabled")),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 11),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "nand0"),
+               SUNXI_FUNCTION(0x3, "sdc2"),
+               SUNXI_FUNCTION(0x4, "uart1"),
+               SUNXI_FUNCTION(0x5, "sdc3"),
+               SUNXI_FUNCTION(0x7, "io_disabled")),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 12),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "nand0"),
+               SUNXI_FUNCTION(0x3, "sdc2"),
+               SUNXI_FUNCTION(0x4, "uart1"),
+               SUNXI_FUNCTION(0x5, "sdc3"),
+               SUNXI_FUNCTION(0x7, "io_disabled")),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 13),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "nand0"),
+               SUNXI_FUNCTION(0x3, "sdc2"),
+               SUNXI_FUNCTION(0x4, "uart1"),
+               SUNXI_FUNCTION(0x5, "sdc3"),
+               SUNXI_FUNCTION(0x7, "io_disabled")),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 14),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "nand0"),
+               SUNXI_FUNCTION(0x3, "sdc2"),
+               SUNXI_FUNCTION(0x5, "sdc3"),
+               SUNXI_FUNCTION(0x7, "io_disabled")),
+     /* Hole */
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 0),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x3, "uart1"),
+               SUNXI_FUNCTION(0x4, "csi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 0)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 1),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x3, "uart1"),
+               SUNXI_FUNCTION(0x4, "csi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 1)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 2),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x3, "uart5"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 2)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 3),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x3, "uart5"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 3)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 4),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x3, "uart5"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 4)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 5),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x3, "uart5"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 5)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 6),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 6)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 7),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 7)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 8),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x3, "uart1"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 8)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 9),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x3, "uart1"),
+               SUNXI_FUNCTION(0x4, "csi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 9)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 10),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 10)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 11),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 11)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 12),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 12)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 13),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x4, "csi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 13)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 14),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x4, "csi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 14)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 15),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x4, "csi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 15)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 16),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x4, "csi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 16)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 17),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x4, "csi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 17)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 18),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x4, "csi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 18)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 19),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x4, "csi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 19)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 20),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x4, "csi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 20)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 21),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x4, "csi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 21)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 22),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x4, "csi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 22)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 23),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x4, "csi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 23)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 24),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x3, "spi2"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 24)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 25),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x3, "spi2"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 25)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 26),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x3, "spi2"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 26)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 27),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x3, "spi2"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 27)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 28),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "pwm0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 28)),
+
+     /* Hole */
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 0),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "sdc0"),
+               SUNXI_FUNCTION(0x4, "jtag0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 0)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 1),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "sdc0"),
+               SUNXI_FUNCTION(0x4, "jtag0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 1)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 2),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "sdc0"),
+               SUNXI_FUNCTION(0x4, "uart0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 2)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 3),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "sdc0"),
+               SUNXI_FUNCTION(0x4, "jtag0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 3)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 4),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "sdc0"),
+               SUNXI_FUNCTION(0x4, "uart0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 4)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 5),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "sdc0"),
+               SUNXI_FUNCTION(0x4, "jtag0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 5)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 6),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 6)),
+
+     /* Hole */
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 0),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "pwm6"),
+               SUNXI_FUNCTION(0x3, "dmic0"),
+               SUNXI_FUNCTION(0x4, "spi1"),
+               SUNXI_FUNCTION(0x5, "sdc1"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 0)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 1),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "pwm7"),
+               SUNXI_FUNCTION(0x3, "dmic0"),
+               SUNXI_FUNCTION(0x4, "spi1"),
+               SUNXI_FUNCTION(0x5, "sdc1"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 1)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 2),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "twi1"),
+               SUNXI_FUNCTION(0x3, "dmic0"),
+               SUNXI_FUNCTION(0x4, "spi1"),
+               SUNXI_FUNCTION(0x5, "sdc1"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 2)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 3),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "twi1"),
+               SUNXI_FUNCTION(0x3, "dmic0"),
+               SUNXI_FUNCTION(0x4, "spi1"),
+               SUNXI_FUNCTION(0x5, "sdc1"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 1)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 4),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "twi2"),
+               SUNXI_FUNCTION(0x3, "dmic0"),
+               SUNXI_FUNCTION(0x4, "spi1"),
+               SUNXI_FUNCTION(0x5, "sdc1"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 4)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 5),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "twi2"),
+               SUNXI_FUNCTION(0x4, "ac0"),
+               SUNXI_FUNCTION(0x5, "sdc1"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 5)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 6),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "i2s0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 6)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 7),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "i2s0"),
+               SUNXI_FUNCTION(0x3, "dsd0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 7)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 8),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "i2s0"),
+               SUNXI_FUNCTION(0x3, "dsd0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 8)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 9),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "i2s0"),
+               SUNXI_FUNCTION(0x3, "dsd0"),
+               SUNXI_FUNCTION(0x4, "bist_result0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 9)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 10),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "i2s0"),
+               SUNXI_FUNCTION(0x3, "dsd0"),
+               SUNXI_FUNCTION(0x4, "bist_result1"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 10)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 11),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "spdif0"),
+               SUNXI_FUNCTION(0x4, "pll_lock_dbg"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 11)),
+
+};
+
+static const struct sunxi_pinctrl_desc sun8i_b288_pinctrl_data = {
+     .pins = sun8i_b288_pins,
+     .npins = ARRAY_SIZE(sun8i_b288_pins),
+     .irq_banks = 4,
+};
+
+static int sun8i_b288_pinctrl_probe(struct platform_device *pdev)
+{
+     return sunxi_pinctrl_init(pdev,
+                               &sun8i_b288_pinctrl_data);
+}
+
+static const struct of_device_id sun8i_b288_pinctrl_match[] = {
+     { .compatible = "allwinner,sun8i-b288-pinctrl", },
+     {}
+};
+
+static struct platform_driver sun8i_b288_pinctrl_driver = {
+     .probe  = sun8i_b288_pinctrl_probe,
+     .driver = {
+             .name           = "sun8i-b288-pinctrl",
+             .of_match_table = sun8i_b288_pinctrl_match,
+     },
+};
+builtin_platform_driver(sun8i_b288_pinctrl_driver);
#11 lore raw

Re: [PATCH v1 04/11] pinctrl: sunxi: add Allwinner B288 pin controller driver

Hi Pablo,

Quoted 9 lines · Pablo Mazzini

Hi Andre,

Quoted 1 line

look at pinctrl-sun55i-a523.c for an example

Thanks for the pointer - much nicer. Converted for v2.

Quoted 1 line

Can you put it into our wiki

The page already has the table and it matches the BSP exactly.

Lol, it was even me putting it there, but I hid it under that Collapse feature, so I didn't spot it yesterday. All good then, and thanks for the confirmation about them matching!

Cheers,
Andre

Quoted 713 lines

Thanks,
Pablo

Quoted 708 lines · Andre Przywara

Hi,

many thanks for going through the task of creating this table - though I think you wouldn't need to do this anymore, since we now have another way of describing pins, which avoids this lenghty table in the driver:
look at pinctrl-sun55i-a523.c for an example.

This would allow the "driver" to be a mere high level description, and leave the mux values to the DT.

That being said: it's good to have that info, for the lack of a manual. Can you by any chance try to make a table out of it and put it into our wiki (https://linux-sunxi.org/B288)? That would then be the replacement for the manual. Maybe write a small tool to convert this data struct into Wiki table format.

Some general things inline ...

Quoted 65 lines · Pablo Mazzini

78 pins across ports B, C, D, F and G. PH0 is BSP FPGA-only and omitted.

---
   drivers/pinctrl/sunxi/Kconfig              |  10 +
   drivers/pinctrl/sunxi/Makefile             |   1 +
   drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c | 623 +++++++++++++++++++++
   3 files changed, 634 insertions(+)

create mode 100644 drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c

drivers/pinctrl/sunxi/Kconfig +10 -0
index dc62eba96348..a08186133090 100644
@@ -56,6 +56,16 @@ config PINCTRL_SUN8I_A23_R
       default MACH_SUN8I
       select PINCTRL_SUNXI
 
+config PINCTRL_SUN8I_B288
+     bool "Support for the Allwinner B288 PIO"
+     default MACH_SUN8I
+     select PINCTRL_SUNXI
+     help
+       Say Y here to enable pin controller and GPIO support for the
+       Allwinner B288 (sun8iw10p1) SoC, as used in e-book readers such
+       as the PocketBook Verse. This covers ports B, C, D, F and G,
+       including the four banks of external interrupt capable pins.
+
   config PINCTRL_SUN8I_H3
       bool "Support for the Allwinner H3 PIO"
       default MACH_SUN8I
drivers/pinctrl/sunxi/Makefile +1 -0
index 951b3f1e4b4f..5129c0f19f3e 100644
@@ -18,6 +18,7 @@ obj-$(CONFIG_PINCTRL_SUN50I_A100)   += pinctrl-sun50i-a100.o
   obj-$(CONFIG_PINCTRL_SUN50I_A100_R) += pinctrl-sun50i-a100-r.o
   obj-$(CONFIG_PINCTRL_SUN8I_A83T)    += pinctrl-sun8i-a83t.o
   obj-$(CONFIG_PINCTRL_SUN8I_A83T_R)  += pinctrl-sun8i-a83t-r.o
+obj-$(CONFIG_PINCTRL_SUN8I_B288)     += pinctrl-sun8i-b288.o
   obj-$(CONFIG_PINCTRL_SUN8I_H3)              += pinctrl-sun8i-h3.o
   obj-$(CONFIG_PINCTRL_SUN8I_H3_R)    += pinctrl-sun8i-h3-r.o
   obj-$(CONFIG_PINCTRL_SUN8I_V3S)             += pinctrl-sun8i-v3s.o
drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c new file +16 -0
new file mode 100644
index 000000000000..ffd7eef68d19
@@ -0,0 +1,623 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Allwinner B288 (sun8iw10p1) SoC pinctrl driver.
+ *
+ * Derived from Allwinner's BSP driver pinctrl-sun8iw10p1.c, which is:
+ * Copyright (C) 2014 Jackie Hwang <[email protected]>
+ *
+ * Based on pinctrl-sun8i-a23.c, which is:
+ * Copyright (C) 2014 Chen-Yu Tsai <[email protected]>
+ * Copyright (C) 2014 Maxime Ripard <[email protected]>
+ */
+
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/of.h>
+#include <linux/pinctrl/pinctrl.h>

drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c line 26

Quoted 10 lines
drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c new file +10 -0
+
+#include "pinctrl-sunxi.h"
+
+static const struct sunxi_desc_pin sun8i_b288_pins[] = {
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 0),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "uart2"),
+               SUNXI_FUNCTION(0x3, "jtag0"),
+               SUNXI_FUNCTION(0x5, "vdevice"),

What's vdevice? I don't think we used to describe those weird functions.

drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c line 27

Quoted 1 line
drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c new file +1 -0
+               SUNXI_FUNCTION(0x7, "io_disabled"),

I know Allwinner does this, but we do not describe the HighZ mux, it's all 1's anyway, and the same for all pins.

Those comments are probably irrelevant if you go with the new pinctrl driver style. Most of the settings there should be straightforward to figure out, just remember to add an IRQ map, to account for the missing interrupts on PortC.

Cheers,
Andre

Quoted 596 lines
drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c new file +596 -0
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 0)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 1),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "uart2"),
+               SUNXI_FUNCTION(0x3, "jtag0"),
+               SUNXI_FUNCTION(0x4, "spdif0"),
+               SUNXI_FUNCTION(0x5, "vdevice"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 1)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 2),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "uart2"),
+               SUNXI_FUNCTION(0x3, "jtag0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 2)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 3),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "uart2"),
+               SUNXI_FUNCTION(0x3, "jtag0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 3)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 4),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "uart0"),
+               SUNXI_FUNCTION(0x3, "pwm0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 4)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 5),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "uart0"),
+               SUNXI_FUNCTION(0x3, "pwm1"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 5)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 6),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "twi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 6)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 7),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "twi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 7)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 10),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "spi1"),
+               SUNXI_FUNCTION(0x3, "uart4"),
+               SUNXI_FUNCTION(0x4, "pwm2"),
+               SUNXI_FUNCTION(0x5, "wifi_uart0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 10)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 11),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "spi1"),
+               SUNXI_FUNCTION(0x3, "uart4"),
+               SUNXI_FUNCTION(0x4, "pwm3"),
+               SUNXI_FUNCTION(0x5, "wifi_uart0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 11)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 12),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "i2s1"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 12)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 13),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "i2s1"),
+               SUNXI_FUNCTION(0x4, "pwm4"),
+               SUNXI_FUNCTION(0x5, "uart3"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 13)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 14),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "i2s1"),
+               SUNXI_FUNCTION(0x4, "pwm5"),
+               SUNXI_FUNCTION(0x5, "uart3"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 14)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 15),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "i2s1"),
+               SUNXI_FUNCTION(0x3, "ac0"),
+               SUNXI_FUNCTION(0x4, "twi1"),
+               SUNXI_FUNCTION(0x5, "uart3"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 15)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 16),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "i2s1"),
+               SUNXI_FUNCTION(0x3, "ac0"),
+               SUNXI_FUNCTION(0x4, "twi1"),
+               SUNXI_FUNCTION(0x5, "uart3"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 16)),
+     /*Hole*/
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 0),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "nand0"),
+               SUNXI_FUNCTION(0x4, "spi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled")),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 1),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "nand0"),
+               SUNXI_FUNCTION(0x3, "sdc2"),
+               SUNXI_FUNCTION(0x4, "spi0"),
+               SUNXI_FUNCTION(0x5, "sdc3"),
+               SUNXI_FUNCTION(0x7, "io_disabled")),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 2),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "nand0"),
+               SUNXI_FUNCTION(0x4, "spi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled")),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 3),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "nand0"),
+               SUNXI_FUNCTION(0x4, "spi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled")),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 4),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "nand0"),
+               SUNXI_FUNCTION(0x3, "sdc2"),
+               SUNXI_FUNCTION(0x5, "sdc3"),
+               SUNXI_FUNCTION(0x7, "io_disabled")),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 5),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "nand0"),
+               SUNXI_FUNCTION(0x3, "sdc2"),
+               SUNXI_FUNCTION(0x5, "sdc3"),
+               SUNXI_FUNCTION(0x7, "io_disabled")),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 6),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "nand0"),
+               SUNXI_FUNCTION(0x3, "sdc2"),
+               SUNXI_FUNCTION(0x4, "uart1"),
+               SUNXI_FUNCTION(0x5, "sdc3"),
+               SUNXI_FUNCTION(0x7, "io_disabled")),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 7),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "nand0"),
+               SUNXI_FUNCTION(0x3, "sdc2"),
+               SUNXI_FUNCTION(0x4, "uart1"),
+               SUNXI_FUNCTION(0x5, "sdc3"),
+               SUNXI_FUNCTION(0x7, "io_disabled")),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 8),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "nand0"),
+               SUNXI_FUNCTION(0x3, "sdc2"),
+               SUNXI_FUNCTION(0x4, "uart1"),
+               SUNXI_FUNCTION(0x5, "sdc3"),
+               SUNXI_FUNCTION(0x7, "io_disabled")),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 9),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "nand0"),
+               SUNXI_FUNCTION(0x3, "sdc2"),
+               SUNXI_FUNCTION(0x4, "uart1"),
+               SUNXI_FUNCTION(0x5, "sdc3"),
+               SUNXI_FUNCTION(0x7, "io_disabled")),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 10),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "nand0"),
+               SUNXI_FUNCTION(0x3, "sdc2"),
+               SUNXI_FUNCTION(0x4, "uart1"),
+               SUNXI_FUNCTION(0x5, "sdc3"),
+               SUNXI_FUNCTION(0x7, "io_disabled")),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 11),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "nand0"),
+               SUNXI_FUNCTION(0x3, "sdc2"),
+               SUNXI_FUNCTION(0x4, "uart1"),
+               SUNXI_FUNCTION(0x5, "sdc3"),
+               SUNXI_FUNCTION(0x7, "io_disabled")),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 12),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "nand0"),
+               SUNXI_FUNCTION(0x3, "sdc2"),
+               SUNXI_FUNCTION(0x4, "uart1"),
+               SUNXI_FUNCTION(0x5, "sdc3"),
+               SUNXI_FUNCTION(0x7, "io_disabled")),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 13),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "nand0"),
+               SUNXI_FUNCTION(0x3, "sdc2"),
+               SUNXI_FUNCTION(0x4, "uart1"),
+               SUNXI_FUNCTION(0x5, "sdc3"),
+               SUNXI_FUNCTION(0x7, "io_disabled")),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 14),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "nand0"),
+               SUNXI_FUNCTION(0x3, "sdc2"),
+               SUNXI_FUNCTION(0x5, "sdc3"),
+               SUNXI_FUNCTION(0x7, "io_disabled")),
+     /* Hole */
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 0),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x3, "uart1"),
+               SUNXI_FUNCTION(0x4, "csi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 0)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 1),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x3, "uart1"),
+               SUNXI_FUNCTION(0x4, "csi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 1)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 2),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x3, "uart5"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 2)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 3),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x3, "uart5"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 3)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 4),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x3, "uart5"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 4)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 5),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x3, "uart5"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 5)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 6),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 6)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 7),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 7)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 8),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x3, "uart1"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 8)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 9),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x3, "uart1"),
+               SUNXI_FUNCTION(0x4, "csi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 9)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 10),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 10)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 11),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 11)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 12),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 12)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 13),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x4, "csi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 13)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 14),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x4, "csi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 14)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 15),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x4, "csi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 15)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 16),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x4, "csi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 16)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 17),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x4, "csi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 17)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 18),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x4, "csi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 18)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 19),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x4, "csi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 19)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 20),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x4, "csi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 20)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 21),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x4, "csi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 21)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 22),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x4, "csi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 22)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 23),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x4, "csi0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 23)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 24),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x3, "spi2"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 24)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 25),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x3, "spi2"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 25)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 26),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x3, "spi2"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 26)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 27),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "lcd0"),
+               SUNXI_FUNCTION(0x3, "spi2"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 27)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 28),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "pwm0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 28)),
+
+     /* Hole */
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 0),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "sdc0"),
+               SUNXI_FUNCTION(0x4, "jtag0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 0)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 1),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "sdc0"),
+               SUNXI_FUNCTION(0x4, "jtag0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 1)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 2),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "sdc0"),
+               SUNXI_FUNCTION(0x4, "uart0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 2)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 3),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "sdc0"),
+               SUNXI_FUNCTION(0x4, "jtag0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 3)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 4),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "sdc0"),
+               SUNXI_FUNCTION(0x4, "uart0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 4)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 5),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "sdc0"),
+               SUNXI_FUNCTION(0x4, "jtag0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 5)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 6),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 6)),
+
+     /* Hole */
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 0),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "pwm6"),
+               SUNXI_FUNCTION(0x3, "dmic0"),
+               SUNXI_FUNCTION(0x4, "spi1"),
+               SUNXI_FUNCTION(0x5, "sdc1"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 0)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 1),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "pwm7"),
+               SUNXI_FUNCTION(0x3, "dmic0"),
+               SUNXI_FUNCTION(0x4, "spi1"),
+               SUNXI_FUNCTION(0x5, "sdc1"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 1)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 2),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "twi1"),
+               SUNXI_FUNCTION(0x3, "dmic0"),
+               SUNXI_FUNCTION(0x4, "spi1"),
+               SUNXI_FUNCTION(0x5, "sdc1"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 2)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 3),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "twi1"),
+               SUNXI_FUNCTION(0x3, "dmic0"),
+               SUNXI_FUNCTION(0x4, "spi1"),
+               SUNXI_FUNCTION(0x5, "sdc1"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 1)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 4),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "twi2"),
+               SUNXI_FUNCTION(0x3, "dmic0"),
+               SUNXI_FUNCTION(0x4, "spi1"),
+               SUNXI_FUNCTION(0x5, "sdc1"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 4)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 5),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "twi2"),
+               SUNXI_FUNCTION(0x4, "ac0"),
+               SUNXI_FUNCTION(0x5, "sdc1"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 5)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 6),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "i2s0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 6)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 7),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "i2s0"),
+               SUNXI_FUNCTION(0x3, "dsd0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 7)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 8),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "i2s0"),
+               SUNXI_FUNCTION(0x3, "dsd0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 8)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 9),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "i2s0"),
+               SUNXI_FUNCTION(0x3, "dsd0"),
+               SUNXI_FUNCTION(0x4, "bist_result0"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 9)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 10),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "i2s0"),
+               SUNXI_FUNCTION(0x3, "dsd0"),
+               SUNXI_FUNCTION(0x4, "bist_result1"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 10)),
+     SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 11),
+               SUNXI_FUNCTION(0x0, "gpio_in"),
+               SUNXI_FUNCTION(0x1, "gpio_out"),
+               SUNXI_FUNCTION(0x2, "spdif0"),
+               SUNXI_FUNCTION(0x4, "pll_lock_dbg"),
+               SUNXI_FUNCTION(0x7, "io_disabled"),
+               SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 11)),
+
+};
+
+static const struct sunxi_pinctrl_desc sun8i_b288_pinctrl_data = {
+     .pins = sun8i_b288_pins,
+     .npins = ARRAY_SIZE(sun8i_b288_pins),
+     .irq_banks = 4,
+};
+
+static int sun8i_b288_pinctrl_probe(struct platform_device *pdev)
+{
+     return sunxi_pinctrl_init(pdev,
+                               &sun8i_b288_pinctrl_data);
+}
+
+static const struct of_device_id sun8i_b288_pinctrl_match[] = {
+     { .compatible = "allwinner,sun8i-b288-pinctrl", },
+     {}
+};
+
+static struct platform_driver sun8i_b288_pinctrl_driver = {
+     .probe  = sun8i_b288_pinctrl_probe,
+     .driver = {
+             .name           = "sun8i-b288-pinctrl",
+             .of_match_table = sun8i_b288_pinctrl_match,
+     },
+};
+builtin_platform_driver(sun8i_b288_pinctrl_driver);