Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp695804pxm; Thu, 3 Mar 2022 02:47:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJzqOpgZnsXo3rpzMXIIilW1tthbLN58RajwVYEcr7W50QrhyglMtMMYbQGPCFeETh6OFkKz X-Received: by 2002:a17:902:ce8c:b0:151:8c12:2ce3 with SMTP id f12-20020a170902ce8c00b001518c122ce3mr10840289plg.135.1646304423257; Thu, 03 Mar 2022 02:47:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646304423; cv=none; d=google.com; s=arc-20160816; b=fp+E8KT8EXqrBRtu7KJtwuQl0ac3mWcWuKWvKMEYSDXLfLYYann15Td0ty2c1K0YM6 No7Qixjvxw+99pb7Mv8R4QdHGUaFxGW99QQUgbsZzmNSFLL/bYAH6wc+Rq8pZSLstX9o 1gHK/ei5RWjGZe6e31KEoeU+wgPKzNmHHqdEMS3DAQjmk04LHKXLjbxtgem9uuvmtdro 3P8pwclwesfac5YPaDWtT9wlKd1ScBVLnKEoUeD1SQ3EI1u2jzl/1AtEUsDpbJx8FEPT S9H5NSh+KWT8Qfu2BOZYXX6hb4cZlMbDj3/rstgdl4rmFUTqNcmoFI56LZ1i2p6f6ooy I3zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=G9PHk5b8ybcVtwN7kEtMFnRB/ixoL3gdzwNYrWBekH4=; b=sQ/cviHRUEjPzHE9cx9SKMnlvdFmTwkLTXgLmOaduClkOF2CGWx63XHaGW2EjWvtkz V4BF1ZJQEs7f7u4DTs13A6Bs/o/xPwnYqDhQ0MTwynsnS4LhWZ+asxgiz7h4RUGhCNCb MZTOvFL9YuP4s3VMRD3eDjAgQK32H2QsSwqxgRYPXXPQ+f8wB7RmrFL58KnexwMKkF12 49+9sjo+ah0BnyiqwbjJmiG8Zx7gxw6ISMUQagMmHCXOtTZgnUOx4MM0UEi0Lz/a2RuE fA/EwnvBPlMeLxtvFx9BP6AII6I8ZqTHmi+3vh7vhok5NyjA00TfqI99h8C2raEf+uiL /UwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@jms.id.au header.s=google header.b=iGc3tjeR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f33-20020a635121000000b0037264ef5f8bsi1622497pgb.859.2022.03.03.02.46.48; Thu, 03 Mar 2022 02:47:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@jms.id.au header.s=google header.b=iGc3tjeR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232153AbiCCKCU (ORCPT + 99 others); Thu, 3 Mar 2022 05:02:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230109AbiCCKCS (ORCPT ); Thu, 3 Mar 2022 05:02:18 -0500 Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DE6A17583E; Thu, 3 Mar 2022 02:01:33 -0800 (PST) Received: by mail-qt1-x836.google.com with SMTP id s6so771623qtc.4; Thu, 03 Mar 2022 02:01:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jms.id.au; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=G9PHk5b8ybcVtwN7kEtMFnRB/ixoL3gdzwNYrWBekH4=; b=iGc3tjeRFO5Rq2XYTcdMye2mUJQXxEERvcn+LrCIDZkAydY6bGbK56wkpjUHFc0TjF LECSYDRcmRUtSG7JBAXl3WSRHANYn5S2QY+ktWPAjNaYVap0AlSjvhdAzmLMvzK1WlaJ zJRdPYVyaxF/ju9TGZyi8ifWNzfUbUVZusKPo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=G9PHk5b8ybcVtwN7kEtMFnRB/ixoL3gdzwNYrWBekH4=; b=XfbOEtK60N0hQBJGzdMORZEuKrm07xAS133scmVnuDTN+xZj/otZvXbwPnQPJ3k0HZ InAfVsq5COposvip71tx6ilJDbjLbi5hnd9M7MJpMCitPrjhZopt1cW065n2+5lM8U6c 1/AZL21VXSo3MpbL4yj6HgeWmK/QWOXmpnHrj080tFzty7j68Udh8hXgzx/5LxR/gG2z /9gSEaYH60I8+tqoB+TMpmTi51v3g7ToiFz9acnczeHm0u2SVCDVlqF748EoS68h1S/2 7o/GYnv5qodakgMZBACFvGF2pXP7gl0J2cic+pHlosNcA2ETG7F6wK4qOKQHQW0v2pIm JNEw== X-Gm-Message-State: AOAM532vV5GS8KRf1ULWsMv5J8X3NIGtpYz0m6efyL6BLvFlEwcnweJF 8DR6lldwZGXtDvYkJWgFXdakmtbXV78rHOK686E= X-Received: by 2002:ac8:5d89:0:b0:2df:f357:c681 with SMTP id d9-20020ac85d89000000b002dff357c681mr20144873qtx.475.1646301692215; Thu, 03 Mar 2022 02:01:32 -0800 (PST) MIME-Version: 1.0 References: <20220302173114.927476-1-clg@kaod.org> In-Reply-To: <20220302173114.927476-1-clg@kaod.org> From: Joel Stanley Date: Thu, 3 Mar 2022 10:01:20 +0000 Message-ID: Subject: Re: [PATCH v2 00/10] spi: spi-mem: Add driver for Aspeed SMC controllers To: =?UTF-8?Q?C=C3=A9dric_Le_Goater?= , Tao Ren , John Wang Cc: linux-spi@vger.kernel.org, linux-mtd , Mark Brown , Tudor Ambarus , Pratyush Yadav , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , linux-aspeed , Andrew Jeffery , Chin-Ting Kuo , devicetree , Rob Herring , Linux ARM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2 Mar 2022 at 17:31, C=C3=A9dric Le Goater wrote: > > Hi, > > This series adds a new SPI driver using the spi-mem interface for the > Aspeed static memory controllers of the AST2600, AST2500 and AST2400 > SoCs. > > * AST2600 Firmware SPI Memory Controller (FMC) > * AST2600 SPI Flash Controller (SPI1 and SPI2) I've performed read and write tests on the 2600 controllers, and the driver seems stable at the settings you have in the device tree. Tested-by: Joel Stanley I've added Tao and John to cc as they have tested the 2400 and 2500, and I'm sure will be able to provide some Tested-by. Cheers, Joel > * AST2500 Firmware SPI Memory Controller (FMC) > * AST2500 SPI Flash Controller (SPI1 and SPI2) > * AST2400 New Static Memory Controller (also referred as FMC) > * AST2400 SPI Flash Controller (SPI) > > It is based on the current OpenBMC kernel driver [1], using directly > the MTD SPI-NOR interface and on a patchset [2] previously proposed > adding support for the AST2600 only. This driver takes a slightly > different approach to cover all 6 controllers. > > It does not make use of the controller register disabling Address and > Data byte lanes because is not available on the AST2400 SoC. We could > introduce a specific handler for new features available on recent SoCs > if needed. As there is not much difference on performance, the driver > chooses the common denominator: "User mode" which has been heavily > tested in [1]. "User mode" is also used as a fall back method when > flash device mapping window is too small. > > Problems to address with spi-mem were the configuration of the mapping > windows and the calibration of the read timings. The driver handles > them in the direct mapping handler when some knowledge on the size of > the flash device is know. It is not perfect but not incorrect either. > The algorithm is one from [1] because it doesn't require the DMA > registers which are not available on all controllers. > > Direct mapping for writes is not supported (yet). I have seen some > corruption with writes and I preferred to use the safer and proven > method of the initial driver [1]. We can improve that later. > > The driver supports Quad SPI RX transfers on the AST2600 SoC but it > didn't have the expected results. Therefore it is not activated yet. > There are some issues on the pinctrl to investigate first. > > The series does not remove the current Aspeed SMC driver but prepares > ground for its removal by changing its CONFIG option. This last step > can be addressed as a followup when the new driver using the spi-mem > interface has been sufficiently exposed. > > Tested on: > > * OpenPOWER Palmetto (AST2400) > * Facebook Wedge 100 BMC (AST2400) by Tao Ren > * Evaluation board (AST2500) > * Inspur FP5280G2 BMC (AST2500) by John Wang > * Facebook Backpack CMM BMC (AST2500) by Tao Ren > * OpenPOWER Witherspoon (AST2500) > * Evaluation board (AST2600 A0 and A3) > * Rainier board (AST2600) > > [1] https://github.com/openbmc/linux/blob/dev-5.15/drivers/mtd/spi-nor/co= ntrollers/aspeed-smc.c > [2] https://patchwork.ozlabs.org/project/linux-aspeed/list/?series=3D2123= 94 > > Thanks, > > C. > > Changes in v2: > > - Fixed dt_binding_check warnings (Rob) > - New entry in MAINTAINERS > - Addressed Lukas comments regarding the SPI controller registration > and device removal. Checked with driver bind/unbind > - Introduced setup and cleanup handlers and removed routine looping > on the DT children properties (Pratyush) > - Clarified in commit log requirements for training. > - Removed defconfig changes of patch 1 since they were reverted in > the last patch (Joel) > > C=C3=A9dric Le Goater (10): > mtd: spi-nor: aspeed: Rename Kconfig option > ARM: dts: aspeed: Adjust "reg" property of FMC/SPI controllers > dt-bindings: spi: Add Aspeed SMC controllers device tree binding > spi: spi-mem: Add driver for Aspeed SMC controllers > spi: aspeed: Add support for direct mapping > spi: aspeed: Adjust direct mapping to device size > spi: aspeed: Workaround AST2500 limitations > spi: aspeed: Add support for the AST2400 SPI controller > spi: aspeed: Calibrate read timings > ARM: dts: aspeed: Enable Dual SPI RX transfers > > drivers/spi/spi-aspeed-smc.c | 1186 +++++++++++++++++ > .../bindings/spi/aspeed,ast2600-fmc.yaml | 90 ++ > MAINTAINERS | 10 + > arch/arm/boot/dts/aspeed-g4.dtsi | 12 +- > arch/arm/boot/dts/aspeed-g5.dtsi | 16 +- > arch/arm/boot/dts/aspeed-g6.dtsi | 17 +- > drivers/mtd/spi-nor/controllers/Kconfig | 4 +- > drivers/mtd/spi-nor/controllers/Makefile | 2 +- > drivers/spi/Kconfig | 11 + > drivers/spi/Makefile | 1 + > 10 files changed, 1330 insertions(+), 19 deletions(-) > create mode 100644 drivers/spi/spi-aspeed-smc.c > create mode 100644 Documentation/devicetree/bindings/spi/aspeed,ast2600-= fmc.yaml > > -- > 2.34.1 >