public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] Time Base register definitions inccorrect in asm-ppc/processor.h
@ 2005-11-05 17:43 Mike Wellington
  2005-11-07  9:00 ` Stefan Roese
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Wellington @ 2005-11-05 17:43 UTC (permalink / raw)
  To: u-boot

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

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

* [U-Boot-Users] Time Base register definitions inccorrect in asm-ppc/processor.h
  2005-11-05 17:43 [U-Boot-Users] Time Base register definitions inccorrect in asm-ppc/processor.h Mike Wellington
@ 2005-11-07  9:00 ` Stefan Roese
  2005-11-07 14:43   ` Dan Malek
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Roese @ 2005-11-07  9:00 UTC (permalink / raw)
  To: u-boot

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

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

* [U-Boot-Users] Time Base register definitions inccorrect in asm-ppc/processor.h
  2005-11-07  9:00 ` Stefan Roese
@ 2005-11-07 14:43   ` Dan Malek
  2005-11-25  3:22     ` Mike Wellington
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Malek @ 2005-11-07 14:43 UTC (permalink / raw)
  To: u-boot

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

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

* [U-Boot-Users] Time Base register definitions inccorrect in asm-ppc/processor.h
  2005-11-07 14:43   ` Dan Malek
@ 2005-11-25  3:22     ` Mike Wellington
  2005-11-25  8:16       ` Wolfgang Denk
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Wellington @ 2005-11-25  3:22 UTC (permalink / raw)
  To: u-boot

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
>
>

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

* [U-Boot-Users] Time Base register definitions inccorrect in asm-ppc/processor.h
  2005-11-25  3:22     ` Mike Wellington
@ 2005-11-25  8:16       ` Wolfgang Denk
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Denk @ 2005-11-25  8:16 UTC (permalink / raw)
  To: u-boot

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

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The number you have dialed is imaginary. Please divide by 0  and  try
again.

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

end of thread, other threads:[~2005-11-25  8:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-05 17:43 [U-Boot-Users] Time Base register definitions inccorrect in asm-ppc/processor.h Mike Wellington
2005-11-07  9:00 ` Stefan Roese
2005-11-07 14:43   ` Dan Malek
2005-11-25  3:22     ` Mike Wellington
2005-11-25  8:16       ` Wolfgang Denk

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