Re: [Article] NuttX on Star64 JH7110: RISC-V PLIC Interrupts and Serial I/O

2023-08-02 Thread Alan C. Assis
Congratulations Lup!

I'm looking forward to see Star64 JH7110 integrated into mainline.

BR,

Alan

On 8/2/23, Lee, Lup Yuen  wrote:
> Thanks Tomek! Here's the backup link for the article (since Codeberg is
> down): https://lupyuen.github.io/articles/plic
>
> I found out (from Hacker News) that JH7110 uses a Synopsys DesignWare 8250
> UART that has a peculiar problem with the Line Control Register (LCR)... If
> we write to LCR while the UART is busy, it will trigger spurious UART
> Interrupts.
>
> The fix is to wait for the UART to be not busy before writing to LCR.
> Here's my proposed patch for the NuttX 16550 UART Driver
> (drivers/serial/uart_16550.c):
> https://github.com/lupyuen2/wip-pinephone-nuttx/pull/36/files#diff-f208234edbfb636de240a0fef1c85f9cecb37876d5bc91ffb759f70a1e96b1d1
>
> We're all ready to merge NuttX for JH7110! :-)
>
> Lup
>
> On Wed, Aug 2, 2023 at 7:19 AM Tomek CEDRO  wrote:
>
>> On Wed, Aug 2, 2023 at 1:14 AM Lee, Lup Yuen  wrote:
>> > NuttX on Star64 JH7110 RISC-V SBC is almost ready! But we're stuck with
>> > 16550 UART Controller firing too many Spurious Interrupts.
>>
>> Good luck Lup! IRQ storm is (was?) known problem on a desktop machines
>> too! I hope you fight that beast soon :-) :-)
>>
>> --
>> CeDeROM, SQ7MHZ, http://www.tomek.cedro.info
>>
>


Re: [Article] NuttX on Star64 JH7110: RISC-V PLIC Interrupts and Serial I/O

2023-08-01 Thread Lee, Lup Yuen
Thanks Tomek! Here's the backup link for the article (since Codeberg is
down): https://lupyuen.github.io/articles/plic

I found out (from Hacker News) that JH7110 uses a Synopsys DesignWare 8250
UART that has a peculiar problem with the Line Control Register (LCR)... If
we write to LCR while the UART is busy, it will trigger spurious UART
Interrupts.

The fix is to wait for the UART to be not busy before writing to LCR.
Here's my proposed patch for the NuttX 16550 UART Driver
(drivers/serial/uart_16550.c):
https://github.com/lupyuen2/wip-pinephone-nuttx/pull/36/files#diff-f208234edbfb636de240a0fef1c85f9cecb37876d5bc91ffb759f70a1e96b1d1

We're all ready to merge NuttX for JH7110! :-)

Lup

On Wed, Aug 2, 2023 at 7:19 AM Tomek CEDRO  wrote:

> On Wed, Aug 2, 2023 at 1:14 AM Lee, Lup Yuen  wrote:
> > NuttX on Star64 JH7110 RISC-V SBC is almost ready! But we're stuck with
> > 16550 UART Controller firing too many Spurious Interrupts.
>
> Good luck Lup! IRQ storm is (was?) known problem on a desktop machines
> too! I hope you fight that beast soon :-) :-)
>
> --
> CeDeROM, SQ7MHZ, http://www.tomek.cedro.info
>


Re: [Article] NuttX on Star64 JH7110: RISC-V PLIC Interrupts and Serial I/O

2023-08-01 Thread Tomek CEDRO
On Wed, Aug 2, 2023 at 1:14 AM Lee, Lup Yuen  wrote:
> NuttX on Star64 JH7110 RISC-V SBC is almost ready! But we're stuck with
> 16550 UART Controller firing too many Spurious Interrupts.

Good luck Lup! IRQ storm is (was?) known problem on a desktop machines
too! I hope you fight that beast soon :-) :-)

-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info


[Article] NuttX on Star64 JH7110: RISC-V PLIC Interrupts and Serial I/O

2023-08-01 Thread Lee, Lup Yuen
NuttX on Star64 JH7110 RISC-V SBC is almost ready! But we're stuck with
16550 UART Controller firing too many Spurious Interrupts.

In this article, we explain…
(1) Why there’s No Console Output from NuttX Apps
(2) How Serial I/O works in NuttX QEMU
(3) How UART I/O differs for Star64 vs QEMU
(4) What’s the RISC-V Platform-Level Interrupt Controller (PLIC)
(5) Why we delegate RISC-V Machine-Mode Interrupts to Supervisor-Mode
(6) How NuttX Star64 handles UART Interrupts
(7) Which leads to a new problem: 16550 UART Controller fires too many
Spurious Interrupts!

Check out the article: https://lupyuen.codeberg.page/articles/plic.html

Lup