From: Tudor.Ambarus at microchip.com Date: Wed, 9 Oct 2019 15:50:58 +0000 Subject: [U-Boot] [PATCH 1/4] mtd: spi: spi-nor-core: Add Microchip SFDP parser In-Reply-To: <2b12ce1f-5de5-3e29-6444-5ff08228add3@ti.com> References: <20191001085914.7635-1-tudor.ambarus@microchip.com> <20191001085914.7635-2-tudor.ambarus@microchip.com> <2b12ce1f-5de5-3e29-6444-5ff08228add3@ti.com> Message-ID: <13d8dcac-d53a-7973-5c1d-ff7ed18117a5@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 Hi, Vignesh, On 10/09/2019 03:04 PM, Vignesh Raghavendra wrote: > External E-Mail >=20 >=20 > Hi Tudor, >=20 > 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 contains >> 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-co= re.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? >=20 It is unique. Quoting form JESD216 rev D, section "6.3.3 Definition of Parameter ID Field= ": "The original JESD216 specification used only a one byte ID field to identi= fy the parameter table owner. JESD216 revision A expanded the ID field to two bytes, MSB and LSB, becaus= e a single byte is insufficient to uniquely identify all manufacturers ( vendors). The origin= al 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-7fh interval) and bfh is the Parameter ID LSB (has odd parity, which is correct= ). Now I'm looking in the JEP106AZ standard (Standard Manufacturer=E2=80=99s Identification Code): 01h MSB indicates the bank number (one), and bfh LSB indicates the Manufacturer Identification code (which is bfh for SST). Cheers, ta