diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-09-05 14:42:59 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-09-05 14:42:59 +0000 |
commit | 39cc10ab8a4ca0e6a7bc504a53e41c1a57f8060e (patch) | |
tree | 73568bc762bac4ef9afe155d8f87453fe5d0f4c0 | |
parent | 2008-09-05 Ralf Corsépius <ralf.corsepius@rtems.org> (diff) | |
download | rtems-39cc10ab8a4ca0e6a7bc504a53e41c1a57f8060e.tar.bz2 |
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.
-rw-r--r-- | c/src/lib/libbsp/powerpc/psim/ChangeLog | 7 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/psim/Makefile.am | 4 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/psim/include/psim.h | 75 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/psim/preinstall.am | 4 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/psim/shmsupp/getcfg.c | 7 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/psim/shmsupp/lock.c | 13 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/psim/startup/linkcmds | 26 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/psim/startup/psim_registers.c | 15 |
8 files changed, 129 insertions, 22 deletions
diff --git a/c/src/lib/libbsp/powerpc/psim/ChangeLog b/c/src/lib/libbsp/powerpc/psim/ChangeLog index 7bb5e24e28..0b52f8f9e2 100644 --- a/c/src/lib/libbsp/powerpc/psim/ChangeLog +++ b/c/src/lib/libbsp/powerpc/psim/ChangeLog @@ -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> * Makefile.am: Remove another duplicate reference. diff --git a/c/src/lib/libbsp/powerpc/psim/Makefile.am b/c/src/lib/libbsp/powerpc/psim/Makefile.am index 972834a80d..34566b3bdb 100644 --- a/c/src/lib/libbsp/powerpc/psim/Makefile.am +++ b/c/src/lib/libbsp/powerpc/psim/Makefile.am @@ -15,6 +15,7 @@ dist_project_lib_DATA = bsp_specs include_HEADERS = include/bsp.h include_HEADERS += include/tm27.h +include_HEADERS += include/psim.h nodist_include_HEADERS = include/bspopts.h DISTCLEANFILES = include/bspopts.h @@ -42,7 +43,8 @@ noinst_LIBRARIES = libbsp.a startup_SOURCES = startup/bspclean.c ../../shared/bsplibc.c \ ../../shared/bsppost.c ../../shared/bsppretaskinghook.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 console_SOURCES = ../../shared/console-polled.c diff --git a/c/src/lib/libbsp/powerpc/psim/include/psim.h b/c/src/lib/libbsp/powerpc/psim/include/psim.h new file mode 100644 index 0000000000..8071716de6 --- /dev/null +++ b/c/src/lib/libbsp/powerpc/psim/include/psim.h @@ -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 */ diff --git a/c/src/lib/libbsp/powerpc/psim/preinstall.am b/c/src/lib/libbsp/powerpc/psim/preinstall.am index 0c96435c3d..534524fe2d 100644 --- a/c/src/lib/libbsp/powerpc/psim/preinstall.am +++ b/c/src/lib/libbsp/powerpc/psim/preinstall.am @@ -40,6 +40,10 @@ $(PROJECT_INCLUDE)/tm27.h: include/tm27.h $(PROJECT_INCLUDE)/$(dirstamp) $(INSTALL_DATA) $< $(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) $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bspopts.h PREINSTALL_FILES += $(PROJECT_INCLUDE)/bspopts.h diff --git a/c/src/lib/libbsp/powerpc/psim/shmsupp/getcfg.c b/c/src/lib/libbsp/powerpc/psim/shmsupp/getcfg.c index 0a9056314a..288513f276 100644 --- a/c/src/lib/libbsp/powerpc/psim/shmsupp/getcfg.c +++ b/c/src/lib/libbsp/powerpc/psim/shmsupp/getcfg.c @@ -12,7 +12,7 @@ * * NOTES: No interrupt support. * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -23,6 +23,7 @@ */ #include <rtems.h> +#include <psim.h> #include "shm_driver.h" #define INTERRUPT 0 /* PSIM target supports only */ @@ -35,8 +36,8 @@ void Shm_Get_configuration( shm_config_table **shmcfg ) { - BSP_shm_cfgtbl.base = (uint32_t*)0xc0000000; - BSP_shm_cfgtbl.length = 64 * 1024; + BSP_shm_cfgtbl.base = (uint32_t*)PSIM.SharedMemory; + BSP_shm_cfgtbl.length = sizeof(PSIM.SharedMemory); BSP_shm_cfgtbl.format = SHM_BIG; BSP_shm_cfgtbl.cause_intr = Shm_Cause_interrupt; diff --git a/c/src/lib/libbsp/powerpc/psim/shmsupp/lock.c b/c/src/lib/libbsp/powerpc/psim/shmsupp/lock.c index 3d2cb199b8..204d0188de 100644 --- a/c/src/lib/libbsp/powerpc/psim/shmsupp/lock.c +++ b/c/src/lib/libbsp/powerpc/psim/shmsupp/lock.c @@ -6,7 +6,7 @@ * and deadlock when two tasks poll for the same lock. * previous level. * - * COPYRIGHT (c) 1989-1997. + * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may in @@ -19,8 +19,7 @@ #include <rtems.h> #include <bsp.h> #include <shm_driver.h> - -typedef volatile unsigned int volint; +#include <psim.h> /* * Shm_Initialize_lock @@ -46,9 +45,7 @@ void Shm_Lock( Shm_Locked_queue_Control *lq_cb ) { - volint *p = (volint *)0xc0010000; - - (void) p[1]; + (void) PSIM.Semaphore.lock; } /* @@ -61,7 +58,5 @@ void Shm_Unlock( Shm_Locked_queue_Control *lq_cb ) { - volint *p = (volint *)0xc0010000; - - (void) p[2]; + (void) PSIM.Semaphore.unlock; } diff --git a/c/src/lib/libbsp/powerpc/psim/startup/linkcmds b/c/src/lib/libbsp/powerpc/psim/startup/linkcmds index 5a7205633f..42f052798f 100644 --- a/c/src/lib/libbsp/powerpc/psim/startup/linkcmds +++ b/c/src/lib/libbsp/powerpc/psim/startup/linkcmds @@ -1,6 +1,5 @@ /* - * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -10,18 +9,17 @@ * $Id$ */ -OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", - "elf32-powerpc") +OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc") OUTPUT_ARCH(powerpc) ENTRY(_start) /* Do we need any of these for elf? __DYNAMIC = 0; */ -PROVIDE (PSIM_INSTRUCTIONS_PER_MICROSECOND = 10000); /* 100); */ -PROVIDE (CPU_PPC_CLICKS_PER_MS = 16667); +PROVIDE (PSIM_INSTRUCTIONS_PER_MICROSECOND = 10000); MEMORY { - RAM : ORIGIN = 0, LENGTH = 8M - EPROM : ORIGIN = 0xFFF00000, LENGTH = 0x20000 + RAM : ORIGIN = 0, LENGTH = 8M + PSIM_REGS : ORIGIN = 0x0c000000, LENGTH = 16M + VECTORS : ORIGIN = 0xFFF00000, LENGTH = 0x20000 } SECTIONS @@ -29,7 +27,17 @@ SECTIONS .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: */ /* . = 0x40000 + SIZEOF_HEADERS; */ diff --git a/c/src/lib/libbsp/powerpc/psim/startup/psim_registers.c b/c/src/lib/libbsp/powerpc/psim/startup/psim_registers.c new file mode 100644 index 0000000000..f3de59b3c5 --- /dev/null +++ b/c/src/lib/libbsp/powerpc/psim/startup/psim_registers.c @@ -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; |