Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Add support for Lichee Pi Zero from Rui-Xiang Guo o...
details: https://anonhg.NetBSD.org/src/rev/5e5e416764b9
branches: trunk
changeset: 368203:5e5e416764b9
user: skrll <skrll%NetBSD.org@localhost>
date: Tue Jun 28 05:19:03 2022 +0000
description:
Add support for Lichee Pi Zero from Rui-Xiang Guo on port-arm
diffstat:
sys/arch/arm/sunxi/files.sunxi | 3 +-
sys/arch/arm/sunxi/sun8i_v3s_gpio.c | 102 ++++++++++++++++++++++++++++++++++++
sys/arch/arm/sunxi/sunxi_de2_ccu.c | 6 +-
sys/arch/arm/sunxi/sunxi_drm.c | 5 +-
sys/arch/arm/sunxi/sunxi_emac.c | 5 +-
sys/arch/arm/sunxi/sunxi_gpio.c | 8 ++-
sys/arch/arm/sunxi/sunxi_gpio.h | 6 +-
sys/arch/arm/sunxi/sunxi_lcdc.c | 5 +-
sys/arch/arm/sunxi/sunxi_mixer.c | 6 +-
sys/arch/arm/sunxi/sunxi_platform.c | 5 +-
sys/arch/arm/sunxi/sunxi_usbphy.c | 5 +-
sys/arch/evbarm/conf/GENERIC | 3 +-
12 files changed, 140 insertions(+), 19 deletions(-)
diffs (truncated from 374 to 300 lines):
diff -r aee142e93b08 -r 5e5e416764b9 sys/arch/arm/sunxi/files.sunxi
--- a/sys/arch/arm/sunxi/files.sunxi Tue Jun 28 03:13:27 2022 +0000
+++ b/sys/arch/arm/sunxi/files.sunxi Tue Jun 28 05:19:03 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.sunxi,v 1.70 2021/11/07 17:13:12 jmcneill Exp $
+# $NetBSD: files.sunxi,v 1.71 2022/06/28 05:19:03 skrll Exp $
#
# Configuration info for Allwinner sunxi family SoCs
#
@@ -137,6 +137,7 @@
file arch/arm/sunxi/sun7i_a20_gpio.c sunxi_gpio & soc_sun7i_a20
file arch/arm/sunxi/sun8i_a83t_gpio.c sunxi_gpio & soc_sun8i_a83t
file arch/arm/sunxi/sun8i_h3_gpio.c sunxi_gpio & soc_sun8i_h3
+file arch/arm/sunxi/sun8i_v3s_gpio.c sunxi_gpio & soc_sun8i_v3s
file arch/arm/sunxi/sun9i_a80_gpio.c sunxi_gpio & soc_sun9i_a80
file arch/arm/sunxi/sun50i_a64_gpio.c sunxi_gpio & soc_sun50i_a64
file arch/arm/sunxi/sun50i_h6_gpio.c sunxi_gpio & soc_sun50i_h6
diff -r aee142e93b08 -r 5e5e416764b9 sys/arch/arm/sunxi/sun8i_v3s_gpio.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/arm/sunxi/sun8i_v3s_gpio.c Tue Jun 28 05:19:03 2022 +0000
@@ -0,0 +1,102 @@
+/* $NetBSD: sun8i_v3s_gpio.c,v 1.1 2022/06/28 05:19:03 skrll Exp $ */
+
+/*-
+ * Copyright (c) 2021 Rui-Xiang Guo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: sun8i_v3s_gpio.c,v 1.1 2022/06/28 05:19:03 skrll Exp $");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/types.h>
+
+#include <arm/sunxi/sunxi_gpio.h>
+
+static const struct sunxi_gpio_pins v3s_pins[] = {
+ {"PB0", 1, 0, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "irq", NULL}, 6, 0},
+ {"PB1", 1, 1, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "irq", NULL}, 6, 1},
+ {"PB2", 1, 2, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "irq", NULL}, 6, 2},
+ {"PB3", 1, 3, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "irq", NULL}, 6, 3},
+ {"PB4", 1, 4, {"gpio_in", "gpio_out", "pwm0", NULL, NULL, NULL, "irq", NULL}, 6, 4},
+ {"PB5", 1, 5, {"gpio_in", "gpio_out", "pwm1", NULL, NULL, NULL, "irq", NULL}, 6, 5},
+ {"PB6", 1, 6, {"gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, "irq", NULL}, 6, 6},
+ {"PB7", 1, 7, {"gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, "irq", NULL}, 6, 7},
+ {"PB8", 1, 8, {"gpio_in", "gpio_out", "i2c1", "uart0", NULL, NULL, "irq", NULL}, 6, 8},
+ {"PB9", 1, 9, {"gpio_in", "gpio_out", "i2c1", "uart0", NULL, NULL, "irq", NULL}, 6, 9},
+
+ {"PC0", 2, 0, {"gpio_in", "gpio_out", "mmc2", "spi0", NULL, NULL, NULL, NULL}},
+ {"PC1", 2, 1, {"gpio_in", "gpio_out", "mmc2", "spi0", NULL, NULL, NULL, NULL}},
+ {"PC2", 2, 2, {"gpio_in", "gpio_out", "mmc2", "spi0", NULL, NULL, NULL, NULL}},
+ {"PC3", 2, 3, {"gpio_in", "gpio_out", "mmc2", "spi0", NULL, NULL, NULL, NULL}},
+
+ {"PE0", 4, 0, {"gpio_in", "gpio_out", "csi", "lcd", NULL, NULL, NULL, NULL}},
+ {"PE1", 4, 1, {"gpio_in", "gpio_out", "csi", "lcd", NULL, NULL, NULL, NULL}},
+ {"PE2", 4, 2, {"gpio_in", "gpio_out", "csi", "lcd", NULL, NULL, NULL, NULL}},
+ {"PE3", 4, 3, {"gpio_in", "gpio_out", "csi", "lcd", NULL, NULL, NULL, NULL}},
+ {"PE4", 4, 4, {"gpio_in", "gpio_out", "csi", "lcd", NULL, NULL, NULL, NULL}},
+ {"PE5", 4, 5, {"gpio_in", "gpio_out", "csi", "lcd", NULL, NULL, NULL, NULL}},
+ {"PE6", 4, 6, {"gpio_in", "gpio_out", "csi", "lcd", NULL, NULL, NULL, NULL}},
+ {"PE7", 4, 7, {"gpio_in", "gpio_out", "csi", "lcd", NULL, NULL, NULL, NULL}},
+ {"PE8", 4, 8, {"gpio_in", "gpio_out", "csi", "lcd", NULL, NULL, NULL, NULL}},
+ {"PE9", 4, 9, {"gpio_in", "gpio_out", "csi", "lcd", NULL, NULL, NULL, NULL}},
+ {"PE10", 4, 10, {"gpio_in", "gpio_out", "csi", "lcd", NULL, NULL, NULL, NULL}},
+ {"PE11", 4, 11, {"gpio_in", "gpio_out", "csi", "lcd", NULL, NULL, NULL, NULL}},
+ {"PE12", 4, 12, {"gpio_in", "gpio_out", "csi", "lcd", NULL, NULL, NULL, NULL}},
+ {"PE13", 4, 13, {"gpio_in", "gpio_out", "csi", "lcd", NULL, NULL, NULL, NULL}},
+ {"PE14", 4, 14, {"gpio_in", "gpio_out", "csi", "lcd", NULL, NULL, NULL, NULL}},
+ {"PE15", 4, 15, {"gpio_in", "gpio_out", "csi", "lcd", NULL, NULL, NULL, NULL}},
+ {"PE16", 4, 16, {"gpio_in", "gpio_out", "csi", "lcd", NULL, NULL, NULL, NULL}},
+ {"PE17", 4, 17, {"gpio_in", "gpio_out", "csi", "lcd", NULL, NULL, NULL, NULL}},
+ {"PE18", 4, 18, {"gpio_in", "gpio_out", "csi", "lcd", NULL, NULL, NULL, NULL}},
+ {"PE19", 4, 19, {"gpio_in", "gpio_out", "csi", "lcd", NULL, NULL, NULL, NULL}},
+ {"PE20", 4, 20, {"gpio_in", "gpio_out", "csi", "csi_mipi", NULL, NULL, NULL, NULL}},
+ {"PE21", 4, 21, {"gpio_in", "gpio_out", "csi", "i2c1", "uart1", NULL, NULL, NULL}},
+ {"PE22", 4, 22, {"gpio_in", "gpio_out", "csi", "i2c1", "uart1", NULL, NULL, NULL}},
+ {"PE23", 4, 23, {"gpio_in", "gpio_out", "lcd", "uart1", NULL, NULL, NULL, NULL}},
+ {"PE24", 4, 24, {"gpio_in", "gpio_out", "lcd", "uart1", NULL, NULL, NULL, NULL}},
+
+ {"PF0", 5, 0, {"gpio_in", "gpio_out", "mmc0", "jtag", NULL, NULL, NULL, NULL}},
+ {"PF1", 5, 1, {"gpio_in", "gpio_out", "mmc0", "jtag", NULL, NULL, NULL, NULL}},
+ {"PF2", 5, 2, {"gpio_in", "gpio_out", "mmc0", "uart0", NULL, NULL, NULL, NULL}},
+ {"PF3", 5, 3, {"gpio_in", "gpio_out", "mmc0", "jtag", NULL, NULL, NULL, NULL}},
+ {"PF4", 5, 4, {"gpio_in", "gpio_out", "mmc0", "uart0", NULL, NULL, NULL, NULL}},
+ {"PF5", 5, 5, {"gpio_in", "gpio_out", "mmc0", "jtag", NULL, NULL, NULL, NULL}},
+ {"PF6", 5, 6, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, NULL}},
+
+ {"PG0", 6, 0, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "irq", NULL}, 6, 0},
+ {"PG1", 6, 1, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "irq", NULL}, 6, 1},
+ {"PG2", 6, 2, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "irq", NULL}, 6, 2},
+ {"PG3", 6, 3, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "irq", NULL}, 6, 3},
+ {"PG4", 6, 4, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "irq", NULL}, 6, 4},
+ {"PG5", 6, 5, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "irq", NULL}, 6, 5},
+};
+
+const struct sunxi_gpio_padconf sun8i_v3s_padconf = {
+ .npins = __arraycount(v3s_pins),
+ .pins = v3s_pins,
+};
diff -r aee142e93b08 -r 5e5e416764b9 sys/arch/arm/sunxi/sunxi_de2_ccu.c
--- a/sys/arch/arm/sunxi/sunxi_de2_ccu.c Tue Jun 28 03:13:27 2022 +0000
+++ b/sys/arch/arm/sunxi/sunxi_de2_ccu.c Tue Jun 28 05:19:03 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_de2_ccu.c,v 1.7 2021/01/27 03:10:20 thorpej Exp $ */
+/* $NetBSD: sunxi_de2_ccu.c,v 1.8 2022/06/28 05:19:03 skrll Exp $ */
/*-
* Copyright (c) 2019 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: sunxi_de2_ccu.c,v 1.7 2021/01/27 03:10:20 thorpej Exp $");
+__KERNEL_RCSID(1, "$NetBSD: sunxi_de2_ccu.c,v 1.8 2022/06/28 05:19:03 skrll Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -100,6 +100,8 @@
static const struct device_compatible_entry compat_data[] = {
{ .compat = "allwinner,sun8i-h3-de2-clk",
.data = &sun8i_h3_de2_config },
+ { .compat = "allwinner,sun8i-v3s-de2-clk",
+ .data = &sun8i_h3_de2_config },
{ .compat = "allwinner,sun50i-a64-de2-clk",
.data = &sun50i_a64_de2_config },
{ .compat = "allwinner,sun50i-h5-de2-clk",
diff -r aee142e93b08 -r 5e5e416764b9 sys/arch/arm/sunxi/sunxi_drm.c
--- a/sys/arch/arm/sunxi/sunxi_drm.c Tue Jun 28 03:13:27 2022 +0000
+++ b/sys/arch/arm/sunxi/sunxi_drm.c Tue Jun 28 05:19:03 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_drm.c,v 1.24 2022/04/21 21:22:25 andvar Exp $ */
+/* $NetBSD: sunxi_drm.c,v 1.25 2022/06/28 05:19:03 skrll Exp $ */
/*-
* Copyright (c) 2019 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunxi_drm.c,v 1.24 2022/04/21 21:22:25 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_drm.c,v 1.25 2022/06/28 05:19:03 skrll Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -69,6 +69,7 @@
static const struct device_compatible_entry compat_data[] = {
{ .compat = "allwinner,sun8i-h3-display-engine" },
+ { .compat = "allwinner,sun8i-v3s-display-engine" },
{ .compat = "allwinner,sun50i-a64-display-engine" },
DEVICE_COMPAT_EOL
};
diff -r aee142e93b08 -r 5e5e416764b9 sys/arch/arm/sunxi/sunxi_emac.c
--- a/sys/arch/arm/sunxi/sunxi_emac.c Tue Jun 28 03:13:27 2022 +0000
+++ b/sys/arch/arm/sunxi/sunxi_emac.c Tue Jun 28 05:19:03 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_emac.c,v 1.35 2021/12/31 14:25:22 riastradh Exp $ */
+/* $NetBSD: sunxi_emac.c,v 1.36 2022/06/28 05:19:03 skrll Exp $ */
/*-
* Copyright (c) 2016-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -33,7 +33,7 @@
#include "opt_net_mpsafe.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunxi_emac.c,v 1.35 2021/12/31 14:25:22 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_emac.c,v 1.36 2022/06/28 05:19:03 skrll Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -134,6 +134,7 @@
static const struct device_compatible_entry compat_data[] = {
{ .compat = "allwinner,sun8i-a83t-emac", .value = EMAC_A83T },
{ .compat = "allwinner,sun8i-h3-emac", .value = EMAC_H3 },
+ { .compat = "allwinner,sun8i-v3s-emac", .value = EMAC_H3 },
{ .compat = "allwinner,sun50i-a64-emac", .value = EMAC_A64 },
{ .compat = "allwinner,sun50i-h6-emac", .value = EMAC_H6 },
DEVICE_COMPAT_EOL
diff -r aee142e93b08 -r 5e5e416764b9 sys/arch/arm/sunxi/sunxi_gpio.c
--- a/sys/arch/arm/sunxi/sunxi_gpio.c Tue Jun 28 03:13:27 2022 +0000
+++ b/sys/arch/arm/sunxi/sunxi_gpio.c Tue Jun 28 05:19:03 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_gpio.c,v 1.37 2021/08/07 16:18:45 thorpej Exp $ */
+/* $NetBSD: sunxi_gpio.c,v 1.38 2022/06/28 05:19:03 skrll Exp $ */
/*-
* Copyright (c) 2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -29,7 +29,7 @@
#include "opt_soc.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunxi_gpio.c,v 1.37 2021/08/07 16:18:45 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_gpio.c,v 1.38 2022/06/28 05:19:03 skrll Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -111,6 +111,10 @@
{ .compat = "allwinner,sun8i-h3-r-pinctrl",
.data = &sun8i_h3_r_padconf },
#endif
+#ifdef SOC_SUN8I_V3S
+ { .compat = "allwinner,sun8i-v3s-pinctrl",
+ .data = &sun8i_v3s_padconf },
+#endif
#ifdef SOC_SUN9I_A80
{ .compat = "allwinner,sun9i-a80-pinctrl",
.data = &sun9i_a80_padconf },
diff -r aee142e93b08 -r 5e5e416764b9 sys/arch/arm/sunxi/sunxi_gpio.h
--- a/sys/arch/arm/sunxi/sunxi_gpio.h Tue Jun 28 03:13:27 2022 +0000
+++ b/sys/arch/arm/sunxi/sunxi_gpio.h Tue Jun 28 05:19:03 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_gpio.h,v 1.9 2019/05/27 23:27:14 jmcneill Exp $ */
+/* $NetBSD: sunxi_gpio.h,v 1.10 2022/06/28 05:19:03 skrll Exp $ */
/*-
* Copyright (c) 2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -79,6 +79,10 @@
extern const struct sunxi_gpio_padconf sun8i_h3_r_padconf;
#endif
+#ifdef SOC_SUN8I_V3S
+extern const struct sunxi_gpio_padconf sun8i_v3s_padconf;
+#endif
+
#ifdef SOC_SUN9I_A80
extern const struct sunxi_gpio_padconf sun9i_a80_padconf;
extern const struct sunxi_gpio_padconf sun9i_a80_r_padconf;
diff -r aee142e93b08 -r 5e5e416764b9 sys/arch/arm/sunxi/sunxi_lcdc.c
--- a/sys/arch/arm/sunxi/sunxi_lcdc.c Tue Jun 28 03:13:27 2022 +0000
+++ b/sys/arch/arm/sunxi/sunxi_lcdc.c Tue Jun 28 05:19:03 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_lcdc.c,v 1.14 2021/12/19 11:01:10 riastradh Exp $ */
+/* $NetBSD: sunxi_lcdc.c,v 1.15 2022/06/28 05:19:03 skrll Exp $ */
/*-
* Copyright (c) 2019 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunxi_lcdc.c,v 1.14 2021/12/19 11:01:10 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_lcdc.c,v 1.15 2022/06/28 05:19:03 skrll Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -109,6 +109,7 @@
static const struct device_compatible_entry compat_data[] = {
{ .compat = "allwinner,sun8i-h3-tcon-tv", .value = TYPE_TCON1 },
+ { .compat = "allwinner,sun8i-v3s-tcon", .value = TYPE_TCON0 },
{ .compat = "allwinner,sun50i-a64-tcon-lcd", .value = TYPE_TCON0 },
{ .compat = "allwinner,sun50i-a64-tcon-tv", .value = TYPE_TCON1 },
DEVICE_COMPAT_EOL
diff -r aee142e93b08 -r 5e5e416764b9 sys/arch/arm/sunxi/sunxi_mixer.c
--- a/sys/arch/arm/sunxi/sunxi_mixer.c Tue Jun 28 03:13:27 2022 +0000
+++ b/sys/arch/arm/sunxi/sunxi_mixer.c Tue Jun 28 05:19:03 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_mixer.c,v 1.18 2021/12/19 11:01:10 riastradh Exp $ */
+/* $NetBSD: sunxi_mixer.c,v 1.19 2022/06/28 05:19:03 skrll Exp $ */
/*-
* Copyright (c) 2019 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunxi_mixer.c,v 1.18 2021/12/19 11:01:10 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_mixer.c,v 1.19 2022/06/28 05:19:03 skrll Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -203,6 +203,8 @@
static const struct device_compatible_entry compat_data[] = {
{ .compat = "allwinner,sun8i-h3-de2-mixer-0",
.data = &mixer0_data },
+ { .compat = "allwinner,sun8i-v3s-de2-mixer",
Home |
Main Index |
Thread Index |
Old Index