Print this page
bcm2835: remove workaround for u-boot
Since we are not using u-boot, we don't need a work-around for it.
bcm2835: enable access to p10 and p11
When determining whether or not we are running on a supported processor, we
call arm_cpuid_vfpidreg.  This function attempts to get the FPSID which
involves talking to p10.  It however turns out that after a reset only p14
and p15 are accessible.  So, before handing off control to _fakebop_start,
let's enable access to p10 and p11 (privileged mode only).
NOTE: qemu doesn't seem to behave the same - it lets us access p10 & p11
without us doing anything special.

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/armv6/bcm2835/ml/locore.s
          +++ new/usr/src/uts/armv6/bcm2835/ml/locore.s
↓ open down ↓ 3 lines elided ↑ open up ↑
   4    4   * You may only use this file in accordance with the terms of version
   5    5   * 1.0 of the CDDL.
   6    6   *
   7    7   * A full copy of the text of the CDDL should have accompanied this
   8    8   * source.  A copy of the CDDL is also available via the Internet at
   9    9   * http://www.illumos.org/license/CDDL.
  10   10   */
  11   11  
  12   12  /*
  13   13   * Copyright 2013 (c) Joyent, Inc. All rights reserved.
       14 + * Copyright 2015 (c) Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
  14   15   */
  15   16  
  16   17  #include <sys/asm_linkage.h>
  17   18  #include <sys/machparam.h>
  18   19  #include <sys/cpu_asm.h>
  19   20  
  20   21  /*
  21   22   * Every story needs a beginning. This is ours.
  22   23   */
  23   24  
↓ open down ↓ 70 lines elided ↑ open up ↑
  94   95          mov     r4, #1
  95   96          lsl     r4, r4, #13
  96   97          orr     r3, r3, r4
  97   98          mcr     p15, 0, r3, c1, c0, 0
  98   99  
  99  100          /* Disable A (disables strict alignment checks) */
 100  101          mrc     p15, 0, r3, c1, c0, 0
 101  102          bic     r3, r3, #2
 102  103          mcr     p15, 0, r3, c1, c0, 0
 103  104  
 104      -        /*
 105      -         * XXX Currently we're using u-boot to allow us to make forward progress
 106      -         * while the .data section is a bit tumultuous. It loads that, but we
 107      -         * can say for certain that it does not correctly pass in the machid and
 108      -         * tagstart. Since we know what it is, we manually fix it up here.
 109      -         */
 110      -        mov r2,#0x100
      105 +        /* Enable access to p10 and p11 (privileged mode only) */
      106 +        mrc     p15, 0, r0, c1, c0, 2
      107 +        orr     r0, #0x00500000
      108 +        mcr     p15, 0, r0, c1, c0, 2
      109 +
 111  110          bl _fakebop_start
 112  111          SET_SIZE(_start)
 113  112  
 114  113          ENTRY(arm_reg_read)
 115  114          ldr r0, [r0]
 116  115          bx lr
 117  116          SET_SIZE(arm_reg_read)
 118  117  
 119  118          ENTRY(arm_reg_write)
 120  119          str r1, [r0]
 121  120          bx lr
 122  121          SET_SIZE(arm_reg_write)
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX