* [U-Boot-Users] Fixed CD in serial.c, AT91RM9200
@ 2004-07-13 7:13 Kögler Peter
2004-08-02 23:26 ` Wolfgang Denk
0 siblings, 1 reply; 4+ messages in thread
From: Kögler Peter @ 2004-07-13 7:13 UTC (permalink / raw)
To: u-boot
Hello all,
is there a reason why the clock divisor in the baudrate generator register
(us->US_BRGR) is set to a fixed value in serial_setbrg(void):
us->US_BRGR = CFG_AT91C_BRGR_DIVISOR
I changed the implementation of serial_setbrg(void) and i can now opperate
at higher baudrates. (change baudrate with loadb).
Here is my version:
void serial_setbrg (void)
{
DECLARE_GLOBAL_DATA_PTR;
int baudrate, baudRateGenDiv,i;
unsigned long baudrate_table[] = CFG_BAUDRATE_TABLE;
int n_baudrates = (sizeof(baudrate_table) / sizeof(baudrate_table[0]));
baudrate = gd->baudrate;
//check if value is supported
for (i=0; i<n_baudrates; ++i)
{
if (baudrate == baudrate_table[i])
{
baudRateGenDiv = AT91C_MASTER_CLOCK / baudrate / 16;
//printf ("## Switched baudrate to %dbps.\n", baudrate);
break;
}
}
if (baudRateGenDiv==0)
{
//using default value
baudRateGenDiv = CFG_AT91C_BRGR_DIVISOR;
printf ("## Baudrate %dbps not supported using default baudrate
%dbps.\n", baudrate, CONFIG_BAUDRATE);
}
us->US_BRGR = baudRateGenDiv;
}
If you agree with my changes i can provide a patch.
wbr
Peter
^ permalink raw reply [flat|nested] 4+ messages in thread* [U-Boot-Users] Fixed CD in serial.c, AT91RM9200
2004-07-13 7:13 [U-Boot-Users] Fixed CD in serial.c, AT91RM9200 Kögler Peter
@ 2004-08-02 23:26 ` Wolfgang Denk
2004-08-03 11:34 ` Steven Scholz
0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Denk @ 2004-08-02 23:26 UTC (permalink / raw)
To: u-boot
In message <367ED8C46538D7119DAC000A0D106744520D6E@elmegmbh.elmedmn.com> you wrote:
>
> is there a reason why the clock divisor in the baudrate generator register
> (us->US_BRGR) is set to a fixed value in serial_setbrg(void):
>
> us->US_BRGR = CFG_AT91C_BRGR_DIVISOR
>
>
> I changed the implementation of serial_setbrg(void) and i can now opperate
> at higher baudrates. (change baudrate with loadb).
I have never seen any feedback or comments about this proposal.
Anybody out there?
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd at denx.de
HANDLE WITH EXTREME CARE: This Product Contains Minute Electrically
Charged Particles Moving at Velocities in Excess of Five Hundred
Million Miles Per Hour.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot-Users] Fixed CD in serial.c, AT91RM9200
2004-08-02 23:26 ` Wolfgang Denk
@ 2004-08-03 11:34 ` Steven Scholz
2004-08-03 13:29 ` Wolfgang Denk
0 siblings, 1 reply; 4+ messages in thread
From: Steven Scholz @ 2004-08-03 11:34 UTC (permalink / raw)
To: u-boot
Wolfgang Denk wrote:
> In message <367ED8C46538D7119DAC000A0D106744520D6E@elmegmbh.elmedmn.com> you wrote:
>
>>is there a reason why the clock divisor in the baudrate generator register
>>(us->US_BRGR) is set to a fixed value in serial_setbrg(void):
>>
>>us->US_BRGR = CFG_AT91C_BRGR_DIVISOR
>>
>>
>>I changed the implementation of serial_setbrg(void) and i can now opperate
>>at higher baudrates. (change baudrate with loadb).
>
>
> I have never seen any feedback or comments about this proposal.
>
> Anybody out there?
I introduced this since it was originally hardcoded to
us->US_BRGR = 33
for the AT91RM9200DK. The comment says "hardcode so no __divsi3".
I decdided that having a CFG_AT91C_BRGR_DIVISOR in your board specific
header file would be enough.
I had no time to test Peter's patch yet. But go ahead and apply it. If I
find problems I'll report them...
--
Steven Scholz
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot-Users] Fixed CD in serial.c, AT91RM9200
2004-08-03 11:34 ` Steven Scholz
@ 2004-08-03 13:29 ` Wolfgang Denk
0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2004-08-03 13:29 UTC (permalink / raw)
To: u-boot
In message <410F7832.8070700@imc-berlin.de> you wrote:
>
> I introduced this since it was originally hardcoded to
>
> us->US_BRGR = 33
>
> for the AT91RM9200DK. The comment says "hardcode so no __divsi3".
This is what I remember, so I guess there was a problem?
> I had no time to test Peter's patch yet. But go ahead and apply it. If I
> find problems I'll report them...
Ummm... please test it first, to avoid checking in something that
doesn't work. Thanks.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd at denx.de
No problem is insoluble.
-- Dr. Janet Wallace, "The Deadly Years", stardate 3479.4
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-08-03 13:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-13 7:13 [U-Boot-Users] Fixed CD in serial.c, AT91RM9200 Kögler Peter
2004-08-02 23:26 ` Wolfgang Denk
2004-08-03 11:34 ` Steven Scholz
2004-08-03 13:29 ` Wolfgang Denk
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.