On Wednesday, April 15, 2020 8:28:36 PM EEST Vignesh Raghavendra wrote: > EXTERNAL EMAIL: Do not click links or open attachments unless you know the > content is safe > On 09/03/20 2:10 pm, Sascha Hauer wrote: > > The Cypress cy15b104q and cy15v104q are 4Mbit serial SPI F-RAM devices. > > Add support for them to the spi-nor driver. > > > > Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> > > --- > > > > Changes since v1: > > - Instead of specifying 1024 sectors with a sector size of 512 specify > > > > 512 * 1024 sectos with a sector size of 1. The device has no idea of > > sectors and is not erasable, so a sector size of 1 seems to better > > reflect reality. > > > > drivers/mtd/spi-nor/spi-nor.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c > > index 4fc632ec18fe..a5c1d684364c 100644 > > --- a/drivers/mtd/spi-nor/spi-nor.c > > +++ b/drivers/mtd/spi-nor/spi-nor.c > > @@ -2335,6 +2335,9 @@ static const struct flash_info spi_nor_ids[] = { > > > > { "at45db081d", INFO(0x1f2500, 0, 64 * 1024, 16, SECT_4K) }, > > > > + /* Cypress */ > > + { "cy15x104q", INFO6(0x042cc2, 0x7f7f7f, 512 * 1024, 1, > > SPI_NOR_NO_ERASE) }, > This seems wrong > > As the datasheet for the device says: > > "Device ID > The CY15B104Q device can be interrogated for its manufacturer, product > identification, and die revision. The RDID opcode 9Fh allows > the user to read the manufacturer ID and product ID, both of which are > read-only bytes. The JEDEC-assigned manufacturer ID places > the Cypress (Ramtron) identifier in bank 7; therefore, there are six > bytes of the continuation code 7Fh followed by the single byte C2h. > There are two bytes of product ID, which includes a family code, a > density code, a sub code, and the product revision code." > > I am not sure how are you reading 0x4 as the first byte. It should have > been 6 bytes of 0x7F followed by 0xc2 right? You're right, I skimmed too quickly through the id. > > Also 0x7F is continuation code and not actual device ID (See JEDEC > standard JEP106). You will have to extend spi_nor_read_id() function to > take care of continuation code and read more bytes in order to get the > actual Manuf/device ID Right, thanks for the intervention, Vignesh! Cheers, ta ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/