[U-Boot-Users] Time Base register definitions inccorrect in asm-ppc/processor.h

In include/asm-ppc/processor.h the definitions for the Time Base Upper and Lower registers are incorrect for the PPC440GX.
#define SPRN_TBRL 0x10D /* Time Base Read Lower Register */ #define SPRN_TBRU 0x10C /* Time Base Read Upper Register */ #define SPRN_TBWL 0x11D /* Time Base Write Lower Register */ #define SPRN_TBWU 0x11C /* Time Base Write Upper Register */
i fixed this in my own code by adding the following ifdef:
#ifdef CONFIG_440GX #define SPRN_TBRL 0x10C /* Time Base Read Lower Register */ #define SPRN_TBRU 0x10D /* Time Base Read Upper Register */ #define SPRN_TBWL 0x11C /* Time Base Write Lower Register */ #define SPRN_TBWU 0x11D /* Time Base Write Upper Register */ #else #define SPRN_TBRL 0x10D /* Time Base Read Lower Register */ #define SPRN_TBRU 0x10C /* Time Base Read Upper Register */ #define SPRN_TBWL 0x11D /* Time Base Write Lower Register */ #define SPRN_TBWU 0x11C /* Time Base Write Upper Register */ #endif
-mike wellington

Hi Mike,
On Saturday 05 November 2005 18:43, Mike Wellington wrote:
In include/asm-ppc/processor.h the definitions for the Time Base Upper and Lower registers are incorrect for the PPC440GX.
#define SPRN_TBRL 0x10D /* Time Base Read Lower Register */ #define SPRN_TBRU 0x10C /* Time Base Read Upper Register */ #define SPRN_TBWL 0x11D /* Time Base Write Lower Register */ #define SPRN_TBWU 0x11C /* Time Base Write Upper Register */
i fixed this in my own code by adding the following ifdef:
#ifdef CONFIG_440GX #define SPRN_TBRL 0x10C /* Time Base Read Lower Register */ #define SPRN_TBRU 0x10D /* Time Base Read Upper Register */ #define SPRN_TBWL 0x11C /* Time Base Write Lower Register */ #define SPRN_TBWU 0x11D /* Time Base Write Upper Register */ #else #define SPRN_TBRL 0x10D /* Time Base Read Lower Register */ #define SPRN_TBRU 0x10C /* Time Base Read Upper Register */ #define SPRN_TBWL 0x11D /* Time Base Write Lower Register */ #define SPRN_TBWU 0x11C /* Time Base Write Upper Register */ #endif
After a quick look in some other ppc manuals (AMCC and Freescale) this seems to be not only a 440GX problem, but a generic ppc problem. I will prepare a patch for this.
I didn't find any code referencing these registers. Do you have an command/application using these timebase regsisters, which could be interesting for the community? If so, please share it it with us.
And please submit a proper patch next time (CHANGELOG, etc...)
Best regards, Stefan

On Nov 7, 2005, at 4:00 AM, Stefan Roese wrote:
After a quick look in some other ppc manuals (AMCC and Freescale) this seems to be not only a 440GX problem, but a generic ppc problem. I will prepare a patch for this.
If you just use the proper assembler instructions for the mttb/mftb variants, the assembler will chose the right encoding for the processor model.
I didn't find any code referencing these registers.
This is why I don't like people just arbitrarily going through the manuals and generating such #defines. If we don't use something, let's not define it. How are you going to test a patch to "fix" this stuff if it isn't used? Just delete it and forget it.
Thanks.
-- Dan

Architecture-specific definition files such as
include/asm-ppc/processor.h
should be complete and correct, whether u-boot ,( or whatever app,) uses every single register and value defined in them or not.
Otherwise name the file something else like
"include/asm-ppc/u-boot-centric.h"
That way people will have some inkling that the include file they are reading is not technically complete or accurate.
Regards,
-mike wellington
On 11/7/05, Dan Malek dan@embeddededge.com wrote:
This is why I don't like people just arbitrarily going through the manuals and generating such #defines. If we don't use something, let's not define it. How are you going to test a patch to "fix" this stuff if it isn't used? Just delete it and forget it.
On 11/7/05, Dan Malek dan@embeddededge.com wrote:
On Nov 7, 2005, at 4:00 AM, Stefan Roese wrote:
After a quick look in some other ppc manuals (AMCC and Freescale) this seems to be not only a 440GX problem, but a generic ppc problem. I will prepare a patch for this.
If you just use the proper assembler instructions for the mttb/mftb variants, the assembler will chose the right encoding for the processor model.
I didn't find any code referencing these registers.
This is why I don't like people just arbitrarily going through the manuals and generating such #defines. If we don't use something, let's not define it. How are you going to test a patch to "fix" this stuff if it isn't used? Just delete it and forget it.
Thanks.
-- Dan

In message d1ed0eb40511241922p45cde91eg2b8652d53fa73eb6@mail.gmail.com you wrote:
Architecture-specific definition files such as
include/asm-ppc/processor.h
should be complete and correct, whether u-boot ,( or whatever app,) uses every single register and value defined in them or not.
I agree that they shall be correct.
There is no attempt or intention to make them "complete" (whatever that means).
For me the file is "complete" when it contains all the necessary definitions.
Best regards,
Wolfgang Denk
participants (4)
-
Dan Malek
-
Mike Wellington
-
Stefan Roese
-
Wolfgang Denk