RE: [PATCH v8 char-misc-next 3/5] misc: microchip: pci1xxxx: Add EEPROM Functionality to read and write into EEPROM bin sysfs

From: Kumaravel.Thiagarajan
Date: Thu Mar 30 2023 - 13:21:17 EST


> -----Original Message-----
> From: Michael Walle <michael@xxxxxxxx>
> Sent: Thursday, March 30, 2023 3:22 PM
> To: VaibhaavRam TL - I69105 <VaibhaavRam.TL@xxxxxxxxxxxxx>
>
> [First, please CC people who did comments on previous versions.]
Sure. We will do this henceforth.
>
> > > > Microchip's pci1xxxx is an unmanaged PCIe3.1a switch for consumer,
> > > > industrial, and automotive applications. This switch integrates
> > > > OTP and EEPROM to enable customization of the part in the field.
> > > > This patch adds EEPROM functionality to support the same.
> > >
> > > Again, why not use the in-kernel eeprom api instead?
> > Unlike other in-Kernel EEPROM APIs, this EEPROM is not accessible
> > through any of the i2c/spi buses available to the kernel.
>
> I fail to see how this matters. NVMEM has a generic read/write callback.
> There is no dependency on I2C or SPI. Again, you should look into nvmem.
> And it should be perfectly fine to use nvmem without nvmem cells at all.
>
> With CONFIG_NVMEM_SYSFS you should get a "nvmem" binary file in sysfs.
> Wit config->compat set (although I don't know if that is recommended) you
> should get an "eeprom" binary file in sysfs.
>
> > It is only accessible through the register interface available in the
> > EEPROM controller of the PCI1XXXX device.
Michael & Greg,
By in-kernel EEPROM APIs and NVMEM, are you both referring to the same?
Can you please confirm?
We can explore this if that is fine to use this without nvmem cells.
I think we misunderstood as we were referring to drivers/misc/eeprom for examples.

Thank You.

Regards,
Kumar