From patchwork Thu Mar 5 18:53:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 1249826 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=TXuB5glC; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48YKgh1wV5z9sPk for ; Fri, 6 Mar 2020 05:55:12 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6D68A8135D; Thu, 5 Mar 2020 19:54:10 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="TXuB5glC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 29B69812E1; Thu, 5 Mar 2020 19:53:59 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B4ABB801F1 for ; Thu, 5 Mar 2020 19:53:51 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qt1-x844.google.com with SMTP id j34so4971661qtk.4 for ; Thu, 05 Mar 2020 10:53:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ROVJStw06DhcmEcehZC6VUe0KUrRTqV/vgMlmSlKJ6c=; b=TXuB5glCPWLy+jidsgLr0Rma6z7El/+OlFBb8UcyaxzslRRwzXXnZ25813jqrFqQCT 6i8bCGXh156MJlIPy3pV2RQxyWf2wN3nIAgF2/0lYA3eu84AzKX9wbo9Y71Z71mL2XKy Svo7086pXCKxu+Cdh4lXNdekmaYZPs48ToqGfLB8BZbyHM092DmQg6jd/oohPFw6Q4DV YMHwkLj6WGJdc49b9pJljfQxqGNJOiOIgciQBQyTVtnr3+IwhBlSsobTh1BtxFt7LR2R NlwnqXN1LObnCl2Ws9TGhyUUPC86OhcAf2DxXGDwWA5h5IEave6zDGZX3i5buZtv3rNs aCdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ROVJStw06DhcmEcehZC6VUe0KUrRTqV/vgMlmSlKJ6c=; b=Xe6M8aeg0aMy11o/VSgLWvULT9DG4CHS9FEQsGkpg9DBOloJAtbePG84voxC2kj9Rw HNRTbsIHfHC2g07cckdqfnWSv6LxFXK36lpMQjNp+HP0jPil7xtH2Mi2AKAz8zEJcUE6 cDU/shZGL2SaX+YTeEjzRpIX6zHoQYQke1VQYVvby1/vGapNc9AQTEr9oUFzrEBQgVA+ xStLrXWuSlIWhcL65CrTHGi7bH3INMVu3mIjc/8PcwGta0MBoTZmLbDoO3LW6c6yOubS c1+NDTvauHRTM1Muy2IAgslAGFo+gENvI4kJAwBhEGBxKWUv1F9AKwQZoa38HidOkJVY c15A== X-Gm-Message-State: ANhLgQ1ebnTxe2MpBYi0dEefVyaClNfQrVibxPxLV5Yqe77SbUtkH6Mk Uiul5MpgIFos4KrbFIkf6/mVGYMDIUg= X-Google-Smtp-Source: ADFU+vvkWEazleaSKqwkz4Cc1V+Klk3hU8u5DGkbgALnBSfUvfVGy2f0dI59tgmKfmiy69zS/p+dsQ== X-Received: by 2002:ac8:6f79:: with SMTP id u25mr113090qtv.180.1583434430298; Thu, 05 Mar 2020 10:53:50 -0800 (PST) Received: from localhost.localdomain ([75.102.135.197]) by smtp.gmail.com with ESMTPSA id o16sm16263379qke.35.2020.03.05.10.53.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Mar 2020 10:53:49 -0800 (PST) From: Sean Anderson To: u-boot@lists.denx.de Cc: Simon Glass , Tom Rini , Sean Anderson , Bin Meng , Rick Chen Subject: [PATCH v1 7/8] riscv: Add pinmux and gpio bindings for Kendryte K210 Date: Thu, 5 Mar 2020 13:53:27 -0500 Message-Id: <20200305185328.951011-8-seanga2@gmail.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200305185328.951011-1-seanga2@gmail.com> References: <20200305185328.951011-1-seanga2@gmail.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean This patch adds the necessary device tree bindings. Signed-off-by: Sean Anderson --- arch/riscv/dts/k210-maix-bit.dts | 196 +++++++++++++++++++++++++++++++ arch/riscv/dts/k210.dtsi | 43 ++++++- 2 files changed, 234 insertions(+), 5 deletions(-) diff --git a/arch/riscv/dts/k210-maix-bit.dts b/arch/riscv/dts/k210-maix-bit.dts index 5b32c5fd5f..c0ec572552 100644 --- a/arch/riscv/dts/k210-maix-bit.dts +++ b/arch/riscv/dts/k210-maix-bit.dts @@ -17,6 +17,22 @@ stdout-path = "serial0:115200"; }; + gpio-leds { + compatible = "gpio-leds"; + + green { + gpios = <&gpio1_0 4 GPIO_ACTIVE_LOW>; + }; + + red { + gpios = <&gpio1_0 5 GPIO_ACTIVE_LOW>; + }; + + blue { + gpios = <&gpio1_0 6 GPIO_ACTIVE_LOW>; + }; + }; + sound { compatible = "simple-audio-card"; simple-audio-card,format = "i2s"; @@ -39,9 +55,189 @@ }; &uarths0 { + pinctrl-0 = <&fpioa_uarths>; + pinctrl-names = "default"; + status = "okay"; +}; + +&gpio0 { + pinctrl-0 = <&fpioa_gpiohs>; + pinctrl-names = "default"; + status = "okay"; +}; + +&gpio1 { + pinctrl-0 = <&fpioa_gpio>; + pinctrl-names = "default"; status = "okay"; }; &i2s0 { #sound-dai-cells = <1>; + pinctrl-0 = <&fpioa_i2s0>; + pinctrl-names = "default"; +}; + +&fpioa { + status = "okay"; + + fpioa_uarths: uarths { + rx { + function = "UARTHS_RX"; + pins = "IO_4"; + }; + tx { + function = "UARTHS_TX"; + pins = "IO_5"; + }; + }; + + fpioa_gpiohs: gpiohs { + 1 { + function = "GPIOHS1"; + pins = "IO_6"; + }; + 2 { + function = "GPIOHS2"; + pins = "IO_7"; + }; + 3 { + function = "GPIOHS3"; + pins = "IO_17"; + }; + 4 { + function = "GPIOHS4"; + pins = "IO_21"; + }; + 5 { + function = "GPIOHS5"; + pins = "IO_22"; + }; + 6 { + function = "GPIOHS6"; + pins = "IO_23"; + }; + 7 { + function = "GPIOHS7"; + pins = "IO_24"; + }; + 8 { + function = "GPIOHS8"; + pins = "IO_25"; + }; + 9 { + function = "GPIOHS9"; + pins = "IO_30"; + }; + 10 { + function = "GPIOHS10"; + pins = "IO_31"; + }; + 11 { + function = "GPIOHS11"; + pins = "IO_32"; + }; + 12 { + function = "GPIOHS12"; + pins = "IO_33"; + }; + 13 { + function = "GPIOHS13"; + pins = "IO_34"; + }; + 14 { + function = "GPIOHS14"; + pins = "IO_35"; + }; + }; + + fpioa_gpio: gpio { + 0 { + function = "GPIO0"; + pins = "IO_8"; + }; + 1 { + function = "GPIO1"; + pins = "IO_9"; + }; + 2 { + function = "GPIO2"; + pins = "IO_10"; + }; + 3 { + function = "GPIO3"; + pins = "IO_11"; + }; + 4 { + function = "GPIO4"; + pins = "IO_12"; + }; + 5 { + function = "GPIO5"; + pins = "IO_13"; + }; + 6 { + function = "GPIO6"; + pins = "IO_14"; + }; + 7 { + function = "GPIO7"; + pins = "IO_15"; + }; + }; + + fpioa_i2s0: i2s0 { + bck { + function = "I2S0_SCLK"; + pins = "IO_18"; + }; + ws { + function = "I2S0_WS"; + pins = "IO_19"; + }; + dat { + function = "I2S0_IN_D0"; + pins = "IO_20"; + }; + }; + + fpioa_dvp: dvp { + sda { + function = "SCCP_SDA"; + pins = "IO_40"; + }; + sck { + function = "SCCP_SCLK"; + pins = "IO_41"; + }; + rst { + function = "DVP_RST"; + pins = "IO_42"; + }; + vsync { + function = "DVP_VSYNC"; + pins = "IO_43"; + }; + pwdn { + function = "DVP_PWDN"; + pins = "IO_44"; + }; + hsync { + function = "DVP_HSYNC"; + pins = "IO_45"; + }; + xclk { + function = "DVP_XCLK"; + pins = "IO_46"; + }; + pclk { + function = "DVP_PCLK"; + pins = "IO_47"; + }; + }; +}; + +&dvp0 { + pinctrl-0 = <&fpioa_dvp>; + pinctrl-names = "default"; }; diff --git a/arch/riscv/dts/k210.dtsi b/arch/riscv/dts/k210.dtsi index 8b3b872e2f..0192ce5eae 100644 --- a/arch/riscv/dts/k210.dtsi +++ b/arch/riscv/dts/k210.dtsi @@ -230,6 +230,14 @@ interrupts = <23>; gpio-controller; snps,nr-gpios = <8>; + + isp { + gpio-hog; + gpios = <0 0>; + input; + pinctrl-0 = <&fpioa_isp>; + pinctrl-names = "default"; + }; }; }; @@ -290,11 +298,6 @@ clocks = <&sysclk K210_CLK_SPI2>; resets = <&sysrst K210_RST_SPI2>; spi-max-frequency = <25000000>; - /* - * Likely not the only offset change, but this - * is the only one which is documented. - */ - snps,tmod-offset = <8>; status = "disabled"; }; @@ -372,7 +375,37 @@ reg = <0x502B0000 0x100>; clocks = <&sysclk K210_CLK_FPIOA>; resets = <&sysrst K210_RST_FPIOA>; + kendryte,sysctl = <&sysctl>; + kendryte,power-offset = ; + pinctrl-0 = <&fpioa_jtag>; + pinctrl-names = "default"; status = "disabled"; + + fpioa_jtag: jtag { + tck { + function = "JTAG_TCLK"; + pins = "IO_0"; + }; + tdi { + function = "JTAG_TDI"; + pins = "IO_1"; + }; + tms { + function = "JTAG_TMS"; + pins = "IO_2"; + }; + tdo { + function = "JTAG_TDO"; + pins = "IO_3"; + }; + }; + + fpioa_isp: isp { + isp { + function = "GPIOHS0"; + pins = "IO_16"; + }; + }; }; sha256: sha256@502C0000 {