Skip to content

Conversation

@nategraff-sifive
Copy link
Contributor

GPIO external interrupt lines need to be offset by RISCV_MAX_GENERIC_IRQ. I missed this when I converted the SiFive GPIO driver to support DeviceTree and it broke GPIO external interrupts.

IRQ_CONNECT calls in the SiFive GPIO driver were misconfigured when the
conversion to DeviceTree support occurred.

Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
@nategraff-sifive nategraff-sifive added area: GPIO area: RISCV RISCV Architecture (32-bit & 64-bit) labels Oct 15, 2018
@codecov-io
Copy link

Codecov Report

Merging #10613 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #10613   +/-   ##
=======================================
  Coverage   53.19%   53.19%           
=======================================
  Files         211      211           
  Lines       25828    25828           
  Branches     5686     5686           
=======================================
  Hits        13738    13738           
  Misses       9781     9781           
  Partials     2309     2309

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 017a351...2e3a5b7. Read the comment docs.

@nashif nashif merged commit c0a6801 into zephyrproject-rtos:master Oct 16, 2018
@nategraff-sifive nategraff-sifive deleted the sifive-gpio-interrupts branch October 25, 2018 20:32
@nmeum
Copy link
Contributor

nmeum commented Apr 30, 2019

Shouldn't a similar change be necessary for other external interrupt sources as well? For example drivers/serial/uart_sifive.c. Because I noticed that, for IRQ 4 (UART1) riscv_plic_irq_enable is not called (even though UART1 is an external interrupt source) because 4 <= RISCV_MAX_GENERIC_IRQ.

void z_arch_irq_enable(unsigned int irq)
{
u32_t mie;
#if defined(CONFIG_RISCV_HAS_PLIC)
if (irq > RISCV_MAX_GENERIC_IRQ) {
riscv_plic_irq_enable(irq);
return;
}
#endif
/*
* CSR mie register is updated using atomic instruction csrrs
* (atomic read and set bits in CSR register)
*/
__asm__ volatile ("csrrs %0, mie, %1\n"
: "=r" (mie)
: "r" (1 << irq));
}

nmeum added a commit to beduino-project/zephyr that referenced this pull request Apr 30, 2019
IRQ_CONNECT and irq_enable calls in the SiFive UART driver were
misconfigured when the conversion to DeviceTree support occurred.

See also: zephyrproject-rtos#10613

Signed-off-by: Sören Tempel <soeren+git@soeren-tempel.net>
backporting bot pushed a commit that referenced this pull request May 1, 2019
IRQ_CONNECT and irq_enable calls in the SiFive UART driver were
misconfigured when the conversion to DeviceTree support occurred.

See also: #10613

Signed-off-by: Sören Tempel <soeren+git@soeren-tempel.net>
nashif pushed a commit that referenced this pull request May 1, 2019
IRQ_CONNECT and irq_enable calls in the SiFive UART driver were
misconfigured when the conversion to DeviceTree support occurred.

See also: #10613

Signed-off-by: Sören Tempel <soeren+git@soeren-tempel.net>
nashif pushed a commit that referenced this pull request May 3, 2019
IRQ_CONNECT and irq_enable calls in the SiFive UART driver were
misconfigured when the conversion to DeviceTree support occurred.

See also: #10613

Signed-off-by: Sören Tempel <soeren+git@soeren-tempel.net>
nashif pushed a commit that referenced this pull request Jun 11, 2019
IRQ_CONNECT and irq_enable calls in the SiFive UART driver were
misconfigured when the conversion to DeviceTree support occurred.

See also: #10613

Signed-off-by: Sören Tempel <soeren+git@soeren-tempel.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: GPIO area: RISCV RISCV Architecture (32-bit & 64-bit)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants