It is not possible to read the entire 64-bit timebase value by one instruction, instruction mfspr reads only 32 bits. The following is said in "Book E: Enhanced PowerPC Architecture", Section 8.4.3 "Reading the Time Base":
It is not possible to read the entire 64-bit Time Base in a single instruction. mfspr RT, TBL moves from the lower half of the Time Base (TBL) to a GPR, and mfspr RT, TBU extended mnemonic moves from the upper half (TBU) to a GPR. Because of the possibility of a carry from Time Base Lower to Time Base Upper occurring between reads of Time Base Lower and Time Base Upper, a sequence such as the following is necessary to read the Time Base.
loop:
mfspr Rx,TBU #load from TBU
mfspr Ry,TBL #load from TBL
mfspr Rz,TBU #load from TBU
cmp cr0,0,Rz,Rx #see if 'old' = 'new'
bc 4,2,loop #loop if carry occurred
The comparison and loop are necessary to ensure that a consistent pair of values has been obtained.
Reading entire 64-bit by one instruction is possible in 64-bit implementations only.
P2020 device (e500v2 core) is 32-bit.
Have a great day,
Alexander
TIC
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------