mbox series

[0/3] serial: sh-sci: Clock handling improvements

Message ID cover.1639663832.git.geert+renesas@glider.be (mailing list archive)
Headers show
Series serial: sh-sci: Clock handling improvements | expand

Message

Geert Uytterhoeven Dec. 16, 2021, 2:17 p.m. UTC
Hi Greg, Jiri,

This patch series contains a legacy cleanup and two small improvements
for the Renesas (H)SCI(F) serial driver.

This been tested on a various of Renesas (SuperH and ARM) SoCs.

Thanks!

Geert Uytterhoeven (3):
  serial: sh-sci: Drop support for "sci_ick" clock
  serial: sh-sci: Use dev_err_probe()
  serial: sh-sci: Use devm_clk_get_optional()

 drivers/tty/serial/sh-sci.c | 37 +++++++++++--------------------------
 1 file changed, 11 insertions(+), 26 deletions(-)

Comments

Rob Landley Dec. 19, 2021, 10:35 a.m. UTC | #1
On 12/16/21 8:17 AM, Geert Uytterhoeven wrote:
> 	Hi Greg, Jiri,
> 
> This patch series contains a legacy cleanup and two small improvements
> for the Renesas (H)SCI(F) serial driver.

Tested-by: Rob Landley <rob@landley.net>

By the way, did you ever figure out how to get the first serial port to work on
qemu so qemu-system-sh4 doesn't have to "-serial null -serial mon:stdio" to get
a serial console?

Rob
Geert Uytterhoeven Dec. 19, 2021, 10:53 a.m. UTC | #2
Hi Rob,

On Sun, Dec 19, 2021 at 11:34 AM Rob Landley <rob@landley.net> wrote:
> On 12/16/21 8:17 AM, Geert Uytterhoeven wrote:
> >       Hi Greg, Jiri,
> >
> > This patch series contains a legacy cleanup and two small improvements
> > for the Renesas (H)SCI(F) serial driver.
>
> Tested-by: Rob Landley <rob@landley.net>

Thanks!

> By the way, did you ever figure out how to get the first serial port to work on
> qemu so qemu-system-sh4 doesn't have to "-serial null -serial mon:stdio" to get
> a serial console?

Nope, same as last time you asked ;-)

However, upon a fresh look at linux/arch/sh/boards/mach-r2d/setup.c,
I noticed something I missed before: the SCI port is not available
as a UART, as it is used to talk SPI to an RTC.  So that means qemu
has the hardware description wrong?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Rob Landley Dec. 20, 2021, 10:29 a.m. UTC | #3
On 12/19/21 4:53 AM, Geert Uytterhoeven wrote:
>> By the way, did you ever figure out how to get the first serial port to work on
>> qemu so qemu-system-sh4 doesn't have to "-serial null -serial mon:stdio" to get
>> a serial console?
> 
> Nope, same as last time you asked ;-)

Well it had been a couple years, you never know...

> However, upon a fresh look at linux/arch/sh/boards/mach-r2d/setup.c,
> I noticed something I missed before: the SCI port is not available
> as a UART, as it is used to talk SPI to an RTC.

/* Single Epson RTC-9701JE attached on CS0 */

Huh. That does explain the CONFIG_RTC_DRV_R9701=y in rts7751r2d*_defconfig.
(And also SPI SPI_SH_SCI MFD_SM501 RTC_CLASS and RTC_DRV_SH RTC_HCTOSYS which
I've never gotten connected to QEMU.)

> So that means qemu
> has the hardware description wrong?

It would be nice if qemu-system-sh4 grew an RTC. Looks like Sato-san and Magnus
Damm are the qemu-system-sh4 maintainers? (cc'd)

Thanks,

Rob
Yoshinori Sato Dec. 22, 2021, 9:25 a.m. UTC | #4
On Mon, 20 Dec 2021 19:29:24 +0900,
Rob Landley wrote:
> 
> On 12/19/21 4:53 AM, Geert Uytterhoeven wrote:
> >> By the way, did you ever figure out how to get the first serial port to work on
> >> qemu so qemu-system-sh4 doesn't have to "-serial null -serial mon:stdio" to get
> >> a serial console?
> > 
> > Nope, same as last time you asked ;-)
> 
> Well it had been a couple years, you never know...
> 
> > However, upon a fresh look at linux/arch/sh/boards/mach-r2d/setup.c,
> > I noticed something I missed before: the SCI port is not available
> > as a UART, as it is used to talk SPI to an RTC.

Yes.
R2D plus serial port connected SuperI/O UART. It not cpu on-chip SCI.
It is not possible to check SCI with the standard version of qemu-system-sh4.
There is SCI emulation, so you can change it to connect to the qemu serial port.

> /* Single Epson RTC-9701JE attached on CS0 */
> 
> Huh. That does explain the CONFIG_RTC_DRV_R9701=y in rts7751r2d*_defconfig.
> (And also SPI SPI_SH_SCI MFD_SM501 RTC_CLASS and RTC_DRV_SH RTC_HCTOSYS which
> I've never gotten connected to QEMU.)

SPI_SH_SCI using SCI pin like GPIO.
qemu-system-sh4 is not support this.

> > So that means qemu
> > has the hardware description wrong?
> 
> It would be nice if qemu-system-sh4 grew an RTC. Looks like Sato-san and Magnus
> Damm are the qemu-system-sh4 maintainers? (cc'd)
> 
> Thanks,
> 
> Rob