u-boot/arch
Andre Przywara 68f08966b0 armv8: start.S: remove CONFIG_SYS_RESET_SCTRL code
There is some code that tries to "reset" the SCTLR_ELx register early in
the boot process. The idea seems to be to guarantee some sane settings
that U-Boot actually relies on, for instance running in little-endian
mode, with the MMU off initially.
However the current code has multiple problems:
- For a start, no platform or config defines the symbol that would
  enable that code.
- The code itself really only works if the bits that it tries to clear
  are already cleared:
  - If we run in big-endian mode initially, any previous loads would have
    been wrong already. That applies to the (optional) relocation code,
    but more prominently to the mask that it uses to clear those bits:
    "ldr x1, =0xfdfffffa" looks innocent, but actually involves a memory
    access to the literal pool, using the current endianness.
  - If we run with the MMU enabled, we are probably doomed already. We
    *could* hope that we are running with an identity mapping, but would
    need to do some cache maintenance to avoid losing dirty cache lines.
- The idea of doing a read-modify-write of SCTLR is somewhat
  questionable to begin with, because as the owner of the current
  exception level we should initialise all bits of this register with a
  certain fixed value.
- The code is unnecessarily complicated, and the function name is
  misspelled.

While those problems *could* admittedly be fixed, the point that is does
not seem to be used at all at the moment tells me we should just remove
this code, and be it to not give a bad example.

If people care, I could introduce some proper SCTLR initialisation code.
We are about to work this out for the boot-wrapper[1] as we speak, but
apparently we got away without doing this in U-Boot ever since, so it
might not be worth the potential trouble.

[1] https://lore.kernel.org/linux-arm-kernel/20220114105653.3003399-7-mark.rutland@arm.com/

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2022-02-03 12:15:37 -05:00
..
arc Finish conversion of CONFIG_SYS_CLK_FREQ to Kconfig 2021-12-27 16:20:18 -05:00
arm armv8: start.S: remove CONFIG_SYS_RESET_SCTRL code 2022-02-03 12:15:37 -05:00
m68k m68k: mcf5445x: pci: Use PCI_CONF1_ADDRESS() macro 2022-01-12 14:21:24 -05:00
microblaze Pull request doc-2022-04-rc1 2022-01-20 09:39:45 -05:00
mips Merge https://source.denx.de/u-boot/custodians/u-boot-marvell 2022-01-20 12:40:20 -05:00
nds32 Finish conversion of CONFIG_SYS_CLK_FREQ to Kconfig 2021-12-27 16:20:18 -05:00
nios2 lmb: nios2: Add arch_lmb_reserve() 2021-09-23 14:15:32 -04:00
powerpc Convert CONFIG_TIMESTAMP to Kconfig 2022-01-21 14:01:34 -05:00
riscv doc: replace @return by Return: 2022-01-19 18:11:34 +01:00
sandbox sandbox: eth-raw: fix building with musl library 2022-01-25 14:02:38 -07:00
sh Convert CONFIG_CPU_SH7751 to Kconfig 2021-12-27 16:20:19 -05:00
x86 x86: Move acpi_get_rsdp_addr() ACPI tables to the writer 2022-01-25 11:44:36 -07:00
xtensa Finish conversion of CONFIG_SYS_CLK_FREQ to Kconfig 2021-12-27 16:20:18 -05:00
.gitignore
Kconfig acpi: Use finer-grained control of ACPI-table generation 2022-01-25 11:44:36 -07:00
u-boot-elf.lds