mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/6] sparc64: add Fujitsu M3000 support
@ 2026-10-11 19:55 Magnus Lindholm
  2026-10-11 19:55 ` [PATCH v2 1/6] sparc64: return from the generic clear_page implementation Magnus Lindholm
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Magnus Lindholm @ 2026-10-11 19:55 UTC (permalink / raw)
  To: davem, andreas, sparclinux
  Cc: linux-kernel, gregkh, jirislaby, linux-serial, linuxppc-dev,
	krzk, oleg, linmag7

Several years ago I salvaged an M3000 SPARC Enterprise box being
decommissioned at work. The box has been sitting ever since, as it did
not run Linux. It did not seem impossible to get Linux running, but
my earlier attempts failed. I recently found some documentation:
"SPARC JPS2: Common Specification" and the "Fujitsu SPARC64 VII
Extensions", which gave me some of the missing pieces.
Getting this up and running required extensive testing, some
kernel instrumentation, debug printouts and many reboot iterations.
For this, Codex proved very helpful. Along the way, I stumbled upon
some generic sparc and driver bugs that this series addresses as well.

This series adds support for the Fujitsu SPARC Enterprise M3000, with
SPARC64 VII+, Oberon PCIe and a firmware hvc console.
Based on Linux v7.3-rc1, commit cee9395acd8043be0644b25c34bfa86623f2b935.

Patches 1-3 fix existing sparc64 defects in generic clear_page, secondary
queued-spinlock acquisition and sun4u kernel huge-PUD mappings. Each has
a Fixes tag. Patches 4-6 add the CPU/MMU/SMP path, PCIe bridge and
firmware console.

Changes since v1:
- Split the tg3 firmware byte-order fix into a standalone netdev patch,
  as requested by Jakub. It has no code dependency on this series.
- Address Krzysztof's topology review: replace the root-model check and
  adjacent-CPU assumption with compatible core nodes and cpu/core/cmp
  ancestry. Unknown ancestry produces no inferred sibling groups;
  hardware CPU IDs are unchanged. This uses the observed firmware tree,
  without claiming that the root model is a documented binding.
- Address Greg's console-state review: group state by HVC term number.
  Retain static storage for early console use and firmware-visible locked
  mappings; the M3000 exposes one /chosen stdin/stdout pair.
- Replace READ_ONCE/WRITE_ONCE polling-state access with explicit locking.
  A spinlock protects active state and timer rearming; a mutex serializes
  open, last close and hangup while close waits for the timer callback.
- Remove the arbitrary eight-attempt write loop. No progress returns
  zero: HVC retries buffered TTY output but drops stalled console chunks.
  A firmware call that never returns remains unbounded.
- Retain the raw buffer lock because console writes can run in atomic
  contexts. The PROM lock protects firmware entry, not the buffer copies
  before and after it. Panic/NMI and recursive console safety remain
  unverified.
- Retain the service-name pointer cast: p1275_cmd_direct() takes unsigned
  long argument cells, as used by the existing prom_console_write_buf().
- Remove stale "experimental" wording and the console success message;
  add copyright, use min(), and fix the Makefile spacing and blank line.
- Retain CONFIG_SPARC64_VII and its HugeTLB/THP exclusions. Removing the
  option requires runtime feature gating and further MMU work. Retain
  separate VII demap routines: similar Cheetah assembly does not establish
  the same hardware synchronization requirement there.

Onboard BCM5718 networking also needs the standalone patch
"tg3: normalize inherited M3000 register byte order". Apply it alongside
this series for complete M3000 testing; it is not a build dependency.
The two submissions can be taken through their respective trees.

The six-patch SPARC series also applies and builds without the tg3 fix.
The tg3 patch applies and its driver builds independently on v7.3-rc1.
Applying both submissions in either order reproduces the tested tree.

The combined v2 tree, including the standalone tg3 fix, cross-built with
GCC 13.3 in SMP, true CONFIG_SMP=n and non-VII Ultra45 configurations.
Each prefix of that seven-patch tree applied and built. The combined,
uninstrumented SMP kernel booted from disk with eight threads; true UP
also booted from disk. Both reached Gentoo/OpenRC with hvc0. SMP topology
reports four cores, two threads per core and one package with reciprocal
sibling masks.

Bounded SMP fork/COW and remap/protection tests passed, as did UP COW.
Console testing covered login, 100 paired-open/last-close cycles,
hangup/reopen, paced input, idle input and concurrent output. Rapid
pasted input still loses characters. Mocked firmware tests exercised
partial writes, no progress, errors and invalid return counts; topology
fixtures covered sparse IDs, package separation and missing ancestry.
The Ultra45 configuration was compile-tested only for this revision;
topology fixtures do not establish multi-package hardware support.

Oberon MSI and native bridge error recovery, VII CPU offlining and
complete RAS recovery remain unimplemented. ECC recovery was not
fault-injected; urgent errors stop with a raw record. Raw-IPI page
lifetime and Oberon ordering remain audit topics.

Link to v1:
https://lore.kernel.org/sparclinux/20261002161515.932316-1-linmag7@gmail.com/
Link to tg3 patch (v3):
https://lore.kernel.org/sparclinux/20261011194228.981141-1-linmag7@gmail.com/

Magnus Lindholm (6):
  sparc64: return from the generic clear_page implementation
  sparc64: honor queued spinlock layout in secondary startup
  sparc64: avoid huge kernel PUD mappings on sun4u
  sparc64: add SPARC64 VII CPU, MMU and SMP support
  sparc64: add M3000 Oberon PCIe support
  hvc: add an M3000 firmware console backend

 MAINTAINERS                         |   6 +
 arch/sparc/Kconfig                  |  20 +++
 arch/sparc/include/asm/head_64.h    |  15 ++
 arch/sparc/include/asm/iommu_64.h   |   1 +
 arch/sparc/include/asm/irq_64.h     |   1 +
 arch/sparc/include/asm/setup.h      |   5 +
 arch/sparc/include/asm/smp_64.h     |   4 +
 arch/sparc/include/asm/spitfire.h   |   1 +
 arch/sparc/include/asm/trap_block.h |   6 +
 arch/sparc/kernel/cpu.c             |   3 +
 arch/sparc/kernel/entry.h           |   2 +
 arch/sparc/kernel/head_64.S         |  18 +++
 arch/sparc/kernel/helpers.S         |  41 +++++
 arch/sparc/kernel/iommu.c           |  44 ++++++
 arch/sparc/kernel/irq_64.c          |  50 ++++--
 arch/sparc/kernel/pci_fire.c        |  31 +++-
 arch/sparc/kernel/pci_impl.h        |   1 +
 arch/sparc/kernel/prom_64.c         |  27 ++++
 arch/sparc/kernel/prom_irqtrans.c   |   7 +
 arch/sparc/kernel/ptrace_64.c       |   7 +
 arch/sparc/kernel/setup_64.c        |  55 +++++++
 arch/sparc/kernel/smp_64.c          |  89 ++++++++++-
 arch/sparc/kernel/trampoline_64.S   |  53 ++++++-
 arch/sparc/kernel/traps_64.c        |  27 ++++
 arch/sparc/lib/GENpage.S            |   3 +
 arch/sparc/mm/init_64.c             | 110 ++++++++++++-
 arch/sparc/mm/tsb.c                 |  19 ++-
 arch/sparc/mm/ultra.S               | 236 ++++++++++++++++++++++++++++
 drivers/tty/hvc/Kconfig             |  10 ++
 drivers/tty/hvc/Makefile            |   1 +
 drivers/tty/hvc/hvc_m3000.c         | 205 ++++++++++++++++++++++++
 31 files changed, 1064 insertions(+), 34 deletions(-)
 create mode 100644 drivers/tty/hvc/hvc_m3000.c


base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
-- 
2.43.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-10-12  7:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-11 19:55 [PATCH v2 0/6] sparc64: add Fujitsu M3000 support Magnus Lindholm
2026-10-11 19:55 ` [PATCH v2 1/6] sparc64: return from the generic clear_page implementation Magnus Lindholm
2026-10-11 19:55 ` [PATCH v2 2/6] sparc64: honor queued spinlock layout in secondary startup Magnus Lindholm
2026-10-11 19:55 ` [PATCH v2 3/6] sparc64: avoid huge kernel PUD mappings on sun4u Magnus Lindholm
2026-10-11 19:55 ` [PATCH v2 4/6] sparc64: add SPARC64 VII CPU, MMU and SMP support Magnus Lindholm
2026-10-12  7:34   ` kernel test robot
2026-10-11 19:55 ` [PATCH v2 5/6] sparc64: add M3000 Oberon PCIe support Magnus Lindholm
2026-10-11 19:55 ` [PATCH v2 6/6] hvc: add an M3000 firmware console backend Magnus Lindholm
2026-10-12  6:46   ` Jiri Slaby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®