From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tudor.Ambarus at microchip.com Date: Wed, 9 Oct 2019 16:27:04 +0000 Subject: [U-Boot] [PATCH 1/4] mtd: spi: spi-nor-core: Add Microchip SFDP parser In-Reply-To: <42cd5a74-37db-c647-a1b9-2a458df490cd@ti.com> References: <20191001085914.7635-1-tudor.ambarus@microchip.com> <20191001085914.7635-2-tudor.ambarus@microchip.com> <2b12ce1f-5de5-3e29-6444-5ff08228add3@ti.com> <13d8dcac-d53a-7973-5c1d-ff7ed18117a5@microchip.com> <42cd5a74-37db-c647-a1b9-2a458df490cd@ti.com> Message-ID: <197e1e68-c056-7cd2-75ff-f32b0c4bba79@microchip.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable To: u-boot@lists.denx.de On 10/09/2019 07:25 PM, Vignesh Raghavendra wrote: > External E-Mail >=20 >=20 >=20 > On 09-Oct-19 9:20 PM, Tudor.Ambarus at microchip.com wrote: >> Hi, Vignesh, >> >> On 10/09/2019 03:04 PM, Vignesh Raghavendra wrote: >>> External E-Mail >>> >>> >>> Hi Tudor, >>> >>> On 01/10/19 2:29 PM, Tudor.Ambarus at microchip.com wrote: >>>> From: Tudor Ambarus >>>> >>>> JESD216 allow vendors to define their own SFDP tables. >>>> >>>> Add Microchip SFDP parser. The vendor table is allocated using >>>> resource-managed kmalloc - the table will be freed on driver detach. >>>> It will be accessible by getting the UCLASS_SPI_FLASH's private data. >>>> >>>> The Michrochip's SFDP table is particularly of interest because contai= ns >>>> pre-programmed globally unique EUI-48 and EUI-64 identifiers. >>>> >>>> Signed-off-by: Tudor Ambarus >>>> --- >>>> drivers/mtd/spi/spi-nor-core.c | 35 +++++++++++++++++++++++++++++++++= ++ >>>> include/linux/mtd/spi-nor.h | 2 ++ >>>> 2 files changed, 37 insertions(+) >>>> >>>> diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-= core.c >>>> index 1acff745d1a2..bade7d8a9f79 100644 >>>> --- a/drivers/mtd/spi/spi-nor-core.c >>>> +++ b/drivers/mtd/spi/spi-nor-core.c >>>> @@ -1417,6 +1417,7 @@ struct sfdp_parameter_header { >>>> =20 >>>> #define SFDP_BFPT_ID 0xff00 /* Basic Flash Parameter Table */ >>>> #define SFDP_SECTOR_MAP_ID 0xff81 /* Sector Map Table */ >>>> +#define SFDP_MICROCHIP_ID 0x01bf /* Manufacturer specific Table */ >>>> =20 >>> Is this ID unique enough such that no other vendor will use the same? I >>> recall that MSB byte should be assigned to Vendor and 0x01 does not seem >>> to be Microchip specific? Or did I miss something? >>> >> >> It is unique. >> >> Quoting form JESD216 rev D, section "6.3.3 Definition of Parameter ID Fi= eld": >> "The original JESD216 specification used only a one byte ID field to ide= ntify >> the parameter table owner. >> JESD216 revision A expanded the ID field to two bytes, MSB and LSB, bec= ause a >> single byte is >> insufficient to uniquely identify all manufacturers ( vendors). The ori= ginal >> single byte parameter ID is >> now referred to as the parameter ID LSB." >> >> In the Microchip's case, 01h is the Parameter ID MSB (respects the 01h-7= fh >> interval) and bfh is the Parameter ID LSB (has odd parity, which is corr= ect). >> Now I'm looking in the JEP106AZ standard (Standard Manufacturer=E2=80=99s >> Identification Code): 01h MSB indicates the bank number (one), and bfh L= SB >> indicates the Manufacturer Identification code (which is bfh for SST). >> >=20 > Ah, thanks for the explanation! I was confused with bank number > initially. Was also confused by the fact that there is an entry for > Microchip Technology in JEP106AZ that reads 29. May be rename the macro > to indicate SFDP_SST_ID? Ok, will do so. Thanks!