[meta-xilinx] [PATCH v3] platform-init: add support for psu_init_gpl files
Nathan Rossi
nathan at nathanrossi.com
Sun Feb 5 07:12:44 PST 2017
On 5 February 2017 at 04:33, Jean-Francois Dagenais
<jeff.dagenais at gmail.com> wrote:
>
>> On Feb 3, 2017, at 07:00, Nathan Rossi <nathan at nathanrossi.com> wrote:
>>
>> So before I make any comments, I would like to point out I have some
>> changes that I have been working on to add similar support for ZynqMP
>> platform init files. I hit some issues regarding compatibility with
>> existing layers, which is why I have not sent out a series for it yet.
>>
>> https://github.com/nathanrossi/meta-xilinx/commits/nrossi/wip
>>
>> I would be interested in your opinion of your changes vs the changes
>> in in that branch.
>
> I will take a look soon.
>
>>
>> So I think the biggest issue with this patch would be that it breaks
>> the ability work with existing provides/etc. Which I think is quite
>> important. However I am open to breaking that if users would prefer to
>> do so.
>
> You mean in their own layers? In meta-xilinx, I fixed the provides and depends.
Yep. Since it is relatively trivial to keep the compatibility I am
inclined to avoid the breaking change with regards to the Zynq
providers/file paths/etc.
>
>>> diff --git a/recipes-bsp/u-boot/u-boot-spl-zynq-init.inc b/recipes-bsp/u-boot/u-boot-spl-zynq-init.inc
>>> index cc06de6..6a5fe25 100644
>>> --- a/recipes-bsp/u-boot/u-boot-spl-zynq-init.inc
>>> +++ b/recipes-bsp/u-boot/u-boot-spl-zynq-init.inc
>>> @@ -1,35 +1,35 @@
>>> -inherit zynq7-platform-paths
>>> +inherit zynq-platform-paths
>>>
>>> do_configure_prepend() {
>>> - if ${@bb.utils.contains('DEPENDS', 'virtual/zynq7-platform-init', 'true', 'false', d)}; then
>>> + if ${@bb.utils.contains('DEPENDS', 'virtual/zynq-platform-init', 'true', 'false', d)}; then
>>> if [ -d "${S}/board/xilinx/zynq/custom_hw_platform" ]; then
>>> - cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.h ${S}/board/xilinx/zynq/custom_hw_platform/
>>> - cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.c ${S}/board/xilinx/zynq/custom_hw_platform/
>>> + cp ${PLATFORM_INIT_STAGE_DIR}/${PSx}_init_gpl.h ${S}/board/xilinx/zynq/custom_hw_platform/
>>> + cp ${PLATFORM_INIT_STAGE_DIR}/${PSx}_init_gpl.c ${S}/board/xilinx/zynq/custom_hw_platform/
>>> else
>>> - cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.h ${S}/board/xilinx/zynq/
>>> - cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.c ${S}/board/xilinx/zynq/
>>> + cp ${PLATFORM_INIT_STAGE_DIR}/${PSx}_init_gpl.h ${S}/board/xilinx/zynq/
>>> + cp ${PLATFORM_INIT_STAGE_DIR}/${PSx}_init_gpl.c ${S}/board/xilinx/zynq/
>>> fi
>>> - if [ -n "${FORCE_PS7INIT}" ]; then
>>> - # overwrite all the existing platforms ps7_init files, this is a shotgun approach and only works due to
>>> + if [ -n "${FORCE_PSxINIT}" ]; then
>>> + # overwrite all the existing platforms ${PSx}_init files, this is a shotgun approach and only works due to
>>> # u-boot being built for each machine seperately with seperate source directories.
>>> for i in ${S}/board/xilinx/zynq/*/; do
>>> - cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.h $i
>>> - cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.c $i
>>> + cp ${PLATFORM_INIT_STAGE_DIR}/${PSx}_init_gpl.h $i
>>> + cp ${PLATFORM_INIT_STAGE_DIR}/${PSx}_init_gpl.c $i
>>
>> This should populate into the "zynqmp" board directory for zynqmp and
>> "zynq" for "zynq".
>
> If you look at the PSx assignment, it is "ps7" for zynq's, and "psu" for
> zynqmp's. The same directory can be used since the files are put in a machine
> specific staging sysroot.
Sorry my comment was not quite clear. I was referring to the
directories that it is populating to in the u-boot source tree. Since
zynqmp is a setup as a different board, it uses board/xilinx/zynqmp/.
http://git.denx.de/?p=u-boot.git;a=tree;f=board/xilinx/zynqmp;h=14b1bfe5a295a1c76e9be3d8e7916b055a8cfa7f;hb=HEAD
>
>>
>>> done
>>> fi
>>> fi
>>> }
>>>
>>> -FORCE_PS7INIT[doc] = "This variable is used to force the overriding of all ps7_init_gpl.* files in u-boot source with what is provided by virtual/zynq7-platform-init."
>>> +FORCE_PSxINIT[doc] = "This variable is used to force the overriding of all ${PSx}_init_gpl.* files in u-boot source with what is provided by virtual/zynq-platform-init."
>>>
>>> python () {
>>> - # Determine if target machine needs to provide a custom ps7_init_gpl.*
>>> - if d.getVar("SOC_FAMILY", True) == "zynq":
>>> + # Determine if target machine needs to provide a custom ${PSx}_init_gpl.*
>>> + if "zynq" in d.getVar("SOC_FAMILY", True):
>>
>> This should be a full match, since it is likely for future SOC's to
>> have the "*zynq*" name.
>
> I assume that every zynq and zynqmp and other variants to come will use the
> platform-init mechanism with psX_init_gpl.c/h files. This is why I wanted to
> match anything that contains the word "zynq" in it.
Sure (and who knows Xilinx might not use the zynq brand?). But u-boot
might not have support for those targets (initially?), and arguably
this include doesn't support anything more than zynq/zynqmp, so it
would likely need to be modified to support additional targets in the
future.
Regards,
Nathan
More information about the meta-xilinx
mailing list