Name
HAL Port — Implementation Details
Overview
This documentation explains how the eCos HAL specification has been mapped onto the ADS512101 hardware, and should be read in conjunction with that specification. The ADS512101 platform HAL package complements the PowerPC architectural HAL and the MPC51XX variant HAL. It provides functionality which is specific to the target board.
Startup
Following a hard or soft reset the HAL will initialize or reinitialize the on-chip peripherals that eCos uses. There is an exception for RAM startup applications which depend on a ROM monitor for certain services.
For ROM startup, the HAL will perform additional initialization,
setting up the external RAM and programming the various internal
registers. This is all done in the
hal_hardware_init
function in the assembler
source file ads512101.S
.
Linker Scripts and Memory Maps
The platform HAL package provides the memory layout information needed to generate the linker script. The key memory locations are as follows:
- Flash
- This is located at address 0xFC000000 of the physical memory space. It is mapped by the BAR registers 1-1 to virtual address 0xFC000000 with caching enabled, and to 0x50000000 with caching disabled. The PowerPC reset vector is at 0xFFF00100 so RedBoot is normally programmed from 0xFFF00000.
- SDRAM
- This is located at address 0x00000000 of the physical memory space. The first 0x3000 bytes are used for the exception entry trampolines. The following 512 bytes contain the VSR table and the next 256 bytes are normally used for the eCos virtual vectors, allowing RAM-based applications to use services provided by the ROM monitor. For ROM and JTAG startup, all remaining SDRAM is available. For RAM startup, available RAM starts at location 0x00100000, with the bottom 1MiB reserved for use by RedBoot. The SDRAM is mapped 1-1 with cache enabled at virtual address 0x00000000 and uncached at 0x20000000.
- SRAM
- The 128KiB of on-chip SRAM is mapped 1-1 at 0x30000000. This memory is not used by eCos and is therefore available for application use.
- Peripherals
- All on-chip peripherals are accessed relative to the address in the IMMBAR register. Both the PEEDI configuration file and eCos itself set this to 0xE0000000. The CPLD is mapped to 0xE2000000 and is accessible just beyond the IMMBAR peripherals.
Real-time characterization
The tm_basic kernel test gives statistics gathered about the real-time characterization and performance of the kernel. The sample output is shown here for information.
Example 350.1. ads512101 Real-time characterization
Startup, main stack : stack used 1032 size 5920 Startup : Interrupt stack used 571 size 4096 Startup : Idlethread stack used 480 size 2048 eCos Kernel Timings Notes: all times are in microseconds (.000001) unless otherwise stated Reading the hardware clock takes 0 'ticks' overhead ... this value will be factored out of all other measurements Clock interrupt took 1.49 microseconds (74 raw clock ticks) Testing parameters: Clock samples: 32 Threads: 64 Thread switches: 128 Mutexes: 32 Mailboxes: 32 Semaphores: 32 Scheduler operations: 128 Counters: 32 Flags: 32 Alarms: 32 Confidence Ave Min Max Var Ave Min Function ====== ====== ====== ====== ========== ======== 2.91 2.38 3.68 0.29 46% 32% Create thread 0.28 0.26 1.00 0.02 98% 98% Yield thread [all suspended] 0.29 0.26 0.98 0.04 90% 90% Suspend [suspended] thread 0.27 0.26 0.62 0.01 96% 96% Resume thread 0.40 0.38 1.10 0.03 96% 96% Set priority 0.03 0.02 0.24 0.01 98% 73% Get priority 0.72 0.68 1.90 0.06 84% 84% Kill [suspended] thread 0.26 0.26 0.34 0.00 98% 98% Yield [no other] thread 0.41 0.38 0.86 0.03 67% 85% Resume [suspended low prio] thread 0.26 0.26 0.28 0.00 96% 96% Resume [runnable low prio] thread 0.33 0.32 0.42 0.01 62% 35% Suspend [runnable] thread 0.27 0.26 0.28 0.01 73% 73% Yield [only low prio] thread 0.26 0.26 0.34 0.01 84% 84% Suspend [runnable->not runnable] 0.69 0.68 0.84 0.02 90% 90% Kill [runnable] thread 0.64 0.60 2.16 0.06 93% 93% Destroy [dead] thread 1.14 1.10 1.44 0.05 79% 79% Destroy [runnable] thread 3.93 2.88 5.30 0.38 54% 7% Resume [high priority] thread 0.67 0.62 2.36 0.06 85% 75% Thread switch 0.02 0.02 0.18 0.00 99% 99% Scheduler lock 0.21 0.20 0.30 0.01 62% 62% Scheduler unlock [0 threads] 0.21 0.20 0.22 0.01 61% 61% Scheduler unlock [1 suspended] 0.21 0.20 0.30 0.01 68% 68% Scheduler unlock [many suspended] 0.21 0.20 0.22 0.01 60% 60% Scheduler unlock [many low prio] 0.18 0.04 0.80 0.11 43% 43% Init mutex 0.37 0.34 1.28 0.06 96% 96% Lock [unlocked] mutex 0.38 0.34 1.72 0.08 96% 96% Unlock [locked] mutex 0.30 0.26 1.02 0.04 96% 96% Trylock [unlocked] mutex 0.26 0.26 0.34 0.00 96% 96% Trylock [locked] mutex 0.06 0.04 0.42 0.02 96% 96% Destroy mutex 1.57 1.54 1.82 0.02 93% 3% Unlock/Lock mutex 0.33 0.14 1.22 0.15 62% 50% Create mbox 0.01 0.00 0.04 0.01 50% 46% Peek [empty] mbox 0.36 0.32 1.44 0.07 96% 96% Put [first] mbox 0.02 0.02 0.10 0.00 96% 96% Peek [1 msg] mbox 0.35 0.32 0.46 0.04 71% 71% Put [second] mbox 0.02 0.02 0.10 0.00 96% 96% Peek [2 msgs] mbox 0.34 0.30 1.28 0.06 96% 96% Get [first] mbox 0.31 0.30 0.40 0.01 50% 46% Get [second] mbox 0.29 0.26 0.92 0.04 96% 96% Tryput [first] mbox 0.31 0.28 0.86 0.03 96% 96% Peek item [non-empty] mbox 0.34 0.32 0.80 0.03 96% 96% Tryget [non-empty] mbox 0.27 0.26 0.34 0.01 96% 59% Peek item [empty] mbox 0.27 0.26 0.36 0.01 96% 50% Tryget [empty] mbox 0.03 0.02 0.12 0.01 71% 71% Waiting to get mbox 0.03 0.02 0.12 0.01 71% 71% Waiting to put mbox 0.08 0.06 0.50 0.03 96% 96% Delete mbox 1.17 1.16 1.34 0.01 96% 96% Put/Get mbox 0.07 0.04 0.26 0.04 75% 75% Init semaphore 0.26 0.26 0.34 0.01 93% 93% Post [0] semaphore 0.33 0.32 0.42 0.01 50% 46% Wait [1] semaphore 0.27 0.24 0.74 0.03 96% 96% Trywait [0] semaphore 0.25 0.24 0.36 0.01 96% 65% Trywait [1] semaphore 0.05 0.04 0.22 0.02 96% 62% Peek semaphore 0.06 0.04 0.32 0.02 50% 46% Destroy semaphore 1.09 1.08 1.20 0.01 96% 62% Post/Wait semaphore 0.21 0.06 0.66 0.08 50% 25% Create counter 0.03 0.02 0.20 0.02 96% 75% Get counter value 0.02 0.02 0.10 0.00 96% 96% Set counter value 0.31 0.30 0.56 0.02 96% 93% Tick counter 0.06 0.04 0.32 0.02 59% 37% Delete counter 0.08 0.04 0.54 0.06 93% 71% Init flag 0.30 0.26 1.00 0.04 96% 96% Destroy flag 0.26 0.24 0.90 0.04 96% 96% Mask bits in flag 0.30 0.28 0.88 0.04 96% 96% Set bits in flag [no waiters] 0.41 0.36 1.42 0.06 96% 96% Wait for flag [AND] 0.35 0.34 0.44 0.01 96% 50% Wait for flag [OR] 0.38 0.36 0.38 0.00 96% 3% Wait for flag [AND/CLR] 0.35 0.34 0.46 0.01 96% 50% Wait for flag [OR/CLR] 0.02 0.02 0.12 0.01 96% 96% Peek on flag 0.34 0.18 1.14 0.08 71% 21% Create alarm 0.41 0.38 1.18 0.05 96% 96% Initialize alarm 0.25 0.24 0.42 0.02 96% 62% Disable alarm 0.39 0.36 0.88 0.03 96% 96% Enable alarm 0.30 0.28 0.46 0.02 96% 50% Delete alarm 0.35 0.34 0.42 0.01 96% 59% Tick counter [1 alarm] 2.13 2.12 2.14 0.01 53% 53% Tick counter [many alarms] 0.57 0.56 0.68 0.01 96% 59% Tick & fire counter [1 alarm] 9.50 9.50 9.58 0.00 96% 96% Tick & fire counters [>1 together] 2.36 2.36 2.36 0.00 100% 100% Tick & fire counters [>1 separately] 1.18 1.18 1.32 0.00 99% 99% Alarm latency [0 threads] 1.45 1.18 1.72 0.16 51% 27% Alarm latency [2 threads] 4.51 3.24 6.08 0.56 50% 21% Alarm latency [many threads] 2.11 2.10 3.44 0.02 99% 99% Alarm -> thread resume latency 0.57 0.32 2.36 0.00 Clock/interrupt latency 0.75 0.38 2.88 0.00 Clock DSR latency 18 0 1177 (main stack: 1272) Thread stack used (1960 total) All done, main stack : stack used 1272 size 5920 All done : Interrupt stack used 263 size 4096 All done : Idlethread stack used 1117 size 2048 Timing complete - 29950 ms total PASS:<Basic timing OK> EXIT:<done>
Other Issues
The ADS512101 platform HAL does not affect the implementation of other parts of the eCos HAL specification. The MPC55XX variant HAL, and the PowerPC architectural HAL documentation should be consulted for further details.
2024-03-18 | eCosPro Non-Commercial Public License |