Patches from ~gonzo/arm/rpi3-smp/u-boot-patches/ missing from u-boot upstream and from relevant sysutils/u-boot-* ports?
Mark Millard
marklmi at yahoo.com
Mon Oct 12 02:23:41 UTC 2020
There are u-boot patches (from 2015-Nov-25) listed at:
https://people.freebsd.org/~gonzo/arm/rpi3-smp/u-boot-patches/
that are not in u-boot and are not in the sysutils/u-boot-master
or sysutils/u-boot-rpi[34] ports tree via patch-* files.
arm/rpi3-smp/u-boot-patches/patch-board_raspberrypi_rpi_rpi.c
looks to be what was expected to handle the values from the:
https://github.com/gonzoua/rpi3-psci-monitor/blob/master/pscimon.S
code (w0 and x1 before boot_kernel). That calling code (to u-boot
as kernel) looks like:
primary_cpu:
mov sp, #RESERVE_SIZE
sub sp, sp, #16
ldr w0, dtb_ptr32
bl fixup_dt_blob
ldr w4, kernel_entry32
ldr w0, dtb_ptr32
mov x1, #RESERVE_SIZE
boot_kernel:
mov x2, #0
mov x3, #0
br x4
The matching rpi.c patch code was (in part):
+static u64 fw_fdt_address __attribute__ ((section(".data")));
+static u64 reserve_memory __attribute__ ((section(".data")));
+
+void save_boot_params(u64 x0, u64 x1, u64 x2, u64 x3)
+{
+ fw_fdt_address = x0;
+ reserve_memory = x1;
+ save_boot_params_ret();
+}
+
+void dram_init_banksize(void)
+{
+ gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE + reserve_memory;
+ gd->bd->bi_dram[0].size = get_effective_memsize() - reserve_memory;
+}
. . .
+#ifdef CONFIG_ARM64
+ if (fw_fdt_address)
+ setenv_hex("fdt_addr_r", (ulong)fw_fdt_address);
+#endif
The only "set_env.*fdt_addr_r" that I find is:
# grep -r "set_env.*fdt_addr_r" ./ | more
./arch/arm/mach-uniphier/board_late_init.c: uniphier_set_env_addr("fdt_addr_r", "fdt_addr_r_offset");
As for the line with CONFIG_SYS_SDRAM_BASE, only one match
seems to be for armv8 cotnexts:
# grep -r "\<bi_dram\[0\].start.*CONFIG_SYS_SDRAM_BASE" ./ | more
./arch/arm/cpu/armv8/fsl-layerscape/cpu.c: gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
. . .
If there is other, more modern u-boot code that covers handling
the x0 and x1 from pscimon.S I have yet to notice. (But, the
code is not familiar so that might not be surprising.)
===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)
More information about the freebsd-arm
mailing list