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=-10.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 2576BC47082 for ; Sat, 5 Jun 2021 15:18:29 +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 6C6E3613DF for ; Sat, 5 Jun 2021 15:18:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6C6E3613DF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rock-chips.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 F0DB680C94; Sat, 5 Jun 2021 17:18:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 4D90B82B1C; Sat, 5 Jun 2021 09:37:06 +0200 (CEST) Received: from regular1.263xmail.com (regular1.263xmail.com [211.150.70.206]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2945781FB2 for ; Sat, 5 Jun 2021 09:37:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=jon.lin@rock-chips.com Received: from localhost (unknown [192.168.167.235]) by regular1.263xmail.com (Postfix) with ESMTP id 0C3831B16; Sat, 5 Jun 2021 15:36:57 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-ANTISPAM-LEVEL: 2 X-SKE-CHECKED: 1 X-ABS-CHECKED: 1 Received: from [172.16.12.73] (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P31751T140094889510656S1622878615807423_; Sat, 05 Jun 2021 15:36:57 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <5dcd7577f463ba7f51b200bb45b3642e> X-RL-SENDER: jon.lin@rock-chips.com X-SENDER: jon.lin@rock-chips.com X-LOGIN-NAME: jon.lin@rock-chips.com X-FST-TO: zyf@rock-chips.com X-RCPT-COUNT: 9 X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-System-Flag: 0 Subject: Re: [RFC 0/5] rockchip_sfc: add support for Rockchip SFC To: Chris Morgan Cc: =?UTF-8?B?5p2o5Yev?= , u-boot , "heiko.stuebner" , vigneshr , jagan , sjg , Chris Morgan , =?UTF-8?B?6LW15Luq5bOw?= References: <20210525214921.16606-1-macroalpha82@gmail.com> <8416db10-aea9-7717-3121-81802c049509@rock-chips.com> <20210601165430.GA56@wintermute.localdomain> <20210604214218242796317@rock-chips.com> <20210604144058.GB27295@wintermute.localdomain> From: Jon Lin Message-ID: <3fe04456-9ec9-acca-fb15-edda503bd9e4@rock-chips.com> Date: Sat, 5 Jun 2021 15:37:01 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210604144058.GB27295@wintermute.localdomain> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Mailman-Approved-At: Sat, 05 Jun 2021 17:18:23 +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 6/4/21 10:40 PM, Chris Morgan wrote: > On Fri, Jun 04, 2021 at 09:42:18PM +0800, 林鼎强 wrote: >> Hi Chris: >> >> It's my honor to read about spi-rockchip-sfc driver from you, and your code has made a big difference to me. >> >> Recently, we happen to be willing to submit the spi-mem rk sfc drivers, and we have tried some of them >> in the internal process. Compared with the RK internal code, I have the following thoughts on your code: >> 1) Only support spi-nor, not support spi-nand >> 2) Only support rx_dual, tx_quad, not support tx_dual, tx_quad >> 3) Some of the code may be further simplified, such as "rockchip_sfc_register_all" >> 4) Some of the logic may be further simplified, such as "rockchip_sfc_init" >> 5) Doesn't support SFC ver4 ver5 althought witch is compatibled with lower version >> >> In order to support all these features, I adjust the drivers on the basis of your code witch is attach to these mail, these >> drivers have been test in linux 5.10 rk3568 board, and I'm still doing more strict tests. >> >> So I suggest that we complete it together, or we may consider transferring it to me for submission If I have the honor. >> >> I'm still unfamiliar with the community culture. I hope I didn't offend you. If I have, I'll say sorry in advance. >> Best wishes. > I am absolutely fine with you taking this on, and will be happy to help > you in any way I can. I only started working on support for this > because I wanted it supported in both Linux and U-Boot mainline, and > didn't see any progress being made (so I thought I would do it myself). > Basically, my goal all along has been to ensure the Odroid Go Advance > is fully supported in mainline Linux (and U-boot), and that requires > we get the audio (done), SFC (in progress), crypto, battery, charger, > and everything else (done) supported. > > I trust you are better able to develop/test this than I am, as I only > have access to some technical documents and a single PX30 based device > to test this on. > > Please CC me when you are ready to submit upstream to Linux and U-boot > and I will happily test it on my hardware. If you don't have a U-boot > driver in progress let me know and I can start working on one. > > Thank you. I'm glad to receive your reply and your understanding so soon. I'll talk about my plan directly. If there is no obvious objection,I'll go on with it. Firstly, I will submit the support for the my first version of Linux drivers next week which is base on your series submission. After browsing your submission, there will be the following changes: 1) [RFC,v4,1/8] change with the "Rob Herring" comment 2) [RFC,v4,2/8] update driver 3) All dt patches, make a little change to compatible with RK SDK [RFC,v4,8/8] arm64: dts: rockchip: Enable SFC for Odroid Go Advance [RFC,v4,7/8] arm64: dts: rockchip: Add SFC to RK3308 [RFC,v4,6/8] arm: dts: rockchip: Add SFC to RV1108 [RFC,v4,5/8] arm: dts: rockchip: Add SFC to RK3036 [RFC,v4,4/8] clk: rockchip: Add support for hclk_sfc on rk3036 [RFC,v4,3/8] arm64: dts: rockchip: Add SFC to PX30 [RFC,v4,2/8] spi: rockchip-sfc: add rockchip serial flash controller [RFC,v4,1/8] dt-bindings: rockchip-sfc: Bindings for Rockchip serial flash controller Secondly, Keep devolop uboot drivers base on your serieas submission https://patchwork.ozlabs.org/project/uboot/list//?series=245724 submit the code under uboot as soon as possible. Finally I'll keep focus on the new comments about all these linux patches,then fix it until they are merged. Best wishes. >> >> >> jon.lin@rock-chips.com >> >> From: Kever Yang >> Date: 2021-06-02 09:27 >> To: Chris Morgan >> CC: u-boot; heiko.stuebner; vigneshr; jagan; sjg; Chris Morgan; 赵仪峰; 林鼎强 >> Subject: Re: [RFC 0/5] rockchip_sfc: add support for Rockchip SFC >> Hi Chris, >> >> On 2021/6/2 上午12:54, Chris Morgan wrote: >>> 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. >> >> >> This sounds better, then we can wait for driver with new framework. >> >> Thanks, >> >> - Kever >> >>> 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 >>>>> >> >> >> > > > > >