[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87k2d5eqel.fsf@free-electrons.com>
Date: Tue, 18 Oct 2016 15:29:54 +0200
From: Gregory CLEMENT <gregory.clement@...e-electrons.com>
To: Rob Herring <robh+dt@...nel.org>
Cc: Rob Herring <robh@...nel.org>, Ziji Hu <huziji@...vell.com>,
Ulf Hansson <ulf.hansson@...aro.org>,
Adrian Hunter <adrian.hunter@...el.com>,
<linux-mmc@...r.kernel.org>, Jason Cooper <jason@...edaemon.net>,
Andrew Lunn <andrew@...n.ch>,
Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>,
<devicetree@...r.kernel.org>,
Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>,
<linux-arm-kernel@...ts.infradead.org>,
"Jack\(SH\) Zhu" <jmzhu@...vell.com>, Jimmy Xu <zmxu@...vell.com>,
Jisheng Zhang <jszhang@...vell.com>,
Nadav Haklai <nadavh@...vell.com>, Ryan Gao <ygao@...vell.com>,
Doug Jones <dougj@...vell.com>,
Shiwu Zhang <zhangshw@...vell.com>,
Victor Gu <xigu@...vell.com>,
"Wei\(SOCP\) Liu" <liuw@...vell.com>,
Wilson Ding <dingwei@...vell.com>,
Xueping Liu <xpliu@...vell.com>,
Hilbert Zhang <zzhang@...vell.com>,
Keji Zhang <keji@...vell.com>,
Liuliu Zhao <zhaoliul@...vell.com>,
Peng Zhu <zhupeng@...vell.com>, Yu Cao <yucao@...vell.com>,
Romain Perier <romain.perier@...e-electrons.com>,
Yehuda Yitschak <yehuday@...vell.com>,
Marcin Wojtas <mw@...ihalf.com>,
Hanna Hawa <hannah@...vell.com>,
Kostya Porotchkin <kostap@...vell.com>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 5/10] dt: bindings: Add bindings for Marvell Xenon SD Host Controller
Hi Rob,
On mar., oct. 11 2016, Ziji Hu <huziji@...vell.com> wrote:
[...]
>>> + Different Xenon SDHC release has different register set size.
>>> + The specific size should also refer to the SOC implementation.
>>> +
>>> +Optional Properties:
>>> +- Slot Index
>>> + A single Xenon IP can support multiple slots.
>>> + During initialization, each slot should set corresponding setting bit in
>>> + some Xenon-specific registers. The corresponding bit is determined by
>>> + this property.
>>> + - xenon,slotno = <slot_index>;
>>
>> Slots should probably be represented as child nodes with the reg
>> property being the slot number.
>
> Since each SDHC slot is independent, I find it is more
> convenient to implement each one as independent SD host/MMC host
> instant.
> Otherwise, a main function should loop and initialize each
> slot, like sdhci-pci. I prefer to avoiding such a unnecessary main
> function.
>
> It is very hard to determine the slot number by reg property.
> Xenon slots are likely to be different types. 1st slot might
> be eMMC and 2nd one might be SD. They might have different register
> size.
> The register size might also varies in different Xenon versions.
>
Something that took me a while to figure out is that even it is the same
hardware block which handle multiple SoCs.
Each slots is managed by its own set of register. From the point of view
of the OS, it is as if we have an independent controller for each
slot.
But for an obscure reason, some command need to know which slot is
used. That's why we ended with this property.
With some example what you had in mind was something like that:
sdhci@...000 {
compatible = "marvell,armada-3700-sdhci";
reg = <0xaa0000 0x1000>;
[...]
slot0 {
/* slot0 is an eMMC */
reg = <0>;
bus-width = <8>;
xenon,pad-type = "fixed-1-8v";
}
slot1 {
/* slot1 is an SD Card */
reg = <1>;
bus-width = <4>;
xenon,pad-type = "fixed-1-8v";
}
};
But it won't work as each slot uses its own address registers, that why we
ended with this:
sdhci@...000 {
/* slot0 is an eMMC */
compatible = "marvell,armada-3700-sdhci";
reg = <0xaa0000 0x1000>;
[...]
xenon,slotno = <0>;
bus-width = <8>;
xenon,pad-type = "fixed-1-8v";
};
sdhci@...000 {
/* slot1 is an SD Card */
compatible = "marvell,armada-3700-sdhci";
reg = <0xbb0000 0x1000>;
[...]
xenon,slotno = <1>;
bus-width = <4>;
xenon,pad-type = "fixed-1-8v";
};
I hope it is more clear now.
Gregory
--
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
Powered by blists - more mailing lists