mbox series

[v2,00/28] sparc32: sunset sun4m and sun4d

Message ID 20240309-sunset-v2-0-f09912574d2c@ravnborg.org
Headers show
Series sparc32: sunset sun4m and sun4d | expand

Message

Sam Ravnborg via B4 Relay March 9, 2024, 6:15 p.m. UTC
This is the second attempt to sunset sun4m and sun4d.
See [1] for the inital attempt.

The sun4m and sun4d parts of the kernel have seen no real interest
for several years now. Last time a few people surfaced, but it was
either due to a personal project or for nostalgic reasons.
It is time to let go and drop the parts of sparc32 that in reality
are not in use.

LEON from Frontgrade Gaisler is the only real user of sparc32,
and this patchset reduces sparc32 to what is required by LEON.

The defconfig is first adapted to the one used by Gaisler.
Then the patches removes sun4m and sun4d specific
implementations such as small drivers, SMP support, IRQ suppor etc.

Removing sun4m and sun4d support allowed removal of the run time
patching of the code as well as a lot of assembler code.
The result is a much cleaner assembler code that is easier to
understand and thus maintain and extend.

Changes in v2:
  - Rebased on top of Andreas' for-next branch
  - Collected ack's
  - Added patch to remove cpuid patching (Andreas)
  - Run-time testing using qemu (Andreas, Mark Cave-Ayland)

	Sam

[1]: https://lore.kernel.org/all/20201218184347.2180772-1-sam@ravnborg.org/

---
Sam Ravnborg (28):
      sparc32: Update defconfig to LEON SMP
      sparc32: Drop sun4m/sun4d support from head_32.S
      sparc32: Drop floppy support
      sparc32: Drop sun4m specific led driver
      sparc32: Drop sun specific power management drivers
      sparc32: Drop auxio support
      sparc32: Drop run-time patching of ipi trap
      sparc32: Drop patching of interrupt vector
      sparc32: Drop sun4m/sun4d specific irq handling
      sparc32: Drop sun4d/sun4m smp support
      sparc32: Drop pcic support
      sparc32: Drop mbus support
      sparc32: Drop unused function __get_{phys,iospace}
      sparc32: Drop unused mmu models
      sparc32: Drop check for sparc_model
      sparc32: Drop use of sparc_config
      sparc32: Drop run-time cpuid patching
      sparc32: Drop run-time patching of ASI instructions
      sparc32: Drop support for 7 register windows
      sparc32: Drop additional sun4d bits
      sparc32: Drop unused prom ranges support
      sparc32: Drop unused sbus iommu support
      sparc32: Drop sun4m irq support
      sparc32: Drop unused trampoline code
      sparc32: Drop config SPARC_LEON
      sparc32: Drop sbus support
      sbus: char: Drop now unused uctrl driver
      fbdev/p9100: Drop now unused driver p9100

 arch/sparc/Kconfig                    |  54 +--
 arch/sparc/configs/sparc32_defconfig  | 170 +++----
 arch/sparc/include/asm/asmmacro.h     |  22 -
 arch/sparc/include/asm/auxio_32.h     |  73 +--
 arch/sparc/include/asm/cpu_type.h     |  18 -
 arch/sparc/include/asm/elf_32.h       |   2 -
 arch/sparc/include/asm/fb.h           |   8 +-
 arch/sparc/include/asm/floppy.h       |   2 -
 arch/sparc/include/asm/floppy_32.h    | 393 ----------------
 arch/sparc/include/asm/io-unit.h      |  59 ---
 arch/sparc/include/asm/io_32.h        |  83 ----
 arch/sparc/include/asm/iommu.h        |   2 -
 arch/sparc/include/asm/iommu_32.h     | 122 -----
 arch/sparc/include/asm/irq_32.h       |   2 -
 arch/sparc/include/asm/mbus.h         |  97 ----
 arch/sparc/include/asm/mxcc.h         | 138 ------
 arch/sparc/include/asm/obio.h         | 226 ---------
 arch/sparc/include/asm/oplib_32.h     |  11 -
 arch/sparc/include/asm/pcic.h         | 130 ------
 arch/sparc/include/asm/pgtable_32.h   |  24 -
 arch/sparc/include/asm/pgtsrmmu.h     |  33 +-
 arch/sparc/include/asm/ross.h         | 192 --------
 arch/sparc/include/asm/sbi.h          | 116 -----
 arch/sparc/include/asm/sections.h     |   3 -
 arch/sparc/include/asm/setup.h        |  12 -
 arch/sparc/include/asm/swift.h        | 107 -----
 arch/sparc/include/asm/switch_to_32.h |   1 -
 arch/sparc/include/asm/timer_32.h     |   1 +
 arch/sparc/include/asm/tsunami.h      |  65 ---
 arch/sparc/include/asm/turbosparc.h   | 126 -----
 arch/sparc/include/asm/viking.h       | 255 -----------
 arch/sparc/include/asm/winmacro.h     |  12 -
 arch/sparc/kernel/Makefile            |   8 +-
 arch/sparc/kernel/apc.c               | 196 --------
 arch/sparc/kernel/auxio_32.c          | 139 ------
 arch/sparc/kernel/cpu.c               |   1 -
 arch/sparc/kernel/devices.c           |  10 +-
 arch/sparc/kernel/entry.S             | 426 +----------------
 arch/sparc/kernel/etrap_32.S          |  50 +-
 arch/sparc/kernel/head_32.S           | 255 +----------
 arch/sparc/kernel/ioport.c            |  55 +--
 arch/sparc/kernel/irq.h               |  84 +---
 arch/sparc/kernel/irq_32.c            | 133 +-----
 arch/sparc/kernel/kernel.h            |  53 +--
 arch/sparc/kernel/led.c               | 146 ------
 arch/sparc/kernel/leon_kernel.c       |  53 +--
 arch/sparc/kernel/leon_pmc.c          |  16 +-
 arch/sparc/kernel/leon_smp.c          |   3 -
 arch/sparc/kernel/of_device_32.c      |  18 +-
 arch/sparc/kernel/pcic.c              | 840 ----------------------------------
 arch/sparc/kernel/pmc.c               | 100 ----
 arch/sparc/kernel/process_32.c        |  10 -
 arch/sparc/kernel/rtrap_32.S          |  73 ++-
 arch/sparc/kernel/setup_32.c          | 109 -----
 arch/sparc/kernel/smp_32.c            | 102 +----
 arch/sparc/kernel/sun4d_irq.c         | 519 ---------------------
 arch/sparc/kernel/sun4d_smp.c         | 415 -----------------
 arch/sparc/kernel/sun4m_irq.c         | 478 -------------------
 arch/sparc/kernel/sun4m_smp.c         | 275 -----------
 arch/sparc/kernel/time_32.c           |  68 +--
 arch/sparc/kernel/trampoline_32.S     | 127 +----
 arch/sparc/kernel/ttable_32.S         |   9 +-
 arch/sparc/kernel/vmlinux.lds.S       |   5 -
 arch/sparc/kernel/wof.S               |  61 +--
 arch/sparc/kernel/wuf.S               |  41 +-
 arch/sparc/mm/Makefile                |   4 +-
 arch/sparc/mm/hypersparc.S            | 414 -----------------
 arch/sparc/mm/io-unit.c               | 286 ------------
 arch/sparc/mm/iommu.c                 | 455 ------------------
 arch/sparc/mm/mm_32.h                 |   4 -
 arch/sparc/mm/srmmu.c                 | 836 +--------------------------------
 arch/sparc/mm/srmmu_access.S          |  83 ----
 arch/sparc/mm/swift.S                 | 256 -----------
 arch/sparc/mm/tsunami.S               | 132 ------
 arch/sparc/mm/viking.S                | 284 ------------
 arch/sparc/prom/Makefile              |   1 -
 arch/sparc/prom/init_32.c             |   2 -
 arch/sparc/prom/misc_32.c             |   2 -
 arch/sparc/prom/ranges.c              | 114 -----
 drivers/sbus/char/Kconfig             |   8 -
 drivers/sbus/char/Makefile            |   1 -
 drivers/sbus/char/uctrl.c             | 434 ------------------
 drivers/usb/host/Kconfig              |   2 +-
 drivers/usb/host/ehci-hcd.c           |   4 +-
 drivers/usb/host/uhci-hcd.c           |   2 +-
 drivers/video/fbdev/Kconfig           |  10 +-
 drivers/video/fbdev/Makefile          |   1 -
 drivers/video/fbdev/p9100.c           | 372 ---------------
 sound/sparc/Kconfig                   |   1 +
 89 files changed, 316 insertions(+), 10829 deletions(-)
---
base-commit: 84b76d05828a1909e20d0f66553b876b801f98c8
change-id: 20240309-sunset-3437be64cd5f

Best regards,

Comments

Sam Ravnborg April 23, 2024, 6:02 p.m. UTC | #1
Hi Andreas,

On Sat, Mar 09, 2024 at 07:15:21PM +0100, Sam Ravnborg via B4 Relay wrote:
> This is the second attempt to sunset sun4m and sun4d.
> See [1] for the inital attempt.
> 
> The sun4m and sun4d parts of the kernel have seen no real interest
> for several years now. Last time a few people surfaced, but it was
> either due to a personal project or for nostalgic reasons.
> It is time to let go and drop the parts of sparc32 that in reality
> are not in use.
> 
> LEON from Frontgrade Gaisler is the only real user of sparc32,
> and this patchset reduces sparc32 to what is required by LEON.
> 
> The defconfig is first adapted to the one used by Gaisler.
> Then the patches removes sun4m and sun4d specific
> implementations such as small drivers, SMP support, IRQ suppor etc.
> 
> Removing sun4m and sun4d support allowed removal of the run time
> patching of the code as well as a lot of assembler code.
> The result is a much cleaner assembler code that is easier to
> understand and thus maintain and extend.
> 
> Changes in v2:
>   - Rebased on top of Andreas' for-next branch
>   - Collected ack's
>   - Added patch to remove cpuid patching (Andreas)
>   - Run-time testing using qemu (Andreas, Mark Cave-Ayland)

Please let me know if you expect me to rebase this on for-next.
I have not yet tried if there are merge conflicts but can take a look in
a some days if required.

That is assuming you agree with the sunset of the sun platforms...

	Sam
Andreas Larsson April 26, 2024, 4:31 p.m. UTC | #2
On 2024-04-23 20:02, Sam Ravnborg wrote:
> Please let me know if you expect me to rebase this on for-next.
> I have not yet tried if there are merge conflicts but can take a look in
> a some days if required.

My local testing branch for this patchset rebased with trivial fixups,
so no immediate rebase and resubmission is needed. I do run into some
strange problems on SMP with this patchset plus your CAS patchset, that
I do not get when I rebase the Linux patches from our kernel release
that has my CAS patchset. With no CAS at all these things fails even
worse, so do I need one or the other for these tests.

I will need to dig deeper into figuring out the problems seems to be due
to something in any of your two patchsets in themselves or if it is
something else. I do need some additional fixes from our kernel release
for SMP to work properly, so it could also be that there is something
with my combination of your patches and my patches adapted on top of
yours.

There are also some needed fixes for LEON that relies upon code removed
in this patchset. Maybe the best solution for that would be if I submit
those and you then rebase upon them.

> That is assuming you agree with the sunset of the sun platforms...

I do agree with the idea in general, but being busy with other things I
have had little time to dig into this lately.

Thanks,
Andreas
Sam Ravnborg April 26, 2024, 4:53 p.m. UTC | #3
Hi Andreas.

On Fri, Apr 26, 2024 at 06:31:12PM +0200, Andreas Larsson wrote:
> On 2024-04-23 20:02, Sam Ravnborg wrote:
> > Please let me know if you expect me to rebase this on for-next.
> > I have not yet tried if there are merge conflicts but can take a look in
> > a some days if required.
> 
> My local testing branch for this patchset rebased with trivial fixups,
> so no immediate rebase and resubmission is needed. I do run into some
> strange problems on SMP with this patchset plus your CAS patchset, that
> I do not get when I rebase the Linux patches from our kernel release
> that has my CAS patchset. With no CAS at all these things fails even
> worse, so do I need one or the other for these tests.
:-(

> 
> I will need to dig deeper into figuring out the problems seems to be due
> to something in any of your two patchsets in themselves or if it is
> something else. I do need some additional fixes from our kernel release
> for SMP to work properly, so it could also be that there is something
> with my combination of your patches and my patches adapted on top of
> yours.
> 
> There are also some needed fixes for LEON that relies upon code removed
> in this patchset. Maybe the best solution for that would be if I submit
> those and you then rebase upon them.
If you can make LEON stable before starting the code removal that would
be the best way forward. Then it should be easier to identify when
the removal patches breaks things.

With all the surgery I had to do to remove stuff it would have been a
big surprise if it just worked - so it goes as expected. qemu only
verify so much - the real target (and SMP) is way better.

> > That is assuming you agree with the sunset of the sun platforms...
> 
> I do agree with the idea in general, but being busy with other things I
> have had little time to dig into this lately.

If this round could be used to stabilize LEON and apply other more
trivial stuff, then I am happy to rebase the "sunset" patchset sometimes
after next -rc1.

I have accumulated a bit more on top of what I already posted, and I
will include a few more patches in the next round.

In other words - take your time!

	Sam