MPC8xx CPU library changes

Andrew Rybchenko arybchik at oktet.ru
Tue Oct 30 17:50:51 UTC 2001


Hello all MPC8xx CPU library users!

 In order to make MPC8xx console generic driver more flexible we made
some changes:

1). In file lib/libcpu/powerpc/mpc8xx/include/mpc8xx.h

  a).  Added some definitions related to SCC/SMC UART initialization.
     Added I2C parameters definition. Added HDLC/Async-HDLC/BISYNC/
     Transparent specific parameters in SCC specific parameters union.

       This changes do not cause any problems.

  b).  Type of m8xx.scc1p is changed to m8xxSCCparams_t instead of
     m8xxSCCENparams_t in order to
      - to place I2C parameters in m8xx_t structure.
      - to provide homogeneous interface to SCCx parameters, i.e. it's
        possible to use any SCC channel for Ethernet.
     Now in order to use Ethernet specific SCC parameters it is
     necessary to make forced type transformation.

       This change causes compilation warnings:
  	  warning: assignment from incompatible pointer type
     and compilation errors if somebody tries to set up ethernet
     specific parameters in m8xx.scc1p.un.ethernet without forced
     type transformation.
       But it's so easy to fix it.

 Comments?

2). File lib/libcpu/powerpc/mpc8xx/console-generic/console-generic.c
   was considerably reformed:

   a). - added more comments
       - definitions are used intead of numbers in most cases
       - one macro is used to generate all(6) interrupt handler
         (in order to avoid code duplication)

       This changes don't cause any problems at all.

   b). I think it's useful to track more errors during scc/smc uart
      initialization. Two versions may be used:
       1.  Change m8xx_uart_smc(scc)_initialize prototype to return
         rtems_error_code and BSP decide what should it do.
           I think it's not cause any problems exept compilation
         warnings.
       2.  Call rtems_fatal_error if an error is occure.
           No problems at all, but less flexible.
 Comments?

   c). Since various ports initialization may be done to use SCCx UART.
         E.g.: ~RTS1(2) - PortB(19,18) or PortC(15,14)
               ~RTS3(4) - PortB(17,16) or PortC(13,12) or PortD(7,6)
               RXD/TXD(3,4) - PortA(11/10,9/8) or PortD(11/10,9/8)
       We suggest to keep current ports initialization or use, if
       specified, init_pins routine BSP-provided. In order to use
       it's necessary to:
         1). Change m8xx_uart_smc(scc)_initialize prototype to get
            additional parameter.
             May cause compilation problems, but it's not so hard add
            it equal to NULL.
         2). Include <bsp.h> in console-generic.c and use conditional
            compilation to set up init_pins routine to NULL or
            BSP-porvided routine.
             This version will not cause any problem at all but it's
            not so good to make console-generic BSP-dependent in such way.
 Comments?

3). We suggest to put all baud rate generators related routines,
   definitions and declarations in new file in
   lib/libcpu/powerpc/mpc8xx/cpm directory in order to use it in
   all cases when baud rate generators are used/allocated. Now
   it possible to overlap its usage.

 Comments?


Of course, it is possible to put all this changes in additional MPC8xx.NEW
CPU library and configure library usage in BSP, but I think these features
may be useful for all MPC8xx BSPs.

Thanks for attention!

-- 
Andrew Rybchenko
OKTET Ltd.
1 Ulianovskaya st., Petergof, St.Petersburg, 198904 Russia
Phone: +7(812)428-4384 Fax: +7(812)428-4389
mailto:Andrew.Rybchenko at oktet.ru






More information about the users mailing list