Commit Graph

3345 Commits

Author SHA1 Message Date
Marcin Rajwa 0683635252 kpb: record history buffer update while draining
This patch enables draining task to know how
much data was buffered since draining task
has been started.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 39f24fbc2a kpb: add secure reset while buffering
This patch takes care of secure reset while
KPB is in buffering state.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 60f4f9baa9 kpb: change input parameter to kpb_buffer_data()
Due to secure reset procedure this function needs
a pointer to component device now.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 053f4f90fe kpb: add timeout for buffering function
This patch adds timeout to buffering. So now
if we are stuck in buffering due to i.e
pointers corruption we can detect that, log
error message and leave that procedure.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa d150379651 kpb: rework main copy function
This patch reworks kpb_copy() adding
explicit state handling. Improves redability and
function performance. This way we don't need to
search for things that are not needed at the time.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 7c4764cfa4 kpb: block KPB prepare() if reset is not done
This patch checks if reset request has been
completed before KPB can be prepared again.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa f27cd973f1 kpb: add function to reset history buffer pointers
This adds function to reset history buffer key
pointers.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 8994a7ff81 kpb: make reset more secure
This patch takes care of secure reset.
Now we check in what state KPB currently is.
If this state involves some ongoing work
like draining or buffering then KPB will
register reset request and terminate this
job gracefully.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 9f746c01c0 kpb: extend internal states
This commit adds more detailed states into KPB

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 6027b3e5f7 kpb: unregister kpb from notifications at free()
This change unregisters KPB from async
notifications during kpb_free(). Additionally
reset main history buffer pointer.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 0b279e06bc kpb: move history buffer allocation to prepare
This change moves history buffer allocation
from kpb_new() to kpb_prepare(). This is to
folow the calling convention with kernel.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 444effac9c kpb: pass component device in events
This patch passes comp device pointer to buffering
and draining function as this pointer is needed to
finish reset requests.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 0bb593b15e kpb: unify component data naming
This patch renames component data local
variables name from 'cd' to 'kpb'.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa d180cd343f memory: set LPSRAM related defines to zero if LP not configured
This patch sets all LPSRAM related memory defines to
zero if CONFIG_LP_MEMORY_BANKS is not defined.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 19:29:59 +02:00
Marcin Rajwa f0e5e484a6 kconfig: enable LPSRAM by default for CNL
This patch enables LPSRAM memory by default on
all APL platforms.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 19:29:59 +02:00
Marcin Rajwa 160dbf7441 kconfig: enable LPSRAM by default for APL
This patch enables LPSRAM memory by default on
all APL platforms.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 19:29:59 +02:00
Marcin Rajwa bcad85bf50 memory: fix LPSRAM defines on CANNONLAKE
Enable whole LPSRAM bank to be allocated by heap buffer.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 19:29:59 +02:00
Marcin Rajwa 01969e083a bootloader: enable LPSRAM depending on CONFIG
This patch changes the rules of LPSRAM enabling.
Now it is no longer platform dependent but rather
rely on config selection.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 19:29:59 +02:00
Marcin Rajwa 3e06a3569a Kconfig: add option to enable CONFIG_LP_SRAM
Choose to power ON LPSRAM banks in Kconfig menu.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 19:29:59 +02:00
Marcin Rajwa dcc4119ae2 shim: add LSPGCTL register relative offset
To be able to use register read interfaces like shim_read()
we need to specify offset. This patch adds such offset for
LSPGCTL register.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 19:29:59 +02:00
Adrian Bonislawski bb823ce7eb trace: fix build error if traces are disabled
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2019-07-30 19:20:40 +02:00
Marcin Rajwa 04d0a165b8 detector: rework detection algorithm to support 24 bit samples
This patch modifies the dection algortihm to support
24 bit samples.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 17:24:06 +02:00
Marcin Rajwa b2c6dc7425 detector: verify if format is supported
This patch adds verification if sample width is
supported by detector.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 17:24:06 +02:00
Marcin Rajwa 6115724ce8 detector: update prepare() method
This change updates prepare() method to support proper
threshold for 24 bit samples.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 17:24:06 +02:00
Marcin Rajwa f19acba8e1 detector: update apply_config() procedure
This patch applies detector config according to sample
width.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 17:24:06 +02:00
Marcin Rajwa 0db051b83a detector: add new threshold for 24 bit samples
This patch adds news threshold value for 24 bit samples.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 17:24:06 +02:00
Marcin Rajwa 2bfe9c48c4 detector: update ABI to support 24 and 32 bit samples
This patch updates header file to support 24/32 bit samples
and also adds new default config.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 17:24:06 +02:00
Marcin Rajwa c4a7fe191a sys_agent: add option to temporarily enable/disable
This patch adds an option to temporarily disable system
agent. This is especially needed when SOF is performing
long last tasks like draining.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 14:28:59 +02:00
Bartosz Kokoszko f7809a2ee3 alloc: fix blocks update in alloc_cont_blocks()
Add proper stop condition during block hdr update
in alloc_cont_blocks() function.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2019-07-27 14:35:19 +02:00
Bartosz Kokoszko f3d79e7398 component: add comp_set_sink_buffer() function
Component in comp_prepare() should change sink buffer
only when sink component is not connected to dma.
comp_set_sink_buffer() checks whether sink component
is not connected to dma and in that case it try to
resize sink buffer.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2019-07-27 13:30:18 +02:00
Bartosz Kokoszko e36f584d0c dai: dma: add dma buffer alignment in dai_params()
Add dw dma buffer alignment in order to provide the
same buffer alignment as in the host side. Without
alignment it may appear mismatch between host and
dai buffer in simple pass-through pipeline (host->dai).

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2019-07-27 13:30:18 +02:00
Tomasz Lauda 5449dc2a30 panic: keep interrupts disabled after panic
This patch fixes the issue, where we've reenabled
the interrupts for the DSP, which sometimes caused
immediate DSP exception and overwrite of our dump.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-27 12:55:41 +02:00
Tomasz Lauda 736ca2e446 panic: read epc1 only if set
Fixes the bug, where it tried to read epc1 value even,
if the pointer hasn't been previously set. It is only set
when there is an exception.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-27 12:55:41 +02:00
Tomasz Lauda 418ddec569 panic: move panic related functions to new panic.h
Moves panic related functions from arch/sof.h to newly created
arch/debug/panic.h. Also change definition of arch_dump_regs
function to take dump buffer from caller. It decreases the
number of included headers in arch/debug/panic.h.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-27 12:55:41 +02:00
Tomasz Lauda 0ec0ff73bd arch: xtensa: add check for UserFrame's size alignment
Adds assert to verify if UserFrame's size is 16 bytes aligned.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-26 19:19:16 +02:00
Tomasz Lauda 3e1eebe92c arch: xtensa: extend UserFrame
Extends UserFrame in order to support full
context switch in the future, which will allow
to preempt tasks on the same irq level. Also this
patch adds additional 8-byte alignment fields to
automatically support coprocessors requirements.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-26 19:19:16 +02:00
Janusz Jankowski 10cca53b8c Revert "ipc: align stream.h with kernel"
This reverts commit 6119126d90.
2019-07-26 15:40:08 +02:00
Janusz Jankowski 4eeba9c29e Revert "host: fix wrong check for irq"
This reverts commit 8256465955.
2019-07-26 15:40:08 +02:00
Guennadi Liakhovetski 842e4b5b9f interrupt: add doxygen documentation for struct irq_desc
Other global interrupt-related structs are already documented, add
missing documentation to struct irq_desc

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2019-07-26 13:31:05 +01:00
Guennadi Liakhovetski d5081da8fe interrupt: reduce the use of the container_of() macro
Instead of passing a pointer to the interrupt descriptor, embedded in
a cascading interrupt object and then using container_of() to get
back to the cascading interrupt, pass a pointer to it directly to
functions.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2019-07-26 13:31:05 +01:00
Guennadi Liakhovetski ac456d0a13 interrupt: support arbitrary interrupt controller cascading
When registering a cascading interrupt controller as a child of
another interrupt controller, no new child descriptor has to be
allocated, instead the embedded into the cascading interrupt
controller object descriptor has to be used.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2019-07-26 13:31:05 +01:00
Guennadi Liakhovetski f0e5094c4a interrupt: switch from bitfields to dynamic interrupt mapping
Currently on cAVS platforms the two kinds of interrupts are treated
differently: the native DSP interrupts and "level" interrupts,
multiplexed by cascading interrupt controllers. For the latter
bitfields are used with both the parent DSP interrupt and the child
multiplexed interrupt numbers encoded in them. This is inflexible and
doesn't scale when more cascading interrupt controllers are added.
This patch switches over from using those bitfields to dynamically
mapping cascaded interrupts into a single plain interrupt number
space. Specifically this patch does the following:

- For interrupt conttrollers it adds an .irq_base field, which is the
  base for child interrupts, multiplexed by this controller.

- An interrupt mapping function interrupt_get_irq() is added, which
  uses the name of the cascading interrupt controller and an
  interrupt number on that controller to create a logical interrupt
  number.

- All uses of SOF_IRQ() and SOF_ID_IRQ() and related bitfield-
  manipulation macros are removed.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2019-07-26 13:31:05 +01:00
Guennadi Liakhovetski 3f416a3e02 interrupt: call the interrupt handler only for enabled descriptors
When multiple interrupt handlers share the same interrupt, only
those, that enabled the interrupt on a specific CPU, have to be
called on that CPU.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2019-07-26 13:31:05 +01:00
Guennadi Liakhovetski 1712beab30 spi: remove the unused irq field
The SPI driver only supports the DMA mode, its IRQ line isn't used
and the IRQ number in Sue Creek data is wrong. Remove the field
completely.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2019-07-26 13:31:05 +01:00
Guennadi Liakhovetski fe5886808b idc: add an irq private data member
Use the platform provided IDC IRQ number only once and save the
number in a private field. This relies on the fact, that the
interrupt number is the same on all cores.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2019-07-26 13:31:05 +01:00
Guennadi Liakhovetski d79c9190e9 schedule: add an irq private data member
Use the platform provided scheduler IRQ number only once and save the
number in a private field.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2019-07-26 13:31:05 +01:00
Guennadi Liakhovetski fb7bf77c51 interrupt: use the parent IRQ instead of SOF_IRQ_NUMBER()
Where available, use the IRQ number of the parent instead of
extracting it from the child's interrupt, using SOF_IRQ_NUMBER().

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2019-07-26 13:31:05 +01:00
Guennadi Liakhovetski 19ac2359c8 interrupt: SOF_IRQ_NUMBER() for DSP interrupts is not needed
DSP interrupts have their own interrupt number in parent interrupt
bits, therefore using SOF_IRQ_NUMBER() for them is redundant.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2019-07-26 13:31:05 +01:00
Guennadi Liakhovetski 6f238763fa interrupt: stop using SOF_IRQ_CPU()
The only two uses of SOF_IRQ_CPU() are currently in irq_mask() and
irq_unmask() on cAVS. However, those functions are always called
after interrupt_get_parent(), which makes sure, that the CPU, encoded
into the IRQ is the same as the current one. Therefore we can also
just use the current CPU in irq_mask() and irq_unmask().

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2019-07-26 13:31:05 +01:00
Guennadi Liakhovetski 4d3d2083f7 interrupt: add a cpu argument to interrupt_(un)mask()
Most interrupts in SOF are handled completely locally: they are
registered, enabled, disabled, and handled on one and the same core.
There is only one case, where interrupts have to be unmasked on a
different core: in idc_enable_interrupts(). To make this possible
without using the CPU field in the IRQ bitfield we add a "cpu"
argument to interrupt_mask() and interrupt_unmask() functions.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2019-07-26 13:31:05 +01:00