linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/1] mtd: devices: add ACPI support for non-jedec m25p80
@ 2019-02-26 10:48 Flavio Suligoi
  2019-02-26 10:48 ` [PATCH v1 1/1] " Flavio Suligoi
  0 siblings, 1 reply; 4+ messages in thread
From: Flavio Suligoi @ 2019-02-26 10:48 UTC (permalink / raw)
  To: David Woodhouse, Brian Norris, Boris Brezillon, Marek Vasut,
	Richard Weinberger, Mark Brown, Frieder Schrempf, Yogesh Gaur,
	linux-mtd, linux-kernel
  Cc: Flavio Suligoi

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


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-03-07 17:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-26 10:48 [PATCH v1 0/1] mtd: devices: add ACPI support for non-jedec m25p80 Flavio Suligoi
2019-02-26 10:48 ` [PATCH v1 1/1] " Flavio Suligoi
2019-03-07 17:40   ` David Woodhouse
2019-03-07 17:50     ` Flavio Suligoi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).