Changeset 71260b4 in rtems


Ignore:
Timestamp:
Mar 15, 2015, 4:04:06 PM (4 years ago)
Author:
Alan Cudmore <alan.cudmore@…>
Branches:
4.11, master
Children:
b4d1f08
Parents:
dc5e5f44
git-author:
Alan Cudmore <alan.cudmore@…> (03/15/15 16:04:06)
git-committer:
Joel Sherrill <joel.sherrill@…> (03/16/15 14:43:21)
Message:

preliminary Raspberry Pi Model 2 support

This patch adds a BSP variant for the Raspberry Pi 2. You can
build both variants by configuring with the option

--enable-rtemsbsp="raspberrypi2 raspberrypi"

For the current BSP, the only change was the peripheral register base
address and the compiler options.

The raspberrypi/make/custom rules were re-factored:

raspberrypi.inc -- Common rules
raspberrypi.cfg -- Raspberry Pi 1 specific rule/optons
raspberrypi2.cfg -- Raspberry Pi 2 specific rule/options

I tested hello, ticker, unlimited, and paranoia on both the Pi (Model A+)
and Pi 2.

Location:
c/src/lib/libbsp/arm/raspberrypi
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/raspberrypi/configure.ac

    rdc5e5f44 r71260b4  
    2525RTEMS_BSPOPTS_HELP([BSP_START_RESET_VECTOR],[reset vector address for BSP start])
    2626
     27# Is this a Raspberry Pi 2?
     28RTEMS_BSPOPTS_SET([BSP_IS_RPI2],[raspberrypi2],[1])
     29RTEMS_BSPOPTS_SET([BSP_IS_RPI2],[*],[0])
     30RTEMS_BSPOPTS_HELP([BSP_IS_RPI2],[Set if the BSP variant is Raspberry Pi 2.])
     31AM_CONDITIONAL(RTEMS_RPI2,[test "$BSP_IS_RPI2" = "1"])
     32
     33
     34
    2735RTEMS_BSP_CLEANUP_OPTIONS(0, 0)
    2836RTEMS_BSP_LINKCMDS
  • c/src/lib/libbsp/arm/raspberrypi/include/raspberrypi.h

    rdc5e5f44 r71260b4  
    4646
    4747/**
     48 * @name Peripheral Base Register Address
     49 *
     50 * @{
     51 */
     52
     53#if (BSP_IS_RPI2 == 1)
     54   #define RPI_PERIPHERAL_BASE      0x3F000000
     55#else
     56   #define RPI_PERIPHERAL_BASE      0x20000000
     57#endif
     58
     59#define RPI_PERIPHERAL_SIZE         0x01000000
     60
     61/**
    4862 * @name Internal ARM Timer Registers
    4963 *
     
    5367#define BCM2835_CLOCK_FREQ       250000000
    5468
    55 #define BCM2835_TIMER_BASE       (0x2000B400)
     69#define BCM2835_TIMER_BASE       (RPI_PERIPHERAL_BASE + 0xB400)
    5670
    5771#define BCM2835_TIMER_LOD        (BCM2835_TIMER_BASE+0x00)
     
    7589 */
    7690
    77 #define BCM2835_GPIO_REGS_BASE   (0x20200000)
     91#define BCM2835_GPIO_REGS_BASE   (RPI_PERIPHERAL_BASE + 0x200000)
    7892
    7993#define BCM2835_GPIO_GPFSEL1     (BCM2835_GPIO_REGS_BASE+0x04)
     
    91105 */
    92106
    93 #define BCM2835_AUX_BASE         (0x20215000)
     107#define BCM2835_AUX_BASE         (RPI_PERIPHERAL_BASE + 0x215000)
    94108
    95109#define AUX_ENABLES              (BCM2835_AUX_BASE+0x04)
     
    116130
    117131
    118 #define BCM2835_UART0_BASE       (0x20201000)
     132#define BCM2835_UART0_BASE       (RPI_PERIPHERAL_BASE + 0x201000)
    119133
    120134#define BCM2835_UART0_DR         (BCM2835_UART0_BASE+0x00)
     
    156170 */
    157171
    158 #define BCM2835_BASE_INTC         (0x2000B200)
     172#define BCM2835_BASE_INTC         (RPI_PERIPHERAL_BASE + 0xB200)
    159173
    160174#define BCM2835_IRQ_BASIC         (BCM2835_BASE_INTC + 0x00)
     
    183197 *       RTEMS.
    184198 */
    185 #define BCM2835_GPU_TIMER_BASE    (0x20003000)
     199#define BCM2835_GPU_TIMER_BASE    (RPI_PERIPHERAL_BASE + 0x3000)
    186200
    187201#define BCM2835_GPU_TIMER_CS      (BCM2835_TIMER_BASE+0x00)
  • c/src/lib/libbsp/arm/raspberrypi/make/custom/raspberrypi.cfg

    rdc5e5f44 r71260b4  
    22#  Config file for RASPBERRYPI
    33#
    4 
    5 include $(RTEMS_ROOT)/make/custom/default.cfg
    6 
    7 RTEMS_CPU = arm
     4include $(RTEMS_ROOT)/make/custom/raspberrypi.inc
    85
    96CPU_CFLAGS = -mcpu=arm1176jzf-s
    107
    11 CFLAGS_OPTIMIZE_V = -O2 -g
    12 
    13 # This defines the operations performed on the linked executable.
    14 # is currently required.
    15 define bsp-post-link
    16     $(OBJCOPY) -O binary --strip-all \
    17         $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)
    18     $(SIZE) $(basename $@)$(EXEEXT)
    19 endef
    20 
  • c/src/lib/libbsp/arm/raspberrypi/startup/mm_config_table.c

    rdc5e5f44 r71260b4  
    2121 */
    2222
     23#include <bsp.h>
    2324#include <bsp/arm-cp15-start.h>
    2425
     
    6566    .flags = ARMV7_MMU_DATA_READ_WRITE_CACHED
    6667  }, {
    67     .begin = 0x20000000,
    68     .end = 0x21000000,
     68    .begin = RPI_PERIPHERAL_BASE,
     69    .end =   RPI_PERIPHERAL_BASE + RPI_PERIPHERAL_SIZE,
    6970    .flags = ARMV7_MMU_DEVICE
    7071  }
Note: See TracChangeset for help on using the changeset viewer.