From patchwork Fri Feb 28 15:18:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 183963 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp847831ile; Fri, 28 Feb 2020 07:23:16 -0800 (PST) X-Google-Smtp-Source: APXvYqyJaPgrQN30bk6YeES+xuV+hMj9GkrOaTDmwZefgoCOq/DJLR4og1b/HAI/in078xKmtKEe X-Received: by 2002:a25:58d7:: with SMTP id m206mr4262869ybb.347.1582903396236; Fri, 28 Feb 2020 07:23:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582903396; cv=none; d=google.com; s=arc-20160816; b=hBvTSh97teM5URARfWxPLdjF/qJMKrkdXrVgeX6sx2WWUXG7KzkcvEoF9/xOuOURbO p3g59vJhlZ18e1vIhDBsWZpNQuLMd9RkG+RWa45QEkQhDX+bL0syju1utJ/7uR9Vd4l+ nhkt+7PfyMDiiy/NEVWVWaTnR991t5YZ6WuuQU32EAoS5miI4Q6512ALSFXqVwQ0GBFb stI9YDNN3dbThQ912uQyMZwN0mQG6gjUgqLf6Di1zx+oGrGOVSk2Vce2/Pg+tuRauJCz mOEcaTT/p/orMw/gPmx4b3rHPZg8tL5/d6foPuiXeWjiF0rnwpKyjUgwKXBalr0Ddyg9 ypNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :dkim-signature; bh=8zi1PCQtyNsdnGEJQVDR+g2yL1Xfl816g1YjeCjoiNY=; b=hZhszust2Z1X/vN7nLBCxwIYghLp+68PjGLmpQ3cBYkEoKrgjRHZpKaNHCRxCaqCPt SGonTXkzBhVoQKAT6MaNL9muWSqoWyfnGrgztdELLpS2Pot3CIeSptGga6pAajuCBLKt g4sHbNYKoBu1c0rgE8JFSPsrv0Kn12WOUK2Uh6kKoNHBixWXA5DHiArgxsNR18EGzpec Y9FFHvrA7yYVF3/jbpCr9DQr8SFScCp8P/qZgWEu3BQ832YXnZWrkDrIUONQccMTFqw+ xDuTMBclT2u2EZYPqOx7TIEJELbzbo+9hpNm9zid0LlJfoA8xuocI/O8X5QK4SxUAa0K 7ypw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=M3nDS1HH; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org" Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id o142si1630029ybc.302.2020.02.28.07.23.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Feb 2020 07:23:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=M3nDS1HH; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=8zi1PCQtyNsdnGEJQVDR+g2yL1Xfl816g1YjeCjoiNY=; b=M3nDS1HHftlULl TFoZRM9OytZ8l4Hdr0HgHkhD80vWacsiVn59P/6GMHDQd4tC/VOq+kLxGKaIclcqtCQ1le0oTCdnj UppXTse1aFC2YpsaAsxB6kQZgubZm2WSDk8tNfcO3PYG/HG29FM3gxqCoa3Zuw6xSNxuVx2x1vUrV LmteGIC4arxGyBhnFVcNFy65fmaAbI3tQyH0gHtA86xGBUFNTBcRmysx7k+Ivz7U1fuV6/I6Sf99t eamTUQKLFoGE63hK9GejuVqGGJbr5fO2DfmZeNOnlG5OOvXbu82Mf8joPGqe9Jf3mnvZdIQrjm2C5 /95YqQioFKMhpru/kPwg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j7hTo-0004o1-0D; Fri, 28 Feb 2020 15:23:08 +0000 Received: from szxga06-in.huawei.com ([45.249.212.32] helo=huawei.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j7hTk-0004mC-Nt for linux-mtd@lists.infradead.org; Fri, 28 Feb 2020 15:23:06 +0000 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id D8DD125A82D882BC737; Fri, 28 Feb 2020 23:22:53 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.439.0; Fri, 28 Feb 2020 23:22:44 +0800 From: John Garry To: Subject: [PATCH RFC 0/3] spi/HiSilicon v3xx: Support dual and quad mode through DMI quirks Date: Fri, 28 Feb 2020 23:18:48 +0800 Message-ID: <1582903131-160033-1-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200228_072304_948669_ECC23914 X-CRM114-Status: GOOD ( 10.01 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [45.249.212.32 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: John Garry , linux-spi@vger.kernel.org, linuxarm@huawei.com, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, andriy.shevchenko@linux.intel.com Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org As discussed during the original HiSilicon v3xx SPI driver upstreaming, currently there is no method for the ACPI SPI Serial Bus Connection Resource Descriptor to define the data buswidth [0], [1]. So we can look to get the ACPI spec updated for this, and I have submitted a proposal for a new feature here: https://bugzilla.tianocore.org/show_bug.cgi?id=2557 However I am not sure how successful that will be. In the meantime, as an alternate approach, this RFC proposes to allow the SPI controller driver override the device buswidth. In this example, the driver uses DMI quirks to discover the host machine and set the buswidth override accordingly when the machine is known to support dual or quad mode of operation. I also have included a fix for dual and quad modes in the driver. Comments welcome. thanks. [0] https://lore.kernel.org/linux-mtd/20200109212842.GK3702@sirena.org.uk/ [1] https://uefi.org/sites/default/files/resources/ACPI_6_3_final_Jan30.pdf, 19.6.126 John Garry (3): spi: Allow SPI controller override device buswidth spi: HiSilicon v3xx: Properly set CMD_CONFIG for Dual/Quad modes spi: HiSilicon v3xx: Use DMI quirk to set controller buswidth override bits drivers/spi/spi-hisi-sfc-v3xx.c | 99 ++++++++++++++++++++++++++++++++- drivers/spi/spi.c | 4 +- include/linux/spi/spi.h | 3 + 3 files changed, 104 insertions(+), 2 deletions(-) -- 2.17.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/