From mboxrd@z Thu Jan 1 00:00:00 1970 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 069B1C48BDF for ; Tue, 15 Jun 2021 19:11:54 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 05DFD60FF4 for ; Tue, 15 Jun 2021 19:11:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 05DFD60FF4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 53AFF82964; Tue, 15 Jun 2021 21:11:25 +0200 (CEST) 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="JvF0q3CJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 33DA882935; Tue, 15 Jun 2021 21:11:08 +0200 (CEST) Received: from mail-ot1-x335.google.com (mail-ot1-x335.google.com [IPv6:2607:f8b0:4864:20::335]) (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 C39FB82927 for ; Tue, 15 Jun 2021 21:11:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=macroalpha82@gmail.com Received: by mail-ot1-x335.google.com with SMTP id 66-20020a9d02c80000b02903615edf7c1aso15339706otl.13 for ; Tue, 15 Jun 2021 12:11:01 -0700 (PDT) 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=KqHm1lbS/JbaUNbi2XpAvOjOxVdVqT2wWu0dX7xXZqY=; b=JvF0q3CJqbwIkC9ayPvec2ybA6Sh4EwEYgKG9b+mXI35oWoJ9QpmsFUkRQtLOP3sN1 5VXX98+xKCDhj6nA36/sPoKzaTUYjc14yY1QHdC9uHmSR3Gf7y5u94DS8G++e6qxDRqu 8O7GYH9fE151KO85uRL21t7rP0yXoBZ/d21ed+GagDBW63bYjGOR91V5luVDckyfJygz 4hpPwsFSaKGkgd1qOEXx+0A+3cMc1tGEOYq271rZPAYHtafWcQpFqmktlEsiXLkbQh1h 5COozKbXa9dmsf1x50geJxF1PhdY2huk9ArX+7AjI+Rma7mHbWIHQac8VIaSQqBhERQd aCmw== 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=KqHm1lbS/JbaUNbi2XpAvOjOxVdVqT2wWu0dX7xXZqY=; b=Dfi/KNriA6HFmpuV6es+UOffLR9kh8gFHZwnFo4dU2MJ7t6YE63owYLtlhx7iw6e3H UUpPZZ/wzayiYZOwVX9pq3ferTFOOpEF5VqW/DPhs4Ds5Pa8/S0Y2vFvC492kgHxfFFa Gu20fFTvxffPHs1CG7c22qRspVQaRq1AO6xDhbAnQcRNQrGgXCY+RPXQC1pzUJ5ObDKo zduxuXMzka8EVKwaI2ldN6Hog/MCc41kb/XNdsFgn4ZRA9yoOwY2p5yd7pvSZguZc+Rj qsBlOhdqJdUJyT3jhmbOy0Pw4CyN/8h/wRq3dFcjZyNzsqD2kVskAfHs1ERPsDv1oygB 5l/g== X-Gm-Message-State: AOAM5327bTiKk3cyI1jo4R50JK+55v8v+vzxyJ5pYwJkcNx8TExdxxxB hpfQF55lEJKHckAk7okC7b5Z8Ct55qw= X-Google-Smtp-Source: ABdhPJx0osNhZTgot0uR45BJ2NpS/02eW2szf2OQnA9fbMGIPwp0nFnbfRU5Z9r10ZNcNOHCYE/Xcw== X-Received: by 2002:a9d:17cb:: with SMTP id j69mr574451otj.261.1623784260037; Tue, 15 Jun 2021 12:11:00 -0700 (PDT) Received: from wintermute.localdomain (cpe-76-183-134-35.tx.res.rr.com. [76.183.134.35]) by smtp.gmail.com with ESMTPSA id m10sm3960873oig.9.2021.06.15.12.10.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Jun 2021 12:10:59 -0700 (PDT) From: Chris Morgan To: u-boot@lists.denx.de Cc: heiko.stuebner@theobroma-systems.com, vigneshr@ti.com, jagan@amarulasolutions.com, kever.yang@rock-chips.com, philipp.tomsich@vrull.eu, sjg@chromium.org, macromorgan@hotmail.com Subject: [PATCH v4 5/5] rockchip: px30: add support for SFC for Odroid Go Advance Date: Tue, 15 Jun 2021 14:10:46 -0500 Message-Id: <20210615191046.11812-6-macroalpha82@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210615191046.11812-1-macroalpha82@gmail.com> References: <20210615191046.11812-1-macroalpha82@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.103.2 at phobos.denx.de X-Virus-Status: Clean From: Chris Morgan The Odroid Go Advance uses a Rockchip Serial Flash Controller with an XT25F128B SPI NOR flash chip. This adds support for both. Note that while both the controller and chip support quad mode, only two lines are connected to the chip. Additionally, a possible errata was found while testing the Linux driver, in that setting the tx mode to 2 would cause erases and writes to sometimes fail. Setting the rx mode to 2 and the tx mode to 1 for this reason, and to match the upcoming changes to Linux. Signed-off-by: Chris Morgan --- arch/arm/dts/rk3326-odroid-go2-u-boot.dtsi | 18 ++++++++++++++++++ arch/arm/dts/rk3326-odroid-go2.dts | 16 ++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/arch/arm/dts/rk3326-odroid-go2-u-boot.dtsi b/arch/arm/dts/rk3326-odroid-go2-u-boot.dtsi index 00767d2abd..d345f6a168 100644 --- a/arch/arm/dts/rk3326-odroid-go2-u-boot.dtsi +++ b/arch/arm/dts/rk3326-odroid-go2-u-boot.dtsi @@ -7,6 +7,16 @@ chosen { u-boot,spl-boot-order = &sdmmc; }; + + aliases { + i2c0 = &i2c0; + i2c1 = &i2c1; + mmc0 = &sdmmc; + serial1 = &uart1; + serial2 = &uart2; + spi0 = &sfc; + spi_flash = "/spi@ff3a0000/flash@0"; + }; }; &cru { @@ -57,6 +67,14 @@ u-boot,spl-fifo-mode; }; +&sfc { + u-boot,dm-pre-reloc; + + flash@0 { + u-boot,dm-pre-reloc; + }; +}; + &uart1 { clock-frequency = <24000000>; u-boot,dm-pre-reloc; diff --git a/arch/arm/dts/rk3326-odroid-go2.dts b/arch/arm/dts/rk3326-odroid-go2.dts index 8cd4688c49..4e3dceecbe 100644 --- a/arch/arm/dts/rk3326-odroid-go2.dts +++ b/arch/arm/dts/rk3326-odroid-go2.dts @@ -617,6 +617,22 @@ status = "okay"; }; +&sfc { + pinctrl-0 = <&sfc_clk &sfc_cs0 &sfc_bus2>; + pinctrl-names = "default"; + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <108000000>; + spi-rx-bus-width = <2>; + spi-tx-bus-width = <1>; + }; +}; + &tsadc { status = "okay"; }; -- 2.25.1