Message ID | 20221114172018.1876608-2-martin.botka@somainline.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2267194wru; Mon, 14 Nov 2022 09:27:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf5SOduTpxhkbQVS4WkYooG6OiaQlcMs/DF71JWJk4z6w+TCqUAx2052C3vJJkoOVOkvMqjr X-Received: by 2002:aa7:cb92:0:b0:459:f897:7940 with SMTP id r18-20020aa7cb92000000b00459f8977940mr11476358edt.168.1668446878711; Mon, 14 Nov 2022 09:27:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668446878; cv=none; d=google.com; s=arc-20160816; b=KGHKUtaDmCDORkbaqcDsrTQ0j6pkadlcjoLO6TYhpz8hkJBg/XfQ9Yd8F2vq58H5hP bAX3FKH/+Jeca/ZaYNKS7rkEani3xqodUqI49dzKJ8lETrieqwzXdRUVr2CTcd77NeWB VMJrWFu7MnH0Wkej+602Xy6nhVkL+h9kIHrhkh5XNgr0Xbj0DscaA1y8R/CZ2+OxW5OX OqH1cm4oedvlfZVBEqZlV+/QUe7JBdyzekjthJVwMO5jek2GEl0t18sGuFLDsLdrDHHH RyNHPnbl6WWDedww+yrCdBA/YuemF7sZtmREtsa6rk4JaWvfhBsFykcn4scfHqEBVnLI P6Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=E+00wwNmTL4YkPfSkYX1nJaXwck5o6xk5DX0DJQ7cKM=; b=ogbx9PC+Ty6JFHdDjOMeFtKrtyl9ctGqr6I0eWS/5xMIUWjYTP0Im4VURIONIHBFon bF3wiipLdA51nkBBgT8sCZxnOc7IFwBzuPCcJUUqRTfG5EShMy71ko0T3P6t8WCJkk8G h55wEZG2PxVP96j9MdnZ/zLU/8jSStGE8lwdBgbn9y1fgA31nmg16etl+yvLuiRmV71M Ts45brZgugRuRXMQz0XAYrzGegbiu0frzMSZEssv0jz4c6/N6v5OLUTsQbqyAn+YPs8c Mh26r0GtoYXJem7mZR1mqMZc0KzpkfKw8zsDzbqpjO/QoSb3MARgdFrxIFsGjrY5Y194 beBA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e2-20020a1709061e8200b0073d8f141e76si7565796ejj.130.2022.11.14.09.27.13; Mon, 14 Nov 2022 09:27:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234803AbiKNRVB (ORCPT <rfc822;zwp10758@gmail.com> + 99 others); Mon, 14 Nov 2022 12:21:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237980AbiKNRUg (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 14 Nov 2022 12:20:36 -0500 Received: from relay03.th.seeweb.it (relay03.th.seeweb.it [5.144.164.164]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9E181F2C8 for <linux-kernel@vger.kernel.org>; Mon, 14 Nov 2022 09:20:35 -0800 (PST) Received: from TimeMachine.lan (bband-dyn193.178-41-216.t-com.sk [178.41.216.193]) by m-r1.th.seeweb.it (Postfix) with ESMTPA id CA7681F68A; Mon, 14 Nov 2022 18:20:33 +0100 (CET) From: Martin Botka <martin.botka@somainline.org> To: martin.botka1@gmail.com Cc: ~postmarketos/upstreaming@lists.sr.ht, Konrad Dybcio <konrad.dybcio@somainline.org>, AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>, Marijn Suijten <marijn.suijten@somainline.org>, Jami Kettunen <jamipkettunen@somainline.org>, Paul Bouchara <paul.bouchara@somainline.org>, Yenda <jtrmal@gmail.com>, Martin Botka <martin.botka@somainline.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Chen-Yu Tsai <wens@csie.org>, Jernej Skrabec <jernej.skrabec@gmail.com>, Samuel Holland <samuel@sholland.org>, Andre Przywara <andre.przywara@arm.com>, Maxime Ripard <maxime@cerno.tech>, Andrew Lunn <andrew@lunn.ch>, Conley Lee <conleylee@foxmail.com>, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH V2 2/2] arm64: dts: Add basic support for BIQU CB1 Date: Mon, 14 Nov 2022 18:20:16 +0100 Message-Id: <20221114172018.1876608-2-martin.botka@somainline.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221114172018.1876608-1-martin.botka@somainline.org> References: <20221114172018.1876608-1-martin.botka@somainline.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749493354166095275?= X-GMAIL-MSGID: =?utf-8?q?1749493354166095275?= |
Series |
[V2,1/2] dt-bindings: arm: sunxi: Add BIQU CB1
|
|
Commit Message
Martin Botka
Nov. 14, 2022, 5:20 p.m. UTC
CB1 is Compute Module style board that plugs into Rpi board style adapter or
Manta 3D printer boards (M4P/M8P).
The board has:
H616 SoC
1GB of RAM
AXP313A PMIC
And the actual boards that CB1 plugs in are just extension to it with ports and
thus are not split in DT.
Boards have:
4x (3x for Manta boards) USB and 1 USB OTG.
SDcard slot for loading images.
Ethernet port wired to the internal PHY.
2x HDMI 2.0.
Power and Status LEDs.
Currently working:
Booting
USB
UART
Signed-off-by: Martin Botka <martin.botka@somainline.org>
---
Changes in V2:
Add proper board compatible
Add regulator prefix for vcc5v
Drop okay status from PMIC
Drop standby_param
arch/arm64/boot/dts/allwinner/Makefile | 1 +
.../dts/allwinner/sun50i-h616-biqu-cb1.dts | 186 ++++++++++++++++++
2 files changed, 187 insertions(+)
create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h616-biqu-cb1.dts
Comments
Hi Martin, Dne ponedeljek, 14. november 2022 ob 18:20:16 CET je Martin Botka napisal(a): > CB1 is Compute Module style board that plugs into Rpi board style adapter or > Manta 3D printer boards (M4P/M8P). > > The board has: > H616 SoC > 1GB of RAM > AXP313A PMIC > > And the actual boards that CB1 plugs in are just extension to it with ports > and thus are not split in DT. > > Boards have: > 4x (3x for Manta boards) USB and 1 USB OTG. > SDcard slot for loading images. > Ethernet port wired to the internal PHY. > 2x HDMI 2.0. > Power and Status LEDs. > > Currently working: > Booting > USB > UART > > Signed-off-by: Martin Botka <martin.botka@somainline.org> > --- > Changes in V2: > Add proper board compatible > Add regulator prefix for vcc5v > Drop okay status from PMIC > Drop standby_param > arch/arm64/boot/dts/allwinner/Makefile | 1 + > .../dts/allwinner/sun50i-h616-biqu-cb1.dts | 186 ++++++++++++++++++ > 2 files changed, 187 insertions(+) > create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h616-biqu-cb1.dts > > diff --git a/arch/arm64/boot/dts/allwinner/Makefile > b/arch/arm64/boot/dts/allwinner/Makefile index 6a96494a2e0a..223f1be73541 > 100644 > --- a/arch/arm64/boot/dts/allwinner/Makefile > +++ b/arch/arm64/boot/dts/allwinner/Makefile > @@ -38,5 +38,6 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-pine-h64.dtb > dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-pine-h64-model-b.dtb > dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-tanix-tx6.dtb > dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-tanix-tx6-mini.dtb > +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-biqu-cb1.dtb > dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-orangepi-zero2.dtb > dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-x96-mate.dtb > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-biqu-cb1.dts > b/arch/arm64/boot/dts/allwinner/sun50i-h616-biqu-cb1.dts new file mode > 100644 > index 000000000000..297536d7629a > --- /dev/null > +++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-biqu-cb1.dts > @@ -0,0 +1,186 @@ > +// SPDX-License-Identifier: (GPL-2.0+ or MIT) > +/* > + * Copyright (C) 2022 Arm Ltd. I suppose Arm Ltd. has nothing to do with this board? Put yours copyrights there. > + */ > + > +/dts-v1/; > + > +#include "sun50i-h616.dtsi" > + > +#include <dt-bindings/gpio/gpio.h> > +#include <dt-bindings/interrupt-controller/arm-gic.h> > +#include <dt-bindings/leds/common.h> > + > +/ { > + model = "BIQU CB1"; > + compatible = "biqu,cb1", "allwinner,sun50i-h616"; > + > + aliases { > + serial0 = &uart0; > + }; > + > + chosen { > + stdout-path = "serial0:115200n8"; > + }; > + > + leds { > + compatible = "gpio-leds"; > + > + led-0 { > + function = LED_FUNCTION_POWER; > + color = <LED_COLOR_ID_RED>; > + gpios = <&pio 2 12 GPIO_ACTIVE_HIGH>; /* PC12 */ > + default-state = "on"; > + }; > + > + led-1 { > + function = LED_FUNCTION_STATUS; > + color = <LED_COLOR_ID_GREEN>; > + gpios = <&pio 2 13 GPIO_ACTIVE_HIGH>; /* PC13 */ > + }; > + }; > + > + reg_vcc5v: regulator_vcc5v { > + /* board wide 5V supply directly from the USB-C socket */ > + compatible = "regulator-fixed"; > + regulator-name = "vcc-5v"; > + regulator-min-microvolt = <5000000>; > + regulator-max-microvolt = <5000000>; > + regulator-always-on; > + }; > + > + reg_usb1_vbus: regulator-usb1-vbus { > + compatible = "regulator-fixed"; > + regulator-name = "usb1-vbus"; > + regulator-min-microvolt = <5000000>; > + regulator-max-microvolt = <5000000>; > + vin-supply = <®_vcc5v>; > + enable-active-high; > + gpio = <&pio 2 16 GPIO_ACTIVE_HIGH>; /* PC16 */ > + }; > +}; > + > +&ehci0 { > + status = "okay"; > +}; > + > +&ehci1 { > + status = "okay"; > +}; > + > +&ehci2 { > + status = "okay"; > +}; > + > +&ehci3 { > + status = "okay"; > +}; > + > +&mmc0 { > + vmmc-supply = <®_dldo1>; > + cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ > + no-1-8-v; > + bus-width = <4>; > + status = "disabled"; > +}; > + > +&ohci0 { > + status = "okay"; > +}; > + > +&ohci1 { > + status = "okay"; > +}; > + > +&ohci2 { > + status = "okay"; > +}; > + > +&ohci3 { > + status = "okay"; > +}; > + > +&r_i2c { > + status = "okay"; > + > + axp1530: pmic@36 { > + compatible = "x-powers,axp1530"; I see that you send driver for this PMIC separately. Next time please mention that this series depends on another, otherwise checks will fail. Ping us here once PMIC driver is merged to unblock this. Anyway, RSB is prefered. Can you switch to it? > + reg = <0x36>; > + wakeup-source; > + > + regulators{ > + reg_dcdc1: dcdc1 { > + regulator-name = "axp1530-dcdc1"; > + regulator-min-microvolt = <500000>; > + regulator-max-microvolt = <3400000>; > + regulator-step-delay-us = <25>; > + regulator-final-delay-us = <50>; > + regulator-always-on; > + }; > + > + reg_dcdc2: dcdc2 { > + regulator-name = "axp1530-dcdc2"; > + regulator-min-microvolt = <500000>; > + regulator-max-microvolt = <1540000>; > + regulator-step-delay-us = <25>; > + regulator-final-delay-us = <50>; > + regulator-ramp-delay = <200>; > + regulator-always-on; > + }; > + > + reg_dcdc3: dcdc3 { > + regulator-name = "axp1530-dcdc3"; > + regulator-min-microvolt = <500000>; > + regulator-max-microvolt = <1840000>; > + regulator-step-delay-us = <25>; > + regulator-final-delay-us = <50>; > + regulator-always-on; > + }; > + > + reg_aldo1: ldo1 { > + regulator-name = "axp1530-aldo1"; > + regulator-min-microvolt = <1800000>; > + regulator-max-microvolt = <1800000>; > + regulator-step-delay-us = <25>; > + regulator-final-delay-us = <50>; > + regulator-always-on; > + }; > + > + reg_dldo1: ldo2 { > + regulator-name = "axp1530-dldo1"; > + regulator-min-microvolt = <3300000>; > + regulator-max-microvolt = <3300000>; > + regulator-step-delay-us = <25>; > + regulator-final-delay-us = <50>; > + regulator-always-on; > + }; > + }; > + }; > +}; > + > +&uart0 { > + pinctrl-names = "default"; > + pinctrl-0 = <&uart0_ph_pins>; > + status = "okay"; > +}; > + > +&usbotg { > + /* > + * PHY0 pins are connected to a USB-C socket, but a role switch > + * is not implemented: both CC pins are pulled to GND. > + * The VBUS pins power the device, so a fixed peripheral mode > + * is the best choice. > + * The board can be powered via GPIOs, in this case port0 *can* > + * act as a host (with a cable/adapter ignoring CC), as VBUS is > + * then provided by the GPIOs. Any user of this setup would > + * need to adjust the DT accordingly: dr_mode set to "host", > + * enabling OHCI0 and EHCI0. > + */ Above text is verbatim copy from OrangePi Zero2 and I'm not sure if it is fully accurate for this board too. Looking at board photo, it surely looks like this board has same USB design as Zero2. But if that's true, you shouldn't enable OHCI0 and EHCI0 nodes. Is there any board schematic publicly available for this board? Best regards, Jernej > + dr_mode = "peripheral"; > + status = "okay"; > +}; > + > +&usbphy { > + usb1_vbus-supply = <®_usb1_vbus>; > + status = "okay"; > +};
On Mon, Nov 14 2022 at 09:16:29 PM +01:00:00, Jernej Škrabec <jernej.skrabec@gmail.com> wrote: > Hi Martin, > > Dne ponedeljek, 14. november 2022 ob 18:20:16 CET je Martin Botka > napisal(a): >> CB1 is Compute Module style board that plugs into Rpi board style >> adapter or >> Manta 3D printer boards (M4P/M8P). >> >> The board has: >> H616 SoC >> 1GB of RAM >> AXP313A PMIC >> >> And the actual boards that CB1 plugs in are just extension to it >> with ports >> and thus are not split in DT. >> >> Boards have: >> 4x (3x for Manta boards) USB and 1 USB OTG. >> SDcard slot for loading images. >> Ethernet port wired to the internal PHY. >> 2x HDMI 2.0. >> Power and Status LEDs. >> >> Currently working: >> Booting >> USB >> UART >> >> Signed-off-by: Martin Botka <martin.botka@somainline.org> >> --- >> Changes in V2: >> Add proper board compatible >> Add regulator prefix for vcc5v >> Drop okay status from PMIC >> Drop standby_param >> arch/arm64/boot/dts/allwinner/Makefile | 1 + >> .../dts/allwinner/sun50i-h616-biqu-cb1.dts | 186 >> ++++++++++++++++++ >> 2 files changed, 187 insertions(+) >> create mode 100644 >> arch/arm64/boot/dts/allwinner/sun50i-h616-biqu-cb1.dts >> >> diff --git a/arch/arm64/boot/dts/allwinner/Makefile >> b/arch/arm64/boot/dts/allwinner/Makefile index >> 6a96494a2e0a..223f1be73541 >> 100644 >> --- a/arch/arm64/boot/dts/allwinner/Makefile >> +++ b/arch/arm64/boot/dts/allwinner/Makefile >> @@ -38,5 +38,6 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-pine-h64.dtb >> dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-pine-h64-model-b.dtb >> dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-tanix-tx6.dtb >> dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-tanix-tx6-mini.dtb >> +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-biqu-cb1.dtb >> dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-orangepi-zero2.dtb >> dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-x96-mate.dtb >> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-biqu-cb1.dts >> b/arch/arm64/boot/dts/allwinner/sun50i-h616-biqu-cb1.dts new file >> mode >> 100644 >> index 000000000000..297536d7629a >> --- /dev/null >> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-biqu-cb1.dts >> @@ -0,0 +1,186 @@ >> +// SPDX-License-Identifier: (GPL-2.0+ or MIT) >> +/* >> + * Copyright (C) 2022 Arm Ltd. > > I suppose Arm Ltd. has nothing to do with this board? Put yours > copyrights > there. Correct. Was a left over from Opi Zero 2 with just changed year. Will correct in V3 with the rest of the changes > >> + */ >> + >> +/dts-v1/; >> + >> +#include "sun50i-h616.dtsi" >> + >> +#include <dt-bindings/gpio/gpio.h> >> +#include <dt-bindings/interrupt-controller/arm-gic.h> >> +#include <dt-bindings/leds/common.h> >> + >> +/ { >> + model = "BIQU CB1"; >> + compatible = "biqu,cb1", "allwinner,sun50i-h616"; >> + >> + aliases { >> + serial0 = &uart0; >> + }; >> + >> + chosen { >> + stdout-path = "serial0:115200n8"; >> + }; >> + >> + leds { >> + compatible = "gpio-leds"; >> + >> + led-0 { >> + function = LED_FUNCTION_POWER; >> + color = <LED_COLOR_ID_RED>; >> + gpios = <&pio 2 12 GPIO_ACTIVE_HIGH>; /* > PC12 */ >> + default-state = "on"; >> + }; >> + >> + led-1 { >> + function = LED_FUNCTION_STATUS; >> + color = <LED_COLOR_ID_GREEN>; >> + gpios = <&pio 2 13 GPIO_ACTIVE_HIGH>; /* > PC13 */ >> + }; >> + }; >> + >> + reg_vcc5v: regulator_vcc5v { >> + /* board wide 5V supply directly from the USB-C socket > */ >> + compatible = "regulator-fixed"; >> + regulator-name = "vcc-5v"; >> + regulator-min-microvolt = <5000000>; >> + regulator-max-microvolt = <5000000>; >> + regulator-always-on; >> + }; >> + >> + reg_usb1_vbus: regulator-usb1-vbus { >> + compatible = "regulator-fixed"; >> + regulator-name = "usb1-vbus"; >> + regulator-min-microvolt = <5000000>; >> + regulator-max-microvolt = <5000000>; >> + vin-supply = <®_vcc5v>; >> + enable-active-high; >> + gpio = <&pio 2 16 GPIO_ACTIVE_HIGH>; /* PC16 */ >> + }; >> +}; >> + >> +&ehci0 { >> + status = "okay"; >> +}; >> + >> +&ehci1 { >> + status = "okay"; >> +}; >> + >> +&ehci2 { >> + status = "okay"; >> +}; >> + >> +&ehci3 { >> + status = "okay"; >> +}; >> + >> +&mmc0 { >> + vmmc-supply = <®_dldo1>; >> + cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ >> + no-1-8-v; >> + bus-width = <4>; >> + status = "disabled"; >> +}; >> + >> +&ohci0 { >> + status = "okay"; >> +}; >> + >> +&ohci1 { >> + status = "okay"; >> +}; >> + >> +&ohci2 { >> + status = "okay"; >> +}; >> + >> +&ohci3 { >> + status = "okay"; >> +}; >> + >> +&r_i2c { >> + status = "okay"; >> + >> + axp1530: pmic@36 { >> + compatible = "x-powers,axp1530"; > > I see that you send driver for this PMIC separately. Next time please > mention > that this series depends on another, otherwise checks will fail. Ping > us here > once PMIC driver is merged to unblock this. > > Anyway, RSB is prefered. Can you switch to it? RSB does initialize but as soon as I try to give it the PMIC via RSB it doesnt really wanna work so thats a no sadly. > >> + reg = <0x36>; >> + wakeup-source; >> + >> + regulators{ >> + reg_dcdc1: dcdc1 { >> + regulator-name = "axp1530-dcdc1"; >> + regulator-min-microvolt = > <500000>; >> + regulator-max-microvolt = > <3400000>; >> + regulator-step-delay-us = <25>; >> + regulator-final-delay-us = <50>; >> + regulator-always-on; >> + }; >> + >> + reg_dcdc2: dcdc2 { >> + regulator-name = "axp1530-dcdc2"; >> + regulator-min-microvolt = > <500000>; >> + regulator-max-microvolt = > <1540000>; >> + regulator-step-delay-us = <25>; >> + regulator-final-delay-us = <50>; >> + regulator-ramp-delay = <200>; >> + regulator-always-on; >> + }; >> + >> + reg_dcdc3: dcdc3 { >> + regulator-name = "axp1530-dcdc3"; >> + regulator-min-microvolt = > <500000>; >> + regulator-max-microvolt = > <1840000>; >> + regulator-step-delay-us = <25>; >> + regulator-final-delay-us = <50>; >> + regulator-always-on; >> + }; >> + >> + reg_aldo1: ldo1 { >> + regulator-name = "axp1530-aldo1"; >> + regulator-min-microvolt = > <1800000>; >> + regulator-max-microvolt = > <1800000>; >> + regulator-step-delay-us = <25>; >> + regulator-final-delay-us = <50>; >> + regulator-always-on; >> + }; >> + >> + reg_dldo1: ldo2 { >> + regulator-name = "axp1530-dldo1"; >> + regulator-min-microvolt = > <3300000>; >> + regulator-max-microvolt = > <3300000>; >> + regulator-step-delay-us = <25>; >> + regulator-final-delay-us = <50>; >> + regulator-always-on; >> + }; >> + }; >> + }; >> +}; >> + >> +&uart0 { >> + pinctrl-names = "default"; >> + pinctrl-0 = <&uart0_ph_pins>; >> + status = "okay"; >> +}; >> + >> +&usbotg { >> + /* >> + * PHY0 pins are connected to a USB-C socket, but a role switch >> + * is not implemented: both CC pins are pulled to GND. >> + * The VBUS pins power the device, so a fixed peripheral mode >> + * is the best choice. >> + * The board can be powered via GPIOs, in this case port0 *can* >> + * act as a host (with a cable/adapter ignoring CC), as VBUS is >> + * then provided by the GPIOs. Any user of this setup would >> + * need to adjust the DT accordingly: dr_mode set to "host", >> + * enabling OHCI0 and EHCI0. >> + */ > > Above text is verbatim copy from OrangePi Zero2 and I'm not sure if > it is > fully accurate for this board too. Looking at board photo, it surely > looks > like this board has same USB design as Zero2. But if that's true, you > shouldn't enable OHCI0 and EHCI0 nodes. Correct. But M8P has a dip switch that enables or disables usbotg. As for if it does anything its hard to say. > > Is there any board schematic publicly available for this board? This is one of the issues. Im in contact with BIQU and asking for the schematics. I hope we can get them released ASAP as it would help me as well. > > Best regards, > Jernej > >> + dr_mode = "peripheral"; >> + status = "okay"; >> +}; >> + >> +&usbphy { >> + usb1_vbus-supply = <®_usb1_vbus>; >> + status = "okay"; >> +}; > > Best Regards, Martin
Dne ponedeljek, 14. november 2022 ob 21:38:08 CET je Martin Botka napisal(a): > On Mon, Nov 14 2022 at 09:16:29 PM +01:00:00, Jernej Škrabec > > <jernej.skrabec@gmail.com> wrote: > > Hi Martin, > > > > Dne ponedeljek, 14. november 2022 ob 18:20:16 CET je Martin Botka > > > > napisal(a): > >> CB1 is Compute Module style board that plugs into Rpi board style > >> > >> adapter or > >> > >> Manta 3D printer boards (M4P/M8P). > >> > >> The board has: > >> H616 SoC > >> 1GB of RAM > >> AXP313A PMIC > >> > >> And the actual boards that CB1 plugs in are just extension to it > >> > >> with ports > >> > >> and thus are not split in DT. > >> > >> Boards have: > >> 4x (3x for Manta boards) USB and 1 USB OTG. > >> SDcard slot for loading images. > >> Ethernet port wired to the internal PHY. > >> 2x HDMI 2.0. > >> Power and Status LEDs. > >> > >> Currently working: > >> Booting > >> USB > >> UART > >> > >> Signed-off-by: Martin Botka <martin.botka@somainline.org> > >> --- > >> Changes in V2: > >> Add proper board compatible > >> Add regulator prefix for vcc5v > >> Drop okay status from PMIC > >> Drop standby_param > >> > >> arch/arm64/boot/dts/allwinner/Makefile | 1 + > >> .../dts/allwinner/sun50i-h616-biqu-cb1.dts | 186 > >> > >> ++++++++++++++++++ > >> > >> 2 files changed, 187 insertions(+) > >> create mode 100644 > >> > >> arch/arm64/boot/dts/allwinner/sun50i-h616-biqu-cb1.dts > >> > >> diff --git a/arch/arm64/boot/dts/allwinner/Makefile > >> b/arch/arm64/boot/dts/allwinner/Makefile index > >> > >> 6a96494a2e0a..223f1be73541 > >> > >> 100644 > >> --- a/arch/arm64/boot/dts/allwinner/Makefile > >> +++ b/arch/arm64/boot/dts/allwinner/Makefile > >> @@ -38,5 +38,6 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-pine-h64.dtb > >> > >> dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-pine-h64-model-b.dtb > >> dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-tanix-tx6.dtb > >> dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-tanix-tx6-mini.dtb > >> > >> +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-biqu-cb1.dtb > >> > >> dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-orangepi-zero2.dtb > >> dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-x96-mate.dtb > >> > >> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-biqu-cb1.dts > >> b/arch/arm64/boot/dts/allwinner/sun50i-h616-biqu-cb1.dts new file > >> > >> mode > >> > >> 100644 > >> index 000000000000..297536d7629a > >> --- /dev/null > >> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-biqu-cb1.dts > >> @@ -0,0 +1,186 @@ > >> +// SPDX-License-Identifier: (GPL-2.0+ or MIT) > >> +/* > >> + * Copyright (C) 2022 Arm Ltd. > > > > I suppose Arm Ltd. has nothing to do with this board? Put yours > > copyrights > > there. > > Correct. Was a left over from Opi Zero 2 with just changed year. Will > correct in V3 with the rest of the changes > > >> + */ > >> + > >> +/dts-v1/; > >> + > >> +#include "sun50i-h616.dtsi" > >> + > >> +#include <dt-bindings/gpio/gpio.h> > >> +#include <dt-bindings/interrupt-controller/arm-gic.h> > >> +#include <dt-bindings/leds/common.h> > >> + > >> +/ { > >> + model = "BIQU CB1"; > >> + compatible = "biqu,cb1", "allwinner,sun50i-h616"; > >> + > >> + aliases { > >> + serial0 = &uart0; > >> + }; > >> + > >> + chosen { > >> + stdout-path = "serial0:115200n8"; > >> + }; > >> + > >> + leds { > >> + compatible = "gpio-leds"; > >> + > >> + led-0 { > >> + function = LED_FUNCTION_POWER; > >> + color = <LED_COLOR_ID_RED>; > >> + gpios = <&pio 2 12 GPIO_ACTIVE_HIGH>; /* > > > > PC12 */ > > > >> + default-state = "on"; > >> + }; > >> + > >> + led-1 { > >> + function = LED_FUNCTION_STATUS; > >> + color = <LED_COLOR_ID_GREEN>; > >> + gpios = <&pio 2 13 GPIO_ACTIVE_HIGH>; /* > > > > PC13 */ > > > >> + }; > >> + }; > >> + > >> + reg_vcc5v: regulator_vcc5v { > >> + /* board wide 5V supply directly from the USB-C socket > > > > */ > > > >> + compatible = "regulator-fixed"; > >> + regulator-name = "vcc-5v"; > >> + regulator-min-microvolt = <5000000>; > >> + regulator-max-microvolt = <5000000>; > >> + regulator-always-on; > >> + }; > >> + > >> + reg_usb1_vbus: regulator-usb1-vbus { > >> + compatible = "regulator-fixed"; > >> + regulator-name = "usb1-vbus"; > >> + regulator-min-microvolt = <5000000>; > >> + regulator-max-microvolt = <5000000>; > >> + vin-supply = <®_vcc5v>; > >> + enable-active-high; > >> + gpio = <&pio 2 16 GPIO_ACTIVE_HIGH>; /* PC16 */ > >> + }; > >> +}; > >> + > >> +&ehci0 { > >> + status = "okay"; > >> +}; > >> + > >> +&ehci1 { > >> + status = "okay"; > >> +}; > >> + > >> +&ehci2 { > >> + status = "okay"; > >> +}; > >> + > >> +&ehci3 { > >> + status = "okay"; > >> +}; > >> + > >> +&mmc0 { > >> + vmmc-supply = <®_dldo1>; > >> + cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ > >> + no-1-8-v; > >> + bus-width = <4>; > >> + status = "disabled"; > >> +}; > >> + > >> +&ohci0 { > >> + status = "okay"; > >> +}; > >> + > >> +&ohci1 { > >> + status = "okay"; > >> +}; > >> + > >> +&ohci2 { > >> + status = "okay"; > >> +}; > >> + > >> +&ohci3 { > >> + status = "okay"; > >> +}; > >> + > >> +&r_i2c { > >> + status = "okay"; > >> + > >> + axp1530: pmic@36 { > >> + compatible = "x-powers,axp1530"; > > > > I see that you send driver for this PMIC separately. Next time please > > mention > > that this series depends on another, otherwise checks will fail. Ping > > us here > > once PMIC driver is merged to unblock this. > > > > Anyway, RSB is prefered. Can you switch to it? > > RSB does initialize but as soon as I try to give it the PMIC via RSB it > doesnt really wanna work so thats a no sadly. It's possible that you have to update this table: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/ drivers/bus/sunxi-rsb.c?h=v6.1-rc5#n528 If still doesn't work, you have to remove RSB support in PMIC driver. Is there datasheet for this PMIC? Best regards, Jernej > > >> + reg = <0x36>; > >> + wakeup-source; > >> + > >> + regulators{ > >> + reg_dcdc1: dcdc1 { > >> + regulator-name = "axp1530- dcdc1"; > >> + regulator-min-microvolt = > > > > <500000>; > > > >> + regulator-max-microvolt = > > > > <3400000>; > > > >> + regulator-step-delay-us = <25>; > >> + regulator-final-delay-us = <50>; > >> + regulator-always-on; > >> + }; > >> + > >> + reg_dcdc2: dcdc2 { > >> + regulator-name = "axp1530- dcdc2"; > >> + regulator-min-microvolt = > > > > <500000>; > > > >> + regulator-max-microvolt = > > > > <1540000>; > > > >> + regulator-step-delay-us = <25>; > >> + regulator-final-delay-us = <50>; > >> + regulator-ramp-delay = <200>; > >> + regulator-always-on; > >> + }; > >> + > >> + reg_dcdc3: dcdc3 { > >> + regulator-name = "axp1530- dcdc3"; > >> + regulator-min-microvolt = > > > > <500000>; > > > >> + regulator-max-microvolt = > > > > <1840000>; > > > >> + regulator-step-delay-us = <25>; > >> + regulator-final-delay-us = <50>; > >> + regulator-always-on; > >> + }; > >> + > >> + reg_aldo1: ldo1 { > >> + regulator-name = "axp1530- aldo1"; > >> + regulator-min-microvolt = > > > > <1800000>; > > > >> + regulator-max-microvolt = > > > > <1800000>; > > > >> + regulator-step-delay-us = <25>; > >> + regulator-final-delay-us = <50>; > >> + regulator-always-on; > >> + }; > >> + > >> + reg_dldo1: ldo2 { > >> + regulator-name = "axp1530- dldo1"; > >> + regulator-min-microvolt = > > > > <3300000>; > > > >> + regulator-max-microvolt = > > > > <3300000>; > > > >> + regulator-step-delay-us = <25>; > >> + regulator-final-delay-us = <50>; > >> + regulator-always-on; > >> + }; > >> + }; > >> + }; > >> +}; > >> + > >> +&uart0 { > >> + pinctrl-names = "default"; > >> + pinctrl-0 = <&uart0_ph_pins>; > >> + status = "okay"; > >> +}; > >> + > >> +&usbotg { > >> + /* > >> + * PHY0 pins are connected to a USB-C socket, but a role switch > >> + * is not implemented: both CC pins are pulled to GND. > >> + * The VBUS pins power the device, so a fixed peripheral mode > >> + * is the best choice. > >> + * The board can be powered via GPIOs, in this case port0 *can* > >> + * act as a host (with a cable/adapter ignoring CC), as VBUS is > >> + * then provided by the GPIOs. Any user of this setup would > >> + * need to adjust the DT accordingly: dr_mode set to "host", > >> + * enabling OHCI0 and EHCI0. > >> + */ > > > > Above text is verbatim copy from OrangePi Zero2 and I'm not sure if > > it is > > fully accurate for this board too. Looking at board photo, it surely > > looks > > like this board has same USB design as Zero2. But if that's true, you > > shouldn't enable OHCI0 and EHCI0 nodes. > > Correct. But M8P has a dip switch that enables or disables usbotg. > As for if it does anything its hard to say. > > > Is there any board schematic publicly available for this board? > > This is one of the issues. Im in contact with BIQU and asking for the > schematics. > I hope we can get them released ASAP as it would help me as well. > > > Best regards, > > Jernej > > > >> + dr_mode = "peripheral"; > >> + status = "okay"; > >> +}; > >> + > >> +&usbphy { > >> + usb1_vbus-supply = <®_usb1_vbus>; > >> + status = "okay"; > >> +}; > > Best Regards, > Martin
On Mon, Nov 14 2022 at 09:47:58 PM +01:00:00, Jernej Škrabec <jernej.skrabec@gmail.com> wrote: > Dne ponedeljek, 14. november 2022 ob 21:38:08 CET je Martin Botka > napisal(a): >> On Mon, Nov 14 2022 at 09:16:29 PM +01:00:00, Jernej Škrabec >> >> <jernej.skrabec@gmail.com> wrote: >> > Hi Martin, >> > >> > Dne ponedeljek, 14. november 2022 ob 18:20:16 CET je Martin Botka >> > >> > napisal(a): >> >> CB1 is Compute Module style board that plugs into Rpi board >> style >> >> >> >> adapter or >> >> >> >> Manta 3D printer boards (M4P/M8P). >> >> >> >> The board has: >> >> H616 SoC >> >> 1GB of RAM >> >> AXP313A PMIC >> >> >> >> And the actual boards that CB1 plugs in are just extension to it >> >> >> >> with ports >> >> >> >> and thus are not split in DT. >> >> >> >> Boards have: >> >> 4x (3x for Manta boards) USB and 1 USB OTG. >> >> SDcard slot for loading images. >> >> Ethernet port wired to the internal PHY. >> >> 2x HDMI 2.0. >> >> Power and Status LEDs. >> >> >> >> Currently working: >> >> Booting >> >> USB >> >> UART >> >> >> >> Signed-off-by: Martin Botka <martin.botka@somainline.org> >> >> --- >> >> Changes in V2: >> >> Add proper board compatible >> >> Add regulator prefix for vcc5v >> >> Drop okay status from PMIC >> >> Drop standby_param >> >> >> >> arch/arm64/boot/dts/allwinner/Makefile | 1 + >> >> .../dts/allwinner/sun50i-h616-biqu-cb1.dts | 186 >> >> >> >> ++++++++++++++++++ >> >> >> >> 2 files changed, 187 insertions(+) >> >> create mode 100644 >> >> >> >> arch/arm64/boot/dts/allwinner/sun50i-h616-biqu-cb1.dts >> >> >> >> diff --git a/arch/arm64/boot/dts/allwinner/Makefile >> >> b/arch/arm64/boot/dts/allwinner/Makefile index >> >> >> >> 6a96494a2e0a..223f1be73541 >> >> >> >> 100644 >> >> --- a/arch/arm64/boot/dts/allwinner/Makefile >> >> +++ b/arch/arm64/boot/dts/allwinner/Makefile >> >> @@ -38,5 +38,6 @@ dtb-$(CONFIG_ARCH_SUNXI) += >> sun50i-h6-pine-h64.dtb >> >> >> >> dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-pine-h64-model-b.dtb >> >> dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-tanix-tx6.dtb >> >> dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-tanix-tx6-mini.dtb >> >> >> >> +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-biqu-cb1.dtb >> >> >> >> dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-orangepi-zero2.dtb >> >> dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-x96-mate.dtb >> >> >> >> diff --git >> a/arch/arm64/boot/dts/allwinner/sun50i-h616-biqu-cb1.dts >> >> b/arch/arm64/boot/dts/allwinner/sun50i-h616-biqu-cb1.dts new >> file >> >> >> >> mode >> >> >> >> 100644 >> >> index 000000000000..297536d7629a >> >> --- /dev/null >> >> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-biqu-cb1.dts >> >> @@ -0,0 +1,186 @@ >> >> +// SPDX-License-Identifier: (GPL-2.0+ or MIT) >> >> +/* >> >> + * Copyright (C) 2022 Arm Ltd. >> > >> > I suppose Arm Ltd. has nothing to do with this board? Put yours >> > copyrights >> > there. >> >> Correct. Was a left over from Opi Zero 2 with just changed year. >> Will >> correct in V3 with the rest of the changes >> >> >> + */ >> >> + >> >> +/dts-v1/; >> >> + >> >> +#include "sun50i-h616.dtsi" >> >> + >> >> +#include <dt-bindings/gpio/gpio.h> >> >> +#include <dt-bindings/interrupt-controller/arm-gic.h> >> >> +#include <dt-bindings/leds/common.h> >> >> + >> >> +/ { >> >> + model = "BIQU CB1"; >> >> + compatible = "biqu,cb1", "allwinner,sun50i-h616"; >> >> + >> >> + aliases { >> >> + serial0 = &uart0; >> >> + }; >> >> + >> >> + chosen { >> >> + stdout-path = "serial0:115200n8"; >> >> + }; >> >> + >> >> + leds { >> >> + compatible = "gpio-leds"; >> >> + >> >> + led-0 { >> >> + function = LED_FUNCTION_POWER; >> >> + color = <LED_COLOR_ID_RED>; >> >> + gpios = <&pio 2 12 GPIO_ACTIVE_HIGH>; /* >> > >> > PC12 */ >> > >> >> + default-state = "on"; >> >> + }; >> >> + >> >> + led-1 { >> >> + function = LED_FUNCTION_STATUS; >> >> + color = <LED_COLOR_ID_GREEN>; >> >> + gpios = <&pio 2 13 GPIO_ACTIVE_HIGH>; /* >> > >> > PC13 */ >> > >> >> + }; >> >> + }; >> >> + >> >> + reg_vcc5v: regulator_vcc5v { >> >> + /* board wide 5V supply directly from the USB-C socket >> > >> > */ >> > >> >> + compatible = "regulator-fixed"; >> >> + regulator-name = "vcc-5v"; >> >> + regulator-min-microvolt = <5000000>; >> >> + regulator-max-microvolt = <5000000>; >> >> + regulator-always-on; >> >> + }; >> >> + >> >> + reg_usb1_vbus: regulator-usb1-vbus { >> >> + compatible = "regulator-fixed"; >> >> + regulator-name = "usb1-vbus"; >> >> + regulator-min-microvolt = <5000000>; >> >> + regulator-max-microvolt = <5000000>; >> >> + vin-supply = <®_vcc5v>; >> >> + enable-active-high; >> >> + gpio = <&pio 2 16 GPIO_ACTIVE_HIGH>; /* PC16 */ >> >> + }; >> >> +}; >> >> + >> >> +&ehci0 { >> >> + status = "okay"; >> >> +}; >> >> + >> >> +&ehci1 { >> >> + status = "okay"; >> >> +}; >> >> + >> >> +&ehci2 { >> >> + status = "okay"; >> >> +}; >> >> + >> >> +&ehci3 { >> >> + status = "okay"; >> >> +}; >> >> + >> >> +&mmc0 { >> >> + vmmc-supply = <®_dldo1>; >> >> + cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ >> >> + no-1-8-v; >> >> + bus-width = <4>; >> >> + status = "disabled"; >> >> +}; >> >> + >> >> +&ohci0 { >> >> + status = "okay"; >> >> +}; >> >> + >> >> +&ohci1 { >> >> + status = "okay"; >> >> +}; >> >> + >> >> +&ohci2 { >> >> + status = "okay"; >> >> +}; >> >> + >> >> +&ohci3 { >> >> + status = "okay"; >> >> +}; >> >> + >> >> +&r_i2c { >> >> + status = "okay"; >> >> + >> >> + axp1530: pmic@36 { >> >> + compatible = "x-powers,axp1530"; >> > >> > I see that you send driver for this PMIC separately. Next time >> please >> > mention >> > that this series depends on another, otherwise checks will fail. >> Ping >> > us here >> > once PMIC driver is merged to unblock this. >> > >> > Anyway, RSB is prefered. Can you switch to it? >> >> RSB does initialize but as soon as I try to give it the PMIC via >> RSB it >> doesnt really wanna work so thats a no sadly. > > It's possible that you have to update this table: > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/ > drivers/bus/sunxi-rsb.c?h=v6.1-rc5#n528 > > If still doesn't work, you have to remove RSB support in PMIC driver. > > Is there datasheet for this PMIC? From what i tried to find there isnt. Maybe i did not look hard enough but i do not have one. All i go from here is the downstream kernel. Biqu itself released datasheets for AXP305 and AXP313A. Where the AXP313A is actually used on the board and uses the AXP1530 driver thats found in downstream which did include RSB support. So it looks like to me that AXP313A is just a rebrand of AXP1530. And all other references to downstream kernels i found about AXP1530 or AXP313A used I2C to communicate with the chip. So in this state i would be happy to drop the RSB support from the driver as there seems to be no use for it and leave I2C in. This would be done in V2 alongside any other requested changes > > Best regards, > Jernej > >> >> >> + reg = <0x36>; >> >> + wakeup-source; >> >> + >> >> + regulators{ >> >> + reg_dcdc1: dcdc1 { >> >> + regulator-name = "axp1530- > dcdc1"; >> >> + regulator-min-microvolt = >> > >> > <500000>; >> > >> >> + regulator-max-microvolt = >> > >> > <3400000>; >> > >> >> + regulator-step-delay-us = <25>; >> >> + regulator-final-delay-us = <50>; >> >> + regulator-always-on; >> >> + }; >> >> + >> >> + reg_dcdc2: dcdc2 { >> >> + regulator-name = "axp1530- > dcdc2"; >> >> + regulator-min-microvolt = >> > >> > <500000>; >> > >> >> + regulator-max-microvolt = >> > >> > <1540000>; >> > >> >> + regulator-step-delay-us = <25>; >> >> + regulator-final-delay-us = <50>; >> >> + regulator-ramp-delay = <200>; >> >> + regulator-always-on; >> >> + }; >> >> + >> >> + reg_dcdc3: dcdc3 { >> >> + regulator-name = "axp1530- > dcdc3"; >> >> + regulator-min-microvolt = >> > >> > <500000>; >> > >> >> + regulator-max-microvolt = >> > >> > <1840000>; >> > >> >> + regulator-step-delay-us = <25>; >> >> + regulator-final-delay-us = <50>; >> >> + regulator-always-on; >> >> + }; >> >> + >> >> + reg_aldo1: ldo1 { >> >> + regulator-name = "axp1530- > aldo1"; >> >> + regulator-min-microvolt = >> > >> > <1800000>; >> > >> >> + regulator-max-microvolt = >> > >> > <1800000>; >> > >> >> + regulator-step-delay-us = <25>; >> >> + regulator-final-delay-us = <50>; >> >> + regulator-always-on; >> >> + }; >> >> + >> >> + reg_dldo1: ldo2 { >> >> + regulator-name = "axp1530- > dldo1"; >> >> + regulator-min-microvolt = >> > >> > <3300000>; >> > >> >> + regulator-max-microvolt = >> > >> > <3300000>; >> > >> >> + regulator-step-delay-us = <25>; >> >> + regulator-final-delay-us = <50>; >> >> + regulator-always-on; >> >> + }; >> >> + }; >> >> + }; >> >> +}; >> >> + >> >> +&uart0 { >> >> + pinctrl-names = "default"; >> >> + pinctrl-0 = <&uart0_ph_pins>; >> >> + status = "okay"; >> >> +}; >> >> + >> >> +&usbotg { >> >> + /* >> >> + * PHY0 pins are connected to a USB-C socket, but a role >> switch >> >> + * is not implemented: both CC pins are pulled to GND. >> >> + * The VBUS pins power the device, so a fixed peripheral mode >> >> + * is the best choice. >> >> + * The board can be powered via GPIOs, in this case port0 >> *can* >> >> + * act as a host (with a cable/adapter ignoring CC), as VBUS >> is >> >> + * then provided by the GPIOs. Any user of this setup would >> >> + * need to adjust the DT accordingly: dr_mode set to "host", >> >> + * enabling OHCI0 and EHCI0. >> >> + */ >> > >> > Above text is verbatim copy from OrangePi Zero2 and I'm not sure >> if >> > it is >> > fully accurate for this board too. Looking at board photo, it >> surely >> > looks >> > like this board has same USB design as Zero2. But if that's true, >> you >> > shouldn't enable OHCI0 and EHCI0 nodes. >> >> Correct. But M8P has a dip switch that enables or disables usbotg. >> As for if it does anything its hard to say. >> >> > Is there any board schematic publicly available for this board? >> >> This is one of the issues. Im in contact with BIQU and asking for >> the >> schematics. >> I hope we can get them released ASAP as it would help me as well. >> >> > Best regards, >> > Jernej >> > >> >> + dr_mode = "peripheral"; >> >> + status = "okay"; >> >> +}; >> >> + >> >> +&usbphy { >> >> + usb1_vbus-supply = <®_usb1_vbus>; >> >> + status = "okay"; >> >> +}; >> >> Best Regards, >> Martin > > > >
diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile index 6a96494a2e0a..223f1be73541 100644 --- a/arch/arm64/boot/dts/allwinner/Makefile +++ b/arch/arm64/boot/dts/allwinner/Makefile @@ -38,5 +38,6 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-pine-h64.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-pine-h64-model-b.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-tanix-tx6.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-tanix-tx6-mini.dtb +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-biqu-cb1.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-orangepi-zero2.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-x96-mate.dtb diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-biqu-cb1.dts b/arch/arm64/boot/dts/allwinner/sun50i-h616-biqu-cb1.dts new file mode 100644 index 000000000000..297536d7629a --- /dev/null +++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-biqu-cb1.dts @@ -0,0 +1,186 @@ +// SPDX-License-Identifier: (GPL-2.0+ or MIT) +/* + * Copyright (C) 2022 Arm Ltd. + */ + +/dts-v1/; + +#include "sun50i-h616.dtsi" + +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/interrupt-controller/arm-gic.h> +#include <dt-bindings/leds/common.h> + +/ { + model = "BIQU CB1"; + compatible = "biqu,cb1", "allwinner,sun50i-h616"; + + aliases { + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + leds { + compatible = "gpio-leds"; + + led-0 { + function = LED_FUNCTION_POWER; + color = <LED_COLOR_ID_RED>; + gpios = <&pio 2 12 GPIO_ACTIVE_HIGH>; /* PC12 */ + default-state = "on"; + }; + + led-1 { + function = LED_FUNCTION_STATUS; + color = <LED_COLOR_ID_GREEN>; + gpios = <&pio 2 13 GPIO_ACTIVE_HIGH>; /* PC13 */ + }; + }; + + reg_vcc5v: regulator_vcc5v { + /* board wide 5V supply directly from the USB-C socket */ + compatible = "regulator-fixed"; + regulator-name = "vcc-5v"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-always-on; + }; + + reg_usb1_vbus: regulator-usb1-vbus { + compatible = "regulator-fixed"; + regulator-name = "usb1-vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <®_vcc5v>; + enable-active-high; + gpio = <&pio 2 16 GPIO_ACTIVE_HIGH>; /* PC16 */ + }; +}; + +&ehci0 { + status = "okay"; +}; + +&ehci1 { + status = "okay"; +}; + +&ehci2 { + status = "okay"; +}; + +&ehci3 { + status = "okay"; +}; + +&mmc0 { + vmmc-supply = <®_dldo1>; + cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ + no-1-8-v; + bus-width = <4>; + status = "disabled"; +}; + +&ohci0 { + status = "okay"; +}; + +&ohci1 { + status = "okay"; +}; + +&ohci2 { + status = "okay"; +}; + +&ohci3 { + status = "okay"; +}; + +&r_i2c { + status = "okay"; + + axp1530: pmic@36 { + compatible = "x-powers,axp1530"; + reg = <0x36>; + wakeup-source; + + regulators{ + reg_dcdc1: dcdc1 { + regulator-name = "axp1530-dcdc1"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <3400000>; + regulator-step-delay-us = <25>; + regulator-final-delay-us = <50>; + regulator-always-on; + }; + + reg_dcdc2: dcdc2 { + regulator-name = "axp1530-dcdc2"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <1540000>; + regulator-step-delay-us = <25>; + regulator-final-delay-us = <50>; + regulator-ramp-delay = <200>; + regulator-always-on; + }; + + reg_dcdc3: dcdc3 { + regulator-name = "axp1530-dcdc3"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <1840000>; + regulator-step-delay-us = <25>; + regulator-final-delay-us = <50>; + regulator-always-on; + }; + + reg_aldo1: ldo1 { + regulator-name = "axp1530-aldo1"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-step-delay-us = <25>; + regulator-final-delay-us = <50>; + regulator-always-on; + }; + + reg_dldo1: ldo2 { + regulator-name = "axp1530-dldo1"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-step-delay-us = <25>; + regulator-final-delay-us = <50>; + regulator-always-on; + }; + }; + }; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_ph_pins>; + status = "okay"; +}; + +&usbotg { + /* + * PHY0 pins are connected to a USB-C socket, but a role switch + * is not implemented: both CC pins are pulled to GND. + * The VBUS pins power the device, so a fixed peripheral mode + * is the best choice. + * The board can be powered via GPIOs, in this case port0 *can* + * act as a host (with a cable/adapter ignoring CC), as VBUS is + * then provided by the GPIOs. Any user of this setup would + * need to adjust the DT accordingly: dr_mode set to "host", + * enabling OHCI0 and EHCI0. + */ + dr_mode = "peripheral"; + status = "okay"; +}; + +&usbphy { + usb1_vbus-supply = <®_usb1_vbus>; + status = "okay"; +};