Changeset 98bcbda3 in rtems


Ignore:
Timestamp:
03/23/98 18:35:41 (26 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
5839b0c1
Parents:
61bbe543
Message:

Patches from Eric Norum:

Here are some patches to the gen68360 BSP. The improvements include:

Boot prom run-time selection of DRAM size (1/4/16 Mbytes)
Full 32-bit ethernet address obtained from boot prom.
Updated README.

Location:
c/src/lib/libbsp/m68k/gen68360
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/m68k/gen68360/README

    r61bbe543 r98bcbda3  
    44
    55#
    6 # This package works best with a version of GCC that has been modified
    7 # to support the `-mcpu32' argument.  I have submitted the required
    8 # changes to the GCC maintainers.
    9 #
    10 
    11 #
    12 #  As of 1998/01/22, no gcc version (gcc 2.8.0 and egcs 1.0 are current)
    13 #  includes proper multilib support for the 68360.  This is basically
    14 #  a m68020 without bitfields from gcc's perspective and there is
    15 #  no multilib entry which corresponds to this.  See the tool build
    16 #  INSTRUCTIONS for information on how to address this.
     6# This package requires a version of GCC that supports the `-mcpu32' option.
    177#
    188
     
    3121# This board support package works with several different versions of
    3222# MC68360 systems.  The choice of hardware is made at the final link-edit
    33 # phase by setting the Makefile LDFLAGS definition appropriately.
     23# phase by setting the Makefile CLAGS_LD definition appropriately.
    3424#
    3525# Decisions made at compile time include:
     
    4333#
    4434# Decisions to be made a link-edit time are:
    45 #       - The amount of dynamic RAM in the system.  This value applies
    46 #         only to hardware versions which support different sizes of RAM.
    47 #         The default value is 4 Mbytes.  To specify 16 Mbytes of memory,
    48 #               --defsym RamSize=0x1000000
    49 #
    5035#     - The size of the memory allocator heap.  The default value is
    5136#       64 kbytes.  If the KA9Q network package is used the heap
     
    5338#       busy, the heap should be even larger.
    5439#       To choose a heap size of 256 kbytes,
    55 #             --defsym HeapSize=0x40000
    56 #         
    57 #       - The Ethernet address for network boot proms.
     40#       CFLAGS_LD += -Wl,--defsym -Wl,HeapSize=0x40000
    5841
    5942BSP NAME:           gen68360 or gen68360_040
     
    10487bus width:      8-bit PROM, 32-bit DRAM
    10588ROM:            To 1 MByte, 180 nsec (3 wait states), chip select 0
    106 RAM:            1 to 64 MByte DRAM SIMM, 60 nsec (0 wait states), parity or nonparity
     89RAM:            1 to 16 MByte DRAM SIMM, 60 nsec (0 wait states), parity or nonparity
    10790
    10891Host System
    10992-----------
    110 NEXTSTEP 3.3 (Intel and Motorola), Solaris 2.5
    111 gcc-2.7.2
    112 binutils-2.6
     93OPENSTEP 4.2 (Intel and Motorola), Solaris 2.5, Linux 2.0.29
    11394
    11495Verification (Standalone 68360)
  • c/src/lib/libbsp/m68k/gen68360/include/bsp.h

    r61bbe543 r98bcbda3  
    125125 * Values assigned by link editor
    126126 */
    127 extern void *_RomBase, *_RamBase, *_RamSize;
     127extern void *_RomBase, *_RamBase;
    128128
    129129/*
  • c/src/lib/libbsp/m68k/gen68360/network/network.c

    r61bbe543 r98bcbda3  
    818818                                 * reset exception handler.  The following
    819819                                 * 4 bytes contain the value loaded into the
    820                                  * program counter.  The low order three
    821                                  * octets of the boards' Ethernet address are
    822                                  * stored in the three bytes immediately
    823                                  * preceding this initial program counter value.
     820                                 * program counter.  The boards' Ethernet
     821                                 * address is stored in the six bytes
     822                                 * immediately preceding this initial
     823                                 * program counter value.
    824824                                 *
    825                                  * See startup/linkcmds and start360/start360.s
    826                                  * for details on how this is done.
    827                                  *
    828                                  * The high order three octets of the Ethernet
    829                                  * address are fixed and indicate that the
    830                                  * address is that of a Motorola device.
     825                                 * See start360/start360.s.
    831826                                 */
    832827                                extern void *_RomBase;  /* From linkcmds */
    833828                                const unsigned long *ExceptionVectors;
    834829                                const unsigned char *entryPoint;
    835 
    836                                 /*
    837                                  * Set up the fixed portion of the address
    838                                  */
    839                                 iface->hwaddr[0] = 0x08;
    840                                 iface->hwaddr[1] = 0x00;
    841                                 iface->hwaddr[2] = 0x3e;
    842830
    843831                                /*
     
    850838                                                        >= (1 * 1024 * 1024)) {
    851839                                        printf ("Warning -- Ethernet address can not be found in bootstrap PROM.\n");
     840                                        iface->hwaddr[0] = 0x08;
     841                                        iface->hwaddr[1] = 0xF3;
     842                                        iface->hwaddr[2] = 0x3E;
    852843                                        iface->hwaddr[3] = 0xC2;
    853844                                        iface->hwaddr[4] = 0xE7;
     
    855846                                }
    856847                                else {
    857                                         iface->hwaddr[3] = entryPoint[-3];
    858                                         iface->hwaddr[4] = entryPoint[-2];
    859                                         iface->hwaddr[5] = entryPoint[-1];
     848                                        memcpy (iface->hwaddr, entryPoint - 6, 6);
    860849                                }
    861850                        }
  • c/src/lib/libbsp/m68k/gen68360/start/start360.s

    r61bbe543 r98bcbda3  
    309309/*
    310310 * Place the low-order 3 octets of the board's ethernet address at
    311  * a `well-known' fixed location relative to the beginning of ROM.
     311 * a `well-known' fixed location relative to the startup location.
    312312 */
    313313        .align 2
    314         .long   ETHERNET_ADDRESS        | Low-order 3 octets of ethernet address
    315 
    316 /*
    317  *  For some reason, the symbol start must not be global.
    318  *
    319  *       .global start
    320  */
     314        .word   0                       | Padding
     315ethernet_address_buffer:
     316        .word   0x08F3                  | Default address
     317        .word   0xDEAD
     318        .word   0xCAFE
    321319
    322320/*
  • c/src/lib/libbsp/m68k/gen68360/start360/start360.s

    r61bbe543 r98bcbda3  
    309309/*
    310310 * Place the low-order 3 octets of the board's ethernet address at
    311  * a `well-known' fixed location relative to the beginning of ROM.
     311 * a `well-known' fixed location relative to the startup location.
    312312 */
    313313        .align 2
    314         .long   ETHERNET_ADDRESS        | Low-order 3 octets of ethernet address
    315 
    316 /*
    317  *  For some reason, the symbol start must not be global.
    318  *
    319  *       .global start
    320  */
     314        .word   0                       | Padding
     315ethernet_address_buffer:
     316        .word   0x08F3                  | Default address
     317        .word   0xDEAD
     318        .word   0xCAFE
    321319
    322320/*
  • c/src/lib/libbsp/m68k/gen68360/startup/init68360.c

    r61bbe543 r98bcbda3  
    3939        extern void _CopyDataClearBSSAndStart (void);
    4040
    41 #if (defined (m68040) || defined (m68lc040) || defined (m68ec040))
     41#if (defined (__mc68040__))
    4242        /*
    4343         *******************************************
     
    408408        /*
    409409         * Step 11: Remap Chip Select 0 (CS0*), set up GMR
    410          */
    411         /*
    412          * 1024/2048/4096 addresses per DRAM page (1M/4M/16M DRAM chips)
    413          * 60 nsec DRAM
    414          * 180 nsec ROM (3 wait states)
    415          */
    416         switch ((unsigned long)&_RamSize) {
    417         default:
    418         case 4*1024*1024:
    419                 m360.gmr = M360_GMR_RCNT(23) | M360_GMR_RFEN |
    420                                         M360_GMR_RCYC(0) | M360_GMR_PGS(3) |
     410         *      32-bit DRAM
     411         *      Internal DRAM address multiplexing
     412         *      60 nsec DRAM
     413         *      180 nsec ROM (3 wait states)
     414         *      15.36 usec DRAM refresh interval
     415         *      The DRAM page size selection is not modified since this
     416         *      startup code may be running in a bootstrap PROM or in
     417         *      a program downloaded by the bootstrap PROM.
     418         */
     419        m360.gmr = (m360.gmr & 0x001C0000) | M360_GMR_RCNT(23) |
     420                                        M360_GMR_RFEN | M360_GMR_RCYC(0) |
    421421                                        M360_GMR_DPS_32BIT | M360_GMR_NCS |
    422422                                        M360_GMR_GAMX;
    423                 break;
    424 
    425         case 16*1024*1024:
    426                 m360.gmr = M360_GMR_RCNT(23) | M360_GMR_RFEN |
    427                                         M360_GMR_RCYC(0) | M360_GMR_PGS(5) |
    428                                         M360_GMR_DPS_32BIT | M360_GMR_NCS |
    429                                         M360_GMR_GAMX;
    430                 break;
    431 
    432         case 64*1024*1024:
    433                 m360.gmr = M360_GMR_RCNT(23) | M360_GMR_RFEN |
    434                                         M360_GMR_RCYC(0) | M360_GMR_PGS(7) |
    435                                         M360_GMR_DPS_32BIT | M360_GMR_NCS |
    436                                         M360_GMR_GAMX;
    437                 break;
    438         }
    439423        m360.memc[0].br = (unsigned long)&_RomBase | M360_MEMC_BR_WP |
    440424                                                                M360_MEMC_BR_V;
     
    444428        /*
    445429         * Step 12: Initialize the system RAM
    446          */
    447         /*
    448          *      Set up option/base registers
    449          *              4M/16M/64M DRAM
    450          *              60 nsec DRAM
    451          *      Wait for chips to power up
    452          *      Perform 8 read cycles
    453          *      Set all parity bits to correct state
    454          *      Enable parity checking
    455          */
    456         switch ((unsigned long)&_RamSize) {
    457         default:
    458         case 4*1024*1024:
     430         * Do this only if the DRAM has not already been set up
     431         */
     432        if ((m360.memc[1].br & M360_MEMC_BR_V) == 0) {
     433                /*
     434                 * Set up GMR DRAM page size, option and  base registers
     435                 *      Assume 16Mbytes of DRAM
     436                 *      60 nsec DRAM
     437                 */
     438                m360.gmr = (m360.gmr & ~0x001C0000) | M360_GMR_PGS(5);
    459439                m360.memc[1].or = M360_MEMC_OR_TCYC(0) |
    460                                         M360_MEMC_OR_4MB |
    461                                         M360_MEMC_OR_DRAM;
    462                 break;
    463 
    464         case 16*1024*1024:
    465                 m360.memc[1].or = M360_MEMC_OR_TCYC(0) |
    466                                         M360_MEMC_OR_16MB |
    467                                         M360_MEMC_OR_DRAM;
    468                 break;
    469 
    470         case 64*1024*1024:
    471                 m360.memc[1].or = M360_MEMC_OR_TCYC(0) |
    472                                         M360_MEMC_OR_64MB |
    473                                         M360_MEMC_OR_DRAM;
    474                 break;
     440                                                M360_MEMC_OR_16MB |
     441                                                M360_MEMC_OR_DRAM;
     442                m360.memc[1].br = (unsigned long)&_RamBase | M360_MEMC_BR_V;
     443
     444                /*
     445                 * Wait for chips to power up
     446                 *      Perform 8 read cycles
     447                 */
     448                for (i = 0; i < 50000; i++)
     449                        continue;
     450                for (i = 0; i < 8; ++i)
     451                        *((volatile unsigned long *)(unsigned long)&_RamBase);
     452
     453                /*
     454                 * Determine memory size (1, 4, or 16 Mbytes)
     455                 * Set GMR DRAM page size appropriately.
     456                 * The OR is left at 16 Mbytes.  The bootstrap PROM places its
     457                 * .data and .bss segments at the top of the 16 Mbyte space.
     458                 * A 1 Mbyte or 4 Mbyte DRAM will show up several times in
     459                 * the memory map, but will work with the same bootstrap PROM.
     460                 */
     461                *(volatile char *)&_RamBase = 0;
     462                *((volatile char *)&_RamBase+0x00C01800) = 1;
     463                if (*(volatile char *)&_RamBase) {
     464                        m360.gmr = (m360.gmr & ~0x001C0000) | M360_GMR_PGS(1);
     465                }
     466                else {
     467                        *((volatile char *)&_RamBase+0x00801000) = 1;
     468                        if (*(volatile char *)&_RamBase) {
     469                                m360.gmr = (m360.gmr & ~0x001C0000) | M360_GMR_PGS(3);
     470                        }
     471                }
     472
     473                /*
     474                 * Enable parity checking
     475                 */
     476                m360.memc[1].br |= M360_MEMC_BR_PAREN;
    475477        }
    476         m360.memc[1].br = (unsigned long)&_RamBase | M360_MEMC_BR_V;
    477         for (i = 0; i < 50000; i++)
    478                 continue;
    479         for (i = 0; i < 8; ++i)
    480                 *((volatile unsigned long *)(unsigned long)&_RamBase);
    481         for (i = 0 ; i < (unsigned long)&_RamSize ; i += sizeof (unsigned long)) {
    482                 volatile unsigned long *lp;
    483                 lp = (unsigned long *)((unsigned char *)&_RamBase + i);
    484                 *lp = *lp;
    485         }
    486         m360.memc[1].br = (unsigned long)&_RamBase |
    487                                 M360_MEMC_BR_PAREN | M360_MEMC_BR_V;
    488478
    489479        /*
  • c/src/lib/libbsp/m68k/gen68360/startup/linkcmds

    r61bbe543 r98bcbda3  
    1818 *      the lines marked XXX below to use a constant value.
    1919 */
    20 RamSize = DEFINED(RamSize) ? RamSize : 4M;
    2120HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
    2221StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
     
    2423/*
    2524 * Declare on-board memory.
    26  * It would be nice if the ram length could be given as
    27  * LENGTH=RamSize, but gld doesn't allow non-constant
    28  * values in the LENGTH expression. 
    2925 */
    3026MEMORY {
     
    3531
    3632/*
    37  * Declare low-order three octets of Ethernet address.
    38  */
    39 ETHERNET_ADDRESS = DEFINED(ETHERNET_ADDRESS) ? ETHERNET_ADDRESS : 0xDEAD12;
    40 
    41 /*
    4233 * Load objects
    4334 */
    4435SECTIONS {
    45         /*
    46          * Hardware variations
    47          */
    48         _RamSize = RamSize;
    49         __RamSize = RamSize;
    50 
    5136        /*
    5237         * Boot PROM
  • c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.bootp

    r61bbe543 r98bcbda3  
    2222 *      the lines marked XXX below to use a constant value.
    2323 */
    24 RamSize = DEFINED(RamSize) ? RamSize : 4M;
    2524HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
    2625StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
     
    2827/*
    2928 * Declare on-board memory.
    30  * It would be nice if the ram length could be given as
    31  * LENGTH=RamSize, but gld doesn't allow non-constant
    32  * values in the LENGTH expression. 
    3329 */
    3430MEMORY {
     
    4036
    4137/*
    42  * Declare low-order three octets of Ethernet address.
    43  */
    44 ETHERNET_ADDRESS = DEFINED(ETHERNET_ADDRESS) ? ETHERNET_ADDRESS : 0xDEAD12;
    45 
    46 /*
    4738 * Load objects
    4839 */
    4940SECTIONS {
    50         /*
    51          * Hardware variations
    52          */
    53         _RamSize = RamSize;
    54         __RamSize = RamSize;
    55 
    5641        /*
    5742         * Boot PROM
  • c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.prom

    r61bbe543 r98bcbda3  
    2929 *      the lines marked XXX below to use a constant value.
    3030 */
    31 RamSize = DEFINED(RamSize) ? RamSize : 4M;
    3231HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
    3332StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
     
    3534/*
    3635 * Declare on-board memory.
    37  * It would be nice if the ram length could be given as
    38  * LENGTH=RamSize, but gld doesn't allow non-constant
    39  * values in the LENGTH expression. 
    4036 */
    4137MEMORY {
     
    4642
    4743/*
    48  * Declare low-order three octets of Ethernet address.
    49  */
    50 ETHERNET_ADDRESS = DEFINED(ETHERNET_ADDRESS) ? ETHERNET_ADDRESS : 0xDEAD12;
    51 
    52 /*
    5344 * Load objects
    5445 */
    5546SECTIONS {
    56         /*
    57          * Hardware variations
    58          */
    59         _RamSize = RamSize;
    60         __RamSize = RamSize;
    61 
    6247        /*
    6348         * Boot PROM
Note: See TracChangeset for help on using the changeset viewer.