forked from Imagelibrary/rtems
Patch from Gunter Magin <magin@skil.camelot.de>.
It seems to me I have found a bug in m860_smc_initialize(). This
function lives in
c/src/lib/libcpu/powerpc/mpc860/console-generic/console-generic.c.
The following lines are supposed to set the simode register with the
baud rate generator index, which has been returned from m860_get_brg_clk().
(line 386 of console-generic.c)
/*
* Put SMC in NMSI mode, connect SMC to BRG
*/
m860.simode &= ~0x7000 << ((port-1) * 8);
m860.simode |= brg << (12 + ((port-1) * 8));
This works well for port == 1 (SMC1), however for SMC2 (port == 2) it
fails. First, the simode register consists of 2 16bit parts (one for
SMC1 and SMC2 respectively), hence the shift count is wrong. Second ~0x7000
(which is 0xffff8fff is shifted left and pulls 0 from the right, which
kills the SMC1 entries, when written back to the simode register.
Substitute those lines by:
m860.simode &= ~(0x7000 << ((port-1) * 16));
m860.simode |= brg << (12 + ((port-1) * 16));
I have checked snapshot 20000218a which still contains the bug.
Also affected is libcpu/powerpc/mpc821/console_generic.c, which is a
cut&paste&substitue decendant of the mpc860 console-generic.c.
This commit is contained in:
@@ -385,8 +385,8 @@ m860_smc_initialize (int port) /* port is the SMC number (i.e. 1 or 2) */
|
|||||||
/*
|
/*
|
||||||
* Put SMC in NMSI mode, connect SMC to BRG
|
* Put SMC in NMSI mode, connect SMC to BRG
|
||||||
*/
|
*/
|
||||||
m860.simode &= ~0x7000 << ((port-1) * 8);
|
m860.simode &= ~(0x7000 << ((port-1) * 16));
|
||||||
m860.simode |= brg << (12 + ((port-1) * 8));
|
m860.simode |= brg << (12 + ((port-1) * 16));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set up SMC1 parameter RAM common to all protocols
|
* Set up SMC1 parameter RAM common to all protocols
|
||||||
|
|||||||
Reference in New Issue
Block a user