Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp207803rdh; Tue, 13 Feb 2024 14:28:20 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXP02NQnOaFRAhOGHGRvuuLK31SmT/P7ogoVPG60k1/0x5rxBFqyltZjN/xWH3yXlwpBGCeQ0UaJHarPXZGpbIy/x5y7IuMHGqAAQh12A== X-Google-Smtp-Source: AGHT+IFmCQS9CRgdKFCh4gabzu+B2ksnkau8QUytJCwNQXp0DJHAZnrRmjU3tLayl3Kt4h4IhEPN X-Received: by 2002:a05:6358:b00d:b0:176:40d5:2bd5 with SMTP id l13-20020a056358b00d00b0017640d52bd5mr837606rwn.6.1707863300150; Tue, 13 Feb 2024 14:28:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707863300; cv=pass; d=google.com; s=arc-20160816; b=beDTsJk7VKihxCLiZmnzI9URMEn0V6+xvoBWM10TM8r2rpl6Vk5gPP/XPcxV1DqX94 j9UONe1a6x2FaVoHAwacPB715xtF2QCLn8zIW746kTQZCG4sLqpVq1s+X56NDXn2423o bqpibh98DKQ63PgR4aLKv2yJSClXzE6Y2FdO1c5cr/tZadr1DsgCzT3EVfzReUVlSMad C12IcCB9eLFv3rJ83Q7jbc84Oqeo9nxABEV64Uuu4x2/9QOBhuk9qrm1Zu1/bJLSumQq nRtjvh14sDdRyCsx98vWc0lkjfHmFZMFhAyDO4H8QRJdw/KNvoFWHSslwroqgxGPGhdo p64A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=uVN+1UOXyAcEBTHiIyYaTXRY6j8rUi7ryuQsoKWFq8g=; fh=yDGCGzoD1WwdW9iwu2FyDczOODXe/1gWrCRf/jNwuWc=; b=KqPYcmPFNyH/u9xrb7SaO0nigzTBjavtje+E4S16lwkrYqqhSnFqrHHm0Vc9TGo4RY Vw03eEv3y3oaFBZ2fBsL3Zfdzyqar6YK2f+Ci+eXPnlDexkkcVOiDR5YeVhnlDLscCvO 1q6Rer2tT16vxGs+/M9SvJtfakiIkNjef10K0Iz07Kc10FO+v1DK81soqSDr/+RPX6Mr /4T0hwweW30Mqb5SQFEcF/viybPyOSGoedGZenFt050EXc120NwzAXVJREAPpRO2gGqF oJ9csNAKGoCTBH31MoIN7lDFeb7RWaGO9MVBiGsL8uxN9En+CCaZJZUMy/ZA4nGua9Th cFSA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JGYwGyrX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-64455-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64455-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCXactPX8o89MVVZDQccWIyeyXvXlJEVnJsZK6/yknHeknFI7sJGP0Old5RJ8cvpNkTHSH7cnGvQnlPdb0tCuoTDKVauiLKNWgrI/yMSvQ== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id cb12-20020a056a02070c00b005dc112b2239si2704854pgb.28.2024.02.13.14.28.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 14:28:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64455-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JGYwGyrX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-64455-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64455-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id BB1A12928B9 for ; Tue, 13 Feb 2024 22:28:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 877FB62177; Tue, 13 Feb 2024 22:28:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JGYwGyrX" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7D627612F0; Tue, 13 Feb 2024 22:28:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707863291; cv=none; b=KK7hHlYuRrpJyMtBD23UHjAUoECTksOY+beIFBKcUOwpYby1jiMqBVn/3Z76iAjZOLTpgNy61buBgykCZiJAz4v7M5q1U0SCx2fi/PFEl9jiO07NFsLwwvEJ5ZrBjgVjso60zurzqsXu3vUC9nwi1DqhDZjQsvWgH3e6pSEJfZg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707863291; c=relaxed/simple; bh=oFFuZOUNHSicGqYZMLonLDDYLy/GpUY8EBDB1WTG0es=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=txwm/6OSJG6witFDmdZoIhEkC3/guoDwdFaXaXOXiBrHf8O5EXMll1xiahcSizgqs7ISZC+NWhb62dgMsAo52CZ1cBIpfT/th0uu2HQFbfEMqyHHHDZfq8kXlF3iXdePvKc+qfeOCkfOMw6hz7s2MIoYyWHFgtabx5zJZ5Nz7rI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JGYwGyrX; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C98C7C433C7; Tue, 13 Feb 2024 22:28:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707863291; bh=oFFuZOUNHSicGqYZMLonLDDYLy/GpUY8EBDB1WTG0es=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JGYwGyrXK0nZVTCamXE68PrmsELblm6cb8mI3mbXPZc25oIOSYbHIWJoHI51r7Vn3 TsCNlOmBf2Hr9SQCZzeHfyBJlackDsH7UzciNBg0CANB3tAk7ds4Ue0VTyOQHCUbKK jhNqA0EcAEftZD4goOrxFg6NJU/4a79BHiGCcTvWTdY4YBjVst8sfWyS3RibS3sCIO gmfkzc/KkApqmTn1NKZF6W8R2y9dds7mKR+skzNlXlIOfAjwrVrg25PApvx5eLsEdo Dtufo9gsq9TAGe/CpwxVRE3DV0DhYTTwFC4SphIJPic5hhMp4gJRLyqaS7TxOL3ZOt VlqZKTej1QzQg== Date: Tue, 13 Feb 2024 16:28:08 -0600 From: Rob Herring To: Manojkiran Eda Cc: Krzysztof Kozlowski , Conor Dooley , Joel Stanley , Andrew Jeffery , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , jk@codeconstruct.com.au, Patrick Rudolph , Chia-Wei Wang , Ryan Chen , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, openbmc@lists.ozlabs.org, zev@bewilderbeest.net Subject: Re: [PATCH] Add eSPI device driver (flash channel) Message-ID: <20240213222808.GA2490812-robh@kernel.org> References: <20240213-espi_driver-v1-1-92741c812843@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240213-espi_driver-v1-1-92741c812843@gmail.com> On Tue, Feb 13, 2024 at 08:06:08PM +0530, Manojkiran Eda wrote: > This patch adds the driver support for the eSPI controller of > Aspeed 5/6th generation SoCs. This controller is a slave device > communicating with a master over Enhanced Serial Peripheral > Interface (eSPI). > > eSPI supports 4 channels, namely peripheral, virtual wire, > out-of-band, and flash, and operates at max frequency of 66MHz. > > But at the moment, this patch set only supports the flash channel. You're not going to need binding changes to add support for those, right? > > Signed-off-by: Manojkiran Eda > --- > Hello everyone, > > I'm presenting a revised version of the eSPI device driver patch series found at the following link: > > https://lore.kernel.org/openbmc/20220516005412.4844-1-chiawei_wang@aspeedtech.com/ > > This update addresses the issues identified during the review process. > > While the previous patch series attempted to incorporate support for all four different channels of eSPI, > this new series focuses on upstreaming the flash channel initially, ensuring that all review comments are > duly addressed, before progressing further. > > Results: > > Successfully conducted a flash update via eSPI. > > Note: > > This marks my inaugural endeavor in contributing code to the kernel subsystem. I kindly request reviewers > to incorporate as many details as possible in the review comments. Please start with submitting-patches.rst and the DT specific version of that. > --- > .../devicetree/bindings/soc/aspeed/espi.yaml | 125 ++++++ This should be a separate patch. checkpatch.pl will tell you this and other things. Filename should match compatible. > arch/arm/boot/dts/aspeed/aspeed-g6.dtsi | 16 +- This is another patch. > drivers/mtd/mtdcore.c | 2 +- Yet another patch. But really, this one will be rejected most likely unless you can justify why it is needed. > drivers/soc/aspeed/Kconfig | 10 + > drivers/soc/aspeed/Makefile | 3 + > drivers/soc/aspeed/aspeed-espi-ctrl.c | 197 +++++++++ > drivers/soc/aspeed/aspeed-espi-ctrl.h | 169 ++++++++ > drivers/soc/aspeed/aspeed-espi-flash.c | 466 +++++++++++++++++++++ > drivers/soc/aspeed/aspeed-espi-flash.h | 45 ++ > include/uapi/linux/espi/aspeed-espi-ioc.h | 103 +++++ Your own interface to userspace is probably not going to be accepted either. > 10 files changed, 1134 insertions(+), 2 deletions(-) > > diff --git a/Documentation/devicetree/bindings/soc/aspeed/espi.yaml b/Documentation/devicetree/bindings/soc/aspeed/espi.yaml > new file mode 100644 > index 000000000000..6521a351d18d > --- /dev/null > +++ b/Documentation/devicetree/bindings/soc/aspeed/espi.yaml > @@ -0,0 +1,125 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +# # Copyright (c) 2021 Aspeed Technology Inc. It's 2024 now. > +%YAML 1.2 > +--- > +$id: "http://devicetree.org/schemas/soc/aspeed/espi.yaml#" > +$schema: "http://devicetree.org/meta-schemas/core.yaml#" > + > +title: Aspeed eSPI Controller > + > +maintainers: > + - Manojkiran Eda > + - Patrick Rudolph > + - Chia-Wei Wang > + - Ryan Chen > + > +description: > + Aspeed eSPI controller implements a slave side eSPI endpoint device s/slave/device/ > + supporting the four eSPI channels, namely peripheral, virtual wire, > + out-of-band, and flash. > + > +properties: > + compatible: > + items: > + - enum: > + - aspeed,ast2500-espi > + - aspeed,ast2600-espi > + - const: simple-mfd > + - const: syscon > + > + reg: > + maxItems: 1 > + > + "#address-cells": > + const: 1 > + > + "#size-cells": > + const: 1 > + > + ranges: true > + > +patternProperties: > + "^espi-ctrl@[0-9a-f]+$": > + type: object Is this really a separate sub-block? As in could it be reused somewhere else or in a different combination of blocks? > + > + description: Control of the four basic eSPI channels > + > + properties: > + compatible: > + items: > + - enum: > + - aspeed,ast2500-espi-ctrl > + - aspeed,ast2600-espi-ctrl > + > + interrupts: > + maxItems: 1 > + > + clocks: > + maxItems: 1 > + > + flash,dma-mode: > + type: boolean > + description: Enable DMA support for eSPI flash channel > + > + flash,safs-mode: > + $ref: /schemas/types.yaml#/definitions/uint32 > + enum: [ 0, 1, 2 ] > + default: 0 > + description: Slave-Attached-Sharing-Flash mode, 0->Mix, 1->SW, 2->HW > + > + required: > + - compatible > + - interrupts > + - clocks > + > + "^espi-mmbi@[0-9a-f]+$": > + type: object Is this really a separate sub-block? > + > + description: Control of the PCH-BMC data exchange over eSPI peripheral memory cycle > + > + properties: > + compatible: > + const: aspeed,ast2600-espi-mmbi > + > + interrupts: > + maxItems: 1 > + > + required: > + - compatible > + - interrupts > + > +required: > + - compatible > + - reg > + - "#address-cells" > + - "#size-cells" > + - ranges > + > +additionalProperties: false > + > +examples: > + - | > + #include > + #include > + > + espi: espi@1e6ee000 { > + compatible = "aspeed,ast2600-espi", "simple-mfd", "syscon"; > + reg = <0x1e6ee000 0x1000>; > + > + #address-cells = <1>; > + #size-cells = <1>; > + ranges = <0x0 0x1e6ee000 0x1000>; > + > + espi_ctrl: espi-ctrl@0 { > + compatible = "aspeed,ast2600-espi-ctrl"; > + reg = <0x0 0x800>; > + interrupts = ; > + clocks = <&syscon ASPEED_CLK_GATE_ESPICLK>; > + }; > + > + espi_mmbi: espi-mmbi@800 { > + compatible = "aspeed,ast2600-espi-mmbi"; > + reg = <0x800 0x50>; > + interrupts = ; > + }; > + }; > diff --git a/arch/arm/boot/dts/aspeed/aspeed-g6.dtsi b/arch/arm/boot/dts/aspeed/aspeed-g6.dtsi > index c4d1faade8be..08d7a2689086 100644 > --- a/arch/arm/boot/dts/aspeed/aspeed-g6.dtsi > +++ b/arch/arm/boot/dts/aspeed/aspeed-g6.dtsi > @@ -453,7 +453,21 @@ video: video@1e700000 { > interrupts = ; > status = "disabled"; > }; > - > + espi: espi@1e6ee000 { > + compatible = "aspeed,ast2600-espi", "simple-mfd", "syscon"; > + reg = <0x1e6ee000 0x1000>; > + #address-cells = <1>; > + #size-cells = <1>; > + ranges = <0x0 0x1e6ee000 0x1000>; > + espi_ctrl: espi-ctrl@0 { > + compatible = "aspeed,ast2600-espi-ctrl"; > + reg = <0x0 0x800>,<0x0 0x4000000>; > + reg-names = "espi_ctrl","espi_flash"; > + interrupts = ; > + clocks = <&syscon ASPEED_CLK_GATE_ESPICLK>; > + status = "disabled"; > + }; Wrong indentation. > + }; > gpio0: gpio@1e780000 { > #gpio-cells = <2>; > gpio-controller;