Skip to content

Commit

Permalink
intel_adsp: mtl: extra step for hst domain
Browse files Browse the repository at this point in the history
This step for an HST power domain is only required on the ACE 1.5
generation platform.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
  • Loading branch information
tmleman committed Dec 13, 2023
1 parent 7495eb0 commit 21cded2
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
14 changes: 14 additions & 0 deletions drivers/power_domain/power_domain_intel_adsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
#include <zephyr/pm/device_runtime.h>
#include <adsp_shim.h>

#if CONFIG_ACE_VERSION_1_5
#include <adsp_power.h>
#endif /* CONFIG_ACE_VERSION_1_5 */

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(power_domain_intel_adsp, LOG_LEVEL_INF);

Expand All @@ -31,6 +35,16 @@ static int pd_intel_adsp_set_power_enable(struct pg_bits *bits, bool power_enabl
return -1;
}
} else {
#if CONFIG_ACE_VERSION_1_5
extern uint32_t g_key_read_holder;

if (bits->SPA_bit == INTEL_ADSP_HST_DOMAIN_BIT) {
volatile uint32_t* key_read_ptr = SRAM_TO_SRAM_ALIAS(&g_key_read_holder);

Check failure on line 42 in drivers/power_domain/power_domain_intel_adsp.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

POINTER_LOCATION

drivers/power_domain/power_domain_intel_adsp.c:42 "foo* bar" should be "foo *bar"
uint32_t key_value = *key_read_ptr;
if (key_value != INTEL_ADSP_ACE15_MAGIC_KEY)

Check warning on line 44 in drivers/power_domain/power_domain_intel_adsp.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LINE_SPACING

drivers/power_domain/power_domain_intel_adsp.c:44 Missing a blank line after declarations
return -1;
}
#endif
sys_write16(sys_read16((mem_addr_t)&ACE_DfPMCCU.dfpwrctl) & ~(SPA_bit_mask),
(mem_addr_t)&ACE_DfPMCCU.dfpwrctl);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,10 @@ static ALWAYS_INLINE bool soc_cpu_is_powered(int cpu_num)
*/
#define INTEL_ADSP_HST_DOMAIN_DEV DEVICE_DT_GET(INTEL_ADSP_HST_DOMAIN_DTNODE)

#define INTEL_ADSP_HST_DOMAIN_BIT DT_PROP(INTEL_ADSP_HST_DOMAIN_DTNODE, bit_position)

#define INTEL_ADSP_ACE15_MAGIC_KEY 0xFFFACE15

#define SRAM_TO_SRAM_ALIAS(address) ((__typeof__(address))((((uint32_t)(address)) & 0x1FFFFFFF) | 0x40000000))

Check warning on line 105 in soc/xtensa/intel_adsp/ace/include/intel_ace15_mtpm/adsp_power.h

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LONG_LINE

soc/xtensa/intel_adsp/ace/include/intel_ace15_mtpm/adsp_power.h:105 line length of 110 exceeds 100 columns

#endif /* ZEPHYR_SOC_INTEL_ADSP_POWER_H_ */
7 changes: 7 additions & 0 deletions soc/xtensa/intel_adsp/ace/multiprocessing.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@

#define ACE_INTC_IRQ DT_IRQN(DT_NODELABEL(ace_intc))

#if CONFIG_ACE_VERSION_1_5
__attribute__((__aligned__(CONFIG_DCACHE_LINE_SIZE))) uint32_t g_key_read_holder;

Check warning on line 30 in soc/xtensa/intel_adsp/ace/multiprocessing.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

PREFER_ALIGNED

soc/xtensa/intel_adsp/ace/multiprocessing.c:30 __aligned(size) is preferred over __attribute__((aligned(size)))
__attribute__((__aligned__(CONFIG_DCACHE_LINE_SIZE))) unsigned alignment_dummy[0];

Check warning on line 31 in soc/xtensa/intel_adsp/ace/multiprocessing.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

UNSPECIFIED_INT

soc/xtensa/intel_adsp/ace/multiprocessing.c:31 Prefer 'unsigned int' to bare use of 'unsigned'

Check warning on line 31 in soc/xtensa/intel_adsp/ace/multiprocessing.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

PREFER_ALIGNED

soc/xtensa/intel_adsp/ace/multiprocessing.c:31 __aligned(size) is preferred over __attribute__((aligned(size)))
#endif /* CONFIG_ACE_VERSION_1_5 */

static void ipc_isr(void *arg)
{
uint32_t cpu_id = arch_proc_id();
Expand Down Expand Up @@ -86,6 +91,8 @@ void soc_mp_init(void)

/* Set the core 0 active */
soc_cpus_active[0] = true;
g_key_read_holder = INTEL_ADSP_ACE15_MAGIC_KEY;
sys_cache_data_flush_range(&g_key_read_holder, sizeof(g_key_read_holder));
}

#ifdef CONFIG_ADSP_IMR_CONTEXT_SAVE
Expand Down

0 comments on commit 21cded2

Please sign in to comment.