Re: [PATCH 7/9] ARM: tegra: Support EMC frequency tables on Tegra210

2021-09-29 Thread Simon Glass
On Fri, 3 Sept 2021 at 07:16, Thierry Reding  wrote:
>
> From: Thierry Reding 
>
> The EMC frequency tables are created from a training sequence performed
> during early boot and passed in via a reserved memory region by nvtboot.
> Copy this table to the kernel DTB so that the kernel can use it to scale
> the EMC frequency at runtime.
>
> Note that early bootloaders store the EMC table at an address that
> currently intersects with the load address of the initial ramdisk. In
> order to avoid copying the table to a different address, simply change
> the load address for the initial ramdisk in U-Boot.
>
> Signed-off-by: Thierry Reding 
> ---
>  board/nvidia/p2371-2180/p2371-2180.c | 1 +
>  board/nvidia/p3450-/p3450-.c | 1 +
>  include/configs/tegra210-common.h| 2 +-
>  3 files changed, 3 insertions(+), 1 deletion(-)

Reviewed-by: Simon Glass 

>
> diff --git a/board/nvidia/p2371-2180/p2371-2180.c 
> b/board/nvidia/p2371-2180/p2371-2180.c
> index f5126c552b00..cd5dc2de629e 100644
> --- a/board/nvidia/p2371-2180/p2371-2180.c
> +++ b/board/nvidia/p2371-2180/p2371-2180.c
> @@ -183,6 +183,7 @@ static void ft_carveout_setup(void *fdt)
> static const char * const nodes[] = {
> "/host1x@5000/dc@5420",
> "/host1x@5000/dc@5424",
> +   "/external-memory-controller@7001b000",
> };

This would be better added to the DT in 'sysinfo' driver or something
like that. It is not nice to have DT paths in the C code.


- Simon


[PATCH 7/9] ARM: tegra: Support EMC frequency tables on Tegra210

2021-09-03 Thread Thierry Reding
From: Thierry Reding 

The EMC frequency tables are created from a training sequence performed
during early boot and passed in via a reserved memory region by nvtboot.
Copy this table to the kernel DTB so that the kernel can use it to scale
the EMC frequency at runtime.

Note that early bootloaders store the EMC table at an address that
currently intersects with the load address of the initial ramdisk. In
order to avoid copying the table to a different address, simply change
the load address for the initial ramdisk in U-Boot.

Signed-off-by: Thierry Reding 
---
 board/nvidia/p2371-2180/p2371-2180.c | 1 +
 board/nvidia/p3450-/p3450-.c | 1 +
 include/configs/tegra210-common.h| 2 +-
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/board/nvidia/p2371-2180/p2371-2180.c 
b/board/nvidia/p2371-2180/p2371-2180.c
index f5126c552b00..cd5dc2de629e 100644
--- a/board/nvidia/p2371-2180/p2371-2180.c
+++ b/board/nvidia/p2371-2180/p2371-2180.c
@@ -183,6 +183,7 @@ static void ft_carveout_setup(void *fdt)
static const char * const nodes[] = {
"/host1x@5000/dc@5420",
"/host1x@5000/dc@5424",
+   "/external-memory-controller@7001b000",
};
unsigned int i;
int err;
diff --git a/board/nvidia/p3450-/p3450-.c 
b/board/nvidia/p3450-/p3450-.c
index 2c709d9b8117..dd408d2ebbf8 100644
--- a/board/nvidia/p3450-/p3450-.c
+++ b/board/nvidia/p3450-/p3450-.c
@@ -183,6 +183,7 @@ static void ft_carveout_setup(void *fdt)
static const char * const nodes[] = {
"/host1x@5000/dc@5420",
"/host1x@5000/dc@5424",
+   "/external-memory-controller@7001b000",
};
unsigned int i;
int err;
diff --git a/include/configs/tegra210-common.h 
b/include/configs/tegra210-common.h
index 2226effe16ab..c38d0f831835 100644
--- a/include/configs/tegra210-common.h
+++ b/include/configs/tegra210-common.h
@@ -48,7 +48,7 @@
"kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
"fdtfile=" FDTFILE "\0" \
"fdt_addr_r=0x8300\0" \
-   "ramdisk_addr_r=0x8320\0"
+   "ramdisk_addr_r=0x8342\0"
 
 /* For USB EHCI controller */
 #define CONFIG_EHCI_IS_TDI
-- 
2.33.0