devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Orson Zhai <orsonzhai-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: "\"Billows Wu (武洪涛)\""
	<Billows.Wu-lxIno14LUO0EEoCn2XhGlw@public.gmane.org>,
	"Rob Herring"
	<robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: "\"Chunyan Zhang (张春艳)\""
	<Chunyan.Zhang-lxIno14LUO0EEoCn2XhGlw@public.gmane.org>,
	"chris-OsFVWbfNK3isTnJN9+BGXg@public.gmane.org"
	<chris-OsFVWbfNK3isTnJN9+BGXg@public.gmane.org>,
	"Ulf Hansson"
	<ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	"Lee Jones" <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	"Shawn Guo" <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	"Grant Likely"
	<grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	"Rob Herring" <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	"Arnd Bergmann" <arnd-r2nGTMty4D4@public.gmane.org>,
	"\"Wei Qiao (乔伟)\""
	<Wei.Qiao-lxIno14LUO0EEoCn2XhGlw@public.gmane.org>,
	"\"Baolin Wang (王宝林)\""
	<Baolin.Wang-lxIno14LUO0EEoCn2XhGlw@public.gmane.org>,
	"\"Ning Yang (杨宁)\""
	<Ning.Yang-lxIno14LUO0EEoCn2XhGlw@public.gmane.org>,
	"\"Orson Zhai (翟京)\""
	<Orson.Zhai-lxIno14LUO0EEoCn2XhGlw@public.gmane.org>,
	"\"Jason Wu (吴霁爽)\""
	<Jason.Wu-lxIno14LUO0EEoCn2XhGlw@public.gmane.org>,
	"linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [RFC PATCH] mmc: sprd: add MMC host driver for Spreadtrum SoC
Date: Sat, 04 Jul 2015 12:03:39 +0800	[thread overview]
Message-ID: <55975B1B.60008@gmail.com> (raw)
In-Reply-To: <f3e0e99497ba4b729fb0e016677f4e16-GFC6RAiklXKXEiejXgtQ7QQSgKfZeEaX@public.gmane.org>



On 2015年07月03日 13:44, Billows Wu (武洪涛) wrote:
> Hi Rob,
>
> Thanks for your reply.
> The MMC subsys core can figure out the type of the device attached. But it happaped after MMC probe function run over.
> If we want to distinguish MMC,SD or Wi-Fi in controller's probe function, we may by controller's register physical address, for example  20600000.sdio,2.400000.sdio or 20300000.sdio.   So we must know MMC controller's physical address is 0x20600000 and SD controller's physical address is 0x20300000. This reduces the code readability.
why not answer rob's 2nd comment on POWER_OFF flag in same time?
and you should use "in-line reply" without base64 encoding.

back to the question, i think you don't need to know the exact card type 
at probe time only a little bit earlier than in later work queue.
just printing out the devname and card type at work queue is good enough.
say some logs in work-queue as "20600000.sdio detecting... card type: emmc"

-orson
> If you have a good opinion how to distinguish MMC form SD or SDIO device in host controller probe function not by physical address, please tell us.
>
> Thanks!
> --billows
> ___________________________________
> From: Orson Zhai <orsonzhai-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Sent: Friday, July 3, 2015 10:50 AM
> To: Rob Herring
> Cc: Chunyan Zhang (张春艳); chris-OsFVWbfNK3isTnJN9+BGXg@public.gmane.org; Ulf Hansson; Lee Jones; Shawn Guo; Grant Likely; Rob Herring; Arnd Bergmann; Billows Wu (武洪涛); Wei Qiao (乔伟); Baolin Wang (王宝林); Ning Yang (杨宁); Orson Zhai (翟京); Jason Wu (吴霁爽); linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; linux-kernel@vger.kernel.org; devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Subject: Re: [RFC PATCH] mmc: sprd: add MMC host driver for Spreadtrum SoC
>
> On Thu, Jul 2, 2015 at 11:47 PM, Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> On Thu, Jul 2, 2015 at 4:26 AM, Orson Zhai <orsonzhai-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>> Hi Rob,
>>>
>>> Thanks for your quick reply.
>>> I have one question to your last comment.
>>>
>>> On Thu, Jul 2, 2015 at 1:50 AM, Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>>> On Wed, Jul 1, 2015 at 2:23 AM, Chunyan Zhang
>>>> <chunyan.zhang-lxIno14LUO0EEoCn2XhGlw@public.gmane.org> wrote:
>>>>> From: Billows Wu <billows.wu-lxIno14LUO0EEoCn2XhGlw@public.gmane.org>
>> [...]
>>
>>>>> +const struct of_device_id sdhost_of_match[] = {
>>>>> +       {.compatible = "sprd,sd-sdhost-3.0", .data = &sd_caps_info,},
>>>>> +       {.compatible = "sprd,wifi-sdhost-3.0", .data = &wifi_caps_info,},
>>>>> +       {.compatible = "sprd,emmc-sdhost-3.0",  .data = &emmc_caps_info,},
>>>> What these are connected to is irrelevant to the driver and compatible
>>>> string. All these differences belong in the DT unless the IP blocks
>>>> are really different.
>>> It's my idea to let Billows do like this.
>>> I learn from SSP part in freescale  "arch/arm/boot/dts/imx28-evk.dts"
>>> Their ssp0-ssp2 each have 2 roles, mmc or generic spi bus.
>>> And they may write one of their combo configuration like this:
>> That is a bit different as the host controller is operating in
>> completely different modes. In your case, the host controller is the
>> same and functions the same way, but just has different cards
>> attached.
>>
>>>   43                         ssp1: ssp@80012000 {
>>>   44                                 compatible = "fsl,imx28-mmc";
>>>   45                                 bus-width = <8>;
>>>   46                                 wp-gpios = <&gpio0 28 0>;
>>>   47                         };
>>>   48
>>>   49                         ssp2: ssp@80014000 {
>>>   50                                 #address-cells = <1>;
>>>   51                                 #size-cells = <0>;
>>>   52                                 compatible = "fsl,imx28-spi";
>>>   53                                 pinctrl-names = "default";
>>>   54                                 pinctrl-0 = <&spi2_pins_a>;
>>>   55                                 status = "okay";
>>>   56
>>>   57                                 flash: m25p80@0 {
>>>   58                                         #address-cells = <1>;
>>>   59                                         #size-cells = <1>;
>>>   60                                         compatible = "sst,sst25vf016b";
>>>   61                                         spi-max-frequency = <40000000>;
>>>   62                                         reg = <0>;
>>>   63                                 };
>>>   64                         };
>>>
>>> Billows tell me they also have 3 roles in their sd host controller
>>> corresponding to 3 kinds of different operation.
>>> He used to create "sprd,name" property for this. Is it a good way or
>>> anything else better?
>> Why do you need to know? You can define parameters which can't be
>> probed such as bus width, voltage, and clock freq. in DT for each
>> host. The MMC subsys core will figure out the type of device attached.
> I think you're right.
> Thanks!
> -orson
>
>> Rob

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2015-07-04  4:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <sprd-mmc-rfc>
2015-07-01  7:12 ` [RFC PATCH] mmc: sprd: add MMC host driver for Spreadtrum SoC Chunyan Zhang
     [not found]   ` <1435734774-10993-1-git-send-email-chunyan.zhang-lxIno14LUO0EEoCn2XhGlw@public.gmane.org>
2015-07-01  9:57     ` Jaehoon Chung
2015-07-02  2:35       ` Chunyan Zhang
2015-07-01  7:23 ` Chunyan Zhang
2015-07-01 17:50   ` Rob Herring
     [not found]     ` <CAL_JsqKcZ-7rM5YrkpJSP7OfECmRg4hWPRFy=UqZn1y74R8qsg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-07-02  9:26       ` Orson Zhai
2015-07-02 15:47         ` Rob Herring
     [not found]           ` <CAL_JsqKk0KOheyGvc=EBkgH3K4fPDsppLQGtXjNA4cekW57bvQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-07-03  2:50             ` Orson Zhai
2015-07-03  5:44               ` Billows Wu (武洪涛)
     [not found]                 ` <f3e0e99497ba4b729fb0e016677f4e16-GFC6RAiklXKXEiejXgtQ7QQSgKfZeEaX@public.gmane.org>
2015-07-04  4:03                   ` Orson Zhai [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=55975B1B.60008@gmail.com \
    --to=orsonzhai-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=Baolin.Wang-lxIno14LUO0EEoCn2XhGlw@public.gmane.org \
    --cc=Billows.Wu-lxIno14LUO0EEoCn2XhGlw@public.gmane.org \
    --cc=Chunyan.Zhang-lxIno14LUO0EEoCn2XhGlw@public.gmane.org \
    --cc=Jason.Wu-lxIno14LUO0EEoCn2XhGlw@public.gmane.org \
    --cc=Ning.Yang-lxIno14LUO0EEoCn2XhGlw@public.gmane.org \
    --cc=Orson.Zhai-lxIno14LUO0EEoCn2XhGlw@public.gmane.org \
    --cc=Wei.Qiao-lxIno14LUO0EEoCn2XhGlw@public.gmane.org \
    --cc=arnd-r2nGTMty4D4@public.gmane.org \
    --cc=chris-OsFVWbfNK3isTnJN9+BGXg@public.gmane.org \
    --cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    /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;
as well as URLs for NNTP newsgroup(s).