Changeset d6b0477 in rtems

Timestamp:
03/21/00 15:06:04 (24 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Children:
d5666945
Parents:
218103d
Message:

Patch from Gunter Magin <magin@…>.

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.

CVS: ----------------------------------------------------------------------
CVS: Enter Log. Lines beginning with `CVS:' are removed automatically
CVS:
CVS: Committing in .
CVS:
CVS: Modified Files:
CVS: Tag: rtems-4-5-branch
CVS: console-generic.c
CVS: ----------------------------------------------------------------------

(No files)

Note: See TracChangeset for help on using the changeset viewer.