Re: [U-Boot] Is it necessary that uboot(mips) should read status register($12) before setting it

2011-09-30 Thread Shinya Kuribayashi
On 09/28/2011 06:09 PM, RdrouterUboot Router wrote:
 2.Is it right?I can delete this code mfc0 $10,$12 from uboot.

You can delete that MFC0 instruction in this case and save one word.
Presumably the original code used to update the Status register value
in read-modify-write manner, and at some point someone modified into
current shape.

By the way, since the first MIPS implementation of U-Boot was merged
into the tree (by wdenk), we've been using k0($26) or t0($8) register
as a scratch pad when modifying the Status register, while your example
code uses t2($10).  So it would be a custom U-Boot we don't know of.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Is it necessary that uboot(mips) should read status register($12) before setting it

2011-09-29 Thread Detlev Zundel
Hi Bruce,

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

Congratulations.  Although I'm not sure what I'm congratulating on ;)

 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.

I'm sorry, but I don;t know what to make of this. Can you tell us if
this code is from U-Boot and if so, in which file?  Also can't you try
for yourself if U-Boot still works after removing this instruction?

What exactly do you want us to tell you?

Cheers
  Detlev

-- 
If I could ask a  genie to grant me one wish for free software, it would not
be about the  popularity of the GNU Hurd,  or even the popularity of the GNU
system.  I would wish for all software users to have  reedom and value free-
dom.   -- Richard Stallman e1oipab-00016e...@fencepost.gnu.org
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Is it necessary that uboot(mips) should read status register($12) before setting it

2011-09-29 Thread Marek Vasut
On Wednesday, September 28, 2011 11:09:05 AM RdrouterUboot Router wrote:
 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
 

I don't see this code in uboot at all ... what version do you use ?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Is it necessary that uboot(mips) should read status register($12) before setting it

2011-09-28 Thread RdrouterUboot Router
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, 0xff02
li$11, 0x0004
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
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot