Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp20344441rwd; Thu, 29 Jun 2023 00:39:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7ptCmUVz07KB2UzwhUtpYW3yaxnSTntymQw92TA1eAhi/7vwyWBCgH8lG7Fnn7aLC8n7oH X-Received: by 2002:a05:6a20:9143:b0:122:6fd2:7a2a with SMTP id x3-20020a056a20914300b001226fd27a2amr24714416pzc.55.1688024340628; Thu, 29 Jun 2023 00:39:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688024340; cv=none; d=google.com; s=arc-20160816; b=P/npK/dYfCvmn312WBaE1LCE3DwztQYAqWyyNNyPUi0xddfSqeIl7RfO2ljhqZoHKR s6GoQKP4QgYPm1kmlUtHA3FhtGZs4N5N2sTYwR2ESmT6Xy7Q6h+HVZCtnR1nUOU6DiDQ uZiuFZBGrvtwZSKR7YDFSkUDKIgiZWDB4WvP+g8qjAZMdAYKbVWuonsNglnRfok4hI4B 2XpcDylba8yMmBZjFUKq6cbNCXz3F9t5B9RqU3xqHSiyWRPRBcEp3Sk1gX/oDZE7eG45 wn9OySg/djYpZh4P9SHOe4rfl3/CR35ft0QVl7W1B8KDFQ9+C7T5hZqaPUEY093vlZjv EexQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:reply-to:in-reply-to:references:mime-version; bh=EX50f8fTe4hHesFShSzPR8b5GnO8f97mj4RlsTOuFb8=; fh=1b6UIvbs8r2E1YCKSX5cbKM9IZDYbmq0eXynppJvfTE=; b=taiMSMyV8G6CWoQqwqs+M114dPtDUtyshm+c0hrq4MChCuvYdPyR3Vf/Z2/a8gAtmv mqFhNdAyWxe4JAWx7pFDgIWUeg6g8EmUDnWRrR0dpN959/bfLshvws2vSop3edRtSwPN 1ffFtdH2nkAzjQY+4uTelZnNRi7uuzQJPRjLy2hguK0sqlMvriePJqLsUGLBC7cyOMNQ 2ehDudpihUZ9iDhlNmGSoDcTM2RuN8Cy1psQklEQLsfnzT2tSG+esX0wc6QaYICuu198 sEIyNsGOrIKjO8Uf27WnwNTyQIB26rBuMKTd6BVmYAyyWjRy6iI0b1ziNAEv0XbJSazB nWew== 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 t13-20020a63dd0d000000b005572d25a921si10537005pgg.419.2023.06.29.00.38.47; Thu, 29 Jun 2023 00:39:00 -0700 (PDT) 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 S232033AbjF2HKu convert rfc822-to-8bit (ORCPT + 99 others); Thu, 29 Jun 2023 03:10:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231709AbjF2HKs (ORCPT ); Thu, 29 Jun 2023 03:10:48 -0400 Received: from mail-yb1-f171.google.com (mail-yb1-f171.google.com [209.85.219.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94CA02110; Thu, 29 Jun 2023 00:10:46 -0700 (PDT) Received: by mail-yb1-f171.google.com with SMTP id 3f1490d57ef6-bd61dd9a346so353251276.2; Thu, 29 Jun 2023 00:10:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688022645; x=1690614645; h=content-transfer-encoding:cc:to:subject:message-id:date:from :reply-to:in-reply-to:references:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Tn9NNmjuel7XZ5JFuKy8oA1aMH0qpUgNaaolh4a54YM=; b=UN3/VbrmzgPIUWLsqQsWMKZrnVsD4s4V8ad3AcNTTsgNXzYAxVBAtEgltV5sxClOqd +3RpkXAYdkI26Xy+oUi7QpYunA1zLPGMXI40BmnpZSCDHKrJjR6C0vUv0D8fKzG0O4d/ 4TEU9iwfA/JxrVSPW0mfsyJKgWCKfqpLOhq1hELj5augeIxecKx/WS3/9uyV5eBqeBUS HRyoePib3Abr7Bv37aD0Us52CO4X1hWc7dLYA3cfalWirGX2Uy9ydI6wQ0h7hqCYkRmo IAXMlHt/4CTLsfuFStyagzi8Kc02cq7X4L9YY88JHWRSP5RmdknaGt0aiUFCTDn2FoKe J8TA== X-Gm-Message-State: AC+VfDxSyP5+XgTZXtALFzGLdLAJ/4ECPM7FQdpfITNmhyIkGrsQHQ4D zlWOxifMT0i/eoglCmwuD0r2kr5eMp1xQQ== X-Received: by 2002:a25:a287:0:b0:c1a:eb92:73d with SMTP id c7-20020a25a287000000b00c1aeb92073dmr11922620ybi.65.1688022645505; Thu, 29 Jun 2023 00:10:45 -0700 (PDT) Received: from mail-yw1-f176.google.com (mail-yw1-f176.google.com. [209.85.128.176]) by smtp.gmail.com with ESMTPSA id x68-20020a25ce47000000b00b8f6ec5a955sm2422276ybe.49.2023.06.29.00.10.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Jun 2023 00:10:45 -0700 (PDT) Received: by mail-yw1-f176.google.com with SMTP id 00721157ae682-57026f4bccaso3520787b3.2; Thu, 29 Jun 2023 00:10:44 -0700 (PDT) X-Received: by 2002:a81:4fce:0:b0:565:e48d:32cf with SMTP id d197-20020a814fce000000b00565e48d32cfmr40124407ywb.7.1688022644631; Thu, 29 Jun 2023 00:10:44 -0700 (PDT) MIME-Version: 1.0 References: <20230627091007.190958-1-tanure@linux.com> <20230627091007.190958-5-tanure@linux.com> In-Reply-To: Reply-To: tanure@linux.com From: Lucas Tanure Date: Thu, 29 Jun 2023 08:10:33 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6 4/4] arm64: dts: amlogic-t7-a311d2-khadas-vim4: add initial device-tree To: Xianwei Zhao Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Jerome Brunet , Kevin Hilman , Nick , Artem , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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 Tue, Jun 27, 2023 at 10:21 AM Xianwei Zhao wrote: > > > > On 2023/6/27 17:10, Lucas Tanure wrote: > > [ EXTERNAL EMAIL ] > > > > The Khadas VIM4 uses the Amlogic A311D2 SoC, based on the Amlogic T7 SoC > > family, on a board with the same form factor as the VIM3 models. > > > > - 8GB LPDDR4X 2016MHz > > - 32GB eMMC 5.1 storage > > - 32MB SPI flash > > - 10/100/1000 Base-T Ethernet > > - AP6275S Wireless (802.11 a/b/g/n/ac/ax, BT5.1) > > - HDMI 2.1 video > > - HDMI Input > > - 1x USB 2.0 + 1x USB 3.0 ports > > - 1x USB-C (power) with USB 2.0 OTG > > - 3x LED's (1x red, 1x blue, 1x white) > > - 3x buttons (power, function, reset) > > - M2 socket with PCIe, USB, ADC & I2C > > - 40pin GPIO Header > > - 1x micro SD card slot > > > > Signed-off-by: Lucas Tanure > > --- > > arch/arm64/boot/dts/amlogic/Makefile | 1 + > > .../amlogic/amlogic-t7-a311d2-khadas-vim4.dts | 52 ++++++ > > arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 158 ++++++++++++++++++ > > 3 files changed, 211 insertions(+) > > create mode 100644 arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts > > create mode 100644 arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi > > > > diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile > > index cd1c5b04890a..166fec1e4229 100644 > > --- a/arch/arm64/boot/dts/amlogic/Makefile > > +++ b/arch/arm64/boot/dts/amlogic/Makefile > > @@ -1,4 +1,5 @@ > > # SPDX-License-Identifier: GPL-2.0 > > +dtb-$(CONFIG_ARCH_MESON) += amlogic-t7-a311d2-khadas-vim4.dtb > > dtb-$(CONFIG_ARCH_MESON) += meson-a1-ad401.dtb > > dtb-$(CONFIG_ARCH_MESON) += meson-axg-jethome-jethub-j100.dtb > > dtb-$(CONFIG_ARCH_MESON) += meson-axg-jethome-jethub-j110-rev-2.dtb > > diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts b/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts > > new file mode 100644 > > index 000000000000..5d7fb86a9738 > > --- /dev/null > > +++ b/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts > > @@ -0,0 +1,52 @@ > > +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) > > +/* > > + * Copyright (c) 2022 Wesion, Inc. All rights reserved. > > + */ > > + > > +/dts-v1/; > > + > > +#include "amlogic-t7.dtsi" > > + > > +/ { > > + model = "Khadas vim4"; > > + compatible = "khadas,vim4", "amlogic,a311d2", "amlogic,t7"; > > + > > + aliases { > > + serial0 = &uart_A; > > + }; > > + > > + memory@0 { > > + device_type = "memory"; > > + reg = <0x0 0x0 0x2 0x0>; /* 8 GB */ > > + }; > > + > > + reserved-memory { > > + #address-cells = <2>; > > + #size-cells = <2>; > > + ranges; > > + > > + /* 3 MiB reserved for ARM Trusted Firmware (BL31) */ > > + secmon_reserved: secmon@5000000 { > > + reg = <0x0 0x05000000 0x0 0x300000>; > > + no-map; > > + }; > > + > > + /* 32 MiB reserved for ARM Trusted Firmware (BL32) */ > > + secmon_reserved_bl32: secmon@5300000 { > > + reg = <0x0 0x05300000 0x0 0x2000000>; > > + no-map; > > + }; > > + }; > > + > > + xtal: xtal-clk { > > + compatible = "fixed-clock"; > > + clock-frequency = <24000000>; > > + clock-output-names = "xtal"; > > + #clock-cells = <0>; > > + }; > > + > > +}; > > + > > +&uart_A { > > + status = "okay"; > > +}; > > diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi > > new file mode 100644 > > index 000000000000..6f3971b4df99 > > --- /dev/null > > +++ b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi > > @@ -0,0 +1,158 @@ > > +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) > > +/* > > + * Copyright (c) 2019 Amlogic, Inc. All rights reserved. > > + */ > > + > > +#include > > + > > +/ { > > + interrupt-parent = <&gic>; > > + #address-cells = <2>; > > + #size-cells = <2>; > > + > > + cpus { > > + #address-cells = <0x2>; > > + #size-cells = <0x0>; > > + > > + cpu-map { > > + cluster0 { > > + core0 { > > + cpu = <&cpu100>; > > + }; > > + core1 { > > + cpu = <&cpu101>; > > + }; > > + core2 { > > + cpu = <&cpu102>; > > + }; > > + core3 { > > + cpu = <&cpu103>; > > + }; > > + }; > > + > > + cluster1 { > > + core0 { > > + cpu = <&cpu0>; > > + }; > > + core1 { > > + cpu = <&cpu1>; > > + }; > > + core2 { > > + cpu = <&cpu2>; > > + }; > > + core3 { > > + cpu = <&cpu3>; > > + }; > > + }; > > + }; > > + > > + cpu100: cpu@100 { > > + device_type = "cpu"; > > + compatible = "arm,cortex-a53"; > > + reg = <0x0 0x100>; > > + enable-method = "psci"; > > + }; > > + > > + cpu101: cpu@101{ > > + device_type = "cpu"; > > + compatible = "arm,cortex-a53"; > > + reg = <0x0 0x101>; > > + enable-method = "psci"; > > + }; > > + > > + cpu102: cpu@102 { > > + device_type = "cpu"; > > + compatible = "arm,cortex-a53"; > > + reg = <0x0 0x102>; > > + enable-method = "psci"; > > + }; > > + > > + cpu103: cpu@103 { > > + device_type = "cpu"; > > + compatible = "arm,cortex-a53"; > > + reg = <0x0 0x103>; > > + enable-method = "psci"; > > + }; > > + > > + cpu0: cpu@0 { > > + device_type = "cpu"; > > + compatible = "arm,cortex-a73"; > > + reg = <0x0 0x0>; > > + enable-method = "psci"; > > + }; > > + > > + cpu1: cpu@1 { > > + device_type = "cpu"; > > + compatible = "arm,cortex-a73"; > > + reg = <0x0 0x1>; > > + enable-method = "psci"; > > + }; > > + > > + cpu2: cpu@2 { > > + device_type = "cpu"; > > + compatible = "arm,cortex-a73"; > > + reg = <0x0 0x2>; > > + enable-method = "psci"; > > + }; > > + > > + cpu3: cpu@3 { > > + device_type = "cpu"; > > + compatible = "arm,cortex-a73"; > > + reg = <0x0 0x3>; > > + enable-method = "psci"; > > + }; > > + }; > > + > > + timer { > > + compatible = "arm,armv8-timer"; > > + interrupts = , > > + , > > + , > > + ; > > + }; > cpu number is 8, not 4, need use GIC_CPU_MASK_SIMPLE(8) > > + > > + psci { > > + compatible = "arm,psci-1.0"; > > + method = "smc"; > > + }; > > + > > + sm: secure-monitor { > > + compatible = "amlogic,meson-gxbb-sm"; > > + }; > > + > > + soc { > > + compatible = "simple-bus"; > > + #address-cells = <2>; > > + #size-cells = <2>; > > + ranges; > > + > > + gic: interrupt-controller@fff01000 { > > + compatible = "arm,gic-400"; > > + #interrupt-cells = <3>; > > + #address-cells = <0>; > > + interrupt-controller; > > + reg = <0x0 0xfff01000 0 0x1000>, > > + <0x0 0xfff02000 0 0x0100>; > > + interrupts = ; > cpu number is 8, not 4, need use GIC_CPU_MASK_SIMPLE(8) OK > > + }; > > + > > + apb4: bus@fe000000 { > > + compatible = "simple-bus"; > > + reg = <0x0 0xfe000000 0x0 0x480000>; > > + #address-cells = <2>; > > + #size-cells = <2>; > > + ranges = <0x0 0x0 0x0 0xfe000000 0x0 0x480000>; > > + > > + uart_A: serial@78000 { > use lowercase, "uart_a" OK > > + compatible = "amlogic,t7-uart", > > + "amlogic,meson-s4-uart"; > > + reg = <0x0 0x78000 0x0 0x18>; > > + interrupts = ; > > + status = "disabled"; > > + clocks = <&xtal>, <&xtal>, <&xtal> > "xtal" why defined in amlogic-t7-a311d2-khadas-vim4.dts files The 24MHz clock is a crystal in VIm4 schematic, so its something the board did to provide that clock. Other boards using a311d2 could provide that clock in a different way. Or are you saying that this clock is mandatory at boot time, and all boards using this chip will have the same crystal? > > + clock-names = "xtal", "pclk", "baud"; > > + }; > > + }; > > + > > + }; > > +}; > > -- > > 2.41.0 > >