From patchwork Thu Mar 5 18:53:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 1249827 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=COckx0n7; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48YKgv1PH5z9sPF for ; Fri, 6 Mar 2020 05:55:23 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3B616812E1; Thu, 5 Mar 2020 19:54:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="COckx0n7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 52C49812E1; Thu, 5 Mar 2020 19:54:00 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 298B58129E for ; Thu, 5 Mar 2020 19:53:53 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qk1-x72d.google.com with SMTP id e11so6349806qkg.9 for ; Thu, 05 Mar 2020 10:53:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uA3jOUZIoe2dZNslfOd20CyYStUdwOK65jVSfBvirpo=; b=COckx0n7c4hxnGxdbhFSFgOgrm5HDwQvxwrPhgoGPmF1JOfiQqdYYWpa+8iHoyXW30 J0y72KrZyROfdC20QJEclaL3vfyjXYvEqZdAteabMzj1fY4prNgFXlL2Qfnyl3NapnoN 0DdhIIwYfGmW7jQlVCvOlvc1QYNufUTIsdZnpfuTO+X6KL/+Mc/tH/GRmmcKvcZCUxiC eF9l4nv6nFIqFZgC/t+yMQgG/1/8M/ZjcfjFwVKR1/xmakXFJCtmdcU4BY7cJ70vYoNg TC72+B59X2eIYY1gWqzaNjKOsnfdoVQ/6rW2AvcZRwLAkYllc7FPCg+VqkJSAEJ3+a0R Ifhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uA3jOUZIoe2dZNslfOd20CyYStUdwOK65jVSfBvirpo=; b=glSDfzavGbrVxOK8p3XgRlwfv1m1f11x+mLxjHA1R63MHLjQNgiuhXmHKPp8ODkyqJ Edirk+gpmJKYYk5yJ3pUk+qcsS0mNHXiqiZxV8vTxcOGwm30xGdPUlT96EBN+uuwzUAj Pzhm5rnhUJXlFi6PYQ9uZ9tOjeZ9Ia8+UmneNjVOYKava5Rb0bLlLo/S2jYi3FFh+TU2 0WXBqiFYjU6+qJAnhu5b6cvFM/X61R1TTRFkseCZtKiEPd+krY9jhRSb3wbEtzpO1VZP iDMfaWyZqQuLKxFIh5AG2EWuL0UWAJA63m9ciwwD0xIVRplYMJnwSsyUrw3JYKF6Q2Zh WQ+A== X-Gm-Message-State: ANhLgQ1BJS1tkoUEkGKO/lWt/RaiG8q5R2JDcy5HE0JpFWseHFxDVBBV O/anVxGJY0mQaIHPQzpWlrhNVVhf7Ks= X-Google-Smtp-Source: ADFU+vvbYYc4ZrLjDO65CuRKj/CpvH94OuJwlNCybNw0o4LSwymjG2dl47OBn7AZDE19uo/77xuUTw== X-Received: by 2002:a37:b4c5:: with SMTP id d188mr9227942qkf.27.1583434431721; Thu, 05 Mar 2020 10:53:51 -0800 (PST) Received: from localhost.localdomain ([75.102.135.197]) by smtp.gmail.com with ESMTPSA id o16sm16263379qke.35.2020.03.05.10.53.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Mar 2020 10:53:50 -0800 (PST) From: Sean Anderson To: u-boot@lists.denx.de Cc: Simon Glass , Tom Rini , Sean Anderson , Bin Meng , Rick Chen Subject: [PATCH v1 8/8] riscv: Add FPIOA and GPIO support for Kendryte K210 Date: Thu, 5 Mar 2020 13:53:28 -0500 Message-Id: <20200305185328.951011-9-seanga2@gmail.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200305185328.951011-1-seanga2@gmail.com> References: <20200305185328.951011-1-seanga2@gmail.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean This patch adds the necessary configs and docs for FPIOA and GPIO support on the K210. Signed-off-by: Sean Anderson --- board/sipeed/maix/Kconfig | 12 ++++++++ doc/board/sipeed/maix.rst | 64 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 74 insertions(+), 2 deletions(-) diff --git a/board/sipeed/maix/Kconfig b/board/sipeed/maix/Kconfig index 8292089fc9..a5a095d4ff 100644 --- a/board/sipeed/maix/Kconfig +++ b/board/sipeed/maix/Kconfig @@ -27,6 +27,9 @@ config NR_CPUS config NR_DRAM_BANKS default 3 +config SF_DEFAULT_BUS + default 3 + config BOARD_SPECIFIC_OPTIONS def_bool y select GENERIC_RISCV @@ -45,4 +48,13 @@ config BOARD_SPECIFIC_OPTIONS imply RESET_SYSCON imply SYSRESET imply SYSRESET_SYSCON + imply PINCTRL + imply PINCONF + imply PINCTRL_K210 + imply DM_GPIO + imply DWAPB_GPIO + imply SIFIVE_GPIO + imply CMD_GPIO + imply LED + imply LED_GPIO endif diff --git a/doc/board/sipeed/maix.rst b/doc/board/sipeed/maix.rst index b11ee0182e..312da1e7bb 100644 --- a/doc/board/sipeed/maix.rst +++ b/doc/board/sipeed/maix.rst @@ -132,7 +132,7 @@ To run legacy images, use the ``bootm`` command: Load Address: 80000000 Entry Point: 80000000 - $ picocom -b 115200 /dev/ttyUSB0i + $ picocom -b 115200 /dev/ttyUSB0 => loady ## Ready for binary (ymodem) download to 0x80000000 at 115200 bps... C @@ -163,6 +163,66 @@ To run legacy images, use the ``bootm`` command: argv[0] = "" Hit any key to exit ... +Pin Assignment +-------------- + +The K210 contains a Fully Programmable I/O Array (FPIOA), which can remap any of +its 256 input functions to any any of 48 output pins. The following table has +the default pin assignments for the BitM. + +===== ========== ======= +Pin Function Comment +===== ========== ======= +IO_0 JTAG_TCLK +IO_1 JTAG_TDI +IO_2 JTAG_TMS +IO_3 JTAG_TDO +IO_4 UARTHS_RX +IO_5 UARTHS_TX +IO_6 GPIOHS_1 +IO_7 GPIOHS_2 +IO_8 GPIO_0 +IO_9 GPIO_1 +IO_10 GPIO_2 +IO_11 GPIO_3 +IO_12 GPIO_4 Green LED +IO_13 GPIO_5 Red LED +IO_14 GPIO_6 Blue LED +IO_15 GPIO_7 +IO_16 GPIOHS_0 ISP +IO_17 GPIOHS_3 +IO_18 I2S0_SCLK MIC CLK +IO_19 I2S0_WS MIC WS +IO_20 I2S0_IN_D0 MIC SD +IO_21 GPIOHS_4 +IO_22 GPIOHS_5 +IO_23 GPIOHS_6 +IO_24 GPIOHS_7 +IO_25 GPIOHS_8 +IO_26 SPI1_D1 MMC MISO +IO_27 SPI1_SCLK MMC CLK +IO_28 SPI1_D0 MMC MOSI +IO_29 GPIOHS_31 MMC CS +IO_30 GPIOHS_9 +IO_31 GPIOHS_10 +IO_32 GPIOHS_11 +IO_33 GPIOHS_12 +IO_34 GPIOHS_13 +IO_35 GPIOHS_14 +IO_36 GPIOHS_28 Panel CS +IO_37 GPIOHS_29 Panel RST +IO_38 GPIOHS_30 Panel DC +IO_39 SPI0_SCK Panel WR +IO_40 SCCP_SDA +IO_41 SCCP_SCLK +IO_42 DVP_RST +IO_43 DVP_VSYNC +IO_44 DVP_PWDN +IO_45 DVP_HSYNC +IO_46 DVP_XCLK +IO_47 DVP_PCLK +===== ========== ======= + Over- and Under-clocking ------------------------ @@ -294,5 +354,5 @@ Address Size Description 0x8801C000 0x1000 riscv priv spec 1.9 config 0x8801D000 0x2000 flattened device tree (contains only addresses and interrupts) -0x8801f000 0x1000 credits +0x8801F000 0x1000 credits ========== ========= ===========