Changeset 7da3405 in rtems


Ignore:
Timestamp:
Jun 20, 2007, 9:42:00 PM (12 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
19b4789
Parents:
18481be
Message:

2007-06-20 Joel Sherrill <joel.sherrill@…>

Add Embedded Planets EP5200 which is the same as the Freescale
5200Lite (a.k.a. IceCube?) evaluation board.

  • Makefile.am: Add linkcmds.ep5200. Add -DMPC5200_BAPI_LIBC_HEADERS to remove some warnings in bestcomm.
  • preinstall.am: Add linkcmds.ep5200.
  • clock/clock.c: Correct math for prescaler/counter when bus speed is high enough to require multiple passes of loop.
  • console/console.c: Use same math for initial baud rate as when it is changed via ioctl. When HAS_UBOOT is defined, initialize console to the same baud as it was with U-Boot.
  • include/bsp.h: Add EP5200 and console boot baud support.
  • include/mpc5200.h: Spacing.
  • startup/bspstart.c: If HAS_UBOOT and SHOW_MORE_INIT_SETTINGS are both defined, dump the U-Boot BD info structure.
  • vectors/vectors.S: ep5200 cannot use vectors segment. When loading it, U-Boot freezes. Besides, U-Boot can automatically start the BSP so we do not have to run from board reset.
  • startup/linkcmds.ep5200: New file.
Location:
c/src/lib/libbsp/powerpc/gen5200
Files:
1 added
9 edited

Legend:

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

    r18481be r7da3405  
     12007-06-20      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        Add Embedded Planets EP5200 which is the same as the Freescale
     4        5200Lite (a.k.a. IceCube) evaluation board.
     5        * Makefile.am: Add linkcmds.ep5200.
     6        Add -DMPC5200_BAPI_LIBC_HEADERS to remove some warnings in bestcomm.
     7        * preinstall.am: Add linkcmds.ep5200.
     8        * clock/clock.c: Correct math for prescaler/counter when bus speed
     9        is high enough to require multiple passes of loop.
     10        * console/console.c: Use same math for initial baud rate as when it
     11        is changed via ioctl.  When HAS_UBOOT is defined, initialize console
     12        to the same baud as it was with U-Boot.
     13        * include/bsp.h: Add EP5200 and console boot baud support.
     14        * include/mpc5200.h: Spacing.
     15        * startup/bspstart.c: If HAS_UBOOT and SHOW_MORE_INIT_SETTINGS are
     16        both defined, dump the U-Boot BD info structure.
     17        * vectors/vectors.S: ep5200 cannot use vectors segment.  When loading
     18        it, U-Boot freezes.  Besides, U-Boot can automatically start the BSP
     19        so we do not have to run from board reset.
     20        * startup/linkcmds.ep5200: New file.
     21
    1222007-04-17      Ralf Corsépius <ralf.corsepius@rtems.org>
    223
  • c/src/lib/libbsp/powerpc/gen5200/Makefile.am

    r18481be r7da3405  
    3232dist_project_lib_DATA += startup/linkcmds
    3333dist_project_lib_DATA += startup/linkcmds.brs5l
     34dist_project_lib_DATA += startup/linkcmds.ep5200
    3435dist_project_lib_DATA += startup/linkcmds.pm520
    3536
     
    5253    bestcomm/task_api/tasksetup_bdtable.h \
    5354    bestcomm/task_api/tasksetup_general.h
    54 bestcomm_rel_CPPFLAGS = $(AM_CPPFLAGS)
     55bestcomm_rel_CPPFLAGS = $(AM_CPPFLAGS) -DMPC5200_BAPI_LIBC_HEADERS
    5556bestcomm_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
    5657
     
    112113startup_rel_SOURCES = ../../shared/bspclean.c ../../shared/bsplibc.c \
    113114    ../../shared/bsppost.c startup/bspstart.c ../../shared/bootcard.c \
    114     ../../shared/sbrk.c \
     115    ../../shared/sbrk.c ../shared/uboot_dump_bdinfo.c \
    115116    ../../shared/gnatinstallhandler.c startup/cpuinit.c start/start.S
    116117startup_rel_CPPFLAGS = $(AM_CPPFLAGS)
  • c/src/lib/libbsp/powerpc/gen5200/clock/clock.c

    r18481be r7da3405  
    171171  {
    172172  uint32_t prescaler_value = 1;
     173  uint32_t counter = counter_value;
    173174  struct mpc5200_gpt *gpt = (struct mpc5200_gpt *)(&mpc5200.gpt[gpt_no]);
    174175
    175176  /* Calculate counter/prescaler value, e.g. IPB_Clock=33MHz -> Int. every 0,3 nsecs. - 130 secs.*/
    176   while((counter_value >= (1 << 16)) && (prescaler_value < (1 << 16)))
     177  while((counter >= (1 << 16)) && (prescaler_value < (1 << 16)))
    177178    {
    178 
    179     prescaler_value++;
    180         counter_value /= prescaler_value;
    181 
    182     }
    183 
    184   counter_value = (uint16_t)counter_value;
    185 
    186   gpt->count_in = (prescaler_value << 16) + counter_value;
     179      prescaler_value++;
     180      counter = counter_value / prescaler_value;
     181    }
     182
     183  counter = (uint16_t)counter;
     184
     185  gpt->count_in = (prescaler_value << 16) + counter;
    187186
    188187  }
  • c/src/lib/libbsp/powerpc/gen5200/console/console.c

    r18481be r7da3405  
    498498  psc->tfalarm = 1;
    499499
    500   baud_divider = IPB_CLOCK / (9600 * 32);
     500  baud_divider = (IPB_CLOCK + GEN5200_CONSOLE_BAUD *16) / (GEN5200_CONSOLE_BAUD * 32);
     501
    501502  /*
    502503   * Set upper timer counter
    503504   */
    504505  psc->ctur = baud_divider >> 16;
    505 
    506506
    507507  /*
  • c/src/lib/libbsp/powerpc/gen5200/include/bsp.h

    r18481be r7da3405  
    9191#define HAS_UBOOT
    9292
     93#elif defined (ep5200)
     94/*
     95 *  Embedded Planet EP5200 -- should be the same as a Freescale 5200lite
     96 *  which is also known as the Ice Cube.  In the RTEMS configuration,
     97 *  we load U-Boot on it instead of the default dBug.
     98 */
     99
     100#define HAS_UBOOT
     101
     102/* These are copied from PM520 but seem to work so OK */
     103#define GPIOPCR_INITMASK 0x330F0F77
     104#define GPIOPCR_INITVAL  0x01050444
     105
     106/* we only have PSC1 */
     107#define GEN5200_UART_AVAIL_MASK 0x01
     108
     109#define MBAR         0xF0000000
     110
    93111#else
    94112#error "board type not defined"
     
    111129
    112130#if defined(HAS_UBOOT)
     131/* This is the define U-Boot uses to configure which entries in the structure are valid */
    113132#define CONFIG_MPC5xxx
    114133#include <u-boot.h>
     134
    115135extern bd_t *uboot_bdinfo_ptr;
    116136extern bd_t uboot_bdinfo_copy;
     
    190210#define SINGLE_CHAR_MODE
    191211#define UARTS_USE_TERMIOS_INT   1
     212/* #define SHOW_MORE_INIT_SETTINGS 1 */
    192213
    193214/* ata modes */
     
    206227#endif
    207228
     229#if defined(HAS_UBOOT)
     230#define GEN5200_CONSOLE_BAUD (uboot_bdinfo_ptr->bi_baudrate)
     231#else
     232#define GEN5200_CONSOLE_BAUD 9600
     233#endif
     234
    208235/*
    209236 *  Convert decrement value to tenths of microsecnds (used by
  • c/src/lib/libbsp/powerpc/gen5200/include/mpc5200.h

    r18481be r7da3405  
    700700
    701701#endif
    702         /*
     702    /*
    703703     * programmable serial controller 1 (MBAR + 0x2000)
    704704     */
  • c/src/lib/libbsp/powerpc/gen5200/preinstall.am

    r18481be r7da3405  
    8686PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.brs5l
    8787
     88$(PROJECT_LIB)/linkcmds.ep5200: startup/linkcmds.ep5200 $(PROJECT_LIB)/$(dirstamp)
     89        $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.ep5200
     90PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.ep5200
     91
    8892$(PROJECT_LIB)/linkcmds.pm520: startup/linkcmds.pm520 $(PROJECT_LIB)/$(dirstamp)
    8993        $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.pm520
  • c/src/lib/libbsp/powerpc/gen5200/startup/bspstart.c

    r18481be r7da3405  
    245245}
    246246
    247 
    248 
    249247void bsp_start(void)
    250248{
     
    258256   * store the result in global variables so that it can be used latter...
    259257   */
    260   myCpu             = get_ppc_cpu_type();
     258  myCpu         = get_ppc_cpu_type();
    261259  myCpuRevision = get_ppc_cpu_revision();
    262260
     
    265263  uboot_bdinfo_ptr = &uboot_bdinfo_copy;
    266264#endif 
     265
     266#if defined(HAS_UBOOT) && defined(SHOW_MORE_INIT_SETTINGS)
     267  {
     268    void dumpUBootBDInfo( bd_t * );
     269    dumpUBootBDInfo( uboot_bdinfo_ptr );
     270  }
     271#endif
     272
    267273  cpu_init();
    268274
  • c/src/lib/libbsp/powerpc/gen5200/vectors/vectors.S

    r18481be r7da3405  
    6767
    6868#include <rtems/asm.h>
     69#include <bspopts.h>
    6970#include <rtems/score/cpu.h>
    7071#include "vectors.h"   
     
    198199        rfi
    199200
     201#if !defined(ep5200)
    200202        .section .vectors,"awx",@progbits
    201203
     
    262264        .long 0x04000400
    263265        .endr
    264 
     266#endif
Note: See TracChangeset for help on using the changeset viewer.