2019-11-19 12:33:35 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2019 Intel Corporation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <device.h>
|
|
|
|
#include <xtensa/xtruntime.h>
|
|
|
|
#include <irq_nextlevel.h>
|
|
|
|
#include <xtensa/hal.h>
|
|
|
|
#include <init.h>
|
|
|
|
|
2021-08-02 10:09:11 -07:00
|
|
|
#include <soc/shim.h>
|
soc: intel_adsp: Clean up shim driver
Each platform was defining its own shim.h header, with slightly
variant field definitions, for a register block that is almost
completely compatible between versions. This is made worse by the
fact that these represent an API imported fairly early from SOF, the
upstream version of which has since diverged.
Move the existing shim struct into a header ("cavs-shim.h") of its
own, remove a bunch of unused symbols, fill in definitions for some
registers that were left out, correct naming to match the hardware
docs in a few places, make sure all hardware dependencies are source
from devicetree only, and modify existing usage to use the new API
exclusively.
Interestingly this leaves the older shim.h header in place, as it
turns out to contain definitions for a bunch of things that were never
part of the shim register block. Those will be unified in separate
patches.
Finally: note that the existing IPM_CAVS_IDC driver (soon to be
removed from all the intel_adsp soc's) is still using the old API, so
redeclare the minimal subset that it needs for the benefit of the
platforms in transition.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-09-05 15:27:46 -07:00
|
|
|
#include <cavs-shim.h>
|
2021-08-07 09:44:09 -07:00
|
|
|
#include <cavs-idc.h>
|
2019-11-19 12:33:35 +02:00
|
|
|
#include "soc.h"
|
|
|
|
|
|
|
|
#ifdef CONFIG_DYNAMIC_INTERRUPTS
|
|
|
|
#include <sw_isr_table.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define LOG_LEVEL CONFIG_SOC_LOG_LEVEL
|
|
|
|
#include <logging/log.h>
|
|
|
|
LOG_MODULE_REGISTER(soc);
|
|
|
|
|
2020-04-20 10:29:32 -05:00
|
|
|
#define CAVS_INTC_NODE(n) DT_INST(n, intel_cavs_intc)
|
|
|
|
|
2020-05-27 11:26:57 -05:00
|
|
|
void z_soc_irq_enable(uint32_t irq)
|
2019-11-19 12:33:35 +02:00
|
|
|
{
|
2020-04-30 20:33:38 +02:00
|
|
|
const struct device *dev_cavs;
|
2019-11-19 12:33:35 +02:00
|
|
|
|
|
|
|
switch (XTENSA_IRQ_NUMBER(irq)) {
|
2020-04-20 10:29:32 -05:00
|
|
|
case DT_IRQN(CAVS_INTC_NODE(0)):
|
|
|
|
dev_cavs = device_get_binding(DT_LABEL(CAVS_INTC_NODE(0)));
|
2019-11-19 12:33:35 +02:00
|
|
|
break;
|
2020-04-20 10:29:32 -05:00
|
|
|
case DT_IRQN(CAVS_INTC_NODE(1)):
|
|
|
|
dev_cavs = device_get_binding(DT_LABEL(CAVS_INTC_NODE(1)));
|
2019-11-19 12:33:35 +02:00
|
|
|
break;
|
2020-04-20 10:29:32 -05:00
|
|
|
case DT_IRQN(CAVS_INTC_NODE(2)):
|
|
|
|
dev_cavs = device_get_binding(DT_LABEL(CAVS_INTC_NODE(2)));
|
2019-11-19 12:33:35 +02:00
|
|
|
break;
|
2020-04-20 10:29:32 -05:00
|
|
|
case DT_IRQN(CAVS_INTC_NODE(3)):
|
|
|
|
dev_cavs = device_get_binding(DT_LABEL(CAVS_INTC_NODE(3)));
|
2019-11-19 12:33:35 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
/* regular interrupt */
|
|
|
|
z_xtensa_irq_enable(XTENSA_IRQ_NUMBER(irq));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!dev_cavs) {
|
|
|
|
LOG_DBG("board: CAVS device binding failed");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The specified interrupt is in CAVS interrupt controller.
|
|
|
|
* So enable core interrupt first.
|
|
|
|
*/
|
|
|
|
z_xtensa_irq_enable(XTENSA_IRQ_NUMBER(irq));
|
|
|
|
|
|
|
|
/* Then enable the interrupt in CAVS interrupt controller */
|
|
|
|
irq_enable_next_level(dev_cavs, CAVS_IRQ_NUMBER(irq));
|
|
|
|
}
|
|
|
|
|
2020-05-27 11:26:57 -05:00
|
|
|
void z_soc_irq_disable(uint32_t irq)
|
2019-11-19 12:33:35 +02:00
|
|
|
{
|
2020-04-30 20:33:38 +02:00
|
|
|
const struct device *dev_cavs;
|
2019-11-19 12:33:35 +02:00
|
|
|
|
|
|
|
switch (XTENSA_IRQ_NUMBER(irq)) {
|
2020-04-20 10:29:32 -05:00
|
|
|
case DT_IRQN(CAVS_INTC_NODE(0)):
|
|
|
|
dev_cavs = device_get_binding(DT_LABEL(CAVS_INTC_NODE(0)));
|
2019-11-19 12:33:35 +02:00
|
|
|
break;
|
2020-04-20 10:29:32 -05:00
|
|
|
case DT_IRQN(CAVS_INTC_NODE(1)):
|
|
|
|
dev_cavs = device_get_binding(DT_LABEL(CAVS_INTC_NODE(1)));
|
2019-11-19 12:33:35 +02:00
|
|
|
break;
|
2020-04-20 10:29:32 -05:00
|
|
|
case DT_IRQN(CAVS_INTC_NODE(2)):
|
|
|
|
dev_cavs = device_get_binding(DT_LABEL(CAVS_INTC_NODE(2)));
|
2019-11-19 12:33:35 +02:00
|
|
|
break;
|
2020-04-20 10:29:32 -05:00
|
|
|
case DT_IRQN(CAVS_INTC_NODE(3)):
|
|
|
|
dev_cavs = device_get_binding(DT_LABEL(CAVS_INTC_NODE(3)));
|
2019-11-19 12:33:35 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
/* regular interrupt */
|
|
|
|
z_xtensa_irq_disable(XTENSA_IRQ_NUMBER(irq));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!dev_cavs) {
|
|
|
|
LOG_DBG("board: CAVS device binding failed");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The specified interrupt is in CAVS interrupt controller.
|
|
|
|
* So disable the interrupt in CAVS interrupt controller.
|
|
|
|
*/
|
|
|
|
irq_disable_next_level(dev_cavs, CAVS_IRQ_NUMBER(irq));
|
|
|
|
|
|
|
|
/* Then disable the parent IRQ if all children are disabled */
|
|
|
|
if (!irq_is_enabled_next_level(dev_cavs)) {
|
|
|
|
z_xtensa_irq_disable(XTENSA_IRQ_NUMBER(irq));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int z_soc_irq_is_enabled(unsigned int irq)
|
|
|
|
{
|
2020-04-30 20:33:38 +02:00
|
|
|
const struct device *dev_cavs;
|
2019-11-19 12:33:35 +02:00
|
|
|
int ret = 0;
|
|
|
|
|
|
|
|
switch (XTENSA_IRQ_NUMBER(irq)) {
|
2020-04-20 10:29:32 -05:00
|
|
|
case DT_IRQN(CAVS_INTC_NODE(0)):
|
|
|
|
dev_cavs = device_get_binding(DT_LABEL(CAVS_INTC_NODE(0)));
|
2019-11-19 12:33:35 +02:00
|
|
|
break;
|
2020-04-20 10:29:32 -05:00
|
|
|
case DT_IRQN(CAVS_INTC_NODE(1)):
|
|
|
|
dev_cavs = device_get_binding(DT_LABEL(CAVS_INTC_NODE(1)));
|
2019-11-19 12:33:35 +02:00
|
|
|
break;
|
2020-04-20 10:29:32 -05:00
|
|
|
case DT_IRQN(CAVS_INTC_NODE(2)):
|
|
|
|
dev_cavs = device_get_binding(DT_LABEL(CAVS_INTC_NODE(2)));
|
2019-11-19 12:33:35 +02:00
|
|
|
break;
|
2020-04-20 10:29:32 -05:00
|
|
|
case DT_IRQN(CAVS_INTC_NODE(3)):
|
|
|
|
dev_cavs = device_get_binding(DT_LABEL(CAVS_INTC_NODE(3)));
|
2019-11-19 12:33:35 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
/* regular interrupt */
|
|
|
|
ret = z_xtensa_irq_is_enabled(XTENSA_IRQ_NUMBER(irq));
|
|
|
|
goto out;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!dev_cavs) {
|
|
|
|
LOG_DBG("board: CAVS device binding failed");
|
|
|
|
ret = -ENODEV;
|
|
|
|
goto out;
|
|
|
|
}
|
|
|
|
|
2021-04-01 14:04:42 +02:00
|
|
|
/* Then check the interrupt in CAVS interrupt controller */
|
2019-11-19 12:33:35 +02:00
|
|
|
ret = irq_line_is_enabled_next_level(dev_cavs, CAVS_IRQ_NUMBER(irq));
|
|
|
|
|
|
|
|
out:
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef CONFIG_DYNAMIC_INTERRUPTS
|
|
|
|
int z_soc_irq_connect_dynamic(unsigned int irq, unsigned int priority,
|
2020-07-10 14:17:51 +02:00
|
|
|
void (*routine)(const void *parameter),
|
|
|
|
const void *parameter, uint32_t flags)
|
2019-11-19 12:33:35 +02:00
|
|
|
{
|
|
|
|
uint32_t table_idx;
|
2020-04-20 10:29:32 -05:00
|
|
|
uint32_t cavs_irq, cavs_idx;
|
2019-11-19 12:33:35 +02:00
|
|
|
int ret;
|
|
|
|
|
|
|
|
ARG_UNUSED(flags);
|
|
|
|
ARG_UNUSED(priority);
|
|
|
|
|
|
|
|
/* extract 2nd level interrupt number */
|
|
|
|
cavs_irq = CAVS_IRQ_NUMBER(irq);
|
|
|
|
ret = irq;
|
|
|
|
|
|
|
|
if (cavs_irq == 0) {
|
|
|
|
/* Not affecting 2nd level interrupts */
|
|
|
|
z_isr_install(irq, routine, parameter);
|
|
|
|
goto irq_connect_out;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Figure out the base index. */
|
|
|
|
switch (XTENSA_IRQ_NUMBER(irq)) {
|
2020-04-20 10:29:32 -05:00
|
|
|
case DT_IRQN(CAVS_INTC_NODE(0)):
|
|
|
|
cavs_idx = 0;
|
2019-11-19 12:33:35 +02:00
|
|
|
break;
|
2020-04-20 10:29:32 -05:00
|
|
|
case DT_IRQN(CAVS_INTC_NODE(1)):
|
|
|
|
cavs_idx = 1;
|
2019-11-19 12:33:35 +02:00
|
|
|
break;
|
2020-04-20 10:29:32 -05:00
|
|
|
case DT_IRQN(CAVS_INTC_NODE(2)):
|
|
|
|
cavs_idx = 2;
|
2019-11-19 12:33:35 +02:00
|
|
|
break;
|
2020-04-20 10:29:32 -05:00
|
|
|
case DT_IRQN(CAVS_INTC_NODE(3)):
|
|
|
|
cavs_idx = 3;
|
2019-11-19 12:33:35 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
ret = -EINVAL;
|
|
|
|
goto irq_connect_out;
|
|
|
|
}
|
|
|
|
|
2020-04-20 10:29:32 -05:00
|
|
|
table_idx = CONFIG_CAVS_ISR_TBL_OFFSET +
|
|
|
|
CONFIG_MAX_IRQ_PER_AGGREGATOR * cavs_idx;
|
2019-11-19 12:33:35 +02:00
|
|
|
table_idx += cavs_irq;
|
|
|
|
|
|
|
|
_sw_isr_table[table_idx].arg = parameter;
|
|
|
|
_sw_isr_table[table_idx].isr = routine;
|
|
|
|
|
|
|
|
irq_connect_out:
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2021-09-04 08:15:21 -07:00
|
|
|
static void power_init_v15(void)
|
2019-11-19 12:33:35 +02:00
|
|
|
{
|
soc: intel_adsp: Clean up shim driver
Each platform was defining its own shim.h header, with slightly
variant field definitions, for a register block that is almost
completely compatible between versions. This is made worse by the
fact that these represent an API imported fairly early from SOF, the
upstream version of which has since diverged.
Move the existing shim struct into a header ("cavs-shim.h") of its
own, remove a bunch of unused symbols, fill in definitions for some
registers that were left out, correct naming to match the hardware
docs in a few places, make sure all hardware dependencies are source
from devicetree only, and modify existing usage to use the new API
exclusively.
Interestingly this leaves the older shim.h header in place, as it
turns out to contain definitions for a bunch of things that were never
part of the shim register block. Those will be unified in separate
patches.
Finally: note that the existing IPM_CAVS_IDC driver (soon to be
removed from all the intel_adsp soc's) is still using the old API, so
redeclare the minimal subset that it needs for the benefit of the
platforms in transition.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-09-05 15:27:46 -07:00
|
|
|
/* HP domain clocked by PLL
|
2021-08-02 10:09:11 -07:00
|
|
|
* LP domain clocked by PLL
|
2019-11-19 12:33:35 +02:00
|
|
|
* DSP Core 0 PLL Clock Select divide by 1
|
|
|
|
* DSP Core 1 PLL Clock Select divide by 1
|
|
|
|
* High Power Domain PLL Clock Select device by 2
|
2021-08-02 10:09:11 -07:00
|
|
|
* Low Power Domain PLL Clock Select device by 4
|
|
|
|
* Disable Tensilica Core Prevent Audio PLL Shutdown (TCPAPLLS)
|
|
|
|
* Disable Tensilica Core Prevent Local Clock Gating (Core 0)
|
|
|
|
* Disable Tensilica Core Prevent Local Clock Gating (Core 1)
|
|
|
|
* - Disabling "prevent clock gating" means allowing clock gating
|
2019-11-19 12:33:35 +02:00
|
|
|
*/
|
soc: intel_adsp: Clean up shim driver
Each platform was defining its own shim.h header, with slightly
variant field definitions, for a register block that is almost
completely compatible between versions. This is made worse by the
fact that these represent an API imported fairly early from SOF, the
upstream version of which has since diverged.
Move the existing shim struct into a header ("cavs-shim.h") of its
own, remove a bunch of unused symbols, fill in definitions for some
registers that were left out, correct naming to match the hardware
docs in a few places, make sure all hardware dependencies are source
from devicetree only, and modify existing usage to use the new API
exclusively.
Interestingly this leaves the older shim.h header in place, as it
turns out to contain definitions for a bunch of things that were never
part of the shim register block. Those will be unified in separate
patches.
Finally: note that the existing IPM_CAVS_IDC driver (soon to be
removed from all the intel_adsp soc's) is still using the old API, so
redeclare the minimal subset that it needs for the benefit of the
platforms in transition.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-09-05 15:27:46 -07:00
|
|
|
CAVS_SHIM.clkctl = CAVS15_CLKCTL_LMPCS;
|
2019-11-19 12:33:35 +02:00
|
|
|
|
|
|
|
/* Rewrite the low power sequencing control bits */
|
soc: intel_adsp: Clean up shim driver
Each platform was defining its own shim.h header, with slightly
variant field definitions, for a register block that is almost
completely compatible between versions. This is made worse by the
fact that these represent an API imported fairly early from SOF, the
upstream version of which has since diverged.
Move the existing shim struct into a header ("cavs-shim.h") of its
own, remove a bunch of unused symbols, fill in definitions for some
registers that were left out, correct naming to match the hardware
docs in a few places, make sure all hardware dependencies are source
from devicetree only, and modify existing usage to use the new API
exclusively.
Interestingly this leaves the older shim.h header in place, as it
turns out to contain definitions for a bunch of things that were never
part of the shim register block. Those will be unified in separate
patches.
Finally: note that the existing IPM_CAVS_IDC driver (soon to be
removed from all the intel_adsp soc's) is still using the old API, so
redeclare the minimal subset that it needs for the benefit of the
platforms in transition.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-09-05 15:27:46 -07:00
|
|
|
CAVS_SHIM.lpsctl = CAVS_SHIM.lpsctl;
|
2021-09-04 08:15:21 -07:00
|
|
|
}
|
2021-08-02 10:09:11 -07:00
|
|
|
|
2021-09-04 08:15:21 -07:00
|
|
|
static void power_init(void)
|
|
|
|
{
|
soc: intel_adsp: Clean up shim driver
Each platform was defining its own shim.h header, with slightly
variant field definitions, for a register block that is almost
completely compatible between versions. This is made worse by the
fact that these represent an API imported fairly early from SOF, the
upstream version of which has since diverged.
Move the existing shim struct into a header ("cavs-shim.h") of its
own, remove a bunch of unused symbols, fill in definitions for some
registers that were left out, correct naming to match the hardware
docs in a few places, make sure all hardware dependencies are source
from devicetree only, and modify existing usage to use the new API
exclusively.
Interestingly this leaves the older shim.h header in place, as it
turns out to contain definitions for a bunch of things that were never
part of the shim register block. Those will be unified in separate
patches.
Finally: note that the existing IPM_CAVS_IDC driver (soon to be
removed from all the intel_adsp soc's) is still using the old API, so
redeclare the minimal subset that it needs for the benefit of the
platforms in transition.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-09-05 15:27:46 -07:00
|
|
|
/* Request HP ring oscillator and
|
2021-08-02 10:09:11 -07:00
|
|
|
* wait for status to indicate it's ready.
|
|
|
|
*/
|
soc: intel_adsp: Clean up shim driver
Each platform was defining its own shim.h header, with slightly
variant field definitions, for a register block that is almost
completely compatible between versions. This is made worse by the
fact that these represent an API imported fairly early from SOF, the
upstream version of which has since diverged.
Move the existing shim struct into a header ("cavs-shim.h") of its
own, remove a bunch of unused symbols, fill in definitions for some
registers that were left out, correct naming to match the hardware
docs in a few places, make sure all hardware dependencies are source
from devicetree only, and modify existing usage to use the new API
exclusively.
Interestingly this leaves the older shim.h header in place, as it
turns out to contain definitions for a bunch of things that were never
part of the shim register block. Those will be unified in separate
patches.
Finally: note that the existing IPM_CAVS_IDC driver (soon to be
removed from all the intel_adsp soc's) is still using the old API, so
redeclare the minimal subset that it needs for the benefit of the
platforms in transition.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-09-05 15:27:46 -07:00
|
|
|
CAVS_SHIM.clkctl |= CAVS_CLKCTL_RHROSCC;
|
|
|
|
while ((CAVS_SHIM.clkctl & CAVS_CLKCTL_RHROSCC) != CAVS_CLKCTL_RHROSCC) {
|
2021-08-02 10:09:11 -07:00
|
|
|
k_busy_wait(10);
|
|
|
|
}
|
|
|
|
|
soc: intel_adsp: Clean up shim driver
Each platform was defining its own shim.h header, with slightly
variant field definitions, for a register block that is almost
completely compatible between versions. This is made worse by the
fact that these represent an API imported fairly early from SOF, the
upstream version of which has since diverged.
Move the existing shim struct into a header ("cavs-shim.h") of its
own, remove a bunch of unused symbols, fill in definitions for some
registers that were left out, correct naming to match the hardware
docs in a few places, make sure all hardware dependencies are source
from devicetree only, and modify existing usage to use the new API
exclusively.
Interestingly this leaves the older shim.h header in place, as it
turns out to contain definitions for a bunch of things that were never
part of the shim register block. Those will be unified in separate
patches.
Finally: note that the existing IPM_CAVS_IDC driver (soon to be
removed from all the intel_adsp soc's) is still using the old API, so
redeclare the minimal subset that it needs for the benefit of the
platforms in transition.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-09-05 15:27:46 -07:00
|
|
|
/* Request HP Ring Oscillator
|
2021-08-02 10:09:11 -07:00
|
|
|
* Select HP Ring Oscillator
|
|
|
|
* High Power Domain PLL Clock Select device by 2
|
|
|
|
* Low Power Domain PLL Clock Select device by 4
|
|
|
|
* Disable Tensilica Core(s) Prevent Local Clock Gating
|
|
|
|
* - Disabling "prevent clock gating" means allowing clock gating
|
|
|
|
*/
|
soc: intel_adsp: Clean up shim driver
Each platform was defining its own shim.h header, with slightly
variant field definitions, for a register block that is almost
completely compatible between versions. This is made worse by the
fact that these represent an API imported fairly early from SOF, the
upstream version of which has since diverged.
Move the existing shim struct into a header ("cavs-shim.h") of its
own, remove a bunch of unused symbols, fill in definitions for some
registers that were left out, correct naming to match the hardware
docs in a few places, make sure all hardware dependencies are source
from devicetree only, and modify existing usage to use the new API
exclusively.
Interestingly this leaves the older shim.h header in place, as it
turns out to contain definitions for a bunch of things that were never
part of the shim register block. Those will be unified in separate
patches.
Finally: note that the existing IPM_CAVS_IDC driver (soon to be
removed from all the intel_adsp soc's) is still using the old API, so
redeclare the minimal subset that it needs for the benefit of the
platforms in transition.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-09-05 15:27:46 -07:00
|
|
|
CAVS_SHIM.clkctl = (CAVS_CLKCTL_RHROSCC |
|
|
|
|
CAVS_CLKCTL_OCS |
|
|
|
|
CAVS_CLKCTL_LMCS);
|
2021-08-02 10:09:11 -07:00
|
|
|
|
soc: intel_adsp: Clean up shim driver
Each platform was defining its own shim.h header, with slightly
variant field definitions, for a register block that is almost
completely compatible between versions. This is made worse by the
fact that these represent an API imported fairly early from SOF, the
upstream version of which has since diverged.
Move the existing shim struct into a header ("cavs-shim.h") of its
own, remove a bunch of unused symbols, fill in definitions for some
registers that were left out, correct naming to match the hardware
docs in a few places, make sure all hardware dependencies are source
from devicetree only, and modify existing usage to use the new API
exclusively.
Interestingly this leaves the older shim.h header in place, as it
turns out to contain definitions for a bunch of things that were never
part of the shim register block. Those will be unified in separate
patches.
Finally: note that the existing IPM_CAVS_IDC driver (soon to be
removed from all the intel_adsp soc's) is still using the old API, so
redeclare the minimal subset that it needs for the benefit of the
platforms in transition.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-09-05 15:27:46 -07:00
|
|
|
#ifndef CONFIG_SOC_SERIES_INTEL_CAVS_V15
|
2021-08-02 10:09:11 -07:00
|
|
|
/* Prevent LP GPDMA 0 & 1 clock gating */
|
|
|
|
sys_write32(SHIM_CLKCTL_LPGPDMAFDCGB, SHIM_GPDMA_CLKCTL(0));
|
|
|
|
sys_write32(SHIM_CLKCTL_LPGPDMAFDCGB, SHIM_GPDMA_CLKCTL(1));
|
soc: intel_adsp: Clean up shim driver
Each platform was defining its own shim.h header, with slightly
variant field definitions, for a register block that is almost
completely compatible between versions. This is made worse by the
fact that these represent an API imported fairly early from SOF, the
upstream version of which has since diverged.
Move the existing shim struct into a header ("cavs-shim.h") of its
own, remove a bunch of unused symbols, fill in definitions for some
registers that were left out, correct naming to match the hardware
docs in a few places, make sure all hardware dependencies are source
from devicetree only, and modify existing usage to use the new API
exclusively.
Interestingly this leaves the older shim.h header in place, as it
turns out to contain definitions for a bunch of things that were never
part of the shim register block. Those will be unified in separate
patches.
Finally: note that the existing IPM_CAVS_IDC driver (soon to be
removed from all the intel_adsp soc's) is still using the old API, so
redeclare the minimal subset that it needs for the benefit of the
platforms in transition.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-09-05 15:27:46 -07:00
|
|
|
#endif
|
2021-08-02 10:09:11 -07:00
|
|
|
|
|
|
|
/* Disable power gating for first cores */
|
soc: intel_adsp: Clean up shim driver
Each platform was defining its own shim.h header, with slightly
variant field definitions, for a register block that is almost
completely compatible between versions. This is made worse by the
fact that these represent an API imported fairly early from SOF, the
upstream version of which has since diverged.
Move the existing shim struct into a header ("cavs-shim.h") of its
own, remove a bunch of unused symbols, fill in definitions for some
registers that were left out, correct naming to match the hardware
docs in a few places, make sure all hardware dependencies are source
from devicetree only, and modify existing usage to use the new API
exclusively.
Interestingly this leaves the older shim.h header in place, as it
turns out to contain definitions for a bunch of things that were never
part of the shim register block. Those will be unified in separate
patches.
Finally: note that the existing IPM_CAVS_IDC driver (soon to be
removed from all the intel_adsp soc's) is still using the old API, so
redeclare the minimal subset that it needs for the benefit of the
platforms in transition.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-09-05 15:27:46 -07:00
|
|
|
CAVS_SHIM.pwrctl |= SHIM_PWRCTL_TCPDSPPG(0);
|
2021-08-02 10:09:11 -07:00
|
|
|
|
soc: intel_adsp: Clean up shim driver
Each platform was defining its own shim.h header, with slightly
variant field definitions, for a register block that is almost
completely compatible between versions. This is made worse by the
fact that these represent an API imported fairly early from SOF, the
upstream version of which has since diverged.
Move the existing shim struct into a header ("cavs-shim.h") of its
own, remove a bunch of unused symbols, fill in definitions for some
registers that were left out, correct naming to match the hardware
docs in a few places, make sure all hardware dependencies are source
from devicetree only, and modify existing usage to use the new API
exclusively.
Interestingly this leaves the older shim.h header in place, as it
turns out to contain definitions for a bunch of things that were never
part of the shim register block. Those will be unified in separate
patches.
Finally: note that the existing IPM_CAVS_IDC driver (soon to be
removed from all the intel_adsp soc's) is still using the old API, so
redeclare the minimal subset that it needs for the benefit of the
platforms in transition.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-09-05 15:27:46 -07:00
|
|
|
#ifndef CONFIG_SOC_SERIES_INTEL_CAVS_V15
|
2021-06-24 14:56:37 -07:00
|
|
|
/* On cAVS 1.8+, we must demand ownership of the timestamping
|
|
|
|
* and clock generator registers. Lacking the former will
|
|
|
|
* prevent wall clock timer interrupts from arriving, even
|
|
|
|
* though the device itself is operational.
|
|
|
|
*/
|
|
|
|
sys_write32(GENO_MDIVOSEL | GENO_DIOPTOSEL, DSP_INIT_GENO);
|
|
|
|
sys_write32(LPGPDMA_CHOSEL_FLAG | LPGPDMA_CTLOSEL_FLAG,
|
|
|
|
DSP_INIT_LPGPDMA(0));
|
|
|
|
sys_write32(LPGPDMA_CHOSEL_FLAG | LPGPDMA_CTLOSEL_FLAG,
|
|
|
|
DSP_INIT_LPGPDMA(1));
|
|
|
|
#endif
|
2021-09-04 08:15:21 -07:00
|
|
|
}
|
2021-06-24 14:56:37 -07:00
|
|
|
|
2021-09-04 08:15:21 -07:00
|
|
|
static int soc_init(const struct device *dev)
|
|
|
|
{
|
|
|
|
if (IS_ENABLED(CONFIG_SOC_SERIES_INTEL_CAVS_V15)) {
|
|
|
|
power_init_v15();
|
|
|
|
} else {
|
|
|
|
power_init();
|
|
|
|
}
|
2021-08-07 09:44:09 -07:00
|
|
|
|
|
|
|
soc_idc_init();
|
2019-11-19 12:33:35 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
SYS_INIT(soc_init, PRE_KERNEL_1, 99);
|