public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v1 08/18] MIPS: pic32: Add driver for Microchip PIC32 flash controller.
Date: Fri, 8 Jan 2016 15:11:12 +0100	[thread overview]
Message-ID: <568FC380.1020609@denx.de> (raw)
In-Reply-To: <568FBF5F.7020100@microchip.com>

On 08.01.2016 14:53, Purna Chandra Mandal wrote:
> On 12/21/2015 08:50 PM, Stefan Roese wrote:
>> On 21.12.2015 15:58, Daniel Schwierzeck wrote:
>>>
>>>
>>> Am 17.12.2015 um 18:30 schrieb Purna Chandra Mandal:
>>>> From: Cristian Birsan <cristi.birsan@microchip.com>
>>>>
>>>> Signed-off-by: Cristian Birsan <cristi.birsan@microchip.com>
>>>> Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
>>>> ---
>>>>
>>>>    arch/mips/mach-pic32/Makefile |   5 +-
>>>>    arch/mips/mach-pic32/flash.c  | 471 ++++++++++++++++++++++++++++++++++++++++++
>>>>    include/flash.h               |   5 +-
>>>>    3 files changed, 479 insertions(+), 2 deletions(-)
>>>>    create mode 100644 arch/mips/mach-pic32/flash.c
>>>>
>>>
>>> +cc Stefan Roese
>>>
>>> have you tried to use drivers/mtd/cfi_flash.c? You are duplicating some
>>> common code. If you need additional logic for your flash controller,
>>> then you can try to overwrite the weak flash_readX/flash_writeX
>>> accessors. You have to enable CONFIG_CFI_FLASH_USE_WEAK_ACCESSORS to be
>>> able to do this.
>>
>> Yes, this really looks like it could use the common CFI flash driver.
>> You might need to add support for the new flash devices with the
>> commands, if its not already supported. But this should be better
>> than duplicating some of the code already available.
>>
> Thanks Stefan.
>
> Tried to understand and map PIC32 flash driver on cfi_flash.c. It is not straight
> forward and resultant code becomes clumsy, full of if-else.

Ughh. Thats definitely not something that we strive for.

> Please note PIC32 flash is not CFI complaint. Specific operations
> (like erase, and program) on the flash panel are handled by PIC32 nvm controller.
> NVM controller documentation: http://ww1.microchip.com/downloads/en/DeviceDoc/60001193B.pdf
>
> Instead I'll propose to improve current pic32_flash driver and move it to drivers/mtd/
> (like st_smi.c).

Okay. Then please continue with this approach and lets see,
how the resulting code will be structured.

Thanks,
Stefan

      reply	other threads:[~2016-01-08 14:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-17 17:30 [U-Boot] [PATCH v1 08/18] MIPS: pic32: Add driver for Microchip PIC32 flash controller Purna Chandra Mandal
2015-12-21 14:58 ` Daniel Schwierzeck
2015-12-21 15:20   ` Stefan Roese
2016-01-08 13:53     ` Purna Chandra Mandal
2016-01-08 14:11       ` Stefan Roese [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=568FC380.1020609@denx.de \
    --to=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox