mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-21 18:28:55 +08:00
Statically initialize the interrupt stack area
(_Configuration_Interrupt_stack_area_begin,
_Configuration_Interrupt_stack_area_end, and
_Configuration_Interrupt_stack_size) via <rtems/confdefs.h>. Place the
interrupt stack area in a special section ".rtemsstack.interrupt". Let
BSPs define the optimal placement of this section in their linker
command files (e.g. in a fast on-chip memory).
This change makes makes the CPU_HAS_SOFTWARE_INTERRUPT_STACK and
CPU_HAS_HARDWARE_INTERRUPT_STACK CPU port defines superfluous, since the
low level initialization code has all information available via global
symbols.
This change makes the CPU_ALLOCATE_INTERRUPT_STACK CPU port define
superfluous, since the interrupt stacks are allocated by confdefs.h for
all architectures. There is no need for BSP-specific linker command
file magic (except the section placement), see previous ARM linker
command file as a bad example.
Remove _CPU_Install_interrupt_stack(). Initialize the hardware
interrupt stack in _CPU_Initialize() if necessary (e.g.
m68k_install_interrupt_stack()).
The optional _CPU_Interrupt_stack_setup() is still useful to customize
the registration of the interrupt stack area in the per-CPU information.
The initialization stack can reuse the interrupt stack, since
* interrupts are disabled during the sequential system initialization,
and
* the boot_card() function does not return.
This stack resuse saves memory.
Changes per architecture:
arm:
* Mostly replace the linker symbol based configuration of stacks with
the standard <rtems/confdefs.h> configuration via
CONFIGURE_INTERRUPT_STACK_SIZE. The size of the FIQ, ABT and UND
mode stack is still defined via linker symbols. These modes are
rarely used in applications and the default values provided by the
BSP should be sufficient in most cases.
* Remove the bsp_processor_count linker symbol hack used for the SMP
support. This is possible since the interrupt stack area is now
allocated by the linker and not allocated from the heap. This makes
some configure.ac stuff obsolete. Remove the now superfluous BSP
variants altcycv_devkit_smp and realview_pbx_a9_qemu_smp.
bfin:
* Remove unused magic linker command file allocation of initialization
stack. Maybe a previous linker command file copy and paste problem?
In the start.S the initialization stack is set to a hard coded value.
lm32, m32c, mips, nios2, riscv, sh, v850:
* Remove magic linker command file allocation of initialization stack.
Reuse interrupt stack for initialization stack.
m68k:
* Remove magic linker command file allocation of initialization stack.
Reuse interrupt stack for initialization stack.
powerpc:
* Remove magic linker command file allocation of initialization stack.
Reuse interrupt stack for initialization stack.
* Used dedicated memory region (REGION_RTEMSSTACK) for the interrupt
stack on BSPs using the shared linkcmds.base (replacement for
REGION_RWEXTRA).
sparc:
* Remove the hard coded initialization stack. Use the interrupt stack
for the initialization stack on the boot processor. This saves
16KiB of RAM.
Update #3459.
Some information about this BSP
================================
ACKNOWLEDGEMENTS
----------------
Acknowledgements:
Valuable information was obtained from the following drivers
linux: (BCM54xx) Maciej W. Rozycki, Amy Fong.
This BSP also builds on top of the work of others who have contributed
to similar RTEMS (powerpc) BSPs, most notably Eric Valette, Eric Norum
and others.
This BSP was produced by the Stanford Linear Accelerator Center,
Stanford University under contract with the US Department of Energy.
LICENSE
-------
See ./LICENSE file.
Note that not all files that are part of this BSP were written by
myself. Consult individual file headers for copyright
and authorship information.
HARDWARE SUPPORT
===============
(some of the headers mentioned below contain more
detailed information)
NOTE: The BSP supports the mvme3100 board.
WARNING: It is extremely important that a MOTLoad "waitProbe", "netShut"
sequence be executed before booting RTEMS. Otherwise, network
interface interrupt handlers installed by MOTLoad may cause memory
corruption
CONSOLE: 2 serial devices, UART driver from 'shared' - no surprises
("/dev/ttyS0", [="/dev/console"], "/dev/ttyS1"). (Only
/dev/ttyS0 is accessible from the front panel.)
CLOCK: Decrementer, same as other PPC BSPs. (FIXME: a openpic timer
could be used.) The bookE decrementer is slightly different
from the classic PPC decrementer but the differences are
hidden from the user.
PIC (interrupt controller) (bsp/irq.h): OpenPIC integrated with
the MPC8540. (see also: bsp/openpic.h).
PCI (bsp/pci.h):
In addition to rtems' PCI API, a call is available to scan
all devices executing a user callback on each device.
BSP_pciConfigDump() is a convenience wrapper dumping essential
information (IDs, BAs, IRQ pin/line) to the console or a file.
MEMORY MAP: MotLoad; all addresses (MEM + I/O) read from PCI config. space
are CPU addresses. For sake of portability, drivers should still
use the _IO_BASE, PCI_MEM_BASE, PCI_DRAM_OFFSET constants.
NVRAM: No NVRAM.
FLASH (bsp/flashPgm.h): Routines to write flash. Highest level
wrapper writes a file to flash.
NOTE: Writing to flash is disabled by default;
call BSP_flashWriteEnable().
I2C (bsp.h, rtems/libi2c.h, libchip/i2c-xxx.h): temp. sensor, eeprom
and real-time clock (RTC) are available as device files (bsp.h);
lower-level interface is provided by libi2c.h.
Available i2c devices are:
/dev/i2c0.vpd-eeprom
/dev/i2c0.usr-eeprom
/dev/i2c0.usr1-eeprom
/dev/i2c0.ds1621
/dev/i2c0.ds1621-raw
/dev/i2c0.ds1375-raw
You can e.g., read the board temperature:
fd = open("/dev/i2c0.ds1621",O_RDONLY)
read(fd,&temp,1)
close(fd);
printf("Board Temp. is %idegC\n",(int)temp);
VME: (bsp/VME.h, bsp/vme_am_defs.h, bsp/VMEDMA.h).
*always* use VME.h API, if possible; do *not* use chip driver
(vmeTsi148.h) directly unless you know what you are
doing (i.e., if you need specific features provided by the particular
chip)
VMEConfig.h should not be used by applications as it makes them
dependent on BSP internals. VMEConfig.h is intended to be used
by BSP designers only.
VME interrupt priorities: the VME bridge(s) do not implement
priorities in hardware.
However, on the 3100 multiple physical interrupt
lines/wires connect the VME bridge to the PIC. Hence, it is possible
to assign the different wires different priorities at the PIC
(see bsp/openpic.h) and to route VME interrupts to different
wires according to their priority.
You need to call driver specific routines
for this (vmeXXXIntRoute()), however (for driver-specific API
consult bsp/vmeTsi148.h).
For VME DMA *always* use the bsp/VMEDMA.h API. DO NOT use
chip-specific features. Applications written using the bsp/VMEDMA.h
API are portable between the UniverseII and the Tsi148.
HARDWARE TIMERS: (bsp/openpic.h). Programmable general-purpose
timers. Routines are provided to setup, start and stop
GPTs. The setup routine allows for specifying single-shot or periodic
mode and dispatches a user ISR when the GPT expires.
NETWORK: (bsp/if_tsec_pub.h). In addition to the standard bsdnet
'attach' function the driver offers a low-level API that
can be used to implement alternate communication links
which are totally decoupled from BSDNET.
Consult 'KNOWN_PROBLEMS'.
VPD: (bsp/vpd.h). The board's VPD (vital-product-data such as S/N,
MAC addresses and so forth) can be retrieved.
BOOTING: BSP has a relocator-header. Clear MSR and jump to the first
instruction in the binary. R3 and R4, if non-null, point to the
start/end of an optional command line string that is copied into
BSP_commandline_string. The BSP is compatible with 'netboot'.
Have fun.
-- Till Straumann <strauman@slac.stanford.edu>, 2007.