[PATCH v2 0/4] memory: tegra210-emc: Support Device Tree EMC Tables

Aaron Kling via B4 Relay posted 4 patches 7 months, 1 week ago
.../nvidia,tegra21-emc-table.yaml                  |  1692 +
.../memory-controllers/nvidia,tegra210-emc.yaml    |    44 +-
arch/arm64/boot/dts/nvidia/tegra210-p2180-emc.dtsi | 49749 +++++++++++++++++++
arch/arm64/boot/dts/nvidia/tegra210-p2180.dtsi     |     1 +
drivers/memory/tegra/tegra210-emc-core.c           |   246 +-
5 files changed, 51721 insertions(+), 11 deletions(-)
[PATCH v2 0/4] memory: tegra210-emc: Support Device Tree EMC Tables
Posted by Aaron Kling via B4 Relay 7 months, 1 week ago
Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
---
Changes in v2:
- Add patch to describe the emc table bindings
- Add patch to allow a fallback compatible on the tegra210 emc device to
  match firmware expectations
- Add a patch to include the baseline emc tables on p2180
- Link to v1: https://lore.kernel.org/r/20250430-tegra210-emc-dt-v1-1-99896fa69341@gmail.com

---
Aaron Kling (4):
      dt-bindings: memory-controllers: Describe Tegra210 EMC Tables
      dt-bindings: memory-controllers: tegra210: Allow fallback compatible
      arm64: tegra: Add EMC timings to P2180
      memory: tegra210-emc: Support Device Tree EMC Tables

 .../nvidia,tegra21-emc-table.yaml                  |  1692 +
 .../memory-controllers/nvidia,tegra210-emc.yaml    |    44 +-
 arch/arm64/boot/dts/nvidia/tegra210-p2180-emc.dtsi | 49749 +++++++++++++++++++
 arch/arm64/boot/dts/nvidia/tegra210-p2180.dtsi     |     1 +
 drivers/memory/tegra/tegra210-emc-core.c           |   246 +-
 5 files changed, 51721 insertions(+), 11 deletions(-)
---
base-commit: 8bac8898fe398ffa3e09075ecea2be511725fb0b
change-id: 20250429-tegra210-emc-dt-97dce690ad4e

Best regards,
-- 
Aaron Kling <webgeek1234@gmail.com>
Re: [PATCH v2 0/4] memory: tegra210-emc: Support Device Tree EMC Tables
Posted by Rob Herring (Arm) 7 months, 1 week ago
On Thu, 08 May 2025 01:07:37 -0500, Aaron Kling wrote:
> Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
> ---
> Changes in v2:
> - Add patch to describe the emc table bindings
> - Add patch to allow a fallback compatible on the tegra210 emc device to
>   match firmware expectations
> - Add a patch to include the baseline emc tables on p2180
> - Link to v1: https://lore.kernel.org/r/20250430-tegra210-emc-dt-v1-1-99896fa69341@gmail.com
> 
> ---
> Aaron Kling (4):
>       dt-bindings: memory-controllers: Describe Tegra210 EMC Tables
>       dt-bindings: memory-controllers: tegra210: Allow fallback compatible
>       arm64: tegra: Add EMC timings to P2180
>       memory: tegra210-emc: Support Device Tree EMC Tables
> 
>  .../nvidia,tegra21-emc-table.yaml                  |  1692 +
>  .../memory-controllers/nvidia,tegra210-emc.yaml    |    44 +-
>  arch/arm64/boot/dts/nvidia/tegra210-p2180-emc.dtsi | 49749 +++++++++++++++++++
>  arch/arm64/boot/dts/nvidia/tegra210-p2180.dtsi     |     1 +
>  drivers/memory/tegra/tegra210-emc-core.c           |   246 +-
>  5 files changed, 51721 insertions(+), 11 deletions(-)
> ---
> base-commit: 8bac8898fe398ffa3e09075ecea2be511725fb0b
> change-id: 20250429-tegra210-emc-dt-97dce690ad4e
> 
> Best regards,
> --
> Aaron Kling <webgeek1234@gmail.com>
> 
> 
> 


My bot found new DTB warnings on the .dts files added or changed in this
series.

Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings
are fixed by another series. Ultimately, it is up to the platform
maintainer whether these warnings are acceptable or not. No need to reply
unless the platform maintainer has comments.

If you already ran DT checks and didn't see these error(s), then
make sure dt-schema is up to date:

  pip3 install dtschema --upgrade


This patch series was applied (using b4) to base:
 Base: using specified base-commit 8bac8898fe398ffa3e09075ecea2be511725fb0b

If this is not the correct base, please add 'base-commit' tag
(or use b4 which does this automatically)

New warnings running 'make CHECK_DTBS=y for arch/arm64/boot/dts/nvidia/' for 20250508-tegra210-emc-dt-v2-0-d33dc20a1123@gmail.com:

arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dtb: external-memory-controller@7001b000 (nvidia,tegra210-emc): '#cooling-cells' does not match any of the regexes: '^emc-table@[0-9]+$', '^pinctrl-[0-9]+$'
	from schema $id: http://devicetree.org/schemas/memory-controllers/nvidia,tegra210-emc.yaml#
arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dtb: external-memory-controller@7001b000 (nvidia,tegra210-emc): '#cooling-cells' does not match any of the regexes: '^emc-table@[0-9]+$', '^pinctrl-[0-9]+$'
	from schema $id: http://devicetree.org/schemas/memory-controllers/nvidia,tegra210-emc.yaml#
arch/arm64/boot/dts/nvidia/tegra210-p2371-0000.dtb: external-memory-controller@7001b000 (nvidia,tegra210-emc): '#cooling-cells' does not match any of the regexes: '^emc-table@[0-9]+$', '^pinctrl-[0-9]+$'
	from schema $id: http://devicetree.org/schemas/memory-controllers/nvidia,tegra210-emc.yaml#
arch/arm64/boot/dts/nvidia/tegra210-smaug.dtb: external-memory-controller@7001b000 (nvidia,tegra210-emc): '#cooling-cells' does not match any of the regexes: '^emc-table@[0-9]+$', '^pinctrl-[0-9]+$'
	from schema $id: http://devicetree.org/schemas/memory-controllers/nvidia,tegra210-emc.yaml#
arch/arm64/boot/dts/nvidia/tegra210-p2571.dtb: external-memory-controller@7001b000 (nvidia,tegra210-emc): '#cooling-cells' does not match any of the regexes: '^emc-table@[0-9]+$', '^pinctrl-[0-9]+$'
	from schema $id: http://devicetree.org/schemas/memory-controllers/nvidia,tegra210-emc.yaml#
arch/arm64/boot/dts/nvidia/tegra210-p2894-0050-a08.dtb: external-memory-controller@7001b000 (nvidia,tegra210-emc): '#cooling-cells' does not match any of the regexes: '^emc-table@[0-9]+$', '^pinctrl-[0-9]+$'
	from schema $id: http://devicetree.org/schemas/memory-controllers/nvidia,tegra210-emc.yaml#
Re: [PATCH v2 0/4] memory: tegra210-emc: Support Device Tree EMC Tables
Posted by Thierry Reding 7 months, 1 week ago
On Thu, May 08, 2025 at 01:07:37AM -0500, Aaron Kling via B4 Relay wrote:
> Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
> ---
> Changes in v2:
> - Add patch to describe the emc table bindings
> - Add patch to allow a fallback compatible on the tegra210 emc device to
>   match firmware expectations
> - Add a patch to include the baseline emc tables on p2180
> - Link to v1: https://lore.kernel.org/r/20250430-tegra210-emc-dt-v1-1-99896fa69341@gmail.com
> 
> ---
> Aaron Kling (4):
>       dt-bindings: memory-controllers: Describe Tegra210 EMC Tables
>       dt-bindings: memory-controllers: tegra210: Allow fallback compatible
>       arm64: tegra: Add EMC timings to P2180
>       memory: tegra210-emc: Support Device Tree EMC Tables
> 
>  .../nvidia,tegra21-emc-table.yaml                  |  1692 +
>  .../memory-controllers/nvidia,tegra210-emc.yaml    |    44 +-
>  arch/arm64/boot/dts/nvidia/tegra210-p2180-emc.dtsi | 49749 +++++++++++++++++++
>  arch/arm64/boot/dts/nvidia/tegra210-p2180.dtsi     |     1 +
>  drivers/memory/tegra/tegra210-emc-core.c           |   246 +-
>  5 files changed, 51721 insertions(+), 11 deletions(-)

We've had discussions about this in the past, and I don't think this is
going to go anywhere. Device tree maintainers have repeatedly said that
they won't accept this kind of binding, which is, admittedly, a bit non-
sensical. 50,000 lines of DT for EMC tables is just crazy.

The existing binary table bindings were created to avoid the need for
this. I don't know how easy this is to achieve for all bootloaders, but
the expectation was that these tables should be passed in their native
format.

Thierry
Re: [PATCH v2 0/4] memory: tegra210-emc: Support Device Tree EMC Tables
Posted by Aaron Kling 7 months, 1 week ago
On Thu, May 8, 2025 at 2:41 AM Thierry Reding <thierry.reding@gmail.com> wrote:
>
> On Thu, May 08, 2025 at 01:07:37AM -0500, Aaron Kling via B4 Relay wrote:
> > Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
> > ---
> > Changes in v2:
> > - Add patch to describe the emc table bindings
> > - Add patch to allow a fallback compatible on the tegra210 emc device to
> >   match firmware expectations
> > - Add a patch to include the baseline emc tables on p2180
> > - Link to v1: https://lore.kernel.org/r/20250430-tegra210-emc-dt-v1-1-99896fa69341@gmail.com
> >
> > ---
> > Aaron Kling (4):
> >       dt-bindings: memory-controllers: Describe Tegra210 EMC Tables
> >       dt-bindings: memory-controllers: tegra210: Allow fallback compatible
> >       arm64: tegra: Add EMC timings to P2180
> >       memory: tegra210-emc: Support Device Tree EMC Tables
> >
> >  .../nvidia,tegra21-emc-table.yaml                  |  1692 +
> >  .../memory-controllers/nvidia,tegra210-emc.yaml    |    44 +-
> >  arch/arm64/boot/dts/nvidia/tegra210-p2180-emc.dtsi | 49749 +++++++++++++++++++
> >  arch/arm64/boot/dts/nvidia/tegra210-p2180.dtsi     |     1 +
> >  drivers/memory/tegra/tegra210-emc-core.c           |   246 +-
> >  5 files changed, 51721 insertions(+), 11 deletions(-)
>
> We've had discussions about this in the past, and I don't think this is
> going to go anywhere. Device tree maintainers have repeatedly said that
> they won't accept this kind of binding, which is, admittedly, a bit non-
> sensical. 50,000 lines of DT for EMC tables is just crazy.
>
> The existing binary table bindings were created to avoid the need for
> this. I don't know how easy this is to achieve for all bootloaders, but
> the expectation was that these tables should be passed in their native
> format.

Mmm, this would definitely be an issue with my long term end goal of
supporting the SHIELD t210 devices on mainline. The bootloader on
those devices cannot be replaced due to secure boot and that variant
of the bootloader only supports this dt table for emc. And support
without emc reclocking would be rather unusable as a consumer media
device. Unless the devices could get a bootloader update switching to
the reserved memory tables before they go eol, but I don't see that as
likely.

So I guess the question goes to Krzysztof. I didn't have the bindings
or a copy of the tables in v1 of this series, mostly due to a
misunderstanding, and was fairly asked to add them. That's this
revision. Would you consider accepting this after any fixes? Or is
this concept entirely dead in the water?

Sincerely,
Aaron
Re: [PATCH v2 0/4] memory: tegra210-emc: Support Device Tree EMC Tables
Posted by Krzysztof Kozlowski 7 months, 1 week ago
On 08/05/2025 13:37, Aaron Kling wrote:
> On Thu, May 8, 2025 at 2:41 AM Thierry Reding <thierry.reding@gmail.com> wrote:
>>
>> On Thu, May 08, 2025 at 01:07:37AM -0500, Aaron Kling via B4 Relay wrote:
>>> Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
>>> ---
>>> Changes in v2:
>>> - Add patch to describe the emc table bindings
>>> - Add patch to allow a fallback compatible on the tegra210 emc device to
>>>   match firmware expectations
>>> - Add a patch to include the baseline emc tables on p2180
>>> - Link to v1: https://lore.kernel.org/r/20250430-tegra210-emc-dt-v1-1-99896fa69341@gmail.com
>>>
>>> ---
>>> Aaron Kling (4):
>>>       dt-bindings: memory-controllers: Describe Tegra210 EMC Tables
>>>       dt-bindings: memory-controllers: tegra210: Allow fallback compatible
>>>       arm64: tegra: Add EMC timings to P2180
>>>       memory: tegra210-emc: Support Device Tree EMC Tables
>>>
>>>  .../nvidia,tegra21-emc-table.yaml                  |  1692 +
>>>  .../memory-controllers/nvidia,tegra210-emc.yaml    |    44 +-
>>>  arch/arm64/boot/dts/nvidia/tegra210-p2180-emc.dtsi | 49749 +++++++++++++++++++
>>>  arch/arm64/boot/dts/nvidia/tegra210-p2180.dtsi     |     1 +
>>>  drivers/memory/tegra/tegra210-emc-core.c           |   246 +-
>>>  5 files changed, 51721 insertions(+), 11 deletions(-)
>>
>> We've had discussions about this in the past, and I don't think this is
>> going to go anywhere. Device tree maintainers have repeatedly said that
>> they won't accept this kind of binding, which is, admittedly, a bit non-
>> sensical. 50,000 lines of DT for EMC tables is just crazy.
>>
>> The existing binary table bindings were created to avoid the need for
>> this. I don't know how easy this is to achieve for all bootloaders, but
>> the expectation was that these tables should be passed in their native
>> format.
> 
> Mmm, this would definitely be an issue with my long term end goal of
> supporting the SHIELD t210 devices on mainline. The bootloader on
> those devices cannot be replaced due to secure boot and that variant
> of the bootloader only supports this dt table for emc. And support
> without emc reclocking would be rather unusable as a consumer media
> device. Unless the devices could get a bootloader update switching to
> the reserved memory tables before they go eol, but I don't see that as
> likely.
> 
> So I guess the question goes to Krzysztof. I didn't have the bindings

What is the question exactly?

> or a copy of the tables in v1 of this series, mostly due to a
> misunderstanding, and was fairly asked to add them. That's this
> revision. Would you consider accepting this after any fixes? Or is
> this concept entirely dead in the water?


The binding here is far away from what is in general acceptable DTS
style, so in general this won't be easy to upstream. If we allow any
crap to be sent post factum, what is the benefit for companies to
actually took to community BEFORE they ship products? None, because that
crap will be always sent after release with explanation "we cannot
change now". Old platforms with Android bootloaders are in general
encouraged to move to something decent, like U-boot.

50 kB DTS is another point - I don't even understand why do you need it
if you claim this is coming from bootloader.


Best regards,
Krzysztof
Re: [PATCH v2 0/4] memory: tegra210-emc: Support Device Tree EMC Tables
Posted by Aaron Kling 7 months, 1 week ago
On Thu, May 8, 2025 at 6:47 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On 08/05/2025 13:37, Aaron Kling wrote:
> > On Thu, May 8, 2025 at 2:41 AM Thierry Reding <thierry.reding@gmail.com> wrote:
> >>
> >> On Thu, May 08, 2025 at 01:07:37AM -0500, Aaron Kling via B4 Relay wrote:
> >>> Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
> >>> ---
> >>> Changes in v2:
> >>> - Add patch to describe the emc table bindings
> >>> - Add patch to allow a fallback compatible on the tegra210 emc device to
> >>>   match firmware expectations
> >>> - Add a patch to include the baseline emc tables on p2180
> >>> - Link to v1: https://lore.kernel.org/r/20250430-tegra210-emc-dt-v1-1-99896fa69341@gmail.com
> >>>
> >>> ---
> >>> Aaron Kling (4):
> >>>       dt-bindings: memory-controllers: Describe Tegra210 EMC Tables
> >>>       dt-bindings: memory-controllers: tegra210: Allow fallback compatible
> >>>       arm64: tegra: Add EMC timings to P2180
> >>>       memory: tegra210-emc: Support Device Tree EMC Tables
> >>>
> >>>  .../nvidia,tegra21-emc-table.yaml                  |  1692 +
> >>>  .../memory-controllers/nvidia,tegra210-emc.yaml    |    44 +-
> >>>  arch/arm64/boot/dts/nvidia/tegra210-p2180-emc.dtsi | 49749 +++++++++++++++++++
> >>>  arch/arm64/boot/dts/nvidia/tegra210-p2180.dtsi     |     1 +
> >>>  drivers/memory/tegra/tegra210-emc-core.c           |   246 +-
> >>>  5 files changed, 51721 insertions(+), 11 deletions(-)
> >>
> >> We've had discussions about this in the past, and I don't think this is
> >> going to go anywhere. Device tree maintainers have repeatedly said that
> >> they won't accept this kind of binding, which is, admittedly, a bit non-
> >> sensical. 50,000 lines of DT for EMC tables is just crazy.
> >>
> >> The existing binary table bindings were created to avoid the need for
> >> this. I don't know how easy this is to achieve for all bootloaders, but
> >> the expectation was that these tables should be passed in their native
> >> format.
> >
> > Mmm, this would definitely be an issue with my long term end goal of
> > supporting the SHIELD t210 devices on mainline. The bootloader on
> > those devices cannot be replaced due to secure boot and that variant
> > of the bootloader only supports this dt table for emc. And support
> > without emc reclocking would be rather unusable as a consumer media
> > device. Unless the devices could get a bootloader update switching to
> > the reserved memory tables before they go eol, but I don't see that as
> > likely.
> >
> > So I guess the question goes to Krzysztof. I didn't have the bindings
>
> What is the question exactly?

If there's any way to get these bindings and the dt change accepted.
Or getting the code change accepted without them. If there isn't, then
there's no reason for me to put any more effort into this series and I
need to start looking at alternatives. Like forking a downstream copy
of this driver for my Android efforts. I'm trying very hard to avoid
this as much as I can, though. The more downstream variation I have,
the more maintenance work I have to do over time.

>
> > or a copy of the tables in v1 of this series, mostly due to a
> > misunderstanding, and was fairly asked to add them. That's this
> > revision. Would you consider accepting this after any fixes? Or is
> > this concept entirely dead in the water?
>
>
> The binding here is far away from what is in general acceptable DTS
> style, so in general this won't be easy to upstream. If we allow any
> crap to be sent post factum, what is the benefit for companies to
> actually took to community BEFORE they ship products? None, because that
> crap will be always sent after release with explanation "we cannot
> change now". Old platforms with Android bootloaders are in general
> encouraged to move to something decent, like U-boot.

I'm not even sure I can work around this by chainloading u-boot. With
some hoop jumping, I could read in the dt tables in u-boot, but I'm
not sure how simple it would be to write out a reserved memory table
to match what mainline currently expects. And I can't just replace the
entire boot stack due to secure boot.

The devices I'm talking about are not yet end of life, so it is
physically possible for them to get a bootloader update to conform to
the existing mainline model. But I'm just one guy trying to do 3rd
party support for these devices, I can't affect what Nvidia does with
the signed bootloader on these devices. I'd love to be able to swap
out an open source bootloader on these, but the secure boot setup
prevents that.

> 50 kB DTS is another point - I don't even understand why do you need it
> if you claim this is coming from bootloader.

Like mentioned in the commit message for the 50k lines of dt
additions, the existing bootloader will only write the trained values
to dt nodes that already exist. If it doesn't find the nodes, it'll
still do the training, but nothing will be written to the in-ram copy
of the kernel dtb.

Sincerely,
Aaron
Re: [PATCH v2 0/4] memory: tegra210-emc: Support Device Tree EMC Tables
Posted by Thierry Reding 7 months, 1 week ago
On Thu, May 08, 2025 at 07:27:52AM -0500, Aaron Kling wrote:
[...]
> The devices I'm talking about are not yet end of life, so it is
> physically possible for them to get a bootloader update to conform to
> the existing mainline model. But I'm just one guy trying to do 3rd
> party support for these devices, I can't affect what Nvidia does with
> the signed bootloader on these devices. I'd love to be able to swap
> out an open source bootloader on these, but the secure boot setup
> prevents that.

I've reached out to our Android team internally to see if there's
anything we can realistically do about this.

Thierry
Re: [PATCH v2 0/4] memory: tegra210-emc: Support Device Tree EMC Tables
Posted by Aaron Kling 6 months, 2 weeks ago
On Thu, May 8, 2025 at 7:48 AM Thierry Reding <thierry.reding@gmail.com> wrote:
>
> On Thu, May 08, 2025 at 07:27:52AM -0500, Aaron Kling wrote:
> [...]
> > The devices I'm talking about are not yet end of life, so it is
> > physically possible for them to get a bootloader update to conform to
> > the existing mainline model. But I'm just one guy trying to do 3rd
> > party support for these devices, I can't affect what Nvidia does with
> > the signed bootloader on these devices. I'd love to be able to swap
> > out an open source bootloader on these, but the secure boot setup
> > prevents that.
>
> I've reached out to our Android team internally to see if there's
> anything we can realistically do about this.
>
> Thierry

Thierry, has there been any feedback about this?

Sincerely,
Aaron
Re: [PATCH v2 0/4] memory: tegra210-emc: Support Device Tree EMC Tables
Posted by Aaron Kling 5 months, 2 weeks ago
On Wed, May 28, 2025 at 12:41 PM Aaron Kling <webgeek1234@gmail.com> wrote:
>
> On Thu, May 8, 2025 at 7:48 AM Thierry Reding <thierry.reding@gmail.com> wrote:
> >
> > On Thu, May 08, 2025 at 07:27:52AM -0500, Aaron Kling wrote:
> > [...]
> > > The devices I'm talking about are not yet end of life, so it is
> > > physically possible for them to get a bootloader update to conform to
> > > the existing mainline model. But I'm just one guy trying to do 3rd
> > > party support for these devices, I can't affect what Nvidia does with
> > > the signed bootloader on these devices. I'd love to be able to swap
> > > out an open source bootloader on these, but the secure boot setup
> > > prevents that.
> >
> > I've reached out to our Android team internally to see if there's
> > anything we can realistically do about this.
> >
> > Thierry
>
> Thierry, has there been any feedback about this?
>

Reminder about this question. Has there been any response from the
Nvidia Android team? Or do I/we need to continue pursuing independent
solutions?

Aaron
Re: [PATCH v2 0/4] memory: tegra210-emc: Support Device Tree EMC Tables
Posted by Thierry Reding 5 months, 2 weeks ago
On Mon, Jun 30, 2025 at 02:26:06PM -0500, Aaron Kling wrote:
> On Wed, May 28, 2025 at 12:41 PM Aaron Kling <webgeek1234@gmail.com> wrote:
> >
> > On Thu, May 8, 2025 at 7:48 AM Thierry Reding <thierry.reding@gmail.com> wrote:
> > >
> > > On Thu, May 08, 2025 at 07:27:52AM -0500, Aaron Kling wrote:
> > > [...]
> > > > The devices I'm talking about are not yet end of life, so it is
> > > > physically possible for them to get a bootloader update to conform to
> > > > the existing mainline model. But I'm just one guy trying to do 3rd
> > > > party support for these devices, I can't affect what Nvidia does with
> > > > the signed bootloader on these devices. I'd love to be able to swap
> > > > out an open source bootloader on these, but the secure boot setup
> > > > prevents that.
> > >
> > > I've reached out to our Android team internally to see if there's
> > > anything we can realistically do about this.
> > >
> > > Thierry
> >
> > Thierry, has there been any feedback about this?
> >
> 
> Reminder about this question. Has there been any response from the
> Nvidia Android team? Or do I/we need to continue pursuing independent
> solutions?

There's been no decision either way, but it's fairly complicated because
the changes involved here are fairly large, even if the impact should be
fairly low.

If all else fails, do we have other alternatives? I suspect that adding
some sort of shim that runs prior to the kernel won't work because the
EMC tables just aren't accessible from the bootloader anymore. Would it
entail parsing the entirety of the DT EMC tables and transcribing them
into some memory and pass that to the kernel?

Thierry
Re: [PATCH v2 0/4] memory: tegra210-emc: Support Device Tree EMC Tables
Posted by Aaron Kling 5 months, 2 weeks ago
On Thu, Jul 3, 2025 at 5:37 AM Thierry Reding <thierry.reding@gmail.com> wrote:
>
> On Mon, Jun 30, 2025 at 02:26:06PM -0500, Aaron Kling wrote:
> > On Wed, May 28, 2025 at 12:41 PM Aaron Kling <webgeek1234@gmail.com> wrote:
> > >
> > > On Thu, May 8, 2025 at 7:48 AM Thierry Reding <thierry.reding@gmail.com> wrote:
> > > >
> > > > On Thu, May 08, 2025 at 07:27:52AM -0500, Aaron Kling wrote:
> > > > [...]
> > > > > The devices I'm talking about are not yet end of life, so it is
> > > > > physically possible for them to get a bootloader update to conform to
> > > > > the existing mainline model. But I'm just one guy trying to do 3rd
> > > > > party support for these devices, I can't affect what Nvidia does with
> > > > > the signed bootloader on these devices. I'd love to be able to swap
> > > > > out an open source bootloader on these, but the secure boot setup
> > > > > prevents that.
> > > >
> > > > I've reached out to our Android team internally to see if there's
> > > > anything we can realistically do about this.
> > > >
> > > > Thierry
> > >
> > > Thierry, has there been any feedback about this?
> > >
> >
> > Reminder about this question. Has there been any response from the
> > Nvidia Android team? Or do I/we need to continue pursuing independent
> > solutions?
>
> There's been no decision either way, but it's fairly complicated because
> the changes involved here are fairly large, even if the impact should be
> fairly low.
>
> If all else fails, do we have other alternatives? I suspect that adding
> some sort of shim that runs prior to the kernel won't work because the
> EMC tables just aren't accessible from the bootloader anymore. Would it
> entail parsing the entirety of the DT EMC tables and transcribing them
> into some memory and pass that to the kernel?

I see three options in general

1) Change the bootloader to conform with existing mainline standards
2) Merge support for the existing bootloader method to mainline
3) Have a chainloaded bootloader / shim that converts the tables

I submitted this series because I was trying to avoid 3. On most
devices, I don't need u-boot and I'm trying to avoid it. Due to
another issue on p2571 (nvtboot ignores the bootloader dtb when the
cvm board id is 2530 and uses the kernel dtb, making it to where I
can't replace the kernel dtb like I can everywhere else), I will
likely have to use u-boot. But for p2897, p3425, and the devkits I can
still avoid it.

If 1 fails and 3 is undesirable, then 2 is the only option I see.
Which based on responses seems pretty unlikely too. If u-boot becomes
the only option, I should be able to write something to read the dt
tables and write out a reserved memory region. I just want to exhaust
every other possibility before adding that complexity to the boot
flow.

Aaron