Date: Sun, 11 Oct 2020 19:23:36 -0700 From: Mark Millard <marklmi@yahoo.com> To: Robert Crowston <crowston@protonmail.com>, Oleksandr Tymoshenko <gonzo@freebsd.org>, freebsd-arm <freebsd-arm@freebsd.org> Subject: Patches from ~gonzo/arm/rpi3-smp/u-boot-patches/ missing from u-boot upstream and from relevant sysutils/u-boot-* ports? Message-ID: <9DE1EAA1-40DB-4614-843B-73A8861098E7@yahoo.com> References: <9DE1EAA1-40DB-4614-843B-73A8861098E7.ref@yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 =3D x0; + reserve_memory =3D x1; + save_boot_params_ret(); +} + +void dram_init_banksize(void) +{ + gd->bd->bi_dram[0].start =3D CONFIG_SYS_SDRAM_BASE + = reserve_memory; + gd->bd->bi_dram[0].size =3D 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 = =3D 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.) =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9DE1EAA1-40DB-4614-843B-73A8861098E7>