Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -448,11 +448,17 @@ AC_CONFIG_FILES([
src/audio/Makefile
src/math/Makefile
src/drivers/Makefile
src/drivers/intel/Makefile
src/drivers/intel/cavs/Makefile
src/drivers/intel/legacy/Makefile
src/drivers/intel/legacy/baytrail/Makefile
src/drivers/intel/legacy/haswell/Makefile
src/include/Makefile
src/include/sof/Makefile
src/include/sof/audio/Makefile
src/include/sof/audio/coefficients/Makefile
src/include/sof/audio/coefficients/src/Makefile
src/include/sof/drivers/Makefile
src/include/sof/math/Makefile
src/include/uapi/Makefile
src/ipc/Makefile
Expand Down
2 changes: 1 addition & 1 deletion src/arch/xtensa/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ sof_LDADD = \
../../ipc/libsof_ipc.a \
../../lib/libdma.a \
../../audio/libaudio.a \
../../drivers/libdrivers.a \
../../drivers/libdrivers.la \
../../math/libsof_math.a \
-lgcc

Expand Down
2 changes: 1 addition & 1 deletion src/arch/xtensa/smp/include/arch/idc.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static inline void idc_enable_interrupts(int target_core, int source_core)
{
idc_write(IPC_IDCCTL, target_core,
IPC_IDCCTL_IDCTBIE(source_core));
platform_interrupt_unmask(PLATFORM_IDC_INTERRUPT(target_core), 0);
drivers_interrupt_unmask(PLATFORM_IDC_INTERRUPT(target_core), 0);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/audio/dai.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ static int dai_comp_trigger(struct comp_dev *dev, int cmd)
}

/* update starting wallclock */
platform_dai_wallclock(dev, &dd->wallclock);
drivers_timer_dai_wallclock(dev, &dd->wallclock);
break;
case COMP_TRIGGER_RELEASE:
/* only start the DAI if we are not XRUN handling */
Expand All @@ -578,7 +578,7 @@ static int dai_comp_trigger(struct comp_dev *dev, int cmd)
}

/* update starting wallclock */
platform_dai_wallclock(dev, &dd->wallclock);
drivers_timer_dai_wallclock(dev, &dd->wallclock);
break;
case COMP_TRIGGER_XRUN:
dd->xrun = 1;
Expand Down
8 changes: 4 additions & 4 deletions src/audio/pipeline.c
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ static int timestamp_downstream(struct comp_dev *start,

if (current->comp.type == SOF_COMP_DAI ||
current->comp.type == SOF_COMP_SG_DAI) {
platform_dai_timestamp(current, posn);
drivers_timer_dai_timestamp(current, posn);
return 1;
}
}
Expand Down Expand Up @@ -1052,7 +1052,7 @@ static int timestamp_upstream(struct comp_dev *start,

if (current->comp.type == SOF_COMP_DAI ||
current->comp.type == SOF_COMP_SG_DAI) {
platform_dai_timestamp(current, posn);
drivers_timer_dai_timestamp(current, posn);
return 1;
}
}
Expand Down Expand Up @@ -1085,7 +1085,7 @@ static int timestamp_upstream(struct comp_dev *start,
void pipeline_get_timestamp(struct pipeline *p, struct comp_dev *host,
struct sof_ipc_stream_posn *posn)
{
platform_host_timestamp(host, posn);
drivers_timer_host_timestamp(host, posn);

if (host->params.direction == SOF_IPC_STREAM_PLAYBACK) {
timestamp_downstream(host, host, posn);
Expand All @@ -1099,7 +1099,7 @@ static void xrun(struct comp_dev *dev, void *data)
struct sof_ipc_stream_posn *posn = data;

/* get host timestamps */
platform_host_timestamp(dev, posn);
drivers_timer_host_timestamp(dev, posn);

/* send XRUN to host */
ipc_stream_send_xrun(dev, posn);
Expand Down
46 changes: 8 additions & 38 deletions src/drivers/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,44 +1,14 @@
noinst_LIBRARIES = libdrivers.a
SUBDIRS = intel

libdrivers_a_SOURCES = \
dw-dma.c
noinst_LTLIBRARIES = libdrivers.la

if BUILD_BAYTRAIL
libdrivers_a_SOURCES += \
byt-ssp.c
endif

if BUILD_CHERRYTRAIL
libdrivers_a_SOURCES += \
byt-ssp.c
endif

if BUILD_HASWELL
libdrivers_a_SOURCES += \
hsw-ssp.c
endif

if BUILD_BROADWELL
libdrivers_a_SOURCES += \
hsw-ssp.c
endif

if BUILD_APOLLOLAKE
libdrivers_a_SOURCES += \
apl-ssp.c \
hda-dma.c \
dmic.c
endif

if BUILD_CANNONLAKE
libdrivers_a_SOURCES += \
apl-ssp.c \
hda-dma.c \
dmic.c
endif

libdrivers_a_CFLAGS = \
libdrivers_la_CFLAGS = \
$(ARCH_CFLAGS) \
$(PLATFORM_INCDIR) \
$(SOF_INCDIR) \
$(ARCH_INCDIR)

# This lib is just composition of convenience libraries
libdrivers_la_SOURCES =

libdrivers_la_LIBADD = intel/libdrivers.la
17 changes: 17 additions & 0 deletions src/drivers/intel/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
noinst_LTLIBRARIES = libdrivers.la

libdrivers_la_CFLAGS = \
$(ARCH_CFLAGS) \
$(PLATFORM_INCDIR) \
$(SOF_INCDIR) \
$(ARCH_INCDIR)

libdrivers_la_SOURCES = dw-dma.c

if BUILD_CAVS
SUBDIRS = cavs
libdrivers_la_LIBADD = cavs/libdrivers.la
else
SUBDIRS = legacy
libdrivers_la_LIBADD = legacy/libdrivers.la
endif
15 changes: 15 additions & 0 deletions src/drivers/intel/cavs/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
noinst_LTLIBRARIES = libdrivers.la

libdrivers_la_SOURCES = \
clk.c \
dmic.c \
hda-dma.c \
interrupt.c \
ssp.c \
timer.c

libdrivers_la_CFLAGS = \
$(ARCH_CFLAGS) \
$(PLATFORM_INCDIR) \
$(SOF_INCDIR) \
$(ARCH_INCDIR)
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
* Janusz Jankowski <janusz.jankowski@linux.intel.com>
*/

#include <sof/drivers/clk.h>
#include <sof/clock.h>
#include <sof/io.h>
#include <sof/sof.h>
Expand Down Expand Up @@ -204,7 +205,7 @@ uint64_t clock_time_elapsed(int clock, uint64_t previous, uint64_t *current)
_current = arch_timer_get_system(NULL);
break;
case CLK_SSP:
_current = platform_timer_get(platform_timer);
_current = drivers_timer_get(platform_timer);
break;
default:
return 0;
Expand All @@ -219,7 +220,7 @@ uint64_t clock_time_elapsed(int clock, uint64_t previous, uint64_t *current)
clk_pdata->clk[clock].ticks_per_usec;
}

void init_platform_clocks(void)
void drivers_clock_init(void)
{
clk_pdata = rmalloc(RZONE_SYS, SOF_MEM_CAPS_RAM, sizeof(*clk_pdata));

Expand Down
4 changes: 2 additions & 2 deletions src/drivers/dmic.c → src/drivers/intel/cavs/dmic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1421,7 +1421,7 @@ static void dmic_irq_handler(void *data)
trace_value(val);

/* clear IRQ */
platform_interrupt_clear(dmic_irq(dai), 1);
drivers_interrupt_clear(dmic_irq(dai), 1);
}

static int dmic_probe(struct dai *dai)
Expand All @@ -1442,7 +1442,7 @@ static int dmic_probe(struct dai *dai)
/* register our IRQ handler */
interrupt_register(dmic_irq(dai), dmic_irq_handler, dai);

platform_interrupt_unmask(dmic_irq(dai), 1);
drivers_interrupt_unmask(dmic_irq(dai), 1);
interrupt_enable(dmic_irq(dai));

return 0;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ static inline void irq_lvl2_handler(void *data,

/* handle each child */
while (status) {

/* any IRQ for this child bit ? */
if ((status & 0x1) == 0)
goto next;
Expand Down Expand Up @@ -149,7 +148,7 @@ static struct irq_desc dsp_irq[PLATFORM_CORE_COUNT][4] = {
{IRQ_NUM_EXT_LEVEL5, irq_lvl2_level5_handler, } },
};

struct irq_desc *platform_irq_get_parent(uint32_t irq)
struct irq_desc *drivers_interrupt_irq_get_parent(uint32_t irq)
{
int core = SOF_IRQ_CPU(irq);

Expand All @@ -167,12 +166,12 @@ struct irq_desc *platform_irq_get_parent(uint32_t irq)
}
}

uint32_t platform_interrupt_get_enabled(void)
uint32_t drivers_interrupt_get_enabled(void)
{
return 0;
}

void platform_interrupt_mask(uint32_t irq, uint32_t mask)
void drivers_interrupt_mask(uint32_t irq, uint32_t mask)
{
int core = SOF_IRQ_CPU(irq);

Expand All @@ -193,10 +192,9 @@ void platform_interrupt_mask(uint32_t irq, uint32_t mask)
default:
break;
}

}

void platform_interrupt_unmask(uint32_t irq, uint32_t mask)
void drivers_interrupt_unmask(uint32_t irq, uint32_t mask)
{
int core = SOF_IRQ_CPU(irq);

Expand All @@ -217,14 +215,13 @@ void platform_interrupt_unmask(uint32_t irq, uint32_t mask)
default:
break;
}

}

void platform_interrupt_clear(uint32_t irq, uint32_t mask)
void drivers_interrupt_clear(uint32_t irq, uint32_t mask)
{
}

void platform_interrupt_init(void)
void drivers_interrupt_init(void)
{
int i, j;
int core = cpu_get_id();
Expand Down
4 changes: 2 additions & 2 deletions src/drivers/apl-ssp.c → src/drivers/intel/cavs/ssp.c
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ static void ssp_irq_handler(void *data)

/* clear IRQ */
ssp_write(dai, SSSR, ssp_read(dai, SSSR));
platform_interrupt_clear(ssp_irq(dai), 1);
drivers_interrupt_clear(ssp_irq(dai), 1);
}

static int ssp_probe(struct dai *dai)
Expand All @@ -744,7 +744,7 @@ static int ssp_probe(struct dai *dai)

/* register our IRQ handler */
interrupt_register(ssp_irq(dai), ssp_irq_handler, dai);
platform_interrupt_unmask(ssp_irq(dai), 1);
drivers_interrupt_unmask(ssp_irq(dai), 1);
interrupt_enable(ssp_irq(dai));

return 0;
Expand Down
33 changes: 17 additions & 16 deletions src/platform/intel/cavs/timer.c → src/drivers/intel/cavs/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,26 @@
#include <platform/shim.h>
#include <sof/debug.h>
#include <sof/audio/component.h>
#include <sof/drivers/timer.h>
#include <stdint.h>

void platform_timer_start(struct timer *timer)
void drivers_timer_start(struct timer *timer)
{
/* run timer */
shim_write64(SHIM_DSPWCT0C, 0);
shim_write(SHIM_DSPWCTCS,
shim_read(SHIM_DSPWCTCS) | SHIM_DSPWCTCS_T0A);
shim_read(SHIM_DSPWCTCS) | SHIM_DSPWCTCS_T0A);
}

void platform_timer_stop(struct timer *timer)
void drivers_timer_stop(struct timer *timer)
{
/* stop timer */
shim_write64(SHIM_DSPWCT0C, 0);
shim_write(SHIM_DSPWCTCS,
shim_read(SHIM_DSPWCTCS) & ~SHIM_DSPWCTCS_T0A);
shim_read(SHIM_DSPWCTCS) & ~SHIM_DSPWCTCS_T0A);
}

int platform_timer_set(struct timer *timer, uint64_t ticks)
int drivers_timer_set(struct timer *timer, uint64_t ticks)
{
/* a tick value of 0 will not generate an IRQ */
if (ticks == 0)
Expand All @@ -62,27 +63,27 @@ int platform_timer_set(struct timer *timer, uint64_t ticks)
/* set new value and run */
shim_write64(SHIM_DSPWCT0C, ticks);
shim_write(SHIM_DSPWCTCS,
shim_read(SHIM_DSPWCTCS) | SHIM_DSPWCTCS_T0A);
shim_read(SHIM_DSPWCTCS) | SHIM_DSPWCTCS_T0A);

return 0;
}

void platform_timer_clear(struct timer *timer)
void drivers_timer_clear(struct timer *timer)
{
/* write 1 to clear the timer interrupt */
shim_write(SHIM_DSPWCTCS,
shim_read(SHIM_DSPWCTCS) | SHIM_DSPWCTCS_T0T);
shim_read(SHIM_DSPWCTCS) | SHIM_DSPWCTCS_T0T);
}

uint64_t platform_timer_get(struct timer *timer)
uint64_t drivers_timer_get(struct timer *timer)
{
// return arch_timer_get_system(timer);
return (uint64_t)shim_read64(SHIM_DSPWC);
}

/* get timestamp for host stream DMA position */
void platform_host_timestamp(struct comp_dev *host,
struct sof_ipc_stream_posn *posn)
void drivers_timer_host_timestamp(struct comp_dev *host,
struct sof_ipc_stream_posn *posn)
{
int err;

Expand All @@ -93,8 +94,8 @@ void platform_host_timestamp(struct comp_dev *host,
}

/* get timestamp for DAI stream DMA position */
void platform_dai_timestamp(struct comp_dev *dai,
struct sof_ipc_stream_posn *posn)
void drivers_timer_dai_timestamp(struct comp_dev *dai,
struct sof_ipc_stream_posn *posn)
{
int err;

Expand All @@ -109,13 +110,13 @@ void platform_dai_timestamp(struct comp_dev *dai,
}

/* get current wallclock for componnent */
void platform_dai_wallclock(struct comp_dev *dai, uint64_t *wallclock)
void drivers_timer_dai_wallclock(struct comp_dev *dai, uint64_t *wallclock)
{
*wallclock = shim_read64(SHIM_DSPWC);
}

int platform_timer_register(struct timer *timer,
void (*handler)(void *arg), void *arg)
static int platform_timer_register(struct timer *timer,
void (*handler)(void *arg), void *arg)
{
return interrupt_register(timer->irq, handler, arg);
}
Expand Down
Loading