source: rtems/c/src/lib/libbsp/powerpc/psim/include/psim.h @ b094233

4.104.115
Last change on this file since b094233 was b094233, checked in by Till Straumann <strauman@…>, on 09/11/09 at 17:13:42

2009-09-11 Till Straumann <strauman@…>

  • Makefile.am, preinstall.am, irq/no_pic.c (REMOVED), irq/irq.h, irq/irq_init.c: use openpic from 'shared' area instead of no_pic.
  • inlude/psim.h: use openpic from 'shared' area instead of no_pic. Added 'extern' declaration for (linker-script defined) RamBase? and RamSize? symbols. Let CPP macros expand to these symbols instead of static constants. Added register definitions for OpenPIC in the register area. Added register definitions for ethernet controller in the register area.
  • startup/linkcmds: Increased RamSize? to 16M. Increased 'RAM' memory region to 32M (there is really no disadvantage in making this large). Added comment explaining the inter-relation between RamSize?, the size of the memory region, the device-tree property "oea-memory-size" and the DBAT setting.
  • tools/psim-shared: Try to determine RamSize? from executable and set 'oea-memory-size' accordingly. May be overridden if 'RAM_SIZE' envvar is set. Added openpic to device-tree. Added ethernet controller to device-tree (commented because a PSIM patch is currently required to use this device).
  • startup/bspstart: Increase DBAT0 mapping to size of 32M.
  • Property mode set to 100644
File size: 2.0 KB
Line 
1/*
2 *  PSIM addresses and constants based upon the configuration
3 *  of devices used in the script provided by RTEMS.
4 *
5 *  $Id$
6 */
7
8#ifndef __PSIM_h
9#define __PSIM_h
10
11/*
12 * RAM Information
13 */
14
15extern char RamBase[];
16extern char RamSize[];
17
18/*
19 * RamBase/RamSize is defined by the linker script;
20 * CPP symbols are AFAIK unused and deprecated.
21 */
22#define PSIM_RAM_SIZE ((unsigned long)RamSize)
23#define PSIM_RAM_BASE ((void*)RamBase)
24
25/*
26 * NVRAM/RTC Structure and Information
27 */
28
29#define PSIM_RTC_FREEZE 0xc0
30#define PSIM_RTC_UPDATE 0x00
31
32typedef struct {
33  volatile uint8_t Control; /* 0x04 */
34  volatile uint8_t Second;  /* 0x05 */
35  volatile uint8_t Minute;  /* 0x06 */
36  volatile uint8_t Hour;    /* 0x07 */
37  volatile uint8_t Day;     /* 0x08 */
38  volatile uint8_t Date;    /* 0x09 */
39  volatile uint8_t Month;   /* 0x0a */
40  volatile uint8_t Year;    /* 0x0b */
41} psim_rtc_t;
42
43/*
44 *  System V IPC Semaphore -- Read Only
45 */
46
47typedef struct {
48  volatile uint32_t  obtain_value;  /* 0x00 */
49  volatile uint32_t  lock;          /* 0x04 */
50  volatile uint32_t  unlock;        /* 0x08 */
51} psim_sysv_sem_t;
52
53typedef struct {
54  /* 0x0c000000 - 0x0c007FFF - AMD 29F040 */
55  volatile uint8_t Flash[ 512 * 1024 ];
56
57  /* 0x0c080000 - 0x0c0FFFFF - NVRAM/NVRAM */
58  volatile uint8_t nvram[ 512 * 1024 ];
59
60  /* 0x0c100000 - 0x0c100007 - NVRAM/RTC */
61  psim_rtc_t RTC;
62
63  /* 0x0c100008 - 0x0c10000F - NVRAM/RTC */
64  uint8_t gap1[8];
65
66  /* 0x0c100010 - 0x0c10001b - System V IPC Semaphore */
67  psim_sysv_sem_t Semaphore;
68
69  /* 0x0c10001c - 0x0c10001f - NVRAM/RTC */
70  uint8_t gap2[4];
71
72  /* 0x0c100020 - 0x0c10005F - Ethernet */
73  volatile uint8_t Ethtap[ 64 ];
74
75  /* 0x0c100060 - 0x0c10FFFF - NVRAM/RTC */
76  uint8_t gap3[65440];
77
78  /* 0x0c110000 - 0x0c12FFFF - System V IPC Shared Memory */
79  uint8_t SharedMemory[ 128 * 1024 ];
80
81  /* 0x0c130000 - 0x0c170000 - OpenPIC IRQ Controller */
82  volatile uint8_t OpenPIC[ 256 * 1024 ];
83
84} psim_registers_t;
85
86/*
87 *  Data Structure Overlay for Registers.  See linkcmds for placement.
88 */
89extern psim_registers_t PSIM;
90
91#endif
92/* end of include file */
Note: See TracBrowser for help on using the repository browser.