##############################################################################
#                                                                            #
# IAR ARM ANSI C/C++ Compiler V4.11A/W32               20/Jul/2004  18:58:48 #
# Copyright 1999-2004 IAR Systems. All rights reserved.                      #
#                                                                            #
#    Cpu mode        =  arm                                                  #
#    Endian          =  little                                               #
#    Stack alignment =  4                                                    #
#    Source file     =  C:\medusa\zarlink.c                                  #
#    Command line    =  -I "C:\Program Files\IAR Systems\Embedded Workbench  #
#                       4.0\ARM\INC\" -lc C:\medusa\Debug\List\ -la          #
#                       C:\medusa\Debug\List\ -o C:\medusa\Debug\Obj\ -s2    #
#                       --no_cse --no_unroll --no_inline --no_code_motion    #
#                       --no_tbaa --no_clustering --no_scheduling --debug    #
#                       --cpu_mode arm --endian little --cpu ARM7TDMI-S      #
#                       --stack_align 4 -e --fpu None                        #
#                       "-D_DLIB_CONFIG_FILE=C:\Program Files\IAR            #
#                       Systems\Embedded Workbench                           #
#                       4.0\ARM\LIB\dl4tpannl8n.h" C:\medusa\zarlink.c       #
#    List file       =  C:\medusa\Debug\List\zarlink.lst                     #
#    Object file     =  C:\medusa\Debug\Obj\zarlink.r79                      #
#                                                                            #
#                                                                            #
##############################################################################

C:\medusa\zarlink.c
      1          #include "archinc.h"
      2          #include "zarlink.h"
      3          
      4          #ifdef CONFIG_INCLUDE_ZARLINK
      5          
      6          static unsigned char initialMacAddr[6] = {0x00, 0x00, 0x01, 0x6a, 0x0c, 0x00};
      7          
      8          static void initSwitch(void)
      9          {
     10            lpc210x_reg dummy;
     11            int i;
     12          
     13            // magic write to keep switch from resetting if TSTOUT12 is high
     14            zarlinkIndexedWrite(0xe10, 0x07);
     15          
     16            // set one microsecond divider to 50 for 50MHz clock
     17            zarlinkIndexedWrite(0x609, 0x50);
     18          
     19            // reset all ports
     20            for(i=0;i<6;i++) {
     21              zarlinkIndexedWrite((0x81+(2*i)), 0x98);
     22              }
     23          
     24            // read an RTC register for some delay
     25            for(i=0;i<10;i++)
     26              dummy = CTIME0;
     27          
     28            // enable all ports
     29            for(i=0;i<6;i++) {
     30              zarlinkIndexedWrite((0x81+(2*i)), 0x18);
     31              }
     32          
     33            // enable receive of runt packets (<64b)
     34            for(i=0;i<6;i++) {
     35              zarlinkIndexedWrite((0x80+(2*i)), 0x01);
     36              }
     37          
     38            // force all fiber ports to 100BaseT, FDX
     39            for(i=0;i<4;i++) {
     40              zarlinkIndexedWrite((2*i), 0xd8);
     41              }
     42          
     43            // enable statistics engine
     44            zarlinkIndexedWrite(0x602, 0x11);
     45          
     46            // set a default mac address
     47            zarlinkCpuMacAddrSet(initialMacAddr);
     48          
     49            // tell the switch to start
     50            zarlinkIndexedWrite(0xf00, 0x10);
     51          }
     52          
     53          int zarlinkInit(void)
     54          {
     55            lpc210x_reg iodirMask;
     56          
     57            iodirMask = IODIR;
     58          
     59            // setup IODIR for SSI interface
     60            // iodirMask &= 0xFCFFFBFF;
     61            // wr_n=output, rd_n=input, cs_n=output, addr[2:0]=output, input, input
     62            // data[7:0]=input
     63          
     64            // setup IODIR for 8-bit bus interface: data[7:0]=input, addr[2:0]=output, 
     65            //   wr_n, rd_n, cs_n=output
     66            iodirMask |= 0x03000700;
     67          
     68            // in any case, make data[7:0] inputs
     69            iodirMask &= 0xff00ffff;
     70          
     71            IODIR = iodirMask;
     72          
     73            initSwitch();
     74          
     75            return 0;
     76          }
     77          
     78          #endif /* CONFIG_INCLUDE_ZARLINK */
     79          

   Maximum stack usage in bytes:

     Function    CSTACK
     --------    ------
     initSwitch     12
     zarlinkInit     8


   Segment part sizes:

     Function/Label                 Bytes
     --------------                 -----
     initialMacAddr                    8
     initSwitch                      344
     zarlinkInit                      88
     ?<Initializer for initialMacAddr>
                                       8
      Others                          36

 
 456 bytes in segment CODE
   8 bytes in segment DATA_I
   8 bytes in segment DATA_ID
  12 bytes in segment INITTAB
 
 432 bytes of CODE  memory (+ 36 bytes shared)
   8 bytes of CONST memory
   8 bytes of DATA  memory

Errors: none
Warnings: none
