RE: [PATCH v1 1/1] mtd: devices: add ACPI support for non-jedec m25p80

From: Flavio Suligoi
Date: Thu Mar 07 2019 - 12:50:30 EST


> -----Original Message-----
> From: David Woodhouse <dwmw2@xxxxxxxxxxxxx>
> Sent: giovedà 7 marzo 2019 18:40
> To: Flavio Suligoi <f.suligoi@xxxxxxx>; Brian Norris
> <computersforpeace@xxxxxxxxx>; Boris Brezillon <bbrezillon@xxxxxxxxxx>;
> Marek Vasut <marek.vasut@xxxxxxxxx>; Richard Weinberger <richard@xxxxxx>;
> Mark Brown <broonie@xxxxxxxxxx>; Frieder Schrempf
> <frieder.schrempf@xxxxxxxxx>; Yogesh Gaur <yogeshnarayan.gaur@xxxxxxx>;
> linux-mtd@xxxxxxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH v1 1/1] mtd: devices: add ACPI support for non-jedec
> m25p80
>
> On Tue, 2019-02-26 at 11:48 +0100, Flavio Suligoi wrote:
> > 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 <f.suligoi@xxxxxxx>
>
> Why use the specific chip name in the "compatible" property? Why isn't
> it using "jedec,spi-nor"?
>
> Does this still actually get passed through to spi_nor_scan()... and is
> it *necessary*? Can't the chips be probed?
>

Hi David,

exactly, the mr25h40 is not Jedec compatible, so it can't be probed,
so it is necessary to identify it explicitly.

Flavio