-
Notifications
You must be signed in to change notification settings - Fork 36
Add ADSP SC5xx System Protection Unit info #411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Brandon-Hurst
wants to merge
1
commit into
analogdevicesinc:main
Choose a base branch
from
Brandon-Hurst:adsp/add-spu-doc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,7 +79,9 @@ PTYs | |
| RPi|rpi | ||
| RTDs | ||
| RTOSes | ||
| SHARC | ||
| Scarthgap | ||
| SPU(s)? | ||
| SDRangel | ||
| SDRsharp | ||
| STMicroelectronics | ||
|
|
||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
|
Brandon-Hurst marked this conversation as resolved.
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,153 @@ | ||
| .. _adsp system-protection-unit: | ||
|
|
||
| System Protection Unit (SPU) | ||
| ============================ | ||
|
|
||
| Introduction | ||
| ------------ | ||
|
|
||
| This page describes the System Protection Unit (SPU) on ADSP-SC5xx platforms, | ||
| which is responsible for controlling access to shared system resources | ||
| (peripherals, DMA, memory, etc) by different system bus masters (ARM core, | ||
| SHARC cores, MDMA). | ||
|
|
||
| The information contained in this page is from the | ||
| :adi:`ADSP-SC5xx Hardware Reference Manual <media/en/dsp-documentation/processor-manuals/SC58x-2158x-hrm.pdf>`, | ||
| Chapter 43. | ||
|
|
||
| Overview | ||
| -------- | ||
|
|
||
| The SPU protects a system from multiple bus masters from causing conflicts over | ||
| peripherals, and keeps access to system components fixed to particular bus | ||
| masters. It does this in 2 ways: | ||
|
|
||
| - Write-Protect access to certain Memory-Mapped Registers (MMRs) against | ||
| selected bus masters. | ||
| - Global Lock Mechanism to simultaneously & dynamically protect many peripheral | ||
| configuration registers. | ||
| - Exception Signal to indicate blocked accesses | ||
|
|
||
| In addition, a user can configure access protection for the SPU's own | ||
| write-protection registers. | ||
|
|
||
| The SPU is a critical configuration resource for systems which intend to | ||
| leverage peripherals via the SHARC cores. Proper configuration of the SPU | ||
| should generate an SPU exception when a core (Arm or SHARC) tries to access a | ||
| peripheral that has already been allocated to a different core. | ||
|
|
||
| Write-Protect Configuration | ||
| --------------------------- | ||
|
|
||
| The configuration of the SPU's Write Protection roughly begins with setting the | ||
| Write Protect register corresponding to the peripheral to protect. | ||
|
|
||
| Each of these registers protects a particular peripheral from write accesses by | ||
| certain bus masters: | ||
|
|
||
| .. figure:: images/spu-wp-regs.jpg | ||
| :align: center | ||
| :alt: SPU Write Protect registers overview | ||
|
|
||
| SPU Write Protect Registers [1]_ | ||
|
|
||
| Access is prevented by system bus masters whose bitfields are masked in the | ||
| corresponding Write Protect register: | ||
|
|
||
| .. figure:: images/spu-wp-access.jpg | ||
| :align: center | ||
| :alt: SPU Write Protect access control | ||
|
|
||
| SPU Write Protect Access Control [2]_ | ||
|
|
||
| The Write Protect Registers are all formatted the same. Each register is | ||
| associated with a particular peripheral, and contains Write Protect Enable bits | ||
| corresponding to either Core Masters (CM) or System Masters (SM) such as | ||
| DMA, PCIe, or debug interfaces. | ||
|
|
||
| .. figure:: images/spu-wp-reg-n.jpg | ||
| :align: center | ||
| :alt: SPU Write Protect register format | ||
|
|
||
| SPU_WP Register Format [3]_ | ||
|
|
||
| These registers each have bitfields which correspond to system bus masters | ||
| which should be prevented from writing the peripheral. | ||
|
|
||
| .. table:: SPU_WP Core (CM) and System Master (SM) Bits | ||
| :width: 100% | ||
| :widths: auto | ||
| :align: left | ||
|
|
||
| +------------+----------+-----------------------------+ | ||
| | Bit Number | Bit Name | Description | | ||
| +============+==========+=============================+ | ||
| | 0 | CM_WP[0] | ARM Core 0 | | ||
| +------------+----------+-----------------------------+ | ||
| | 1 | CM_WP[1] | SHARC Core 1 | | ||
| +------------+----------+-----------------------------+ | ||
| | 2 | CM_WP[2] | SHARC Core 2 | | ||
| +------------+----------+-----------------------------+ | ||
| | 15 | SM_WP[0] | PCIe | | ||
| +------------+----------+-----------------------------+ | ||
| | 16 | SM_WP[1] | DBG | | ||
| +------------+----------+-----------------------------+ | ||
| | 17 | SM_WP[2] | Embedded Trace Router (ETR) | | ||
| +------------+----------+-----------------------------+ | ||
| | 18 | SM_WP[3] | Enhanced Bandwidth MDMA | | ||
| +------------+----------+-----------------------------+ | ||
|
|
||
| Consult the SPU chapter of the | ||
| :adi:`Hardware Reference Manual <media/en/dsp-documentation/processor-manuals/SC58x-2158x-hrm.pdf>` | ||
| for the index of the WP registers corresponding to each peripheral. | ||
|
|
||
| Current Linux Support Status | ||
| ---------------------------- | ||
|
|
||
| Currently, the DSP Linux kernel has support instrumented within the various | ||
| peripheral drivers for the SPU. | ||
|
|
||
| The drivers call back to functions defined in | ||
| :git-linux:`arch/arm/mach-sc5xx/spu.c <adsp-6.12.0-y:arch/arm/mach-sc5xx/spu.c>`. | ||
|
Check failure on line 111 in docs/products/adsp/system-protection-unit.rst
|
||
|
|
||
| .. code-block:: c | ||
|
|
||
| #include <linux/export.h> | ||
| #include <linux/types.h> | ||
|
|
||
| void set_spu_securep_msec(uint16_t n, bool msec) | ||
| { | ||
| (void)n; | ||
| (void)msec; | ||
| } | ||
| EXPORT_SYMBOL(set_spu_securep_msec); | ||
|
|
||
| Currently, these functions are stubs which do not actually configure the SPU. | ||
| The ADI DSP Linux kernel and accompanying examples are designed with the intent | ||
| that the ARM core owns and allocates most of the system's peripherals. | ||
| The accompanying SHARC examples leverage peripherals minimally to prevent | ||
| contention with the ARM for system resources. | ||
|
|
||
| SPU support is currently being worked on as an addition to the ADSP Linux kernel | ||
| (`PR #3133 <https://github.com/analogdevicesinc/linux/issues/3133>`_). | ||
| Systems where SHARC cores boot their own applications prior to Linux/ARM will | ||
| not be supported due to contention with Linux for system resources | ||
| (peripherals, interrupts, DMA, shared L2 memory, etc.). For these systems, | ||
| system resources must be carefully managed by the developer to avoid conflicts | ||
| with the understanding that Linux/ARM will own the SPU configuration | ||
| and all system resources allocated in the devicetree. | ||
|
|
||
| References | ||
| ---------- | ||
|
|
||
| .. [1] | ||
| ADSP-SC5xx Hardware Reference Manual, Chapter 43, Figure 43-1 (SPU Write Protect Registers), | ||
| Analog Devices, Inc. https://www.analog.com/media/en/dsp-documentation/processor-manuals/SC58x-2158x-hrm.pdf | ||
|
|
||
| .. [2] | ||
| ADSP-SC5xx Hardware Reference Manual, Chapter 43, Figure 43-2 (SPU Write Protect Access Control), | ||
| Analog Devices, Inc. https://www.analog.com/media/en/dsp-documentation/processor-manuals/SC58x-2158x-hrm.pdf | ||
|
|
||
| .. [3] | ||
| ADSP-SC5xx Hardware Reference Manual, Chapter 43, Figure 43-3 (SPU_WP Register Format), | ||
| Analog Devices, Inc. https://www.analog.com/media/en/dsp-documentation/processor-manuals/SC58x-2158x-hrm.pdf | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.