[U-Boot] [PATCH] drivers: mtd: add Microchip PIC32 internal non-CFI flash driver.

Jagan Teki jagannadh.teki at gmail.com
Wed Mar 16 15:25:35 CET 2016


On 16 March 2016 at 16:37, Purna Chandra Mandal
<purna.mandal at microchip.com> wrote:
> On 03/15/2016 05:35 PM, Jagan Teki wrote:
>
>> On 14 March 2016 at 19:37, Purna Chandra Mandal
>> <purna.mandal at microchip.com> wrote:
>>> Jagan.
>>>
>>> On 03/14/2016 07:16 PM, Jagan Teki wrote:
>>>
>>>> On Monday 14 March 2016 07:00 PM, Purna Chandra Mandal wrote:
>>>>> On 03/14/2016 06:13 PM, Daniel Schwierzeck wrote:
>>>>>> 2016-03-10 14:12 GMT+01:00 Purna Chandra Mandal <purna.mandal at microchip.com>:
>>>>>>> PIC32 embedded flash banks are memory mapped, directly read by CPU,
>>>>>>> and programming (erase followed by write) operation on them are
>>>>>>> handled by on-chip NVM controller.
>>>>>>> Signed-off-by: Purna Chandra Mandal <purna.mandal at microchip.com>
>>>>>>> ---
>>>>>>>   drivers/mtd/Kconfig       |   6 +
>>>>>>>   drivers/mtd/Makefile      |   1 +
>>>>>>>   drivers/mtd/pic32_flash.c | 377 ++++++++++++++++++++++++++++++++++++++++++++++
>>>> BTW: this driver need to be write in mtd driver mode, see for existing
>>>> drivers and let me know for any help.
>>> Will take up this activity [of supporting MTD] later on. For the time-being we are
>>> not using mtd on embedded flash, mainly using for environment and bootcode which
>>> are at well-known offset, size defined in include/configs/<board.h>.
>> I understand your concern, but It look very hard to maintain the new
>> drivers with non-dm model.
>
> If issue is only non-dm model I can add DM support with exception that it will not
> implement MTD functionality.

OK, Adding mtd dm is straight forward with registering MTD_UCLASS and
mtd_info ops please check drivers/mtd/altera_qspi.c for more info.

Mean while I will come back again for my inputs.

>
>> My suggestions are better to add this on existing mtd(cfi or
>> something) I guess ie "not possible"  or move this driver to your soc
>> or board code for time being till mtd uclass addition or write a fresh
>> mtd dm driver.
>
> PIC32 flash devices are non CFI/JEDEC compliant so no way we can separate one flash
> chip from other. Even though flash devices are parallel erase and program on these
> flash chips are performed through NVM controller (serial interface). So we can't
> directly port the functionality on CFI driver.
>
> I like the idea of adding this driver under arch/soc/ or board/. But that is where it was
> initially added, but based on review comment it is moved to drivers/mtd/.
>
> Please suggest me a way!

-- 
Jagan.


More information about the U-Boot mailing list