head	1.7;
access;
symbols
	perseant-exfatfs:1.7.0.2
	perseant-exfatfs-base-20261102:1.7;
locks; strict;
comment	@# @;


1.7
date	2026.09.28.20.41.00;	author rkujawa;	state Exp;
branches
	1.7.2.1;
next	1.6;
commitid	qChHdbcPYQzpBqXG;

1.6
date	2026.06.23.22.07.46;	author rkujawa;	state Exp;
branches;
next	1.5;
commitid	NiATJw9qZdnRjYKG;

1.5
date	2026.06.19.18.55.23;	author rkujawa;	state Exp;
branches;
next	1.4;
commitid	kEARArDOGw3MnrKG;

1.4
date	2026.06.18.22.11.20;	author rkujawa;	state Exp;
branches;
next	1.3;
commitid	TxAbu2wzQ6V2vkKG;

1.3
date	2026.06.18.00.44.58;	author rkujawa;	state Exp;
branches;
next	1.2;
commitid	kFZuVRm3gkzNndKG;

1.2
date	2026.06.17.15.08.53;	author rkujawa;	state Exp;
branches;
next	1.1;
commitid	vrsSRIZW7M2UbaKG;

1.1
date	2026.06.16.21.51.19;	author rkujawa;	state Exp;
branches;
next	;
commitid	4fiFS3rMnulSr4KG;

1.7.2.1
date	2026.09.28.20.41.00;	author perseant;	state dead;
branches;
next	1.7.2.2;
commitid	3QTNojfCEH9lUb2H;

1.7.2.2
date	2026.11.04.23.20.35;	author perseant;	state Exp;
branches;
next	;
commitid	3QTNojfCEH9lUb2H;


desc
@@


1.7
log
@Fixes and features for PPC440 core, PPC460EX chip, Sam460ex board.

- Add ebc - PPC440 family External Bus Controller driver.
- Add samfpga - Driver for Sam460ex on-board FPGA (provides 80 GPIOs,
soft power off, 3x led(4), etc. Lives on the ebc.
- Enable PPC460EX on-chip GPIO via gpio_opb.
- Implement a bunch of workarounds for 440/460 hardware bugs.
- Enable pm2fb in SAM460EX config (necessary fixes to pm2fb pending
commit).
- Disable OHCI in SAM460EX config - due to hardware bug operating
two AHB masters at the same time may cause lockups. And it sure does,
there's no known software workaround.
- Don't allow passing PSL_FP from MSR userland bits (userland can cause
panic).
- Fix ghost interrupt deliveries where asserted line re-entered the
exception.
- Ensure interrupt level-mask flag is set by default.
- Tag mmaped DMA address as cacheable unless memory was explicitly
allocated as uncached (only for 440, OEA probably could use it too).
- Fix up 440 TLB decoding in ddb.
- Fix pmap handling of reserved windows that may be mapped from userland.
- Refactor L2 cache handling, make it more maintainable and in style of
other ports.
- Decode PLL straps and let the user know at what base frequency does
the board run (useful if the user wants to apply firmware update,
because images are built for different base freqs).
- Minor trap stuff: decode and clear MCSR in a single helper, dump TLB
on parity checks, user-mode MCHK are now SIGBUS.
- Try to sanely handle the fact that 460EX has SERDES PHY that can
either serve PCIe port or SATA - detect that and attach drivers accordingly.
@
text
@#	$NetBSD: SAM460EX,v 1.6 2026/06/23 22:07:46 rkujawa Exp $
#
#	SAM460EX -- ACube Sam460ex (AMCC 460EX)
#

include 	"arch/evbppc/conf/std.sam460ex"

#ident 		"SAM460EX-$Revision: 1.6 $"

maxusers	32

options 	SAM460EX_FDT		# parse U-Boot supplied device tree
options 	PPC4XX_L2CACHE		# on-chip 256KB L2 

#
# Diagnostic/debugging support options
#
#options 	DIAGNOSTIC		# cheap kernel consistency checks
#options 	DEBUG			# expensive debugging checks/support
options 	DDB			# in-kernel debugger
options 	DDB_HISTORY_SIZE=512	# enable history editing in DDB
options 	TRAP_PANICWAIT
makeoptions	COPY_SYMTAB=1		# size for embedded symbol table

options		KTRACE			# system call tracing

makeoptions	DEBUG="-g"		# compile full symbol table

#
# File systems
#
file-system 	FFS			# UFS
file-system 	EXT2FS			# Linux ext2fs
file-system 	MSDOSFS			# FAT 
file-system 	KERNFS			# /kern
file-system	PTYFS			# /dev/pts/N support
file-system	TMPFS			# Efficient memory file-system

options		FFS_EI			# Enable Endian Independent 

options         DKWEDGE_AUTODISCOVER	# Automatically add dk(4) instances
options         DKWEDGE_METHOD_MBR	# Support MBR partitions as wedges
options         DKWEDGE_METHOD_RDB	# Support RDB partitions as wedges

file-system 	NFS			# Network File System client
options 	NFS_BOOT_DHCP		# Support DHCP NFS root

#
# Networking options
#
options 	INET
options 	INET6

#
# Kernel root file system and dump configuration.
#
config		netbsd	root on ? type ?

#
# Device configuration
#
plb0 at root				# Processor Local Bus
cpu0	at plb?				# CPU

# On-chip Peripheral Bus support
opb*	at plb?				# On-chip Peripheral Bus
com*	at opb? addr ? irq ?		# UARTs
wdog*	at opb?				# On-chip Watchdog
ebc0	at plb?				# External Bus Controller
samfpga0 at ebc0 bank 2			# Lattice XP2 FPGA
gpio0	at samfpga0			# GPIOs on J22 connector
opbgpio* at opb? addr ? irq ?		# On-chip GPIO
gpio1	at opbgpio0			# GPIO0-31
gpio2	at opbgpio1			# GPIO32-63
gpiic*	at opb? addr ? irq ?		# On-chip IIC 
iic*	at gpiic?			# I2C bus

strtc0	at iic0 addr 0x68 flags 62	# M41T62 RTC (M41T80 under QEMU)
spdmem0 at iic0 addr 0x50		# DDR2 SPD EEPROM

#seeprom0 at iic0 addr 0x54 flags 8	# U-Boot env EEPROM

# only EMAC0 is wired on the Sam460ex 
emac0	at opb0 addr 0xef600e00 irq 80	# Ethernet Media Access Controller
options 	EMAC_EVENT_COUNTERS
options 	EMAC_RGMII_PHY		# both EMACs use the RGMII0 bridge
options		EMAC_TAH

# MII/PHY support
makphy*	at mii? phy ?			# Marvell 88E1121R (dual GbE PHY)
ukphy*	at mii? phy ?			# generic/unknown PHYs

# PCI bus support
options 	PCI_NETBSD_CONFIGURE
pcix0	at plb?				# 460EX PLB-PCIX host bridge
pciex0	at plb?				# 460EX PCIe root complex 0
pciex1	at plb?				# 460EX PCIe root complex 1
pci*	at pcix?
pci*	at pciex?
ppb*	at pci? dev ? function ?	# PCI-PCI bridges
pci*	at ppb? bus ?

# on-board SM502 framebuffer, selected via console=sm502
voyager0 at pci? dev ? function ?	# SM502 multimedia processor
voyagerfb0 at voyager0			# SM502 framebuffer console
options 	VOYAGERFB_MODE_SETTING	# DDC/EDID readout + mode-setting
vac0	at voyager0			# SM502 AC97-link (Realtek ALC655)

# audio
audio*	at audiobus?

spkr*	at audio?			# tone interface, synthesized via audio
wsbell*	at spkr?			# bell for the wscons display

# selected via console=pci
radeonfb* at pci? dev ? function ?	# ATI Radeon R100 - R3XX
pm2fb*	at pci? dev ? function ?	# 3Dlabs Permedia 2/2v framebuffer

wsdisplay* at wsemuldisplaydev?

options 	WSEMUL_VT100
options 	WSDISPLAY_SCROLLSUPPORT
options 	FONT_BOLD8x16		# bitmap font

satalink* at pci? dev ? function ?	# SATALink
siisata* at pci? dev ? function ?

# SATA shares SERDES PHY with one of PCI root complexes, but we detect
# which one was enabled on the firmware level and configure accordingly.
dwcsata0 at plb? addr 0xbffd1000 irq 96	# on-chip DWC SATA-II
options 	DWCSATA_PIO_ONLY	# force PIO mode

atabus*	at ata?
wd*	at atabus? drive ? flags 0x0000

# On-chip USB controllers.
#
# Due to 460ex CHIP_16 errata, we can not safely operate both EHCI and OHCI
# at the same time. However, it's not a huge deal in practice.
#ohci0	at plb? addr 0xbffd0000 irq 94
ehci0	at plb? addr 0xbffd0400 irq 93

# USB bus support
usb*	at ehci0
#usb*	at ohci0

# USB Hubs
uhub*	at usb?
uhub*	at uhub? port ?

# USB Mass Storage
umass*	at uhub? port ? configuration ? interface ?
scsibus* at umass?
sd*	at scsibus? target ? lun ?	# SCSI disk drives

# USB HID devices
uhidev*	at uhub? port ? configuration ? interface ?
ukbd*	at uhidev? reportid ?
wskbd*	at ukbd? console ?
ums*	at uhidev? reportid ?
wsmouse* at ums? mux 0
uhid*	at uhidev? reportid ?

#
# Pseudo devices
#
pseudo-device	wsmux			# keyboard/mouse multiplexor
pseudo-device	wsfont			# bitmap fonts for the wsdisplay console
pseudo-device	loop			# network loopback
pseudo-device	pty			# pseudo-terminals
pseudo-device	clockctl		# user control of clock subsystem
pseudo-device	drvctl			# detach/rescan devices
pseudo-device	ksyms			# /dev/ksyms
@


1.7.2.1
log
@file SAM460EX was added on branch perseant-exfatfs on 2026-11-04 23:20:35 +0000
@
text
@d1 173
@


1.7.2.2
log
@Sync with HEAD
@
text
@a0 173
#	$NetBSD: SAM460EX,v 1.7 2026/09/28 20:41:00 rkujawa Exp $
#
#	SAM460EX -- ACube Sam460ex (AMCC 460EX)
#

include 	"arch/evbppc/conf/std.sam460ex"

#ident 		"SAM460EX-$Revision: 1.7 $"

maxusers	32

options 	SAM460EX_FDT		# parse U-Boot supplied device tree
options 	PPC4XX_L2CACHE		# on-chip 256KB L2 

#
# Diagnostic/debugging support options
#
#options 	DIAGNOSTIC		# cheap kernel consistency checks
#options 	DEBUG			# expensive debugging checks/support
options 	DDB			# in-kernel debugger
options 	DDB_HISTORY_SIZE=512	# enable history editing in DDB
options 	TRAP_PANICWAIT
makeoptions	COPY_SYMTAB=1		# size for embedded symbol table

options		KTRACE			# system call tracing

makeoptions	DEBUG="-g"		# compile full symbol table

#
# File systems
#
file-system 	FFS			# UFS
file-system 	EXT2FS			# Linux ext2fs
file-system 	MSDOSFS			# FAT 
file-system 	KERNFS			# /kern
file-system	PTYFS			# /dev/pts/N support
file-system	TMPFS			# Efficient memory file-system

options		FFS_EI			# Enable Endian Independent 

options         DKWEDGE_AUTODISCOVER	# Automatically add dk(4) instances
options         DKWEDGE_METHOD_MBR	# Support MBR partitions as wedges
options         DKWEDGE_METHOD_RDB	# Support RDB partitions as wedges

file-system 	NFS			# Network File System client
options 	NFS_BOOT_DHCP		# Support DHCP NFS root

#
# Networking options
#
options 	INET
options 	INET6

#
# Kernel root file system and dump configuration.
#
config		netbsd	root on ? type ?

#
# Device configuration
#
plb0 at root				# Processor Local Bus
cpu0	at plb?				# CPU

# On-chip Peripheral Bus support
opb*	at plb?				# On-chip Peripheral Bus
com*	at opb? addr ? irq ?		# UARTs
wdog*	at opb?				# On-chip Watchdog
ebc0	at plb?				# External Bus Controller
samfpga0 at ebc0 bank 2			# Lattice XP2 FPGA
gpio0	at samfpga0			# GPIOs on J22 connector
opbgpio* at opb? addr ? irq ?		# On-chip GPIO
gpio1	at opbgpio0			# GPIO0-31
gpio2	at opbgpio1			# GPIO32-63
gpiic*	at opb? addr ? irq ?		# On-chip IIC 
iic*	at gpiic?			# I2C bus

strtc0	at iic0 addr 0x68 flags 62	# M41T62 RTC (M41T80 under QEMU)
spdmem0 at iic0 addr 0x50		# DDR2 SPD EEPROM

#seeprom0 at iic0 addr 0x54 flags 8	# U-Boot env EEPROM

# only EMAC0 is wired on the Sam460ex 
emac0	at opb0 addr 0xef600e00 irq 80	# Ethernet Media Access Controller
options 	EMAC_EVENT_COUNTERS
options 	EMAC_RGMII_PHY		# both EMACs use the RGMII0 bridge
options		EMAC_TAH

# MII/PHY support
makphy*	at mii? phy ?			# Marvell 88E1121R (dual GbE PHY)
ukphy*	at mii? phy ?			# generic/unknown PHYs

# PCI bus support
options 	PCI_NETBSD_CONFIGURE
pcix0	at plb?				# 460EX PLB-PCIX host bridge
pciex0	at plb?				# 460EX PCIe root complex 0
pciex1	at plb?				# 460EX PCIe root complex 1
pci*	at pcix?
pci*	at pciex?
ppb*	at pci? dev ? function ?	# PCI-PCI bridges
pci*	at ppb? bus ?

# on-board SM502 framebuffer, selected via console=sm502
voyager0 at pci? dev ? function ?	# SM502 multimedia processor
voyagerfb0 at voyager0			# SM502 framebuffer console
options 	VOYAGERFB_MODE_SETTING	# DDC/EDID readout + mode-setting
vac0	at voyager0			# SM502 AC97-link (Realtek ALC655)

# audio
audio*	at audiobus?

spkr*	at audio?			# tone interface, synthesized via audio
wsbell*	at spkr?			# bell for the wscons display

# selected via console=pci
radeonfb* at pci? dev ? function ?	# ATI Radeon R100 - R3XX
pm2fb*	at pci? dev ? function ?	# 3Dlabs Permedia 2/2v framebuffer

wsdisplay* at wsemuldisplaydev?

options 	WSEMUL_VT100
options 	WSDISPLAY_SCROLLSUPPORT
options 	FONT_BOLD8x16		# bitmap font

satalink* at pci? dev ? function ?	# SATALink
siisata* at pci? dev ? function ?

# SATA shares SERDES PHY with one of PCI root complexes, but we detect
# which one was enabled on the firmware level and configure accordingly.
dwcsata0 at plb? addr 0xbffd1000 irq 96	# on-chip DWC SATA-II
options 	DWCSATA_PIO_ONLY	# force PIO mode

atabus*	at ata?
wd*	at atabus? drive ? flags 0x0000

# On-chip USB controllers.
#
# Due to 460ex CHIP_16 errata, we can not safely operate both EHCI and OHCI
# at the same time. However, it's not a huge deal in practice.
#ohci0	at plb? addr 0xbffd0000 irq 94
ehci0	at plb? addr 0xbffd0400 irq 93

# USB bus support
usb*	at ehci0
#usb*	at ohci0

# USB Hubs
uhub*	at usb?
uhub*	at uhub? port ?

# USB Mass Storage
umass*	at uhub? port ? configuration ? interface ?
scsibus* at umass?
sd*	at scsibus? target ? lun ?	# SCSI disk drives

# USB HID devices
uhidev*	at uhub? port ? configuration ? interface ?
ukbd*	at uhidev? reportid ?
wskbd*	at ukbd? console ?
ums*	at uhidev? reportid ?
wsmouse* at ums? mux 0
uhid*	at uhidev? reportid ?

#
# Pseudo devices
#
pseudo-device	wsmux			# keyboard/mouse multiplexor
pseudo-device	wsfont			# bitmap fonts for the wsdisplay console
pseudo-device	loop			# network loopback
pseudo-device	pty			# pseudo-terminals
pseudo-device	clockctl		# user control of clock subsystem
pseudo-device	drvctl			# detach/rescan devices
pseudo-device	ksyms			# /dev/ksyms
@


1.6
log
@Enable RTC, minor clean up.
@
text
@d1 1
a1 1
#	$NetBSD: SAM460EX,v 1.5 2026/06/19 18:55:23 rkujawa Exp $
d8 1
a8 1
#ident 		"SAM460EX-$Revision: 1.5 $"
d69 6
d117 1
d128 2
d136 5
a140 2
# On-chip USB 2.0 host (EHCI + OHCI on the AHB)
ohci0	at plb? addr 0xbffd0000 irq 94
d145 1
a145 1
usb*	at ohci0
@


1.5
log
@L2 cache support on 460EX plus cache coherency fixes and USB workarounds.
@
text
@d1 1
a1 1
#	$NetBSD: SAM460EX,v 1.4 2026/06/18 22:11:20 rkujawa Exp $
d8 1
a8 1
#ident 		"SAM460EX-$Revision: 1.4 $"
d25 2
d32 12
a43 6
file-system 	FFS		# UFS
file-system 	NFS		# Network File System client
file-system 	MSDOSFS		# FAT (USB mass storage stress testing)
file-system 	KERNFS		# /kern
file-system	PTYFS		# /dev/pts/N support
file-system	TMPFS		# Efficient memory file-system
d45 2
a46 1
options 	NFS_BOOT_DHCP	# Support DHCP NFS root
d68 2
a69 2
wdog*	at opb?				# 460EX on-chip watchdog -> sysmon(4) /dev/watchdog
gpiic*	at opb? addr ? irq ?		# On-chip IIC (bitbang via DIRECTCNTL)
d72 1
a72 2
# needs MI m41st84 M41T62 support, not yet committed
#strtc0	at iic0 addr 0x68 flags 62	# M41T62 RTC (M41T80 under QEMU)
d106 3
d116 1
a116 1
options 	FONT_BOLD8x16		# bitmap font (engine putchar path)
d118 1
a118 1
satalink* at pci? dev ? function ?	# SATALink, often used on Sam460ex
d121 2
a122 2
dwcsata0 at plb? addr 0xbffd1000 irq 96	# on-chip DWC SATA-II (PIO only)
options 	DWCSATA_PIO_ONLY	# DMA is unstable
d144 1
a144 1
# USB HID devices (QEMU plugs a usb-kbd and usb-mouse by default)
a155 1
					# (console input from USB keyboards)
d160 1
a160 1
pseudo-device	drvctl			# detach/rescan devices (AHB tests)
@


1.4
log
@Enable voyagerfb mode setting on Sam460ex.
@
text
@d1 1
a1 1
#	$NetBSD: SAM460EX,v 1.3 2026/06/18 00:44:58 rkujawa Exp $
d8 1
a8 1
#ident 		"SAM460EX-$Revision: 1.3 $"
d13 1
a27 5
# Compatibility options
#
include 	"conf/compat_netbsd13.config"

#
d32 1
@


1.3
log
@Enable SM502 audio on Sam460ex.
@
text
@d1 1
a1 1
#	$NetBSD: SAM460EX,v 1.2 2026/06/17 15:08:53 rkujawa Exp $
d8 1
a8 1
#ident 		"SAM460EX-$Revision: 1.2 $"
d95 1
a95 1
#iic*	at voyager0			# SM502 DDC/I2C bus
@


1.2
log
@Improve console handling on Sam460ex.

While here: support prefetchable PCI window and fix configuration
space accesses on PPC460EX.
@
text
@d1 1
a1 1
#	$NetBSD: SAM460EX,v 1.1 2026/06/16 21:51:19 rkujawa Exp $
d8 1
a8 1
#ident 		"SAM460EX-$Revision: 1.1 $"
d96 4
@


1.1
log
@Add support for Sam460ex by ACube Systems.

Still very much work in progress, but already bootable to multiuser
and CPU support itself seems stable.
@
text
@d1 1
a1 1
#	$NetBSD$
d92 13
a104 9
# SM502 needs MI voyager/voyagerfb fixes not committed yet
#voyager0 at pci? dev ? function ?	# SM502 multimedia processor
#voyagerfb0 at voyager0			# SM502 framebuffer console
#iic*	at voyager0			# not yet
#wsdisplay* at wsemuldisplaydev?

#options 	WSEMUL_VT100
#options 	WSDISPLAY_SCROLLSUPPORT
#options 	FONT_BOLD8x16		# bitmap font (engine putchar path)
d145 1
@

