RE: Reg: New MFD Driver for my PCIe Device

Kumaravel.Thiagarajan
2021-11-23T18:33:25Z

Dear Greg KH,

Please find my answers inline below and let me know if you have any questions or comments.

Thank You.

Regards,
Kumaravel Thiagarajan

> -----Original Message-----
> From: Greg KH <gregkh@linuxfoundation.org>
> Sent: Friday, November 19, 2021 8:23 PM
> To: Kumaravel Thiagarajan - I21417 <Kumaravel.Thiagarajan@microchip.com>
> Cc: lee.jones@linaro.org; Pragash Mangalapandian - I21326
> <Pragash.Mangalapandian@microchip.com>; Sundararaman Hariharaputran -
> I21286 <Sundararaman.H@microchip.com>; axboe@kernel.dk; linux-
> block@vger.kernel.org; miquel.raynal@bootlin.com; richard@nod.at;
> vigneshr@ti.com; linux-mtd@lists.infradead.org; Lakshmi Praveen Kopparthi
> - I17972 <LakshmiPraveen.Kopparthi@microchip.com>; Ronnie Kunin -
> C21729 <Ronnie.Kunin@microchip.com>
> Subject: Re: Reg: New MFD Driver for my PCIe Device
>
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the
> content is safe
>
> On Fri, Nov 19, 2021 at 09:16:29AM +0000,
> Kumaravel.Thiagarajan@microchip.com wrote:
> > Dear Greg KH,
> >
> > I went through the documentation of aux bus and felt that it would be the
> correct way to go as you said.
> > I will migrate from MFD to aux bus.
> >
> > I have one more architectural question as below.
> > I have written the driver such that it enumerates the OTP memory and
> EEPROM memory as two separate block devices or disks each of size 8KB and
> this enables me to use the linux dd command with "direct" option to dump
> the configuration binary onto OTP or EEPROM devices.
> > Also, this enables me to use the application like hexedit to view the OTP or
> EEPROM devices in raw binary format.
> > These devices are not based on mtd (memory technology device)
> architecture as we don't have any erase functionality here.
> > Can you please let me know a suitable location in kernel source tree for my
> block or disk device driver?
>

> So they are a read-only block device?
KT: No. These block devices are writeable too. I program these block devices using the linux dd command with the "direct" option.

>
> Why use a block device and not just the "normal" eeprom driver?
KT: I thought the normal EEPROM driver can be used only for EEPROMs that are connected to I2C adapters for which there is a I2C Adapter driver available already. But my device has an inbuilt EEPROM controller hardware which is not like an I2C adapter.

> Or a char device node and mmap the memory?
KT: I am not sure if I clearly understand this. Are you suggesting to mmap the EEPROM memory? The EEPROM memory is not mapped into the address space directly. EEPROM and OTP controller registers are mapped into the address space of the processor and accessed by the kernel mode driver.

>
> Anyway, no idea where to put them, drivers/misc/ ?
KT: Ok. I can use this location.

>
> thanks,
>
> greg k-h