mbox series

[0/2] SH7709 DMA fixes

Message ID 20230506141703.65605-1-contact@artur-rojek.eu (mailing list archive)
Headers show
Series SH7709 DMA fixes | expand

Message

Artur Rojek May 6, 2023, 2:17 p.m. UTC
Hi, 

this series provides fixes to the SH7709 DMA controller, allowing the HP
Jornada 680 palmtop to boot Linux again. To my knowledge, this is the
first time in ~14 years someone tests upstream Linux on this device. And
with the included patches applied, I'm happy to announce that it still
works like a charm.

PS. What might be of interest to the sh-linux community, there's further
work towards this platform in my pipeline. E.g. I've added support for
the HD6446x PCMCIA controller, allowing Jornada 680 to use Ethernet and
Wi-Fi cards. However, what prevents proper upstream of such a driver is
the crude and antiquated code of the underlying platform base. For
example, the HD6446x bridge (`cchips/hd6446x/hd64461.c`) lacks the
concept of clocks, preventing the PCMCIA driver from hardware agnostic
clock gating. So what I'm looking into next is the cleanup of existing
platform code base, bringing it up-to-date with modern kernel APIs.
Hopefully it's not trying to bite more than I can chew, but eventually
ending up with Device Tree support would be really nice :)

Artur Rojek (2):
  sh: dma: fix `dmaor_read_reg`/`dmaor_write_reg` macros
  sh: dma: Correct the number of DMA channels in SH7709

 arch/sh/drivers/dma/Kconfig  | 10 ++++++----
 arch/sh/drivers/dma/dma-sh.c |  7 +++++--
 2 files changed, 11 insertions(+), 6 deletions(-)

Comments

John Paul Adrian Glaubitz May 6, 2023, 3:25 p.m. UTC | #1
Hi Artur!

Thanks a lot for your patches!

On Sat, 2023-05-06 at 16:17 +0200, Artur Rojek wrote:
> this series provides fixes to the SH7709 DMA controller, allowing the HP
> Jornada 680 palmtop to boot Linux again. To my knowledge, this is the
> first time in ~14 years someone tests upstream Linux on this device. And
> with the included patches applied, I'm happy to announce that it still
> works like a charm.

Wow, that sounds great! I will be happy to review your patches.

> PS. What might be of interest to the sh-linux community, there's further
> work towards this platform in my pipeline. E.g. I've added support for
> the HD6446x PCMCIA controller, allowing Jornada 680 to use Ethernet and
> Wi-Fi cards. However, what prevents proper upstream of such a driver is
> the crude and antiquated code of the underlying platform base. For
> example, the HD6446x bridge (`cchips/hd6446x/hd64461.c`) lacks the
> concept of clocks, preventing the PCMCIA driver from hardware agnostic
> clock gating. So what I'm looking into next is the cleanup of existing
> platform code base, bringing it up-to-date with modern kernel APIs.
> Hopefully it's not trying to bite more than I can chew, but eventually
> ending up with Device Tree support would be really nice :)

Yes, there is still a lot of modernization work to be done for SuperH!

Device tree has actually been worked on in the past and there is a patch
set by Yoshinori Sato to add support for device tree that got never merged,
see [1].

Geert and I are planning to have another look at these patches and see whether
we can get them into a shape where they can be merged. Maybe you can help us
with that effort.

I might not have the time for your patches today, but certainly next week
starting Monday. Very much looking forward to reviewing and merging them
into my SuperH tree [2].

Adrian

> [1] https://lore.kernel.org/all/1467564402-2649-1-git-send-email-ysato@users.sourceforge.jp/
> [2] https://git.kernel.org/pub/scm/linux/kernel/git/glaubitz/sh-linux.git/
Rich Felker May 6, 2023, 4:56 p.m. UTC | #2
On Sat, May 06, 2023 at 05:25:01PM +0200, John Paul Adrian Glaubitz wrote:
> Hi Artur!
> 
> Thanks a lot for your patches!
> 
> On Sat, 2023-05-06 at 16:17 +0200, Artur Rojek wrote:
> > this series provides fixes to the SH7709 DMA controller, allowing the HP
> > Jornada 680 palmtop to boot Linux again. To my knowledge, this is the
> > first time in ~14 years someone tests upstream Linux on this device. And
> > with the included patches applied, I'm happy to announce that it still
> > works like a charm.
> 
> Wow, that sounds great! I will be happy to review your patches.
> 
> > PS. What might be of interest to the sh-linux community, there's further
> > work towards this platform in my pipeline. E.g. I've added support for
> > the HD6446x PCMCIA controller, allowing Jornada 680 to use Ethernet and
> > Wi-Fi cards. However, what prevents proper upstream of such a driver is
> > the crude and antiquated code of the underlying platform base. For
> > example, the HD6446x bridge (`cchips/hd6446x/hd64461.c`) lacks the
> > concept of clocks, preventing the PCMCIA driver from hardware agnostic
> > clock gating. So what I'm looking into next is the cleanup of existing
> > platform code base, bringing it up-to-date with modern kernel APIs.
> > Hopefully it's not trying to bite more than I can chew, but eventually
> > ending up with Device Tree support would be really nice :)
> 
> Yes, there is still a lot of modernization work to be done for SuperH!
> 
> Device tree has actually been worked on in the past and there is a patch
> set by Yoshinori Sato to add support for device tree that got never merged,
> see [1].
> 
> Geert and I are planning to have another look at these patches and see whether
> we can get them into a shape where they can be merged. Maybe you can help us
> with that effort.

At one point I tried to rebase these to run on what was (at the time)
current, and had partial success -- I got it to start booting with DT
under qemu, but my work rebasing the PCI stuff had problems and IIRC
prevented getting virtio working -- it was crashing at that stage. If
there's interest I can see if I can dig up that rebased branch in case
it would be useful to look at. It probably has mistakes but might be a
start for looking at what changed out from under the patches that
needs to change.

Rich
John Paul Adrian Glaubitz May 11, 2023, 8:12 p.m. UTC | #3
Hi Rich!

On Sat, 2023-05-06 at 12:56 -0400, Rich Felker wrote:
> At one point I tried to rebase these to run on what was (at the time)
> current, and had partial success -- I got it to start booting with DT
> under qemu, but my work rebasing the PCI stuff had problems and IIRC
> prevented getting virtio working -- it was crashing at that stage. If
> there's interest I can see if I can dig up that rebased branch in case
> it would be useful to look at. It probably has mistakes but might be a
> start for looking at what changed out from under the patches that
> needs to change.

Yes, there is definitely interest. Apologies for the late reply, I wanted
to send an answer earlier but it unfortunately went off my radar.

Adrian
John Paul Adrian Glaubitz July 6, 2023, 6:34 a.m. UTC | #4
Hi Artur!

On Sat, 2023-05-06 at 16:17 +0200, Artur Rojek wrote:
> this series provides fixes to the SH7709 DMA controller, allowing the HP
> Jornada 680 palmtop to boot Linux again. To my knowledge, this is the
> first time in ~14 years someone tests upstream Linux on this device. And
> with the included patches applied, I'm happy to announce that it still
> works like a charm.

Your first batch of patches has been merged into Linus' tree now:

> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c17414a273b81fe4e34e11d69fc30cc8b1431614

> PS. What might be of interest to the sh-linux community, there's further
> work towards this platform in my pipeline. E.g. I've added support for
> the HD6446x PCMCIA controller, allowing Jornada 680 to use Ethernet and
> Wi-Fi cards. However, what prevents proper upstream of such a driver is
> the crude and antiquated code of the underlying platform base. For
> example, the HD6446x bridge (`cchips/hd6446x/hd64461.c`) lacks the
> concept of clocks, preventing the PCMCIA driver from hardware agnostic
> clock gating. So what I'm looking into next is the cleanup of existing
> platform code base, bringing it up-to-date with modern kernel APIs.
> Hopefully it's not trying to bite more than I can chew, but eventually
> ending up with Device Tree support would be really nice :)

Feel free to start sending in more patches addressing the issues mentioned above.

Adrian