Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7063249rwb; Tue, 15 Nov 2022 07:15:38 -0800 (PST) X-Google-Smtp-Source: AA0mqf4uMA4LIKPXQf7KuJckb8IR/ZRkQ5EhRrshyxnSRPXyIbNYhavbITKoZe8OOwlV76ZhDg88 X-Received: by 2002:a63:1126:0:b0:46b:4204:b3e5 with SMTP id g38-20020a631126000000b0046b4204b3e5mr16319060pgl.351.1668525338039; Tue, 15 Nov 2022 07:15:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668525338; cv=none; d=google.com; s=arc-20160816; b=gidcdNLexZLemwyhxCgTyIx7faAfucratJIgr05j3RTnzSgd8edoJBKn2GfE7sRe5L R5xh7hMY5sGwXeq6vFpM0+jYJxmFfA632VTqRw6YbbFu9KjvWN4afMNb4+HkPf38gMhJ YHxvDYBBYVpfr0IrIo3tC/VxcgVwYDyVsYxyq2MmgIGXTeIUFFktP0Awhy7RBD6y67cG 9Xj0mIZWNRcynURuIEzbyTvnI6n16CRsztwHt5B1Sg+wvrPyzmjXMG2GmgD52wGaesvy K1LZafEWCydSgDnAFDR628U558ZElCwl0Nzw/nkztEOsDe9n10mBFvQ5kkXWcvx6Cdzk vlGg== 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 :message-id:references:in-reply-to:user-agent:subject:cc:to:from :date; bh=Of20x5cLN5RsxBjLQJB1HQhKieTYufpeTikjo23fxNg=; b=CievRLYe/UhFzj41FsG0XdGoVLwDGkI4awfD3zlT2PztmF8xztZnQUYgDwkdvD6dlB huurfFN0/kNUgcPvEF4AWSZaNgiGl1UsDCAaZfyUQalmKunjzsCt6P1jQ3S6evu4krpX DY1GnbXvH0ecNZ+KTbSfHRnuPUXpkWOYRmMX+IKTN+IGrZAvMcYXMvTKqilr6MKo1LTy MTk5LLRmz5amnDAokbBsJOs0zSIFZnMxo5ihBrK7bjKzjSUn9CSfXrleHPaCKC0NVyQQ PrnvJvZo9su2d163SsY4y4khrHCPyGRUteKnjGi6ViVlQHLw5JxRMHkTj6pGoMdZhxUT fc5g== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u12-20020a63df0c000000b0043c0b452d3esi12718057pgg.292.2022.11.15.07.15.13; Tue, 15 Nov 2022 07:15:38 -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 S230291AbiKOOsW convert rfc822-to-8bit (ORCPT + 90 others); Tue, 15 Nov 2022 09:48:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230430AbiKOOsN (ORCPT ); Tue, 15 Nov 2022 09:48:13 -0500 Received: from relay03.th.seeweb.it (relay03.th.seeweb.it [5.144.164.164]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 144B627148 for ; Tue, 15 Nov 2022 06:48:10 -0800 (PST) Received: from [127.0.0.1] (85-237-234-12.dynamic.orange.sk [85.237.234.12]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r1.th.seeweb.it (Postfix) with ESMTPSA id D3EFF20058; Tue, 15 Nov 2022 15:48:08 +0100 (CET) Date: Tue, 15 Nov 2022 15:48:07 +0100 From: Martin Botka To: Andre Przywara CC: Martin Botka , ~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 , linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, Linux Kernel Mailing List Subject: Re: [PATCH v3 2/2] arm64: dts: Add basic support for BIQU CB1 User-Agent: K-9 Mail for Android In-Reply-To: <20221115142714.310049c4@donnerap.cambridge.arm.com> References: <20221114214452.1993744-1-martin.botka@somainline.org> <20221114214452.1993744-2-martin.botka@somainline.org> <20221114233102.3b1f96cc@slackpad.lan> <20221115005429.57d72f64@slackpad.lan> <20221115103307.5f5b9106@donnerap.cambridge.arm.com> <78EC79B1-1664-48EB-A902-9173FE59C45B@somainline.org> <20221115142714.310049c4@donnerap.cambridge.arm.com> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 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=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 November 15, 2022 3:27:14 PM GMT+01:00, Andre Przywara wrote: >On Tue, 15 Nov 2022 12:38:59 +0100 >Martin Botka wrote: > >Hi Martin, > >> On November 15, 2022 11:33:07 AM GMT+01:00, Andre Przywara wrote: >> >On Tue, 15 Nov 2022 09:24:04 +0100 >> >Martin Botka wrote: >> > >> >Hi, >> > >> >> On November 15, 2022 1:54:29 AM GMT+01:00, Andre Przywara wrote: >> >> >On Tue, 15 Nov 2022 00:44:46 +0100 >> >> >Martin Botka wrote: >> >> > >> >> >Hi Martin, >> >> > >> >> >> I can totally understand how this can get confusing. >> >> >> >> >> >> Basically because of the Rpi shortage biqu decided to make an Rpi >> >> >> alternative. >> >> >> >> >> >> So they made CB1 which is compute module style board. >> >> >> >> >> >> And they made 3 other boards where CB1 or Rpi CM4 can be plugged in. The 3 >> >> >> boards are: >> >> >> >> >> >> Rpi adapter which takes the Compute module style boards and turns them into >> >> >> SBC style with basically identical size and etc to Rpi 4. >> >> >> >> >> >> Then we have Manta M8P and M4P. These boards are MCUs for a 3D printer. But >> >> >> they were made for Klipper use case which requires a computer or SBC >> >> >> (Usually Rpi4). They combined it into 1 board. >> >> >> Where you get the MCU and you can plug in CM4 or CB1 >> >> > >> >> >Thanks for the explanations! I was guessing along those shortage lines, >> >> >since the H616 is quite a step down from the RPi4CM, though probably >> >> >still enough for driving a 3D printer. >> >> Mostly yes >> >> > >> >> >> All these boards are basically taking the pins and routing them to ports. >> >> > >> >> >Yes, this is what those SoM carrier boards do ;-) >> >> :) >> >> > >> >> >> There is nearly 0 chips for conversion or processing of the pins from CB1 >> >> >> or CM4 thus i do not see a reason for having parent dtsi and dts for the >> >> >> adapter and Manta boards. >> >> > >> >> >And the DT does not need to describe "chips" only, a lot of DT nodes >> >> >are about connectors, and which ports and which exact pins (out of the >> >> >possible pinmuxes) are actually used. The SoM itself mostly exposes >> >> >just pins, and the board DT describes how these pins are used (GPIO or >> >> >special function, for instance). >> >> > >> >> >So did you try to split this up? How would that look? >> >> >> >> The main difference between adapter and Manta boards is that adapter has 4x USB. >> > >> >So those are two double-type-A sockets? This is not really what the DT >> >below describes? It's perfectly fine to fix USB0 to host mode, we do this >> >on the Pine64 boards (both A64 and H6), for instance. >> >> Yes. But the third and fourth is also used. Third is done in 2.54 4p connector (just pins on board) and fourth is connected directly to manta stm32 MCU. So all 4 are host. > >Wait, so you are talking about the Manta board now? I see two sockets, the >2.54mm headers and the STM32 there, but the Pi4B is quite different in >that respect: I see four(!) USB type-A sockets (two dual-port stacks). >Plus the CM4 connector seems to only have pins for one USB 2.0 port >(D-,D+). So is this a hub chip on the underside of the board, close to the >USB ports? Can you read the label of that chip? >And where are the other H616 USB pins routed to? Are they (ab-)using the >PCIe pins of the CM4 connector? Or are they actually not used at all, and >it's all one USB port through a by-4 hub? >If you have a running system, "lsusb -t" should give you a clue which host >ports are used and if there is a hub. > >Cheers, >Andre Hi Andre, I do not own Rpi 4 adapter. I can only check on Manta M8P as thats what BIQU provided. But it will be the same there probably. I asked biqu to provide full schematic for the CB1 but didnt get a reply yet. I will reply after i get home with the details Best regards, Martin > >> >> Manta only has 3 and 1 otg. But it has a switch to disable or enable otg. >> > >> >What does the switch do, exactly? By definition OTG works fine in both >> >ways. And there are pins in the connector to decide the role. >> The switch is just signal pin for RS2227. Its the multiplexer i mentioned. It decides if we should have the pins wired to usb type C port or normally to stm32 MCU. Thats all it does. >> > >> >Allwinner actually goes one step further and provides a full HCI to the >> >same PHY that the MUSB OTG controller is connected to, so you don't need >> >to live with the sometimes limited performance of the MUSB host mode >> >(which we drive without DMA). Not sure if that is the case or a problem on >> >the RPi4. >> > >> >> Im not opposed to splitting it up. It is probably a good idea. >> >> I dont see how to resolve that switch on manta boards tho. >> > >> >If the Manta board is (almost) a superset of the Pi4B, then you can >> >include the latter from there. Look at sun50i-a64-pine64-lts.dts or >> >sun50i-h6-pine-h64-model-b.dts for examples. >> > >> >Cheers, >> >Andre. >> > >> Yep i will split it into SoM boards. >> >> >> The only exception to conversion are the LEDs on the boards but since both >> >> >> adapter and manta boards have them this yet again eliminates need for >> >> >> parent style DT. >> >> >> >> >> >> Best regards, >> >> >> Martin >> >> >> >> >> >> On Tue, Nov 15, 2022, 12:32 AM Andre Przywara >> >> >> wrote: >> >> >> >> >> >> > 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"; >> >> >> > > +}; >> >> >> > >> >> >> > >> >> > >> > >