Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp615392pxb; Tue, 15 Feb 2022 23:54:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJxC0tCfxi+tJisy2Br/yflMjLLKOTl5DcvGnFlbI9uFGfaiUayJceXnBijo7abHrzKSchk1 X-Received: by 2002:a63:ff54:0:b0:373:520f:a01d with SMTP id s20-20020a63ff54000000b00373520fa01dmr1287979pgk.394.1644998055258; Tue, 15 Feb 2022 23:54:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644998055; cv=none; d=google.com; s=arc-20160816; b=UreHVOtJ5dA4FsURqE/cJFTBKuX1ZgHQArHt0pWcZqQCnKo5TR1v6BHfAdkIMiKKSw 1qidam+SFkq9AYZDhD/hkTUZA6LxP4J3/hl6Ajsq7EjlNaeb3PEE7JmGY65J897obM7M a/ox8pJsLHANkUQlp+uopakLSEf8LNY4bzlpkAg9PTNoniuqV+VlHTi2NIpIlE1HcmME XNSBr5vxk3i7TcP38VapaW6DVM7aKjo+gWrd+RODfD9XpZpuMD+xLqU20XjTOjLQL7uX 6VHn9zPVtMNG9Pconi/QCnEOBGgikp7CW8ydipS7MD9UaRhe7r3NCEyNHAKJKD9jtX3K 0O6Q== 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=pOcJAEz2qU41PX9tifsFjG0wojUZW1SvJzugMZiYuC0=; b=k8wuhMk9C20NLn4/7qNo04+A9kWkG2yuWPnPynbrgrNDZpHj9hzhfUbg5v74sPCRoe BOhaFAp8YjfSXyScmzLdTsNanVYnBrPvIE2cRYwjyM34OzaUq9Dd0WIvUZlWU56WeeUL E1cm/wx3Up6bQM4zrZRVsyrPZVrD2/ZuLoQ6oLeFhc97eLPtzwuQe2nVeT6uJrqmSZg+ Yc59hYapKQwdAoJIYvPLVfT/tU8Nj+yjExberLE6HaR+nm/JZKzc4vJwwuHMDq5ZQZkb RPiowCT0CcL19Br//ps0kjBz+ALi9hz+2uUJUjGMfaezoDO4mKnzf9xV7tC07n7oyQQb 3asw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@jms.id.au header.s=google header.b="nqq/1QEd"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id g186si4668964pgc.790.2022.02.15.23.54.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 23:54:15 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@jms.id.au header.s=google header.b="nqq/1QEd"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6CE87DF76; Tue, 15 Feb 2022 23:21:52 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229997AbiBPHVj (ORCPT + 99 others); Wed, 16 Feb 2022 02:21:39 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:59356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229991AbiBPHVg (ORCPT ); Wed, 16 Feb 2022 02:21:36 -0500 Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6E43205FC; Tue, 15 Feb 2022 23:21:16 -0800 (PST) Received: by mail-qt1-x834.google.com with SMTP id s1so1282528qtw.9; Tue, 15 Feb 2022 23:21:16 -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=pOcJAEz2qU41PX9tifsFjG0wojUZW1SvJzugMZiYuC0=; b=nqq/1QEdzD/5W/nv2zTp9XXZj9GEXhlgKtfxNAWzCJpuPUnCuJDSykqaLEkUu73Eee bpXiXJ2uphU0Cix+zo+9i2ba1WtVKzy4o7JqsKHE9ClIbqu0kFBMDG+Q5jLFF5yisf+P DgWLheZ+6e0nB1COWgkhri2ulmv9D5ph51brU= 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=pOcJAEz2qU41PX9tifsFjG0wojUZW1SvJzugMZiYuC0=; b=b3DuuDw7rAfzLypkZTQ9E8Ziy8CX8Cy9lMZQUWibDXR1g7+sodh68U5eB9mS/yVdT9 UwqTWQtaOm/xqIpuoF/XYPOx/Sn0qdM73U/KFYDgoWvp8fXuKMVzaXWHmVnJZ731+JzE uvxLAEDhE7WEuYXvPFeEdxYweXKCLOCgybMV/++2rAvYM0WI8Sb4qzcLRmAGU4Fzmpns P08Y7b+mLmk+4+BLa2u/i2uVeKoajISw6X+ob++m2IYN2XEc8UldRTI2rUz9MhNh5Tnv UgFcpWkAorDKiLZWmLstyceSNW/ts7TUNME6lpQja6wzN7fVo4OgZW/0IJYpwkC+yBgY XmpA== X-Gm-Message-State: AOAM5327nLVOYUmuUj9W2hsR+btNLFxGI+kKkcP7ZTxHDVz8w+PnvTTf 3sTB/d/vmqTQrT3plpYon64EJzbUFLM423Wk0Ss= X-Received: by 2002:ac8:5b91:0:b0:2db:acb7:2412 with SMTP id a17-20020ac85b91000000b002dbacb72412mr1055351qta.475.1644996075867; Tue, 15 Feb 2022 23:21:15 -0800 (PST) MIME-Version: 1.0 References: <20220214094231.3753686-1-clg@kaod.org> In-Reply-To: <20220214094231.3753686-1-clg@kaod.org> From: Joel Stanley Date: Wed, 16 Feb 2022 07:21:04 +0000 Message-ID: Subject: Re: [PATCH 00/10] spi: spi-mem: Add driver for Aspeed SMC controllers To: =?UTF-8?Q?C=C3=A9dric_Le_Goater?= 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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,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 Mon, 14 Feb 2022 at 09:42, 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) > * 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. > This needs more tests. > > 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) > * Evaluation board (AST2500) > * OpenPOWER Witherspoon (AST2500) > * Evaluation board (AST2600 A0) > * Rainier board (AST2600) Looks great! Thanks for doing this work C=C3=A9dric. I reviewed all of the patches. The device tree and defconfig ones, which we will send via my aspeed tree, are good to go. The others look good too, to the best of my knowledge. I'll do some more testing of your v2 when you send it out. Cheers, Joel > > [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. > > C=C3=A9dric Le Goater (10): > mtd: spi-nor: aspeed: Rename Kconfig option > 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 > spi: aspeed: Activate new spi-mem driver > > drivers/spi/spi-aspeed-smc.c | 1241 +++++++++++++++++ > .../bindings/spi/aspeed,ast2600-fmc.yaml | 92 ++ > arch/arm/boot/dts/aspeed-g4.dtsi | 6 + > arch/arm/boot/dts/aspeed-g5.dtsi | 7 + > arch/arm/boot/dts/aspeed-g6.dtsi | 8 + > drivers/mtd/spi-nor/controllers/Kconfig | 4 +- > drivers/mtd/spi-nor/controllers/Makefile | 2 +- > drivers/spi/Kconfig | 11 + > drivers/spi/Makefile | 1 + > 9 files changed, 1369 insertions(+), 3 deletions(-) > create mode 100644 drivers/spi/spi-aspeed-smc.c > create mode 100644 Documentation/devicetree/bindings/spi/aspeed,ast2600-= fmc.yaml > > -- > 2.34.1 >