Print this page
bcm2835: move strict alignment check disable code into the loader
Since the loader wants to muck with alignment related bits of the SCTLR
anyway, it should set both A and U to the desired values (0 and 1
respectively).


  34          * XXX manually fix up the tag start
  35          */
  36         mov     r2, #0x100
  37         bl      fakeload_init
  38         SET_SIZE(_start)
  39 
  40 #if defined(__lint)
  41 
  42 /* ARGSUSED */
  43 void
  44 fakeload_unaligned_enable(void)
  45 {}
  46 
  47 #else   /* __lint */
  48 
  49         /*
  50          * Fix up alignment by turning off A and by turning on U.
  51          */
  52         ENTRY(fakeload_unaligned_enable)
  53         mrc     p15, 0, r0, c1, c0, 0
  54         orr     r0, #0x400000

  55         mcr     p15, 0, r0, c1, c0, 0
  56         bx      lr
  57         SET_SIZE(fakeload_unaligned_enable);
  58 
  59 #endif  /* __lint */
  60 
  61 #if defined(__lint)
  62 
  63 fakeload_pt_setup(uintptr_t ptroot)
  64 {}
  65 
  66 #else /* __lint */
  67 
  68         /*
  69          * We need to set up the world for the first time. We'll do the
  70          * following in order:
  71          *
  72          * o Set the TTBCR to always use TTBR0
  73          * o Set domain 0 to manager mode
  74          * o Program the Page table root




  34          * XXX manually fix up the tag start
  35          */
  36         mov     r2, #0x100
  37         bl      fakeload_init
  38         SET_SIZE(_start)
  39 
  40 #if defined(__lint)
  41 
  42 /* ARGSUSED */
  43 void
  44 fakeload_unaligned_enable(void)
  45 {}
  46 
  47 #else   /* __lint */
  48 
  49         /*
  50          * Fix up alignment by turning off A and by turning on U.
  51          */
  52         ENTRY(fakeload_unaligned_enable)
  53         mrc     p15, 0, r0, c1, c0, 0
  54         orr     r0, #0x400000   /* U = 1 */
  55         bic     r0, r0, #2      /* A = 0 */
  56         mcr     p15, 0, r0, c1, c0, 0
  57         bx      lr
  58         SET_SIZE(fakeload_unaligned_enable);
  59 
  60 #endif  /* __lint */
  61 
  62 #if defined(__lint)
  63 
  64 fakeload_pt_setup(uintptr_t ptroot)
  65 {}
  66 
  67 #else /* __lint */
  68 
  69         /*
  70          * We need to set up the world for the first time. We'll do the
  71          * following in order:
  72          *
  73          * o Set the TTBCR to always use TTBR0
  74          * o Set domain 0 to manager mode
  75          * o Program the Page table root