Page MenuHomeFreeBSD

D10383.id27402.diff
No OneTemporary

D10383.id27402.diff

Index: sys/arm/allwinner/a10_gpio.c
===================================================================
--- sys/arm/allwinner/a10_gpio.c
+++ sys/arm/allwinner/a10_gpio.c
@@ -111,7 +111,7 @@
#endif
/* Defined in h3_padconf.c */
-#ifdef SOC_ALLWINNER_H3
+#if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H2PLUS)
extern const struct allwinner_padconf h3_padconf;
extern const struct allwinner_padconf h3_r_padconf;
#endif
@@ -154,7 +154,7 @@
{"allwinner,sun8i-a83t-pinctrl", (uintptr_t)&a83t_padconf},
{"allwinner,sun8i-a83t-r-pinctrl", (uintptr_t)&a83t_r_padconf},
#endif
-#ifdef SOC_ALLWINNER_H3
+#if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H2PLUS)
{"allwinner,sun8i-h3-pinctrl", (uintptr_t)&h3_padconf},
{"allwinner,sun8i-h3-r-pinctrl", (uintptr_t)&h3_r_padconf},
#endif
Index: sys/arm/allwinner/aw_ccu.c
===================================================================
--- sys/arm/allwinner/aw_ccu.c
+++ sys/arm/allwinner/aw_ccu.c
@@ -83,6 +83,7 @@
{ "allwinner,sun8i-a33", CLOCK_CCU },
{ "allwinner,sun8i-a83t", CLOCK_CCU|CLOCK_PRCM|CLOCK_SYSCTRL },
{ "allwinner,sun8i-h3", CLOCK_CCU|CLOCK_PRCM },
+ { "allwinner,sun8i-h2-plus", CLOCK_CCU|CLOCK_PRCM },
{ NULL, 0 }
};
Index: sys/arm/allwinner/aw_machdep.h
===================================================================
--- sys/arm/allwinner/aw_machdep.h
+++ sys/arm/allwinner/aw_machdep.h
@@ -35,6 +35,7 @@
#define ALLWINNERSOC_A10S 0x10000001
#define ALLWINNERSOC_A20 0x20000000
#define ALLWINNERSOC_H3 0x30000000
+#define ALLWINNERSOC_H2PLUS 0x30000001
#define ALLWINNERSOC_A31 0x31000000
#define ALLWINNERSOC_A31S 0x31000001
#define ALLWINNERSOC_A33 0x33000000
Index: sys/arm/allwinner/aw_machdep.c
===================================================================
--- sys/arm/allwinner/aw_machdep.c
+++ sys/arm/allwinner/aw_machdep.c
@@ -61,6 +61,7 @@
static platform_attach_t a31s_attach;
static platform_attach_t a83t_attach;
static platform_attach_t h3_attach;
+static platform_attach_t h2plus_attach;
static platform_devmap_init_t allwinner_devmap_init;
static platform_cpu_reset_t allwinner_cpu_reset;
@@ -137,6 +138,15 @@
return (0);
}
+static int
+h2plus_attach(platform_t plat)
+{
+ soc_type = ALLWINNERSOC_H2PLUS;
+ soc_family = ALLWINNERSOC_SUN8I;
+
+ return (0);
+}
+
/*
* Set up static device mappings.
*
@@ -276,6 +286,21 @@
FDT_PLATFORM_DEF(h3, "h3", 0, "allwinner,sun8i-h3", 200);
#endif
+#if defined(SOC_ALLWINNER_H2PLUS)
+static platform_method_t h2plus_methods[] = {
+ PLATFORMMETHOD(platform_attach, h2plus_attach),
+ PLATFORMMETHOD(platform_devmap_init, allwinner_devmap_init),
+ PLATFORMMETHOD(platform_cpu_reset, allwinner_cpu_reset),
+
+#ifdef SMP
+ PLATFORMMETHOD(platform_mp_start_ap, aw_mp_start_ap),
+ PLATFORMMETHOD(platform_mp_setmaxid, aw_mp_setmaxid),
+#endif
+ PLATFORMMETHOD_END,
+};
+FDT_PLATFORM_DEF(h2plus, "h2plus", 0, "allwinner,sun8i-h2-plus", 200);
+#endif
+
u_int
allwinner_soc_type(void)
{
Index: sys/arm/allwinner/clkng/aw_ccung.c
===================================================================
--- sys/arm/allwinner/clkng/aw_ccung.c
+++ sys/arm/allwinner/clkng/aw_ccung.c
@@ -58,7 +58,7 @@
#include <arm/allwinner/clkng/ccu_a31.h>
#endif
-#if defined(SOC_ALLWINNER_H3)
+#if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H2PLUS)
#include <arm/allwinner/clkng/ccu_h3.h>
#endif
@@ -70,7 +70,7 @@
{ -1, 0 }
};
-#if defined(SOC_ALLWINNER_H3)
+#if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H2PLUS)
#define H3_CCU 1
#endif
@@ -79,7 +79,7 @@
#endif
static struct ofw_compat_data compat_data[] = {
-#if defined(SOC_ALLWINNER_H3)
+#if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H2PLUS)
{ "allwinner,sun8i-h3-ccu", H3_CCU },
#endif
#if defined(SOC_ALLWINNER_A31)
@@ -301,7 +301,7 @@
panic("Cannot create clkdom\n");
switch (sc->type) {
-#if defined(SOC_ALLWINNER_H3)
+#if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H2PLUS)
case H3_CCU:
ccu_h3_register_clocks(sc);
break;
Index: sys/arm/allwinner/h3/h3_padconf.c
===================================================================
--- sys/arm/allwinner/h3/h3_padconf.c
+++ sys/arm/allwinner/h3/h3_padconf.c
@@ -35,7 +35,7 @@
#include <arm/allwinner/allwinner_pinctrl.h>
-#ifdef SOC_ALLWINNER_H3
+#if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H2PLUS)
const static struct allwinner_pins h3_pins[] = {
{"PA0", 0, 0, {"gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "pa_eint0", NULL}, 6, 0},
@@ -144,4 +144,4 @@
.pins = h3_pins,
};
-#endif /* SOC_ALLWINNER_H3 */
+#endif /* SOC_ALLWINNER_H3 || SOC_ALLWINNER_H2PLUS */
Index: sys/arm/allwinner/h3/h3_r_padconf.c
===================================================================
--- sys/arm/allwinner/h3/h3_r_padconf.c
+++ sys/arm/allwinner/h3/h3_r_padconf.c
@@ -35,7 +35,7 @@
#include <arm/allwinner/allwinner_pinctrl.h>
-#ifdef SOC_ALLWINNER_H3
+#if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H2PLUS)
const static struct allwinner_pins h3_r_pins[] = {
{"PL0", 0, 0, {"gpio_in", "gpio_out", "s_twi", NULL, NULL, NULL, "pl_eint0", NULL}, 6, 0},
@@ -57,4 +57,4 @@
.pins = h3_r_pins,
};
-#endif /* SOC_ALLWINNER_H3 */
+#endif /* SOC_ALLWINNER_H3 || SOC_ALLWINNER_H2PLUS */
Index: sys/arm/conf/ALLWINNER
===================================================================
--- sys/arm/conf/ALLWINNER
+++ sys/arm/conf/ALLWINNER
@@ -1,6 +1,6 @@
#
# ALLWINNER -- Custom configuration for the Allwinner A20, A31, A31S, A83T,
-# and H3 ARM SoCs.
+# H3 and H2+ ARM SoCs.
#
# For more information on this file, please read the config(5) manual page,
# and/or the handbook section on Kernel Configuration Files:
@@ -33,6 +33,7 @@
options SOC_ALLWINNER_A31S
options SOC_ALLWINNER_A83T
options SOC_ALLWINNER_H3
+options SOC_ALLWINNER_H2PLUS
options SCHED_ULE # ULE scheduler
options SMP # Enable multiple cores
Index: sys/arm/conf/GENERIC
===================================================================
--- sys/arm/conf/GENERIC
+++ sys/arm/conf/GENERIC
@@ -54,6 +54,7 @@
options SOC_ALLWINNER_A33
options SOC_ALLWINNER_A83T
options SOC_ALLWINNER_H3
+options SOC_ALLWINNER_H2PLUS
options SOC_BCM2836
options SOC_TI_AM335X
options SOC_OMAP4
Index: sys/boot/fdt/dts/arm/orangepi-zero.dts
===================================================================
--- /dev/null
+++ sys/boot/fdt/dts/arm/orangepi-zero.dts
@@ -0,0 +1,69 @@
+/*-
+ * Copyright (c) 2016 Jared McNeill <jmcneill@invisible.ca>
+ * 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.
+ *
+ * $FreeBSD$
+ */
+
+#include "sun8i-h2-plus-orangepi-zero.dts"
+#include "h3.dtsi"
+
+/ {
+ vdd_cpu: reg_cpux_vset {
+ compatible = "regulator-gpio";
+
+ regulator-name = "cpux-supply";
+ regulator-min-microvolt = <1100000>;
+ regulator-max-microvolt = <1300000>;
+ regulator-boot-on;
+
+ gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* GPIOL6 */
+ states = <1300000 0x1
+ 1100000 0x0>;
+
+ enable-active-high;
+ };
+};
+
+&emac {
+ phy = <&phy1>;
+ phy-mode = "mii";
+ allwinner,use-internal-phy;
+ allwinner,leds-active-low;
+ status = "okay";
+
+ phy1: ethernet-phy@1 {
+ reg = <1>;
+ };
+};
+
+&cpu0 {
+ cpu-supply = <&vdd_cpu>;
+ operating-points = <
+ /* kHz uV */
+ 1008000 1300000
+ 816000 1100000
+ 480000 1100000
+ >;
+};
Index: sys/conf/options.arm
===================================================================
--- sys/conf/options.arm
+++ sys/conf/options.arm
@@ -50,6 +50,7 @@
SOC_ALLWINNER_A33 opt_global.h
SOC_ALLWINNER_A83T opt_global.h
SOC_ALLWINNER_H3 opt_global.h
+SOC_ALLWINNER_H2PLUS opt_global.h
SOC_ALTERA_ARRIA10 opt_global.h
SOC_ALTERA_CYCLONE5 opt_global.h
SOC_BCM2835 opt_global.h
Index: sys/gnu/dts/arm/sun8i-h2-plus-orangepi-zero.dts
===================================================================
--- /dev/null
+++ sys/gnu/dts/arm/sun8i-h2-plus-orangepi-zero.dts
@@ -0,0 +1,160 @@
+/*
+ * Copyright (C) 2016 Icenowy Zheng <icenowy@aosc.xyz>
+ *
+ * Based on sun8i-h3-orangepi-one.dts, which is:
+ * Copyright (C) 2016 Hans de Goede <hdegoede@redhat.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ * a) This file is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ * b) Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun8i-h3.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+
+/ {
+ model = "Xunlong Orange Pi Zero";
+ compatible = "xunlong,orangepi-zero", "allwinner,sun8i-h2-plus";
+
+ aliases {
+ serial0 = &uart0;
+ /* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */
+ ethernet1 = &xr819;
+ };
+
+ chosen {
+ stdout-path = "serial0:115200n8";
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ pwr_led {
+ label = "orangepi:green:pwr";
+ gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
+ default-state = "on";
+ };
+
+ status_led {
+ label = "orangepi:red:status";
+ gpios = <&pio 0 17 GPIO_ACTIVE_HIGH>;
+ };
+ };
+
+ reg_vcc_wifi: reg_vcc_wifi {
+ compatible = "regulator-fixed";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-name = "vcc-wifi";
+ enable-active-high;
+ gpio = <&pio 0 20 GPIO_ACTIVE_HIGH>;
+ };
+
+ wifi_pwrseq: wifi_pwrseq {
+ compatible = "mmc-pwrseq-simple";
+ reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>;
+ post-power-on-delay-ms = <200>;
+ };
+};
+
+&ehci1 {
+ status = "okay";
+};
+
+&mmc0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&mmc0_pins_a>;
+ vmmc-supply = <&reg_vcc3v3>;
+ bus-width = <4>;
+ cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
+ cd-inverted;
+ status = "okay";
+};
+
+&mmc1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&mmc1_pins_a>;
+ vmmc-supply = <&reg_vcc_wifi>;
+ mmc-pwrseq = <&wifi_pwrseq>;
+ bus-width = <4>;
+ non-removable;
+ status = "okay";
+
+ /*
+ * Explicitly define the sdio device, so that we can add an ethernet
+ * alias for it (which e.g. makes u-boot set a mac-address).
+ */
+ xr819: sdio_wifi@1 {
+ reg = <1>;
+ };
+};
+
+&mmc1_pins_a {
+ bias-pull-up;
+};
+
+&ohci1 {
+ status = "okay";
+};
+
+&uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pins_a>;
+ status = "okay";
+};
+
+&uart1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart1_pins>;
+ status = "disabled";
+};
+
+&uart2 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart2_pins>;
+ status = "disabled";
+};
+
+&usbphy {
+ /* USB VBUS is always on */
+ status = "okay";
+};
Index: sys/modules/dtb/allwinner/Makefile
===================================================================
--- sys/modules/dtb/allwinner/Makefile
+++ sys/modules/dtb/allwinner/Makefile
@@ -3,6 +3,7 @@
DTS= \
nanopi-neo.dts \
orangepi-plus-2e.dts \
+ orangepi-zero.dts \
sinovoip-bpi-m3.dts \
sun4i-a10-cubieboard.dts \
sun4i-a10-olinuxino-lime.dts \

File Metadata

Mime Type
text/plain
Expires
Thu, Mar 12, 12:44 AM (6 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29558081
Default Alt Text
D10383.id27402.diff (13 KB)

Event Timeline