Commit graph

149 commits

Author SHA1 Message Date
Guennadi Liakhovetski
4de0c9abc0 SoC: Intel: ADSP: ACE30: add .imrdata to MMU definitions
On ACE30 platforms adding a section to the linker script isn't
enough, it should also be added to the xtensa_soc_mmu_ranges[] array.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2025-06-10 12:52:38 -04:00
Tomasz Leman
e70765391f soc: intel_adsp: Fix typo in cavs/power.c comment
This patch makes cosmetic changes to cavs/power.c by updating comments to
Doxygen style, fixing typos.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2025-06-06 08:43:15 +02:00
Tomasz Leman
c26b0767f2 soc: intel_adsp: Update comment style and fix typos
This patch makes cosmetic changes to ace/power.c by updating comments to
Doxygen style, fixing typos, and removing an extraneous character for
improved readability and consistency.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2025-06-06 08:43:15 +02:00
Tomasz Leman
fbafada9b6 soc: intel_adsp: Manage power gating based on core activity
This patch enhances the power management capabilities of the Intel ADSP
by ensuring that power gating states are appropriately managed based on
core activity. It prevents the primary core from entering power gating
if secondary cores are active and re-enables power gating when all
secondary cores are off, using pm_policy_state_lock_get and
pm_policy_state_lock_put functions.

The Sound Open Firmware (SOF) project currently uses a custom power
management policy to achieve these effects. With this patch, the default
power management policy can be utilized, allowing the option to disable
the custom policy while maintaining system reliability and performance
across different core states.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2025-06-06 08:43:15 +02:00
Adrian Bonislawski
7918839ddd intel_adsp: ace30: Bring up ACE 3.0 (WCL)
This commit adds definition of ACE 3.0 Wildcat Lake board

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2025-05-15 22:14:44 +02:00
Daniel Leung
92ebb2eb69 kernel: remove kernel/internal/smp.h
There is no need for kernel/internal/smp.h as SOF does not call
z_sched_ipi(). Actually... git log over there has no mention of
z_sched_ipi() anywhere, just arch_sched_ipi().

And include <ksched.h> for source using z_sched_ipi() since
they are using scheduling functions, and would be the correct
file to include.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2025-04-29 02:42:09 +02:00
Li Feng
132f0088ec ish build: add new manifest v1.1 support
ISH manifest v1.1 applies to ISH 5.8.

Signed-off-by: Li Feng <li1.feng@intel.com>
2025-04-28 08:35:53 +02:00
Daniel Leung
d08981527d soc: intel_adsp/ace: use custom arch_spin_relax()
Intel Audio DSP ACE needs to use arch_spin_relax() to give
the bus more time to propagate the RCW transactions among
CPUs, and to avoid sending too many requests to the bus
after failing to lock spinlocks. However, the number of
NOPs results in a very big arch_spin_relax() that spans
multiple instruction cache lines, and requires evicting
them just for NOPs.  With 5 CPUs, it can span 6 cache
lines (if using nop.n instead of nop). That's a waste of
space and cache. So instead, we do a tight loop instead.
Since the SoC supports zero-overhead loops, this should
have minimal performance impact.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2025-04-21 07:45:23 +02:00
Daniel Leung
58b035b85f soc: intel_adsp/ace: linker: align cpuhold_* variables
For some weird unknown reasons, the simulator really do not
like the cpuhold_* variables to be tightly packed together.
This results in cpuhold_spawned not being updated, and we
will be stuck in the while loop for it to be set.
Workaround this by explicitly aligning these variables on
16 byte boundary. This seems to work for now.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2025-04-21 07:45:23 +02:00
Daniel Leung
e5685cab4a soc: intel_adsp/ace: link xtensa_swap_update_page_tables...
...earlier. Similar to xtensa_do_syscall, we want to group
some functions together.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2025-04-21 07:45:23 +02:00
Adrian Bonislawski
e64cce9053 soc: intel_adsp: ace30: set MMU permissions for rom_ext sections
This patch will set MMU permissions for rom_ext sections
It is possible to call the rom_ext code located in IMR

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2025-04-04 09:35:29 +02:00
Adrian Bonislawski
368f6cfee4 soc: intel_adsp: ace30: extend hwreg1 MMU mapping
This patch will extend MMU mapping range for hwreg1 entry
because it is required to access lower register addresses

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2025-04-04 09:35:29 +02:00
Anisetti Avinash Krishna
55662b1e82 soc: intel: raptor_lake: soc_gpio: Enabled support for BTL-s
Enabled support for BTL-s platform on RPL soc.

Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
2025-03-29 07:44:22 -04:00
Adrian Bonislawski
e7f2e1412d soc: intel_adsp: set MMU permissions for .cold* sections
This patch will set MMU permissions for .cold* sections
Fixes cold section execution if MMU is enabled

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2025-03-15 00:35:13 +01:00
Ederson de Souza
70c89811be scripts and soc: Mark MD5 and SHA1 usage as not for security
MD5 and SHA1 are not supposed to be used nowadays on security context.
Some ancillary scripts in tree do use them, but for verification only -
or where externally mandated, such the SPDX tool.

This patch marks those usages as `usedforsecurity=False`, which helps
clarify intent.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2025-03-11 04:52:15 +01:00
Adrian Bonislawski
72f820cda3 dts: xtensa: intel_adsp_ace30: enable Mic privacy driver
Enable Microphone Privacy driver for Intel ACE 3.0 platform

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2025-02-13 01:13:31 +01:00
Anas Nashif
94ba9caf82 soc: ish: use lakemont value cpu
Use the Lakemont Value CPU family.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-02-12 23:16:38 +01:00
Anas Nashif
10506f8a25 x86: lakemont: split lakemont into families
Define multiple lakemont cpu families: value and performance.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-02-12 23:16:38 +01:00
Benjamin Cabé
248d3d02c4 soc: intel: ace: Fix power down compilation issue
CONFIG_ADSP_POWER_DOWN_HPSRAM may not be defined (when it's "n") so
update the code accordingly so that power_down() is called with
correct parameters.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-02-06 10:42:25 +01:00
Kai Vehmanen
76dc24ba0a soc: intel_adsp: tools: add cavstool.py fallback for PCI class
If no PCI device with DSP capability is reported, also try to
find compatible devices using PCI_CLASS=40300. This is mostly
useful on preproduction systems where incorrect PCI class data
is reported.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2025-01-07 15:58:26 +01:00
Guennadi Liakhovetski
6d0c23be31 soc: intel_adsp: add support for .cold* sections
Add support for .cold and .coldrodata sections, used to implement
a cold module. Assigning code and read-only data to those sections
makes them suitable for use in a cold module, stored and executed in
slow memory.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-12-29 05:50:25 +01:00
Guennadi Liakhovetski
09cdc1f4b8 soc: intel_adsp: add a "cold" module manifest
Add a manifest for a "cold" module, that will be executed in DRAM
without copying it to SRAM for the whole duration of the firmware
life-time.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-12-29 05:50:25 +01:00
Guennadi Liakhovetski
de4003c07b soc: intel_adsp: check module address before copying to SRAM
Before copying modules to SRAM, check whether they're built for it,
skip modules, that aren't.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-12-29 05:50:25 +01:00
Girisha Dengi
36e71c839f drivers: clock_control: Agilex5 clock control driver updates
The clock controller/manager registers are updated with
the correct divider values by bootloader via hand-off
data, so now we can use the clock controller to get the
clock value of each peripheral during the run time.

Signed-off-by: Girisha Dengi <girisha.dengi@intel.com>
2024-12-16 17:12:34 -05:00
Tomasz Leman
c0a01d33e3 Revert "soc: intel_adsp/ace30: do not map 0x0"
This reverts commit 3d3ffa2c05.

The original commit aimed to prevent NULL pointer accesses by moving the
MMU mapping starting point one page later. However, this change has
caused a regression on PTL. Our DSP has registers with addresses lower
than 0x1000, and the firmware uses addresses starting from 0xC40. For
instance, the HDAMLDMICL register is located at 0xCC0, which is now
inaccessible due to the change.

Reverting this commit restores access to these critical registers and
resolves the regression issue.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-11-29 19:27:53 -05:00
Yong Cong Sin
e6dd68ec89 arch: riscv: introduce CONFIG_RISCV_GP_PURPOSE choice
Introduce `CONFIG_RISCV_GP_PURPOSE` choice to make sure that only
one of `CONFIG_RISCV_GP` or `CONFIG_RISCV_CURRENT_VIA_GP` can be
enabled, instead of relying of dependencies.

To do that, introduce a new
`CONFIG_RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING` that can be selected
by SoC when it implemented global pointer (GP) initialization for
relative addressing in its linker.

`CONFIG_RISCV_GP` will be the default choice when
`CONFIG_RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING=y`

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-11-28 12:51:09 +01:00
Daniel Leung
22de29e768 soc: intel_adsp/ace: put syscall helpers in vector code section
This puts the syscall helpers into the vector code section, and
is a tiny TLB optimization. Before this, worst case scenario is
that there would 2 instruction TLB misses when both the syscall
helpers and the vector code pages are not in TLB cache. With
this change, there would be at most 1 instruction TLB miss as
now the syscall helper and the vector code (which includes
exception handling code and xtensa_do_syscall()) are now in
the same page, and the same TLB entry.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-11-26 00:12:18 +01:00
Pieter De Gendt
bf2db7afc0 python: Format and sort imports
ruff check --select I001 --fix applied to all python files that had
this as only issue.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-25 10:07:13 +01:00
Daniel Leung
3d3ffa2c05 soc: intel_adsp/ace30: do not map 0x0
The MMU mapping in SoC covers 0x0 which prevents catching NULL
pointer accesses. Since there are no hardware registers at
the very first page of memory, we move the starting point one
page later.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-11-25 08:30:57 +01:00
Jamie McCrae
2f800cea8f soc: Remove re-defining some defined types
Removes re-defining some Kconfigs that are already defined
e.g. in arch

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-11-18 07:41:23 -05:00
Tomasz Leman
5cf2cb6a37 soc: intel_adsp: ace: Use DT macros instead of hardcoded values
Replace hardcoded register addresses and values in
asm_memory_management.h with Devicetree (DT) macros for LPSRAM
power-down operations. This change ensures that register addresses and
bank counts are dynamically obtained from the Devicetree, improving code
portability and reducing the risk of errors due to manual updates.

- Removed hardcoded LSPGCTL address definitions.
- Updated m_ace_lpsram_power_down_entire macro to use DT_NODELABEL to
  fetch LPSRAM bank count and control register address
- Adjusted bit field extraction logic to align with the updated register
  information from the Devicetree.

This commit aligns with the ongoing effort to utilize Devicetree for
hardware abstraction and to facilitate easier maintenance and updates to
the codebase.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-11-16 14:03:50 -05:00
Tomasz Leman
946aeaa7e8 soc: intel_adsp: ace: Remove obsolete HPSRAM power change macro
Remove the m_ace_hpsram_power_change macro from asm_memory_management.h
as it is no longer used after refactoring the power_down function to
utilize the new m_ace_hpsram_power_down_entire macro. This cleanup helps
to reduce code complexity and maintainability.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-11-16 14:03:50 -05:00
Tomasz Leman
2d997082fc soc: intel_adsp: ace: Update power_down to use new HPSRAM power-down macro
Refactor the power_down function to utilize the newly introduced
m_ace_hpsram_power_down_entire macro for shutting down the entire
HPSRAM. This change simplifies the power-down process by replacing the
previous segment-based power gating mask approach with a single boolean
flag that indicates whether the entire HPSRAM should be disabled.

The function signature of power_down has been updated to accept the new
boolean flag, and the corresponding call sites have been modified to
pass the flag based on the CONFIG_ADSP_POWER_DOWN_HPSRAM Kconfig option.

Additionally, the assembly code has been cleaned up to remove the
now-obsolete hpsram_mask array and related logic.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-11-16 14:03:50 -05:00
Tomasz Leman
f447d10b0a soc: intel_adsp: ace: Add macro to power down entire HPSRAM
Introduce a new assembly macro, m_ace_hpsram_power_down_entire, which
utilizes Zephyr Devicetree macros to power down the entire HPSRAM on
Intel ADSP ACE platforms.

This macro dynamically retrieves the HPSRAM bank count and control
register address from the Devicetree, streamlining the power-down
process. The macro is designed to iterate over all HPSRAM banks and
issue a power down command to each, ensuring a complete shutdown of the
HPSRAM when required by the system's power management policy.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-11-16 14:03:50 -05:00
Tomasz Leman
e0977dccd8 dts: xtensa: intel: Add hsbcap register node for ADSP ACE platforms
This commit introduces the L2 Memory Capabilities (hsbcap) register node
to the Devicetree specifications for Intel ADSP ACE platforms. The
hsbcap register provides information on the general capabilities
associated with the L2 memory, which is critical for system
configuration and resource management. The hsbcap node has been added to
the Devicetree source files for ACE 1.5 (MTPM), ACE 2.0 (LNL), and ACE
3.0 (PTL) platforms.

In addition, the DFL2MM_REG macro in adsp_memory.h has been updated to
use the Devicetree node label for hsbcap, ensuring a consistent and
maintainable approach to accessing this register across the codebase.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-11-16 14:03:50 -05:00
Tomasz Leman
f810b5d292 soc: intel_adsp: ace: Clean up macro indentation in power_down.S
This commit improves the readability of the power_down.S assembly file
by standardizing the indentation of the preprocessor definitions.

No functional changes have been made; this is purely a cosmetic update
to the code formatting.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-11-16 14:03:50 -05:00
Tomasz Leman
095bc56a57 soc: intel_adsp: ace: Ensure TLB entry for HW registers during power-down
This commit addresses an issue on platforms with an MMU where a
LoadStoreTLBMissCause exception occurs when accessing hardware registers
during the power-down process. The exception arises when attempting to
access the IPC register after HPSRAM has been powered down, leading to a
double exception: LoadStoreTLBMissCause followed by
InstrPIFDataErrorCause.

To resolve this, we preload the IPC register before shutting down
LPSRAM. This change prevents the double exception by ensuring that the
page table entries are correctly managed in the TLB before HPSRAM is
powered down and allowing the power-down sequence to complete
successfully.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-11-16 14:03:50 -05:00
Kai Vehmanen
475878428c soc: intel_adsp: tools: cavstool.py: add RPL and ADL-N support
Add PCI device IDs for common Intel Raptor Lake variants and Alder Lake N.
These all have cAVS2.5 audio DSP.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-10-23 11:31:35 +02:00
Kai Vehmanen
7ad012d3bb soc: intel_adsp: tools: sort cAVS2.5 PCI DIDs in cavstool.py
Numerically sort the PCI DIDs for cAVS2.5 hardware. This follows
the convention in e.g. Linux and coreboot and eases maintainance. No
functional change.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-10-23 11:31:35 +02:00
Kai Vehmanen
2c79024b2f soc: intel_adsp: tools: cavstool.py: add PCI DIDs for Intel Arrow Lake
Add PCI device IDs for two Intel Arrow Lake variants.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-10-23 11:31:35 +02:00
Kai Vehmanen
8795a17fa2 soc: intel_adsp: tools: reword cavstool.py startup log message
The "Detected cAVS 1.8+ hardware" message is misleading as it implies
some version of Intel cAVS hardware has been found, while in fact this
script supports also other types of hardware, including Intel ACE.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-10-23 11:31:35 +02:00
Kai Vehmanen
52bd2ff9a6 soc: intel_adsp: tools: continue cavstool.py legacy cleanup
Clean up code documentation to drop references to platforms no longer
supported in the code. Continues the cleanup started in commit
086e4f84ed ("intel_adsp: cavstool: Remove
legacy code").

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-10-23 11:31:35 +02:00
Kai Vehmanen
52efa3bb9b soc: intel_adsp: tools: fix ace15 ROM status check in cavstool.py
Fix definition for ROM status register for ACE1.5. The value should be
same as ACE2.0 and only different for ACE3.0.

Fixes: 6ad9b6ccab ("soc: intel_adsp: tools: add intel_adsp_ace30
support to cavstool.py")
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-10-15 19:01:35 +01:00
Jyri Sarha
32f9ecacc4 soc: intel_adsp: tools: cavstool.py: Add debug_slot_offset_by_type()
Add debug_slot_offset_by_type() for getting debug window slot offset
by type identifier. How to find the correct slot and what types there
are is documented here:

soc/intel/intel_adsp/common/include/adsp_debug_window.h

In a normal situation a client program would try to find a specific
slot right after DSP boot. Because of that the we can not expect it to
be there immediately. Instead we need to try multiple times and give
firmware some time to update the debug slot descriptor table.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2024-10-03 22:00:33 +01:00
Yong Cong Sin
52a202309b zephyr: bulk update to DT_NODE_HAS_STATUS_OKAY
Change instances of:

DT_NODE_HAS_STATUS(<node_id>, okay)

to

DT_NODE_HAS_STATUS_OKAY(<node_id>)

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-10-03 17:06:52 +01:00
Jyri Sarha
80e629cd97 soc: intel_adsp: tools: cavstool.py: Add debug_slot_offset()
Add debug_slot_offset() function for getting a debug slot offset by
the slot number.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2024-10-03 11:39:15 +01:00
Jyri Sarha
9563960bde soc: intel_adsp: tools: cavstool: Fix fw_is_alive() and wait_fw_entered()
The fw_is_alive() depends on 'dsp' global variable which is assigned
from map_regs() return value. To make fw_is_alive() and
wait_fw_entered(), that calls fw_is_alive(), callable from another
module, the 'dsp' variable needs to be passed as an argument.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2024-10-03 11:39:15 +01:00
Jyri Sarha
91495812bd soc: intel_adsp: tools: cavstool.py: Make map_regs() shareable
map_reg() depends on args global variable for knowing it should
load a new firmware or just stand by for logging or Zephyr
shell. The map_regs() code is the very first step to access the
DSP memory, it nees to be shareable if the code is to be accessed
from another python module.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2024-10-03 11:39:15 +01:00
Jyri Sarha
c2126cb906 soc: intel_adsp: tools: cavstool.py: argsparse code to separate function
Do not force argsparse code to all modules importing cavstool.py. The
commit moves argparse code into a separate function, and calls it from
'if __name__ == "__main__":'. Also adds the argsparse call to to
acetool.py that shares cavstool code with the argument parsing.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2024-10-03 11:39:15 +01:00
Anas Nashif
cb02d090bf soc: intel_adsp: rename missing file during compilation
Fix renaming of file during refactoring of SoC.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-09-24 09:20:01 -04:00