Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp774647ybf; Fri, 28 Feb 2020 07:24:07 -0800 (PST) X-Google-Smtp-Source: APXvYqzZSPul3XUw0TtmdqPpuCne4tA6wrATtf0BhJdf1r2zV9Tot6/x3ube2zVRdUzVl8PCcbH0 X-Received: by 2002:a05:6830:139a:: with SMTP id d26mr3904620otq.75.1582903447111; Fri, 28 Feb 2020 07:24:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582903447; cv=none; d=google.com; s=arc-20160816; b=V92rIjjTiWAbubVwVMi7K9Ja6PzVlmJFjusAcg9bEWCh2jCkpQKqHKiNdBtzOAEAUx KdxrR4dy/UqH+4RirJkC2EIMHk4lVwEcrb27IVAuw1PsXFL/eNCXqX1hUn67rBFVOFWb kTutIgBio/MsVxeYBRxfz7QVIdB583FtCGihgohrZNv0U1dLUxyvC2hNUAVfqEmN/BqZ WbDPr/G5UfF8dwoNDDHwVmVkhqzFA3ZGCf03iZoKwlgE3fq0Co4tCqYbrDQhBuOWzMIQ qO1W3rc3ca88gOw0BdbNli2SRBUnL83lDORct5Cc7IUnLvaRozGHZBgHISbzMpnnrcDL qe0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=YyTVEsOs2H1+n4hp39azuwABIdWB5Kuf9yiAapLJWUg=; b=N8pbc/dob7Ds3EtPjhJoe/odbFZpHrSVOlKr95CLALQ9GMUMUz0KY57PNd5Q+fX9e5 zMbP74UGPUWFLkKHx8lDvs5XgSPyaaIHWn0XR5aPp1m94jj4/4OKvW9abfXRVHv83fge gGtkPGzbQvkM/b5TKqgypL4NPyZ67YNAc26VYf781yyd+qLGYAJfgHvw/Ud05pc7HWKx tOtiALzYpOPvR+YaZgTqmAXW008o7M/82johLy3D9NtD5IpSvRBvVF2G4VacGDwMPqFK MO3fvI5UjhJ+s0jNDUYt+JZ8oddIsruMbAYfw3IexgJbQh99y0621hMs2hCP3wF2goif u7aA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o1si1739530otk.154.2020.02.28.07.23.55; Fri, 28 Feb 2020 07:24:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727107AbgB1PXB (ORCPT + 99 others); Fri, 28 Feb 2020 10:23:01 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:40860 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726650AbgB1PXB (ORCPT ); Fri, 28 Feb 2020 10:23:01 -0500 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: CC: , , , , , John Garry 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 Content-Type: text/plain X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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