📄 devconf.h
字号:
/* -*-C-*- * * $Revision: $ * $Author: $ * $Date: $ * * Copyright (c) 1996 Advanced RISC Machines Limited. * All Rights Reserved. * * Project: ANGEL * * Title: Hardware description of the Evaluator board. */#ifndef evaluator_devconf_h#define evaluator_devconf_h#include "stacks.h"#define CACHE_SUPPORTED 0#define DCC_SUPPORTED 0#define PCI_SUPPORTED 0#define PCMCIA_SUPPORTED 0#define PARALLEL_SUPPORTED 0#define PROFILE_SUPPORTED 0#define SYSTEM_COPROCESSOR_SUPPORTED 0#define TIMER_SUPPORTED 0#define POLLING_SUPPORTED 0/* * The number of serial ports used, set to 1 or 2 * * Although the board (and drivers) support 2, select 1 only as the * default allowing the other one to be used by the application * entirely standalone. */#define C501UART_NUM_PORTS 1#include "evaluator.h"/* set the number of task blocks */#if DEBUG#define POOLSIZE 8#else#define POOLSIZE 6#endif/* * ring buffer size * * NOTE - the ring buffer macros are more efficient * when ring buffer size is declared as a power of 2 */#define RING_SIZE (4096)#define RING_LOW_WATER_MARK (32) /* when to fill tx buffer */#define RING_HIGH_WATER_MARK (RING_SIZE-64) /* when to empty rx buffer *//* * Choose the mthod for debug output here. Options supported for PID are: * panicblk panic string written to RAM * logserial via Serial port at 115200 baud * logterm as logserial, but interactive. (#define LOGTERM_DEBUGGING in Makefile too!) */#if DEBUG#if MINIMAL_ANGEL#define DEBUG_METHOD panicblk#else#define DEBUG_METHOD logterm#endif#endif/* * These can be set to determine whether the interrupt handlers are * connected, to IRQ, FIQ or both. */#define HANDLE_INTERRUPTS_ON_IRQ 1#define HANDLE_INTERRUPTS_ON_FIQ 0#if defined(MINIMAL_ANGEL) && MINIMAL_ANGEL != 0#define RAW_C501UART_B 1#if (C501UART_NUM_PORTS > 1)#define RAW_C501UART_A 1#endif#else#define RAW_C501UART_B 0 /* set to 1 if always raw */#if (C501UART_NUM_PORTS > 1)#define RAW_C501UART_A 1 /* set to 0 if B is Angel/shared */#endif#endif#if (C501UART_NUM_PORTS > 1)#define HAVE_RAW_C501UART (RAW_C501UART_A || RAW_C501UART_B)#define HAVE_ANGEL_C501UART (!(RAW_C501UART_A && RAW_C501UART_B))#else#define HAVE_RAW_C501UART (RAW_C501UART_B)#define HAVE_ANGEL_C501UART (!RAW_C501UART_B)#endif#if PARALLEL_SUPPORTED/* * define which serial port the parallel "driver" uses * for uploads to the remote host */#define DI_PARALLEL DI_DOES_NOT_EXIST#endif/* the default active device */#define DE_DEFAULT_ACTIVE DI_C501UART_B/* * sanity checks */#if (C501UART_NUM_PORTS != 1) && (C501UART_NUM_PORTS != 2)#error "Number of Serial Ports must be either 1 or 2"#endif#if (ETHERNET_SUPPORTED != 0) && (PCMCIA_SUPPORTED == 0) && (PCI_SUPPORTED == 0)#error "Ethernet without PCMCIA/PCI support"#endif#if (PROFILE_SUPPORTED != 0) && (TIMER_SUPPORTED == 0)#error "Profiling without Timer support"#endif#if (POLLING_SUPPORTED != 0) && (TIMER_SUPPORTED == 0)#error "Polled Devices need Timer support"#endif#if ((ETHERNET_SUPPORTED != 0) || (DCC_SUPPORTED != 0)) && (POLLING_SUPPORTED == 0)#error "Ethernet & DCC need Polled Device support"#endif#if (HANDLE_INTERRUPTS_ON_IRQ == 0) && ((PARALLEL_SUPPORTED == 1) || (ETHERNET_SUPPORTED == 1))#error "Parallel / Ethernet Support can only use IRQ, & Serial is using it"#endif/* * If dynamic resizing is set, then the following values are required * by the routine FindTopOfMemory in stacks.c: * ( dynamic resizing is not supported on the evaluator ) */#define FINDTOP_BLOCK_STEP 0x10000#define FINDTOP_FIRST_ADDRESS_TO_CHECK 0x40000#define FINDTOP_DRAM_WRAP_ADDR (FINDTOP_DRAM_MAX - 4)#define FINDTOP_DRAM_MAX 0x10000000/* * sanity checks on link addresses defined in Makefile */#if ((RWADDR < EVALUATOR_SSRAM_BASE) || (RWADDR >= (EVALUATOR_SSRAM_BASE + EVALUATOR_SSRAM_SIZE)) )#error "Illegal value for RWADDR"#endif#if ( ((ROADDR < EVALUATOR_SSRAM_BASE) || (ROADDR >= (EVALUATOR_SSRAM_BASE + EVALUATOR_SSRAM_SIZE)) )\ && ((ROADDR < EVALUATOR_FLASH_BASE) || (ROADDR >= (EVALUATOR_FLASH_BASE + EVALUATOR_FLASH_SIZE))) )#error "Illegal value for ROADDR"#endif/* * This constant should be changed only with great care. It is the * amount of stack space per task within the Angel_AngelStack. */#if DEBUG#define Angel_AngelStackFreeSpace 0x800#else#define Angel_AngelStackFreeSpace 0x600#endif/* * These macros are used by debugger-originated memory reads/writes * to check if the write is valid. */#define READ_PERMITTED(__addr__) (1)#define WRITE_PERMITTED(__addr__) (1)/* This can be overridden by the memory sizer - if present */ /* Reserve space (128K) for angel code & stacks*/#define Angel_DefaultTopOfMemory (0x00074000)/* This should be set to 1 for systems with RAM slots */#define MEMORY_SIZE_MAY_CHANGE_DYNAMICALLY 0/* The following are the sizes of the various Angel stacks */#define Angel_UNDStackSize 0x0100#define Angel_ABTStackSize 0x0100#define Angel_AngelStackSize (POOLSIZE * Angel_AngelStackFreeSpace)#define Angel_SVCStackSize 0x0800#if HANDLE_INTERRUPTS_ON_IRQ#define Angel_IRQStackSize 0x0800#else#define Angel_IRQStackSize 0x0100#endif#if HANDLE_INTERRUPTS_ON_FIQ#define Angel_FIQStackSize 0x0800#else#define Angel_FIQStackSize 0x0100#endif/* for the fatal error handler (only!) */#define Angel_FatalStackSize 0x0400/* This is set to 1 only if the system does not remap ROM to 0 * on a reset */#define BRANCH_TO_HIGH_ROM_ON_RESET 0/* And where should the Angel stacks live ? * They can either live at an absolute address (eg the bottom of memory) * or somewhere relative to the top of memory, so * this must be specified here. You may change this if you require * a different memory map. *//* The default is for Angel in RAM at the top of memory and the data * at the bottom of memory below 0x8000, the Angel stacks a bit higher * up but also below 0x8000 */#define Angel_StacksAreRelativeToTopOfMemory 0#if Angel_StacksAreRelativeToTopOfMemory# define Angel_StackBaseOffsetFromTopMemory (-(Angel_CombinedAngelStackSize))# define Angel_ApplStackOffset Angel_StackBaseOffsetFromTopMemory#else#define Angel_FixedStackBase 0x00004800 /* puts stack in SSRAM *//* Check in stacks.c, this is relative to Angel_DefaultTopOfMemory */#define Angel_ApplStackOffset 0#endif/* We also allocate a lump of memory for use by profiling counts. * only allocate this space if profiling is supported. */#if PROFILE_SUPPORTED/* Set the area to 0 if no special memory area is to be set aside * Here we don't so it will be stolen off the heap instead */#define Angel_ProfileAreaSize 0x00001000#define Angel_ProfileAreaIsRelativeToTopOfMemory 1#if Angel_ProfileAreaIsRelativeToTopOfMemory#define Angel_ProfileAreaBaseOffsetFromTopOfMemory \ (Angel_FusionHeapOffsetFromTopMemory - Angel_ProfileAreaSize)#undef Angel_ApplStackOffset#define Angel_ApplStackOffset Angel_ProfileAreaBaseOffsetFromTopOfMemory#else#define Angel_FixedProfileAreaBase 0x0003D000 /* puts profile in SSRAM */#endif#endif/* * The application stack will sit at the top of memory, below the * Angel stacks (if situated there) and the profiling area (if any) */#define Angel_ApplStackSize 8192#define Angel_ApplStackLimitOffset (Angel_ApplStackOffset - Angel_ApplStackSize)/* * By default the heap starts at the end of the ROM image and the heap * limit is the bottom of the application stack. These are the * defaults unless these two #defines are turned on in which case the * addresses specified are used by the C Library. */#if 0#define Angel_ApplHeapLimit ???#define Angel_ApplHeap ???#endif/* * where to download a new agent to */#define Angel_DownloadAgentArea 0x8000/*---------------------------------------------------------------------------*//*-- I/O memory map ---------------------------------------------------------*//*---------------------------------------------------------------------------*//* * the devices available * ORDER AND NUMBER MUST MATCH angel_Device[] TABLE IN devices.c */typedef enum DeviceIdent{ DI_C501UART_B,#if (C501UART_NUM_PORTS > 1) || (DEBUG && LOGTERM_DEBUGGING) DI_C501UART_A,#endif#if ETHERNET_SUPPORTED DI_ETHER,#endif#if DCC_SUPPORTED DI_DCC,#endif DI_NUM_DEVICES}DeviceIdent;/* the device which controls the LED's */#define DI_LED_DEVICE DI_C501UART_B/* * Interrupt masks in the PID board Interrupt controller */#if HANDLE_INTERRUPTS_ON_FIQ/* * In order to test out interrupts on FIQ you can set SERIAL_INTERRUPTS_ON_FIQ * to 1. The interrupts for that port will then occur on FIQ not IRQ. * * This setup is definitely not recommended for normal use - keep Angel * interrupts on IRQ. */#if (C501UART_NUM_PORTS > 1)# error "Only one serial port on FIQ"#endif# define SERIAL_INTERRUPTS_ON_FIQ 1# define C501UART_FIQMASK (1<<FIQ_UARTINT1)#else# define SERIAL_INTERRUPTS_ON_FIQ 0# define C501UART_FIQMASK 0#endif /* HANDLE_INTERRUPTS_ON_FIQ */#if HANDLE_INTERRUPTS_ON_IRQ#if (C501UART_NUM_PORTS > 1)# define C501UART_IRQMASK ((1<<IRQ_UARTINT0) | (1<<IRQ_UARTINT1))#else# define C501UART_IRQMASK (1<<IRQ_UARTINT1)#endif#else#define C501UART_IRQMASK 0#endif /* HANDLE_INTERRUPTS_ON_IRQ *//* * the Interrupt handlers available * ORDER AND NUMBER MUST MATCH angel_IntHandler[] in devices.c */typedef enum IntHandlerID{ IH_C501UART_B, IH_C501UART_A,#if TIMER_SUPPORTED IH_TIMER,#endif IH_NUM_DEVICES} IntHandlerID;/* * must be no. of entries in IntHandlerID */#if TIMER_SUPPORTED#define DE_NUM_INT_HANDLERS (3)#else#define DE_NUM_INT_HANDLERS (2)#endif/* * the POLL handlers available * NUMBER MUST MATCH angel_PollHandler[] in devices.c */#if ETHERNET_SUPPORTED# define NETHERNET_PH 1#else# define NETHERNET_PH 0#endif#if DCC_SUPPORTED# define NDCC_PH 1#else# define NDCC_PH 0#endif#define DE_NUM_POLL_HANDLERS (NETHERNET_PH + NDCC_PH)// #define DEBUG_BASE 0x0FF80000// #define DEBUG_SIZE 0x00010000#define ROMBase (EVALUATOR_FLASH_BASE)#define ROMSize (EVALUATOR_FLASH_SIZE)#define ROMTop (EVALUATOR_FLASH_BASE + EVALUATOR_FLASH_SIZE)#define SSRAMBase (EVALUATOR_SSRAM_BASE)#define SSRAMSize (EVALUATOR_SSRAM_SIZE)#define SSRAMTop (EVALUATOR_SSRAM_BASE + EVALUATOR_SSRAM_SIZE)#endif /* devconf_h */ /* EOF devconf_h */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -