From patchwork Tue Feb 26 10:48:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: FLAVIO SULIGOI X-Patchwork-Id: 1048231 X-Patchwork-Delegate: tudor.ambarus@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=asem.it Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ISktPxRl"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 447wXP5XNkz9s2R for ; Tue, 26 Feb 2019 21:48:37 +1100 (AEDT) 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:References:In-Reply-To: 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: List-Owner; bh=Kyiw60VOG4pqwD0/zHxNlb2WXGcvYFSHlH7R9B/jmdQ=; b=ISktPxRl85beyu Uu3U7DHKsqtXWgAAUeuYYfHn6oPSRfFv1zkfgH2z7/2cAFoPh8cTyjij8tvTEkpLTumht1LakYq70 UCrRZy47bZpUldtm312GO+Yw4SW/CAf/EWX39qUHY1SoCaK094Jrhw3lNhoWl65RC/NG/6byTTJgy l6MuX6usJl6TgDJSMnvh24c84MyWrNvkksX+zKCp8tTAAMYWt6sEueHQrp3WTsATIgIqNOqaeTbC2 hvlaEyx9I/TfmoMyCPSTjJg5DvzN+AXUXV4ko7lKLaLdzheW8UK5Uj6UuE3iIRQTGyF0wHnuGZa7b FHIjHs/cVgPu1XfNPXsQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gyaHo-0007yS-21; Tue, 26 Feb 2019 10:48:32 +0000 Received: from smtp.asem.it ([151.1.184.197]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gyaHg-0007ou-W1 for linux-mtd@lists.infradead.org; Tue, 26 Feb 2019 10:48:26 +0000 Received: from webmail.asem.it by asem.it (smtp.asem.it) (SecurityGateway 5.5.0) with ESMTP id SG003717273.MSG for ; Tue, 26 Feb 2019 11:48:11 +0100S Received: from ASAS044.asem.intra (172.16.16.44) by ASAS044.asem.intra (172.16.16.44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Tue, 26 Feb 2019 11:48:10 +0100 Received: from flavio-x.asem.intra (172.16.17.161) by ASAS044.asem.intra (172.16.16.44) with Microsoft SMTP Server id 15.1.1261.35 via Frontend Transport; Tue, 26 Feb 2019 11:48:10 +0100 From: Flavio Suligoi To: David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , Mark Brown , Frieder Schrempf , Yogesh Gaur , , Subject: [PATCH v1 1/1] mtd: devices: add ACPI support for non-jedec m25p80 Date: Tue, 26 Feb 2019 11:48:08 +0100 Message-ID: <1551178088-6615-2-git-send-email-f.suligoi@asem.it> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1551178088-6615-1-git-send-email-f.suligoi@asem.it> References: <1551178088-6615-1-git-send-email-f.suligoi@asem.it> MIME-Version: 1.0 X-SGHeloLookup-Result: pass smtp.helo=webmail.asem.it (ip=172.16.16.44) X-SGSPF-Result: none (smtp.asem.it) X-SGOP-RefID: str=0001.0A0B0207.5C75196B.0066, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 (_st=1 _vt=0 _iwf=0) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190226_024825_213666_73C84F48 X-CRM114-Status: GOOD ( 15.89 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [151.1.184.197 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 T_FILL_THIS_FORM_SHORT Fill in a short form with personal information X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Flavio Suligoi Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org For the x86 machines a m25p80-compatible device have to be declared using an ACPI table (which can be directly a part of the BIOS ACPI tables). In this case it is necessary to add the device in the "of_device_id" structure list, to permit the device name matching by the ACPI kernel functions. This is an example of a SSDT table for the Everspin mr25h40: DefinitionBlock ("mr25h40.aml", "SSDT", 5, "ASEMsp", "MR25H40", 1) { External (_SB.SPI1, DeviceObj) Scope (\_SB.SPI1) { Device (NVR0) { Name (_HID, "PRP0001") Name (_DDN, "Everspin MR25H40 MRAM") Name (_CRS, ResourceTemplate () { SpiSerialBus ( 1, // Chip select PolarityLow, // Chip select is active low FourWireMode, // Full duplex 8, // Bits per word is 8 (byte) ControllerInitiated, // Don't care 10000000, // 10 MHz ClockPolarityLow, // SPI mode 0 ClockPolarityLow ClockPhaseFirst, // SPI mode 0 ClockPhaseFirst "\\_SB.SPI1", // SPI host controller 0, // Must be 0 ResourceConsumer, , ) }) Name (_DSD, Package () { ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), Package () { Package () {"compatible", "mr25h40"}, } }) } } } Signed-off-by: Flavio Suligoi --- v1: - first patch version drivers/mtd/devices/m25p80.c | 57 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index c4a1d04..b5c7db8 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c @@ -312,9 +312,64 @@ MODULE_DEVICE_TABLE(spi, m25p_ids); static const struct of_device_id m25p_of_table[] = { /* * Generic compatibility for SPI NOR that can be identified by the - * JEDEC READ ID opcode (0x9F). Use this, if possible. + * JEDEC READ ID opcode (0x9F). Use this (jedec,spi-nor), if possible. + * + * The list of all flash devices is instead necessary in x86 machines, + * to use a "non-jedec device" inside the ACPI BIOS tables. */ { .compatible = "jedec,spi-nor" }, + { .compatible = "s25sl064a" }, + { .compatible = "w25x16" }, + { .compatible = "m25p10" }, + { .compatible = "m25px64" }, + { .compatible = "at25df321a" }, + { .compatible = "at25df641" }, + { .compatible = "at26df081a" }, + { .compatible = "mx25l4005a" }, + { .compatible = "mx25l1606e" }, + { .compatible = "mx25l6405d" }, + { .compatible = "mx25l12805d" }, + { .compatible = "mx25l25635e" }, + { .compatible = "mx66l51235l" }, + { .compatible = "n25q064" }, + { .compatible = "n25q128a11" }, + { .compatible = "n25q128a13" }, + { .compatible = "n25q512a" }, + { .compatible = "s25fl256s1" }, + { .compatible = "s25fl512s" }, + { .compatible = "s25sl12801" }, + { .compatible = "s25fl008k" }, + { .compatible = "s25fl064k" }, + { .compatible = "sst25vf040b" }, + { .compatible = "sst25vf016b" }, + { .compatible = "sst25vf032b" }, + { .compatible = "sst25wf040" }, + { .compatible = "m25p40" }, + { .compatible = "m25p80" }, + { .compatible = "m25p16" }, + { .compatible = "m25p32" }, + { .compatible = "m25p64" }, + { .compatible = "m25p128" }, + { .compatible = "w25x80" }, + { .compatible = "w25x32" }, + { .compatible = "w25q32" }, + { .compatible = "w25q32dw" }, + { .compatible = "w25q80bl" }, + { .compatible = "w25q128" }, + { .compatible = "w25q256" }, + { .compatible = "m25p05-nonjedec" }, + { .compatible = "m25p10-nonjedec" }, + { .compatible = "m25p20-nonjedec" }, + { .compatible = "m25p40-nonjedec" }, + { .compatible = "m25p80-nonjedec" }, + { .compatible = "m25p16-nonjedec" }, + { .compatible = "m25p32-nonjedec" }, + { .compatible = "m25p64-nonjedec" }, + { .compatible = "m25p128-nonjedec" }, + { .compatible = "mr25h128" }, + { .compatible = "mr25h256" }, + { .compatible = "mr25h10" }, + { .compatible = "mr25h40" }, {} }; MODULE_DEVICE_TABLE(of, m25p_of_table);