From patchwork Tue Feb 9 12:29:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 12077901 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE172C433DB for ; Tue, 9 Feb 2021 12:30:38 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4F47364EB9 for ; Tue, 9 Feb 2021 12:30:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4F47364EB9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=SGPCRCR3aYDwjpt8iO0XmZhyWRgILMafMnhwC+8+L3E=; b=xtVcaQJuGhc7EOSKubZBZ/i/h HEVoasq9kk1JxCbyvMK0ZsvxxxR1UmNwk8jZgHKybl/25gJflO/e31A08sDTPmbKYfWZuhtnGuAzN 8+M4ijQK8z3LQZXV8k2zh9+v8bCUIJEygQbFp30nte+Bl4vLsIgy5l18u5HRJ6A7y9O7QpFu08I+e OLpmGzC2wfw/8/n7p0QcV1SxmIlTg+DV//mr/Uh6NBa3Q5W34OIsM+44OmVIawlYbv7h06m8eNm/f RE07jbeOnamCdJ/Y8PSOHTDd5GIG1DV9ecSnD72nmaGTbzbuG9/33TosWSoINwOUodawNJPDfc4dl kDtR+NIKw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9SA0-00087R-Ri; Tue, 09 Feb 2021 12:30:28 +0000 Received: from esa2.hgst.iphmx.com ([68.232.143.124]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9S9s-00084I-MB for linux-riscv@lists.infradead.org; Tue, 09 Feb 2021 12:30:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612874188; x=1644410188; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TxfidNqefqxMUisZtkxjHAl9g4l4Mi2iLVoOkKU+tdg=; b=MeFtBOmDexhk5rldVZGqqgmfGS3NA0T2oJalQtec0awDPKsxasjHYb29 mOL3D5WYtf4HKpoSSMVUJNPWm7i8/Vehsvn5m+AK5sw9uZhP4ebMBeTVh T0fYkm+IlClsg+qautSvBSt/B3SB7dOgeqAYUOQwht9QB8aFRKIGRQ2zF KevDCeJFqrhxhcuILvJBhHdYoKw5AOSOJ+Owpm8phqoM1XvPqLDKxE1wh 7I/z3ngEVWk2Hfd2See1RPFJMHFMGlNRA1FFeTAW6xZnKGsxJEGrOCdLb CPCP2zqgkNRkPlZxppwXQYMU3FQa/zFgwdAovPq7XLIrq2CoQSeQO21X5 Q==; IronPort-SDR: 9yzFEIPOO5QQ3J2MWOGicCyh1oRzTx2r7R0YtuxwWWT/xiseaAnOF2VJztrYdcfv+HSAOJpw4h cdHWi00bMmVTc4BE0KHuipqOClM8JWQ3nFKLRdCdUbVj21+/VbtnUbRoPlZyt77RZ7TdqzCK09 FM493vZVeuwy+hmiMJBPZ2p64OUwjTe9EpCG3DxJrOpYlmcyw0GIsZcS+fpUaEre10GUyXYyWk XAyLQMYMSOeUqgCEfX2SWr5oKdB7UlcP5V2iaSTKzcmw5Ojg2hu1ib7CnhkSk4AHFaUU0MT8i6 Gpo= X-IronPort-AV: E=Sophos;i="5.81,164,1610380800"; d="scan'208";a="263648815" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 09 Feb 2021 20:36:27 +0800 IronPort-SDR: PpYAWHR9AFv6AL1MpYSCqGHoAzYrC36PuO4duz+84vXQzHsZzwDOxZM14GpmMhbg2/4jykXVkT Wf/FDQ3xo7mHJJhnzCRgwYddGB1iEj+I0O0CHHcqjuhZaSAjKv4qcDV7KJx8sMy3sx03GYzoTf DPaHs4DrgZGDr1z/k4KCTCNrJ+Bhzb9IGdbjYZxD8Cwb+HFPsjTvXFZGWHxPbBeSUKaINCbTsy 5IlZI+WOKTPZXO01umEWpEh863z7on3bsW4yDJlDUyKrNIF7yaVJqnLAUoR1FG0jRjkvwFAe4H KVstypLrrTTVl97S7lLVAINu Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2021 04:14:03 -0800 IronPort-SDR: 8mMxi9kANhR3uTtiW9GamvtMSCS+ZOaBbXPeo0tF3qNK6I42gVEcpRx/GuG4ugQ53XRLB7Id80 vlofhGiDvM0PEHpLGt3hlp3qgfdtLgrNTGN0t9K9pnePHZAFLDlERKBrSN0Wx8iViVm4ESfBLo Akg7ox6fETMIQQz1ZSmShXU78flCujDbUBUnEQtNZ/h/pr3hhTpeT6ZZQImvLHBfzm4ZFKBAug PXIV7xi2oRGcUl+5CfoYz8JVDDPNMG3yBj3fkP2znIL5HKUTblTad7lhwpnjTcSTx7js1rpeWt FFw= WDCIronportException: Internal Received: from phd004806.ad.shared (HELO twashi.fujisawa.hgst.com) ([10.84.71.69]) by uls-op-cesaip01.wdc.com with ESMTP; 09 Feb 2021 04:30:18 -0800 From: Damien Le Moal To: Palmer Dabbelt , linux-riscv@lists.infradead.org Subject: [PATCH v18 01/16] clk: Add RISC-V Canaan Kendryte K210 clock driver Date: Tue, 9 Feb 2021 21:29:59 +0900 Message-Id: <20210209123014.165928-2-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210209123014.165928-1-damien.lemoal@wdc.com> References: <20210209123014.165928-1-damien.lemoal@wdc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210209_073020_990889_19B77797 X-CRM114-Status: GOOD ( 24.56 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stephen Boyd , Michael Turquette , Anup Patel , Sean Anderson , Atish Patra , linux-clk@vger.kernel.org Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add a clock provider driver for the Canaan Kendryte K210 RISC-V SoC. This new driver with the compatible string "canaan,k210-clk" implements support for the full clock structure of the K210 SoC. Since it is required for the correct operation of the SoC, this driver is selected by default for compilation when the SOC_CANAAN option is selected. With this change, the k210-sysctl driver is turned into a simple platform driver which enables its power bus clock and triggers populating its child nodes. The sysctl driver retains the SOC early initialization code, but the implementation now relies on the new function k210_clk_early_init() provided by the new clk-k210 driver. The clock structure implemented and many of the coding ideas for the driver come from the work by Sean Anderson on the K210 support for the U-Boot project. Cc: Stephen Boyd Cc: Michael Turquette Cc: linux-clk@vger.kernel.org Signed-off-by: Damien Le Moal Reviewed-by: Anup Patel --- MAINTAINERS | 1 + drivers/clk/Kconfig | 8 + drivers/clk/Makefile | 1 + drivers/clk/clk-k210.c | 1012 ++++++++++++++++++++++++++++++ drivers/soc/canaan/Kconfig | 18 +- drivers/soc/canaan/Makefile | 2 +- drivers/soc/canaan/k210-sysctl.c | 205 ++---- include/soc/canaan/k210-sysctl.h | 2 + 8 files changed, 1071 insertions(+), 178 deletions(-) create mode 100644 drivers/clk/clk-k210.c diff --git a/MAINTAINERS b/MAINTAINERS index 3031c2012865..2128630a9dd2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3878,6 +3878,7 @@ CANAAN/KENDRYTE K210 SOC SYSTEM CONTROLLER DRIVER M: Damien Le Moal L: linux-riscv@lists.infradead.org S: Maintained +F: Documentation/devicetree/bindings/mfd/canaan,k210-sysctl.yaml F: drivers/soc/canaan/ F: include/soc/canaan/ diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig index 85856cff506c..cb971f6632e2 100644 --- a/drivers/clk/Kconfig +++ b/drivers/clk/Kconfig @@ -368,6 +368,14 @@ config COMMON_CLK_FIXED_MMIO help Support for Memory Mapped IO Fixed clocks +config COMMON_CLK_K210 + bool "Clock driver for the Canaan Kendryte K210 SoC" + depends on COMMON_CLK && OF + depends on RISCV && SOC_CANAAN + default SOC_CANAAN + help + Support for the Canaan Kendryte K210 RISC-V SoC clocks. + source "drivers/clk/actions/Kconfig" source "drivers/clk/analogbits/Kconfig" source "drivers/clk/baikal-t1/Kconfig" diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile index dbdc590e7de3..5f8f9f135df5 100644 --- a/drivers/clk/Makefile +++ b/drivers/clk/Makefile @@ -37,6 +37,7 @@ obj-$(CONFIG_COMMON_CLK_ASPEED) += clk-aspeed.o obj-$(CONFIG_MACH_ASPEED_G6) += clk-ast2600.o obj-$(CONFIG_ARCH_HIGHBANK) += clk-highbank.o obj-$(CONFIG_CLK_HSDK) += clk-hsdk-pll.o +obj-$(CONFIG_COMMON_CLK_K210) += clk-k210.o obj-$(CONFIG_COMMON_CLK_LOCHNAGAR) += clk-lochnagar.o obj-$(CONFIG_COMMON_CLK_MAX77686) += clk-max77686.o obj-$(CONFIG_COMMON_CLK_MAX9485) += clk-max9485.o diff --git a/drivers/clk/clk-k210.c b/drivers/clk/clk-k210.c new file mode 100644 index 000000000000..429db4904ad6 --- /dev/null +++ b/drivers/clk/clk-k210.c @@ -0,0 +1,1012 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (C) 2019-20 Sean Anderson + * Copyright (c) 2019 Western Digital Corporation or its affiliates. + */ +#define pr_fmt(fmt) "k210-clk: " fmt + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/* + * Clocks parameters. + */ +struct k210_sysclk; + +struct k210_clk { + int id; + struct k210_sysclk *ksc; + struct clk_hw hw; +}; + +struct k210_clk_cfg { + const char *name; + u8 gate_reg; + u8 gate_bit; + u8 div_reg; + u8 div_shift; + u8 div_width; + u8 div_type; + u8 mux_reg; + u8 mux_bit; +}; + +enum k210_clk_div_type { + K210_DIV_NONE, + K210_DIV_ONE_BASED, + K210_DIV_DOUBLE_ONE_BASED, + K210_DIV_POWER_OF_TWO, +}; + +#define K210_GATE(_reg, _bit) \ + .gate_reg = (_reg), \ + .gate_bit = (_bit) +#define K210_DIV(_reg, _shift, _width, _type) \ + .div_reg = (_reg), \ + .div_shift = (_shift), \ + .div_width = (_width), \ + .div_type = (_type) +#define K210_MUX(_reg, _bit) \ + .mux_reg = (_reg), \ + .mux_bit = (_bit) + +static struct k210_clk_cfg k210_clk_cfgs[K210_NUM_CLKS] = { + + /* Gated clocks, no mux, no divider */ + [K210_CLK_CPU] = { + .name = "cpu", + K210_GATE(K210_SYSCTL_EN_CENT, 0) + }, + [K210_CLK_DMA] = { + .name = "dma", + K210_GATE(K210_SYSCTL_EN_PERI, 1) + }, + [K210_CLK_FFT] = { + .name = "fft", + K210_GATE(K210_SYSCTL_EN_PERI, 4) + }, + [K210_CLK_GPIO] = { + .name = "gpio", + K210_GATE(K210_SYSCTL_EN_PERI, 5) + }, + [K210_CLK_UART1] = { + .name = "uart1", + K210_GATE(K210_SYSCTL_EN_PERI, 16) + }, + [K210_CLK_UART2] = { + .name = "uart2", + K210_GATE(K210_SYSCTL_EN_PERI, 17) + }, + [K210_CLK_UART3] = { + .name = "uart3", + K210_GATE(K210_SYSCTL_EN_PERI, 18) + }, + [K210_CLK_FPIOA] = { + .name = "fpioa", + K210_GATE(K210_SYSCTL_EN_PERI, 20) + }, + [K210_CLK_SHA] = { + .name = "sha", + K210_GATE(K210_SYSCTL_EN_PERI, 26) + }, + [K210_CLK_AES] = { + .name = "aes", + K210_GATE(K210_SYSCTL_EN_PERI, 19) + }, + [K210_CLK_OTP] = { + .name = "otp", + K210_GATE(K210_SYSCTL_EN_PERI, 27) + }, + [K210_CLK_RTC] = { + .name = "rtc", + K210_GATE(K210_SYSCTL_EN_PERI, 29) + }, + + /* Gated divider clocks */ + [K210_CLK_SRAM0] = { + .name = "sram0", + K210_GATE(K210_SYSCTL_EN_CENT, 1), + K210_DIV(K210_SYSCTL_THR0, 0, 4, K210_DIV_ONE_BASED) + }, + [K210_CLK_SRAM1] = { + .name = "sram1", + K210_GATE(K210_SYSCTL_EN_CENT, 2), + K210_DIV(K210_SYSCTL_THR0, 4, 4, K210_DIV_ONE_BASED) + }, + [K210_CLK_ROM] = { + .name = "rom", + K210_GATE(K210_SYSCTL_EN_PERI, 0), + K210_DIV(K210_SYSCTL_THR0, 16, 4, K210_DIV_ONE_BASED) + }, + [K210_CLK_DVP] = { + .name = "dvp", + K210_GATE(K210_SYSCTL_EN_PERI, 3), + K210_DIV(K210_SYSCTL_THR0, 12, 4, K210_DIV_ONE_BASED) + }, + [K210_CLK_APB0] = { + .name = "apb0", + K210_GATE(K210_SYSCTL_EN_CENT, 3), + K210_DIV(K210_SYSCTL_SEL0, 3, 3, K210_DIV_ONE_BASED) + }, + [K210_CLK_APB1] = { + .name = "apb1", + K210_GATE(K210_SYSCTL_EN_CENT, 4), + K210_DIV(K210_SYSCTL_SEL0, 6, 3, K210_DIV_ONE_BASED) + }, + [K210_CLK_APB2] = { + .name = "apb2", + K210_GATE(K210_SYSCTL_EN_CENT, 5), + K210_DIV(K210_SYSCTL_SEL0, 9, 3, K210_DIV_ONE_BASED) + }, + [K210_CLK_AI] = { + .name = "ai", + K210_GATE(K210_SYSCTL_EN_PERI, 2), + K210_DIV(K210_SYSCTL_THR0, 8, 4, K210_DIV_ONE_BASED) + }, + [K210_CLK_SPI0] = { + .name = "spi0", + K210_GATE(K210_SYSCTL_EN_PERI, 6), + K210_DIV(K210_SYSCTL_THR1, 0, 8, K210_DIV_DOUBLE_ONE_BASED) + }, + [K210_CLK_SPI1] = { + .name = "spi1", + K210_GATE(K210_SYSCTL_EN_PERI, 7), + K210_DIV(K210_SYSCTL_THR1, 8, 8, K210_DIV_DOUBLE_ONE_BASED) + }, + [K210_CLK_SPI2] = { + .name = "spi2", + K210_GATE(K210_SYSCTL_EN_PERI, 8), + K210_DIV(K210_SYSCTL_THR1, 16, 8, K210_DIV_DOUBLE_ONE_BASED) + }, + [K210_CLK_I2C0] = { + .name = "i2c0", + K210_GATE(K210_SYSCTL_EN_PERI, 13), + K210_DIV(K210_SYSCTL_THR5, 8, 8, K210_DIV_DOUBLE_ONE_BASED) + }, + [K210_CLK_I2C1] = { + .name = "i2c1", + K210_GATE(K210_SYSCTL_EN_PERI, 14), + K210_DIV(K210_SYSCTL_THR5, 16, 8, K210_DIV_DOUBLE_ONE_BASED) + }, + [K210_CLK_I2C2] = { + .name = "i2c2", + K210_GATE(K210_SYSCTL_EN_PERI, 15), + K210_DIV(K210_SYSCTL_THR5, 24, 8, K210_DIV_DOUBLE_ONE_BASED) + }, + [K210_CLK_WDT0] = { + .name = "wdt0", + K210_GATE(K210_SYSCTL_EN_PERI, 24), + K210_DIV(K210_SYSCTL_THR6, 0, 8, K210_DIV_DOUBLE_ONE_BASED) + }, + [K210_CLK_WDT1] = { + .name = "wdt1", + K210_GATE(K210_SYSCTL_EN_PERI, 25), + K210_DIV(K210_SYSCTL_THR6, 8, 8, K210_DIV_DOUBLE_ONE_BASED) + }, + [K210_CLK_I2S0] = { + .name = "i2s0", + K210_GATE(K210_SYSCTL_EN_PERI, 10), + K210_DIV(K210_SYSCTL_THR3, 0, 16, K210_DIV_DOUBLE_ONE_BASED) + }, + [K210_CLK_I2S1] = { + .name = "i2s1", + K210_GATE(K210_SYSCTL_EN_PERI, 11), + K210_DIV(K210_SYSCTL_THR3, 16, 16, K210_DIV_DOUBLE_ONE_BASED) + }, + [K210_CLK_I2S2] = { + .name = "i2s2", + K210_GATE(K210_SYSCTL_EN_PERI, 12), + K210_DIV(K210_SYSCTL_THR4, 0, 16, K210_DIV_DOUBLE_ONE_BASED) + }, + + /* Divider clocks, no gate, no mux */ + [K210_CLK_I2S0_M] = { + .name = "i2s0_m", + K210_DIV(K210_SYSCTL_THR4, 16, 8, K210_DIV_DOUBLE_ONE_BASED) + }, + [K210_CLK_I2S1_M] = { + .name = "i2s1_m", + K210_DIV(K210_SYSCTL_THR4, 24, 8, K210_DIV_DOUBLE_ONE_BASED) + }, + [K210_CLK_I2S2_M] = { + .name = "i2s2_m", + K210_DIV(K210_SYSCTL_THR4, 0, 8, K210_DIV_DOUBLE_ONE_BASED) + }, + + /* Muxed gated divider clocks */ + [K210_CLK_SPI3] = { + .name = "spi3", + K210_GATE(K210_SYSCTL_EN_PERI, 9), + K210_DIV(K210_SYSCTL_THR1, 24, 8, K210_DIV_DOUBLE_ONE_BASED), + K210_MUX(K210_SYSCTL_SEL0, 12) + }, + [K210_CLK_TIMER0] = { + .name = "timer0", + K210_GATE(K210_SYSCTL_EN_PERI, 21), + K210_DIV(K210_SYSCTL_THR2, 0, 8, K210_DIV_DOUBLE_ONE_BASED), + K210_MUX(K210_SYSCTL_SEL0, 13) + }, + [K210_CLK_TIMER1] = { + .name = "timer1", + K210_GATE(K210_SYSCTL_EN_PERI, 22), + K210_DIV(K210_SYSCTL_THR2, 8, 8, K210_DIV_DOUBLE_ONE_BASED), + K210_MUX(K210_SYSCTL_SEL0, 14) + }, + [K210_CLK_TIMER2] = { + .name = "timer2", + K210_GATE(K210_SYSCTL_EN_PERI, 23), + K210_DIV(K210_SYSCTL_THR2, 16, 8, K210_DIV_DOUBLE_ONE_BASED), + K210_MUX(K210_SYSCTL_SEL0, 15) + }, +}; + +/* + * PLL control register bits. + */ +#define K210_PLL_CLKR GENMASK(3, 0) +#define K210_PLL_CLKF GENMASK(9, 4) +#define K210_PLL_CLKOD GENMASK(13, 10) +#define K210_PLL_BWADJ GENMASK(19, 14) +#define K210_PLL_RESET (1 << 20) +#define K210_PLL_PWRD (1 << 21) +#define K210_PLL_INTFB (1 << 22) +#define K210_PLL_BYPASS (1 << 23) +#define K210_PLL_TEST (1 << 24) +#define K210_PLL_EN (1 << 25) +#define K210_PLL_SEL GENMASK(27, 26) /* PLL2 only */ + +/* + * PLL lock register bits. + */ +#define K210_PLL_LOCK 0 +#define K210_PLL_CLEAR_SLIP 2 +#define K210_PLL_TEST_OUT 3 + +/* + * Clock selector register bits. + */ +#define K210_ACLK_SEL BIT(0) +#define K210_ACLK_DIV GENMASK(2, 1) + +/* + * PLLs. + */ +enum k210_pll_id { + K210_PLL0, K210_PLL1, K210_PLL2, K210_PLL_NUM +}; + +struct k210_pll { + enum k210_pll_id id; + struct k210_sysclk *ksc; + void __iomem *base; + void __iomem *reg; + void __iomem *lock; + u8 lock_shift; + u8 lock_width; + struct clk_hw hw; +}; +#define to_k210_pll(_hw) container_of(_hw, struct k210_pll, hw) + +/* + * PLLs configuration: by default PLL0 runs at 780 MHz and PLL1 at 299 MHz. + * The first 2 SRAM banks depend on ACLK/CPU clock which is by default PLL0 + * rate divided by 2. Set PLL1 to 390 MHz so that the third SRAM bank has the + * same clock as the first 2. + */ +struct k210_pll_cfg { + u32 reg; + u8 lock_shift; + u8 lock_width; + u32 r; + u32 f; + u32 od; + u32 bwadj; +}; + +static struct k210_pll_cfg k210_plls_cfg[] = { + { K210_SYSCTL_PLL0, 0, 2, 0, 59, 1, 59 }, /* 780 MHz */ + { K210_SYSCTL_PLL1, 8, 1, 0, 59, 3, 59 }, /* 390 MHz */ + { K210_SYSCTL_PLL2, 16, 1, 0, 22, 1, 22 }, /* 299 MHz */ +}; + +/** + * struct k210_sysclk - sysclk driver data + * @node: device node + * @regs: system controller registers start address + * @clk_lock: clock setting spinlock + * @plls: SoC PLLs descriptors + * @aclk: ACLK clock + * @clks: All other clocks + */ +struct k210_sysclk { + struct device_node *node; + void __iomem *regs; + spinlock_t clk_lock; + struct k210_pll plls[K210_PLL_NUM]; + struct clk_hw aclk; + struct k210_clk clks[K210_NUM_CLKS]; +}; + +#define to_k210_sysclk(_hw) container_of(_hw, struct k210_sysclk, aclk) + +/* + * Set ACLK parent selector: 0 for IN0, 1 for PLL0. + */ +static void k210_aclk_set_selector(void __iomem *regs, u8 sel) +{ + u32 reg = readl(regs + K210_SYSCTL_SEL0); + + if (sel) + reg |= K210_ACLK_SEL; + else + reg &= K210_ACLK_SEL; + writel(reg, regs + K210_SYSCTL_SEL0); +} + +static void k210_init_pll(void __iomem *regs, enum k210_pll_id pllid, + struct k210_pll *pll) +{ + pll->id = pllid; + pll->reg = regs + k210_plls_cfg[pllid].reg; + pll->lock = regs + K210_SYSCTL_PLL_LOCK; + pll->lock_shift = k210_plls_cfg[pllid].lock_shift; + pll->lock_width = k210_plls_cfg[pllid].lock_width; +} + +static void k210_pll_wait_for_lock(struct k210_pll *pll) +{ + u32 reg, mask = GENMASK(pll->lock_shift + pll->lock_width - 1, + pll->lock_shift); + + while (true) { + reg = readl(pll->lock); + if ((reg & mask) == mask) + break; + + reg |= BIT(pll->lock_shift + K210_PLL_CLEAR_SLIP); + writel(reg, pll->lock); + } +} + +static bool k210_pll_hw_is_enabled(struct k210_pll *pll) +{ + u32 reg = readl(pll->reg); + u32 mask = K210_PLL_PWRD | K210_PLL_EN; + + if (reg & K210_PLL_RESET) + return false; + + return (reg & mask) == mask; +} + +static void k210_pll_enable_hw(void __iomem *regs, struct k210_pll *pll) +{ + struct k210_pll_cfg *pll_cfg = &k210_plls_cfg[pll->id]; + u32 reg; + + if (k210_pll_hw_is_enabled(pll)) + return; + + /* + * For PLL0, we need to re-parent ACLK to IN0 to keep the CPU cores and + * SRAM running. + */ + if (pll->id == K210_PLL0) + k210_aclk_set_selector(regs, 0); + + /* Set PLL factors */ + reg = readl(pll->reg); + reg &= ~GENMASK(19, 0); + reg |= FIELD_PREP(K210_PLL_CLKR, pll_cfg->r); + reg |= FIELD_PREP(K210_PLL_CLKF, pll_cfg->f); + reg |= FIELD_PREP(K210_PLL_CLKOD, pll_cfg->od); + reg |= FIELD_PREP(K210_PLL_BWADJ, pll_cfg->bwadj); + reg |= K210_PLL_PWRD; + writel(reg, pll->reg); + + /* + * Reset the PLL: ensure reset is low before asserting it. + * The magic NOPs come from the Kendryte reference SDK. + */ + reg &= ~K210_PLL_RESET; + writel(reg, pll->reg); + reg |= K210_PLL_RESET; + writel(reg, pll->reg); + nop(); + nop(); + reg &= ~K210_PLL_RESET; + writel(reg, pll->reg); + + k210_pll_wait_for_lock(pll); + + reg &= ~K210_PLL_BYPASS; + reg |= K210_PLL_EN; + writel(reg, pll->reg); + + if (pll->id == K210_PLL0) + k210_aclk_set_selector(regs, 1); +} + +static int k210_pll_enable(struct clk_hw *hw) +{ + struct k210_pll *pll = to_k210_pll(hw); + struct k210_sysclk *ksc = pll->ksc; + unsigned long flags; + + spin_lock_irqsave(&ksc->clk_lock, flags); + + k210_pll_enable_hw(ksc->regs, pll); + + spin_unlock_irqrestore(&ksc->clk_lock, flags); + + return 0; +} + +static void k210_pll_disable(struct clk_hw *hw) +{ + struct k210_pll *pll = to_k210_pll(hw); + struct k210_sysclk *ksc = pll->ksc; + unsigned long flags; + u32 reg; + + /* + * Bypassing before powering off is important so child clocks do not + * stop working. This is especially important for pll0, the indirect + * parent of the cpu clock. + */ + spin_lock_irqsave(&ksc->clk_lock, flags); + reg = readl(pll->reg); + reg |= K210_PLL_BYPASS; + writel(reg, pll->reg); + + reg &= ~K210_PLL_PWRD; + reg &= ~K210_PLL_EN; + writel(reg, pll->reg); + spin_unlock_irqrestore(&ksc->clk_lock, flags); +} + +static int k210_pll_is_enabled(struct clk_hw *hw) +{ + return k210_pll_hw_is_enabled(to_k210_pll(hw)); +} + +static unsigned long k210_pll_get_rate(struct clk_hw *hw, + unsigned long parent_rate) +{ + struct k210_pll *pll = to_k210_pll(hw); + u32 reg = readl(pll->reg); + u32 r, f, od; + + if (reg & K210_PLL_BYPASS) + return parent_rate; + + if (!(reg & K210_PLL_PWRD)) + return 0; + + r = FIELD_GET(K210_PLL_CLKR, reg) + 1; + f = FIELD_GET(K210_PLL_CLKF, reg) + 1; + od = FIELD_GET(K210_PLL_CLKOD, reg) + 1; + + return (u64)parent_rate * f / (r * od); +} + +static const struct clk_ops k210_pll_ops = { + .enable = k210_pll_enable, + .disable = k210_pll_disable, + .is_enabled = k210_pll_is_enabled, + .recalc_rate = k210_pll_get_rate, +}; + +static int k210_pll2_set_parent(struct clk_hw *hw, u8 index) +{ + struct k210_pll *pll = to_k210_pll(hw); + struct k210_sysclk *ksc = pll->ksc; + unsigned long flags; + u32 reg; + + spin_lock_irqsave(&ksc->clk_lock, flags); + + reg = readl(pll->reg); + reg &= ~K210_PLL_SEL; + reg |= FIELD_PREP(K210_PLL_SEL, index); + writel(reg, pll->reg); + + spin_unlock_irqrestore(&ksc->clk_lock, flags); + + return 0; +} + +static u8 k210_pll2_get_parent(struct clk_hw *hw) +{ + struct k210_pll *pll = to_k210_pll(hw); + u32 reg = readl(pll->reg); + + return FIELD_GET(K210_PLL_SEL, reg); +} + +static const struct clk_ops k210_pll2_ops = { + .enable = k210_pll_enable, + .disable = k210_pll_disable, + .is_enabled = k210_pll_is_enabled, + .recalc_rate = k210_pll_get_rate, + .set_parent = k210_pll2_set_parent, + .get_parent = k210_pll2_get_parent, +}; + +static int k210_register_pll(struct k210_sysclk *ksc, const char *in0, + enum k210_pll_id pllid, const char *name, + int num_parents, const struct clk_ops *ops) +{ + struct k210_pll *pll = &ksc->plls[pllid]; + struct clk_init_data init = {}; + const struct clk_parent_data parent_data[] = { + { .name = in0 }, + { .hw = &ksc->plls[K210_PLL0].hw }, + { .hw = &ksc->plls[K210_PLL1].hw }, + }; + + init.name = name; + init.parent_data = parent_data; + init.num_parents = num_parents; + init.ops = ops; + + pll->hw.init = &init; + pll->ksc = ksc; + + return clk_hw_register(NULL, &pll->hw); +} + +static int k210_register_plls(struct k210_sysclk *ksc, const char *in0) +{ + int i, ret; + + for (i = 0; i < K210_PLL_NUM; i++) + k210_init_pll(ksc->regs, i, &ksc->plls[i]); + + /* PLL0 and PLL1 only have IN0 as parent */ + ret = k210_register_pll(ksc, in0, K210_PLL0, "pll0", 1, &k210_pll_ops); + if (ret) { + pr_err("%pOFP: register PLL0 failed\n", ksc->node); + return ret; + } + ret = k210_register_pll(ksc, in0, K210_PLL1, "pll1", 1, &k210_pll_ops); + if (ret) { + pr_err("%pOFP: register PLL1 failed\n", ksc->node); + return ret; + } + + /* PLL2 has IN0, PLL0 and PLL1 as parents */ + ret = k210_register_pll(ksc, in0, K210_PLL2, "pll2", 3, &k210_pll2_ops); + if (ret) { + pr_err("%pOFP: register PLL2 failed\n", ksc->node); + return ret; + } + + return 0; +} + +static int k210_aclk_set_parent(struct clk_hw *hw, u8 index) +{ + struct k210_sysclk *ksc = to_k210_sysclk(hw); + unsigned long flags; + + spin_lock_irqsave(&ksc->clk_lock, flags); + + k210_aclk_set_selector(ksc->regs, index); + + spin_unlock_irqrestore(&ksc->clk_lock, flags); + + return 0; +} + +static u8 k210_aclk_get_parent(struct clk_hw *hw) +{ + struct k210_sysclk *ksc = to_k210_sysclk(hw); + u32 sel; + + sel = readl(ksc->regs + K210_SYSCTL_SEL0) & K210_ACLK_SEL; + + return sel ? 1 : 0; +} + +static unsigned long k210_aclk_get_rate(struct clk_hw *hw, + unsigned long parent_rate) +{ + struct k210_sysclk *ksc = to_k210_sysclk(hw); + u32 reg = readl(ksc->regs + K210_SYSCTL_SEL0); + unsigned int shift; + + if (!(reg & 0x1)) + return parent_rate; + + shift = FIELD_GET(K210_ACLK_DIV, reg); + + return parent_rate / (2UL << shift); +} + +static const struct clk_ops k210_aclk_ops = { + .set_parent = k210_aclk_set_parent, + .get_parent = k210_aclk_get_parent, + .recalc_rate = k210_aclk_get_rate, +}; + +/* + * ACLK has IN0 and PLL0 as parents. + */ +static int k210_register_aclk(struct k210_sysclk *ksc, const char *in0) +{ + struct clk_init_data init = {}; + const struct clk_parent_data parent_data[] = { + { .name = in0 }, + { .hw = &ksc->plls[K210_PLL0].hw }, + }; + int ret; + + init.name = "aclk"; + init.parent_data = parent_data; + init.num_parents = 2; + init.ops = &k210_aclk_ops; + ksc->aclk.init = &init; + + ret = clk_hw_register(NULL, &ksc->aclk); + if (ret) { + pr_err("%pOFP: register aclk failed\n", ksc->node); + return ret; + } + + return 0; +} + +#define to_k210_clk(_hw) container_of(_hw, struct k210_clk, hw) + +static int k210_clk_enable(struct clk_hw *hw) +{ + struct k210_clk *kclk = to_k210_clk(hw); + struct k210_sysclk *ksc = kclk->ksc; + struct k210_clk_cfg *cfg = &k210_clk_cfgs[kclk->id]; + unsigned long flags; + u32 reg; + + if (!cfg->gate_reg) + return 0; + + spin_lock_irqsave(&ksc->clk_lock, flags); + reg = readl(ksc->regs + cfg->gate_reg); + reg |= BIT(cfg->gate_bit); + writel(reg, ksc->regs + cfg->gate_reg); + spin_unlock_irqrestore(&ksc->clk_lock, flags); + + return 0; +} + +static void k210_clk_disable(struct clk_hw *hw) +{ + struct k210_clk *kclk = to_k210_clk(hw); + struct k210_sysclk *ksc = kclk->ksc; + struct k210_clk_cfg *cfg = &k210_clk_cfgs[kclk->id]; + unsigned long flags; + u32 reg; + + if (!cfg->gate_reg) + return; + + spin_lock_irqsave(&ksc->clk_lock, flags); + reg = readl(ksc->regs + cfg->gate_reg); + reg &= ~BIT(cfg->gate_bit); + writel(reg, ksc->regs + cfg->gate_reg); + spin_unlock_irqrestore(&ksc->clk_lock, flags); +} + +static int k210_clk_set_parent(struct clk_hw *hw, u8 index) +{ + struct k210_clk *kclk = to_k210_clk(hw); + struct k210_sysclk *ksc = kclk->ksc; + struct k210_clk_cfg *cfg = &k210_clk_cfgs[kclk->id]; + unsigned long flags; + u32 reg; + + spin_lock_irqsave(&ksc->clk_lock, flags); + reg = readl(ksc->regs + cfg->mux_reg); + if (index) + reg |= BIT(cfg->mux_bit); + else + reg &= ~BIT(cfg->mux_bit); + spin_unlock_irqrestore(&ksc->clk_lock, flags); + + return 0; +} + +static u8 k210_clk_get_parent(struct clk_hw *hw) +{ + struct k210_clk *kclk = to_k210_clk(hw); + struct k210_sysclk *ksc = kclk->ksc; + struct k210_clk_cfg *cfg = &k210_clk_cfgs[kclk->id]; + unsigned long flags; + u32 reg, idx; + + spin_lock_irqsave(&ksc->clk_lock, flags); + reg = readl(ksc->regs + cfg->mux_reg); + idx = (reg & BIT(cfg->mux_bit)) ? 1 : 0; + spin_unlock_irqrestore(&ksc->clk_lock, flags); + + return idx; +} + +static unsigned long k210_clk_get_rate(struct clk_hw *hw, + unsigned long parent_rate) +{ + struct k210_clk *kclk = to_k210_clk(hw); + struct k210_sysclk *ksc = kclk->ksc; + struct k210_clk_cfg *cfg = &k210_clk_cfgs[kclk->id]; + u32 reg, div_val; + + if (!cfg->div_reg) + return parent_rate; + + reg = readl(ksc->regs + cfg->div_reg); + div_val = (reg >> cfg->div_shift) & GENMASK(cfg->div_width - 1, 0); + + switch (cfg->div_type) { + case K210_DIV_ONE_BASED: + return parent_rate / (div_val + 1); + case K210_DIV_DOUBLE_ONE_BASED: + return parent_rate / ((div_val + 1) * 2); + case K210_DIV_POWER_OF_TWO: + return parent_rate / (2UL << div_val); + case K210_DIV_NONE: + default: + return 0; + } +} + +static const struct clk_ops k210_clk_mux_ops = { + .enable = k210_clk_enable, + .disable = k210_clk_disable, + .set_parent = k210_clk_set_parent, + .get_parent = k210_clk_get_parent, + .recalc_rate = k210_clk_get_rate, +}; + +static const struct clk_ops k210_clk_ops = { + .enable = k210_clk_enable, + .disable = k210_clk_disable, + .recalc_rate = k210_clk_get_rate, +}; + +static void k210_register_clk(struct k210_sysclk *ksc, int id, + const struct clk_parent_data *parent_data, + int num_parents, unsigned long flags) +{ + struct k210_clk *kclk = &ksc->clks[id]; + struct clk_init_data init = {}; + int ret; + + init.name = k210_clk_cfgs[id].name; + init.flags = flags; + init.parent_data = parent_data; + init.num_parents = num_parents; + if (num_parents > 1) + init.ops = &k210_clk_mux_ops; + else + init.ops = &k210_clk_ops; + + kclk->id = id; + kclk->ksc = ksc; + kclk->hw.init = &init; + + ret = clk_hw_register(NULL, &kclk->hw); + if (ret) { + pr_err("%pOFP: register clock %s failed\n", + ksc->node, k210_clk_cfgs[id].name); + kclk->id = -1; + } +} + +/* + * All muxed clocks have IN0 and PLL0 as parents. + */ +static inline void k210_register_mux_clk(struct k210_sysclk *ksc, + const char *in0, int id) +{ + const struct clk_parent_data parent_data[2] = { + { .name = in0 }, + { .hw = &ksc->plls[K210_PLL0].hw }, + }; + + k210_register_clk(ksc, id, parent_data, 2, 0); +} + +static inline void k210_register_in0_child(struct k210_sysclk *ksc, + const char *in0, int id) +{ + const struct clk_parent_data parent_data = { + .name = in0, + }; + + k210_register_clk(ksc, id, &parent_data, 1, 0); +} + +static inline void k210_register_pll_child(struct k210_sysclk *ksc, int id, + enum k210_pll_id pllid, + unsigned long flags) +{ + const struct clk_parent_data parent_data = { + .hw = &ksc->plls[pllid].hw, + }; + + k210_register_clk(ksc, id, &parent_data, 1, flags); +} + +static inline void k210_register_aclk_child(struct k210_sysclk *ksc, int id, + unsigned long flags) +{ + const struct clk_parent_data parent_data = { + .hw = &ksc->aclk, + }; + + k210_register_clk(ksc, id, &parent_data, 1, flags); +} + +static inline void k210_register_clk_child(struct k210_sysclk *ksc, int id, + int parent_id) +{ + const struct clk_parent_data parent_data = { + .hw = &ksc->clks[parent_id].hw, + }; + + k210_register_clk(ksc, id, &parent_data, 1, 0); +} + +static struct clk_hw *k210_clk_hw_onecell_get(struct of_phandle_args *clkspec, + void *data) +{ + struct k210_sysclk *ksc = data; + unsigned int idx = clkspec->args[0]; + + if (idx >= K210_NUM_CLKS) + return ERR_PTR(-EINVAL); + + return &ksc->clks[idx].hw; +} + +static void __init k210_clk_init(struct device_node *np) +{ + struct device_node *sysctl_np; + struct k210_sysclk *ksc; + const char *in0; + int i, ret; + + ksc = kzalloc(sizeof(*ksc), GFP_KERNEL); + if (!ksc) + return; + + ksc->node = np; + spin_lock_init(&ksc->clk_lock); + sysctl_np = of_get_parent(np); + ksc->regs = of_iomap(sysctl_np, 0); + of_node_put(sysctl_np); + if (!ksc->regs) { + pr_err("%pOFP: failed to map registers\n", np); + return; + } + + in0 = of_clk_get_parent_name(np, 0); + if (!in0) { + pr_err("%pOFP: undefined fixed-rate oscillator clock\n", np); + return; + } + + ret = k210_register_plls(ksc, in0); + if (ret) + return; + + ret = k210_register_aclk(ksc, in0); + if (ret) + return; + + /* + * Critical clocks: there are no consumers of the SRAM clocks, + * including the AI clock for the third SRAM bank. The CPU clock + * is only referenced by the uarths serial device and so would be + * disabled if the serial console is disabled to switch to another + * console. Mark all these clocks as critical so that they are never + * disabled by the core clock management. + */ + k210_register_aclk_child(ksc, K210_CLK_CPU, CLK_IS_CRITICAL); + k210_register_aclk_child(ksc, K210_CLK_SRAM0, CLK_IS_CRITICAL); + k210_register_aclk_child(ksc, K210_CLK_SRAM1, CLK_IS_CRITICAL); + k210_register_pll_child(ksc, K210_CLK_AI, K210_PLL1, CLK_IS_CRITICAL); + + /* Clocks with aclk as source */ + k210_register_aclk_child(ksc, K210_CLK_DMA, 0); + k210_register_aclk_child(ksc, K210_CLK_FFT, 0); + k210_register_aclk_child(ksc, K210_CLK_ROM, 0); + k210_register_aclk_child(ksc, K210_CLK_DVP, 0); + k210_register_aclk_child(ksc, K210_CLK_APB0, 0); + k210_register_aclk_child(ksc, K210_CLK_APB1, 0); + k210_register_aclk_child(ksc, K210_CLK_APB2, 0); + + /* Clocks with PLL0 as source */ + k210_register_pll_child(ksc, K210_CLK_SPI0, K210_PLL0, 0); + k210_register_pll_child(ksc, K210_CLK_SPI1, K210_PLL0, 0); + k210_register_pll_child(ksc, K210_CLK_SPI2, K210_PLL0, 0); + k210_register_pll_child(ksc, K210_CLK_I2C0, K210_PLL0, 0); + k210_register_pll_child(ksc, K210_CLK_I2C1, K210_PLL0, 0); + k210_register_pll_child(ksc, K210_CLK_I2C2, K210_PLL0, 0); + + /* Clocks with PLL2 as source */ + k210_register_pll_child(ksc, K210_CLK_I2S0, K210_PLL2, 0); + k210_register_pll_child(ksc, K210_CLK_I2S1, K210_PLL2, 0); + k210_register_pll_child(ksc, K210_CLK_I2S2, K210_PLL2, 0); + k210_register_pll_child(ksc, K210_CLK_I2S0_M, K210_PLL2, 0); + k210_register_pll_child(ksc, K210_CLK_I2S1_M, K210_PLL2, 0); + k210_register_pll_child(ksc, K210_CLK_I2S2_M, K210_PLL2, 0); + + /* Clocks with IN0 as source */ + k210_register_in0_child(ksc, in0, K210_CLK_WDT0); + k210_register_in0_child(ksc, in0, K210_CLK_WDT1); + k210_register_in0_child(ksc, in0, K210_CLK_RTC); + + /* Clocks with APB0 as source */ + k210_register_clk_child(ksc, K210_CLK_GPIO, K210_CLK_APB0); + k210_register_clk_child(ksc, K210_CLK_UART1, K210_CLK_APB0); + k210_register_clk_child(ksc, K210_CLK_UART2, K210_CLK_APB0); + k210_register_clk_child(ksc, K210_CLK_UART3, K210_CLK_APB0); + k210_register_clk_child(ksc, K210_CLK_FPIOA, K210_CLK_APB0); + k210_register_clk_child(ksc, K210_CLK_SHA, K210_CLK_APB0); + + /* Clocks with APB1 as source */ + k210_register_clk_child(ksc, K210_CLK_AES, K210_CLK_APB1); + k210_register_clk_child(ksc, K210_CLK_OTP, K210_CLK_APB1); + + /* Mux clocks with in0 or pll0 as source */ + k210_register_mux_clk(ksc, in0, K210_CLK_SPI3); + k210_register_mux_clk(ksc, in0, K210_CLK_TIMER0); + k210_register_mux_clk(ksc, in0, K210_CLK_TIMER1); + k210_register_mux_clk(ksc, in0, K210_CLK_TIMER2); + + /* Check for registration errors */ + for (i = 0; i < K210_NUM_CLKS; i++) { + if (ksc->clks[i].id != i) + return; + } + + ret = of_clk_add_hw_provider(np, k210_clk_hw_onecell_get, ksc); + if (ret) { + pr_err("%pOFP: add clock provider failed %d\n", np, ret); + return; + } + + pr_info("%pOFP: CPU running at %lu MHz\n", + np, clk_hw_get_rate(&ksc->clks[K210_CLK_CPU].hw) / 1000000); +} + +CLK_OF_DECLARE(k210_clk, "canaan,k210-clk", k210_clk_init); + +/* + * Enable PLL1 to be able to use the AI SRAM. + */ +void __init k210_clk_early_init(void __iomem *regs) +{ + struct k210_pll pll1; + + /* Make sure ACLK selector is set to PLL0 */ + k210_aclk_set_selector(regs, 1); + + /* Startup PLL1 to enable the aisram bank for general memory use */ + k210_init_pll(regs, K210_PLL1, &pll1); + k210_pll_enable_hw(regs, &pll1); +} diff --git a/drivers/soc/canaan/Kconfig b/drivers/soc/canaan/Kconfig index 5232d13f07e5..8179b69518b4 100644 --- a/drivers/soc/canaan/Kconfig +++ b/drivers/soc/canaan/Kconfig @@ -1,14 +1,12 @@ # SPDX-License-Identifier: GPL-2.0 -if SOC_CANAAN - -config K210_SYSCTL +config SOC_K210_SYSCTL bool "Canaan Kendryte K210 SoC system controller" - default y - depends on RISCV + depends on RISCV && SOC_CANAAN && OF + default SOC_CANAAN + select PM + select SIMPLE_PM_BUS + select SYSCON + select MFD_SYSCON help - Enables controlling the K210 various clocks and to enable - general purpose use of the extra 2MB of SRAM normally - reserved for the AI engine. - -endif + Canaan Kendryte K210 SoC system controller driver. diff --git a/drivers/soc/canaan/Makefile b/drivers/soc/canaan/Makefile index 002d9ce95c0d..570280ad7967 100644 --- a/drivers/soc/canaan/Makefile +++ b/drivers/soc/canaan/Makefile @@ -1,3 +1,3 @@ # SPDX-License-Identifier: GPL-2.0 -obj-$(CONFIG_K210_SYSCTL) += k210-sysctl.o +obj-$(CONFIG_SOC_K210_SYSCTL) += k210-sysctl.o diff --git a/drivers/soc/canaan/k210-sysctl.c b/drivers/soc/canaan/k210-sysctl.c index 60b474c33d45..27a346c406bc 100644 --- a/drivers/soc/canaan/k210-sysctl.c +++ b/drivers/soc/canaan/k210-sysctl.c @@ -3,165 +3,45 @@ * Copyright (c) 2019 Christoph Hellwig. * Copyright (c) 2019 Western Digital Corporation or its affiliates. */ -#include #include -#include #include -#include -#include -#include +#include +#include #include #include -#define K210_SYSCTL_CLK0_FREQ 26000000UL - -/* Registers base address */ -#define K210_SYSCTL_SYSCTL_BASE_ADDR 0x50440000ULL - -/* Register bits */ -/* K210_SYSCTL_PLL1: clkr: 4bits, clkf1: 6bits, clkod: 4bits, bwadj: 4bits */ -#define PLL_RESET (1 << 20) -#define PLL_PWR (1 << 21) -#define PLL_BYPASS (1 << 23) -#define PLL_OUT_EN (1 << 25) -/* K210_SYSCTL_PLL_LOCK */ -#define PLL1_LOCK1 (1 << 8) -#define PLL1_LOCK2 (1 << 9) -#define PLL1_SLIP_CLEAR (1 << 10) -/* K210_SYSCTL_SEL0 */ -#define CLKSEL_ACLK (1 << 0) -/* K210_SYSCTL_CLKEN_CENT */ -#define CLKEN_CPU (1 << 0) -#define CLKEN_SRAM0 (1 << 1) -#define CLKEN_SRAM1 (1 << 2) -/* K210_SYSCTL_EN_PERI */ -#define CLKEN_ROM (1 << 0) -#define CLKEN_TIMER0 (1 << 21) -#define CLKEN_RTC (1 << 29) - -struct k210_sysctl { - void __iomem *regs; - struct clk_hw hw; -}; - -static void k210_set_bits(u32 val, void __iomem *reg) -{ - writel(readl(reg) | val, reg); -} - -static void k210_clear_bits(u32 val, void __iomem *reg) -{ - writel(readl(reg) & ~val, reg); -} - -static void k210_pll1_enable(void __iomem *regs) -{ - u32 val; - - val = readl(regs + K210_SYSCTL_PLL1); - val &= ~GENMASK(19, 0); /* clkr1 = 0 */ - val |= FIELD_PREP(GENMASK(9, 4), 0x3B); /* clkf1 = 59 */ - val |= FIELD_PREP(GENMASK(13, 10), 0x3); /* clkod1 = 3 */ - val |= FIELD_PREP(GENMASK(19, 14), 0x3B); /* bwadj1 = 59 */ - writel(val, regs + K210_SYSCTL_PLL1); - - k210_clear_bits(PLL_BYPASS, regs + K210_SYSCTL_PLL1); - k210_set_bits(PLL_PWR, regs + K210_SYSCTL_PLL1); - - /* - * Reset the pll. The magic NOPs come from the Kendryte reference SDK. - */ - k210_clear_bits(PLL_RESET, regs + K210_SYSCTL_PLL1); - k210_set_bits(PLL_RESET, regs + K210_SYSCTL_PLL1); - nop(); - nop(); - k210_clear_bits(PLL_RESET, regs + K210_SYSCTL_PLL1); - - for (;;) { - val = readl(regs + K210_SYSCTL_PLL_LOCK); - if (val & PLL1_LOCK2) - break; - writel(val | PLL1_SLIP_CLEAR, regs + K210_SYSCTL_PLL_LOCK); - } - - k210_set_bits(PLL_OUT_EN, regs + K210_SYSCTL_PLL1); -} - -static unsigned long k210_sysctl_clk_recalc_rate(struct clk_hw *hw, - unsigned long parent_rate) -{ - struct k210_sysctl *s = container_of(hw, struct k210_sysctl, hw); - u32 clksel0, pll0; - u64 pll0_freq, clkr0, clkf0, clkod0; - - /* - * If the clock selector is not set, use the base frequency. - * Otherwise, use PLL0 frequency with a frequency divisor. - */ - clksel0 = readl(s->regs + K210_SYSCTL_SEL0); - if (!(clksel0 & CLKSEL_ACLK)) - return K210_SYSCTL_CLK0_FREQ; - - /* - * Get PLL0 frequency: - * freq = base frequency * clkf0 / (clkr0 * clkod0) - */ - pll0 = readl(s->regs + K210_SYSCTL_PLL0); - clkr0 = 1 + FIELD_GET(GENMASK(3, 0), pll0); - clkf0 = 1 + FIELD_GET(GENMASK(9, 4), pll0); - clkod0 = 1 + FIELD_GET(GENMASK(13, 10), pll0); - pll0_freq = clkf0 * K210_SYSCTL_CLK0_FREQ / (clkr0 * clkod0); - - /* Get the frequency divisor from the clock selector */ - return pll0_freq / (2ULL << FIELD_GET(0x00000006, clksel0)); -} - -static const struct clk_ops k210_sysctl_clk_ops = { - .recalc_rate = k210_sysctl_clk_recalc_rate, -}; - -static const struct clk_init_data k210_clk_init_data = { - .name = "k210-sysctl-pll1", - .ops = &k210_sysctl_clk_ops, -}; - static int k210_sysctl_probe(struct platform_device *pdev) { - struct k210_sysctl *s; - int error; - - pr_info("Kendryte K210 SoC sysctl\n"); - - s = devm_kzalloc(&pdev->dev, sizeof(*s), GFP_KERNEL); - if (!s) - return -ENOMEM; - - s->regs = devm_ioremap_resource(&pdev->dev, - platform_get_resource(pdev, IORESOURCE_MEM, 0)); - if (IS_ERR(s->regs)) - return PTR_ERR(s->regs); - - s->hw.init = &k210_clk_init_data; - error = devm_clk_hw_register(&pdev->dev, &s->hw); - if (error) { - dev_err(&pdev->dev, "failed to register clk"); - return error; + struct device *dev = &pdev->dev; + struct clk *pclk; + int ret; + + dev_info(dev, "K210 system controller\n"); + + /* Get power bus clock */ + pclk = devm_clk_get(dev, NULL); + if (IS_ERR(pclk)) + return dev_err_probe(dev, PTR_ERR(pclk), + "Get bus clock failed\n"); + + ret = clk_prepare_enable(pclk); + if (ret) { + dev_err(dev, "Enable bus clock failed\n"); + return ret; } - error = devm_of_clk_add_hw_provider(&pdev->dev, of_clk_hw_simple_get, - &s->hw); - if (error) { - dev_err(&pdev->dev, "adding clk provider failed\n"); - return error; - } + /* Populate children */ + ret = devm_of_platform_populate(dev); + if (ret) + dev_err(dev, "Populate platform failed %d\n", ret); - return 0; + return ret; } static const struct of_device_id k210_sysctl_of_match[] = { - { .compatible = "kendryte,k210-sysctl", }, - {} + { .compatible = "canaan,k210-sysctl", }, + { /* sentinel */ }, }; static struct platform_driver k210_sysctl_driver = { @@ -171,12 +51,13 @@ static struct platform_driver k210_sysctl_driver = { }, .probe = k210_sysctl_probe, }; +builtin_platform_driver(k210_sysctl_driver); -static int __init k210_sysctl_init(void) -{ - return platform_driver_register(&k210_sysctl_driver); -} -core_initcall(k210_sysctl_init); +/* + * System controller registers base address and size. + */ +#define K210_SYSCTL_BASE_ADDR 0x50440000ULL +#define K210_SYSCTL_BASE_SIZE 0x1000 /* * This needs to be called very early during initialization, given that @@ -184,24 +65,14 @@ core_initcall(k210_sysctl_init); */ static void __init k210_soc_early_init(const void *fdt) { - void __iomem *regs; - - regs = ioremap(K210_SYSCTL_SYSCTL_BASE_ADDR, 0x1000); - if (!regs) - panic("K210 sysctl ioremap"); - - /* Enable PLL1 to make the KPU SRAM useable */ - k210_pll1_enable(regs); - - k210_set_bits(PLL_OUT_EN, regs + K210_SYSCTL_PLL0); + void __iomem *sysctl_base; - k210_set_bits(CLKEN_CPU | CLKEN_SRAM0 | CLKEN_SRAM1, - regs + K210_SYSCTL_EN_CENT); - k210_set_bits(CLKEN_ROM | CLKEN_TIMER0 | CLKEN_RTC, - regs + K210_SYSCTL_EN_PERI); + sysctl_base = ioremap(K210_SYSCTL_BASE_ADDR, K210_SYSCTL_BASE_SIZE); + if (!sysctl_base) + panic("k210-sysctl: ioremap failed"); - k210_set_bits(CLKSEL_ACLK, regs + K210_SYSCTL_SEL0); + k210_clk_early_init(sysctl_base); - iounmap(regs); + iounmap(sysctl_base); } -SOC_EARLY_INIT_DECLARE(generic_k210, "kendryte,k210", k210_soc_early_init); +SOC_EARLY_INIT_DECLARE(k210_soc, "canaan,kendryte-k210", k210_soc_early_init); diff --git a/include/soc/canaan/k210-sysctl.h b/include/soc/canaan/k210-sysctl.h index 2e037db68f35..0c2b2c2dabca 100644 --- a/include/soc/canaan/k210-sysctl.h +++ b/include/soc/canaan/k210-sysctl.h @@ -38,4 +38,6 @@ #define K210_SYSCTL_DMA_SEL1 0x68 /* DMA handshake selector 1 */ #define K210_SYSCTL_POWER_SEL 0x6C /* IO Power Mode Select controller */ +void k210_clk_early_init(void __iomem *regs); + #endif From patchwork Tue Feb 9 12:30:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 12077897 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D28F6C433E6 for ; Tue, 9 Feb 2021 12:30:38 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5374B64E88 for ; Tue, 9 Feb 2021 12:30:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5374B64E88 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=TAiGY+Yusu2VXndGzKJnwPBCwOLROgrrXSF/XF0sykQ=; b=GVbceh1f4ofX61eZMPC1Ev9Ia 3SIACV+qLt9N+svYen3XeO2VpL8QizZsmgjnvm04jzplbd0UbUMgdX11gSvMp6OJuzaDqhlJmQpg1 GYRLr6OdnUBFiPq/NU1LuH2xZkZPJ6RAYq8UKJ8+daxei3mWWccvqAIYKi0gpDU0/L/f6L/T3s04Y F5MpGHehLUFKI0gPoMHpKCcfZYXTqwO+W7Sk5kmLwYjAwUQmglyjVbTI0gjshsKsRCiK4L0DY8oJa +dhAxsWVItawYXvSrrqXxfB0zP2GXGqtL4/7M7CIZYm3gjrmysIVsISIoToRglzvy8FnGP4VO/jlt ecClaVKAg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9SA1-00087l-SW; Tue, 09 Feb 2021 12:30:29 +0000 Received: from esa2.hgst.iphmx.com ([68.232.143.124]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9S9v-00083p-4v for linux-riscv@lists.infradead.org; Tue, 09 Feb 2021 12:30:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612874192; x=1644410192; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=U5RPnx9naL44L8pODbHMwPFT+udQFeaq9RcnNssxEXo=; b=OeVarnLaxC4rDO7F2tVZV55rVrs7ITzZReWmV6khcMgbQOsHOHsGERHG 1XV4v7yVeYRitCg6WZESaiZsuP0P2RluuDJuuDGB9fL2H3rOWOQkPnt29 x4prk7E28wBRI44XXAAwZe4c2skK9ou1wgiU9RSnmnJrwaSfX9bR/q8cl XXi1Ejt9BasuhvzN/8SGJ+LMfT1gjcFDdKwwuTlM7D4cg3FV+ZW1UANuS PnJBpWLyZboERcL9aFmYIYD6xI6QE7/9qhiPx1CFtsbCIFpZSUpfvlzlG QZvIOS/BNFHlSS2meN8vd0sLCM4DcvDE4ohT8hQcABVwAdl2uvAp4dTWm g==; IronPort-SDR: I5V0fpLLcOVr54OqIJQQNgWKYK9ysVOM1NaRLxTRzdCUlWNV6FwBiDj2OBtEOgUTsTEp1rFZe/ 6nMJIOuA2re5U0szw7vlycNlsTOcPEQVMPgI/XOI1JIi7b4DwQmEnZd9IHWNPXKF8p8Hhm9xIh tmsEudLv54d6cF+A8ycpVY2VWcPFsu3a8R6UhCSXnlbrbItlsqdklBHDrCswbmc3l1HH6bswIh rtoO0R7AmuQUpWNMv+CvHFJgsd7X9s9Eicy8TA93Z3fhpfuqFHbBVVb01egVybNPi5V8uLILM/ cps= X-IronPort-AV: E=Sophos;i="5.81,164,1610380800"; d="scan'208";a="263648820" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 09 Feb 2021 20:36:32 +0800 IronPort-SDR: l60qf/RRcalKzyp/Hwk7zr0OBZEd8HFz/xgXLCObzqRXyQgdda5xQ3ztgLDb7TeEgNO0y2A9h3 xpydNvokrCAzOuZ1Y90I2MKuxN4cvS5jUR/HILaLXLQsdyiWO5NbAcr43zXavtZGhsn+nfO9mw R/bdGQ19vSn+CULrZ/LcMJoYayNDes5xCluJZlRT2c/vM56e7oM98Ruepu9RFKkGfWSKavFEGK m07nU0k0k3oSbPL5ArnuOhiPIc7aHX31wQkTQtaf26olU6WTOrHEVfBBC1lSy0iEdOoTCvs0E9 4Cjo0HvizcOOMrKao+jpDPIN Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2021 04:14:05 -0800 IronPort-SDR: r9hEnmBu4wIfPTdBYSA76Z/ywFdhj6ON6RjGc0GOcZSRSI1kK+JTgPaI0w/KSHucAh3pQSD3/C hP+4DvttaT2Pa32wnT8XO8eV8T5vO9rmmoF7OgsGNGNQsrGF2dKgtsF0q2feRCY6mlHLyzbz4R xHQIPb0v0SLWAq/DQ4ojO3WEBSMWnyaqo8CzPMLM4DQkDH+7oWtVtMvsOEibMO8/PCrquAsrDr OeAcErzjWlWu5Gjb+9EVketDTTJheHSEX1AV8FPoc4mxCnZQohdJFq2HDkS1KaJ7MFrhUy396h j4E= WDCIronportException: Internal Received: from phd004806.ad.shared (HELO twashi.fujisawa.hgst.com) ([10.84.71.69]) by uls-op-cesaip01.wdc.com with ESMTP; 09 Feb 2021 04:30:20 -0800 From: Damien Le Moal To: Palmer Dabbelt , linux-riscv@lists.infradead.org Subject: [PATCH v18 02/16] dt-bindings: add Canaan boards compatible strings Date: Tue, 9 Feb 2021 21:30:00 +0900 Message-Id: <20210209123014.165928-3-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210209123014.165928-1-damien.lemoal@wdc.com> References: <20210209123014.165928-1-damien.lemoal@wdc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210209_073023_361629_767DFC3F X-CRM114-Status: GOOD ( 12.09 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Atish Patra , devicetree@vger.kernel.org, Anup Patel , Rob Herring , Sean Anderson Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Introduce the file riscv/canaan.yaml to document compatible strings related to the Canaan Kendryte K210 SoC. The compatible string "canaan,kendryte-k210" used to indicate the use of this SoC to the early SoC init code is added. This new file also defines the compatible strings of all supported boards based on this SoC. Cc: Rob Herring Cc: devicetree@vger.kernel.org Signed-off-by: Damien Le Moal Reviewed-by: Atish Patra Reviewed-by: Rob Herring --- .../devicetree/bindings/riscv/canaan.yaml | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Documentation/devicetree/bindings/riscv/canaan.yaml diff --git a/Documentation/devicetree/bindings/riscv/canaan.yaml b/Documentation/devicetree/bindings/riscv/canaan.yaml new file mode 100644 index 000000000000..f8f3f286bd55 --- /dev/null +++ b/Documentation/devicetree/bindings/riscv/canaan.yaml @@ -0,0 +1,47 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/riscv/canaan.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Canaan SoC-based boards + +maintainers: + - Damien Le Moal + +description: + Canaan Kendryte K210 SoC-based boards + +properties: + $nodename: + const: '/' + compatible: + oneOf: + - items: + - const: sipeed,maix-bit + - const: sipeed,maix-bitm + - const: canaan,kendryte-k210 + + - items: + - const: sipeed,maix-go + - const: canaan,kendryte-k210 + + - items: + - const: sipeed,maix-dock-m1 + - const: sipeed,maix-dock-m1w + - const: canaan,kendryte-k210 + + - items: + - const: sipeed,maixduino + - const: canaan,kendryte-k210 + + - items: + - const: canaan,kendryte-kd233 + - const: canaan,kendryte-k210 + + - items: + - const: canaan,kendryte-k210 + +additionalProperties: true + +... From patchwork Tue Feb 9 12:30:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 12077895 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB976C433E0 for ; Tue, 9 Feb 2021 12:30:36 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5C75C64EB1 for ; Tue, 9 Feb 2021 12:30:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5C75C64EB1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Ndn6te/sz3mdePW5tHgwvH+Ot6tYmmRpXbfK4S9IcOQ=; b=qoaydqfC4p+fZqQuKY2RDcMXi HrLkAGMbdUuOFKW6+abOExyso3h6vRl+68hLYw2mnxEqx4Q8kt8Y1LcxCzps52DntsP8VuHLL1mYg nAXEAM22AhnJNlGHISg1WdINPUTmywa7jwgC/dHaBJGI7UYQ7XVw/9XycQ9OTojpoXE4H/8RFNdkE JVCLU8Rxj4Xby8FPRc+4Y3fMJtg6h7BplTrlG6qT70ZPXXzgGVJw/YYBLrugt445E0v+j4GXtH2+t rgOplCxST+J+BcRHLdSMDO68GEQ3luIujSnUZCS1/XQPBWzOFLLOrNeE7Qz6mN4acrkFyhWbdGreJ YRXlVBqKA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9SA0-00086r-2P; Tue, 09 Feb 2021 12:30:28 +0000 Received: from esa2.hgst.iphmx.com ([68.232.143.124]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9S9v-00084y-KA for linux-riscv@lists.infradead.org; Tue, 09 Feb 2021 12:30:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612874193; x=1644410193; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6K57gJ4d4JJEae1PJW0yBIWM0fdObKVyG7NMETneATc=; b=JkO8KsvzhgQsZwhXtFLg4he2nPpfo+OjyPGp0I9FfNHyO+Z6HL1N3xs3 FXclLdz2oOWi7jgXaE41lbuQVnr4i1G11vRqI+fc0mlUjEt3LgAOBUNsa oMI5iJfqDChZUnjcntWp9FlfgE0wmodNK24hwWFKo6UkmQ6SUfaYhfCVk y9bqq/mv+UmVcL+4es+NC5FC2pj4Q4OqunUyTDfaeGujuRHY3cXX6eHJj W/EWgBRfY7VRd00JyDjcDcAn1g4w5jaxZkotFEyt0EDBPcWtI743kDq8v kbIYj5wTWhy8mIP7PcGIKeQmwxs4kQbbjTM43NVtoDLBKfw+IBluuptR1 g==; IronPort-SDR: Nx5oBFhQQIdiCGo7e1CeW/qYnv881Wnn9fy549wi//KBdeeshT6f/+34EVvmlLSUi3luO/aamG vWcekIX1FiosV4fHzA+8vVQ1WYzEbk5FpJdu03gybjy2GW/pbcGG1OZwiFtK0wYNsHthZpHMSV wLZ4HadpDOLqWUZO0ec7PVB6w1mMCopasAZFktsNNTgU0lziJ9ZPGHCMLM1B0FgfZFsuMA8dA+ yMQQ55l5M+Iet3D5LRdSxmLDcrF9SGar4lu2LUZHi7caCcWCQNQdJKvy3IHfpulK/7+24sh2yf /mc= X-IronPort-AV: E=Sophos;i="5.81,164,1610380800"; d="scan'208";a="263648821" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 09 Feb 2021 20:36:32 +0800 IronPort-SDR: ROz8LF3QXK5ZNIonC0QWepfWTQiO02yG8PfaK1O/BNwQ1K+bRNRC0kmpZ0f00tNNlkOhlgiUNr YrAd0dk5AlicDWib47dc1+1CvPHWDQaCyFBhhJpf91FdOGqPZwELEbj8c5HDs0xwA5ntZxyxhx GysEMgboXKbk352e3ymqeejlwkIVbA3OWg3QGrKIAp71cwZUCZAsRH0woJWguNLwKniWAREA6k H+joBDFwf8FAPkIkQ87417Z/9vKlcGomenS3APoHJ2epTJy4K4+v4Qoqp2mihuv4vrFU03B6Q2 2S8XOTOEsQAHJjafRoJJiHDT Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2021 04:14:07 -0800 IronPort-SDR: MQyDinRdhBof0TBzSa/ZG/iJFHUtLY0doAsDije0XaGZWciMyGH5/cORW0qEvTs8L7BatoGNBV pQiHsSW16XKkR2EoyGXY3gp/yrAIh2Y4SMkb4rilKGmYypm2kagnbJeiIUvIqLsvHof70ZfWgR 1Vpcch7i5LHxJXuM+8XrM74AGueKNTU2fq0OMJ455h0kPJzfQBT9KKsQUr2s4dZh6PP/UyxhX0 R+gbna/+JuuMBH/hXg2EAF9s9AH+yqsYWe8k7R6SYS2MpBCG6cFF8G7QuJA9kn1+VOqHr6zt8H i3E= WDCIronportException: Internal Received: from phd004806.ad.shared (HELO twashi.fujisawa.hgst.com) ([10.84.71.69]) by uls-op-cesaip01.wdc.com with ESMTP; 09 Feb 2021 04:30:22 -0800 From: Damien Le Moal To: Palmer Dabbelt , linux-riscv@lists.infradead.org Subject: [PATCH v18 03/16] dt-bindings: update risc-v cpu properties Date: Tue, 9 Feb 2021 21:30:01 +0900 Message-Id: <20210209123014.165928-4-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210209123014.165928-1-damien.lemoal@wdc.com> References: <20210209123014.165928-1-damien.lemoal@wdc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210209_073023_791858_ED2AFA55 X-CRM114-Status: GOOD ( 12.45 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Rob Herring , Anup Patel , Sean Anderson , Atish Patra , Paul Walmsley Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org The Canaan Kendryte K210 SoC CPU cores are based on a rocket chip version using a draft verion of the RISC-V ISA specifications. To avoid any confusion with CPU cores using stable specifications, add the compatible string "canaan,k210" for this SoC CPU cores. Also add the "riscv,none" value to the mmu-type property to allow a DT to indicate that the CPU being described does not have an MMU or that it has an MMU that is not usable (which is the case for the K210 SoC). Cc: Paul Walmsley Cc: Rob Herring Cc: devicetree@vger.kernel.org Signed-off-by: Damien Le Moal Reviewed-by: Atish Patra Reviewed-by: Anup Patel Acked-by: Rob Herring --- Documentation/devicetree/bindings/riscv/cpus.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/riscv/cpus.yaml b/Documentation/devicetree/bindings/riscv/cpus.yaml index eb6843f69f7c..e534f6a7cfa1 100644 --- a/Documentation/devicetree/bindings/riscv/cpus.yaml +++ b/Documentation/devicetree/bindings/riscv/cpus.yaml @@ -39,6 +39,7 @@ properties: - sifive,u74 - sifive,u5 - sifive,u7 + - canaan,k210 - const: riscv - const: riscv # Simulator only description: @@ -56,6 +57,7 @@ properties: - riscv,sv32 - riscv,sv39 - riscv,sv48 + - riscv,none riscv,isa: description: From patchwork Tue Feb 9 12:30:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 12077899 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 509A9C433E9 for ; Tue, 9 Feb 2021 12:30:39 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D214564EB1 for ; Tue, 9 Feb 2021 12:30:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D214564EB1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=CobTpFA9scSRrNTMd1NHma5ttxWf60hziFhI15Lh/2g=; b=jtL7gmZeiFhG1NTXJAhhQ/G8N sGHHUrPEtRg+8SpXL/pFVE5UJav59L5T0NV17fhHk21Dtd+kNqeae+Piso+hh0CgkEWkc/UpmXrut Z5RNdyLDA0skkFboRMXuiv1Cnnv6PWTNCd1HOyuOZoqPFKhcXdB4XUYHylRhRpe0Io3VKgyGV/h0x oDzNIJBvwcHqTUjwLj9HXaUiitA205N/mMB8pZvPjwC9XaBSCZyAjAmB+U3V4JwnHhQUzl0pPqS93 0fx29wWwKBNLTft+Mow6Uc3u3PNreyj+baXmOaZRNedwsKj6j4ZomukFEshL/hQEkyS001YxkRi0n jLoTLtX0g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9SA2-000881-Jx; Tue, 09 Feb 2021 12:30:30 +0000 Received: from esa6.hgst.iphmx.com ([216.71.154.45]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9S9y-00085Y-EH for linux-riscv@lists.infradead.org; Tue, 09 Feb 2021 12:30:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612873826; x=1644409826; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NGUiJ8C+bTM58/VzIl1j0v+4iWOTF+8rASnEfXwaBo0=; b=FRY29YR/Dc8VYPI/9TXxJf0CXgRF8k7AdbuaXzQqbvyUtqyIHzdcePsp mI3k35aqu7H/8f3AO0PHBkHP54SnyvEti3qvkii0lg5BAvaQztexoEyRi HqFNq4OZXTmQib2BKiaTLyQ0HjrFtvV0WUXLnK21hb+cfrxS1IX44HU1G Fk+pz2FUCaj19L6GDQoeMy2rhkBTzyf1+up4yMcDD1GWeU/ix7+8SGwli o+O7nM3yCYSVB4XFP4jNAFPrI4bcnPBYL0TvhxJgFy+6A05aVwjYnlCqX ZSQzRTgk0pAkbJZyfjoaGF7Nw0NOg4hbphU5FsZvmKrTYWc/1Ma6Edd2j A==; IronPort-SDR: XKMRGq94L3NDz1TDwVGUsHOoq9JO6MDgcp/35ELjSgVgQ6QC91Ied71U5kq5HMPOqUeI2pUXiA fFHoZ0gnxkbdzbbALxKB9oQRtKoJy9U/pZvUYRlduk4+w/8P8sbEpUAA0dfiibJN06MoYHJI8r vWvThgP0WWAZkXGwMzDDpLgbnXmxrcO2k5Yg8SxkeasM05+sEMv40r8wOxbV8Wm20M396syYT+ cL9ngqY61n42qnO8+EW2Yzd1Tlb80BQ6/B+5CHp1OU0ubuM9N9yTkrJA+OXQYN7lNksnoRVHtk 87I= X-IronPort-AV: E=Sophos;i="5.81,164,1610380800"; d="scan'208";a="160707550" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 09 Feb 2021 20:30:25 +0800 IronPort-SDR: sbQUK5JHVJQuF8aQiYfkGK2gC/R+oqYXxp9zqMycIRYF75FYPfB9NQGOOSeFUJXE3VYf/yFiZg FNmfvlW4Zu1lb70QPk+xaycgF0IofjMUDtWGEZguxFiN3RVMzcG4+/UnyDQR2fpgaRwBFQdVJi ckFsN/thTLKgonLVfQ+mWtufYxCFQIyU3y0YaDqTMcKjcbVQpHnCCjxo5EwwSedU5J9tLhAebn e9UHIMcfQDEWcwsg4ZvdOU/oO4ZGiJz+4co8unb4vQVnK3H3wFzQJO9AKbzGPjqacuOi2oxS+1 VmpCakfIRNdhY6vDF49hRbwg Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2021 04:12:18 -0800 IronPort-SDR: tVpNS3b5HttM+gO4JgIkVgnoba0hYx90quy4/NNyq9c/v+AM+MNv8pvaTqGs4Ddevvit0ObYvx DQiJF+KtJgZRy4tLAh+zF3M7YzziIMADUcu/nZ6fZy5lXYjG2qWqcmjPETvAv6ASQce2tHI2JQ gOx5k/tfTcuCcTjVGdHu0+KEkx1SqegXfmidkPrwHvBlJg+B7SW+R2FcquYC+kqomSdOQBLfL0 FhKqBy0EQu9wH91VcsEZ9WMHF6zAZBh2E3ef2gVAPsOyzWVVnsHBjshLhPcGp9UFoPHekqV8sn +is= WDCIronportException: Internal Received: from phd004806.ad.shared (HELO twashi.fujisawa.hgst.com) ([10.84.71.69]) by uls-op-cesaip01.wdc.com with ESMTP; 09 Feb 2021 04:30:24 -0800 From: Damien Le Moal To: Palmer Dabbelt , linux-riscv@lists.infradead.org Subject: [PATCH v18 04/16] dt-bindings: update sifive plic compatible string Date: Tue, 9 Feb 2021 21:30:02 +0900 Message-Id: <20210209123014.165928-5-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210209123014.165928-1-damien.lemoal@wdc.com> References: <20210209123014.165928-1-damien.lemoal@wdc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210209_073026_625766_DA9039E5 X-CRM114-Status: GOOD ( 12.11 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Rob Herring , Anup Patel , Sean Anderson , Atish Patra , Paul Walmsley Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add the compatible string "canaan,k210-plic" to the Sifive plic bindings to indicate the use of the "sifive,plic-1.0.0" IP block in the Canaan Kendryte K210 SoC. The description is also updated to reflect this change, that is, that SoCs from other vendors may also use this plic implementation. Cc: Paul Walmsley Cc: Rob Herring Cc: devicetree@vger.kernel.org Signed-off-by: Damien Le Moal Acked-by: Rob Herring --- .../interrupt-controller/sifive,plic-1.0.0.yaml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/interrupt-controller/sifive,plic-1.0.0.yaml b/Documentation/devicetree/bindings/interrupt-controller/sifive,plic-1.0.0.yaml index b9a61c9f7530..08d5a57ce00f 100644 --- a/Documentation/devicetree/bindings/interrupt-controller/sifive,plic-1.0.0.yaml +++ b/Documentation/devicetree/bindings/interrupt-controller/sifive,plic-1.0.0.yaml @@ -8,10 +8,11 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: SiFive Platform-Level Interrupt Controller (PLIC) description: - SiFive SOCs include an implementation of the Platform-Level Interrupt Controller - (PLIC) high-level specification in the RISC-V Privileged Architecture - specification. The PLIC connects all external interrupts in the system to all - hart contexts in the system, via the external interrupt source in each hart. + SiFive SoCs and other RISC-V SoCs include an implementation of the + Platform-Level Interrupt Controller (PLIC) high-level specification in + the RISC-V Privileged Architecture specification. The PLIC connects all + external interrupts in the system to all hart contexts in the system, via + the external interrupt source in each hart. A hart context is a privilege mode in a hardware execution thread. For example, in an 4 core system with 2-way SMT, you have 8 harts and probably at least two @@ -42,7 +43,9 @@ maintainers: properties: compatible: items: - - const: sifive,fu540-c000-plic + - enum: + - sifive,fu540-c000-plic + - canaan,k210-plic - const: sifive,plic-1.0.0 reg: From patchwork Tue Feb 9 12:30:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 12077903 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0CC17C43381 for ; Tue, 9 Feb 2021 12:30:40 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9701A64EB9 for ; Tue, 9 Feb 2021 12:30:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9701A64EB9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=WMKUUrQCbcO+nF3Bv2V20DdXycmeQ/4m+KbZtp7RNZ0=; b=f/OncH7oY4pOjBQiY75747PeZ 6N8ERsuMb9FDOXDc4Nq3IAo2ge2a3kpFm8BXX5Ncn8tMRZbUkjqZ+gg67UmCZn3PA0PnopbQfSJW9 P1Vd77gxpX8LlQOyJQGZvvHS48hZSeQnWRswCipQyZwL+hJUt0IcoJ2Ty0nRT+IjAKZ2Rywej3hmU ZhcCrwNaXFTeyw0/h6NyPcGZf3iAUPm7RJaBu8TYwEbwdKOFFT/5YaYGVMpPoVanfnxwYKrYBkgVK CWfsctOIhD2og4mk77LAZhSS6qZt3XGh7FBLmFmgtPEQGFNnMnBreliobf2XBHHh6i9CjSH7hOwVq QjJTPDQVw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9SA3-00088x-Sy; Tue, 09 Feb 2021 12:30:31 +0000 Received: from esa6.hgst.iphmx.com ([216.71.154.45]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9S9y-00086F-QS for linux-riscv@lists.infradead.org; Tue, 09 Feb 2021 12:30:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612873827; x=1644409827; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vo/OPIAjkDR1OdjdExr2oFWyf1l5b2KQ57/Uzl/0wR8=; b=V6/53cM+NmdxD48OjsxoTivlm/OGtcMvxgituiaIIOGchR1RT3DEsfl8 i0USda7PexiPIOMFVMXSvpen+5ftKCm23zjBPNEQnzoXzcqa9bUOysiiJ G9gc6DYAytYf7OS9Nu81gWFW8nT0PGFvmadUHtzPArdJGcnIywxHvZWvT pY+PSKlI51FMPDTuQ9lVM8zqAYwwRRh0e61g59R/ECGmWtv4LPF1dR22L KC0u/Xu6csxvoGI4St8E19YQiE8M7O3Y0Js0qwdZouxad8FDv+Z7fRXrV fXs+gzzGE5hhfDEfE+ftSrZDrpestckSpggB7wIkxW/jVYkgvY3Yyh4eJ w==; IronPort-SDR: v04aH9wUTIkl8NsfnieHJQFnFTpbL8rfkGWUzlfwQU0HfWcVHpCoPqF+gWcxAp6+iOn7VZdjzb O/u7YRgbSvPblYwJOw3ZCMf6uv0IFhDnbbpBWNQUdUC4ygZ3hTWz7nPCYCXrcjs9YXY6dH2QgG J8lt+z8yW+lIoz1/YYl0zdy4gbgAz2HvMH7qmQmF08ytOUMU2oyTVsegr8QuGgRxT4s3Uvbyo9 Z3p6e6mwLAj9bSaptJugd+auCy9zMf2C47qsKg0tQbfU+1PWimZUpFjuwYD8K8bjfvBSQwzxqy 7DM= X-IronPort-AV: E=Sophos;i="5.81,164,1610380800"; d="scan'208";a="160707551" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 09 Feb 2021 20:30:26 +0800 IronPort-SDR: pxJgVrEV4kBjuN1Ztc2QLGPmHY7pi5gXfrPzE69Jvd3DqId2A6LoIb/H/6s7hY9QzFdklLLZIf 9wk8Tt+9IDh84cplw1so+C9BSt+BGWBmSPth4uWKGhp7JTNl5IVxvFdEPy3U58qx7/p9ktF+vj 8JdRoLF5CVvJ8nBlOGNx7r14M2p7XQfa5t9WEV+Q4XdFi2PZ/xe4huEFoHK1MRdNtLOrX606fd nYyNRTw7u2A25iH7FglYjXbvZwON5p3kt1q0B1hstLOMcgSLmerOrqyWzDIC+7EGncL/tCcztX bPpD7+pgbcJzPY0dhnJAG8aJ Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2021 04:12:20 -0800 IronPort-SDR: cMmr6H2j9YehT9FwaFBGGz/CYFJi6MAaKnxJWQyGcxrq47/gMaasKj8n1RLjDQm2RllacyRmJj bsxl5wMPYmTXEySnWcqEBtsyqwXfpJJPBAWKS5xDc6FtGsV1JwYJbVAkPmmiw4upY6ni55bzDr 8qjGeHTwwMNku7ePDQhoZyHzMcfd9tKgCbnAjKdqr4bth5cehStLn+i86d6ien0Bo5fj+DCIGK nXnZ87p1u/xF6UDRJ68LfPnf258f0D+JjzT9dlDfa75/l6o79+nbUs/VOgwhlQHXAfPSYgMWOA M9U= WDCIronportException: Internal Received: from phd004806.ad.shared (HELO twashi.fujisawa.hgst.com) ([10.84.71.69]) by uls-op-cesaip01.wdc.com with ESMTP; 09 Feb 2021 04:30:25 -0800 From: Damien Le Moal To: Palmer Dabbelt , linux-riscv@lists.infradead.org Subject: [PATCH v18 05/16] dt-bindings: update sifive clint compatible string Date: Tue, 9 Feb 2021 21:30:03 +0900 Message-Id: <20210209123014.165928-6-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210209123014.165928-1-damien.lemoal@wdc.com> References: <20210209123014.165928-1-damien.lemoal@wdc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210209_073026_991581_78616C8D X-CRM114-Status: GOOD ( 10.35 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Atish Patra , devicetree@vger.kernel.org, Anup Patel , Rob Herring , Sean Anderson Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add the "canaan,k210-clint" compatible string to the Sifive clint bindings to indicate the use of the "sifive,clint0" IP block in the Canaan Kendryte K210 SoC. The description of the compatible string property is also updated to reflect this addition. Cc: Anup Patel Cc: Rob Herring Cc: devicetree@vger.kernel.org Signed-off-by: Damien Le Moal Acked-by: Rob Herring --- .../devicetree/bindings/timer/sifive,clint.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/timer/sifive,clint.yaml b/Documentation/devicetree/bindings/timer/sifive,clint.yaml index 2a0e9cd9fbcf..a35952f48742 100644 --- a/Documentation/devicetree/bindings/timer/sifive,clint.yaml +++ b/Documentation/devicetree/bindings/timer/sifive,clint.yaml @@ -23,15 +23,19 @@ description: properties: compatible: items: - - const: sifive,fu540-c000-clint + - enum: + - sifive,fu540-c000-clint + - canaan,k210-clint - const: sifive,clint0 description: - Should be "sifive,-clint" and "sifive,clint". + Should be ",-clint" and "sifive,clint". Supported compatible strings are - "sifive,fu540-c000-clint" for the SiFive CLINT v0 as integrated - onto the SiFive FU540 chip, and "sifive,clint0" for the SiFive - CLINT v0 IP block with no chip integration tweaks. + onto the SiFive FU540 chip, "canaan,k210-clint" for the SiFive + CLINT v0 as integrated onto the Canaan Kendryte K210 chip, and + "sifive,clint0" for the SiFive CLINT v0 IP block with no chip + integration tweaks. Please refer to sifive-blocks-ip-versioning.txt for details reg: From patchwork Tue Feb 9 12:30:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 12077905 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40F03C433DB for ; Tue, 9 Feb 2021 12:30:43 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9A01D64EB1 for ; Tue, 9 Feb 2021 12:30:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9A01D64EB1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rDOsYd80hg1kW7D7IGobBsRgC2QIET2X9X+AVMYW0Ss=; b=MqfECFI6K2DHxJ9jOdw2JGAjO modzrGkbJ8osLn9Y62DBwh+yF901o0/xV0xrCE17jiYWqBcB5Ryo7h06vNzaG6HA1U1BjSIUXepox ubUon2e5wFfXBHW6168pq+AmbEnkZIRHnEb/9ou6NtD5uoHKOxf/4xyTY5AoGm3qrayqGD35TcuSd cXsiq+3GaW/jZz5GEiuK4VBoVKbqqpMZxIyVMFT4vylnXzPvCIXTPqCXUahBuoF4DNhO76M109RDq L5Kv+3UhlmO2xB2tO9hkBDH+77xEQbvwOOeqtKsqwwD/nLDrh0mx6UWvbqzqtCFmp17sbR7EK/ABX YhPB0A4BQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9SA4-00089o-Sd; Tue, 09 Feb 2021 12:30:32 +0000 Received: from esa6.hgst.iphmx.com ([216.71.154.45]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9SA0-00085Y-3a for linux-riscv@lists.infradead.org; Tue, 09 Feb 2021 12:30:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612873828; x=1644409828; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=AIY+mENCG0OfDogqN2TK/zkNool8y2CBwzDhCDvMBTc=; b=oEqzJHDb2afh0fZoUNyFebYkHz79ttkKwYHfmQ4UH43R3geXwahh6aQC ekieooyk2EKkd+v3ymFhNsE+ZqA71376cFJcnLLb9pkcz1iTC+eQMoOPg BkRA4UFjRMG05+28JAr7kJT0vUvm/RYCTMxolWrJCkmiNvtlVANCam4d+ etbNLFUdj3HqER1evXhZBxPStfHilbVpbkhc74Sz4isy0xoyxGgxsLrj7 1uJCaG3lyzy0Wq/bSg/RRIAUFfsUPMAj80frpw1yGCYD/4+1T7roGbxCI AOiYDD0em3uxIBSyDJ1J+BrY4Cyo2ecEtqoM+Lmn9Re3aE4+m6TE5rWCG Q==; IronPort-SDR: mwscthNsz7DMN0usOU0XZlpdAHnWiTnKvzTvRPtJ5RqGPcd//dgkGPs2B8clvSu/qrH5OnCzvc b/esNbhikgiKO64N97B601jgFDyNtFfodVK4Xdp0MIPESlSZIozTxfvs9xhzduQzgK5Q0FKkNg lWqQAvN9Ed3462Sh3PviC9ehMnML5xVJrepAsoQ+Ay5rFrorg1Uiu4n8RYEu//CYDb5xye2jaN jBCEmOlzLT7vmnARGLvRxKUC0B4hy5tFTIbJaqo6fhIniaI/FhT+4QHVe0A02RRp5HdKp1LP5Q uH0= X-IronPort-AV: E=Sophos;i="5.81,164,1610380800"; d="scan'208";a="160707554" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 09 Feb 2021 20:30:28 +0800 IronPort-SDR: ErhL6eywFuQGfBrK6y+10eHSzLxHRVmN2nQAX32HaIjV4kk+ZTgMuj7cTAoVh03y/39VrAzRBj bBk0D41GtZyjVCk3Z5jsU/pFSC4BTNziV1CjnkqyhtD/DUxeLRz9+w9aDJf5ph0sxcXvEkhG9B BJGlpNZ1R9F0GF4S7hN6qBK7T953u57q3XzfQL1zIVPX/ykAWdlTNFgP0rsJGjirfosd0+PPQO iJzBprLL4CzFTatvB5EdIKP270fgPrm4ADWLY1pLtrpwkPPlmOB1cOu7LuX8wpTrDJtLCVP2Ab XDx3vnh9oNb1iOq0NA8b1rCg Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2021 04:12:21 -0800 IronPort-SDR: lupY98j76pDHZuYYE2dQnSvWhf/sfGpMDlmBHyuIQEEnke/G2Oyg/37jDggAlx2Zd9ElclfcPk c2BdbxJJx5Mxs8PkBvAz+pIAoozWNypYTFm/zP4z4oLlF51Kuykg2QgyQGn6oBJGgVofsZX4tO IM1XA4IbvyPTHB8f+cWPsyoF+FE5+irbtsY9/RdjWvAW7JdO9nkTiwx4LlxMahUOspwwSSQ3nw 6h6YFTUZuKh24aZXVLuIR455J5JVBfDDYEJ7sen5dHxf9F6F9rEYV3fjQuZBSAaTwIAzf3JkYJ OIM= WDCIronportException: Internal Received: from phd004806.ad.shared (HELO twashi.fujisawa.hgst.com) ([10.84.71.69]) by uls-op-cesaip01.wdc.com with ESMTP; 09 Feb 2021 04:30:27 -0800 From: Damien Le Moal To: Palmer Dabbelt , linux-riscv@lists.infradead.org Subject: [PATCH v18 06/16] dt-bindings: update sifive uart compatible string Date: Tue, 9 Feb 2021 21:30:04 +0900 Message-Id: <20210209123014.165928-7-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210209123014.165928-1-damien.lemoal@wdc.com> References: <20210209123014.165928-1-damien.lemoal@wdc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210209_073028_336831_E3FD96F6 X-CRM114-Status: GOOD ( 11.22 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Rob Herring , Anup Patel , Sean Anderson , Atish Patra , Paul Walmsley Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add the compatible string "canaan,k210-uarths" to the sifive uart bindings to indicate the use of this IP block in the Canaan Kendryte K210 SoC. Cc: Paul Walmsley Cc: Rob Herring Cc: devicetree@vger.kernel.org Signed-off-by: Damien Le Moal Reviewed-by: Atish Patra Acked-by: Rob Herring --- Documentation/devicetree/bindings/serial/sifive-serial.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/serial/sifive-serial.yaml b/Documentation/devicetree/bindings/serial/sifive-serial.yaml index 3ac5c7ff2758..5fa94dacbba9 100644 --- a/Documentation/devicetree/bindings/serial/sifive-serial.yaml +++ b/Documentation/devicetree/bindings/serial/sifive-serial.yaml @@ -20,6 +20,7 @@ properties: - enum: - sifive,fu540-c000-uart - sifive,fu740-c000-uart + - canaan,k210-uarths - const: sifive,uart0 description: From patchwork Tue Feb 9 12:30:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 12077907 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B92AC433E0 for ; Tue, 9 Feb 2021 12:30:45 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2AFFD64E88 for ; Tue, 9 Feb 2021 12:30:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2AFFD64E88 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ZBezENa7uLTJEpAbnXHrjRpvltgAEHRnmo2Tsywwa5w=; b=beJMziyosLncUs49xR/Y9KT3A ViXGEdM13SiLfw9m2v+PRxcE4kV4xT9X/mHWM8ALRD+UkSm5bEFVcD/I17xLKjeqg00kmQcpASwSU zsD/m6K05xscxf6HtHB9z2PCijzDA1sj9KGJ1sQbp+l4eAew7MLidaAyNVuFiVc+C1eJIrCZ8Qc8S WGmUosXYjXYEvCvhZfQ30dCwp2rgYML7bGhRgDExCVoE0BCqcnlghsXxmzk9U00ofsmyfGLcs6UJ+ rL3S3bIROc7XBebc3upVdmOZHh2oFg+Xq8e70qxJ+8peVFK3ExBci+yHMt0H0hYgmsQ07J9ErkYLk Vfisnx+hg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9SA6-0008Aj-Um; Tue, 09 Feb 2021 12:30:34 +0000 Received: from esa6.hgst.iphmx.com ([216.71.154.45]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9SA2-00087n-8P for linux-riscv@lists.infradead.org; Tue, 09 Feb 2021 12:30:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612873830; x=1644409830; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sry4Jcxj7WaCMHpIVu5N/bY5as1f1P4twJ4S9BPW/Dg=; b=i/VJGKztFw5G5nKeaqRv0Ev1Fd1lK3AeGQWWCxJCsLztprfDOuJYI+k+ WJ3RdE9DRrfKD10jxoALkrRiNWhp4XxjfXKyS9gAfFJ399PSyY/zsNpON we19F4LODHPzhpzwXCZYw2N22CwrIsYpE6GNt+PKafHvnQ3nvlesY12mm bj2Qm7HrjK6Pi2QK6mh9R75fYn791UCaxIBru+D9zHhKWrtsVBjOuknsk AHC4jJkhUuilquYNK7wT3hiQWmMg/snla8Me5SoRx/96LrDTR6AqN3rVZ K31JWzzMEleIaQb1xYSqreDQjSrn8mB3Z6bV2Tm4PZ129YakgBPOIU3ss A==; IronPort-SDR: 1Qf5cvrU4qUrR1AwinDIOmX5wdOqdkeF6ioLQbY8YqEhZ+n5HQjwSwLai5HPVPRMgIt33udt7N OFpxFfGO7dCnQZNRUwTJbq+83So03MEsC39TyXxtOksFCIubMlhSIYn1ktzTGEuxJMOqmPlCNx BPR+U3SBXIhvpIPzdcixH8hbFd3hMfe7SED+7cnPImJvJZOZcguKSgdbt/+l0ctz1ru+3KbJRr IamdCuVHQclAraWSCCEBYw4LyyFKLMtbOqLHbpgygewMwHtFcxN99AQYAjkRu6JDGLBZsowp6i UDw= X-IronPort-AV: E=Sophos;i="5.81,164,1610380800"; d="scan'208";a="160707559" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 09 Feb 2021 20:30:29 +0800 IronPort-SDR: uoGxr3/8mtZrmnuWoD3KJelXR4QLcloW7wYymgmyDBd0otqzKGNTt1zod9hO0HpP5295XzibDC Y53ybAhELe9jkwqb6+JOjatsUqNbaNfw06zLN6chzIzfkbi6J20QcEW71zzfADcfdFk4cjOiQY UAUTf8NgZf/8VB1uSkn5FIt20AIcJsdHMo5Ha9sfOtv0EYNPAE0NCb+Hf+AqHsuERMfqNmdkLv 2f7ozzu479kdXst8gs1M7FIL9iOCrFtyh+yAHVBupnrVWSc7i66/SyTMdPvt6s70Qem3i1Wf9r ir4ZpmT6gbpI/BSg8bnQ0zh9 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2021 04:12:23 -0800 IronPort-SDR: RBC6pRxpUgQBA2M/aLZRapfqYs1SiBE81mk1IX9qpQgLWz33b9JjzwbMomYFijp52OKCvywyZh TAI4Ne2bb8gGyvCLsAUiw/Kd57+kQo4aHhTmNEjGoCcVCDRZT2K+KE+0qDCiGKKB+4NyztfQpa zns8KRx3z7ao9gpvP/TsgYebIJSiuQMR1eb1OUmPy1F+E30uy3hFD3CiVZv/9tWy6a2uqwbn0f aLb/qB1hBu7z9gJVuXqWsJkyfWMGhoqEs2wbLR07fzqn5Nqm3U7M4jnIHRtqtjtcGP7NM0kQpp lBU= WDCIronportException: Internal Received: from phd004806.ad.shared (HELO twashi.fujisawa.hgst.com) ([10.84.71.69]) by uls-op-cesaip01.wdc.com with ESMTP; 09 Feb 2021 04:30:29 -0800 From: Damien Le Moal To: Palmer Dabbelt , linux-riscv@lists.infradead.org Subject: [PATCH v18 07/16] dt-bindings: fix sifive gpio properties Date: Tue, 9 Feb 2021 21:30:05 +0900 Message-Id: <20210209123014.165928-8-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210209123014.165928-1-damien.lemoal@wdc.com> References: <20210209123014.165928-1-damien.lemoal@wdc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210209_073030_472392_7BFE42CB X-CRM114-Status: GOOD ( 12.59 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Rob Herring , Anup Patel , Sean Anderson , Atish Patra , Paul Walmsley Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org The sifive gpio IP block supports up to 32 GPIOs. Reflect that in the interrupts property description and maxItems. Also add the standard ngpios property to describe the number of GPIOs available on the implementation. Also add the "canaan,k210-gpiohs" compatible string to indicate the use of this gpio controller in the Canaan Kendryte K210 SoC. If this compatible string is used, do not define the clocks property as required as the K210 SoC does not have a software controllable clock for the Sifive gpio IP block. Cc: Paul Walmsley Cc: Rob Herring Cc: devicetree@vger.kernel.org Signed-off-by: Damien Le Moal --- .../devicetree/bindings/gpio/sifive,gpio.yaml | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/gpio/sifive,gpio.yaml b/Documentation/devicetree/bindings/gpio/sifive,gpio.yaml index ab22056f8b44..c2902aac2514 100644 --- a/Documentation/devicetree/bindings/gpio/sifive,gpio.yaml +++ b/Documentation/devicetree/bindings/gpio/sifive,gpio.yaml @@ -16,6 +16,7 @@ properties: - enum: - sifive,fu540-c000-gpio - sifive,fu740-c000-gpio + - canaan,k210-gpiohs - const: sifive,gpio0 reg: @@ -23,9 +24,9 @@ properties: interrupts: description: - interrupt mapping one per GPIO. Maximum 16 GPIOs. + Interrupt mapping, one per GPIO. Maximum 32 GPIOs. minItems: 1 - maxItems: 16 + maxItems: 32 interrupt-controller: true @@ -38,6 +39,14 @@ properties: "#gpio-cells": const: 2 + ngpios: + description: + The number of GPIOs available on the controller implementation. + It is 16 for the SiFive SoCs and 32 for the Canaan K210. + minimum: 1 + maximum: 32 + default: 16 + gpio-controller: true required: @@ -46,10 +55,20 @@ required: - interrupts - interrupt-controller - "#interrupt-cells" - - clocks - "#gpio-cells" - gpio-controller +if: + properties: + compatible: + contains: + enum: + - sifive,fu540-c000-gpio + - sifive,fu740-c000-gpio +then: + required: + - clocks + additionalProperties: false examples: From patchwork Tue Feb 9 12:30:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 12077909 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5C1EC433E0 for ; Tue, 9 Feb 2021 12:30:47 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8093C64EB4 for ; Tue, 9 Feb 2021 12:30:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8093C64EB4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=hQqmwUGTRtLWJ/g8j/lY8xYgjNeH8yAgWBiPvspHh6s=; b=TKWt4NYu1rWGyKFAfDp/csIzj YHrpMWv6oZ2Q2B5waQ+3ZNdxoPvbIrFIK9tpsOFRX9DfiqL+FVeUi3iOuepf3fAhCxV6xzLTNi+2U jzC+ev5YnR6eilj10hor21meeT8DWi2z/K1M0opNxg45xF4QTyWi/Jxp7wpW9J2I1SZS48JlVeDqf j6QzAYAIF3Qr2O19gf2dXpE4JR5fVrv/tQ8b7ebUmobSNMaRJPZoQuIR+G9h8ZlQfLUOHpY5dAobF sLyVhcO5c7ZvUMRIMTzhnzZeeZymjslKikdtN6D2KBFR2ZYAmsVj2BjwPMCpEuwphf/a14C4PTAWM Ok2AMzl8Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9SA9-0008CR-Le; Tue, 09 Feb 2021 12:30:37 +0000 Received: from esa6.hgst.iphmx.com ([216.71.154.45]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9SA3-00087n-W2 for linux-riscv@lists.infradead.org; Tue, 09 Feb 2021 12:30:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612873832; x=1644409832; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CdDSnYoUg4x8z9E5kd8zeW/UQhTCXdRY19IDHVs+Ulg=; b=bRulR+qLrriyNYu3/atsd1KlF7RhG5aEGDh4SYYUAFDf4QZGSK0QFhcC P5cVZguTkuLbOscq7VqaKabzkkOMTHj2Yf0OFXdDV/OSj2Ia8rIi3PAaA 3RupQ8c6k6NLIFiQLXaKXynpcKbMkAFijrxdu7tb+xD0mvbQRayzPYIJ5 uPXk2JQFJDAH+an0UnHxLxq8zXT4NWFiTyNQcgNtDag/VP+NWzIW6H0kh WW3mkNjWBkiVzTZoammn9l2rldYaUqHMd35WevLgIEkw8zx0QXOaXaiXF 9i2efgsI4WiPXdQeizLqA73WSFujyi/F5yywjJGdKNLbqQp+BME+Hmtpt A==; IronPort-SDR: 2q3Dr+7iDtIgmldnRmlW+R5ceONlQupgA53vb1fp6cpChGE545RgL3lwjROp14Bu06ScY+bxcC /S9C4M6FwoYok21ZwBIW71qff8HEwqcbXUv1rKz4qvPLBRLr2cj9rbII7FO6TYsv0tQz/U1MtF oi5kKhmiC1nqG1HBZi4Tcssxag1w5tiEOGQWmFHVJ2opxzyDv6+lDYgrh39vDviXopEPulZt8U A5gXHjH5SQn2CSnSs1AqNNmxhQC2Jcj+jnY1oTiFFwj0unwtBDdVYF/HjwEktGsCXuFpLTB+DZ dko= X-IronPort-AV: E=Sophos;i="5.81,164,1610380800"; d="scan'208";a="160707562" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 09 Feb 2021 20:30:31 +0800 IronPort-SDR: vrPCIQpMEUotvoWKol5W/7ybDMTmoEQVYfaCf08yUWEigl01itzcclvvBw6Zu4kDeZCCKeP5Jb LURNR6GBYd+arYAaGoRCHO8gu2pc0WOT1SJkDclnGPaGO5E8skoYAsrVyawTZiIQrhrrrb15FD KGLWOq1ydPoSgpa475iPd4TemxFnaOxvyHfLadkmVzIQo+DEVo1XP4iGxPHiYgdtDm3YNB95d5 gECS2vJAGllfBgvVOgclfkFi6On2Uk/DmFpY8vB6re44M2AIg//fjdBk+GORdRZGPQxQgMTk0c Yp6Kfe7+PWuhbUtGlVK2CZdQ Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2021 04:12:25 -0800 IronPort-SDR: 5cL0Thx6WDBaCz2ayEZmhttWOulinwOkASJ58p4pqWuqpATlAHpqsmZu+ufE1HNQ+rWJJvyBM2 pOJM1RsFbp5sbj5v8eOIe2BqVcWDtR6ql7UgCvI5CQus3Dfirvb6Ax2U92qv98GZjRooqFrOSC 2KuyjVFZM/3aQsH7CMhztdTtwCEnvBAllTAu8TCVPVz292D04e2nPnVxrKL8LfKH3Z3uCABFQL 4uTG3uoqr8/JPHFIgU0iZu2vuuQ4YWj3PRduaUvkme3KMdNZqD1LtQuoobGYyMrJjl2eJMKKiC s28= WDCIronportException: Internal Received: from phd004806.ad.shared (HELO twashi.fujisawa.hgst.com) ([10.84.71.69]) by uls-op-cesaip01.wdc.com with ESMTP; 09 Feb 2021 04:30:30 -0800 From: Damien Le Moal To: Palmer Dabbelt , linux-riscv@lists.infradead.org Subject: [PATCH v18 08/16] dt-bindings: add resets property to dw-apb-timer Date: Tue, 9 Feb 2021 21:30:06 +0900 Message-Id: <20210209123014.165928-9-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210209123014.165928-1-damien.lemoal@wdc.com> References: <20210209123014.165928-1-damien.lemoal@wdc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210209_073032_190002_0541E759 X-CRM114-Status: GOOD ( 11.22 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring , Daniel Lezcano , devicetree@vger.kernel.org, Anup Patel , Sean Anderson , Atish Patra Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org The Synopsis DesignWare APB timer driver (drivers/clocksource/dw_apb_timer_of.c) indirectly uses the resets property of its node as it executes the function of_reset_control_get(). Make sure that this property is documented in timer/snps,dw-apb-timer.yaml to avoid make dtbs_check warnings. Cc: Daniel Lezcano Cc: Rob Herring Cc: devicetree@vger.kernel.org Signed-off-by: Damien Le Moal Reviewed-by: Atish Patra Acked-by: Rob Herring Acked-by: Daniel Lezcano --- Documentation/devicetree/bindings/timer/snps,dw-apb-timer.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/timer/snps,dw-apb-timer.yaml b/Documentation/devicetree/bindings/timer/snps,dw-apb-timer.yaml index d65faf289a83..d33c9205a909 100644 --- a/Documentation/devicetree/bindings/timer/snps,dw-apb-timer.yaml +++ b/Documentation/devicetree/bindings/timer/snps,dw-apb-timer.yaml @@ -24,6 +24,9 @@ properties: interrupts: maxItems: 1 + resets: + maxItems: 1 + clocks: minItems: 1 items: From patchwork Tue Feb 9 12:30:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 12077913 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 246CBC433E0 for ; Tue, 9 Feb 2021 12:30:52 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A26FB64EB9 for ; Tue, 9 Feb 2021 12:30:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A26FB64EB9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=I77CvDMWboV3dM51Anfsk84PVmvr5V3dGUo04mCtc6M=; b=CviF7tIGuMkMLvNE8LlLVeSrc Ef/d4AATJaKMGuw6S3e2d1xkwO7xA90EdyUwejYW3Zo9QzK6q4w8y5Rzcl/yOZwklEZVRSY5WhnhM CAeU1oZasAZdjG0agHjAB6po5tZzw/BSHp+XYzR5dC8pt7m0KxTnx5zFeMCnsCydZDkxdxcmjeT0p Ir1HIXFh0EK2ieEk+tMw+vdWWfiLXNKqwV9uj88rlTEt22yZAPxTEIWXH8NxEDk3EsOh1Y9d1mLFn 0FszxCRnD/+aa/Fqzwe23I8VrssQOnazjhnAt+F5pR7HPYEOhTZVeqiVEwlDWDZJnnmlBxGzoeDgd wDi7LZ4uA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9SAB-0008Di-M9; Tue, 09 Feb 2021 12:30:39 +0000 Received: from esa6.hgst.iphmx.com ([216.71.154.45]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9SA5-00088v-9S for linux-riscv@lists.infradead.org; Tue, 09 Feb 2021 12:30:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612873833; x=1644409833; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=077YnwDwKAoaZLyayKqj3ad/MpHjhavXIRgm8FQqxSU=; b=cnNSBMLlqSHCuI1LUoMmhK/s9s5gLpmTJMSnzkooVyT/S5WdsvbFQcHs JzviF7D8aqGzJCXjT2uIQnDrjaii7beXBwJhnKd190NEI+w1vhNUtkidt Qp8XoCXWzbhYAPqyYMTpFnAMKSwxZQTXGQfK3wkWRXFNm9uz0U3edq2Fq ICAcUHTaO8Y92cqv4K351rgohUtFxktQMdkrz6WQ9daOaS9RtmnBRU7UD +d+vXQb2mo3aGCKacRdFXRfxe/Bn4CGa3GdLRMa2JJbIQhKocUkvZTfpd Dc1rxaherGLSu62uPn0Hzsmxre0vCcxcqEWG5DgqMvh/iZSzi2OGrpKru A==; IronPort-SDR: alm30ruITF5CS3YB4wNgZIEgO/ZF52isAZ9eNeRRQj6BQfVmCUl6BeicIZ9xGBYPnBaL5YKLy1 oItReVpvRNRqfHcV6QO2GnzVRPIWZG78VIazYY8u82q7rgCajJcPH3tRYCRYlony8NUXR4LfvR B7IBD6wguZUQZnb6xI2yd++kxHmQcq20M0r2264cbr0fiGGCXQdu46yfe7nTIUUe69P7D/rui0 vD5wcwPsOoWGD3/ZizYtS4lRg/1bJlkIIIXpQ5tOkLCGjzXqJbgTYFL/sIam+sX/THwHe4wktU KDg= X-IronPort-AV: E=Sophos;i="5.81,164,1610380800"; d="scan'208";a="160707564" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 09 Feb 2021 20:30:33 +0800 IronPort-SDR: Nbdkzk0uObquJ8ZnTAqO3eTH2VCofy/+PLrCA/v2jYwq4ho70gcLxuUePlt7aAIxLQbYNxmiAV kUwhUz5TPwWxztxwzuDGFE10QMXjvLekXN5ghmrJDuNmpfNoK/oXZda2vcBc397X3667sNSdOC /QtV4+LMGRdgj5zZi+gveCOz3+yeaNTWkJlajmL7EbKrh8r1Ju+vVS/Foga3m2nKwysZQR2maW X4LIwzx4rGB/hLMG/CTHUFu16B70jCgkGTkCn+Yh0Hkpd1RfhEbV1FnI+1QoKdHZYTIJOcLRwl Nuv4RNNGLRpd62yglOxETBCg Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2021 04:12:26 -0800 IronPort-SDR: YGtE/WtwrmHkfhJ838Y3faL0mj7e0UKGii+oMZsbMDJC8taqDfETY17//7RhesQHf0U0Ftsla5 8OzKu8BUeCKLhePLyLeANN4/dQJa81PdfsPEs9bKeMSlJdvMDFs8BODssVD6Fj/tvr7ioHnvUZ /LXUOwHj8uFDQUPXtnWo7556xzIG1mQsD0fOm7H/P+TAzqQgTJZWlmm3/7aRqs/05ZQzQANbc1 XZnYKNl3i0G75TVxfXItkaxmnuSY2BzBC4NHGJQm7gOYQgTfpCQvjQcTBacb4oqKevnlRe+2dh Ez8= WDCIronportException: Internal Received: from phd004806.ad.shared (HELO twashi.fujisawa.hgst.com) ([10.84.71.69]) by uls-op-cesaip01.wdc.com with ESMTP; 09 Feb 2021 04:30:32 -0800 From: Damien Le Moal To: Palmer Dabbelt , linux-riscv@lists.infradead.org Subject: [PATCH v18 09/16] riscv: Update Canaan Kendryte K210 device tree Date: Tue, 9 Feb 2021 21:30:07 +0900 Message-Id: <20210209123014.165928-10-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210209123014.165928-1-damien.lemoal@wdc.com> References: <20210209123014.165928-1-damien.lemoal@wdc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210209_073033_624944_43AFEECC X-CRM114-Status: GOOD ( 22.75 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Atish Patra , devicetree@vger.kernel.org, Anup Patel , Rob Herring , Sean Anderson Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Update the Canaan Kendryte K210 base device tree k210.dtsi to define all supported peripherals of the SoC, their clocks and reset lines. The device tree file k210.dts is renamed to k210_generic.dts and becomes the default value selection of the configuration option SOC_CANAAN_K210_DTB_BUILTIN_SOURCE. No device beside the serial console is defined by this device tree. This makes this generic device tree suitable for use with a builtin initramfs with all known K210 based boards. These changes result in the K210_CLK_ACLK clock ID to be unused and removed from the dt-bindings k210-clk.h header file. Most updates to the k210.dtsi file come from Sean Anderson's work on U-Boot support for the K210. Cc: Rob Herring Cc: devicetree@vger.kernel.org Signed-off-by: Damien Le Moal Reviewed-by: Rob Herring --- arch/riscv/Kconfig.socs | 2 +- arch/riscv/boot/dts/canaan/k210.dts | 23 -- arch/riscv/boot/dts/canaan/k210.dtsi | 395 ++++++++++++++++++-- arch/riscv/boot/dts/canaan/k210_generic.dts | 46 +++ include/dt-bindings/clock/k210-clk.h | 1 - 5 files changed, 414 insertions(+), 53 deletions(-) delete mode 100644 arch/riscv/boot/dts/canaan/k210.dts create mode 100644 arch/riscv/boot/dts/canaan/k210_generic.dts diff --git a/arch/riscv/Kconfig.socs b/arch/riscv/Kconfig.socs index 6402746c68f3..7efcece8896c 100644 --- a/arch/riscv/Kconfig.socs +++ b/arch/riscv/Kconfig.socs @@ -51,7 +51,7 @@ config SOC_CANAAN_K210_DTB_SOURCE string "Source file for the Canaan Kendryte K210 builtin DTB" depends on SOC_CANAAN depends on SOC_CANAAN_K210_DTB_BUILTIN - default "k210" + default "k210_generic" help Base name (without suffix, relative to arch/riscv/boot/dts/canaan) for the DTS file that will be used to produce the DTB linked into the diff --git a/arch/riscv/boot/dts/canaan/k210.dts b/arch/riscv/boot/dts/canaan/k210.dts deleted file mode 100644 index 0d1f28fce6b2..000000000000 --- a/arch/riscv/boot/dts/canaan/k210.dts +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * Copyright (C) 2020 Western Digital Corporation or its affiliates. - */ - -/dts-v1/; - -#include "k210.dtsi" - -/ { - model = "Kendryte K210 generic"; - compatible = "kendryte,k210"; - - chosen { - bootargs = "earlycon console=ttySIF0"; - stdout-path = "serial0"; - }; -}; - -&uarths0 { - status = "okay"; -}; - diff --git a/arch/riscv/boot/dts/canaan/k210.dtsi b/arch/riscv/boot/dts/canaan/k210.dtsi index 354b263195a3..5e8ca8142482 100644 --- a/arch/riscv/boot/dts/canaan/k210.dtsi +++ b/arch/riscv/boot/dts/canaan/k210.dtsi @@ -1,9 +1,11 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2019 Sean Anderson + * Copyright (C) 2019-20 Sean Anderson * Copyright (C) 2020 Western Digital Corporation or its affiliates. */ #include +#include +#include / { /* @@ -12,14 +14,17 @@ / { */ #address-cells = <1>; #size-cells = <1>; - compatible = "kendryte,k210"; + compatible = "canaan,kendryte-k210"; aliases { serial0 = &uarths0; + serial1 = &uart1; + serial2 = &uart2; + serial3 = &uart3; }; /* - * The K210 has an sv39 MMU following the priviledge specification v1.9. + * The K210 has an sv39 MMU following the privileged specification v1.9. * Since this is a non-ratified draft specification, the kernel does not * support it and the K210 support enabled only for the !MMU case. * Be consistent with this by setting the CPUs MMU type to "none". @@ -30,14 +35,14 @@ cpus { timebase-frequency = <7800000>; cpu0: cpu@0 { device_type = "cpu"; + compatible = "canaan,k210", "riscv"; reg = <0>; - compatible = "kendryte,k210", "sifive,rocket0", "riscv"; riscv,isa = "rv64imafdc"; - mmu-type = "none"; - i-cache-size = <0x8000>; + mmu-type = "riscv,none"; i-cache-block-size = <64>; - d-cache-size = <0x8000>; + i-cache-size = <0x8000>; d-cache-block-size = <64>; + d-cache-size = <0x8000>; cpu0_intc: interrupt-controller { #interrupt-cells = <1>; interrupt-controller; @@ -46,14 +51,14 @@ cpu0_intc: interrupt-controller { }; cpu1: cpu@1 { device_type = "cpu"; + compatible = "canaan,k210", "riscv"; reg = <1>; - compatible = "kendryte,k210", "sifive,rocket0", "riscv"; riscv,isa = "rv64imafdc"; - mmu-type = "none"; - i-cache-size = <0x8000>; + mmu-type = "riscv,none"; i-cache-block-size = <64>; - d-cache-size = <0x8000>; + i-cache-size = <0x8000>; d-cache-block-size = <64>; + d-cache-size = <0x8000>; cpu1_intc: interrupt-controller { #interrupt-cells = <1>; interrupt-controller; @@ -64,10 +69,15 @@ cpu1_intc: interrupt-controller { sram: memory@80000000 { device_type = "memory"; + compatible = "canaan,k210-sram"; reg = <0x80000000 0x400000>, <0x80400000 0x200000>, <0x80600000 0x200000>; reg-names = "sram0", "sram1", "aisram"; + clocks = <&sysclk K210_CLK_SRAM0>, + <&sysclk K210_CLK_SRAM1>, + <&sysclk K210_CLK_AI>; + clock-names = "sram0", "sram1", "aisram"; }; clocks { @@ -81,40 +91,369 @@ in0: oscillator { soc { #address-cells = <1>; #size-cells = <1>; - compatible = "kendryte,k210-soc", "simple-bus"; + compatible = "simple-bus"; ranges; interrupt-parent = <&plic0>; - sysctl: sysctl@50440000 { - compatible = "kendryte,k210-sysctl", "simple-mfd"; - reg = <0x50440000 0x1000>; - #clock-cells = <1>; + rom0: nvmem@1000 { + reg = <0x1000 0x1000>; + read-only; }; - clint0: clint@2000000 { - #interrupt-cells = <1>; - compatible = "riscv,clint0"; + clint0: timer@2000000 { + compatible = "canaan,k210-clint", "sifive,clint0"; reg = <0x2000000 0xC000>; - interrupts-extended = <&cpu0_intc 3 &cpu0_intc 7 - &cpu1_intc 3 &cpu1_intc 7>; + interrupts-extended = <&cpu0_intc 3 &cpu0_intc 7 + &cpu1_intc 3 &cpu1_intc 7>; }; plic0: interrupt-controller@c000000 { #interrupt-cells = <1>; - interrupt-controller; - compatible = "kendryte,k210-plic0", "riscv,plic0"; + #address-cells = <0>; + compatible = "canaan,k210-plic", "sifive,plic-1.0.0"; reg = <0xC000000 0x4000000>; - interrupts-extended = <&cpu0_intc 11>, <&cpu0_intc 0xffffffff>, - <&cpu1_intc 11>, <&cpu1_intc 0xffffffff>; + interrupt-controller; + interrupts-extended = <&cpu0_intc 11 &cpu1_intc 11>; riscv,ndev = <65>; - riscv,max-priority = <7>; }; uarths0: serial@38000000 { - compatible = "kendryte,k210-uarths", "sifive,uart0"; + compatible = "canaan,k210-uarths", "sifive,uart0"; reg = <0x38000000 0x1000>; interrupts = <33>; - clocks = <&sysctl K210_CLK_CPU>; + clocks = <&sysclk K210_CLK_CPU>; + }; + + gpio0: gpio-controller@38001000 { + #interrupt-cells = <2>; + #gpio-cells = <2>; + compatible = "canaan,k210-gpiohs", "sifive,gpio0"; + reg = <0x38001000 0x1000>; + interrupt-controller; + interrupts = <34 35 36 37 38 39 40 41 + 42 43 44 45 46 47 48 49 + 50 51 52 53 54 55 56 57 + 58 59 60 61 62 63 64 65>; + gpio-controller; + ngpios = <32>; + }; + + dmac0: dma-controller@50000000 { + compatible = "snps,axi-dma-1.01a"; + reg = <0x50000000 0x1000>; + interrupts = <27 28 29 30 31 32>; + #dma-cells = <1>; + clocks = <&sysclk K210_CLK_DMA>, <&sysclk K210_CLK_DMA>; + clock-names = "core-clk", "cfgr-clk"; + resets = <&sysrst K210_RST_DMA>; + dma-channels = <6>; + snps,dma-masters = <2>; + snps,priority = <0 1 2 3 4 5>; + snps,data-width = <5>; + snps,block-size = <0x200000 0x200000 0x200000 + 0x200000 0x200000 0x200000>; + snps,axi-max-burst-len = <256>; + }; + + apb0: bus@50200000 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "simple-pm-bus"; + ranges; + clocks = <&sysclk K210_CLK_APB0>; + + gpio1: gpio@50200000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "snps,dw-apb-gpio"; + reg = <0x50200000 0x80>; + clocks = <&sysclk K210_CLK_APB0>, + <&sysclk K210_CLK_GPIO>; + clock-names = "bus", "db"; + resets = <&sysrst K210_RST_GPIO>; + + gpio1_0: gpio-port@0 { + #gpio-cells = <2>; + #interrupt-cells = <2>; + compatible = "snps,dw-apb-gpio-port"; + reg = <0>; + interrupt-controller; + interrupts = <23>; + gpio-controller; + ngpios = <8>; + }; + }; + + uart1: serial@50210000 { + compatible = "snps,dw-apb-uart"; + reg = <0x50210000 0x100>; + interrupts = <11>; + clocks = <&sysclk K210_CLK_UART1>, + <&sysclk K210_CLK_APB0>; + clock-names = "baudclk", "apb_pclk"; + resets = <&sysrst K210_RST_UART1>; + reg-io-width = <4>; + reg-shift = <2>; + dcd-override; + dsr-override; + cts-override; + ri-override; + }; + + uart2: serial@50220000 { + compatible = "snps,dw-apb-uart"; + reg = <0x50220000 0x100>; + interrupts = <12>; + clocks = <&sysclk K210_CLK_UART2>, + <&sysclk K210_CLK_APB0>; + clock-names = "baudclk", "apb_pclk"; + resets = <&sysrst K210_RST_UART2>; + reg-io-width = <4>; + reg-shift = <2>; + dcd-override; + dsr-override; + cts-override; + ri-override; + }; + + uart3: serial@50230000 { + compatible = "snps,dw-apb-uart"; + reg = <0x50230000 0x100>; + interrupts = <13>; + clocks = <&sysclk K210_CLK_UART3>, + <&sysclk K210_CLK_APB0>; + clock-names = "baudclk", "apb_pclk"; + resets = <&sysrst K210_RST_UART3>; + reg-io-width = <4>; + reg-shift = <2>; + dcd-override; + dsr-override; + cts-override; + ri-override; + }; + + spi2: spi@50240000 { + compatible = "canaan,k210-spi"; + spi-slave; + reg = <0x50240000 0x100>; + #address-cells = <0>; + #size-cells = <0>; + interrupts = <3>; + clocks = <&sysclk K210_CLK_SPI2>, + <&sysclk K210_CLK_APB0>; + clock-names = "ssi_clk", "pclk"; + resets = <&sysrst K210_RST_SPI2>; + spi-max-frequency = <25000000>; + }; + + i2s0: i2s@50250000 { + compatible = "snps,designware-i2s"; + reg = <0x50250000 0x200>; + interrupts = <5>; + clocks = <&sysclk K210_CLK_I2S0>; + clock-names = "i2sclk"; + resets = <&sysrst K210_RST_I2S0>; + }; + + i2s1: i2s@50260000 { + compatible = "snps,designware-i2s"; + reg = <0x50260000 0x200>; + interrupts = <6>; + clocks = <&sysclk K210_CLK_I2S1>; + clock-names = "i2sclk"; + resets = <&sysrst K210_RST_I2S1>; + }; + + i2s2: i2s@50270000 { + compatible = "snps,designware-i2s"; + reg = <0x50270000 0x200>; + interrupts = <7>; + clocks = <&sysclk K210_CLK_I2S2>; + clock-names = "i2sclk"; + resets = <&sysrst K210_RST_I2S2>; + }; + + i2c0: i2c@50280000 { + compatible = "snps,designware-i2c"; + reg = <0x50280000 0x100>; + interrupts = <8>; + clocks = <&sysclk K210_CLK_I2C0>, + <&sysclk K210_CLK_APB0>; + clock-names = "ref", "pclk"; + resets = <&sysrst K210_RST_I2C0>; + }; + + i2c1: i2c@50290000 { + compatible = "snps,designware-i2c"; + reg = <0x50290000 0x100>; + interrupts = <9>; + clocks = <&sysclk K210_CLK_I2C1>, + <&sysclk K210_CLK_APB0>; + clock-names = "ref", "pclk"; + resets = <&sysrst K210_RST_I2C1>; + }; + + i2c2: i2c@502a0000 { + compatible = "snps,designware-i2c"; + reg = <0x502A0000 0x100>; + interrupts = <10>; + clocks = <&sysclk K210_CLK_I2C2>, + <&sysclk K210_CLK_APB0>; + clock-names = "ref", "pclk"; + resets = <&sysrst K210_RST_I2C2>; + }; + + fpioa: pinmux@502b0000 { + compatible = "canaan,k210-fpioa"; + reg = <0x502B0000 0x100>; + clocks = <&sysclk K210_CLK_FPIOA>, + <&sysclk K210_CLK_APB0>; + clock-names = "ref", "pclk"; + resets = <&sysrst K210_RST_FPIOA>; + canaan,k210-sysctl-power = <&sysctl 108>; + }; + + timer0: timer@502d0000 { + compatible = "snps,dw-apb-timer"; + reg = <0x502D0000 0x100>; + interrupts = <14 15>; + clocks = <&sysclk K210_CLK_TIMER0>, + <&sysclk K210_CLK_APB0>; + clock-names = "timer", "pclk"; + resets = <&sysrst K210_RST_TIMER0>; + }; + + timer1: timer@502e0000 { + compatible = "snps,dw-apb-timer"; + reg = <0x502E0000 0x100>; + interrupts = <16 17>; + clocks = <&sysclk K210_CLK_TIMER1>, + <&sysclk K210_CLK_APB0>; + clock-names = "timer", "pclk"; + resets = <&sysrst K210_RST_TIMER1>; + }; + + timer2: timer@502f0000 { + compatible = "snps,dw-apb-timer"; + reg = <0x502F0000 0x100>; + interrupts = <18 19>; + clocks = <&sysclk K210_CLK_TIMER2>, + <&sysclk K210_CLK_APB0>; + clock-names = "timer", "pclk"; + resets = <&sysrst K210_RST_TIMER2>; + }; + }; + + apb1: bus@50400000 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "simple-pm-bus"; + ranges; + clocks = <&sysclk K210_CLK_APB1>; + + wdt0: watchdog@50400000 { + compatible = "snps,dw-wdt"; + reg = <0x50400000 0x100>; + interrupts = <21>; + clocks = <&sysclk K210_CLK_WDT0>, + <&sysclk K210_CLK_APB1>; + clock-names = "tclk", "pclk"; + resets = <&sysrst K210_RST_WDT0>; + }; + + wdt1: watchdog@50410000 { + compatible = "snps,dw-wdt"; + reg = <0x50410000 0x100>; + interrupts = <22>; + clocks = <&sysclk K210_CLK_WDT1>, + <&sysclk K210_CLK_APB1>; + clock-names = "tclk", "pclk"; + resets = <&sysrst K210_RST_WDT1>; + }; + + sysctl: syscon@50440000 { + compatible = "canaan,k210-sysctl", + "syscon", "simple-mfd"; + reg = <0x50440000 0x100>; + clocks = <&sysclk K210_CLK_APB1>; + clock-names = "pclk"; + + sysclk: clock-controller { + #clock-cells = <1>; + compatible = "canaan,k210-clk"; + clocks = <&in0>; + }; + + sysrst: reset-controller { + compatible = "canaan,k210-rst"; + #reset-cells = <1>; + }; + + reboot: syscon-reboot { + compatible = "syscon-reboot"; + regmap = <&sysctl>; + offset = <48>; + mask = <1>; + value = <1>; + }; + }; + }; + + apb2: bus@52000000 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "simple-pm-bus"; + ranges; + clocks = <&sysclk K210_CLK_APB2>; + + spi0: spi@52000000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "canaan,k210-spi"; + reg = <0x52000000 0x100>; + interrupts = <1>; + clocks = <&sysclk K210_CLK_SPI0>, + <&sysclk K210_CLK_APB2>; + clock-names = "ssi_clk", "pclk"; + resets = <&sysrst K210_RST_SPI0>; + reset-names = "spi"; + spi-max-frequency = <25000000>; + num-cs = <4>; + reg-io-width = <4>; + }; + + spi1: spi@53000000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "canaan,k210-spi"; + reg = <0x53000000 0x100>; + interrupts = <2>; + clocks = <&sysclk K210_CLK_SPI1>, + <&sysclk K210_CLK_APB2>; + clock-names = "ssi_clk", "pclk"; + resets = <&sysrst K210_RST_SPI1>; + reset-names = "spi"; + spi-max-frequency = <25000000>; + num-cs = <4>; + reg-io-width = <4>; + }; + + spi3: spi@54000000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "snps,dwc-ssi-1.01a"; + reg = <0x54000000 0x200>; + interrupts = <4>; + clocks = <&sysclk K210_CLK_SPI3>, + <&sysclk K210_CLK_APB2>; + clock-names = "ssi_clk", "pclk"; + resets = <&sysrst K210_RST_SPI3>; + reset-names = "spi"; + /* Could possibly go up to 200 MHz */ + spi-max-frequency = <100000000>; + num-cs = <4>; + reg-io-width = <4>; + }; }; }; }; diff --git a/arch/riscv/boot/dts/canaan/k210_generic.dts b/arch/riscv/boot/dts/canaan/k210_generic.dts new file mode 100644 index 000000000000..396c8ca4d24d --- /dev/null +++ b/arch/riscv/boot/dts/canaan/k210_generic.dts @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019-20 Sean Anderson + * Copyright (C) 2020 Western Digital Corporation or its affiliates. + */ + +/dts-v1/; + +#include "k210.dtsi" + +#include +#include + +/ { + model = "Kendryte K210 generic"; + compatible = "canaan,kendryte-k210"; + + chosen { + bootargs = "earlycon console=ttySIF0"; + stdout-path = "serial0:115200n8"; + }; +}; + +&fpioa { + pinctrl-0 = <&jtag_pins>; + pinctrl-names = "default"; + status = "okay"; + + jtag_pins: jtag-pinmux { + pinmux = , + , + , + ; + }; + + uarths_pins: uarths-pinmux { + pinmux = , + ; + }; +}; + +&uarths0 { + pinctrl-0 = <&uarths_pins>; + pinctrl-names = "default"; + status = "okay"; +}; diff --git a/include/dt-bindings/clock/k210-clk.h b/include/dt-bindings/clock/k210-clk.h index a48176ad3c23..b2de702cbf75 100644 --- a/include/dt-bindings/clock/k210-clk.h +++ b/include/dt-bindings/clock/k210-clk.h @@ -9,7 +9,6 @@ /* * Kendryte K210 SoC clock identifiers (arbitrary values). */ -#define K210_CLK_ACLK 0 #define K210_CLK_CPU 0 #define K210_CLK_SRAM0 1 #define K210_CLK_SRAM1 2 From patchwork Tue Feb 9 12:30:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 12077911 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55E7FC433DB for ; Tue, 9 Feb 2021 12:30:52 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EA5F764EB4 for ; Tue, 9 Feb 2021 12:30:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EA5F764EB4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=kyJkw6Oi3P5hdG8bSy+l8cXZWsuDYdtzJqyfRpvymZ0=; b=MkrbhSNBo5Bav6N6jho879uka bM2F9k70ZnL2E735GVh7cogt24umf5+YxZYL2aPOzosOxLD+6hizke1nHLC30GLvPqqrU55EkbuQG D3pXyXCXkZ0yEHshIWzPM37iYE5a9Uo2nZwLPuCe970eOOY4SL1Ea74/2qW8syO2qnDzTXWPomoCB mOCac0ydnPWYqyztf/ynotLSTFkB9jojPd/1uuTKWKpbpQoZYbj6Y6BOY+Qxq+bMQOWtbjqAJbdhP jXm6HKrfhZflmjJYeWMcu6taiTSC3F7XHY+Wj3WtjRDKecTcC0DijfFCYME43EFjrDuUqQXs+sGe3 O+8kybovg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9SAF-0008FY-Ai; Tue, 09 Feb 2021 12:30:43 +0000 Received: from esa6.hgst.iphmx.com ([216.71.154.45]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9SA6-00087n-UQ for linux-riscv@lists.infradead.org; Tue, 09 Feb 2021 12:30:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612873835; x=1644409835; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dssAasnlmfor/Cbkf8o5BdfkI5FZbW8aYzSRkDzZcpE=; b=r8P49/pdXRyKsVDJDfRW4gsqGyMnkta5ZDjDMSua6rDjI8h0erK2CEYR YA/vxL1WUdTy24r98szEL6ssDRMG1f9JzfX0jLrLnmT5VYp96ViubVKBD IUL/c4WkMAFY1xyEs9MY9eJJ0tmPkw/tP6PYSkHt5Ne2lNCmFEpRKJpFU 0gzJ0BT3IkpgDX06TFYUk0wPfEHLllc0XWiR19AyWzH/NO3yWLx/hTabb zUXs2jRYdUuC+0y8ZtA48ODkskEfmFPzSELk+A6HhX2lhhTo3cLAwT1S2 WHziPqPCmDvup3cKn9ewAqYS1QdZFZcZfJZAmsE/t8fC8qmzngFq0L6cy Q==; IronPort-SDR: lEunPffiyexNoUNQ94aNfETPDFM+N5fS6gEVcOIfM0CxjoZSsO7qTalcnfW/+nkChu3GWgvri6 20KIFEs9ST0w0vVXjCJPMzF0+/YbbljaxHVYWlmULhtZ5Kbze6xJwG6YCIFnmmLr1Ir+6MXJZY DGZn/clVf79Cyr3BeCyr3i5avCKzm0jl8Xa7kD2VJUQXLVSZ6P+a1Qk3o6Lcsx50MaczKYs3lg yaxienmieEmu6FWQwTK1Vmv+lvlbX2Ow/kU1RD8xB/Wv2gvKi9KvbVUbbHCslnEMrgoIQhLQiT 2Dg= X-IronPort-AV: E=Sophos;i="5.81,164,1610380800"; d="scan'208";a="160707569" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 09 Feb 2021 20:30:35 +0800 IronPort-SDR: p137cBtS0v7FIIQ+IH8eHmujsmH3pWIa2bIfwWXp9Jkv4y/Egqkfkxzp6iLxjkY9DsDFp3hfuR zKOZjBiVmN4qb7rIirTtzBh6Fs9ZbGASgjxlO9u5zAmAWM6ISougN/hFr2cC+MZbAL9qH+6rS+ XFptycTHPofJwiVK0AR0KY0YFP7B4BEUWooZkVrV8CtrFOv5oubAujuJ7uAwpy3lM6D3pMg8WD c5sMXo0s6brjkr1Xg0cHqeGSz2TXESRlIov6Bxa7J4favbiNDEYsU1o5gwxQ1L2t07aDNzHc0g 6dXiT5Fdf3MZMLQ0A7fk+6Gm Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2021 04:12:28 -0800 IronPort-SDR: elaWvTWtTLGnjXT+TBrcbpgIgncS6M7lLQE0f2g+6ZoHPUEqV1AW3l7eXJ8emk3Xh1LpJENDee QZXsaTF+p22u58XJnZs2vVa44MOyGhnUcwTwx4rna9ANflQVfnqpPey/9R6kVcfhsQ5kPymcWF yfz1FIxLV+HsgvJaW5I2A6dwFR/cEQ9z/JRYqa3e1MVckXICCK9FR9KjsxFty0+mgPdsSUy0JA bkC1Cq5PVRp1HtAq+TnWtRHnSmO3d19PtzyFADqXnGKXhRJT01yInVEpGs/Zb5zj4htvRlUs4A Lo8= WDCIronportException: Internal Received: from phd004806.ad.shared (HELO twashi.fujisawa.hgst.com) ([10.84.71.69]) by uls-op-cesaip01.wdc.com with ESMTP; 09 Feb 2021 04:30:34 -0800 From: Damien Le Moal To: Palmer Dabbelt , linux-riscv@lists.infradead.org Subject: [PATCH v18 10/16] riscv: Add SiPeed MAIX BiT board device tree Date: Tue, 9 Feb 2021 21:30:08 +0900 Message-Id: <20210209123014.165928-11-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210209123014.165928-1-damien.lemoal@wdc.com> References: <20210209123014.165928-1-damien.lemoal@wdc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210209_073035_238921_6FC74618 X-CRM114-Status: GOOD ( 14.07 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Atish Patra , devicetree@vger.kernel.org, Anup Patel , Rob Herring , Sean Anderson Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add the device tree sipeed_maix_bit.dts for the SiPeed MAIX BiT and MAIX BiTm boards. This device tree enables LEDs, gpio, i2c and spi/mmc SD card devices. Cc: Rob Herring Cc: devicetree@vger.kernel.org Signed-off-by: Damien Le Moal --- .../riscv/boot/dts/canaan/sipeed_maix_bit.dts | 229 ++++++++++++++++++ 1 file changed, 229 insertions(+) create mode 100644 arch/riscv/boot/dts/canaan/sipeed_maix_bit.dts diff --git a/arch/riscv/boot/dts/canaan/sipeed_maix_bit.dts b/arch/riscv/boot/dts/canaan/sipeed_maix_bit.dts new file mode 100644 index 000000000000..9335fb24168f --- /dev/null +++ b/arch/riscv/boot/dts/canaan/sipeed_maix_bit.dts @@ -0,0 +1,229 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019-20 Sean Anderson + * Copyright (C) 2020 Western Digital Corporation or its affiliates. + */ + +/dts-v1/; + +#include "k210.dtsi" + +#include +#include +#include + +/ { + model = "SiPeed MAIX BiT"; + compatible = "sipeed,maix-bit", "sipeed,maix-bitm", + "canaan,kendryte-k210"; + + chosen { + bootargs = "earlycon console=ttySIF0"; + stdout-path = "serial0:115200n8"; + }; + + gpio-leds { + compatible = "gpio-leds"; + + led0 { + color = ; + label = "green"; + gpios = <&gpio1_0 4 GPIO_ACTIVE_LOW>; + }; + + led1 { + color = ; + label = "red"; + gpios = <&gpio1_0 5 GPIO_ACTIVE_LOW>; + }; + + led2 { + color = ; + label = "blue"; + gpios = <&gpio1_0 6 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-keys { + compatible = "gpio-keys"; + + boot { + label = "BOOT"; + linux,code = ; + gpios = <&gpio0 0 GPIO_ACTIVE_LOW>; + }; + }; + + sound { + compatible = "simple-audio-card"; + simple-audio-card,format = "i2s"; + status = "disabled"; + + simple-audio-card,cpu { + sound-dai = <&i2s0 0>; + }; + + simple-audio-card,codec { + sound-dai = <&mic>; + }; + }; + + mic: mic { + #sound-dai-cells = <0>; + compatible = "memsensing,msm261s4030h0"; + status = "disabled"; + }; +}; + +&fpioa { + pinctrl-names = "default"; + pinctrl-0 = <&jtag_pinctrl>; + status = "okay"; + + jtag_pinctrl: jtag-pinmux { + pinmux = , + , + , + ; + }; + + uarths_pinctrl: uarths-pinmux { + pinmux = , + ; + }; + + gpio_pinctrl: gpio-pinmux { + pinmux = , + , + , + , + , + , + , + ; + }; + + gpiohs_pinctrl: gpiohs-pinmux { + pinmux = , + , + , + , + , + , + , + , + , + , + ; + }; + + i2s0_pinctrl: i2s0-pinmux { + pinmux = , + , + ; + }; + + dvp_pinctrl: dvp-pinmux { + pinmux = , + , + , + , + , + , + , + ; + }; + + spi0_pinctrl: spi0-pinmux { + pinmux = , /* cs */ + , /* rst */ + , /* dc */ + ; /* wr */ + }; + + spi1_pinctrl: spi1-pinmux { + pinmux = , + , + , + ; /* cs */ + }; + + i2c1_pinctrl: i2c1-pinmux { + pinmux = , + ; + }; +}; + +&uarths0 { + pinctrl-0 = <&uarths_pinctrl>; + pinctrl-names = "default"; + status = "okay"; +}; + +&gpio0 { + pinctrl-0 = <&gpiohs_pinctrl>; + pinctrl-names = "default"; + status = "okay"; +}; + +&gpio1 { + pinctrl-0 = <&gpio_pinctrl>; + pinctrl-names = "default"; + status = "okay"; +}; + +&i2s0 { + #sound-dai-cells = <1>; + pinctrl-0 = <&i2s0_pinctrl>; + pinctrl-names = "default"; +}; + +&i2c1 { + pinctrl-0 = <&i2c1_pinctrl>; + pinctrl-names = "default"; + clock-frequency = <400000>; + status = "okay"; +}; + +&spi0 { + pinctrl-0 = <&spi0_pinctrl>; + pinctrl-names = "default"; + num-cs = <1>; + cs-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>; + + panel@0 { + compatible = "sitronix,st7789v"; + reg = <0>; + reset-gpios = <&gpio0 21 GPIO_ACTIVE_LOW>; + dc-gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>; + spi-max-frequency = <15000000>; + spi-cs-high; + status = "disabled"; + }; +}; + +&spi1 { + pinctrl-0 = <&spi1_pinctrl>; + pinctrl-names = "default"; + num-cs = <1>; + cs-gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + status = "okay"; + + slot@0 { + compatible = "mmc-spi-slot"; + reg = <0>; + voltage-ranges = <3300 3300>; + spi-max-frequency = <25000000>; + broken-cd; + }; +}; + +&spi3 { + spi-flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + m25p,fast-read; + broken-flash-reset; + }; +}; From patchwork Tue Feb 9 12:30:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 12077915 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96C69C433DB for ; Tue, 9 Feb 2021 12:30:55 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3923564EB4 for ; Tue, 9 Feb 2021 12:30:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3923564EB4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2X5SeEeFfOGNeS4DRqlXpnC4atQ8zQaNTgXLGMqen8Y=; b=g/ShDc1IDMkaV+ssCTn/CS63k nqMGq+gggaqCMwCu3Xb3ovPlgcdBoyWd8c6YfZW1tE4kIdimKO/6jv15DpLpDHLDFJ0hn/7ZmfSLE 1GGv6b5bVdsKjmwWuZQaMQ+I7jYRosPmtkox3WTOD/CjJWYddxtjdbjJTjHXzaGBoReS6+aZofqPx GkdZOG57FVf1CLAvvvwNWRhl6co1vEfpxPeQ/jwD/FRZy/fXw34jCKXThc2y80IpyAPNQmkBWaZrV RjF5gfO7VuOxb5mcV+LBbuN8/iTIxGKN2qNCoXriE+4GeTe+HfS6MeTbCWCIIgX5tYa5kvDpQH9fA 1DFd2XqXQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9SAI-0008Hh-RU; Tue, 09 Feb 2021 12:30:46 +0000 Received: from esa6.hgst.iphmx.com ([216.71.154.45]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9SA8-00088v-Lf for linux-riscv@lists.infradead.org; Tue, 09 Feb 2021 12:30:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612873837; x=1644409837; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xTAvJyEEVSfpdorhPl1k1ou8mFV/SXaVVbUyBuCbTbk=; b=fk5I2pUft3GXxxKYJqsEG3eONJcxsPfyz8OLJZ9XO3YBlHm5o9S/c01S BIUPJYBtbJQNzEdoFO2JJCFZeSZIW0pCXMrpl7ix/rlg3B9tdJvFcVo5F tZAUy4rFOPIO+MiRYUzVmuX6lYvuZbINYF7VIKy9BAVvgfGfr87HE5me8 rSKmIIqnDzOiRlcHAJiCyWGWIKynHLCsE/ERhqR5Ve1osmUjlBafRQZh4 zV4jQdCJsMPKb6vCiXYDmm11ZtdIfDyCKCUNnlS1vqXp9fMd5V2cmPnJg UnY5AgboTwh6SK7FpG397ZvffSCOU7iAp6RnGWiwEAdjukccWha82Gi74 g==; IronPort-SDR: mKYj0PJ2f8nc4Do4F+RryeCv8KPPQkTE5M4cT0M0oWY/VxwHgTS4LQOIShIweRVZJsQyw2rIDS Ri7PWCw9oXwTerUo31auYAAJmpXA5/cTweLEL1bH9el+k6dUc1JV+2BPfm7PcgPHyF7JmiEgVu T8by/6LQQnEadwFH8mVw6DXM6lcZYPOm4U+eWaoIPZRX7GPZCijS4EpKR1sN9KYm0ktPX/qyjk vk8P3MVpUkipTQ4brTLlUeriELh7RZAmkYlxpQedMKITSzC6/2rokkT5JWSCOOw7ho0uw4omrm Rak= X-IronPort-AV: E=Sophos;i="5.81,164,1610380800"; d="scan'208";a="160707571" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 09 Feb 2021 20:30:36 +0800 IronPort-SDR: rGILzJvJS4iUFBD1K3yK+iPAx74/xrrZi59Mh+FUdDheVzVYxg4lbxJUpqLnCto0hB7zwlCUVH hbouCLuIVJ1SQCr308vRO0GmDl3OGD/RmnmV5VyjsvpLEAweCwYA98FlpqFTMWD0qIRQOfwbJu ckbgqH3vqKBmbib5YmhRxH+DEDkKcWt3tQGDskkz4FZbgtj2gHT2nmSAMyjZdO2V8rzQDUDLy/ ci9ol/gkeMzhrY9GBPuSJDb+YrAPahkHY7G3rWgtsxQesT2siSmTd6HBXcF2C5P/xlLKuqrEyf hYs2L680WhTAgF9WJlO1SciT Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2021 04:12:30 -0800 IronPort-SDR: uwwi7/pAPazmZsydojza7L/ac2A56GWTq+ZtFMxAnGPxcyI2XtMPH0KE298PoU6/L1ywwPDTbn EQWNrsbLPbNabRv9LrVM+0x6msULARZK1XmU1wzqeBpQmAKa7yMIwvBkLc1Cmgn/yJvIC94bs/ eq30UFQ6qYc4AIy5tYoivGNr0FGqqhN3EZ8X4OeEihRATjP32Fk6yQTHkF33Dn3DHvpkRa/lPR tPVOCZAstiG3SX5DQ0w74MpHnKdI9XTjqJv07Mr4mMiZgXhQj0d7Pe0TCPvE8JG1cl+phpFhM5 Rx8= WDCIronportException: Internal Received: from phd004806.ad.shared (HELO twashi.fujisawa.hgst.com) ([10.84.71.69]) by uls-op-cesaip01.wdc.com with ESMTP; 09 Feb 2021 04:30:35 -0800 From: Damien Le Moal To: Palmer Dabbelt , linux-riscv@lists.infradead.org Subject: [PATCH v18 11/16] riscv: Add SiPeed MAIX DOCK board device tree Date: Tue, 9 Feb 2021 21:30:09 +0900 Message-Id: <20210209123014.165928-12-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210209123014.165928-1-damien.lemoal@wdc.com> References: <20210209123014.165928-1-damien.lemoal@wdc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210209_073036_989668_C704C73F X-CRM114-Status: GOOD ( 14.85 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Atish Patra , devicetree@vger.kernel.org, Anup Patel , Rob Herring , Sean Anderson Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add the device tree sipeed_maix_dock.dts for the SiPeed MAIX DOCK m1 and m1w boards. This device tree enables LEDs, gpio, i2c and spi/mmc SD card devices. Cc: Rob Herring Cc: devicetree@vger.kernel.org Signed-off-by: Damien Le Moal --- .../boot/dts/canaan/sipeed_maix_dock.dts | 231 ++++++++++++++++++ 1 file changed, 231 insertions(+) create mode 100644 arch/riscv/boot/dts/canaan/sipeed_maix_dock.dts diff --git a/arch/riscv/boot/dts/canaan/sipeed_maix_dock.dts b/arch/riscv/boot/dts/canaan/sipeed_maix_dock.dts new file mode 100644 index 000000000000..72c995a321ee --- /dev/null +++ b/arch/riscv/boot/dts/canaan/sipeed_maix_dock.dts @@ -0,0 +1,231 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019-20 Sean Anderson + * Copyright (C) 2020 Western Digital Corporation or its affiliates. + */ + +/dts-v1/; + +#include "k210.dtsi" + +#include +#include +#include + +/ { + model = "SiPeed MAIX Dock"; + compatible = "sipeed,maix-dock-m1", "sipeed,maix-dock-m1w", + "canaan,kendryte-k210"; + + chosen { + bootargs = "earlycon console=ttySIF0"; + stdout-path = "serial0:115200n8"; + }; + + gpio-leds { + compatible = "gpio-leds"; + + /* + * Note: the board wiring drawing documents green on + * gpio #4, red on gpio #5 and blue on gpio #6. However, + * the board is actually wired differently as defined here. + */ + led0 { + color = ; + label = "blue"; + gpios = <&gpio1_0 4 GPIO_ACTIVE_LOW>; + }; + + led1 { + color = ; + label = "green"; + gpios = <&gpio1_0 5 GPIO_ACTIVE_LOW>; + }; + + led2 { + color = ; + label = "red"; + gpios = <&gpio1_0 6 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-keys { + compatible = "gpio-keys"; + + boot { + label = "BOOT"; + linux,code = ; + gpios = <&gpio0 0 GPIO_ACTIVE_LOW>; + }; + }; + + sound { + compatible = "simple-audio-card"; + simple-audio-card,format = "i2s"; + status = "disabled"; + + simple-audio-card,cpu { + sound-dai = <&i2s0 0>; + }; + + simple-audio-card,codec { + sound-dai = <&mic>; + }; + }; + + mic: mic { + #sound-dai-cells = <0>; + compatible = "memsensing,msm261s4030h0"; + status = "disabled"; + }; +}; + +&fpioa { + pinctrl-0 = <&jtag_pinctrl>; + pinctrl-names = "default"; + status = "okay"; + + jtag_pinctrl: jtag-pinmux { + pinmux = , + , + , + ; + }; + + uarths_pinctrl: uarths-pinmux { + pinmux = , + ; + }; + + gpio_pinctrl: gpio-pinmux { + pinmux = , + , + , + , + , + ; + }; + + gpiohs_pinctrl: gpiohs-pinmux { + pinmux = , + , + , + , + , + , + , + , + , + , + ; + }; + + i2s0_pinctrl: i2s0-pinmux { + pinmux = , + , + ; + }; + + dvp_pinctrl: dvp-pinmux { + pinmux = , + , + , + , + , + , + , + ; + }; + + spi0_pinctrl: spi0-pinmux { + pinmux = , /* cs */ + , /* rst */ + , /* dc */ + ; /* wr */ + }; + + spi1_pinctrl: spi1-pinmux { + pinmux = , + , + , + ; /* cs */ + }; + + i2c1_pinctrl: i2c1-pinmux { + pinmux = , + ; + }; +}; + +&uarths0 { + pinctrl-0 = <&uarths_pinctrl>; + pinctrl-names = "default"; + status = "okay"; +}; + +&gpio0 { + pinctrl-0 = <&gpiohs_pinctrl>; + pinctrl-names = "default"; + status = "okay"; +}; + +&gpio1 { + pinctrl-0 = <&gpio_pinctrl>; + pinctrl-names = "default"; + status = "okay"; +}; + +&i2s0 { + #sound-dai-cells = <1>; + pinctrl-0 = <&i2s0_pinctrl>; + pinctrl-names = "default"; +}; + +&i2c1 { + pinctrl-0 = <&i2c1_pinctrl>; + pinctrl-names = "default"; + clock-frequency = <400000>; + status = "okay"; +}; + +&spi0 { + pinctrl-0 = <&spi0_pinctrl>; + pinctrl-names = "default"; + num-cs = <1>; + cs-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>; + + panel@0 { + compatible = "sitronix,st7789v"; + reg = <0>; + reset-gpios = <&gpio0 21 GPIO_ACTIVE_LOW>; + dc-gpios = <&gpio0 22 0>; + spi-max-frequency = <15000000>; + status = "disabled"; + }; +}; + +&spi1 { + pinctrl-0 = <&spi1_pinctrl>; + pinctrl-names = "default"; + num-cs = <1>; + cs-gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + status = "okay"; + + slot@0 { + compatible = "mmc-spi-slot"; + reg = <0>; + voltage-ranges = <3300 3300>; + spi-max-frequency = <25000000>; + broken-cd; + }; +}; + +&spi3 { + spi-flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + m25p,fast-read; + broken-flash-reset; + }; +}; From patchwork Tue Feb 9 12:30:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 12077917 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B26AC433E6 for ; Tue, 9 Feb 2021 12:30:57 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9FC5E64EBA for ; Tue, 9 Feb 2021 12:30:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9FC5E64EBA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=JjkXLHOFFFrQyUuwBeIrVDblfRdpWwa6aedpUKwqxdY=; b=EZDFk6RE/fB+5QyKddf8jwOm6 Qjr1vuzG8G+VhosVenvDNCTUKPx3vMWi0hyvh6T6d5BSVCvmXzpYeGzJo0TRfg/KgIx/og2og3rYX yxJ5i+u9+z5Ed1uz+6nwTzjbCZULN3Bt4GXZfq9gzW2Cv/R3CxBTmu76LoiX9yuhKBlYcF9ZuglUw nvO69m7PM9YN7J7P2eYvLv0mzY/K4ow6NH++xwqAt5D3IB/zLvMrIMtA8zy2nCVq60SyKusOmN1P9 /vhRHexdHVGC1MrxAotBSNGwDZGWmRORg9gL3qrbvFgEZNCF6axLR/vJ27PSRQCtO7K6whhzIvQfv DPrDOfAeA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9SAK-0008J0-Jf; Tue, 09 Feb 2021 12:30:48 +0000 Received: from esa6.hgst.iphmx.com ([216.71.154.45]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9SAA-00087n-21 for linux-riscv@lists.infradead.org; Tue, 09 Feb 2021 12:30:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612873838; x=1644409838; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VeIT9lBl1ssu47fH2BnWJYeiIVO+kfCriZYH2x0yARQ=; b=gcgb273VcHRxhqdJEUJMp8uP1lwpvAdVZK3ciZHBAU+O9HwJcWraBQ1q Fm4TWiegtMR38997jsWN5AAurS/qiNZniwVLyGkejJhVM6quUQmfAOmj/ p/0PyaZC+47ghgGjLFVWt5vyTgBEks6tYimExBckL9mhhQZh/jCy8nWpf ILA+JkiGHNqhAtH6sH8ohqkuilW3tTcLbWdXNYSsbn59UfpqidX05jH8c vkE/nxeWTxcaJlvyC5oc4tD9tU9VEoGAND2rpLpvDJr/rDgt6JbZhoJNV hDea6fT+MHOCmA1HvWqWSYTWfMuA5ctYi+DIFdgga/xi2DzQryDlkgVKI g==; IronPort-SDR: UWT1jc1ARwRBa/xRW/t1eE82FmVk3DszisVz7pCY+nz6FKZpY2XYdv6Q9jGSSV5eM9jPphIPj5 DFW52BRr6cK+sDaIQnRj3HMhMtWJQY+Y1xKHe8U0pkhXAx48ccUnkr4R4/6rAf8nud6g7RF3dz uaEFhb3cctNxWxb6xKaq3EUv4gYPpyOeF5mKnP1YRu4oMKjiU/Ysyl34vk9JXgZFlwJd5HvhfM tVLQhgPcC791pHB+vFgkDbxJHv2lQeyOshkbrMK7pbGTnyet1zBu9nJYshCecQQnIR5E7EQJgP aHM= X-IronPort-AV: E=Sophos;i="5.81,164,1610380800"; d="scan'208";a="160707575" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 09 Feb 2021 20:30:38 +0800 IronPort-SDR: 4pHy5brytfUnOhQqTbxbIrcsXqMp1xLBBF2Qv3rq9OVt5DYQuowGq/Z2DYanGS2Qm1mMx2PIk3 urMSiFl5qVARnMVoPpwYLxz59PnEJskK+f7CXWVLkz2Ftbl0zIIEFK4g20AAetW+QhPsXO0rEA FB5sKWZGQZW1C+ewGIWhXK0Dv7RK/KSl9U/ASTaIUXmd1C+XFiybTv6FyJ0qwObjRwznneI2rJ Lnlwsne2UXQQbLFdc5ILo90V7CcMAuzykp1dC1UWt0sfmWLlDn4jNGh0NrmLTDG4SVnQRh9igd B8LnUAyE1JEJEPFpcFTERkol Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2021 04:12:31 -0800 IronPort-SDR: Y5X2Ko5Eh6CCk0roaPhDbJGIH2G3OzFV+fY0ZRg8rs3M0ZkTzM+qIHNx3ZgjhtJYrNvX3aFQWe j8mvELLF8OPvqmqWZCE45L4sDVy9gegHM6JQdZkXpJy8Mh2331BC0BgBXVRrssz2eX//JIsKXt qIhsFcsTm66jykjHLS6EZs2+zbwmeM2QhseHL8TjBrvf3sCmikuMDfunBSLY2VPsamSWlWdxFz c8P3xPbSSbiwJOiPVik1S3tmtMpLC5SaOQ5A/1ybDOTQkS0aiU4O8UnY0BcsrjdV+WtUMIUhZq yto= WDCIronportException: Internal Received: from phd004806.ad.shared (HELO twashi.fujisawa.hgst.com) ([10.84.71.69]) by uls-op-cesaip01.wdc.com with ESMTP; 09 Feb 2021 04:30:37 -0800 From: Damien Le Moal To: Palmer Dabbelt , linux-riscv@lists.infradead.org Subject: [PATCH v18 12/16] riscv: Add SiPeed MAIX GO board device tree Date: Tue, 9 Feb 2021 21:30:10 +0900 Message-Id: <20210209123014.165928-13-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210209123014.165928-1-damien.lemoal@wdc.com> References: <20210209123014.165928-1-damien.lemoal@wdc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210209_073038_325826_3D3AC468 X-CRM114-Status: GOOD ( 14.22 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Atish Patra , devicetree@vger.kernel.org, Anup Patel , Rob Herring , Sean Anderson Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add the device tree sipeed_maix_go.dts for the SiPeed MAIX GO board. This device tree enables buttons, LEDs, gpio, i2c and spi/mmc SD card devices. Cc: Rob Herring Cc: devicetree@vger.kernel.org Signed-off-by: Damien Le Moal --- arch/riscv/boot/dts/canaan/sipeed_maix_go.dts | 239 ++++++++++++++++++ 1 file changed, 239 insertions(+) create mode 100644 arch/riscv/boot/dts/canaan/sipeed_maix_go.dts diff --git a/arch/riscv/boot/dts/canaan/sipeed_maix_go.dts b/arch/riscv/boot/dts/canaan/sipeed_maix_go.dts new file mode 100644 index 000000000000..f618064570bf --- /dev/null +++ b/arch/riscv/boot/dts/canaan/sipeed_maix_go.dts @@ -0,0 +1,239 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019-20 Sean Anderson + * Copyright (C) 2020 Western Digital Corporation or its affiliates. + */ + +/dts-v1/; + +#include "k210.dtsi" + +#include +#include +#include + +/ { + model = "SiPeed MAIX GO"; + compatible = "sipeed,maix-go", "canaan,kendryte-k210"; + + chosen { + bootargs = "earlycon console=ttySIF0"; + stdout-path = "serial0:115200n8"; + }; + + gpio-leds { + compatible = "gpio-leds"; + + led0 { + color = ; + label = "green"; + gpios = <&gpio1_0 4 GPIO_ACTIVE_LOW>; + }; + + led1 { + color = ; + label = "red"; + gpios = <&gpio1_0 5 GPIO_ACTIVE_LOW>; + }; + + led2 { + color = ; + label = "blue"; + gpios = <&gpio1_0 6 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-keys { + compatible = "gpio-keys"; + + up { + label = "UP"; + linux,code = ; + gpios = <&gpio1_0 7 GPIO_ACTIVE_LOW>; + }; + + press { + label = "PRESS"; + linux,code = ; + gpios = <&gpio0 0 GPIO_ACTIVE_LOW>; + }; + + down { + label = "DOWN"; + linux,code = ; + gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; + }; + }; + + sound { + compatible = "simple-audio-card"; + simple-audio-card,format = "i2s"; + status = "disabled"; + + simple-audio-card,cpu { + sound-dai = <&i2s0 0>; + }; + + simple-audio-card,codec { + sound-dai = <&mic>; + }; + }; + + mic: mic { + #sound-dai-cells = <0>; + compatible = "memsensing,msm261s4030h0"; + status = "disabled"; + }; +}; + +&fpioa { + pinctrl-0 = <&jtag_pinctrl>; + pinctrl-names = "default"; + status = "okay"; + + jtag_pinctrl: jtag-pinmux { + pinmux = , + , + , + ; + }; + + uarths_pinctrl: uarths-pinmux { + pinmux = , + ; + }; + + gpio_pinctrl: gpio-pinmux { + pinmux = , + , + , + , + , + , + , + ; + }; + + gpiohs_pinctrl: gpiohs-pinmux { + pinmux = , + , + , + , + , + , + , + , + , + , + ; + }; + + i2s0_pinctrl: i2s0-pinmux { + pinmux = , + , + ; + }; + + dvp_pinctrl: dvp-pinmux { + pinmux = , + , + , + , + , + , + , + ; + }; + + spi0_pinctrl: spi0-pinmux { + pinmux = , /* cs */ + , /* rst */ + , /* dc */ + ; /* wr */ + }; + + spi1_pinctrl: spi1-pinmux { + pinmux = , + , + , + ; /* cs */ + }; + + i2c1_pinctrl: i2c1-pinmux { + pinmux = , + ; + }; +}; + +&uarths0 { + pinctrl-0 = <&uarths_pinctrl>; + pinctrl-names = "default"; + status = "okay"; +}; + +&gpio0 { + pinctrl-0 = <&gpiohs_pinctrl>; + pinctrl-names = "default"; + status = "okay"; +}; + +&gpio1 { + pinctrl-0 = <&gpio_pinctrl>; + pinctrl-names = "default"; + status = "okay"; +}; + +&i2s0 { + #sound-dai-cells = <1>; + pinctrl-0 = <&i2s0_pinctrl>; + pinctrl-names = "default"; +}; + +&i2c1 { + pinctrl-0 = <&i2c1_pinctrl>; + pinctrl-names = "default"; + clock-frequency = <400000>; + status = "okay"; +}; + +&spi0 { + pinctrl-0 = <&spi0_pinctrl>; + pinctrl-names = "default"; + num-cs = <1>; + cs-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>; + + panel@0 { + compatible = "sitronix,st7789v"; + reg = <0>; + reset-gpios = <&gpio0 21 GPIO_ACTIVE_LOW>; + dc-gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>; + spi-max-frequency = <15000000>; + status = "disabled"; + }; +}; + +&spi1 { + pinctrl-0 = <&spi1_pinctrl>; + pinctrl-names = "default"; + num-cs = <1>; + cs-gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + status = "okay"; + + slot@0 { + compatible = "mmc-spi-slot"; + reg = <0>; + voltage-ranges = <3300 3300>; + spi-max-frequency = <25000000>; + broken-cd; + }; +}; + +&spi3 { + spi-flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + m25p,fast-read; + broken-flash-reset; + }; +}; From patchwork Tue Feb 9 12:30:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 12077919 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95835C433E0 for ; Tue, 9 Feb 2021 12:30:58 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3400964EB4 for ; Tue, 9 Feb 2021 12:30:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3400964EB4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=g5pJbpRySU7Govpwbiv7ZQPDj7XnHTO9DxiLdHn6ARY=; b=qJbqAfHTdMiCP8CxFRRsCFEXA Xm/lEQSuPyNQ4XUX/s6lNRd1mYZeGBEka0E720HXJyjyTBq6s5m5PITfr8yQMW0yNkgUSGyWpCyH9 or+53yG2ziOgJAnMLypGsOf3CxtPWaRPVlvBxj6vy/e+igOMxMVbwTGnxED8IbPurpnGqkUmBETJs 8L/IhDKVo0dLbM8EXfZoJJP8uJLlJWv7VwiXVnuzDvfOBpyutOCLpKCY78xvA3xsWc3aPQbrioyhJ vqW8KxXdmKk8hf+EI2ayfbus+appb/57gsN+mgob61Gvi2lyod6jAouByIrem/NM/IHGu9G/BT2Gj rottkFj8Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9SAL-0008Jg-Rv; Tue, 09 Feb 2021 12:30:49 +0000 Received: from esa6.hgst.iphmx.com ([216.71.154.45]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9SAB-00088v-L6 for linux-riscv@lists.infradead.org; Tue, 09 Feb 2021 12:30:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612873839; x=1644409839; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sGFDbT5PBfea9HRjbVs80n8PwYEwnjojub4O7fjDsrI=; b=YfvitdVXNxPh3OG69/qQOR0AaXSYnv++EL7CG0jXAADnA4yBvjXA0yuv epZb7YsCuXliqDSs0KafI7xDf78pGh7X4XO3Sm25ZvAZWl0ZLq0u3nNhQ ocEMIQiI79rVoKpXORTVFn1xMXyA/Ju4m48X5rBIT9ZMoL6R2B9hQxXqS Tx+OmTbZgWtXiqBKrthVOVy693ymQuB03KUbHAozv+wvQlCpWLV7qmkqB GIL4gpkZ8FPVfwdQvyE+Wp9LrY2tNkRLTG+oi9P9vze3++dUbdNxz5/Yk mrtuMy1Lw3VwT96ynvQc341tLVy5BCs61EWlnJgXU9oXu5XzEQI1DzyJr Q==; IronPort-SDR: f9rLUugrcefnE5dweEeX8yqu4IY6rERwpc87ds+TItojgHfWJCj8GOInoQZYv/hxF6bHUTdIck 3njWRlenAXY56WF7ypoJqazqe1b8i/NonRstGn51pvalQzqEAq8Ca2JDZqcd7dNmYBZ4USMZ1/ ixA9J/NyZIsLS1sWkStfTS8elirg2w32sRKL1F9IQqnTie6C0Y53ujvl2N27g8S8k8OSdHo+iB ajXlcFOvp5000WHosn4+B32/pUE+UohlF325ylsA0SR2SkGqLZuIXUZPNDMXRLUmVhUg0lWXKs I+I= X-IronPort-AV: E=Sophos;i="5.81,164,1610380800"; d="scan'208";a="160707579" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 09 Feb 2021 20:30:39 +0800 IronPort-SDR: BgkBm+9U4B07wjH/wzBt/1yguw1GHiaAvjyzD4bW2WiMqhmT1FLM4dXnPb96HPhItuNbKoDTjZ Nq4rN5+vvTLO/MHhXj5cRHBBv4MXJcLyyyz3GxkN+/djzhInNffbfgGof/5dom83NdN7UlnAAJ Fonb0B+V+eY1bXalR+UrmTSqs8IEZZ7jcTBCvMjSms1ugXT5RhALCWOGY3q8OcNHix6KUczY2Z 17DK5yNETqGR1jhEeolVMhxKSOX2I/px6M2PiwJdlVBg3j7lZjizlNQ7LGLOXDNGcWe1rUiiUc ZbSPYpzLcSvvhdgsn4k+DBsu Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2021 04:12:33 -0800 IronPort-SDR: MDMt7CevWgbiiNKtzE4Ja+eO4jsjOw2CmYAyqMWUtDsaxwyaQSqsgmkc9wnRADBL90qg+eAlqb vkUIf4oXkoSvYtvls9YXzKhhRDujH/AxazRESCZKqCEeaI2lF6C1jnSYXCsJGcRdkCTzwWwiKl Q2YymhTt7yVSzidvuL2056q+XkFFja6XHycZ0zP0KX/jW52aR0H+XoR3UUdIezuh8DAlktjgOQ Vsrxgbsbpcl+Ulhu4MqGw7zxdMihYd8PZfhkCY0zKLCHjDkDEHEciy6wRc0Bplgqjw3916GY1I 7w4= WDCIronportException: Internal Received: from phd004806.ad.shared (HELO twashi.fujisawa.hgst.com) ([10.84.71.69]) by uls-op-cesaip01.wdc.com with ESMTP; 09 Feb 2021 04:30:39 -0800 From: Damien Le Moal To: Palmer Dabbelt , linux-riscv@lists.infradead.org Subject: [PATCH v18 13/16] riscv: Add SiPeed MAIXDUINO board device tree Date: Tue, 9 Feb 2021 21:30:11 +0900 Message-Id: <20210209123014.165928-14-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210209123014.165928-1-damien.lemoal@wdc.com> References: <20210209123014.165928-1-damien.lemoal@wdc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210209_073041_700593_2FFA3585 X-CRM114-Status: GOOD ( 14.75 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Atish Patra , devicetree@vger.kernel.org, Anup Patel , Rob Herring , Sean Anderson Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add the device tree sipeed_maixduino.dts for the SiPeed MAIXDUINO board. This device tree enables LEDs and spi/mmc SD card device. Additionally, gpios and i2c are also enabled and mapped to the board header pins as indicated on the board itself. Cc: Rob Herring Cc: devicetree@vger.kernel.org Signed-off-by: Damien Le Moal --- .../boot/dts/canaan/sipeed_maixduino.dts | 204 ++++++++++++++++++ 1 file changed, 204 insertions(+) create mode 100644 arch/riscv/boot/dts/canaan/sipeed_maixduino.dts diff --git a/arch/riscv/boot/dts/canaan/sipeed_maixduino.dts b/arch/riscv/boot/dts/canaan/sipeed_maixduino.dts new file mode 100644 index 000000000000..c73baa8289b8 --- /dev/null +++ b/arch/riscv/boot/dts/canaan/sipeed_maixduino.dts @@ -0,0 +1,204 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019-20 Sean Anderson + * Copyright (C) 2020 Western Digital Corporation or its affiliates. + */ + +/dts-v1/; + +#include "k210.dtsi" + +#include +#include + +/ { + model = "SiPeed MAIXDUINO"; + compatible = "sipeed,maixduino", "canaan,kendryte-k210"; + + chosen { + bootargs = "earlycon console=ttySIF0"; + stdout-path = "serial0:115200n8"; + }; + + gpio-keys { + compatible = "gpio-keys"; + + boot { + label = "BOOT"; + linux,code = ; + gpios = <&gpio0 0 GPIO_ACTIVE_LOW>; + }; + }; + + sound { + compatible = "simple-audio-card"; + simple-audio-card,format = "i2s"; + status = "disabled"; + + simple-audio-card,cpu { + sound-dai = <&i2s0 0>; + }; + + simple-audio-card,codec { + sound-dai = <&mic>; + }; + }; + + mic: mic { + #sound-dai-cells = <0>; + compatible = "memsensing,msm261s4030h0"; + status = "disabled"; + }; + + vcc_3v3: regulator-3v3 { + compatible = "regulator-fixed"; + regulator-name = "3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; +}; + +&fpioa { + status = "okay"; + + uarths_pinctrl: uarths-pinmux { + pinmux = , /* Header "0" */ + ; /* Header "1" */ + }; + + gpio_pinctrl: gpio-pinmux { + pinmux = , + ; + }; + + gpiohs_pinctrl: gpiohs-pinmux { + pinmux = , /* BOOT */ + , /* Header "2" */ + , /* Header "3" */ + , /* Header "4" */ + , /* Header "5" */ + , /* Header "6" */ + , /* Header "7" */ + , /* Header "8" */ + , /* Header "9" */ + , /* Header "10" */ + , /* Header "11" */ + , /* Header "12" */ + ; /* Header "13" */ + }; + + i2s0_pinctrl: i2s0-pinmux { + pinmux = , + , + ; + }; + + spi1_pinctrl: spi1-pinmux { + pinmux = , + , + , + ; /* cs */ + }; + + i2c1_pinctrl: i2c1-pinmux { + pinmux = , /* Header "scl" */ + ; /* Header "sda" */ + }; + + i2s1_pinctrl: i2s1-pinmux { + pinmux = , + , + ; + }; + + spi0_pinctrl: spi0-pinmux { + pinmux = , /* cs */ + , /* rst */ + , /* dc */ + ; /* wr */ + }; + + dvp_pinctrl: dvp-pinmux { + pinmux = , + , + , + , + , + , + , + ; + }; +}; + +&uarths0 { + pinctrl-0 = <&uarths_pinctrl>; + pinctrl-names = "default"; + status = "okay"; +}; + +&gpio0 { + pinctrl-0 = <&gpiohs_pinctrl>; + pinctrl-names = "default"; + status = "okay"; +}; + +&gpio1 { + pinctrl-0 = <&gpio_pinctrl>; + pinctrl-names = "default"; + status = "okay"; +}; + +&i2s0 { + #sound-dai-cells = <1>; + pinctrl-0 = <&i2s0_pinctrl>; + pinctrl-names = "default"; +}; + +&i2c1 { + pinctrl-0 = <&i2c1_pinctrl>; + pinctrl-names = "default"; + clock-frequency = <400000>; + status = "okay"; +}; + +&spi0 { + pinctrl-0 = <&spi0_pinctrl>; + pinctrl-names = "default"; + num-cs = <1>; + cs-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>; + + panel@0 { + compatible = "sitronix,st7789v"; + reg = <0>; + reset-gpios = <&gpio0 21 GPIO_ACTIVE_LOW>; + dc-gpios = <&gpio0 22 0>; + spi-max-frequency = <15000000>; + power-supply = <&vcc_3v3>; + }; +}; + +&spi1 { + pinctrl-0 = <&spi1_pinctrl>; + pinctrl-names = "default"; + num-cs = <1>; + cs-gpios = <&gpio1_0 2 GPIO_ACTIVE_LOW>; + status = "okay"; + + slot@0 { + compatible = "mmc-spi-slot"; + reg = <0>; + voltage-ranges = <3300 3300>; + spi-max-frequency = <25000000>; + broken-cd; + }; +}; + +&spi3 { + spi-flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + m25p,fast-read; + broken-flash-reset; + }; +}; From patchwork Tue Feb 9 12:30:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 12077921 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90063C433E6 for ; Tue, 9 Feb 2021 12:30:59 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2B61164EB9 for ; Tue, 9 Feb 2021 12:30:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2B61164EB9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1aFLJPVMytUmsa/wR/x4Wp1WofSi/JLxNl1KiZYnqlo=; b=xVgVYXQG1AfI6GH8dnfj26h9e CmDHdfSiye4GdR6IIC99LXjbsgr7ZksPrOS3JdyMMQoHZmH3O6KAxRE7dDHyPbKKWryuHcR1uM7Eb 3CxhHGegI6x5o+xjp7Wzo8YjFfkvjl1jEL6S+Fd/8oi9yqR+cvydsUHHIz61f9oiQahz6JnSN/XLh yMWKQAmVinFDyebYXLDmOa1OdPDO2NSNxLJF9qI66pTRTyjWp/cumS02ED1zi37LliVhCvqqprfq1 ziXzvKqDkjSmKhYZ3oZcqbX8TAt3mQsNZuL/bjDCzjlM+4gPawva+lf7/StA0r2lS6mgq8FDSYY4N 9+L/UZ4qA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9SAN-0008Ke-IU; Tue, 09 Feb 2021 12:30:51 +0000 Received: from esa6.hgst.iphmx.com ([216.71.154.45]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9SAD-00087n-8r for linux-riscv@lists.infradead.org; Tue, 09 Feb 2021 12:30:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612873841; x=1644409841; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=O8Zb4MFoD14ZWUaz18hXV55N7UNmAe5OYeG7eeRqwL8=; b=EXN//3wYUY38aJ6VexTaJidkAyC+YdI2VkRyb+YXmUV2LRPsDkWoVvea 63/HrLRqkVXweitlfpfPUcQca3Mnb35Yf93H5fu2r4XNiv6lR/aJ0f1Du 2llMXscbrrwazNX3JIxJiaSc9f+toDb4BkD4xMWHUVviFUWW0afr3zp0m zXLjONxpbdXyBrpQmK9mAxYa0ORwOBzJRs/DYZXCwnWw+loXDYRr3zpAm FVws/F7hfs8R8VQYkfSYRrQZt56vSJ7Fz70KZhSb3R5PufOwo44UXHpXd 9/NSNHfOoCx3DzkLUd0x42NLhCMeKew5HqEly63UFbZD7Tlz2DMJxFFfA w==; IronPort-SDR: ldZTVCZrf6htL34fKTjBkh2j+3cg/t+aCm0uL0R+BY5hNyIaal/kbTP2s8TIR7csz4Aw7oIQ3D RSPgeTCduWyf5FKCGzk263xTP6JqXSvJY3NTtqdXpnK/t6Xr8FygcdFvNeG+hCrSuMDpZOgkBQ VIZimm1MAfVGQfQY6lqxUmJwNlYxv7u4w68S6WPaBdM+L+c+r7Y1nWYwzKVLAkEeH+WGvgeIDs +VcRau2Fw8AY0HKcGCn7+UniBynn9aO6TDqebvmEyQym4dsj9Q72WE8hMrltizVOyiOLCZBm8L Nn4= X-IronPort-AV: E=Sophos;i="5.81,164,1610380800"; d="scan'208";a="160707582" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 09 Feb 2021 20:30:41 +0800 IronPort-SDR: RHmcMyTBhO6SFgsFqmYMGG1MsthYGqZR9HzqrUGvYmaEj7bIelWUEyDBex4V5n9+aaBHthG0cV NbV8qMd2QeKeE/aX2mZd5fgk/lliJerW8NUcErc+blN6j/NExI8gaZ3xB1tQNj5h+2u3i+81z1 Qz6gKQu/MdwqUA3htr1G8sXJCZ4jtFrg2v1kBRcGxPgIBM2AIp4SgE/La9RsuQ56w782cril7K g06npQpP4I4v8TfiJo1GrY8zMf+uMGyx6su7o1XbkSXDUqwnvP1pC+C5GwA4y6BojQ4fXlklgU EUB8N/my9hxssgyYz09cxMWE Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2021 04:12:34 -0800 IronPort-SDR: XcVapXR+FTFouvMjtkXyNGtEZoQ4/OeYHut6QzkpCqn22A0aPMkglZhWJV0PrsS49PgrkbaXz8 jgPRG6YOj1bfGOB10EUZFlLGi+qlwmLhX54n0G07BWbKY7lFkk1d++3hi81hq4PaBCjAtqtzW0 iNsufaSonbmjoKQO0JG1YknsAGUQfmepa22CygyFuon2yZiJFGR/hpy2jr043cxfRierFgaPvL 8J/+kSzZM7MeGiW8zonYaYJfGKhYD7iLRESSnnmSrP/SHNnFVmK1aVQoLw+CkYtlYS7w7JhPTG ccg= WDCIronportException: Internal Received: from phd004806.ad.shared (HELO twashi.fujisawa.hgst.com) ([10.84.71.69]) by uls-op-cesaip01.wdc.com with ESMTP; 09 Feb 2021 04:30:40 -0800 From: Damien Le Moal To: Palmer Dabbelt , linux-riscv@lists.infradead.org Subject: [PATCH v18 14/16] riscv: Add Kendryte KD233 board device tree Date: Tue, 9 Feb 2021 21:30:12 +0900 Message-Id: <20210209123014.165928-15-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210209123014.165928-1-damien.lemoal@wdc.com> References: <20210209123014.165928-1-damien.lemoal@wdc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210209_073041_693524_EE7AF4F1 X-CRM114-Status: GOOD ( 14.08 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Atish Patra , devicetree@vger.kernel.org, Anup Patel , Rob Herring , Sean Anderson Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add the device tree canaan_kd233.dts for the Canaan Kendryte KD233 development board. This device tree enables LEDs, some gpios and spi/mmc SD card device. The WS2812B RGB LED and the 10 positions rotary dip switch present on the board are left undefined. Cc: Rob Herring Cc: devicetree@vger.kernel.org Signed-off-by: Damien Le Moal Reviewed-by: Anup Patel --- arch/riscv/boot/dts/canaan/canaan_kd233.dts | 172 ++++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 arch/riscv/boot/dts/canaan/canaan_kd233.dts diff --git a/arch/riscv/boot/dts/canaan/canaan_kd233.dts b/arch/riscv/boot/dts/canaan/canaan_kd233.dts new file mode 100644 index 000000000000..193792868ef1 --- /dev/null +++ b/arch/riscv/boot/dts/canaan/canaan_kd233.dts @@ -0,0 +1,172 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019-20 Sean Anderson + * Copyright (C) 2020 Western Digital Corporation or its affiliates. + */ + +/dts-v1/; + +#include "k210.dtsi" + +#include +#include + +/ { + model = "Kendryte KD233"; + compatible = "canaan,kendryte-kd233", "canaan,kendryte-k210"; + + chosen { + bootargs = "earlycon console=ttySIF0"; + stdout-path = "serial0:115200n8"; + }; + + gpio-leds { + compatible = "gpio-leds"; + + led0 { + gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; + }; + + led1 { + gpios = <&gpio0 9 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-keys { + compatible = "gpio-keys"; + + key0 { + label = "KEY0"; + linux,code = ; + gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; + }; + }; + + sound { + compatible = "simple-audio-card"; + simple-audio-card,format = "i2s"; + status = "disabled"; + + simple-audio-card,cpu { + sound-dai = <&i2s0 0>; + }; + + simple-audio-card,codec { + sound-dai = <&mic>; + }; + }; + + mic: mic { + #sound-dai-cells = <0>; + compatible = "memsensing,msm261s4030h0"; + status = "disabled"; + }; +}; + +&fpioa { + pinctrl-0 = <&jtag_pinctrl>; + pinctrl-names = "default"; + status = "okay"; + + jtag_pinctrl: jtag-pinmux { + pinmux = , + , + , + ; + }; + + uarths_pinctrl: uarths-pinmux { + pinmux = , + ; + }; + + spi0_pinctrl: spi0-pinmux { + pinmux = , /* cs */ + , /* wr */ + ; /* dc */ + }; + + dvp_pinctrl: dvp-pinmux { + pinmux = , + , + , + , + , + , + , + ; + }; + + gpiohs_pinctrl: gpiohs-pinmux { + pinmux = , + , /* Rot. dip sw line 8 */ + , /* Rot. dip sw line 4 */ + , /* Rot. dip sw line 2 */ + , /* Rot. dip sw line 1 */ + , + , + ; + }; + + spi1_pinctrl: spi1-pinmux { + pinmux = , + , + , + ; /* cs */ + }; + + i2s0_pinctrl: i2s0-pinmux { + pinmux = , + , + ; + }; +}; + +&uarths0 { + pinctrl-0 = <&uarths_pinctrl>; + pinctrl-names = "default"; + status = "okay"; +}; + +&gpio0 { + pinctrl-0 = <&gpiohs_pinctrl>; + pinctrl-names = "default"; + status = "okay"; +}; + +&i2s0 { + #sound-dai-cells = <1>; + pinctrl-0 = <&i2s0_pinctrl>; + pinctrl-names = "default"; +}; + +&spi0 { + pinctrl-0 = <&spi0_pinctrl>; + pinctrl-names = "default"; + num-cs = <1>; + cs-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>; + + panel@0 { + compatible = "ilitek,ili9341"; + reg = <0>; + dc-gpios = <&gpio0 21 GPIO_ACTIVE_HIGH>; + spi-max-frequency = <15000000>; + status = "disabled"; + }; +}; + +&spi1 { + pinctrl-0 = <&spi1_pinctrl>; + pinctrl-names = "default"; + num-cs = <1>; + cs-gpios = <&gpio0 16 GPIO_ACTIVE_LOW>; + status = "okay"; + + slot@0 { + compatible = "mmc-spi-slot"; + reg = <0>; + voltage-ranges = <3300 3300>; + spi-max-frequency = <25000000>; + broken-cd; + }; +}; From patchwork Tue Feb 9 12:30:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 12077923 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UPPERCASE_50_75, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B16DC433DB for ; Tue, 9 Feb 2021 12:31:01 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8626A64E88 for ; Tue, 9 Feb 2021 12:31:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8626A64E88 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=49s2ocOjAFFXGEb12If+26nMjeWWX+TH+opECnSP6N0=; b=lpcnrlFlcFTuKi1F7V6YlVeF5 NQpKie9489Rywa6VuXLT90cPanNfpvfhXmR2Zf+RqyRo/iEoMiEK72oIRQ8y/KvjzF2Uf4FWDvrZB 8NMpZcp4g2KM6PHQ6yO2/JGjOhU4bp8M6A8GfbD4HMVBKHJlDbSqzlA2uGkJRQ2+Sk/+nPDlZiLrX C+yQMGVuQGwwEM3Fz7tPkZLzlQCN4jiLGkqG/GIVtx9J8D2hNyYua3vtoVo+epR5tHj53fnzegLby HPyO/Abr2uSbd01CmPy+6DrNnGUy97zKYOaSe0SOEhrjpyUGW5GgwWRnflGXVEQDtOYFrBKRUmjPr MEIs7QgCg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9SAO-0008LA-HB; Tue, 09 Feb 2021 12:30:52 +0000 Received: from esa6.hgst.iphmx.com ([216.71.154.45]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9SAF-0008FL-IV for linux-riscv@lists.infradead.org; Tue, 09 Feb 2021 12:30:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612873843; x=1644409843; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bLTp7TEh7haEii+R1cR3cRVOJJN7cYqZvqMyNXTVOyE=; b=czFYvNylDcc/uC+ARzDRwugBn5MjMFnYLWQEF6zE/VO7HP9SH5A7oCYw ZV7odTnFluMlFWz/NKz3766LYlrUIXDJ9mfAIATGLWfIzr09kHa9+e1aE N7b2DLItLQ6u9LB5QC1JACaYrg89kCl95huRvBOikV7b4P6EcbIk3obq/ LNv8f/nWoBhYyV3E8jXhoGIctbWiTaImIvKDCHqhH/cNBPVHeM1FecV0x 5WtEhuGOZtG0YJlnl9K9k7Srxeh7zqyUYid6Mt+w1uIeo4MKU7EHOcPmk gVe1Np8yn63dfpvSvaYxsYG40HkJ+BgU84GtsXdNTicFpdzJlfTaIbWW2 A==; IronPort-SDR: YA/3Uw5/7qV3W+SDidyrpNs+4J1MsziPXn3jsowpJn2O2gEMkZk04R1sdlW9eKze6OlV+15CZV n9gW5vleej4hUbTv73HM1Tew27inE5u3LMdEvAO0e9lKYrXEnmpcButVWUHFXKKRpDEWtvM19G 21Oqsa+w1gmvhuZT0nB6rZyc4PGzo+YubaQoogoFDXqJbMPrd7DQgAFsq4fPMqh2baRDObVVgp +twxJRwVRvGCP4YbjHYGWLT/HXzKRelCp83ihp8DF9EfYWauBPaengWBYsDe+XVkyrT3wTAdEW K/c= X-IronPort-AV: E=Sophos;i="5.81,164,1610380800"; d="scan'208";a="160707585" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 09 Feb 2021 20:30:42 +0800 IronPort-SDR: kk1xqT7ls2p9VS8fk+VbzadlYR4rGS+W2+ieqSp1dc9HfALujtwZUTrmpgVGSzucetH1gdC/Br JMHpN/OMPP3Aq4nCxoyrx18vd/7vC9V0oZB40XAeAJW3maq6UGVnoBNQ8CpGg+jiUjP0KqIm84 VZm2kgQCU+PC6kAZrNN0TPaKRIIGwQkoHDmHBlhvvhj64N2x8CcSNqM09nWqusC77WdsgVhYHk 96kyw/yAowct0vCurd6Yb4xbtXWfx9z2Mb7UYjIBVmtoWT+1UfwmRmFjGNWiVse381XUbJIbkr pMkCw+BfHrVUYpLxFZAII9Jf Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2021 04:12:36 -0800 IronPort-SDR: NYem0xvJ62Uf5m73IHIjzFD7PzCzk08U+LbkNkFeONhISDfWBtmVBFWfb4f3+wQH4kGSV2fmk5 IdUkUzntK59AwShtRCZbf55srUTf3AO777htdI2qmcT8Mj6Z1EnhhrRPY5wlzceJnjKiDiqC2N hWDwHFuHWF5wrl8bgiT5x3XUZoq6vmnF2/1BSZMcMuIUSKknK+DESvs5X9rEaCGpwM/8U2fAM3 7PGAW7nXjrsltu6CB9ATGPSGeSnwK3lqH4uNCEmtoEyELyq4ZTvcF8ryNGuz+Ot9BUJABixbUA Jw8= WDCIronportException: Internal Received: from phd004806.ad.shared (HELO twashi.fujisawa.hgst.com) ([10.84.71.69]) by uls-op-cesaip01.wdc.com with ESMTP; 09 Feb 2021 04:30:42 -0800 From: Damien Le Moal To: Palmer Dabbelt , linux-riscv@lists.infradead.org Subject: [PATCH v18 15/16] riscv: Update Canaan Kendryte K210 defconfig Date: Tue, 9 Feb 2021 21:30:13 +0900 Message-Id: <20210209123014.165928-16-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210209123014.165928-1-damien.lemoal@wdc.com> References: <20210209123014.165928-1-damien.lemoal@wdc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210209_073043_855693_28597510 X-CRM114-Status: GOOD ( 14.39 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Atish Patra , Anup Patel , Sean Anderson Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Update the Kendryte k210 nommu default configuration file (nommu_k210_defconfig) to include device drivers for reset, reboot, I2C, SPI, gpio and LEDs support. Virtual Terminal support is also disabled as no terminal devices are supported and enabled. Disabling CONFIG_VT (removing the no longer needed override for CONFIG_VGA_CONSOLE) reduces the kernel image size by about 65 KB. This default configuration remains suitable for a system using an initramfs cpio file linked into the kernel image. Signed-off-by: Damien Le Moal Reviewed-by: Anup Patel Reviewed-by: Atish Patra --- arch/riscv/configs/nommu_k210_defconfig | 44 ++++++++++++++++++++----- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/arch/riscv/configs/nommu_k210_defconfig b/arch/riscv/configs/nommu_k210_defconfig index 368a28cf1467..b16a2a12c82a 100644 --- a/arch/riscv/configs/nommu_k210_defconfig +++ b/arch/riscv/configs/nommu_k210_defconfig @@ -1,17 +1,19 @@ # CONFIG_CPU_ISOLATION is not set -CONFIG_LOG_BUF_SHIFT=15 +CONFIG_LOG_BUF_SHIFT=13 CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=12 CONFIG_BLK_DEV_INITRD=y -CONFIG_INITRAMFS_FORCE=y +# CONFIG_RD_GZIP is not set # CONFIG_RD_BZIP2 is not set # CONFIG_RD_LZMA is not set # CONFIG_RD_XZ is not set # CONFIG_RD_LZO is not set # CONFIG_RD_LZ4 is not set +# CONFIG_RD_ZSTD is not set CONFIG_CC_OPTIMIZE_FOR_SIZE=y # CONFIG_SYSFS_SYSCALL is not set # CONFIG_FHANDLE is not set # CONFIG_BASE_FULL is not set +# CONFIG_FUTEX is not set # CONFIG_EPOLL is not set # CONFIG_SIGNALFD is not set # CONFIG_TIMERFD is not set @@ -25,15 +27,17 @@ CONFIG_EMBEDDED=y # CONFIG_VM_EVENT_COUNTERS is not set # CONFIG_COMPAT_BRK is not set CONFIG_SLOB=y -# CONFIG_SLAB_MERGE_DEFAULT is not set # CONFIG_MMU is not set CONFIG_SOC_CANAAN=y +CONFIG_SOC_CANAAN_K210_DTB_SOURCE="k210_generic" CONFIG_MAXPHYSMEM_2GB=y CONFIG_SMP=y CONFIG_NR_CPUS=2 CONFIG_CMDLINE="earlycon console=ttySIF0" CONFIG_CMDLINE_FORCE=y -CONFIG_JUMP_LABEL=y +# CONFIG_SECCOMP is not set +# CONFIG_STACKPROTECTOR is not set +# CONFIG_GCC_PLUGINS is not set # CONFIG_BLOCK is not set CONFIG_BINFMT_FLAT=y # CONFIG_COREDUMP is not set @@ -41,23 +45,47 @@ CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y # CONFIG_FW_LOADER is not set # CONFIG_ALLOW_DEV_COREDUMP is not set -# CONFIG_INPUT_KEYBOARD is not set -# CONFIG_INPUT_MOUSE is not set +# CONFIG_INPUT is not set # CONFIG_SERIO is not set +# CONFIG_VT is not set +# CONFIG_UNIX98_PTYS is not set # CONFIG_LEGACY_PTYS is not set # CONFIG_LDISC_AUTOLOAD is not set # CONFIG_HW_RANDOM is not set # CONFIG_DEVMEM is not set +CONFIG_I2C=y +# CONFIG_I2C_COMPAT is not set +CONFIG_I2C_CHARDEV=y +# CONFIG_I2C_HELPER_AUTO is not set +CONFIG_I2C_DESIGNWARE_PLATFORM=y +CONFIG_SPI=y +# CONFIG_SPI_MEM is not set +CONFIG_SPI_DESIGNWARE=y +CONFIG_SPI_DW_MMIO=y +# CONFIG_GPIO_CDEV_V1 is not set +CONFIG_GPIO_DWAPB=y +CONFIG_GPIO_SIFIVE=y +CONFIG_POWER_RESET=y +CONFIG_POWER_RESET_SYSCON=y # CONFIG_HWMON is not set -# CONFIG_VGA_CONSOLE is not set -# CONFIG_HID is not set # CONFIG_USB_SUPPORT is not set +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=y +CONFIG_LEDS_GPIO=y +CONFIG_LEDS_USER=y # CONFIG_VIRTIO_MENU is not set +# CONFIG_VHOST_MENU is not set +# CONFIG_SURFACE_PLATFORMS is not set +# CONFIG_FILE_LOCKING is not set # CONFIG_DNOTIFY is not set # CONFIG_INOTIFY_USER is not set # CONFIG_MISC_FILESYSTEMS is not set CONFIG_LSM="[]" CONFIG_PRINTK_TIME=y +# CONFIG_SYMBOLIC_ERRNAME is not set +# CONFIG_DEBUG_BUGVERBOSE is not set +# CONFIG_SECTION_MISMATCH_WARN_ONLY is not set +# CONFIG_FRAME_POINTER is not set # CONFIG_DEBUG_MISC is not set CONFIG_PANIC_ON_OOPS=y # CONFIG_SCHED_DEBUG is not set From patchwork Tue Feb 9 12:30:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 12077925 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B91EC433E6 for ; Tue, 9 Feb 2021 12:31:03 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A9B6E64EB4 for ; Tue, 9 Feb 2021 12:31:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A9B6E64EB4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=pn1MO1wIRyzMlAMnH9te32dBKcVkuyijDy+/2rZbO2g=; b=eiFJiybaE9Rq4ABvrRDOW40IC FXNni2BBvi8Aggu1/vlymR3AMzhewREGy21kicR9IyvCJMwdyNtjbdBqLNRu4/J2Gen9i4LhhJp6p vGfeYxY4sHl2/CNDqJEWhGAVS4/xRThZ7SCPyXfV9cV1HbDQIcKWphlrCbjxkxR8R46IhhRE20IOD 7atPaURDHMbu8p0y2r+JNpe3N5RX/qkOzyqtlR/LqS5tnsMYP/z2Z4DJgTcmjIYR6lqemqpi3345U 4vsabrcKTvT37iCeV86BET47ZGWSg+PWUBXg5dcQeLJ1rS1kA8KjbQxlzUY8UIacN420D/LmJolqR yj+OU7cLg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9SAQ-0008M2-2s; Tue, 09 Feb 2021 12:30:54 +0000 Received: from esa6.hgst.iphmx.com ([216.71.154.45]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9SAF-00088v-WB for linux-riscv@lists.infradead.org; Tue, 09 Feb 2021 12:30:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612873844; x=1644409844; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=baTewvOd0Ca+b6oP67fu7diBD9GZ8yVq0VT0CXYLPk8=; b=aSlHo2Ukk5Mm7wl1sXrrVE9z8wcrTz2UnS+oX8mSRJ/DCcSHNKgbwmvk HfWAe2t1QfopYC/C0B1r5O2EC8ruIRC/SZ401EoIhvn+9qv4/sRyysNjN dJsOpzw9K9pEPd4r0mMfI+wbE5PbN8o8NfDK7C317rElgqp8ofaKdAl9d p2Qdl74JPM2pF+fgmVv4gyWGDtgUCVa6Uir/BALQ1TscDTd2pCNbd5L+o +/vDjg7AeYPBFC73AW55GbGig2wg5wQwEKgD7/sKGaDAzB2MxoEDQ9pOG A0IBEvDAGtplqttBSkDw3D3tPasik7/+wb3HMMMp1oBHs7gn5r+Tsm/N8 g==; IronPort-SDR: oqT1vWRV/uYXLgq1M1I9qoRX7YIUqf8wbX5Y6/HVmTs7f7qjBG6ZQH6pZ5m1SKXqMJbZy7iDnW jau9870juoauX3TBN81k5cR+17EDIAPMpIdwiO418zJFv05F3NThXXHVfsL4t19dwxVCnuPpBN Qv+wK1Fn5x01f+aLEXQFdsJcMG0Qvb8psGr4pZIHVHXH1VKojqmCZ1Ca6WDzeb7ot3osQS1n0y N5StOWBjsWZf2W72WfSCD2AxZhDK25v/B5/HlGnQrkNA6xFyAw6b0XaRrCPT31kuxj7Uv7y4qf b8Y= X-IronPort-AV: E=Sophos;i="5.81,164,1610380800"; d="scan'208";a="160707586" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 09 Feb 2021 20:30:44 +0800 IronPort-SDR: EP3IHxMm0+F3t9fpa4mb5zs4wHiYh0RdsI7Nl7dfqhBvHVG7v45RywkWwtHVy+T9gOu7BCWrQW VyZr2M+LM2N4yMV4en5B+fS0B/Q90TdzGZbdq2cgKZ3bhH+lrfs62LxvGyoSuWCCcqta8FWquJ aAcNTnXdFfyohgsHY0As38dvAaWIPvB2rU8xjEmD7qvEqVKMLs8gUO84tjZ47wPS03KA3jfEb8 Jez9qUPDLFFE/w3AZRlrCudHZEvYKerfTx022YF/LEzXpvlbMIACBFfzeIlrg3/NOXDT2EjJ91 /V3akc+keT2P25GI2ajCuCxg Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2021 04:12:37 -0800 IronPort-SDR: +x0YrxtM5s344dbYTsz9gBEGNtY2u7ukJaiXXWA+BAaHcnaDScYKNjUXZt2LIIFGAvkY6XHjq2 mzpDrQCHJ0Ap2yViSvhIQFHtqBM5ZvDsDIXoCu5Gzn7eQr124sHcsnVCsFLKOD/+KPPE4ZYmhA SFNx3doFauI+uuZm3qdppIBHb5gTs+79Qce2l0TFme7uDb2o0lNsHR0/ZQHuwYvEjcSFKBFDXe L0RXNe1MwACzbahTAz5V/WavXH6u68E70kMMQTHR5ZyO9vW7BfIti1pbt4mF1ewX/4KG5AMENS X9Q= WDCIronportException: Internal Received: from phd004806.ad.shared (HELO twashi.fujisawa.hgst.com) ([10.84.71.69]) by uls-op-cesaip01.wdc.com with ESMTP; 09 Feb 2021 04:30:43 -0800 From: Damien Le Moal To: Palmer Dabbelt , linux-riscv@lists.infradead.org Subject: [PATCH v18 16/16] riscv: Add Canaan Kendryte K210 SD card defconfig Date: Tue, 9 Feb 2021 21:30:14 +0900 Message-Id: <20210209123014.165928-17-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210209123014.165928-1-damien.lemoal@wdc.com> References: <20210209123014.165928-1-damien.lemoal@wdc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210209_073044_248980_D595741A X-CRM114-Status: GOOD ( 19.71 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Atish Patra , Anup Patel , Sean Anderson Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org The nommu_k210_defconfig default configuration allows booting a Canaan Kendryte K210 SoC based boards using an embedded intramfs cpio file. Modifying this configuration to enable support for the board SD card is not trivial for all users. To help beginners getting started with these boards, add the nommu_k210_sdcard_defconfig default configuration file to set all configuration options necessary to use the board mmc-spi sd card for the root file system. This new configuration adds support for the block layer, the mmc-spi driver and modifies the boot options to specify the rootfs device as mmcblk0p1 (first partition of the sd card block device). The ext2 file system is selected by default to encourage its use as that results in only about 4KB added to the kernel image size. As ext2 does not have journaling, the boot options specify a read-only mount of the file system. Similarly to the smaller nommu_k210_defconfig, this new default configuration disables virtual terminal support to reduce the kernel image size. The default device tree selected is unchanged, specifying the simple "k210_generic" device tree file. The user must change this setting to specify the device tree suitable for the board being used (sipeed_maix_bit, sipeed_maix_dock, sipeed_maix_go, sipeed_maixduino or canaan_kd233). Signed-off-by: Damien Le Moal Reviewed-by: Anup Patel Reviewed-by: Atish Patra --- .../riscv/configs/nommu_k210_sdcard_defconfig | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 arch/riscv/configs/nommu_k210_sdcard_defconfig diff --git a/arch/riscv/configs/nommu_k210_sdcard_defconfig b/arch/riscv/configs/nommu_k210_sdcard_defconfig new file mode 100644 index 000000000000..61f887f65419 --- /dev/null +++ b/arch/riscv/configs/nommu_k210_sdcard_defconfig @@ -0,0 +1,92 @@ +# CONFIG_CPU_ISOLATION is not set +CONFIG_LOG_BUF_SHIFT=13 +CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=12 +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +# CONFIG_SYSFS_SYSCALL is not set +# CONFIG_FHANDLE is not set +# CONFIG_BASE_FULL is not set +# CONFIG_FUTEX is not set +# CONFIG_EPOLL is not set +# CONFIG_SIGNALFD is not set +# CONFIG_TIMERFD is not set +# CONFIG_EVENTFD is not set +# CONFIG_AIO is not set +# CONFIG_IO_URING is not set +# CONFIG_ADVISE_SYSCALLS is not set +# CONFIG_MEMBARRIER is not set +# CONFIG_KALLSYMS is not set +CONFIG_EMBEDDED=y +# CONFIG_VM_EVENT_COUNTERS is not set +# CONFIG_COMPAT_BRK is not set +CONFIG_SLOB=y +# CONFIG_MMU is not set +CONFIG_SOC_CANAAN=y +CONFIG_SOC_CANAAN_K210_DTB_SOURCE="k210_generic" +CONFIG_MAXPHYSMEM_2GB=y +CONFIG_SMP=y +CONFIG_NR_CPUS=2 +CONFIG_CMDLINE="earlycon console=ttySIF0 rootdelay=2 root=/dev/mmcblk0p1 ro" +CONFIG_CMDLINE_FORCE=y +# CONFIG_SECCOMP is not set +# CONFIG_STACKPROTECTOR is not set +# CONFIG_GCC_PLUGINS is not set +# CONFIG_BLK_DEV_BSG is not set +# CONFIG_MQ_IOSCHED_DEADLINE is not set +# CONFIG_MQ_IOSCHED_KYBER is not set +CONFIG_BINFMT_FLAT=y +# CONFIG_COREDUMP is not set +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y +# CONFIG_FW_LOADER is not set +# CONFIG_ALLOW_DEV_COREDUMP is not set +# CONFIG_BLK_DEV is not set +# CONFIG_INPUT is not set +# CONFIG_SERIO is not set +# CONFIG_VT is not set +# CONFIG_LEGACY_PTYS is not set +# CONFIG_LDISC_AUTOLOAD is not set +# CONFIG_HW_RANDOM is not set +# CONFIG_DEVMEM is not set +CONFIG_I2C=y +CONFIG_I2C_CHARDEV=y +# CONFIG_I2C_HELPER_AUTO is not set +CONFIG_I2C_DESIGNWARE_PLATFORM=y +CONFIG_SPI=y +# CONFIG_SPI_MEM is not set +CONFIG_SPI_DESIGNWARE=y +CONFIG_SPI_DW_MMIO=y +# CONFIG_GPIO_CDEV_V1 is not set +CONFIG_GPIO_DWAPB=y +CONFIG_GPIO_SIFIVE=y +CONFIG_POWER_RESET=y +CONFIG_POWER_RESET_SYSCON=y +# CONFIG_HWMON is not set +# CONFIG_USB_SUPPORT is not set +CONFIG_MMC=y +# CONFIG_PWRSEQ_EMMC is not set +# CONFIG_PWRSEQ_SIMPLE is not set +CONFIG_MMC_SPI=y +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=y +CONFIG_LEDS_GPIO=y +CONFIG_LEDS_USER=y +# CONFIG_VIRTIO_MENU is not set +# CONFIG_VHOST_MENU is not set +# CONFIG_SURFACE_PLATFORMS is not set +CONFIG_EXT2_FS=y +# CONFIG_FILE_LOCKING is not set +# CONFIG_DNOTIFY is not set +# CONFIG_INOTIFY_USER is not set +# CONFIG_MISC_FILESYSTEMS is not set +CONFIG_LSM="[]" +CONFIG_PRINTK_TIME=y +# CONFIG_SYMBOLIC_ERRNAME is not set +# CONFIG_DEBUG_BUGVERBOSE is not set +# CONFIG_SECTION_MISMATCH_WARN_ONLY is not set +# CONFIG_FRAME_POINTER is not set +# CONFIG_DEBUG_MISC is not set +CONFIG_PANIC_ON_OOPS=y +# CONFIG_SCHED_DEBUG is not set +# CONFIG_RCU_TRACE is not set +# CONFIG_FTRACE is not set +# CONFIG_RUNTIME_TESTING_MENU is not set