All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] dm: implement a cfi flash uclass
Date: Sun, 11 Oct 2015 15:47:30 -0600	[thread overview]
Message-ID: <CAPnjgZ1=WD1K38m-vsxMV1-VXrwrB=LWXoGxa5ALRPDvA9r10A@mail.gmail.com> (raw)
In-Reply-To: <561A643E.5000301@wytron.com.tw>

Hi,

On 11 October 2015 at 07:29, Thomas Chou <thomas@wytron.com.tw> wrote:
> Hi Bin,
>
> On 10/11/2015 08:43 PM, Bin Meng wrote:
>>
>> The spi-flash is converted to driver model, which is good, as there
>> are spi flashes from different vendors which have different op codes
>> thus need different drivers to handle. But for cfi-flash, almost every
>> cfi-flash we see in the market conforms to the same CFI spec, thus we
>> only need one driver (drivers/mtd/cfi_flash.c) to work with all these
>> flashes, right? Unless I am missing something recently, eg: some
>> vendors started to created flashes which are not 100% compatible with
>> the CFI spec? If this is the only single driver, I don't see the need
>> to create a special driver model uclass for it. Just an open
>> discussion. I am not saying we should, or we should not :)
>
>
> I had the same question myself. But I found that there are several uclasses
> which has only one driver. No worries. :)

I don't see any problem with this in general, although the point with
CFI is that you are really implementing the uclass, as there will not
going to be any drivers (as I understand it).

Looking at SPI flash, it does have an API (read, write, erase). Could
CFI use the same API? That might mean that we could unify the two and
share a uclass.

One approach may be to use a name like UCLASS_FLASH, and add some
operations to it. Then we can say that we have a real uclass. The
operations could come in a separate flash perhaps.

>
>>> It is not just base address. There is device binding with compatible ids.
>>> There will be resources allocation, too. Please don't limit your
>>> imagination
>>> by my poor coding skill.
>>
>>
>> All there can be obtained from device tree. Being a non-DM driver does
>> not prevent you from using device tree.
>
>
> It is true. Yet using driver model does have some advantages over non-DM. It
> is more unified and dynamic. So I chose the DM way when I have to add device
> tree binding. You may find my patch quite trivial. Thanks to the DM
> framework.

Regards,
Simon

  reply	other threads:[~2015-10-11 21:47 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-08  7:34 [U-Boot] [PATCH] dm: implement a cfi flash uclass Thomas Chou
2015-10-09  9:36 ` Simon Glass
2015-10-09 13:31   ` Thomas Chou
2015-10-11  5:16     ` Thomas Chou
2015-10-11  5:41       ` Bin Meng
2015-10-11  7:25         ` Thomas Chou
2015-10-11  7:30 ` [U-Boot] [PATCH v2] " Thomas Chou
2015-10-11  7:54   ` Bin Meng
2015-10-11  8:54     ` Thomas Chou
2015-10-11  9:10       ` Bin Meng
2015-10-11 12:24         ` Thomas Chou
2015-10-11 12:43           ` Bin Meng
2015-10-11 13:29             ` Thomas Chou
2015-10-11 21:47               ` Simon Glass [this message]
2015-10-12  0:07                 ` Thomas Chou
2015-10-12  3:07                 ` Bin Meng
2015-10-11  9:35     ` Thomas Chou
2015-10-30 13:33 ` [U-Boot] [PATCH v3 1/3] dm: implement a MTD uclass Thomas Chou
2015-10-30 13:33   ` [U-Boot] [PATCH v3 2/3] cfi_flash: convert to driver model Thomas Chou
2015-11-02  8:20     ` Stefan Roese
2015-11-03  0:23       ` Thomas Chou
2015-11-03  5:56         ` Stefan Roese
2015-11-03  6:25           ` Thomas Chou
2015-11-03  7:22             ` Stefan Roese
2015-10-30 13:33   ` [U-Boot] [PATCH v3 3/3] nios2: use cfi flash " Thomas Chou
2015-11-03 13:09 ` [U-Boot] [PATCH v4 1/3] dm: implement a MTD uclass Thomas Chou
2015-11-03 13:09   ` [U-Boot] [PATCH v4 2/3] cfi_flash: convert to driver model Thomas Chou
2015-11-03 13:54     ` Stefan Roese
2015-11-06  1:09       ` Thomas Chou
2015-11-06  6:04         ` Stefan Roese
2015-11-06  6:33           ` Thomas Chou
2015-11-06  3:15     ` Simon Glass
2015-11-06  4:34       ` Thomas Chou
2015-11-06 23:58         ` Simon Glass
2015-11-03 13:09   ` [U-Boot] [PATCH v4 3/3] nios2: use cfi flash " Thomas Chou
2015-11-03 14:41   ` [U-Boot] [PATCH v4 1/3] dm: implement a MTD uclass Jagan Teki
2015-11-03 14:49     ` Thomas Chou
2015-11-03 14:55       ` Jagan Teki
2015-11-03 14:58         ` Jagan Teki
2015-11-04  3:12         ` Thomas Chou
2015-11-07 12:35           ` Jagan Teki
2015-11-07 13:43             ` Thomas Chou
2015-11-06 12:06   ` Simon Glass
2015-11-06 13:25     ` Thomas Chou
2015-11-06 23:58       ` Simon Glass
2015-11-07  7:57 ` [U-Boot] [PATCH v5 " Thomas Chou
2015-11-07  7:57   ` [U-Boot] [PATCH v5 2/3] cfi_flash: convert to driver model Thomas Chou
2015-11-09 20:24     ` Simon Glass
2015-12-06  8:23     ` Jagan Teki
2015-12-06 11:37       ` Thomas Chou
2015-12-06 13:10         ` Jagan Teki
2015-12-06 13:35           ` Thomas Chou
2015-12-06 15:03             ` Jagan Teki
2015-12-07  9:11               ` Thomas Chou
2015-11-07  7:57   ` [U-Boot] [PATCH v5 3/3] nios2: use cfi flash " Thomas Chou

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='CAPnjgZ1=WD1K38m-vsxMV1-VXrwrB=LWXoGxa5ALRPDvA9r10A@mail.gmail.com' \
    --to=sjg@chromium.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.