U-Boot of-platdata issue
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";
...
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";...
Thanks,
- Kever
Hi Kever,
Quoted 24 lines · Kever Yang
Hi Simon,
I met two issue when using of-platdata
1. compitable name with '.'
I get compile error as below:
In file included frominclude/dt-structs.h:16:0,
fromspl/dts/dt-platdata.c:3:include/generated/dt-structs.h:26:35: error: expected identifier or ?(? before numeric constantstruct 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
Quoted 6 lines
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.
Quoted 17 lines
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 structrockchip_mmc_plat{
24 #ifCONFIG_IS_ENABLED(OF_PLATDATA)
25 structdtd_rockchip_rk3288_dw_mshcdtplat;
26 #endif
27 structmmc_configcfg;
28 struct mmc mmc;
29 };
...
dts node
Quoted 3 lines
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.
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.
Regards,
Simon
Hi Simon,
Quoted 68 lines · Simon Glass
Hi Kever,
Quoted 24 lines · Kever Yang
Hi Simon,
I met two issue when using of-platdata
1. compitable name with '.'
I get compile error as below:
In file included frominclude/dt-structs.h:16:0,
fromspl/dts/dt-platdata.c:3:include/generated/dt-structs.h:26:35: error: expected identifier or ?(? before numeric constantstruct 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 2Quoted 6 lines
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.
Quoted 16 lines
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 structrockchip_mmc_plat{
24 #ifCONFIG_IS_ENABLED(OF_PLATDATA)
25 structdtd_rockchip_rk3288_dw_mshcdtplat;
26 #endif
27 structmmc_configcfg;
28 struct mmc mmc;
29 };
...
dts nodeQuoted 3 lines
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{
#ifCONFIG_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
Quoted 7 lines
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.
Quoted 3 lines
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
Quoted 6 lines
Regards,
Simon
Quoted 73 lines · Kever Yang
Hi Simon,
Quoted 70 lines · Simon Glass
Hi Kever,
Quoted 24 lines · Kever Yang
Hi Simon,
I met two issue when using of-platdata
1. compitable name with '.'
I get compile error as below:
In file included frominclude/dt-structs.h:16:0,
fromspl/dts/dt-platdata.c:3:include/generated/dt-structs.h:26:35: error: expected identifier or ?(? before numeric constantstruct 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 2Quoted 6 lines
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.
Quoted 16 lines
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 structrockchip_mmc_plat{
24 #ifCONFIG_IS_ENABLED(OF_PLATDATA)
25 structdtd_rockchip_rk3288_dw_mshcdtplat;
26 #endif
27 structmmc_configcfg;
28 struct mmc mmc;
29 };
...
dts nodeQuoted 3 lines
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{
#ifCONFIG_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
#endifObviously we don't want that as it is putting SoC-specific stuff in the driver.
Quoted 8 lines
Quoted 5 lines
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.
does it use just "rockchip,dw-mshc"? Maybe this can be common compatible for rockchip. If it needs add the other compatible in future, it should be added the specific compatible at that time.
Quoted 25 lines
Quoted 3 lines
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,
- KeverQuoted 6 lines
Regards,
Simon_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
Hi Simon, Jaehoon,
Quoted 79 lines · Jaehoon Chung
Quoted 78 lines · Kever Yang
Hi Simon,
Quoted 75 lines · Simon Glass
Hi Kever,
Quoted 24 lines · Kever Yang
Hi Simon,
I met two issue when using of-platdata
1. compitable name with '.'
I get compile error as below:
In file included frominclude/dt-structs.h:16:0,
fromspl/dts/dt-platdata.c:3:include/generated/dt-structs.h:26:35: error: expected identifier or ?(? before numeric constantstruct 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 2Quoted 6 lines
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.
Quoted 7 lines
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"Quoted 12 lines
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{
#ifCONFIG_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
#endifObviously 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.
Quoted 5 lines
Quoted 2 lines
Agree, but... this is from kernel, we can't control it unless all kernel maintainers have the same idea.
does it use just "rockchip,dw-mshc"? Maybe this can be common compatible for rockchip. If it needs add the other compatible in future, it should be added the specific compatible at that time.
I don't think we will have a change in dts compatible for U-Boot dts, because we will always using dts
file from kernel, so we will use it as is.
We can use "rockchip,rk3288-dw-mshc" for rk3288 and rk3399, here is the document.
and for dw-mshc:Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.txt
* compatible: should be
- "rockchip,rk2928-dw-mshc": for Rockchip RK2928 and following, before RK3288
- "rockchip,rk3288-dw-mshc": for Rockchip RK3288
- "rockchip,rk3399-dw-mshc", "rockchip,rk3288-dw-mshc": for
Rockchip RK3399
For the compatible name, there had some discuss before, like this patch:
https://lists.gt.net/linux/kernel/2372182
So for the of-platdata, we can use "rockchip,rk3288-dw-mshc" to generate the structure.
Thanks,
- Kever
Quoted 24 lines
Quoted 21 lines
Quoted 2 lines
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,
- KeverQuoted 5 lines
Regards,
Simon_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
Hi Kever,
Quoted 121 lines · Kever Yang
Hi Simon, Jaehoon,
Quoted 92 lines · Jaehoon Chung
Quoted 90 lines · Kever Yang
Hi Simon,
Quoted 85 lines · Simon Glass
Hi Kever,
Quoted 27 lines · Kever Yang
Hi Simon,
I met two issue when using of-platdata
1. compitable name with '.'
I get compile error as below:
In file included frominclude/dt-structs.h:16:0,
fromspl/dts/dt-platdata.c:3:include/generated/dt-structs.h:26:35: error: expected identifier or ?(? before numeric constantstruct 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 2Quoted 6 lines
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.
Quoted 9 lines
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"Quoted 12 lines
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{
#ifCONFIG_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
#endifObviously 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.
Quoted 9 lines
Quoted 3 lines
Agree, but... this is from kernel, we can't control it unless all kernel maintainers
have the same idea.does it use just "rockchip,dw-mshc"? Maybe this can be common compatible for rockchip.
If it needs add the other compatible in future, it should be added the specific compatible at that time.I don't think we will have a change in dts compatible for U-Boot dts, because we will always using dts
file from kernel, so we will use it as is.We can use "rockchip,rk3288-dw-mshc" for rk3288 and rk3399, here is the document.
and for dw-mshc:Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.txt
* compatible: should be
- "rockchip,rk2928-dw-mshc": for Rockchip RK2928 and following, before RK3288
- "rockchip,rk3288-dw-mshc": for Rockchip RK3288
- "rockchip,rk3399-dw-mshc", "rockchip,rk3288-dw-mshc": for Rockchip
RK3399
Quoted 5 lines
For the compatible name, there had some discuss before, like this patch:
https://lists.gt.net/linux/kernel/2372182So for the of-platdata, we can use "rockchip,rk3288-dw-mshc" to generate the structure.
So in this case, as you saying that you need dtoc to #define the structs to be the same? Or can you do this yourself in a header file?
[..]
Regards,
Simon
Hi Simon,
On 02/17/2017 04:43 AM, Simon Glass wrote:
[...]
Quoted 66 lines
Quoted 66 lines
Quoted 43 lines
Quoted 43 lines
Quoted 43 lines
Quoted 9 lines
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"Quoted 12 lines
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{
#ifCONFIG_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
#endifObviously 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.
Quoted 8 lines
Quoted 3 lines
Agree, but... this is from kernel, we can't control it unless all kernel maintainers
have the same idea.does it use just "rockchip,dw-mshc"? Maybe this can be common compatible for rockchip.
If it needs add the other compatible in future, it should be added the specific compatible at that time.I don't think we will have a change in dts compatible for U-Boot dts, because we will always using dts
file from kernel, so we will use it as is.We can use "rockchip,rk3288-dw-mshc" for rk3288 and rk3399, here is the document.
and for dw-mshc:Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.txt
* compatible: should be
- "rockchip,rk2928-dw-mshc": for Rockchip RK2928 and following, before RK3288
- "rockchip,rk3288-dw-mshc": for Rockchip RK3288
- "rockchip,rk3399-dw-mshc", "rockchip,rk3288-dw-mshc": for Rockchip
RK3399
Quoted 7 lines
Quoted 5 lines
For the compatible name, there had some discuss before, like this patch:
https://lists.gt.net/linux/kernel/2372182So for the of-platdata, we can use "rockchip,rk3288-dw-mshc" to generate the structure.
So in this case, as you saying that you need dtoc to #define the structs to be the same? Or can you do this yourself in a header file?
Maybe what I want to say is not clear enough.
Instead of using new compatible for dts match, we should using the very first
compatible for of-platdata structure.
Like the document mentioned before:
"rockchip,rk3288-dw-mshc" for RK3288,
"rockchip,rk3399-dw-mshc", "rockchip,rk3288-dw-mshc"; for RK3399
"rockchip,rk3328-dw-mshc", "rockchip,rk3288-dw-mshc"; for RK3328
The "rockchip,rk3288-dw-mshc" is always there if we are using the same controller,
we can use this "rockchip,rk3288-dw-mshc" to generate the of-platdata structure,
then we can always use "struct dtd_rockchip_rk3288_dw_mshc dtplat;" in mmc driver.
Could you help to send a patch for this? I'm really not good at python :(
Thanks,
- Kever
Quoted 8 lines
[..]
Regards,
Simon