From: Kever Yang <kever.yang@rock-chips.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] U-Boot of-platdata issue
Date: Mon, 13 Feb 2017 17:23:53 +0800 [thread overview]
Message-ID: <58A17B29.1070600@rock-chips.com> (raw)
In-Reply-To: <CAPnjgZ2mFQTQqZVD4w3EXXuK5adW2jd73Yf+KTKJ+R85=Fon=g@mail.gmail.com>
Hi Simon,
On 01/16/2017 12:15 PM, Simon Glass wrote:
> Hi Kever,
>
> On 15 January 2017 at 18:28, Kever Yang <kever.yang@rock-chips.com> wrote:
>> Hi Simon,
>>
>> I met two issue when using of-platdata
>>
>> 1. compitable name with '.'
>> I get compile error as below:
>> In file included from include/dt-structs.h:16:0,
>> from spl/dts/dt-platdata.c:3:
>> include/generated/dt-structs.h:26:35: error: expected identifier or ?(?
>> before numeric constant
>> struct dtd_rockchip_rk3399_sdhci_5.1 {
>> ^
>> spl/dts/dt-platdata.c:41:42: error: expected identifier or ?(? before
>> numeric constant
>> static struct dtd_rockchip_rk3399_sdhci_5.1 dtv_sdhci_at_fe330000 = {
>> ^
>> spl/dts/dt-platdata.c:55:15: error: ?dtv_sdhci_at_fe330000? undeclared here
>> (not in a function)
>> .platdata = &dtv_sdhci_at_fe330000,
>> ^
>> make[2]: *** [spl/dts/dt-platdata.o] Error 1
>> make[1]: *** [spl/u-boot-spl] Error 2
>> make: *** [__build_one_by_one] Error 2
>>
>> The dts node starts like this:
>> sdhci: sdhci at fe330000 {
>> u-boot,dm-pre-reloc;
>> compatible = "rockchip,rk3399-sdhci-5.1",
>> "arasan,sdhci-5.1";
>> ...
> That just involves replacing '.' with '_'. I sent a patch.
>
>> 2. multi compatible name
>> When a dts node have more than one compatible name, which is prefer to use?
>> for example, we have two dwmmc compatible name in rk3399, the tool is using
>> the first one,
>> while the source code using the last one.
>>
>> "drivers/mmc/rockchip_dw_mmc.c"
>> 23 struct rockchip_mmc_plat {
>> 24 #if CONFIG_IS_ENABLED(OF_PLATDATA)
>> 25 struct dtd_rockchip_rk3288_dw_mshc dtplat;
>> 26 #endif
>> 27 struct mmc_config cfg;
>> 28 struct mmc mmc;
>> 29 };
>> ...
>> dts node
>> sdmmc: dwmmc at fe320000 {
>> compatible = "rockchip,rk3399-dw-mshc",
>> "rockchip,rk3288-dw-mshc";
> I'm not sure of the best solution here (other than putting more
> on-chip SRAM in your devices hint hint :-)
>
> One option is something like:
>
> struct rockchip_mmc_plat {
> #if CONFIG_IS_ENABLED(OF_PLATDATA)
> #ifdef CONFIG_ROCKCHIP_RK3288
> struct dtd_rockchip_rk3288_dw_mshc dtplat;
> #elif defined(CONFIG_ROCKCHIP_RK399)
> struct dtd_rockchip_rk399_dw_mshc dtplat;
> #endif
> #endif
>
> Obviously we don't want that as it is putting SoC-specific stuff in the driver.
>
> IMO the compatible strings are being misused a bit. Can there not be a
> compatible string which is common to all rockchip devices which use
> this IP? Something like "rockchip,dw-mshc-v1"? Then you can avoid
> adding a new compatible string every time you use the same IP in a
> device.
Agree, but... this is from kernel, we can't control it unless all kernel
maintainers
have the same idea.
>
> Another option would be for dtoc to #define each compatible string to
> the first one. If you think that would work, I could do a patch.
I think we can try with the first one in the driver for of-platdata,
this would have problem for the first compatible name is different but
they share the same driver, like syscon. For syscon, you have resolved with
a special dirver, not sure if other driver has the same problem.
Could you help to make a patch for this solution?
Thanks,
- Kever
>
> Regards,
> Simon
>
>
>
next prev parent reply other threads:[~2017-02-13 9:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-16 1:28 [U-Boot] U-Boot of-platdata issue Kever Yang
2017-01-16 4:15 ` Simon Glass
2017-02-13 9:23 ` Kever Yang [this message]
2017-02-13 9:51 ` Jaehoon Chung
2017-02-14 1:09 ` Kever Yang
2017-02-16 20:43 ` Simon Glass
2017-04-25 2:29 ` Kever Yang
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=58A17B29.1070600@rock-chips.com \
--to=kever.yang@rock-chips.com \
--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