Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6188518rwb; Mon, 14 Nov 2022 16:02:53 -0800 (PST) X-Google-Smtp-Source: AA0mqf6uxG5WLv98EwXScycEaLeQlzJH046Bmztpb8JIqnrE/D6G9oepgkQta/OwiMR0n3iZejgf X-Received: by 2002:a17:906:601:b0:78d:b3f0:b5c0 with SMTP id s1-20020a170906060100b0078db3f0b5c0mr12409629ejb.141.1668470573257; Mon, 14 Nov 2022 16:02:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668470573; cv=none; d=google.com; s=arc-20160816; b=qTMVBP/PGQgATShvxAtmZDpmgkkJTTH0/JUlDTiqzwjQSXXnM/oBMH2xA4SNFxYRCe TqOBS/bJ7ugvSfpSZE6/GVSqAlxHm20Yw8Z/tK779QiU9fYt7q/extstGUGkyKhSEFNg jOrZeuDq0DIMWzKrVGU9Q+y577pQk7uCSjHcTDh6P0rZovSQc4ucOULYq5GEKqIROmxY V6Z1M0INRKRd0iVnqb/eRxRieYZ3+nO07PsxecxitObljDT/tSy8aLfJE09//iHMkQc2 qgO2u5dFmwPYZ+vS1E8dI15LgAOhp/4iF0PEAwMNuCINcrN9W30j2vr7y4tEfkACQLpY 8gBQ== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=LGz3E2L5BWddzyVAayCvhryyYNxxyf/AnGKMyMLT6/o=; b=Pwb2zGr7yxU8SM23tKsfshAW+kFnrkUvvBtfpP8HE605NXSjqcmqODqeUuqgmqAUfn erLv72xOSJdMggpebS2+7sQ8aaUNv1g3YIapYDQG0/+yWP3JLEnZt5JWCC3GvHePNqY8 quC9csPMPQelrf+XpNX/otZciRV1fAJeX6MfQHx5WEOryYzlTgIYyssNiBgSUAxb2Hro MfetpUJAn8QxhJpkD/czr5KfMTsT5Ust1i2XJmC8usDOqvjwl3JtUpJjPnYm0zrW6tEr hjihAIy0ydMI3aJYcO0MkK7iUZI/4UdYQjN1Ct/yqff4DvWDk/iXOHysJT+VhPL6JhlR mFcA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dp16-20020a170906c15000b007adbeb3798asi9094818ejc.482.2022.11.14.16.02.27; Mon, 14 Nov 2022 16:02:53 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235707AbiKNXcf (ORCPT + 88 others); Mon, 14 Nov 2022 18:32:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230520AbiKNXcd (ORCPT ); Mon, 14 Nov 2022 18:32:33 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6387020E; Mon, 14 Nov 2022 15:32:29 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0D5B711FB; Mon, 14 Nov 2022 15:32:35 -0800 (PST) Received: from slackpad.lan (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CA0193F663; Mon, 14 Nov 2022 15:32:25 -0800 (PST) Date: Mon, 14 Nov 2022 23:31:02 +0000 From: Andre Przywara To: Martin Botka Cc: martin.botka1@gmail.com, ~postmarketos/upstreaming@lists.sr.ht, Konrad Dybcio , AngeloGioacchino Del Regno , Marijn Suijten , Jami Kettunen , Paul Bouchara , Jan Trmal , Tom , Rob Herring , Krzysztof Kozlowski , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Maxime Ripard , 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: Re: [PATCH v3 2/2] arm64: dts: Add basic support for BIQU CB1 Message-ID: <20221114233102.3b1f96cc@slackpad.lan> In-Reply-To: <20221114214452.1993744-2-martin.botka@somainline.org> References: <20221114214452.1993744-1-martin.botka@somainline.org> <20221114214452.1993744-2-martin.botka@somainline.org> Organization: Arm Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.31; x86_64-slackware-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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 On Mon, 14 Nov 2022 22:44:49 +0100 Martin Botka wrote: > 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. I don't really understand that sentence. There is some precedent for a SoM/board split, look at the sun50i-a64-sopine or sun50i-h5-emlid-neutis-n5 files. And if I see this correctly, then there are *two* boards available for the same CB1 SoM, the PI4B and the Manta board? Which would a strong case for a SoM .dtsi, plus the one or two board .dts files. I am just not sure whether that relation to the Pi4-CM is helpful or just complicates things... Cheers, Andre > > 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"; > +};