Changeset 090de1ad in rtems


Ignore:
Timestamp:
04/11/01 14:07:22 (22 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
3491e9e
Parents:
d96374f
Message:

2001-04-11 Eric Valette <valette@…>

  • Makefile.am, configure.in, console/console.c, include/Makefile.am, include/bsp.h, network/network.c, startup/Makefile.am, startup/bspstart.c, startup/linkcmds, wrapup/Makefile.am: Switch the eth_comm BSP to use the "new exception processing model."
Location:
c/src/lib/libbsp/powerpc/eth_comm
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/eth_comm/ChangeLog

    rd96374f r090de1ad  
     12001-04-11      Eric Valette <valette@crf.canon.fr>
     2
     3        * Makefile.am, configure.in, console/console.c,
     4        include/Makefile.am, include/bsp.h, network/network.c,
     5        startup/Makefile.am, startup/bspstart.c, startup/linkcmds,
     6        wrapup/Makefile.am: Switch the eth_comm BSP to use the
     7        "new exception processing model."
     8
    192000-11-09      Ralf Corsepius <corsepiu@faw.uni-ulm.de>
    210
  • c/src/lib/libbsp/powerpc/eth_comm/Makefile.am

    rd96374f r090de1ad  
    88# wrapup is the one that actually builds and installs the library
    99#  from the individual .rel files built in other directories
    10 SUBDIRS = include startup start canbus console network wrapup
     10SUBDIRS = clock include startup start canbus console irq network vectors wrapup
    1111
    1212include $(top_srcdir)/../../bsp.am
  • c/src/lib/libbsp/powerpc/eth_comm/configure.in

    rd96374f r090de1ad  
    2929AC_OUTPUT(
    3030Makefile
     31clock/Makefile
    3132canbus/Makefile
    3233console/Makefile
    3334include/Makefile
     35irq/Makefile
    3436network/Makefile
    3537start/Makefile
    3638startup/Makefile
     39vectors/Makefile
    3740wrapup/Makefile)
  • c/src/lib/libbsp/powerpc/eth_comm/console/console.c

    rd96374f r090de1ad  
    3131#include <rtems/libio.h>
    3232#include <termios.h>
     33#include <bspIo.h>
     34
     35static void _BSP_null_char( char c ) {return;}
     36BSP_output_char_function_type BSP_output_char = _BSP_null_char;
    3337
    3438rtems_device_driver console_initialize(rtems_device_major_number major,
     
    5963  m8xx_uart_scc_initialize(SCC4_MINOR); /* /dev/tty4    */
    6064 
    61   /*
    62    * Set up interrupts
    63    */
    64    m8xx_uart_interrupts_initialize();
    65 
    6665  /*
    6766   * Register the devices
     
    109108  case 0:
    110109    m8xx.smc1.smcm = 1;           /* Enable SMC1 RX interrupts */
    111     m8xx.cimr |= 1UL <<  4;       /* Enable SMC1 interrupts */
    112110    break;
    113111  case 1:
    114112    m8xx.smc2.smcm = 1;           /* Enable SMC2 RX interrupts */
    115     m8xx.cimr |= 1UL <<  3;       /* Enable SMC2 interrupts */
    116113    break;
    117114  case 2:
    118     m8xx.cimr |= 1UL << 30;      /* Enable SCC1 interrupts */
    119115    sccregs = &m8xx.scc1;
    120116    break;
    121117  case 3:
    122 #ifndef I_WANT_TERMIOS
    123     m8xx.cimr |= 1UL << 29;      /* Enable SCC2 interrupts */
    124 #endif /* I_WANT_TERMIOS */
    125118    sccregs = &m8xx.scc2;
    126119    break;
    127120  case 4:
    128     m8xx.cimr |= 1UL << 28;      /* Enable SCC3 interrupts */
    129121    sccregs = &m8xx.scc3;
    130122    break;
    131123  case 5:
    132     m8xx.cimr |= 1UL << 27;      /* Enable SCC4 interrupts */
    133124    sccregs = &m8xx.scc4;
    134125    break;
  • c/src/lib/libbsp/powerpc/eth_comm/include/Makefile.am

    rd96374f r090de1ad  
    77H_FILES = bsp.h coverhd.h canbus.h info.h
    88
     9BSP_H_FILES = commproc.h 8xx_immap.h
     10
    911$(PROJECT_INCLUDE):
     12        $(mkinstalldirs) $@
     13
     14$(PROJECT_INCLUDE)/bsp:
    1015        $(mkinstalldirs) $@
    1116
     
    2227        $(INSTALL_DATA) $< $@
    2328
    24 TMPINSTALL_FILES += $(PROJECT_INCLUDE) $(PROJECT_INCLUDE)/bsp.h \
    25     $(PROJECT_INCLUDE)/coverhd.h $(PROJECT_INCLUDE)/canbus.h \
    26     $(PROJECT_INCLUDE)/info.h
     29 $(PROJECT_INCLUDE)/bsp/commproc.h : commproc.h
     30        $(INSTALL_DATA) $< $@
    2731
    28 all-local: $(TMPINSTALL_FILES)
     32$(PROJECT_INCLUDE)/bsp/8xx_immap.h : 8xx_immap.h
     33        $(INSTALL_DATA) $< $@
     34
     35PREINSTALL_FILES += $(PROJECT_INCLUDE) $(PROJECT_INCLUDE)/bsp \
     36        $(PROJECT_INCLUDE)/bsp.h $(PROJECT_INCLUDE)/info.h \
     37        $(PROJECT_INCLUDE)/coverhd.h $(PROJECT_INCLUDE)/canbus.h \
     38        $(PROJECT_INCLUDE)/bsp/commproc.h $(PROJECT_INCLUDE)/bsp/8xx_immap.h
     39
     40all-local: $(PREINSTALL_FILES)
    2941
    3042EXTRA_DIST = bsp.h canbus.h coverhd.h info.h
  • c/src/lib/libbsp/powerpc/eth_comm/include/bsp.h

    rd96374f r090de1ad  
    8383#define RAM_START 0
    8484#define RAM_END   0x100000
    85 
     85#define IMAP_ADDR ((unsigned int)0xff000000)
     86#define IMAP_SIZE ((unsigned int)(16 * 1024))
    8687/* miscellaneous stuff assumed to exist */
    8788
  • c/src/lib/libbsp/powerpc/eth_comm/network/network.c

    rd96374f r090de1ad  
    3131#include <netinet/in.h>
    3232#include <netinet/if_ether.h>
     33#include <bsp/irq.h>
    3334
    3435/*
     
    4546#define TX_BUF_COUNT     8
    4647#define TX_BD_PER_BUF    4
     48
     49#define INET_ADDR_MAX_BUF_SIZE (sizeof "255.255.255.255")
    4750
    4851/*
     
    109112static struct m860_enet_struct enet_driver[NIFACES];
    110113
     114static void  m8xx_scc1_ethernet_on(const rtems_irq_connect_data* ptr)
     115{
     116  /*
     117   * Please put relevant code there
     118   */
     119}
     120
     121static void  m8xx_scc1_ethernet_off(const rtems_irq_connect_data* ptr)
     122{
     123  /*
     124   * Please put relevant code there
     125   */
     126}
     127
     128static void  m8xx_scc1_ethernet_isOn(const rtems_irq_connect_data* ptr)
     129{
     130  return BSP_irq_enabled_at_cpm (ptr->name);
     131}
     132
    111133/*
    112134 * SCC1 interrupt handler
    113135 */
    114 static rtems_isr
    115 m860_scc1_interrupt_handler (rtems_vector_number v)
     136static void m860_scc1_interrupt_handler ()
    116137{
    117138        /*
     
    140161                rtems_event_send (enet_driver[0].txDaemonTid, INTERRUPT_EVENT);
    141162        }
    142         m8xx.cisr = 1UL << 30;  /* Clear SCC1 interrupt-in-service bit */
    143163}
    144164
     
    146166 * FEC interrupt handler
    147167 */
    148 static rtems_isr
    149 m860_fec_interrupt_handler (rtems_vector_number v)
     168static void m860_fec_interrupt_handler ()
    150169{
    151170  /*
     
    167186  }
    168187}
     188static rtems_irq_connect_data ethernetSCC1IrqData = {
     189  BSP_CPM_IRQ_SCC1,
     190  (rtems_irq_hdl) m860_scc1_interrupt_handler,
     191  (rtems_irq_enable) m8xx_scc1_ethernet_on,
     192  (rtems_irq_disable) m8xx_scc1_ethernet_off,
     193  (rtems_irq_is_enabled)m8xx_scc1_ethernet_isOn
     194};
    169195
    170196/*
     
    335361   * Set up interrupts
    336362   */
    337   status = rtems_interrupt_catch (m860_scc1_interrupt_handler,
    338                                   PPC_IRQ_CPM_SCC1,
    339                                   &old_handler);
     363  status = BSP_install_rtems_irq_handler (&ethernetSCC1IrqData);
    340364  if (status != RTEMS_SUCCESSFUL) {
    341     rtems_panic ("Can't attach M860 SCC1 interrupt handler: %s\n",
     365    rtems_panic ("Can't attach M8xx SCC1 interrupt handler: %s\n",
    342366                 rtems_status_text (status));
    343367  }
    344368  m8xx.scc1.sccm = 0;     /* No interrupts unmasked till necessary */
    345   m8xx.cimr |= (1UL << 30);       /* Enable SCC1 interrupt */
    346369 
    347370  /*
     
    382405  m8xx.pcdir &= ~0x1;
    383406 
    384  
    385   /*
    386    * Set up interrupts
    387    * FIXME: DANGER: WARNING:
    388    * CICR and SIMASK must be set in any module that uses
    389    *   the CPM. Currently those are console-generic.c and
    390    *   network.c. If the registers are not set the same
    391    *   in both places, strange things may happen.
    392    *   If they are only set in one place, then an application
    393    *   that used the other module won't work correctly.
    394    *   Put this comment in each module that sets these 2 registers
    395    */
    396   m8xx.cicr = 0x00e43e80;   /* SCaP=SCC1, SCbP=SCC2, SCcP=SCC3,
    397                                SCdP=SCC4, IRL=1, HP=SCC1, IEN=1 */
    398   m8xx.simask |= M8xx_SIMASK_LVM1;
    399  
    400407  /*
    401408   * Enable receiver and transmitter
     
    403410  m8xx.scc1.gsmr_l = 0x1088003c;
    404411}
     412static void m8xx_fec_ethernet_on(){};
     413static void m8xx_fec_ethernet_off(){};
     414static int m8xx_fec_ethernet_isOn (const rtems_irq_connect_data* ptr)
     415{
     416  return BSP_irq_enabled_at_siu (ptr->name);
     417}
     418
     419static rtems_irq_connect_data ethernetFECIrqData = {
     420  BSP_FAST_ETHERNET_CTRL,
     421  (rtems_irq_hdl) m860_fec_interrupt_handler,
     422  (rtems_irq_enable) m8xx_fec_ethernet_on,
     423  (rtems_irq_disable) m8xx_fec_ethernet_off,
     424  (rtems_irq_is_enabled)m8xx_fec_ethernet_isOn
     425};
    405426
    406427static void
     
    438459   * 
    439460   */
    440   m8xx.fec.ivec = 0x02 << 29;
     461  m8xx.fec.ivec = ((((unsigned) BSP_FAST_ETHERNET_CTRL)/2) << 29);
    441462 
    442463  /*
     
    552573   * Set up interrupts
    553574   */
    554   status = rtems_interrupt_catch (m860_fec_interrupt_handler,
    555                                   PPC_IRQ_LVL2,
    556                                   &old_handler);
     575  status = BSP_install_rtems_irq_handler (&ethernetFECIrqData);
    557576  if (status != RTEMS_SUCCESSFUL)
    558577    rtems_panic ("Can't attach M860 FEC interrupt handler: %s\n",
    559578                 rtems_status_text (status));
    560 
    561   m8xx.simask |= M8xx_SIMASK_LVM2;
    562579
    563580}
  • c/src/lib/libbsp/powerpc/eth_comm/startup/Makefile.am

    rd96374f r090de1ad  
    1010
    1111C_FILES = bspclean.c bsplibc.c bsppost.c bspstart.c bootcard.c cpuinit.c \
    12     main.c mmutlbtab.c sbrk.c setvec.c gnatinstallhandler.c
     12    main.c mmutlbtab.c sbrk.c gnatinstallhandler.c
    1313C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o)
    1414
     
    3636.PRECIOUS: $(PGM)
    3737
    38 EXTRA_DIST = bspstart.c linkcmds setvec.c
     38EXTRA_DIST = bspstart.c linkcmds
    3939
    4040include $(top_srcdir)/../../../../../../automake/local.am
  • c/src/lib/libbsp/powerpc/eth_comm/startup/bspstart.c

    rd96374f r090de1ad  
    3232 */
    3333extern rtems_configuration_table Configuration;
    34 
     34extern unsigned long intrStackPtr;
    3535rtems_configuration_table  BSP_Configuration;
    3636
     
    4444void bsp_postdriver_hook(void);
    4545void bsp_libc_init( void *, unsigned32, int );
     46
     47void BSP_panic(char *s)
     48{
     49  printk("%s PANIC %s\n",_RTEMS_version, s);
     50  __asm__ __volatile ("sc");
     51}
     52
     53void _BSP_Fatal_error(unsigned int v)
     54{
     55  printk("%s PANIC ERROR %x\n",_RTEMS_version, v);
     56  __asm__ __volatile ("sc");
     57}
    4658
    4759/*
     
    100112  rtems_unsigned32  heap_start;
    101113  rtems_unsigned32  ws_start;
     114  ppc_cpu_id_t myCpu;
     115  ppc_cpu_revision_t myCpuRevision;
     116  register unsigned char* intrStack;
     117  register unsigned int intrNestingLevel = 0;
     118   
     119  /*
     120   * Get CPU identification dynamically. Note that the get_ppc_cpu_type() function
     121   * store the result in global variables so that it can be used latter...
     122   */
     123  myCpu         = get_ppc_cpu_type();
     124  myCpuRevision = get_ppc_cpu_revision();
    102125
    103126  cpu_init();
    104127  mmu_init();
    105  
     128  /*
     129   * Initialize some SPRG registers related to irq handling
     130   */
     131   
     132  intrStack = (((unsigned char*)&intrStackPtr) - CPU_MINIMUM_STACK_FRAME_SIZE);
     133  asm volatile ("mtspr  273, %0" : "=r" (intrStack) : "0" (intrStack));
     134  asm volatile ("mtspr  272, %0" : "=r" (intrNestingLevel) : "0" (intrNestingLevel));
     135 
     136   /*
     137    * Install our own set of exception vectors
     138    */
     139   initialize_exceptions();
     140 
    106141  /*
    107142   *  Allocate the memory for the RTEMS Work Space.  This can come from
     
    163198  m8xx.scc2p.tbase=0;
    164199  m8xx_cp_execute_cmd( M8xx_CR_OP_STOP_TX | M8xx_CR_CHAN_SCC2 );
    165 }
    166 
    167 
     200  /*
     201   * Initalize RTEMS IRQ system
     202   */
     203  BSP_rtems_irq_mng_init(0);
     204#ifdef SHOW_MORE_INIT_SETTINGS
     205  printk("Exit from bspstart\n");
     206#endif 
     207
     208}
     209
     210
  • c/src/lib/libbsp/powerpc/eth_comm/startup/linkcmds

    rd96374f r090de1ad  
    126126        text.size = text.end - text.start;
    127127        PROVIDE(_end = bss.end);
    128        
     128        /*
     129         * Interrupt stack setup
     130         */
     131
     132        IntrStack_start = ALIGN(0x10);
     133        . += 0x4000;
     134        intrStack = .;
     135        PROVIDE(intrStackPtr = intrStack);
     136       
    129137        dpram :
    130138        {
  • c/src/lib/libbsp/powerpc/eth_comm/wrapup/Makefile.am

    rd96374f r090de1ad  
    1010endif
    1111
    12 BSP_PIECES = startup start canbus console $(NETWORKING)
     12BSP_PIECES = clock irq startup start canbus vectors console $(NETWORKING)
    1313# pieces to pick up out of libcpu/ppc
    1414# CPU_PIECES = mpc860/clock mpc860/timer mpc860/console-generic \
     
    1818OBJS = $(foreach piece, $(BSP_PIECES), $(wildcard ../$(piece)/$(ARCH)/*.o)) \
    1919    $(wildcard ../../../../libcpu/$(RTEMS_CPU)/shared/*/$(ARCH)/*.o) \
    20     $(wildcard ../../../../libcpu/powerpc/old_exception_processing/$(ARCH)/*.rel) \
     20    $(wildcard ../../../../libcpu/powerpc/new_exception_processing/$(ARCH)/*.rel) \
    2121    $(wildcard ../../../../libcpu/$(RTEMS_CPU)/$(RTEMS_CPU_MODEL)/*/$(ARCH)/*.o)
    2222LIB = $(ARCH)/libbsp.a
Note: See TracChangeset for help on using the changeset viewer.