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: 20047 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2379774wru; Mon, 14 Nov 2022 13:46:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf6WZHXAq1G5fGSaKKoRuZBD+pQqDp6UcFEoQUT6gBHLTGrQDmRJnxlrbLHtZ237hl1saVyI X-Received: by 2002:a17:906:b1d7:b0:7ae:4373:c8aa with SMTP id bv23-20020a170906b1d700b007ae4373c8aamr11972522ejb.466.1668462418164; Mon, 14 Nov 2022 13:46:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668462418; cv=none; d=google.com; s=arc-20160816; b=BCNd/TE8VtFN8qIdgHAqn8FMzfXNGIQHPi/bTlHPypU2n2nnvaIXspd8gF50ZVFsx+ lPML8q/r18kfA9R0cIZbwNIveBmstJQJv6j9ZZmKl2BUj8lZ0sQIjuPYhiHM6CQLMsvg NgWoOxxXue6YHafe2NtpVNnj2ASKa4wiE3jbncNkyTEFXIkdIIX+YprFyhsaE2WLeMJW z0orPB/lbPXMkvGAuE8rQouHz6guqIZcfD4KaEaPoK5pAQqsqW+p8LDJh88IzIzGiIQl QALMSyjD6yNPrO48yIzvQ/jFssXLnHGQ40DZ6uZAvzv7FRKv1yzZKMjMzxok66IVkJCC C/IA== 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=6olPieLi4hyKCYhlnPd/mQMbPr3LCSLi107U2Cp+oZI=; b=i1NfYTKaLGCaDPt0GfrVUvoxup5IocxQFT1FZdKTEFY2YFyUqdEPJfU5GOGXAoKBHI AtkCqLFNzoY6J4Hs7w3TZptvX6/slnebD5Fy0r/4M9RU2BPBUcb/yqowIyBYj7H5zDLa Rrusu1ohU7U1Se7WvlJCPaB3lwTb9FASqUxT+WOfvUlwbOo4ptEfC+cyLJOiRJoVB8cX qGWcfMLLqi7HIdx1u76q4VX7tqfYarQH6KLbaBfsInBt5r87cqGeg2Ppqm1e29mG7kF/ x9MgwDBrfdfTGwJj6cmVenaV3UN9aMqYO5KpCBvgf0JK+8690VnF8tOyJ1dVGepqb7Ao L+iw== 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 s7-20020a50ab07000000b00447eb58b921si10065763edc.38.2022.11.14.13.46.34; Mon, 14 Nov 2022 13:46: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 S237768AbiKNVpR (ORCPT + 99 others); Mon, 14 Nov 2022 16:45:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237763AbiKNVpL (ORCPT ); Mon, 14 Nov 2022 16:45:11 -0500 Received: from relay08.th.seeweb.it (relay08.th.seeweb.it [5.144.164.169]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B467193E7 for ; Mon, 14 Nov 2022 13:45:08 -0800 (PST) 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-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749509648712832115?= X-GMAIL-MSGID: =?utf-8?q?1749509648712832115?= 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"; +};