From patchwork Mon Nov 14 21:44:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Botka X-Patchwork-Id: 13042867 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C419AC4332F for ; Mon, 14 Nov 2022 21:46:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=aDkc7HZJVbhYrXDwSSKeXw14B0Nn3dya8/9J8XCeKuk=; b=BsyAkK7ge+v5rl XckFsEWnZQLmTuQzGt0XnCq9cB9cmjqANDh5QGIxvgt/gWYD1OgqFCeUmpg7whJI3Wf99rp+IcPpa DG9H1PSolTYHhf0KPWIFxoUmMom0NKJY8FP54fM7DSmI3ic45kKRoleHR1VXzYltBtjPC2fHXrFSm +ToaxQQdsWSzru4qMJ1dU2hUIP9lzkB2KDRIuTEmeH9jc6lblof6X8hbs+aNEM88bXPBmvWP2fe4L mMqSf/qe49x93nnYfKBQ+b5F3c8wFTp3YdNLUtYV26KNMIPOolO4Eh/TI2rgQ8gHIP/DT261OJqxo c8SkfYnoF97+UTVQvssg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouhGN-0058oQ-Fe; Mon, 14 Nov 2022 21:45:07 +0000 Received: from relay06.th.seeweb.it ([5.144.164.167]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouhGK-0058nI-9T for linux-arm-kernel@lists.infradead.org; Mon, 14 Nov 2022 21:45:05 +0000 Received: from TimeMachine.lan (bband-dyn193.178-41-216.t-com.sk [178.41.216.193]) by m-r2.th.seeweb.it (Postfix) with ESMTPA id E4FF340210; Mon, 14 Nov 2022 22:44:58 +0100 (CET) From: Martin Botka To: martin.botka1@gmail.com Cc: ~postmarketos/upstreaming@lists.sr.ht, Konrad Dybcio , AngeloGioacchino Del Regno , Marijn Suijten , Jami Kettunen , Paul Bouchara , Jan Trmal , Tom , Martin Botka , Rob Herring , Krzysztof Kozlowski , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Andre Przywara , Maxime Ripard , Andrew Lunn , Conley Lee , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/2] dt-bindings: arm: sunxi: Add BIQU CB1 Date: Mon, 14 Nov 2022 22:44:48 +0100 Message-Id: <20221114214452.1993744-1-martin.botka@somainline.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221114_134504_509006_81A7F343 X-CRM114-Status: UNSURE ( 7.60 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add a name & compatible for BIQU CB1 Signed-off-by: Martin Botka --- Changes in V2: Add compatible and name to dt-bindings Changes in V3: None Documentation/devicetree/bindings/arm/sunxi.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/arm/sunxi.yaml b/Documentation/devicetree/bindings/arm/sunxi.yaml index 3ad1cd50e3fe..d886924023f5 100644 --- a/Documentation/devicetree/bindings/arm/sunxi.yaml +++ b/Documentation/devicetree/bindings/arm/sunxi.yaml @@ -151,6 +151,11 @@ properties: - const: roofull,beelink-x2 - const: allwinner,sun8i-h3 + - description: Biqu CB1 + items: + - const: biqu,cb1 + - const: allwinner,sun50i-h616 + - description: Chuwi V7 CW0825 items: - const: chuwi,v7-cw0825 From patchwork Mon Nov 14 21:44:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Botka X-Patchwork-Id: 13042868 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 29C6DC43217 for ; Mon, 14 Nov 2022 21:46:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GiBlIcQH4zvUu2kGHx8ZG50tzfqnNqWWOLi24JdNM1I=; b=BjkTMwde8Iv+D4 XwPveo/NAzgbpahvMtP+/HoWLNnQQsk82kmDcM+SGBNGhBW7xz5p7nh+fDeesA/X+jGCEAjR5olo7 MlsCUyQj0jLJBQqPRBg78otsSL/ZXlTQM68upoOmGT1CqXLaR1AK9NiDCmvaLnmuKBGXMZL4AXx3B czl4xBxSa5nBMZ6800+kXdQszPorMDxdCxz/kOarmZU1Z4aWRfvG+GHS69b6oQPZTQjPqifNWldSt lok6UY2exkEH/W16RUmNSia2ibaZPafSU8T8BPeov7PxpJI+1g3KSXZj5fnYIHVN1lZA/XHLYlKLp FpD5WHVTiaGje6ak8r4g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouhGV-0058qE-8l; Mon, 14 Nov 2022 21:45:15 +0000 Received: from m-r2.th.seeweb.it ([2001:4b7a:2000:18::171]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouhGQ-0058oZ-5U for linux-arm-kernel@lists.infradead.org; Mon, 14 Nov 2022 21:45:12 +0000 Received: from TimeMachine.lan (bband-dyn193.178-41-216.t-com.sk [178.41.216.193]) by m-r2.th.seeweb.it (Postfix) with ESMTPA id EC61B40212; Mon, 14 Nov 2022 22:45:01 +0100 (CET) From: Martin Botka To: martin.botka1@gmail.com Cc: ~postmarketos/upstreaming@lists.sr.ht, Konrad Dybcio , AngeloGioacchino Del Regno , Marijn Suijten , Jami Kettunen , Paul Bouchara , Jan Trmal , Tom , Martin Botka , Rob Herring , Krzysztof Kozlowski , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Maxime Ripard , Andre Przywara , Conley Lee , Andrew Lunn , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/2] arm64: dts: Add basic support for BIQU CB1 Date: Mon, 14 Nov 2022 22:44:49 +0100 Message-Id: <20221114214452.1993744-2-martin.botka@somainline.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221114214452.1993744-1-martin.botka@somainline.org> References: <20221114214452.1993744-1-martin.botka@somainline.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221114_134510_555767_7CE2AA4B X-CRM114-Status: GOOD ( 17.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- Changes in V2: Add proper board compatible Add regulator prefix for vcc5v Drop okay status from PMIC Drop standby_param Changes in V3: Change copyright to me regulator_vcc5v to regulator-vcc5v Drop ehci0 and ohci0 arch/arm64/boot/dts/allwinner/Makefile | 1 + .../dts/allwinner/sun50i-h616-biqu-cb1.dts | 178 ++++++++++++++++++ 2 files changed, 179 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..86b5aca9b53e --- /dev/null +++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-biqu-cb1.dts @@ -0,0 +1,178 @@ +// SPDX-License-Identifier: (GPL-2.0+ or MIT) +/* + * Copyright (C) 2022 Martin Botka . + */ + +/dts-v1/; + +#include "sun50i-h616.dtsi" + +#include +#include +#include + +/ { + 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 = ; + gpios = <&pio 2 12 GPIO_ACTIVE_HIGH>; /* PC12 */ + default-state = "on"; + }; + + led-1 { + function = LED_FUNCTION_STATUS; + color = ; + 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 */ + }; +}; + +&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"; +}; + +&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"; +};