Skip to content
Snippets Groups Projects
  1. Dec 13, 2023
  2. Nov 16, 2023
  3. Nov 13, 2023
  4. Nov 10, 2023
    • Tom Rini's avatar
      Merge branch '2023-11-10-improve-semihosting-armv6' into next · 3b6db690
      Tom Rini authored
      To quote the author:
      This series has a few fixes for semihosting on ARMv6 and older CPUs. The
      first two patches address problems regarding the stack pointer and link
      register. U-Boot runs in supervisor mode, so taking a software interrupt
      will clobber sp/lr. I think we really should run in system mode, since
      it has separate sp/lr registers. To quote ARM DDI 0100I:
      
      > The remaining mode is System mode, which is not entered by any
      > exception and has exactly the same registers available as User mode.
      > However, it is a privileged mode and is therefore not subject to the
      > User mode restrictions. It is intended for use by operating system
      > tasks that need access to system resources, but wish to avoid using
      > the additional registers associated with the exception modes. Avoiding
      > such use ensures that the task state is not corrupted by the
      > occurrence of any exception.
      
      However, the processor mode has been supervisor for such a long time
      (since relocation got introduced) that I would rather not touch it.
      3b6db690
    • Sean Anderson's avatar
      arm: semihosting: Support semihosting fallback on 32-bit ARM · 47cfdb21
      Sean Anderson authored and Tom Rini's avatar Tom Rini committed
      
      Add support for a semihosting fallback on 32-bit ARM. The assembly is
      lightly adapted from the irq return code, except there is no offset
      since lr already points to the correct instruction. The C side is mostly
      like ARM64, except we have fewer cases to deal with.
      
      Signed-off-by: default avatarSean Anderson <sean.anderson@seco.com>
      47cfdb21
    • Sean Anderson's avatar
      arm: semihosting: Fix returning from traps on ARMv6 and lower · 6ef83ab6
      Sean Anderson authored and Tom Rini's avatar Tom Rini committed
      
      U-Boot runs in supervisor mode. On ARMv6 and lower, software interrupts
      are taken in supervisor mode. When entering an interrupt, the link
      register is set to the address of the next instruction. However, if we
      are already in supervisor mode, this clobbers the link register. The
      debugger can't help us, since by the time it notices we've taken a
      software interrupt, the link register is already gone. Work around this
      by moving the return address to another register.
      
      Signed-off-by: default avatarSean Anderson <sean.anderson@seco.com>
      6ef83ab6
    • Sean Anderson's avatar
      arm: Fix software interrupt handler · 298c26c5
      Sean Anderson authored and Tom Rini's avatar Tom Rini committed
      
      When we take a software interrupt, we are already in supervisor mode.
      get_bad_stack assumes we are not in supervisor mode so it can clobber
      the stack pointer. This causes us to have an invalid stack once that
      macro finishes. Revert back to the get_bad_stack_swi macro which was
      previously removed.
      
      Fixes: 41623c91 ("arm: move exception handling out of start.S files")
      Signed-off-by: default avatarSean Anderson <sean.anderson@seco.com>
      298c26c5
  5. Nov 07, 2023
Loading