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=-7.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 6F387C47080 for ; Wed, 2 Jun 2021 00:35:57 +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 7488B61026 for ; Wed, 2 Jun 2021 00:35:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7488B61026 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 CA45D82D39; Wed, 2 Jun 2021 02:35:43 +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="ITO8ZTSZ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D418082CB2; Tue, 1 Jun 2021 18:54:39 +0200 (CEST) Received: from mail-oi1-x234.google.com (mail-oi1-x234.google.com [IPv6:2607:f8b0:4864:20::234]) (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 6C19182CB2 for ; Tue, 1 Jun 2021 18:54:36 +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-oi1-x234.google.com with SMTP id x15so4604oic.13 for ; Tue, 01 Jun 2021 09:54:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=WJuUmHwPNJj2IgboBKkM8L2ul6QzlOENlMgHvfB920s=; b=ITO8ZTSZxJoOixIPWRc5QfA3NNxoNpNSuI8UiW7ne8jB5YvHir8BQbnrOiWRRcGszY b8FOjhH2zplItOxQLBtMEfyg9Zld2OSXowMJ2CmVxPawUxIss8eNeDEwIfbV2KHU06R/ cCuFMN2gdJqgvrEbb0iRpi408EK7UqN64nT8Srg8upGX5jqAPtxeL5+54N8cwBQS3jTt F3BFAaKgIBGDwTuTmfHQ4S0rUveu1sMid3PhqP2nYjNP4BZnsJFw7XDYzSQq0VvVTn7v OZXnntJwOXBotBhwcRzjKVvKPL6x2Os9aFHIu3JmzISUOXnaybBITnwS19/6FMH4V+pj al3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=WJuUmHwPNJj2IgboBKkM8L2ul6QzlOENlMgHvfB920s=; b=f+rRYHeo8GF75zpQ6csl5wM5RpdcWm3bgwNYEDQceDH+KnvFScjc/73p2h78s0XF+U FqcxgkcMoFKfLQHe3jSkMVvj4Y1pIDi022rOi6y8Xpoy3xLyRhYwzjp1kW1MGdKYPtMO EA+UG0WAlS4W4RvsZzkGNXmgRg2CusaV/FGGxviWZvg6+UExP9eLuc/2YKCp6VBBbJDt og0ZUJsTL0S/tQ2XggTOQNGeZUujaqRTmxjEAxduJH4YpyoEcdkxrGEkkGsrRmDpWUi/ dxIwNtIZV8SdpOTHlFO9SrDM91FOxUnJk2OpaEIKVBbgJAPe6FZlB3LBL1OStUVdIvTc SWiw== X-Gm-Message-State: AOAM530TOoEFzPNSadeBw7Sl2jGu8pE9hpYmDmBOCSmJzxx8sxhihWb6 7CFuccGghFg23nzmV1ANCSQ= X-Google-Smtp-Source: ABdhPJxyGHYc4qpk8AdyeOJB1s6T1EkZeyjS7RKNA0pesj9a662eHYjJZysT1gqS43EVpy34sFg6Cw== X-Received: by 2002:a05:6808:6:: with SMTP id u6mr660030oic.80.1622566474918; Tue, 01 Jun 2021 09:54:34 -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 m1sm3894388otq.12.2021.06.01.09.54.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 09:54:34 -0700 (PDT) Date: Tue, 1 Jun 2021 11:54:30 -0500 From: Chris Morgan To: Kever Yang Cc: u-boot@lists.denx.de, heiko.stuebner@theobroma-systems.com, vigneshr@ti.com, jagan@amarulasolutions.com, sjg@chromium.org, Chris Morgan , =?utf-8?B?6LW15Luq5bOw?= , =?utf-8?B?5p6X6byO5by6?= Subject: Re: [RFC 0/5] rockchip_sfc: add support for Rockchip SFC Message-ID: <20210601165430.GA56@wintermute.localdomain> References: <20210525214921.16606-1-macroalpha82@gmail.com> <8416db10-aea9-7717-3121-81802c049509@rock-chips.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8416db10-aea9-7717-3121-81802c049509@rock-chips.com> X-Mailman-Approved-At: Wed, 02 Jun 2021 02:35:40 +0200 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.102.4 at phobos.denx.de X-Virus-Status: Clean On Tue, Jun 01, 2021 at 08:22:09PM +0800, Kever Yang wrote: > Add Yifeng from rockchip. > > Hi Chris, > >     First of all, I think you should remain the origin author info in the > signed-off. Okay, I can do that. Please note that since I submitted this I was asked to redo the upstream linux proposed driver to use the spi-mem framework. I think for now honestly I'd like to abandon this patch and resubmit a little later with one that is more or less the same (using the spi-mem framework) as the Linux driver. https://patchwork.ozlabs.org/project/linux-mtd/patch/20210528170020.26219-2-macroalpha82@gmail.com/ > > > Hi Yifeng, > >     Please help to review this driver. > > > Thanks, > > - Kever > > On 2021/5/26 上午5:49, Chris Morgan wrote: > > From: Chris Morgan > > > > Requesting comments for a proposed patchset for adding the Rockchip > > serial flash controller to u-boot. The goal of these patches is to > > enable it for the Odroid Go Advance so that it may eventually boot > > exclusively from the SFC on mainline U-boot (I have tested this and > > it works). > > > > The specific help I need with this patch is: > > > > 1) I don't know the best way to upstream the XTX25F128B flash chip. > > This chip uses a continuation code for the manufacturer ID, however I > > cannot seem to find any way to actually read the continuation code. > > There is a risk of this driver, used as-is, to collide with another > > chip which has the same manufacturer ID with a different continuation > > code. > > > > 2) The Rockchip SFC driver itself (as it is mostly as-is from the BSP > > U-Boot sources) supports SPI NAND and chips of varying sizes, but my > > implementation only permits me to test with a single 128Mb flash chip. > > The driver itself does some checking on the bitlen in the routine > > rockchip_sfc_xfer() which is what is called for the dm_spi_ops.xfer. > > I'm not sure if there is a better way to do this. Additionally, I have > > to bit-shift the address written to the SFC as I suspect the value is > > meant to be left justified, but I never tested it further. > > > > Additionally, it might be worth mentioning but I noticed the Rockchip > > BROM will only boot the TPL/SPL off of the SFC if I write it to address > > 0x10000. This is not documented and different than the address looked > > at for SD card booting (512 * 64 = 0x8000 for SD Card booting). Also, > > like the SD card driver I can confirm that if DMA is enabled at the SPL > > stage A-TF seems to fail silently, then when Linux loads it hangs. > > There is an ifdef to force FIFO mode only in the SPL stage. > > > > Tested: Read (works) > > Write (works if you write to an erased sector) > > Erase (works) > > SPL Read (works if you edit the u-boot,spl-boot-order) > > > > Chris Morgan (5): > > spi: rockchip_sfc: add support for Rockchip SFC > > rockchip: px30: Add support for using SFC > > rockchip: px30: add the serial flash controller > > mtd: spi-nor-ids: Add XTX XT25F128B > > rockchip: px30: add support for SFC for Odroid Go Advance > > > > arch/arm/dts/px30.dtsi | 38 ++ > > arch/arm/dts/rk3326-odroid-go2-u-boot.dtsi | 10 +- > > arch/arm/dts/rk3326-odroid-go2.dts | 22 + > > arch/arm/mach-rockchip/px30/px30.c | 64 ++ > > drivers/mtd/spi/Kconfig | 6 + > > drivers/mtd/spi/spi-nor-ids.c | 8 + > > drivers/spi/Kconfig | 8 + > > drivers/spi/Makefile | 1 + > > drivers/spi/rockchip_sfc.c | 652 +++++++++++++++++++++ > > 9 files changed, 926 insertions(+), 1 deletion(-) > > create mode 100644 drivers/spi/rockchip_sfc.c > > > >