forked from Imagelibrary/rtems
2008-09-05 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, preinstall.am, shmsupp/getcfg.c, shmsupp/lock.c, startup/linkcmds: Now running mptests using new memory layout with updates patches against gdb 6.8. * include/psim.h, startup/psim_registers.c: New files.
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
2008-09-05 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||||
|
|
||||||
|
* Makefile.am, preinstall.am, shmsupp/getcfg.c, shmsupp/lock.c,
|
||||||
|
startup/linkcmds: Now running mptests using new memory layout with
|
||||||
|
updates patches against gdb 6.8.
|
||||||
|
* include/psim.h, startup/psim_registers.c: New files.
|
||||||
|
|
||||||
2008-08-29 Joel Sherrill <joel.sherrill@OARcorp.com>
|
2008-08-29 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||||
|
|
||||||
* Makefile.am: Remove another duplicate reference.
|
* Makefile.am: Remove another duplicate reference.
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ dist_project_lib_DATA = bsp_specs
|
|||||||
|
|
||||||
include_HEADERS = include/bsp.h
|
include_HEADERS = include/bsp.h
|
||||||
include_HEADERS += include/tm27.h
|
include_HEADERS += include/tm27.h
|
||||||
|
include_HEADERS += include/psim.h
|
||||||
|
|
||||||
nodist_include_HEADERS = include/bspopts.h
|
nodist_include_HEADERS = include/bspopts.h
|
||||||
DISTCLEANFILES = include/bspopts.h
|
DISTCLEANFILES = include/bspopts.h
|
||||||
@@ -42,7 +43,8 @@ noinst_LIBRARIES = libbsp.a
|
|||||||
startup_SOURCES = startup/bspclean.c ../../shared/bsplibc.c \
|
startup_SOURCES = startup/bspclean.c ../../shared/bsplibc.c \
|
||||||
../../shared/bsppost.c ../../shared/bsppretaskinghook.c \
|
../../shared/bsppost.c ../../shared/bsppretaskinghook.c \
|
||||||
../../shared/bsppredriverhook.c startup/bspstart.c ../../shared/bootcard.c \
|
../../shared/bsppredriverhook.c startup/bspstart.c ../../shared/bootcard.c \
|
||||||
../../shared/sbrk.c ../../shared/gnatinstallhandler.c
|
../../shared/sbrk.c ../../shared/gnatinstallhandler.c \
|
||||||
|
startup/psim_registers.c
|
||||||
|
|
||||||
pclock_SOURCES = ../shared/clock/p_clock.c
|
pclock_SOURCES = ../shared/clock/p_clock.c
|
||||||
console_SOURCES = ../../shared/console-polled.c
|
console_SOURCES = ../../shared/console-polled.c
|
||||||
|
|||||||
75
c/src/lib/libbsp/powerpc/psim/include/psim.h
Normal file
75
c/src/lib/libbsp/powerpc/psim/include/psim.h
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
/*
|
||||||
|
* PSIM addresses and constants based upon the configuration
|
||||||
|
* of devices used in the script provided by RTEMS.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __PSIM_h
|
||||||
|
#define __PSIM_h
|
||||||
|
|
||||||
|
/*
|
||||||
|
* RAM Information
|
||||||
|
*/
|
||||||
|
#define PSIM_RAM_BASE (void *)0x00000000
|
||||||
|
#define PSIM_RAM_SIZE 8388608
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NVRAM/RTC Structure and Information
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define PSIM_RTC_FREEZE 0xc0
|
||||||
|
#define PSIM_RTC_UPDATE 0x00
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
volatile uint8_t Control; /* 0x04 */
|
||||||
|
volatile uint8_t Second; /* 0x05 */
|
||||||
|
volatile uint8_t Minute; /* 0x06 */
|
||||||
|
volatile uint8_t Hour; /* 0x07 */
|
||||||
|
volatile uint8_t Day; /* 0x08 */
|
||||||
|
volatile uint8_t Date; /* 0x09 */
|
||||||
|
volatile uint8_t Month; /* 0x0a */
|
||||||
|
volatile uint8_t Year; /* 0x0b */
|
||||||
|
} psim_rtc_t;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* System V IPC Semaphore -- Read Only
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
volatile uint32_t obtain_value; /* 0x00 */
|
||||||
|
volatile uint32_t lock; /* 0x04 */
|
||||||
|
volatile uint32_t unlock; /* 0x08 */
|
||||||
|
} psim_sysv_sem_t;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
/* 0x0c000000 - 0x0c007FFF - AMD 29F040 */
|
||||||
|
volatile uint8_t Flash[ 512 * 1024 ];
|
||||||
|
|
||||||
|
/* 0x0c080000 - 0x0c0FFFFF - NVRAM/NVRAM */
|
||||||
|
volatile uint8_t nvram[ 512 * 1024 ];
|
||||||
|
|
||||||
|
/* 0x0c100000 - 0x0c100007 - NVRAM/RTC */
|
||||||
|
psim_rtc_t RTC;
|
||||||
|
|
||||||
|
/* 0x0c100008 - 0x0c10000F - NVRAM/RTC */
|
||||||
|
uint8_t gap1[8];
|
||||||
|
|
||||||
|
/* 0x0c100010 - 0x0c10001b - System V IPC Semaphore */
|
||||||
|
psim_sysv_sem_t Semaphore;
|
||||||
|
|
||||||
|
/* 0x0c10001C - 0x0c10FFFF - NVRAM/RTC */
|
||||||
|
uint8_t gap2[65508];
|
||||||
|
|
||||||
|
/* 0x0c110000 - 0x0c12FFFF - System V IPC Shared Memory */
|
||||||
|
uint8_t SharedMemory[ 128 * 1024 ];
|
||||||
|
|
||||||
|
} psim_registers_t;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Data Structure Overlay for Registers. See linkcmds for placement.
|
||||||
|
*/
|
||||||
|
extern psim_registers_t PSIM;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
/* end of include file */
|
||||||
@@ -40,6 +40,10 @@ $(PROJECT_INCLUDE)/tm27.h: include/tm27.h $(PROJECT_INCLUDE)/$(dirstamp)
|
|||||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/tm27.h
|
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/tm27.h
|
||||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/tm27.h
|
PREINSTALL_FILES += $(PROJECT_INCLUDE)/tm27.h
|
||||||
|
|
||||||
|
$(PROJECT_INCLUDE)/psim.h: include/psim.h $(PROJECT_INCLUDE)/$(dirstamp)
|
||||||
|
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/psim.h
|
||||||
|
PREINSTALL_FILES += $(PROJECT_INCLUDE)/psim.h
|
||||||
|
|
||||||
$(PROJECT_INCLUDE)/bspopts.h: include/bspopts.h $(PROJECT_INCLUDE)/$(dirstamp)
|
$(PROJECT_INCLUDE)/bspopts.h: include/bspopts.h $(PROJECT_INCLUDE)/$(dirstamp)
|
||||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bspopts.h
|
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bspopts.h
|
||||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/bspopts.h
|
PREINSTALL_FILES += $(PROJECT_INCLUDE)/bspopts.h
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
*
|
*
|
||||||
* NOTES: No interrupt support.
|
* NOTES: No interrupt support.
|
||||||
*
|
*
|
||||||
* COPYRIGHT (c) 1989-1999.
|
* COPYRIGHT (c) 1989-2008.
|
||||||
* On-Line Applications Research Corporation (OAR).
|
* On-Line Applications Research Corporation (OAR).
|
||||||
*
|
*
|
||||||
* The license and distribution terms for this file may be
|
* The license and distribution terms for this file may be
|
||||||
@@ -23,6 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <rtems.h>
|
#include <rtems.h>
|
||||||
|
#include <psim.h>
|
||||||
#include "shm_driver.h"
|
#include "shm_driver.h"
|
||||||
|
|
||||||
#define INTERRUPT 0 /* PSIM target supports only */
|
#define INTERRUPT 0 /* PSIM target supports only */
|
||||||
@@ -35,8 +36,8 @@ void Shm_Get_configuration(
|
|||||||
shm_config_table **shmcfg
|
shm_config_table **shmcfg
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
BSP_shm_cfgtbl.base = (uint32_t*)0xc0000000;
|
BSP_shm_cfgtbl.base = (uint32_t*)PSIM.SharedMemory;
|
||||||
BSP_shm_cfgtbl.length = 64 * 1024;
|
BSP_shm_cfgtbl.length = sizeof(PSIM.SharedMemory);
|
||||||
BSP_shm_cfgtbl.format = SHM_BIG;
|
BSP_shm_cfgtbl.format = SHM_BIG;
|
||||||
|
|
||||||
BSP_shm_cfgtbl.cause_intr = Shm_Cause_interrupt;
|
BSP_shm_cfgtbl.cause_intr = Shm_Cause_interrupt;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* and deadlock when two tasks poll for the same lock.
|
* and deadlock when two tasks poll for the same lock.
|
||||||
* previous level.
|
* previous level.
|
||||||
*
|
*
|
||||||
* COPYRIGHT (c) 1989-1997.
|
* COPYRIGHT (c) 1989-2008.
|
||||||
* On-Line Applications Research Corporation (OAR).
|
* On-Line Applications Research Corporation (OAR).
|
||||||
*
|
*
|
||||||
* The license and distribution terms for this file may in
|
* The license and distribution terms for this file may in
|
||||||
@@ -19,8 +19,7 @@
|
|||||||
#include <rtems.h>
|
#include <rtems.h>
|
||||||
#include <bsp.h>
|
#include <bsp.h>
|
||||||
#include <shm_driver.h>
|
#include <shm_driver.h>
|
||||||
|
#include <psim.h>
|
||||||
typedef volatile unsigned int volint;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Shm_Initialize_lock
|
* Shm_Initialize_lock
|
||||||
@@ -46,9 +45,7 @@ void Shm_Lock(
|
|||||||
Shm_Locked_queue_Control *lq_cb
|
Shm_Locked_queue_Control *lq_cb
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
volint *p = (volint *)0xc0010000;
|
(void) PSIM.Semaphore.lock;
|
||||||
|
|
||||||
(void) p[1];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -61,7 +58,5 @@ void Shm_Unlock(
|
|||||||
Shm_Locked_queue_Control *lq_cb
|
Shm_Locked_queue_Control *lq_cb
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
volint *p = (volint *)0xc0010000;
|
(void) PSIM.Semaphore.unlock;
|
||||||
|
|
||||||
(void) p[2];
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
*
|
* COPYRIGHT (c) 1989-2008.
|
||||||
* COPYRIGHT (c) 1989-1999.
|
|
||||||
* On-Line Applications Research Corporation (OAR).
|
* On-Line Applications Research Corporation (OAR).
|
||||||
*
|
*
|
||||||
* The license and distribution terms for this file may be
|
* The license and distribution terms for this file may be
|
||||||
@@ -10,18 +9,17 @@
|
|||||||
* $Id$
|
* $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc",
|
OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
|
||||||
"elf32-powerpc")
|
|
||||||
OUTPUT_ARCH(powerpc)
|
OUTPUT_ARCH(powerpc)
|
||||||
ENTRY(_start)
|
ENTRY(_start)
|
||||||
/* Do we need any of these for elf?
|
/* Do we need any of these for elf?
|
||||||
__DYNAMIC = 0; */
|
__DYNAMIC = 0; */
|
||||||
PROVIDE (PSIM_INSTRUCTIONS_PER_MICROSECOND = 10000); /* 100); */
|
PROVIDE (PSIM_INSTRUCTIONS_PER_MICROSECOND = 10000);
|
||||||
PROVIDE (CPU_PPC_CLICKS_PER_MS = 16667);
|
|
||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
RAM : ORIGIN = 0, LENGTH = 8M
|
RAM : ORIGIN = 0, LENGTH = 8M
|
||||||
EPROM : ORIGIN = 0xFFF00000, LENGTH = 0x20000
|
PSIM_REGS : ORIGIN = 0x0c000000, LENGTH = 16M
|
||||||
|
VECTORS : ORIGIN = 0xFFF00000, LENGTH = 0x20000
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTIONS
|
SECTIONS
|
||||||
@@ -29,7 +27,17 @@ SECTIONS
|
|||||||
.entry_point_section :
|
.entry_point_section :
|
||||||
{
|
{
|
||||||
*(.entry_point_section)
|
*(.entry_point_section)
|
||||||
} > EPROM
|
} > VECTORS
|
||||||
|
|
||||||
|
/*
|
||||||
|
* BSP: PSIM Register Block
|
||||||
|
*/
|
||||||
|
.psim_regs (NOLOAD) : {
|
||||||
|
psim_reg*(.text)
|
||||||
|
psim_reg*(.data)
|
||||||
|
psim_reg*(.bss)
|
||||||
|
psim_reg*(COMMON)
|
||||||
|
} > PSIM_REGS
|
||||||
|
|
||||||
/* Read-only sections, merged into text segment: */
|
/* Read-only sections, merged into text segment: */
|
||||||
/* . = 0x40000 + SIZEOF_HEADERS; */
|
/* . = 0x40000 + SIZEOF_HEADERS; */
|
||||||
|
|||||||
15
c/src/lib/libbsp/powerpc/psim/startup/psim_registers.c
Normal file
15
c/src/lib/libbsp/powerpc/psim/startup/psim_registers.c
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
/*
|
||||||
|
* COPYRIGHT (c) 1989-2008.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.rtems.com/license/LICENSE.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <bsp.h>
|
||||||
|
#include <psim.h>
|
||||||
|
|
||||||
|
psim_registers_t PSIM;
|
||||||
Reference in New Issue
Block a user