All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: qcom: sa8775p: add symbols to dtb
@ 2023-03-09 23:39 Eric Chanudet
  2023-03-09 23:47 ` Konrad Dybcio
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Eric Chanudet @ 2023-03-09 23:39 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski
  Cc: linux-arm-msm, devicetree, linux-kernel, Eric Chanudet

ABL uses the __symbols__ section to process the DTB before passing it
forward. Without it, the bootstrap is interrupted.

Signed-off-by: Eric Chanudet <echanude@redhat.com>
---
Depends on initial sa8775p-ride.dts:
https://lore.kernel.org/all/20230214092713.211054-3-brgl@bgdev.pl/

 arch/arm64/boot/dts/qcom/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile
index b63cd1861e68..72e85ab31d74 100644
--- a/arch/arm64/boot/dts/qcom/Makefile
+++ b/arch/arm64/boot/dts/qcom/Makefile
@@ -1,4 +1,8 @@
 # SPDX-License-Identifier: GPL-2.0
+
+# Enable support for device-tree overlays required on sa8775p-ride.
+DTC_FLAGS_sa8775p-ride := -@
+
 dtb-$(CONFIG_ARCH_QCOM)	+= apq8016-sbc.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= apq8094-sony-xperia-kitakami-karin_windy.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= apq8096-db820c.dtb
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] arm64: dts: qcom: sa8775p: add symbols to dtb
  2023-03-09 23:39 [PATCH] arm64: dts: qcom: sa8775p: add symbols to dtb Eric Chanudet
@ 2023-03-09 23:47 ` Konrad Dybcio
  2023-03-14  4:48   ` Prasad Sodagudi
  2023-03-13 12:49 ` Bjorn Andersson
  2023-03-22  2:55 ` Bjorn Andersson
  2 siblings, 1 reply; 9+ messages in thread
From: Konrad Dybcio @ 2023-03-09 23:47 UTC (permalink / raw)
  To: Eric Chanudet, Andy Gross, Bjorn Andersson, Rob Herring,
	Krzysztof Kozlowski
  Cc: linux-arm-msm, devicetree, linux-kernel



On 10.03.2023 00:39, Eric Chanudet wrote:
> ABL uses the __symbols__ section to process the DTB before passing it
> forward. Without it, the bootstrap is interrupted.
> 
> Signed-off-by: Eric Chanudet <echanude@redhat.com>
> ---
Fix your ABL.

Konrad
> Depends on initial sa8775p-ride.dts:
> https://lore.kernel.org/all/20230214092713.211054-3-brgl@bgdev.pl/
> 
>  arch/arm64/boot/dts/qcom/Makefile | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile
> index b63cd1861e68..72e85ab31d74 100644
> --- a/arch/arm64/boot/dts/qcom/Makefile
> +++ b/arch/arm64/boot/dts/qcom/Makefile
> @@ -1,4 +1,8 @@
>  # SPDX-License-Identifier: GPL-2.0
> +
> +# Enable support for device-tree overlays required on sa8775p-ride.
> +DTC_FLAGS_sa8775p-ride := -@
> +
>  dtb-$(CONFIG_ARCH_QCOM)	+= apq8016-sbc.dtb
>  dtb-$(CONFIG_ARCH_QCOM)	+= apq8094-sony-xperia-kitakami-karin_windy.dtb
>  dtb-$(CONFIG_ARCH_QCOM)	+= apq8096-db820c.dtb

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] arm64: dts: qcom: sa8775p: add symbols to dtb
  2023-03-09 23:39 [PATCH] arm64: dts: qcom: sa8775p: add symbols to dtb Eric Chanudet
  2023-03-09 23:47 ` Konrad Dybcio
@ 2023-03-13 12:49 ` Bjorn Andersson
  2023-03-14 15:14   ` Rob Herring
  2023-03-22  2:55 ` Bjorn Andersson
  2 siblings, 1 reply; 9+ messages in thread
From: Bjorn Andersson @ 2023-03-13 12:49 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski
  Cc: Eric Chanudet, Andy Gross, Konrad Dybcio, linux-arm-msm,
	devicetree, linux-kernel

On Thu, Mar 09, 2023 at 06:39:48PM -0500, Eric Chanudet wrote:
> ABL uses the __symbols__ section to process the DTB before passing it
> forward. Without it, the bootstrap is interrupted.
> 
> Signed-off-by: Eric Chanudet <echanude@redhat.com>

@Rob, @Krzysztof, it seems useful to be able to use the upstream
generated DTBs with overlays.

Do you suggest that we enable this on a per-board basis when it's being
requested, across all devices, or tell the users that they have to
re-generate the dtbs themselves?

Thanks,
Bjorn

> ---
> Depends on initial sa8775p-ride.dts:
> https://lore.kernel.org/all/20230214092713.211054-3-brgl@bgdev.pl/
> 
>  arch/arm64/boot/dts/qcom/Makefile | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile
> index b63cd1861e68..72e85ab31d74 100644
> --- a/arch/arm64/boot/dts/qcom/Makefile
> +++ b/arch/arm64/boot/dts/qcom/Makefile
> @@ -1,4 +1,8 @@
>  # SPDX-License-Identifier: GPL-2.0
> +
> +# Enable support for device-tree overlays required on sa8775p-ride.
> +DTC_FLAGS_sa8775p-ride := -@
> +
>  dtb-$(CONFIG_ARCH_QCOM)	+= apq8016-sbc.dtb
>  dtb-$(CONFIG_ARCH_QCOM)	+= apq8094-sony-xperia-kitakami-karin_windy.dtb
>  dtb-$(CONFIG_ARCH_QCOM)	+= apq8096-db820c.dtb
> -- 
> 2.39.1
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] arm64: dts: qcom: sa8775p: add symbols to dtb
  2023-03-09 23:47 ` Konrad Dybcio
@ 2023-03-14  4:48   ` Prasad Sodagudi
  2023-03-14  9:59     ` Konrad Dybcio
  2023-03-16  6:55     ` Krzysztof Kozlowski
  0 siblings, 2 replies; 9+ messages in thread
From: Prasad Sodagudi @ 2023-03-14  4:48 UTC (permalink / raw)
  To: Konrad Dybcio, Eric Chanudet, Andy Gross, Bjorn Andersson,
	Rob Herring, Krzysztof Kozlowski
  Cc: linux-arm-msm, devicetree, linux-kernel



On 3/9/2023 3:47 PM, Konrad Dybcio wrote:
> 
> 
> On 10.03.2023 00:39, Eric Chanudet wrote:
>> ABL uses the __symbols__ section to process the DTB before passing it
>> forward. Without it, the bootstrap is interrupted.
>>
>> Signed-off-by: Eric Chanudet <echanude@redhat.com>
>> ---
> Fix your ABL.
Hi Konrad,

Apps boot-loader need __symbols__ for dynamic overlay operation. 
Qualcomm firmware passes an overlay file to apps boot-loader to overlay 
some of the nodes based on firmware configuration. Without __symbols__ 
apps boot-loader is not able to overlay.

Qualcomm hypervisor/gunyah would like to overlay arch timer node with 
always-on property, So adding __symbols__ helps boot-loader to overlay.

I think, commit text is misleading here and I will request Eric to fix 
the commit text.

-Thanks, Prasad

> 
> Konrad
>> Depends on initial sa8775p-ride.dts:
>> https://lore.kernel.org/all/20230214092713.211054-3-brgl@bgdev.pl/
>>
>>   arch/arm64/boot/dts/qcom/Makefile | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile
>> index b63cd1861e68..72e85ab31d74 100644
>> --- a/arch/arm64/boot/dts/qcom/Makefile
>> +++ b/arch/arm64/boot/dts/qcom/Makefile
>> @@ -1,4 +1,8 @@
>>   # SPDX-License-Identifier: GPL-2.0
>> +
>> +# Enable support for device-tree overlays required on sa8775p-ride.
>> +DTC_FLAGS_sa8775p-ride := -@
>> +
>>   dtb-$(CONFIG_ARCH_QCOM)	+= apq8016-sbc.dtb
>>   dtb-$(CONFIG_ARCH_QCOM)	+= apq8094-sony-xperia-kitakami-karin_windy.dtb
>>   dtb-$(CONFIG_ARCH_QCOM)	+= apq8096-db820c.dtb
> 
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] arm64: dts: qcom: sa8775p: add symbols to dtb
  2023-03-14  4:48   ` Prasad Sodagudi
@ 2023-03-14  9:59     ` Konrad Dybcio
  2023-03-16  6:55     ` Krzysztof Kozlowski
  1 sibling, 0 replies; 9+ messages in thread
From: Konrad Dybcio @ 2023-03-14  9:59 UTC (permalink / raw)
  To: Prasad Sodagudi, Eric Chanudet, Andy Gross, Bjorn Andersson,
	Rob Herring, Krzysztof Kozlowski
  Cc: linux-arm-msm, devicetree, linux-kernel



On 14.03.2023 05:48, Prasad Sodagudi wrote:
> 
> 
> On 3/9/2023 3:47 PM, Konrad Dybcio wrote:
>>
>>
>> On 10.03.2023 00:39, Eric Chanudet wrote:
>>> ABL uses the __symbols__ section to process the DTB before passing it
>>> forward. Without it, the bootstrap is interrupted.
>>>
>>> Signed-off-by: Eric Chanudet <echanude@redhat.com>
>>> ---
>> Fix your ABL.
> Hi Konrad,
> 
> Apps boot-loader need __symbols__ for dynamic overlay operation. Qualcomm firmware passes an overlay file to apps boot-loader to overlay some of the nodes based on firmware configuration. Without __symbols__ apps boot-loader is not able to overlay.
Yes/no. There are a plenty of libfdt functions that let you do that,
especially if you know something about the node.

> 
> Qualcomm hypervisor/gunyah would like to overlay arch timer node with always-on property, So adding __symbols__ helps boot-loader to overlay.
For the arch timer, you can simply iterate over the top-level nodes (or
in the worst case scenario, over all nodes which would not take very
long on cortex-a / cortex-x cores) and look for the specific timer
compatible that has been with us for like 10 years at this point and
use libfdt's fdt_add_property without overlays.

> 
> I think, commit text is misleading here and I will request Eric to fix the commit text.
Sort of, but then the design you explained is very error-prone as it's
dependent on the device tree always satisfying your hypervisor's needs.

Konrad
> 
> -Thanks, Prasad
> 
>>
>> Konrad
>>> Depends on initial sa8775p-ride.dts:
>>> https://lore.kernel.org/all/20230214092713.211054-3-brgl@bgdev.pl/
>>>
>>>   arch/arm64/boot/dts/qcom/Makefile | 4 ++++
>>>   1 file changed, 4 insertions(+)
>>>
>>> diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile
>>> index b63cd1861e68..72e85ab31d74 100644
>>> --- a/arch/arm64/boot/dts/qcom/Makefile
>>> +++ b/arch/arm64/boot/dts/qcom/Makefile
>>> @@ -1,4 +1,8 @@
>>>   # SPDX-License-Identifier: GPL-2.0
>>> +
>>> +# Enable support for device-tree overlays required on sa8775p-ride.
>>> +DTC_FLAGS_sa8775p-ride := -@
>>> +
>>>   dtb-$(CONFIG_ARCH_QCOM)    += apq8016-sbc.dtb
>>>   dtb-$(CONFIG_ARCH_QCOM)    += apq8094-sony-xperia-kitakami-karin_windy.dtb
>>>   dtb-$(CONFIG_ARCH_QCOM)    += apq8096-db820c.dtb
>>
>>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] arm64: dts: qcom: sa8775p: add symbols to dtb
  2023-03-13 12:49 ` Bjorn Andersson
@ 2023-03-14 15:14   ` Rob Herring
  0 siblings, 0 replies; 9+ messages in thread
From: Rob Herring @ 2023-03-14 15:14 UTC (permalink / raw)
  To: Bjorn Andersson, Eric Chanudet
  Cc: Krzysztof Kozlowski, Andy Gross, Konrad Dybcio, linux-arm-msm,
	devicetree, linux-kernel

On Mon, Mar 13, 2023 at 7:46 AM Bjorn Andersson <andersson@kernel.org> wrote:
>
> On Thu, Mar 09, 2023 at 06:39:48PM -0500, Eric Chanudet wrote:
> > ABL uses the __symbols__ section to process the DTB before passing it
> > forward. Without it, the bootstrap is interrupted.

No clue what ABL is... Put this in high level terms, "I want to be
able to apply overlays", not some unknown acronym and low-level detail
of how overlays work.

> >
> > Signed-off-by: Eric Chanudet <echanude@redhat.com>
>
> @Rob, @Krzysztof, it seems useful to be able to use the upstream
> generated DTBs with overlays.
>
> Do you suggest that we enable this on a per-board basis when it's being
> requested, across all devices, or tell the users that they have to
> re-generate the dtbs themselves?

It's up to you whether you want the bloat in the dtbs or not. Labels
become an ABI when symbols are enabled.

If it was my platform(s), I'd require the overlays to be upstream too,
but I'm just paranoid about the modifications people want to make.

Rob

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] arm64: dts: qcom: sa8775p: add symbols to dtb
  2023-03-14  4:48   ` Prasad Sodagudi
  2023-03-14  9:59     ` Konrad Dybcio
@ 2023-03-16  6:55     ` Krzysztof Kozlowski
  1 sibling, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-03-16  6:55 UTC (permalink / raw)
  To: Prasad Sodagudi, Konrad Dybcio, Eric Chanudet, Andy Gross,
	Bjorn Andersson, Rob Herring, Krzysztof Kozlowski
  Cc: linux-arm-msm, devicetree, linux-kernel

On 14/03/2023 05:48, Prasad Sodagudi wrote:
> 
> 
> On 3/9/2023 3:47 PM, Konrad Dybcio wrote:
>>
>>
>> On 10.03.2023 00:39, Eric Chanudet wrote:
>>> ABL uses the __symbols__ section to process the DTB before passing it
>>> forward. Without it, the bootstrap is interrupted.
>>>
>>> Signed-off-by: Eric Chanudet <echanude@redhat.com>
>>> ---
>> Fix your ABL.
> Hi Konrad,
> 
> Apps boot-loader need __symbols__ for dynamic overlay operation. 
> Qualcomm firmware passes an overlay file to apps boot-loader to overlay 
> some of the nodes based on firmware configuration. Without __symbols__ 
> apps boot-loader is not able to overlay.
> 
> Qualcomm hypervisor/gunyah would like to overlay arch timer node with 
> always-on property, So adding __symbols__ helps boot-loader to overlay.

Since none of these overlays are upstream, we can argue that it is not a
valid reason. If you decide to keep overlays downstream then also you
can keep patch enabling the overlays there...

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] arm64: dts: qcom: sa8775p: add symbols to dtb
  2023-03-09 23:39 [PATCH] arm64: dts: qcom: sa8775p: add symbols to dtb Eric Chanudet
  2023-03-09 23:47 ` Konrad Dybcio
  2023-03-13 12:49 ` Bjorn Andersson
@ 2023-03-22  2:55 ` Bjorn Andersson
  2023-03-24 17:19   ` Eric Chanudet
  2 siblings, 1 reply; 9+ messages in thread
From: Bjorn Andersson @ 2023-03-22  2:55 UTC (permalink / raw)
  To: Eric Chanudet
  Cc: Andy Gross, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	linux-arm-msm, devicetree, linux-kernel

On Thu, Mar 09, 2023 at 06:39:48PM -0500, Eric Chanudet wrote:
> ABL uses the __symbols__ section to process the DTB before passing it
> forward. Without it, the bootstrap is interrupted.
> 

If the reason is that ABL refuses to boot without it, then please have
ABL fixed. If on the other hand there is a valid reason for ABL to
require the dtb to have __symbols__ defined, please describe that - if
nothing else so that others know when this is supposed to be used.

Thanks,
Bjorn

> Signed-off-by: Eric Chanudet <echanude@redhat.com>
> ---
> Depends on initial sa8775p-ride.dts:
> https://lore.kernel.org/all/20230214092713.211054-3-brgl@bgdev.pl/
> 
>  arch/arm64/boot/dts/qcom/Makefile | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile
> index b63cd1861e68..72e85ab31d74 100644
> --- a/arch/arm64/boot/dts/qcom/Makefile
> +++ b/arch/arm64/boot/dts/qcom/Makefile
> @@ -1,4 +1,8 @@
>  # SPDX-License-Identifier: GPL-2.0
> +
> +# Enable support for device-tree overlays required on sa8775p-ride.
> +DTC_FLAGS_sa8775p-ride := -@
> +
>  dtb-$(CONFIG_ARCH_QCOM)	+= apq8016-sbc.dtb
>  dtb-$(CONFIG_ARCH_QCOM)	+= apq8094-sony-xperia-kitakami-karin_windy.dtb
>  dtb-$(CONFIG_ARCH_QCOM)	+= apq8096-db820c.dtb
> -- 
> 2.39.1
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] arm64: dts: qcom: sa8775p: add symbols to dtb
  2023-03-22  2:55 ` Bjorn Andersson
@ 2023-03-24 17:19   ` Eric Chanudet
  0 siblings, 0 replies; 9+ messages in thread
From: Eric Chanudet @ 2023-03-24 17:19 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Andy Gross, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	linux-arm-msm, devicetree, linux-kernel, Prasad Sodagudi

On Tue, Mar 21, 2023 at 07:55:19PM -0700, Bjorn Andersson wrote:
> On Thu, Mar 09, 2023 at 06:39:48PM -0500, Eric Chanudet wrote:
> > ABL uses the __symbols__ section to process the DTB before passing it
> > forward. Without it, the bootstrap is interrupted.
> > 
> 
> If the reason is that ABL refuses to boot without it, then please have
> ABL fixed. If on the other hand there is a valid reason for ABL to
> require the dtb to have __symbols__ defined, please describe that - if
> nothing else so that others know when this is supposed to be used.

Here is what I understand from the ABL sources and discussions with
Prasad:

Android Boot Loader (ABL), the UEFI application to run before executing
the kernel, implements the Qualcomm SCM protocol to call into TZ. One of
these SCM call is trapped by the hypervisor, itself provided with the
firmware package for the board, and returns to ABL some information
about our VM. These information may include one or more DTBO. ABL then
proceeds and tries to apply the overlays on the DTB it loaded from the
Android Boot Image it is trying to boot.

If there is an hypervisor and it returned at least one DTBO, ABL treats
a failure to apply the DTBO (e.g, if __symbols__ are not available in
the DTB) as critical and ends the boot. I was only ever given a firmware
package that included the hypervisor and it always returned at least one
DTBO. So enabling overlays is required to run this board, using the
firmware I know of, with an upstream kernel and DTB at time of writing.

I suppose ABL could be made to handle such failure as a warning and
continue booting? Which comes down to ignoring the DTBO provided by the
hypervisor. Maybe that still allows the kernel to run the board with
limited functionality?

Prior cases in the git history for enabling overlays covered board
variants and extension headers (ti and nvidia). These do not fit what is
happening here. In hindsight, I should have sent this as an RFC, with
the above explanation to begin with, to ask about the limits and
requirements.

Maybe Prasad, or someone with a more comprehensive knowledge of this
board, can fill the remaining gaps or correct my understanding of the
boot sequence if I got something wrong?

Thanks,

-- 
Eric Chanudet


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-03-24 17:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-09 23:39 [PATCH] arm64: dts: qcom: sa8775p: add symbols to dtb Eric Chanudet
2023-03-09 23:47 ` Konrad Dybcio
2023-03-14  4:48   ` Prasad Sodagudi
2023-03-14  9:59     ` Konrad Dybcio
2023-03-16  6:55     ` Krzysztof Kozlowski
2023-03-13 12:49 ` Bjorn Andersson
2023-03-14 15:14   ` Rob Herring
2023-03-22  2:55 ` Bjorn Andersson
2023-03-24 17:19   ` Eric Chanudet

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.