mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Billows Wu (武洪涛)" <Billows.Wu@spreadtrum.com>
To: Orson Zhai <orsonzhai@gmail.com>, Rob Herring <robherring2@gmail.com>
Cc: "Chunyan Zhang (张春艳)" <Chunyan.Zhang@spreadtrum.com>,
	"chris@printf.net" <chris@printf.net>,
	"Ulf Hansson" <ulf.hansson@linaro.org>,
	"Lee Jones" <lee.jones@linaro.org>,
	"Shawn Guo" <shawn.guo@linaro.org>,
	"Grant Likely" <grant.likely@linaro.org>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Wei Qiao (乔伟)" <Wei.Qiao@spreadtrum.com>,
	"Baolin Wang (王宝林)" <Baolin.Wang@spreadtrum.com>,
	"Ning Yang (杨宁)" <Ning.Yang@spreadtrum.com>,
	"Orson Zhai (翟京)" <Orson.Zhai@spreadtrum.com>,
	"Jason Wu (吴霁爽)" <Jason.Wu@spreadtrum.com>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: RE: [RFC PATCH] mmc: sprd: add MMC host driver for Spreadtrum SoC
Date: Fri, 3 Jul 2015 05:44:17 +0000	[thread overview]
Message-ID: <f3e0e99497ba4b729fb0e016677f4e16@SHMBX03.spreadtrum.com> (raw)
In-Reply-To: <CA+H2tpFO2uz3Pr4bxoesqc8teF+SYhw-GqKOdk_w4_p5KvJR6A@mail.gmail.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb2312", Size: 4456 bytes --]

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. 
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@gmail.com>
Sent: Friday, July 3, 2015 10:50 AM
To: Rob Herring
Cc: Chunyan Zhang (ÕÅ´ºÑÞ); chris@printf.net; 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@vger.kernel.org; linux-kernel@vger.kernel.org; devicetree@vger.kernel.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@gmail.com> wrote:
> On Thu, Jul 2, 2015 at 4:26 AM, Orson Zhai <orsonzhai@gmail.com> 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@gmail.com> wrote:
>>> On Wed, Jul 1, 2015 at 2:23 AM, Chunyan Zhang
>>> <chunyan.zhang@spreadtrum.com> wrote:
>>>> From: Billows Wu <billows.wu@spreadtrum.com>
>
> [...]
>
>>>> +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
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

  reply	other threads:[~2015-07-03  5:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <sprd-mmc-rfc>
2015-07-01  7:12 ` Chunyan Zhang
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
2015-07-02  9:26     ` Orson Zhai
2015-07-02 15:47       ` Rob Herring
2015-07-03  2:50         ` Orson Zhai
2015-07-03  5:44           ` Billows Wu (武洪涛) [this message]
2015-07-04  4:03             ` Orson Zhai

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=f3e0e99497ba4b729fb0e016677f4e16@SHMBX03.spreadtrum.com \
    --to=billows.wu@spreadtrum.com \
    --cc=Baolin.Wang@spreadtrum.com \
    --cc=Chunyan.Zhang@spreadtrum.com \
    --cc=Jason.Wu@spreadtrum.com \
    --cc=Ning.Yang@spreadtrum.com \
    --cc=Orson.Zhai@spreadtrum.com \
    --cc=Wei.Qiao@spreadtrum.com \
    --cc=arnd@arndb.de \
    --cc=chris@printf.net \
    --cc=devicetree@vger.kernel.org \
    --cc=grant.likely@linaro.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=orsonzhai@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=robherring2@gmail.com \
    --cc=shawn.guo@linaro.org \
    --cc=ulf.hansson@linaro.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

all inboxes | Powered by JetHome®