public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] Is it necessary that uboot(mips) should read status register($12) before setting it
@ 2011-09-28  9:09 RdrouterUboot Router
  2011-09-29 13:04 ` Detlev Zundel
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: RdrouterUboot Router @ 2011-09-28  9:09 UTC (permalink / raw)
  To: u-boot

Hi all,

MIPS Uboot works OK.Part of the code is as below.

And my questions:
1.read status register($12) and save value to $10,but don't use the value in
$10 to do anything.
Because uboot overwrite $10.

2.Is it right?I can delete this code "mfc0 $10,$12" from uboot.

Thanks.

Bruce


# Initialize Misc. Cop0 state

    # Read status register
    mfc0    $10, $12  //Can I delete this code?

    # Set up Status register:
    # Disable Coprocessor Usable bits
    # Turn off Reduce Power bit
    # Turn off reverse endian
    # Turn off BEV (use normal exception vectors)
    # Clear TS, SR, NMI bits
    # Clear Interrupt masks
    # Clear User Mode
    # Clear ERL
    # Set EXL
    # Clear Interrupt Enable
    # modify by Bruce
    #li    $11, 0x0000ff02
    li    $11, 0x00000004
    mtc0    $11, $12


    # Disable watch exceptions
    mtc0    $0, $18

    # Clear Watch Status bits
    li    $11, 0x3
    mtc0    $11, $19

    # Clear WP bit to avoid watch exception upon user code entry
    # Clear IV bit - Interrupts go to general exception vector
    # Clear software interrupts
    mtc0    $0, $13

    # Set KSeg0 to cacheable
    # Config.K0
    mfc0    $10, $16    //Overwrite $10 register.Why uboot read status
register($12) and save value to $10,but don't use $10.

    li    $11, 0x7
    not    $11
    and    $10, $11
    or    $10, 0x3
    mtc0    $10, $16

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-10-01  3:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-28  9:09 [U-Boot] Is it necessary that uboot(mips) should read status register($12) before setting it RdrouterUboot Router
2011-09-29 13:04 ` Detlev Zundel
2011-09-29 16:15 ` Marek Vasut
2011-10-01  3:59 ` Shinya Kuribayashi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox