Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp443380img; Tue, 26 Feb 2019 02:54:20 -0800 (PST) X-Google-Smtp-Source: AHgI3Iasm3LCb882Fgj3kIs8h6zkDbjrntYXQPehNMFrFFYRYkvd6COaLrw9u++8Ocb5FVHwgS0Q X-Received: by 2002:a17:902:9a09:: with SMTP id v9mr24750965plp.225.1551178460805; Tue, 26 Feb 2019 02:54:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551178460; cv=none; d=google.com; s=arc-20160816; b=PyqI2ftJXrAxX9G9vgm3noJ+n5jj2rrUYzXICuVc6jO0r1AVDkRz6nCw+2QPGytJmN BvunvGAJwIQiXWKtJf8QB1ydGIZoRXAZHQkLULkVCf1ECdUoa2VRQ44jIW+OiszNAATX IT1mXgWQ3fO9bpIDY4Qrf8V6s0DUUz3I7tnTWzxNB0JyuBKBZnhIOMHT8Uhk3OBxTGeL 9U4sZoOpeXZ8/VVqSHulJnDcPNz1QnQ3VROLC/0nKB+w1Lbg7fy3nvDWB9HlV3/hM/4L YRdfUzh/RVAoP2hKFhXnzDlWAo+i24Z0KLvTWxP3FKyClvtA7q8YjojDpSU35mwghA/b jeyQ== 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=CIwzNbDPd+Irtig3TNc3tBFTzWXmJpAl7x2IaaamTFg=; b=oC1S2FnPcE/lUEdJ6TOum8wGXIgoyg/hm7Z5Ye9eKy6RawDbH6hROm9eAkVxA4oBPK 24h4nErMNdZe0HOCyU4pQnRBSxid9cgfQCTu1Q7cgcURzbq4U7EL/jxcxrROKFtzP6ON ROPlAt122Rbbfvs/WIohPU4td60Kx7blynGwhatnYZX2fIewuL17QUqKIhxwsKMfwnrv nMa5LMvz8Nse3dUOGBEV29++BITIh0yuclvIGuP/2S9mR7Au+r7fc+1GEsHEuztqQ+Wq MAVyS6C2f+vcyNtgMWgS9IWjao0PjI4iJc+3cBH09oze1tIVHSGhlWS7gLo7wZHgJgL/ f0bA== 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 n81si1938487pfh.272.2019.02.26.02.54.05; Tue, 26 Feb 2019 02:54:20 -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 S1727456AbfBZKxR (ORCPT + 99 others); Tue, 26 Feb 2019 05:53:17 -0500 Received: from smtp.asem.it ([151.1.184.197]:61601 "EHLO smtp.asem.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726602AbfBZKxR (ORCPT ); Tue, 26 Feb 2019 05:53:17 -0500 X-Greylist: delayed 303 seconds by postgrey-1.27 at vger.kernel.org; Tue, 26 Feb 2019 05:53:16 EST Received: from webmail.asem.it by asem.it (smtp.asem.it) (SecurityGateway 5.5.0) with ESMTP id SG003717272.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 , , CC: Flavio Suligoi Subject: [PATCH v1 0/1] mtd: devices: add ACPI support for non-jedec m25p80 Date: Tue, 26 Feb 2019 11:48:07 +0100 Message-ID: <1551178088-6615-1-git-send-email-f.suligoi@asem.it> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain 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.0049,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 (_st=1 _vt=0 _iwf=0) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch concerns the use of a "non-jedec" m25p80 device in a x86 machine. For an x86 machine a m25p80 device has to be declared inside a BIOS ACPI table (for example inside the SSDT or the DSDT table). No matching problems for the jedec compatible devices, since we have the list: static const struct of_device_id m25p_of_table[] = { { .compatible = "jedec,spi-nor" }, {} }; But for the "non-jedec" devices there are no possible matches, even if we try to use, the SPI modalias, as: spi:mr25h40 So it is necessary filling the m25p_of_table with all the m25p80 device names used in the driver. This solution works both for the ACPI-style (x86) and the DT-style declarations (ARM). I checked this patch with: 1) x68 board using both an SSDT and DSDT tables 2) i.MX6DL custom board using a Device Tree This is an example of working SSDT table for x86: 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"}, } }) } } } Flavio Suligoi (1): mtd: devices: add ACPI support for non-jedec m25p80 drivers/mtd/devices/m25p80.c | 57 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) -- 2.7.4