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=-6.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_HOTMAIL_RCVD2,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 5F547C48BDF for ; Fri, 18 Jun 2021 21:54:28 +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 3A39B61059 for ; Fri, 18 Jun 2021 21:54:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3A39B61059 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=hotmail.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 A437D82BD8; Fri, 18 Jun 2021 23:54:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=hotmail.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=hotmail.com header.i=@hotmail.com header.b="M+52KvCm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D098A82BC9; Fri, 18 Jun 2021 18:30:51 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11olkn20810.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eaa::810]) (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 4A3BC80C72 for ; Fri, 18 Jun 2021 18:30:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=hotmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=macromorgan@hotmail.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e+3nstgb5oWHIxABjdVCGT/WH3125a+pSK6QD28EXIsgoPiqv/5dR4WDczA0jprCZ9ioDuxGel3NxqCmIrSNjrdabzY6ev5YcF4u9e8/GSv6tV/vnZoRCi8L02e1de09fffMwZgQPba9YA4oBeFBZ9rc/PTpoQs5QAj7C8/TDT98flfD/o9MQkHS9HhrzhrpK630iPBEu6p4UWi5rztNr2f2eHPQCkYGLfrLUEY4kiPsQonx0tiPbhD0rQz2Jr/CTk4YTlD+qqOWvwvmeEo3EWysZE3eTe8dfjuiC1ot/L48PtHvjKnp5ckiLnplVVMmrbHV7jVidgEnTBC4Wjpddw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kaGxZ7eY5x92RFHIH1BAWDE4v8zYNkWARQNJ9iea0hY=; b=hkhO2pm4B1XYeF/2yS6y3H8SPEaRpzBedX3qUdjwMtIu90bvGo1SCkAqt3+iBxbWpA4vWBwxgQFPZ7UptaISi/3z2FjuP4ryb/ugn/pgYr3T72qnriTvTAPlO6WxGx+zLikZcy0iIb42iPAaR/6GkREMZnSR7Yymaib7RdvmKAUs66CWB/wrDgi93cGidXsSMjed503uiS3QUDHckSqfsfdHShwfOiZ7mEn6SgfEr9sK4vVN+/LhkhhULg2OOmWlxM1CqJu5iAwx/Gyu7MGlQYoeGB3BBNcWwY6Zuf9jtj2FmnkJ1IqBG3j43iPfMhHMFhrhsW1PS5dx1kQeFjVWqw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kaGxZ7eY5x92RFHIH1BAWDE4v8zYNkWARQNJ9iea0hY=; b=M+52KvCmWIh/q7MSTyaiPYDWFUruU9rOESBoaXzMbRYZzhkuzrqzyC1fTfdOj8K6L4hlvLVzAFFxMCrINfazL4MfPOOoLE0i6VOqt+7nieZFm7stbYKTngdA4APpDEb7OgdkWq6y7qYaOBqH+hkXWmcLX5fmIooR5NRTFMJVIJa4byyK1l/L9TstAUYVJkQ3al7eWxj0Y4+nKxEN+P6zNGQo/DinKz2/vbrAGdUZaU8ANwutkDQs6l6BxnwnROaA8h3SSmypYRiBxjI0xwMqoxAmhFgfppSW6XDCldwPBQtVFmqpmSMbHShXpLmnZOMe3B8nHjMxGrs1OSWwhLP4gw== Received: from DM6NAM11FT017.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::44) by DM6NAM11HT154.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::452) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.16; Fri, 18 Jun 2021 16:30:46 +0000 Received: from SN6PR06MB5342.namprd06.prod.outlook.com (2a01:111:e400:fc4d::53) by DM6NAM11FT017.mail.protection.outlook.com (2a01:111:e400:fc4d::145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.16 via Frontend Transport; Fri, 18 Jun 2021 16:30:45 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:F7A7B7DEE69CECADF197170AF8E9AD6E686A6885B27C577DC8C13CC1926F28A0; UpperCasedChecksum:41DC9C21083F7E5DA387557F4ADC7C4D059244FCA0405297026FAFFE0BE54186; SizeAsReceived:8774; Count:47 Received: from SN6PR06MB5342.namprd06.prod.outlook.com ([fe80::91a7:5b3:8e7c:621d]) by SN6PR06MB5342.namprd06.prod.outlook.com ([fe80::91a7:5b3:8e7c:621d%5]) with mapi id 15.20.4242.021; Fri, 18 Jun 2021 16:30:45 +0000 Date: Fri, 18 Jun 2021 11:30:43 -0500 From: Chris Morgan To: Kever Yang Cc: Chris Morgan , u-boot@lists.denx.de, heiko.stuebner@theobroma-systems.com, vigneshr@ti.com, jagan@amarulasolutions.com, philipp.tomsich@vrull.eu, sjg@chromium.org Subject: Re: [PATCH v4 0/5] rockchip_sfc: add support for Rockchip SFC Message-ID: References: <20210615191046.11812-1-macroalpha82@gmail.com> <89947c5c-c6af-3323-14cc-0f0faf4319e0@rock-chips.com> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <89947c5c-c6af-3323-14cc-0f0faf4319e0@rock-chips.com> X-TMN: [jCnAb+tLsIKsQo0yUG7KgvLO7lQrsM71] X-ClientProxiedBy: SA9PR10CA0002.namprd10.prod.outlook.com (2603:10b6:806:a7::7) To SN6PR06MB5342.namprd06.prod.outlook.com (2603:10b6:805:f9::31) X-Microsoft-Original-Message-ID: <20210618163043.GA33@wintermute.localdomain> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wintermute.localdomain (76.183.134.35) by SA9PR10CA0002.namprd10.prod.outlook.com (2603:10b6:806:a7::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.18 via Frontend Transport; Fri, 18 Jun 2021 16:30:44 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 47 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 0f264031-5da8-4f32-7482-08d932766c1d X-MS-TrafficTypeDiagnostic: DM6NAM11HT154: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eiMq7PY+/HpqrvumIT+n1sZ+7NMD6P1eDfmpxfpu0A4eiMz04RRV/x3selRAWKPDSJiEwnoaU+jdMDtPgcVZ7oLzOV8lvRUX4jZWp3GpYQfk/jd0R0n8IGdt3YIYMoaFrCdX7T08EEypxnIn3O5c8/NzgO5jCGe8sAhvQYJa2WwF+ivX0LQ++GZesasNrFGRxzjyaqN4zttbKdWDxd54NMaKRXAsc0+tqmX+VAC0N++pKSsoA6AefwMFvWLoA52sum+j6ArZco5OdzaqIknuZlj1ot1yt8KAvXMcX+Mh04vGErMgOaxtJMA0oCbr2py6JCoyFKi48bpMxxemwQrNgGDdIc5pnLQiWDEeZvSWVexQQPCMELqbfxkNRkb0ZqNa X-MS-Exchange-AntiSpam-MessageData: F13H4xN55G3mon7+IHvDkPqB3I8aX+mOGmgsVgwPD53VOpmwmRcwi/M0EWoEXgly8bqhf14vyojFWlMIzp4r21/qQB2vixiz2w06H8o8HeDertt4CQ16mDegdRQ1gX04jLuZiqNQh9gAX8VE8anE7w== X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0f264031-5da8-4f32-7482-08d932766c1d X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2021 16:30:45.9120 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT017.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6NAM11HT154 X-Mailman-Approved-At: Fri, 18 Jun 2021 23:54:21 +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.103.2 at phobos.denx.de X-Virus-Status: Clean On Fri, Jun 18, 2021 at 10:22:33AM +0800, Kever Yang wrote: > Hi Chris, > >     For this patch set, I would like waiting for kernel sfc driver merge > because there may have some update. Agreed. I just want to get this out there though in case anyone wants to test it. I'm okay with "pausing" the review for this one until the Linux driver is accepted upstream. On a related note, can you provide some additional docs regarding the BROM and how it interacts with the SFC? I found out through trial and error that it reads off of sector 0x10000 (instead of 0x08000 like the SD Card), and that like the SD card the Arm Trusted Firmware hates DMA reads in TPL/SPL modes. Is there anything else we should know if we want to boot an upstream SPL from it (note that I can already do this with this driver, just wanted to know if there were more "gotchas"). Thank you. > > > Thanks, > > - Kever > > On 2021/6/16 上午3:10, Chris Morgan wrote: > > From: Chris Morgan > > > > Changes from v3: > > - Added "rockchip_sfc_adjust_op_work()" function from proposed Linux > > driver to fix potential issue on hardware. Note I never noticed > > this issue while testing, so I cannot test if it fixed any specific > > issue for me. > > - Updated of-compatible string back to "rockchip,sfc" to match what > > is currently proposed for upstream driver. The hardware itself > > has multiple versions but a register is present in the hardware that > > is read by the driver to set version specific functionality. > > - Updated px30.dtsi and rk3266-odroid-go2.dts device-trees so that > > sfc nodes match what is in upstream. > > > > Changes from v2: > > - Resending due to glitch with patch file truncating final two lines > > on patch 1/5 and incorrect patch version number on patch 5/5. > > > > Changes from v1: > > - Reworked code to utilize spi-mem framework, and based it closely > > off of work in progress code for mainline Linux. > > - Removed DMA, as it didn't offer much performance benefit for > > booting (in my test cases), added complexity to the code, and > > interfered with A-TF. > > - Updated the names of the bindings to match the work in progress > > Linux code. > > - Moved alias to u-boot specific device-tree for Odroid Go Advance. > > Alias is updated with the spi0 node pointing to the SFC to > > help the sf command as well as facilitate booting from the SFC. > > - Note 2 below no longer applies, as rebasing this off of upstream > > code should allow the device to work for NAND, and by utilizing > > the spi-mem framework it no longer has to extract the parameters > > from the dm_spi_ops.xfer. > > > > Known Issues Remaining with this Patch Series: > > > > 1) I don't know the best way to upstream the XTX25F128B flash chip. > > This chip should use a continuation code for the manufacturer ID, > > however I cannot seem to find any way to actually read the continuation > > code as one may not be present. 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. > > > > 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. FIFO > > mode was removed from the driver to simplify it and for this reason. > > > > Tested: Read (works) > > Write (works) > > 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 | 18 + > > arch/arm/dts/rk3326-odroid-go2.dts | 16 + > > arch/arm/mach-rockchip/px30/px30.c | 64 +++ > > drivers/mtd/spi/Kconfig | 6 + > > drivers/mtd/spi/spi-nor-ids.c | 4 + > > drivers/spi/Kconfig | 8 + > > drivers/spi/Makefile | 1 + > > drivers/spi/rockchip_sfc.c | 513 +++++++++++++++++++++ > > 9 files changed, 668 insertions(+) > > create mode 100644 drivers/spi/rockchip_sfc.c > > > >