Changeset d8b2e89 in rtems


Ignore:
Timestamp:
Sep 3, 2008, 3:40:46 PM (11 years ago)
Author:
Thomas Doerfler <Thomas.Doerfler@…>
Branches:
4.10, 4.11, 4.9, master
Children:
6c45275a
Parents:
6f776e71
Message:

update to current PPC exception and memory map structure

Location:
c/src/lib/libbsp/powerpc/gen5200
Files:
4 added
5 deleted
5 edited
1 moved

Legend:

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

    r6f776e71 rd8b2e89  
     12008-09-03      Sebastian Huber <sebastian.huber@embedded-brains.de>
     2
     3        * irq/irq.h, irq/irq_asm.h, irq/irq_init.c, vectors/vectors.S,
     4        vectors/vectors.h, vectors/vectors_init.c: Removed files.
     5
     6        * include/irq-config.h, include/irq.h, include/mscan-base.h,
     7        mscan/mscan-base.c, startup/linkcmds.base: New files.
     8
     9        * mscan/mscan.c, mscan/mscan_int.h: Moved general MSCAN functions into
     10        separate header and source files (include/mscan-base.h and
     11        mscan/mscan-base.c).  Formatted code.
     12
     13        * bestcomm/bestcomm_glue.c, bestcomm/load_task.c, clock/clock.c,
     14        console/console.c, i2c/mpc5200mbus.c, ide/idecfg.c, ide/pcmcia_ide.c,
     15        include/bsp.h, irq/irq.c, network_5200/network.c,
     16        slicetimer/slicetimer.c, start/start.S, startup/bspclean.c,
     17        startup/bspstart.c, startup/cpuinit.c: Converted to use shared
     18        exception and interrupt code.
     19
     20        * startup/linkcmds, startup/linkcmds.brs5l, startup/linkcmds.icecube,
     21        startup/linkcmds.pm520: Changed to include new file
     22        startup/linkcmds.base.  Supports small data area now.
     23
     24        * configure.ac, Makefile.am, bsp_specs, preinstall.am: Update.
     25
    1262008-08-25      Sebastian Huber <sebastian.huber@embedded-brains.de>
    227
  • c/src/lib/libbsp/powerpc/gen5200/Makefile.am

    r6f776e71 rd8b2e89  
    88include $(top_srcdir)/../../bsp.am
    99
     10libcpudir = ../../../libcpu/@RTEMS_CPU@
     11
    1012dist_project_lib_DATA = bsp_specs
    1113
    1214include_HEADERS = include/bsp.h include/i2cdrv.h include/u-boot.h \
    13     include/i2c.h include/mpc5200.h
     15    include/i2c.h
    1416include_HEADERS += include/tm27.h
    1517
     
    3537project_lib_DATA += rtems_crti.$(OBJEXT)
    3638
    37 dist_project_lib_DATA += startup/linkcmds
    38 dist_project_lib_DATA += startup/linkcmds.brs5l
    39 dist_project_lib_DATA += startup/linkcmds.icecube
    40 dist_project_lib_DATA += startup/linkcmds.pm520
     39dist_project_lib_DATA += startup/linkcmds \
     40        startup/linkcmds.base \
     41        startup/linkcmds.brs5l \
     42        startup/linkcmds.icecube \
     43        startup/linkcmds.pm520
    4144
    4245noinst_PROGRAMS += bestcomm.rel
     
    6669ide_SOURCES = ide/idecfg.c ide/pcmcia_ide.c ide/pcmcia_ide.h
    6770
    68 include_bsp_HEADERS = irq/irq.h include/i2cdrv.h include/mpc5200.h \
    69     include/i2c.h include/u-boot.h
    70 irq_SOURCES = irq/irq.c irq/irq_init.c irq/irq.h irq/irq_asm.S
    71 mscan_SOURCES = mscan/mscan.c mscan/mscan.h mscan/mscan_int.h
     71include_bsp_HEADERS = $(libcpudir)/new-exceptions/bspsupport/vectors.h \
     72        $(libcpudir)/new-exceptions/bspsupport/ppc_exc_bspsupp.h \
     73        ../../shared/include/irq-generic.h \
     74        include/irq-config.h \
     75        include/irq.h \
     76        include/i2cdrv.h \
     77        include/i2c.h \
     78        include/mpc5200.h \
     79        include/mscan-base.h \
     80        include/u-boot.h \
     81        mscan/mscan.h
     82
     83irq_SOURCES = include/irq.h \
     84        include/irq-config.h \
     85        irq/irq.c \
     86        ../../shared/src/irq-generic.c \
     87        ../../shared/src/irq-legacy.c
     88
     89mscan_SOURCES = mscan/mscan.c mscan/mscan-base.c mscan/mscan.h mscan/mscan_int.h
    7290
    7391include_bsp_HEADERS += nvram/nvram.h
     
    8098    ../../shared/tod.c
    8199
    82 include_bsp_HEADERS += vectors/vectors.h
    83 
    84 startup_SOURCES = startup/bspclean.c ../../shared/bsplibc.c \
    85     ../../shared/bsppost.c startup/bspstart.c ../../shared/bootcard.c \
    86     ../../shared/sbrk.c ../shared/uboot_dump_bdinfo.c \
    87     ../../shared/gnatinstallhandler.c startup/cpuinit.c  \
    88     ../shared/showbats.c startup/uboot_support.c ../shared/uboot_getenv.c
    89 
    90 vectors_SOURCES = vectors/vectors_init.c vectors/vectors.h \
    91     vectors/vectors.S
     100startup_SOURCES = ../../shared/bootcard.c \
     101        ../../shared/bsplibc.c \
     102        ../../shared/bsppost.c \
     103        ../../shared/bsppretaskinghook.c \
     104        ../../shared/gnatinstallhandler.c \
     105        ../../shared/sbrk.c \
     106        ../shared/showbats.c \
     107        ../shared/uboot_dump_bdinfo.c \
     108        ../shared/uboot_getenv.c \
     109        startup/bspclean.c \
     110        startup/bspstart.c \
     111        startup/cpuinit.c  \
     112        startup/uboot_support.c
    92113
    93114if HAS_NETWORKING
     
    103124libbsp_a_SOURCES = $(clock_SOURCES) $(console_SOURCES) $(i2c_SOURCES) \
    104125    $(ide_SOURCES) $(irq_SOURCES) $(mscan_SOURCES) $(nvram_SOURCES) \
    105     $(slicetimer_SOURCES) $(tod_SOURCES) $(startup_SOURCES) \
    106     $(vectors_SOURCES)
     126    $(slicetimer_SOURCES) $(tod_SOURCES) $(startup_SOURCES)
    107127
    108 libbsp_a_LIBADD = \
    109     bestcomm.rel \
    110     ../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \
    111     ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
    112     ../../../libcpu/@RTEMS_CPU@/shared/stack.rel \
    113     ../../../libcpu/@RTEMS_CPU@/@exceptions@/rtems-cpu.rel \
    114     ../../../libcpu/@RTEMS_CPU@/mpc6xx/mmu.rel \
    115     ../../../libcpu/@RTEMS_CPU@/mpc6xx/timer.rel \
    116     ../../../libcpu/@RTEMS_CPU@/@exceptions@/raw_exception.rel
     128libbsp_a_LIBADD =  $(libcpudir)/shared/cpuIdent.rel \
     129        $(libcpudir)/shared/cache.rel \
     130        $(libcpudir)/shared/stack.rel \
     131        $(libcpudir)/@exceptions@/rtems-cpu.rel \
     132        $(libcpudir)/@exceptions@/raw_exception.rel \
     133        $(libcpudir)/@exceptions@/exc_bspsupport.rel \
     134        $(libcpudir)/mpc6xx/mmu.rel \
     135        $(libcpudir)/mpc6xx/timer.rel \
     136        bestcomm.rel
    117137
    118138if HAS_NETWORKING
  • c/src/lib/libbsp/powerpc/gen5200/bsp_specs

    r6f776e71 rd8b2e89  
    1212
    1313*link:
    14 %{!qrtems: %(old_link)} %{qrtems: -dc -dp -u __vectors -N -u start -e start}
     14%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -u start -e start}
  • c/src/lib/libbsp/powerpc/gen5200/configure.ac

    r6f776e71 rd8b2e89  
    4040AC_CONFIG_FILES([Makefile])
    4141
     42RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION
     43
    4244RTEMS_PPC_EXCEPTIONS
    4345
  • c/src/lib/libbsp/powerpc/gen5200/include/irq.h

    r6f776e71 rd8b2e89  
    8585/***********************************************************************/
    8686
    87 #ifndef LIBBSP_POWERPC_MPC5200_IRQ_IRQ_H
    88 #define LIBBSP_POWERPC_MPC5200_IRQ_IRQ_H
     87#ifndef LIBBSP_POWERPC_GEN5200_IRQ_H
     88#define LIBBSP_POWERPC_GEN5200_IRQ_H
    8989
    9090#define CHK_CE_SHADOW(_pmce)    ((_pmce) & 0x00000001)
     
    142142#ifndef ASM
    143143
    144 /*
    145 extern volatile unsigned int ppc_cached_irq_mask;
    146 */
     144#include <rtems.h>
     145#include <rtems/irq.h>
     146#include <rtems/irq-extension.h>
    147147
    148148/*
     
    205205
    206206#define BSP_CRIT_IRQ_PRIO_LEVELS                          4
    207 /*#define BSP_PERIODIC_TIMER                  BSP_DECREMENTER*/
    208207#define BSP_PERIODIC_TIMER                    BSP_SIU_IRQ_TMR6
    209 /*#define CPM_INTERRUPT*/
    210 
    211 
    212 /*
    213  * Type definition for RTEMS managed interrupts
    214  */
    215 typedef unsigned char  rtems_irq_prio;
    216 struct  __rtems_irq_connect_data__;     /* forward declaratiuon */
    217 
    218 typedef unsigned int rtems_irq_number;
    219 typedef void *rtems_irq_hdl_param;
    220 typedef void (*rtems_irq_hdl)(rtems_irq_hdl_param);
    221 typedef void (*rtems_irq_enable)(const struct __rtems_irq_connect_data__*);
    222 typedef void (*rtems_irq_disable)(const struct __rtems_irq_connect_data__*);
    223 typedef int  (*rtems_irq_is_enabled)(const struct __rtems_irq_connect_data__*);
    224 
    225 typedef struct __rtems_irq_connect_data__ {
    226   /*
    227    * IRQ line
    228    */
    229   rtems_irq_number              name;
    230   /*
    231    * handler. See comment on handler properties below in function prototype.
    232    */
    233   rtems_irq_hdl                 hdl;
    234   /*
    235    * Handler handle to store private data
    236    */
    237   rtems_irq_hdl_param           handle;
    238   /*
    239    * function for enabling interrupts at device level (ONLY!).
    240    * The BSP code will automatically enable it at i8259s level.
    241    * RATIONALE : anyway such code has to exist in current driver code.
    242    * It is usually called immediately AFTER connecting the interrupt handler.
    243    * RTEMS may well need such a function when restoring normal interrupt
    244    * processing after a debug session.
    245    *
    246    */
    247   rtems_irq_enable            on;
    248   /*
    249    * function for disabling interrupts at device level (ONLY!).
    250    * The code will disable it at i8259s level. RATIONALE : anyway
    251    * such code has to exist for clean shutdown. It is usually called
    252    * BEFORE disconnecting the interrupt. RTEMS may well need such
    253    * a function when disabling normal interrupt processing for
    254    * a debug session. May well be a NOP function.
    255    */
    256   rtems_irq_disable             off;
    257   /*
    258    * function enabling to know what interrupt may currently occur
    259    * if someone manipulates the i8259s interrupt mask without care...
    260    */
    261   rtems_irq_is_enabled        isOn;
    262 
    263 #ifdef BSP_SHARED_HANDLER_SUPPORT
    264   /*
    265    *  Set to -1 for vectors forced to have only 1 handler
    266    */
    267   void *next_handler;
     208
    268209#endif
    269210
    270 } rtems_irq_connect_data;
    271 
    272 typedef struct {
    273   /*
    274    * size of all the table fields (*Tbl) described below.
    275    */
    276   unsigned int                  irqNb;
    277   /*
    278    * Default handler used when disconnecting interrupts.
    279    */
    280   rtems_irq_connect_data        defaultEntry;
    281   /*
    282    * Table containing initials/current value.
    283    */
    284   rtems_irq_connect_data*       irqHdlTbl;
    285   /*
    286    * actual value of BSP_PER_IRQ_LOWEST_OFFSET...
    287    */
    288   rtems_irq_symbolic_name       irqBase;
    289   /*
    290    * software priorities associated with interrupts.
    291    * if irqPrio  [i]  >  intrPrio  [j]  it  means  that
    292    * interrupt handler hdl connected for interrupt name i
    293    * will  not be interrupted by the handler connected for interrupt j
    294    * The interrupt source  will be physically masked at i8259 level.
    295    */
    296     rtems_irq_prio*             irqPrioTbl;
    297 } rtems_irq_global_settings;
    298 
    299 
    300 
    301 /*-------------------------------------------------------------------------+
    302 | Function Prototypes.
    303 +--------------------------------------------------------------------------*/
    304 /*
    305  * ------------------------ PPC CPM Mngt Routines -------
    306  */
    307 
    308 /*
    309  * function to disable a particular irq. After calling
    310  * this function, even if the device asserts the interrupt line it will
    311  * not be propagated further to the processor
    312  */
    313 int BSP_irq_disable_at_siu(const rtems_irq_symbolic_name irqLine);
    314 /*
    315  * function to enable a particular irq. After calling
    316  * this function, if the device asserts the interrupt line it will
    317  * be propagated further to the processor
    318  */
    319 int BSP_irq_enable_at_siu(const rtems_irq_symbolic_name irqLine);
    320 /*
    321  * function to acknowledge a particular irq. After calling
    322  * this function, if a device asserts an enabled interrupt line it will
    323  * be propagated further to the processor. Mainly useful for people
    324  * writing raw handlers as this is automagically done for rtems managed
    325  * handlers.
    326  */
    327 int BSP_irq_ack_at_siu(const rtems_irq_symbolic_name irqLine);
    328 /*
    329  * function to check ifl d  a particular irq is enabled. After calling
    330  */
    331 int BSP_irq_enabled_at_siu(const rtems_irq_symbolic_name irqLine);
    332 
    333 
    334 
    335 /*
    336  * ------------------------ RTEMS Single Irq Handler Mngt Routines ----------------
    337  */
    338 /*
    339  * function to connect a particular irq handler. This hanlder will NOT be called
    340  * directly as the result of the corresponding interrupt. Instead, a RTEMS
    341  * irq prologue will be called that will :
    342  *
    343  *      1) save the C scratch registers,
    344  *      2) switch to a interrupt stack if the interrupt is not nested,
    345  *      4) modify them to disable the current interrupt at  SIU level (and may
    346  *      be others depending on software priorities)
    347  *      5) aknowledge the SIU',
    348  *      6) demask the processor,
    349  *      7) call the application handler
    350  *
    351  * As a result the hdl function provided
    352  *
    353  *      a) can perfectly be written is C,
    354  *      b) may also well directly call the part of the RTEMS API that can be used
    355  *      from interrupt level,
    356  *      c) It only responsible for handling the jobs that need to be done at
    357  *      the device level including (aknowledging/re-enabling the interrupt at device,
    358  *      level, getting the data,...)
    359  *
    360  *      When returning from the function, the following will be performed by
    361  *      the RTEMS irq epilogue :
    362  *
    363  *      1) masks the interrupts again,
    364  *      2) restore the original SIU interrupt masks
    365  *      3) switch back on the orinal stack if needed,
    366  *      4) perform rescheduling when necessary,
    367  *      5) restore the C scratch registers...
    368  *      6) restore initial execution flow
    369  *
    370  */
    371 int BSP_install_rtems_irq_handler(const rtems_irq_connect_data*);
    372 /*
    373  * function to get the current RTEMS irq handler for ptr->name. It enables to
    374  * define hanlder chain...
    375  */
    376 int BSP_get_current_rtems_irq_handler(rtems_irq_connect_data* ptr);
    377 /*
    378  * function to get disconnect the RTEMS irq handler for ptr->name.
    379  * This function checks that the value given is the current one for safety reason.
    380  * The user can use the previous function to get it.
    381  */
    382 int BSP_remove_rtems_irq_handler(const rtems_irq_connect_data*);
    383 
    384 void BSP_rtems_irq_mng_init(unsigned cpuId);
    385 
    386 int BSP_rtems_irq_mngt_set(rtems_irq_global_settings* config);
    387 
    388 #endif
    389 
    390 #endif
     211#endif /* LIBBSP_POWERPC_GEN5200_IRQ_H */
  • c/src/lib/libbsp/powerpc/gen5200/preinstall.am

    r6f776e71 rd8b2e89  
    2929PREINSTALL_DIRS += $(PROJECT_INCLUDE)/$(dirstamp)
    3030
     31../../../libcpu/@RTEMS_CPU@/$(dirstamp):
     32        @$(MKDIR_P) ../../../libcpu/@RTEMS_CPU@
     33        @: > ../../../libcpu/@RTEMS_CPU@/$(dirstamp)
     34PREINSTALL_DIRS += ../../../libcpu/@RTEMS_CPU@/$(dirstamp)
     35
    3136$(PROJECT_LIB)/bsp_specs: bsp_specs $(PROJECT_LIB)/$(dirstamp)
    3237        $(INSTALL_DATA) $< $(PROJECT_LIB)/bsp_specs
     
    4853        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/i2c.h
    4954PREINSTALL_FILES += $(PROJECT_INCLUDE)/i2c.h
    50 
    51 $(PROJECT_INCLUDE)/mpc5200.h: include/mpc5200.h $(PROJECT_INCLUDE)/$(dirstamp)
    52         $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/mpc5200.h
    53 PREINSTALL_FILES += $(PROJECT_INCLUDE)/mpc5200.h
    5455
    5556$(PROJECT_INCLUDE)/tm27.h: include/tm27.h $(PROJECT_INCLUDE)/$(dirstamp)
     
    8687PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds
    8788
     89$(PROJECT_LIB)/linkcmds.base: startup/linkcmds.base $(PROJECT_LIB)/$(dirstamp)
     90        $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.base
     91PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.base
     92
    8893$(PROJECT_LIB)/linkcmds.brs5l: startup/linkcmds.brs5l $(PROJECT_LIB)/$(dirstamp)
    8994        $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.brs5l
     
    98103PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.pm520
    99104
    100 $(PROJECT_INCLUDE)/bsp/irq.h: irq/irq.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
     105$(PROJECT_INCLUDE)/bsp/vectors.h: $(libcpudir)/new-exceptions/bspsupport/vectors.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
     106        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/vectors.h
     107PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/vectors.h
     108
     109$(PROJECT_INCLUDE)/bsp/ppc_exc_bspsupp.h: $(libcpudir)/new-exceptions/bspsupport/ppc_exc_bspsupp.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
     110        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/ppc_exc_bspsupp.h
     111PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/ppc_exc_bspsupp.h
     112
     113$(PROJECT_INCLUDE)/bsp/irq-generic.h: ../../shared/include/irq-generic.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
     114        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq-generic.h
     115PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq-generic.h
     116
     117$(PROJECT_INCLUDE)/bsp/irq-config.h: include/irq-config.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
     118        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq-config.h
     119PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq-config.h
     120
     121$(PROJECT_INCLUDE)/bsp/irq.h: include/irq.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
    101122        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq.h
    102123PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq.h
     
    106127PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/i2cdrv.h
    107128
     129$(PROJECT_INCLUDE)/bsp/i2c.h: include/i2c.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
     130        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/i2c.h
     131PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/i2c.h
     132
    108133$(PROJECT_INCLUDE)/bsp/mpc5200.h: include/mpc5200.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
    109134        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/mpc5200.h
    110135PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/mpc5200.h
    111136
    112 $(PROJECT_INCLUDE)/bsp/i2c.h: include/i2c.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
    113         $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/i2c.h
    114 PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/i2c.h
     137$(PROJECT_INCLUDE)/bsp/mscan-base.h: include/mscan-base.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
     138        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/mscan-base.h
     139PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/mscan-base.h
    115140
    116141$(PROJECT_INCLUDE)/bsp/u-boot.h: include/u-boot.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
    117142        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/u-boot.h
    118143PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/u-boot.h
     144
     145$(PROJECT_INCLUDE)/bsp/mscan.h: mscan/mscan.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
     146        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/mscan.h
     147PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/mscan.h
    119148
    120149$(PROJECT_INCLUDE)/bsp/nvram.h: nvram/nvram.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
     
    126155PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/slicetimer.h
    127156
    128 $(PROJECT_INCLUDE)/bsp/vectors.h: vectors/vectors.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
    129         $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/vectors.h
    130 PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/vectors.h
    131 
Note: See TracChangeset for help on using the changeset viewer.