Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp154459rwr; Wed, 19 Apr 2023 19:42:57 -0700 (PDT) X-Google-Smtp-Source: AKy350banr8xftW2ZvvWRO/rB2n+2MfjHRSf5P+9I0Fu69BAxnkIQ/F9/+kGAAZwtCWm2viOEph4 X-Received: by 2002:a05:6808:1484:b0:38e:37a:25bb with SMTP id e4-20020a056808148400b0038e037a25bbmr102129oiw.25.1681958577100; Wed, 19 Apr 2023 19:42:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681958577; cv=none; d=google.com; s=arc-20160816; b=q1KtM2tVt2rAlOKre3OVfgRUrpHwN+1uy/urMUt9q6buVzN4vV6twGAXaDm9Peltth uWdFh207//RQGqP57GYwNnwi9ewMzktSkY5vd2ieukTSfnhoaVkApOk1FFzHUKG417qO 3BSdVTkQB6/yYodrajRYeXmjnG9YS1SnUrshzKr9rOzlCUZldnhFDo+yAIgjs28gg7W8 acaOG07/QOOhJ0/C5HvgdJN/V7m8rga0I4LpZTkHguHK6v0mCUSWXZM+D8vQJGRa/BBX MYMQXr/r5gOzBYaSbrPVip3eIdArhxyQ1nV7AdeeI0zDqmw0IcAG2lpEFRWoGeN9I8d5 IC2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=NavBojbdXPLAwozfxPgxB1TuC6kWqwJ3pk+2sVTVGNE=; b=lZ1nbvS9SvjIsc+jFtYME1ozw1vpofzCfXJeF0mYEb5iVPzWvpCGnFTc9Cturk4Rs4 0B4MZZRN3RfSDy/bio97lsz62zKAoNQfONqckpx+QkqzorlJutQ4YN5Xi6V7porgKKeb 6C365a4AcCfMM0EykXJVYRLu3kownZC1PHMYxlkKIcQPfWwBeFFFmjq3MJYIsDqpTsrd 6LBWj4Mb2ZoOxbVhftjn6kcfjzp76dki4jGI2bDUCZ1j01XTdWhDjAEIRhBCzCpOPyT8 aXkHkY/Y1X9e8DBG+8cj3PX8CPqiexvuKEYRxUWOk/of++YUAD2jYZAa1FNq6UvaIJdE czqQ== 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 y128-20020aca3286000000b0038e0ff91243si415959oiy.81.2023.04.19.19.42.44; Wed, 19 Apr 2023 19:42:57 -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 S233643AbjDTCmN (ORCPT + 99 others); Wed, 19 Apr 2023 22:42:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233518AbjDTCln (ORCPT ); Wed, 19 Apr 2023 22:41:43 -0400 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D01E459D6; Wed, 19 Apr 2023 19:41:28 -0700 (PDT) Received: from EXMBX166.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX166", Issuer "EXMBX166" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id 52A0524E171; Thu, 20 Apr 2023 10:41:22 +0800 (CST) Received: from EXMBX168.cuchost.com (172.16.6.78) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 20 Apr 2023 10:41:22 +0800 Received: from SD-Server.starfivetech.com (113.72.144.253) by EXMBX168.cuchost.com (172.16.6.78) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 20 Apr 2023 10:41:21 +0800 From: Walker Chen To: Jaroslav Kysela , Takashi Iwai , "Rob Herring" , Krzysztof Kozlowski , Conor Dooley , Emil Renner Berthing , Liam Girdwood , Mark Brown , Walker Chen CC: , , , Subject: [PATCH v2 4/4] riscv: dts: starfive: add tdm node and sound card Date: Thu, 20 Apr 2023 10:41:18 +0800 Message-ID: <20230420024118.22677-5-walker.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230420024118.22677-1-walker.chen@starfivetech.com> References: <20230420024118.22677-1-walker.chen@starfivetech.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [113.72.144.253] X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) To EXMBX168.cuchost.com (172.16.6.78) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Add the tdm controller node and sound card for the StarFive JH7110 SoC. Reviewed-by: Hal Feng Signed-off-by: Walker Chen --- arch/riscv/boot/dts/starfive/Makefile | 1 + .../starfive/jh7110-starfive-audio-card.dts | 67 +++++++++++++++++++ .../jh7110-starfive-visionfive-2.dtsi | 40 +++++++++++ arch/riscv/boot/dts/starfive/jh7110.dtsi | 21 ++++++ 4 files changed, 129 insertions(+) create mode 100644 arch/riscv/boot/dts/starfive/jh7110-starfive-audio-card.dts diff --git a/arch/riscv/boot/dts/starfive/Makefile b/arch/riscv/boot/dts/starfive/Makefile index 170956846d49..cb22cb7f66b0 100644 --- a/arch/riscv/boot/dts/starfive/Makefile +++ b/arch/riscv/boot/dts/starfive/Makefile @@ -4,3 +4,4 @@ dtb-$(CONFIG_ARCH_STARFIVE) += jh7100-starfive-visionfive-v1.dtb dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-starfive-visionfive-2-v1.2a.dtb dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-starfive-visionfive-2-v1.3b.dtb +dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-starfive-audio-card.dtb diff --git a/arch/riscv/boot/dts/starfive/jh7110-starfive-audio-card.dts b/arch/riscv/boot/dts/starfive/jh7110-starfive-audio-card.dts new file mode 100644 index 000000000000..967d9aa7d1e1 --- /dev/null +++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-audio-card.dts @@ -0,0 +1,67 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT +/* + * Device Tree for JH7110 + Simple Audio Card + * + * Copyright (C) 2023 StarFive Technology Co., Ltd. + */ + +/dts-v1/; +#include "jh7110-starfive-visionfive-2-v1.3b.dts" + +/ { + model = "StarFive VisionFive 2 Audio Board"; + compatible = "starfive,visionfive-2-audio", "starfive,jh7110"; + + wm8960_mclk: wm8960-mclk { + compatible = "fixed-clock"; + clock-output-names = "wm8960_mclk"; + #clock-cells = <0>; + clock-frequency = <24576000>; + }; + + sound { + compatible = "simple-audio-card"; + + #address-cells = <1>; + #size-cells = <0>; + + simple-audio-card,name = "Starfive-TDM-Sound-Card"; + simple-audio-card,widgets = "Microphone", "Mic Jack", + "Line", "Line In", + "Line", "Line Out", + "Speaker", "Speaker", + "Headphone", "Headphone Jack"; + simple-audio-card,routing = "Headphone Jack", "HP_L", + "Headphone Jack", "HP_R", + "Speaker", "SPK_LP", + "Speaker", "SPK_LN", + "LINPUT1", "Mic Jack", + "LINPUT3", "Mic Jack", + "RINPUT1", "Mic Jack", + "RINPUT2", "Mic Jack"; + + simple-audio-card,dai-link@0 { + reg = <0>; + format = "dsp_a"; + bitclock-master = <&dailink_master>; + frame-master = <&dailink_master>; + + cpu { + sound-dai = <&tdm>; + }; + dailink_master: codec { + sound-dai = <&wm8960>; + clocks = <&wm8960_mclk>; + }; + }; + }; +}; + +&i2c0 { + wm8960: codec@1a { + compatible = "wlf,wm8960"; + reg = <0x1a>; + wlf,shared-lrclk; + #sound-dai-cells = <0>; + }; +}; diff --git a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi index 1155b97b593d..19b5954ee72d 100644 --- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi @@ -214,6 +214,40 @@ slew-rate = <0>; }; }; + + tdm0_pins: tdm0-pins { + tdm0-pins-tx { + pinmux = ; + bias-pull-up; + drive-strength = <2>; + input-disable; + input-schmitt-disable; + slew-rate = <0>; + }; + + tdm0-pins-rx { + pinmux = ; + input-enable; + }; + + tdm0-pins-sync { + pinmux = ; + input-enable; + }; + + tdm0-pins-pcmclk { + pinmux = ; + input-enable; + }; + }; }; &uart0 { @@ -221,3 +255,9 @@ pinctrl-0 = <&uart0_pins>; status = "okay"; }; + +&tdm { + pinctrl-names = "default"; + pinctrl-0 = <&tdm0_pins>; + status = "okay"; +}; diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi index 866313570a7e..cfda6fb0d91b 100644 --- a/arch/riscv/boot/dts/starfive/jh7110.dtsi +++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi @@ -366,6 +366,27 @@ status = "disabled"; }; + tdm: tdm@10090000 { + compatible = "starfive,jh7110-tdm"; + reg = <0x0 0x10090000 0x0 0x1000>; + clocks = <&syscrg JH7110_SYSCLK_TDM_AHB>, + <&syscrg JH7110_SYSCLK_TDM_APB>, + <&syscrg JH7110_SYSCLK_TDM_INTERNAL>, + <&syscrg JH7110_SYSCLK_TDM_TDM>, + <&syscrg JH7110_SYSCLK_MCLK_INNER>, + <&tdm_ext>; + clock-names = "tdm_ahb", "tdm_apb", + "tdm_internal", "tdm", + "mclk_inner", "tdm_ext"; + resets = <&syscrg JH7110_SYSRST_TDM_AHB>, + <&syscrg JH7110_SYSRST_TDM_APB>, + <&syscrg JH7110_SYSRST_TDM_CORE>; + dmas = <&dma 20>, <&dma 21>; + dma-names = "rx","tx"; + #sound-dai-cells = <0>; + status = "disabled"; + }; + stgcrg: clock-controller@10230000 { compatible = "starfive,jh7110-stgcrg"; reg = <0x0 0x10230000 0x0 0x10000>; -- 2.17.1