From patchwork Fri Jun 23 08:12:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Tanure X-Patchwork-Id: 11203 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp5626843vqr; Fri, 23 Jun 2023 01:53:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7xdwgSfNjHuw7EOpYZSfifO2e9xYflV3NsdeCIFVIbZsMlkCklhLowdDc5qlwVpWyvyLNd X-Received: by 2002:a17:90a:b895:b0:25e:8169:1b44 with SMTP id o21-20020a17090ab89500b0025e81691b44mr13739847pjr.15.1687510425778; Fri, 23 Jun 2023 01:53:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687510425; cv=none; d=google.com; s=arc-20160816; b=Kk9puFJ1ye1BYUr1j6Ug8SLUtqo0n8XUOI7DrpdOtr6NPAMIa/qocO/EUHW4QvprdZ ytuNelEBF1OxK7Jh8duL+12LfiLsFO1Q29mjKgD9+2HHvNUFe9eQwfN3fiDBEq4GsTtH byf7gfTFflsGfLEnz/HurptS0McewA548p0MLzVLi7yfG/g/TkMCH6ZhWzr5RJu9csNr XwAgsIqp/R5dAMrdawPvCkyx5DMVJGnm31/YazyHmIINmHP6qS74sthsRGoIATSy9Oze kddc/VF2WKtIonUKVCHLffcd93BlE1BImG4SiJLQGBWK1vRuOm0uRB3eN8mZCgmVLAD2 k/Kw== 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:date:subject:cc:to:from; bh=l/dYwrBL+Qkk5ymGNSlPa75MZ37M5uNwNxJYrXJbylM=; b=McsYXbnaRmb7yO+4ybEjKdIS9vughiGHWzXSLrfX+eyQfdFNPFgx8y9ZepX0krCC5y Gpu2Z4IaE1UPPnGlIRHfbrXokvL0m/nlU7zfr7yO33dZQKFg9jM2hz1i5viR6uyvw/F4 5pklaxk4ytD4NV5docWBJX4ZK6xFkOo2CImxpogdf9fPHuk+g6HSrOHNB5gL9w9/JL4P BS4kPmkJMMlq1e4P4OWc+6XZBESA+kf5MRUZRz4/KaxG5At+FFLQ5eRQ67kAapTZXp1y ljlKWFfzvLvfZCUt0jybP2ycOOPgbqot98OclfBzIqgte5EzXbcgckWM/yxpDlbJaXH4 29Ng== 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 x4-20020a63db44000000b00553a99dd783si4386824pgi.778.2023.06.23.01.53.31; Fri, 23 Jun 2023 01:53:45 -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 S231743AbjFWIMu (ORCPT + 99 others); Fri, 23 Jun 2023 04:12:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230481AbjFWIMs (ORCPT ); Fri, 23 Jun 2023 04:12:48 -0400 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8327B2100; Fri, 23 Jun 2023 01:12:46 -0700 (PDT) Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-3fa7cd95dacso3686535e9.3; Fri, 23 Jun 2023 01:12:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687507965; x=1690099965; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=l/dYwrBL+Qkk5ymGNSlPa75MZ37M5uNwNxJYrXJbylM=; b=lE7IE8IkbUUhJH1ss2evldGkN6CiKihB6Iqty213clEt+vW1y7HwPWrrWtXoY8oCM2 QcH5L5ok85zXLGnbH/xUpusyZLjPuXf+SC3lAXFuAxsLjPQAeFARE3xuSLHPpmj2fXeX QPuCwP3rDART+rGreWbywtAtJMGXgG+1i5RBmbiLJoIp4kTuJsLZqt0zMp19PZ9iCeFV YaRraOGhn2pdXBUiqp6f6XaVHopQx2RT/IP1DCuuf0uoR1u6PuPbVkRuLTUfjqTGy5K4 YyL2uD/8KS3jxZT5/lAf7KvG7GLS+/9VywC2xuc1GKlSY5TCOPqo9QKFlaSV+JHx0yYq PMwA== X-Gm-Message-State: AC+VfDxi/LZaOt8ZedUbSGAEQ1BIplBRP1efRbwv9M+2o00r83g/hSsK aqLkG1mMm+f1a+xHwdUzanM= X-Received: by 2002:a05:600c:220b:b0:3f9:b0fe:7e11 with SMTP id z11-20020a05600c220b00b003f9b0fe7e11mr10846336wml.28.1687507964681; Fri, 23 Jun 2023 01:12:44 -0700 (PDT) Received: from ryzen.lan (cpc87451-finc19-2-0-cust61.4-2.cable.virginm.net. [82.11.51.62]) by smtp.gmail.com with ESMTPSA id l21-20020a7bc455000000b003f9b29ba838sm1594141wmi.35.2023.06.23.01.12.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jun 2023 01:12:44 -0700 (PDT) From: Lucas Tanure To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Jerome Brunet , Kevin Hilman Cc: Nick , Artem , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Lucas Tanure Subject: [PATCH v5 0/4] Add Amlogic A311D2 and Khadas Vim4 Board Support Date: Fri, 23 Jun 2023 09:12:38 +0100 Message-ID: <20230623081242.109131-1-tanure@linux.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769482932191086026?= X-GMAIL-MSGID: =?utf-8?q?1769482932191086026?= The Khadas VIM4 uses the Amlogic A311D2 SoC, based on the Amlogic Meson T7 family. This chip is not the same as A311D used in Vim3 board. Work based on Khadas 5.4 branch: https://github.com/khadas/linux/tree/khadas-vims-5.4.y The current status is Vim4 board booting to emergency shell via uart. Board Features: - 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 Changes Since v4: - Use S4 instead of G12a for uart fallback - Add OF_EARLYCON_DECLARE for T7 uart Changes Since v3: - Fix issues with "amlogic,meson-t7-uart" documentation Changes Since v2: - Add "amlogic,meson-t7-uart" documentation Changes Since v1: - Drop the T7 clock driver as it is not needed for serial boot. It will later use the S4 clock driver as S4 and T7 seems to be similar chips. - Use "arm,gic-400" for interrupt controller to fix dtb_check - Remove CPU node properties not needed for serial boot - Move UART node to apb4 node - Drop T7 UART compatible line and use S4 uart - Use psci V1 instead of 0.2, it works, but I can't verify is correct as the datasheet I have doesn't contain that information. - Remove compatible from meson-t7.dtsi, move it to vim4 board dts - Add memory node with 8GB. Not sure about this one, works without, but doesn't detect 8GB - Use defines for GIC_CPU_MASK_SIMPLE, IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_HIGH instead of hardcoded values Lucas Tanure (4): dt-bindings: arm: amlogic: add Amlogic A311D2 bindings dt-bindings: serial: amlogic,meson-uart: Add compatible string for T7 tty: serial: meson: Add a earlycon for the T7 SoC arm64: dts: meson-t7-a311d2-khadas-vim4: add initial device-tree .../devicetree/bindings/arm/amlogic.yaml | 7 + .../bindings/serial/amlogic,meson-uart.yaml | 4 + arch/arm64/boot/dts/amlogic/Makefile | 1 + .../amlogic/meson-t7-a311d2-khadas-vim4.dts | 52 ++++++ arch/arm64/boot/dts/amlogic/meson-t7.dtsi | 158 ++++++++++++++++++ drivers/tty/serial/meson_uart.c | 2 + 6 files changed, 224 insertions(+) create mode 100644 arch/arm64/boot/dts/amlogic/meson-t7-a311d2-khadas-vim4.dts create mode 100644 arch/arm64/boot/dts/amlogic/meson-t7.dtsi --- 2.41.0