Changeset 3084de2 in rtems


Ignore:
Timestamp:
Apr 7, 1999, 3:57:05 PM (22 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
5907192
Parents:
055c18b
Message:

MPC821 support and PPC patches from Andrew Bray <andy@…>:

In c/src/exec/score/cpu/powerpc/rtems/score/ppc.h:

A lot of hardware interrupts were omitted. Patch enclosed.
I have also added the 821.

In c/src/exec/score/cpu/powerpc/rtems/score/cpu.h:

My patch adds the 821.

In c/src/exec/score/cpu/powerpc/cpu.c:

I have added the MPC821, and also fixed up for the missing hardware
interrupts. It is also inconsistent with
c/src/lib/libcpu/powerpc/mpc860/vectors/vectors.S. This has been fixed.

In c/src/lib/libcpu/powerpc/mpc860/vectors/vectors.S:

Fixed an inconsistency with cpu.c.

I also include some new files to go with the above patches. These are the
cpu library rtems-19990331/c/src/lib/libcpu/powerpc/mpc821/* and
c/src/exec/score/cpu/powerpc/mpc821.h which are minor modifications of
the 860 equivalents.

Other comments:

The various accesses to the DPRAM on the 860 are done with a linktime
symbol. This could be done dynamically at run time by reading the immr
register, and masking off the lower 16 bits. This takes the same amount
of time as loading an address constant, and the same number of
instructions as well (2).

In c/src/lib/libcpu/powerpc/mpc860/console-generic/console-generic.c:

This will silently fail if you attempt to use SCC1. This is only relevant
if you are not using SCC1 for ethernet.

This file also sets one of port B output pins for each port. This is NOT
generic, it should be in the BSP specific console driver.

Files:
15 added
5 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/score/cpu/powerpc/cpu.c

    r055c18b r3084de2  
    406406};
    407407
    408 #ifdef mpc860
     408#if defined(mpc860) || defined(mpc821)
    409409const CPU_Trap_table_entry _CPU_Trap_slot_template_m860 = {
    410410  0x7c0803ac,           /* mtlr  %r0                            */
     
    498498 *  one is not present
    499499 */
    500 #ifdef mpc860
     500#if defined(mpc860) || defined(mpc821)
    501501  if (slot->stwu_r1 == _CPU_Trap_slot_template_m860.stwu_r1) {
    502502    /*
     
    513513   *  Copy the template to the slot and then fix it.
    514514   */
    515 #ifdef mpc860
    516   if (vector > PPC_STD_IRQ_LAST)
     515#if defined(mpc860) || defined(mpc821)
     516  if (vector >= PPC_IRQ_IRQ0)
    517517    *slot = _CPU_Trap_slot_template_m860;
    518518  else
     
    673673      break;
    674674
    675 #elif defined(mpc860)
     675#elif defined(mpc860) || defined(mpc821)
     676    case PPC_IRQ_EMULATE:
     677      Offset = 0x1000;
     678      break;
     679    case PPC_IRQ_INST_MISS:
     680      Offset = 0x1100;
     681      break;
     682    case PPC_IRQ_DATA_MISS:
     683      Offset = 0x1200;
     684      break;
     685    case PPC_IRQ_INST_ERR:
     686      Offset = 0x1300;
     687      break;
     688    case PPC_IRQ_DATA_ERR:
     689      Offset = 0x1400;
     690      break;
     691    case PPC_IRQ_DATA_BPNT:
     692      Offset = 0x1c00;
     693      break;
     694    case PPC_IRQ_INST_BPNT:
     695      Offset = 0x1d00;
     696      break;
     697    case PPC_IRQ_IO_BPNT:
     698      Offset = 0x1e00;
     699      break;
     700    case PPC_IRQ_DEV_PORT:
     701      Offset = 0x1f00;
     702      break;
    676703    case PPC_IRQ_IRQ0:
    677       Offset = 0x1000;
     704      Offset = 0x2000;
    678705      break;
    679706    case PPC_IRQ_LVL0:
    680       Offset = 0x1040;
     707      Offset = 0x2040;
    681708      break;
    682709    case PPC_IRQ_IRQ1:
    683       Offset = 0x1080;
     710      Offset = 0x2080;
    684711      break;
    685712    case PPC_IRQ_LVL1:
    686       Offset = 0x10c0;
     713      Offset = 0x20c0;
    687714      break;
    688715    case PPC_IRQ_IRQ2:
    689       Offset = 0x1100;
     716      Offset = 0x2100;
    690717      break;
    691718    case PPC_IRQ_LVL2:
    692       Offset = 0x1140;
     719      Offset = 0x2140;
    693720      break;
    694721    case PPC_IRQ_IRQ3:
    695       Offset = 0x1180;
     722      Offset = 0x2180;
    696723      break;
    697724    case PPC_IRQ_LVL3:
    698       Offset = 0x11c0;
     725      Offset = 0x21c0;
    699726      break;
    700727    case PPC_IRQ_IRQ4:
    701       Offset = 0x1200;
     728      Offset = 0x2200;
    702729      break;
    703730    case PPC_IRQ_LVL4:
    704       Offset = 0x1240;
     731      Offset = 0x2240;
    705732      break;
    706733    case PPC_IRQ_IRQ5:
    707       Offset = 0x1280;
     734      Offset = 0x2280;
    708735      break;
    709736    case PPC_IRQ_LVL5:
    710       Offset = 0x12c0;
     737      Offset = 0x22c0;
    711738      break;
    712739    case PPC_IRQ_IRQ6:
    713       Offset = 0x1300;
     740      Offset = 0x2300;
    714741      break;
    715742    case PPC_IRQ_LVL6:
    716       Offset = 0x1340;
     743      Offset = 0x2340;
    717744      break;
    718745    case PPC_IRQ_IRQ7:
    719       Offset = 0x1380;
     746      Offset = 0x2380;
    720747      break;
    721748    case PPC_IRQ_LVL7:
    722       Offset = 0x13c0;
     749      Offset = 0x23c0;
    723750      break;
    724751    case PPC_IRQ_CPM_RESERVED_0:
    725       Offset = 0x1400;
     752      Offset = 0x2400;
    726753      break;
    727754    case PPC_IRQ_CPM_PC4:
    728       Offset = 0x1410;
     755      Offset = 0x2410;
    729756      break;
    730757    case PPC_IRQ_CPM_PC5:
    731       Offset = 0x1420;
     758      Offset = 0x2420;
    732759      break;
    733760    case PPC_IRQ_CPM_SMC2:
    734       Offset = 0x1430;
     761      Offset = 0x2430;
    735762      break;
    736763    case PPC_IRQ_CPM_SMC1:
    737       Offset = 0x1440;
     764      Offset = 0x2440;
    738765      break;
    739766    case PPC_IRQ_CPM_SPI:
    740       Offset = 0x1450;
     767      Offset = 0x2450;
    741768      break;
    742769    case PPC_IRQ_CPM_PC6:
    743       Offset = 0x1460;
     770      Offset = 0x2460;
    744771      break;
    745772    case PPC_IRQ_CPM_TIMER4:
    746       Offset = 0x1470;
     773      Offset = 0x2470;
    747774      break;
    748775    case PPC_IRQ_CPM_RESERVED_8:
    749       Offset = 0x1480;
     776      Offset = 0x2480;
    750777      break;
    751778    case PPC_IRQ_CPM_PC7:
    752       Offset = 0x1490;
     779      Offset = 0x2490;
    753780      break;
    754781    case PPC_IRQ_CPM_PC8:
    755       Offset = 0x14a0;
     782      Offset = 0x24a0;
    756783      break;
    757784    case PPC_IRQ_CPM_PC9:
    758       Offset = 0x14b0;
     785      Offset = 0x24b0;
    759786      break;
    760787    case PPC_IRQ_CPM_TIMER3:
    761       Offset = 0x14c0;
     788      Offset = 0x24c0;
    762789      break;
    763790    case PPC_IRQ_CPM_RESERVED_D:
    764       Offset = 0x14d0;
     791      Offset = 0x24d0;
    765792      break;
    766793    case PPC_IRQ_CPM_PC10:
    767       Offset = 0x14e0;
     794      Offset = 0x24e0;
    768795      break;
    769796    case PPC_IRQ_CPM_PC11:
    770       Offset = 0x14f0;
     797      Offset = 0x24f0;
    771798      break;
    772799    case PPC_IRQ_CPM_I2C:
    773       Offset = 0x1500;
     800      Offset = 0x2500;
    774801      break;
    775802    case PPC_IRQ_CPM_RISC_TIMER:
    776       Offset = 0x1510;
     803      Offset = 0x2510;
    777804      break;
    778805    case PPC_IRQ_CPM_TIMER2:
    779       Offset = 0x1520;
     806      Offset = 0x2520;
    780807      break;
    781808    case PPC_IRQ_CPM_RESERVED_13:
    782       Offset = 0x1530;
     809      Offset = 0x2530;
    783810      break;
    784811    case PPC_IRQ_CPM_IDMA2:
    785       Offset = 0x1540;
     812      Offset = 0x2540;
    786813      break;
    787814    case PPC_IRQ_CPM_IDMA1:
    788       Offset = 0x1550;
     815      Offset = 0x2550;
    789816      break;
    790817    case PPC_IRQ_CPM_SDMA_ERROR:
    791       Offset = 0x1560;
     818      Offset = 0x2560;
    792819      break;
    793820    case PPC_IRQ_CPM_PC12:
    794       Offset = 0x1570;
     821      Offset = 0x2570;
    795822      break;
    796823    case PPC_IRQ_CPM_PC13:
    797       Offset = 0x1580;
     824      Offset = 0x2580;
    798825      break;
    799826    case PPC_IRQ_CPM_TIMER1:
    800       Offset = 0x1590;
     827      Offset = 0x2590;
    801828      break;
    802829    case PPC_IRQ_CPM_PC14:
    803       Offset = 0x15a0;
     830      Offset = 0x25a0;
    804831      break;
    805832    case PPC_IRQ_CPM_SCC4:
    806       Offset = 0x15b0;
     833      Offset = 0x25b0;
    807834      break;
    808835    case PPC_IRQ_CPM_SCC3:
    809       Offset = 0x15c0;
     836      Offset = 0x25c0;
    810837      break;
    811838    case PPC_IRQ_CPM_SCC2:
    812       Offset = 0x15d0;
     839      Offset = 0x25d0;
    813840      break;
    814841    case PPC_IRQ_CPM_SCC1:
    815       Offset = 0x15e0;
     842      Offset = 0x25e0;
    816843      break;
    817844    case PPC_IRQ_CPM_PC15:
    818       Offset = 0x15f0;
     845      Offset = 0x25f0;
    819846      break;
    820847#endif
  • c/src/exec/score/cpu/powerpc/rtems/score/cpu.h

    r055c18b r3084de2  
    475475  boolean      exceptions_in_RAM;     /* TRUE if in RAM */
    476476
    477 #if (defined(ppc403) || defined(mpc860))
     477#if (defined(ppc403) || defined(mpc860) || defined(mpc821))
    478478  unsigned32   serial_per_sec;         /* Serial clocks per second */
    479479  boolean      serial_external_clock;
     
    486486#endif
    487487
    488 #if (defined(mpc860))
     488#if (defined(mpc860) || defined(mpc821))
    489489  unsigned32   clock_speed;            /* Speed of CPU in Hz */
    490490#endif
  • c/src/exec/score/cpu/powerpc/wrap/Makefile.in

    r055c18b r3084de2  
    3030C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
    3131
    32 H_PIECES = asm.h mpc860.h
     32H_PIECES = asm.h mpc860.h mpc821.h
    3333H_FILES=$(H_PIECES:%=$(srcdir)/../%)
    3434
  • c/src/lib/libcpu/powerpc/mpc860/vectors/vectors.S

    r055c18b r3084de2  
    121121        .set    dev_vector,       0x1f00
    122122        .set    siu_vector,       0x2000
    123         .set    cpm_vector,       0x2600
     123        .set    cpm_vector,       0x2400
    124124
    125125/* Go to the right section */
  • cpukit/score/cpu/powerpc/rtems/score/cpu.h

    r055c18b r3084de2  
    475475  boolean      exceptions_in_RAM;     /* TRUE if in RAM */
    476476
    477 #if (defined(ppc403) || defined(mpc860))
     477#if (defined(ppc403) || defined(mpc860) || defined(mpc821))
    478478  unsigned32   serial_per_sec;         /* Serial clocks per second */
    479479  boolean      serial_external_clock;
     
    486486#endif
    487487
    488 #if (defined(mpc860))
     488#if (defined(mpc860) || defined(mpc821))
    489489  unsigned32   clock_speed;            /* Speed of CPU in Hz */
    490490#endif
Note: See TracChangeset for help on using the changeset viewer.