head	1.20;
access;
symbols
	netbsd-11-0-RC4:1.20
	netbsd-11-0-RC3:1.20
	netbsd-11-0-RC2:1.20
	netbsd-11-0-RC1:1.20
	perseant-exfatfs-base-20250801:1.20
	netbsd-11:1.20.0.10
	netbsd-11-base:1.20
	netbsd-10-1-RELEASE:1.20
	perseant-exfatfs-base-20240630:1.20
	perseant-exfatfs:1.20.0.8
	perseant-exfatfs-base:1.20
	netbsd-9-4-RELEASE:1.10.2.2
	netbsd-10-0-RELEASE:1.20
	netbsd-10-0-RC6:1.20
	netbsd-10-0-RC5:1.20
	netbsd-10-0-RC4:1.20
	netbsd-10-0-RC3:1.20
	netbsd-10-0-RC2:1.20
	thorpej-ifq:1.20.0.6
	thorpej-ifq-base:1.20
	thorpej-altq-separation:1.20.0.4
	thorpej-altq-separation-base:1.20
	netbsd-10-0-RC1:1.20
	netbsd-10:1.20.0.2
	netbsd-10-base:1.20
	bouyer-sunxi-drm:1.19.0.2
	bouyer-sunxi-drm-base:1.19
	netbsd-9-3-RELEASE:1.10.2.2
	thorpej-i2c-spi-conf2:1.14.0.2
	thorpej-i2c-spi-conf2-base:1.14
	thorpej-futex2:1.13.0.14
	thorpej-futex2-base:1.13
	thorpej-cfargs2:1.13.0.12
	thorpej-cfargs2-base:1.13
	cjep_sun2x-base1:1.13
	cjep_sun2x:1.13.0.10
	cjep_sun2x-base:1.13
	cjep_staticlib_x-base1:1.13
	netbsd-9-2-RELEASE:1.10.2.2
	cjep_staticlib_x:1.13.0.8
	cjep_staticlib_x-base:1.13
	thorpej-i2c-spi-conf:1.13.0.6
	thorpej-i2c-spi-conf-base:1.13
	thorpej-cfargs:1.13.0.4
	thorpej-cfargs-base:1.13
	thorpej-futex:1.13.0.2
	thorpej-futex-base:1.13
	netbsd-9-1-RELEASE:1.10.2.2
	bouyer-xenpvh-base2:1.12
	phil-wifi-20200421:1.12
	bouyer-xenpvh-base1:1.12
	phil-wifi-20200411:1.12
	bouyer-xenpvh:1.12.0.6
	bouyer-xenpvh-base:1.12
	is-mlppp:1.12.0.4
	is-mlppp-base:1.12
	phil-wifi-20200406:1.12
	ad-namecache-base3:1.12
	netbsd-9-0-RELEASE:1.10.2.2
	netbsd-9-0-RC2:1.10.2.2
	ad-namecache-base2:1.12
	ad-namecache-base1:1.12
	ad-namecache:1.12.0.2
	ad-namecache-base:1.12
	netbsd-9-0-RC1:1.10.2.1
	phil-wifi-20191119:1.11
	netbsd-9:1.10.0.2
	netbsd-9-base:1.10
	phil-wifi-20190609:1.9
	isaki-audio2:1.9.0.2
	isaki-audio2-base:1.9
	pgoyette-compat-merge-20190127:1.1.2.5
	pgoyette-compat-20190127:1.9
	pgoyette-compat-20190118:1.9
	pgoyette-compat-1226:1.9
	pgoyette-compat-1126:1.9
	pgoyette-compat-1020:1.7
	pgoyette-compat-0930:1.2
	pgoyette-compat-0906:1.1
	pgoyette-compat-0728:1.1
	phil-wifi:1.1.0.4
	phil-wifi-base:1.1
	pgoyette-compat-0625:1.1
	pgoyette-compat-0521:1.1
	pgoyette-compat-0502:1.1
	pgoyette-compat-0422:1.1
	pgoyette-compat-0415:1.1
	pgoyette-compat:1.1.0.2
	pgoyette-compat-0407:1.1;
locks; strict;
comment	@# @;


1.20
date	2022.10.14.22.10.15;	author jmcneill;	state Exp;
branches;
next	1.19;
commitid	A7hlybugMiXaFJXD;

1.19
date	2022.06.25.13.24.35;	author jmcneill;	state Exp;
branches;
next	1.18;
commitid	ktXzgoSrYIl2kqJD;

1.18
date	2021.10.31.12.34.48;	author jmcneill;	state Exp;
branches;
next	1.17;
commitid	wE7HahSSTxGhFXeD;

1.17
date	2021.10.30.19.28.40;	author jmcneill;	state Exp;
branches;
next	1.16;
commitid	BG9xMHpVN59fZReD;

1.16
date	2021.10.03.23.19.26;	author jmcneill;	state Exp;
branches;
next	1.15;
commitid	ogtAdCzShq3j8qbD;

1.15
date	2021.09.18.12.25.07;	author jmcneill;	state Exp;
branches;
next	1.14;
commitid	Ew1cRDmRj9yHYq9D;

1.14
date	2021.08.08.12.31.42;	author jmcneill;	state Exp;
branches;
next	1.13;
commitid	cVnbmXsIC5Tila4D;

1.13
date	2020.09.08.17.39.04;	author jakllsch;	state Exp;
branches;
next	1.12;
commitid	dqmjMPwJUYNuMgnC;

1.12
date	2019.12.07.16.00.09;	author jmcneill;	state Exp;
branches;
next	1.11;
commitid	TJKNn3uXihvS6NNB;

1.11
date	2019.09.06.21.09.11;	author jmcneill;	state Exp;
branches;
next	1.10;
commitid	x2neLj87K17fMZBB;

1.10
date	2019.07.03.19.45.14;	author jmcneill;	state Exp;
branches
	1.10.2.1;
next	1.9;
commitid	Z4gwCGL0OoLYoDtB;

1.9
date	2018.11.13.06.06.29;	author ryo;	state Exp;
branches;
next	1.8;
commitid	xZXwVyPrPMeskKZA;

1.8
date	2018.10.21.00.42.06;	author jmcneill;	state Exp;
branches;
next	1.7;
commitid	5sHbYDaG1HAogLWA;

1.7
date	2018.10.16.10.25.33;	author jmcneill;	state Exp;
branches;
next	1.6;
commitid	zm6h6v1s0BjTEaWA;

1.6
date	2018.10.16.00.32.07;	author jmcneill;	state Exp;
branches;
next	1.5;
commitid	ikY2KxcGlBIxn7WA;

1.5
date	2018.10.15.05.14.07;	author skrll;	state Exp;
branches;
next	1.4;
commitid	wbUWnNjtSsfgY0WA;

1.4
date	2018.10.15.05.11.08;	author skrll;	state Exp;
branches;
next	1.3;
commitid	u0KwAVcJUytdX0WA;

1.3
date	2018.10.07.07.48.44;	author skrll;	state Exp;
branches;
next	1.2;
commitid	2NsfcA28MWxH10VA;

1.2
date	2018.09.08.00.42.24;	author jmcneill;	state Exp;
branches;
next	1.1;
commitid	9h54I3MEsm4OEeRA;

1.1
date	2018.04.01.04.35.04;	author ryo;	state Exp;
branches
	1.1.2.1
	1.1.4.1;
next	;
commitid	Rbo0y8tEIcKr5HwA;

1.10.2.1
date	2019.09.22.12.35.56;	author martin;	state Exp;
branches;
next	1.10.2.2;
commitid	6mgC2zEPzkWgq0EB;

1.10.2.2
date	2019.12.09.16.01.11;	author martin;	state Exp;
branches;
next	;
commitid	JRnyi82WnXxf33OB;

1.1.2.1
date	2018.04.01.04.35.04;	author pgoyette;	state dead;
branches;
next	1.1.2.2;
commitid	ZMkKSYuBapz7LsxA;

1.1.2.2
date	2018.04.07.04.12.12;	author pgoyette;	state Exp;
branches;
next	1.1.2.3;
commitid	ZMkKSYuBapz7LsxA;

1.1.2.3
date	2018.09.30.01.45.40;	author pgoyette;	state Exp;
branches;
next	1.1.2.4;
commitid	SQ44grEPCeKPh4UA;

1.1.2.4
date	2018.10.20.06.58.27;	author pgoyette;	state Exp;
branches;
next	1.1.2.5;
commitid	mTSoqZEZ4arHnFWA;

1.1.2.5
date	2018.11.26.01.52.21;	author pgoyette;	state Exp;
branches;
next	;
commitid	Zj4q5SspGdKXto1B;

1.1.4.1
date	2019.06.10.22.06.05;	author christos;	state Exp;
branches;
next	1.1.4.2;
commitid	jtc8rnCzWiEEHGqB;

1.1.4.2
date	2020.04.08.14.07.34;	author martin;	state Exp;
branches;
next	1.1.4.3;
commitid	Qli2aW9E74UFuA3C;

1.1.4.3
date	2020.04.13.08.03.42;	author martin;	state Exp;
branches;
next	;
commitid	X01YhRUPVUDaec4C;


desc
@@


1.20
log
@Add a PCI resource manager and use it on Arm ACPI platforms.

The Arm ACPI code relied on PCI_NETBSD_CONFIGURE to configure devices that
were not enabled by system firmware. This is not safe to do unless the
firmware explicitly permits it using a device specific method defined in
the PCI firmware spec.

Introduce a new PCI resource manager that discovers what has already been
configured by firmware and allocates from the remaining space. This will
ensure that devices setup by firmware are untouched and only will program
BARs of devices that are not enabled at boot time.

The current implementation assumes that the parent PCI-PCI bridge's
are already configured. A worthwhile improvement in the future would be
to support programming windows for bridges that are not fully configured.
@
text
@#	$NetBSD: std.generic64,v 1.19 2022/06/25 13:24:35 jmcneill Exp $
#
#	generic NetBSD/evbarm64 with FDT support

machine		evbarm aarch64
include		"conf/std"
include		"arch/aarch64/conf/std.aarch64"	# arch standard options

# Architecture options
options 	AARCH64

options 	ACPI_REDUCED_HW
options 	ARM_GENERIC_TODR
options 	ARM_INTR_IMPL="<arch/arm/fdt/fdt_intr.h>"
options 	DRAM_BLOCKS=256
options 	EVBARM_BOARDTYPE="FDT"
options 	FDT				# Flattened Device Tree support
options 	FPU_VFP
options 	MODULAR
options 	MODULAR_DEFAULT_AUTOLOAD
options 	PCI_NETBSD_CONFIGURE
options 	PCI_RESOURCE
options 	PCI_SMCCC		# Arm PCI Conf Access Firmware Interface
options 	_ARM32_NEED_BUS_DMA_BOUNCE
options 	__HAVE_GENERIC_CPU_INITCLOCKS
options 	__HAVE_PCI_CONF_HOOK
options 	__HAVE_PCI_MSI_MSIX
options 	__BUS_SPACE_HAS_PROBING_METHODS
options 	__BUS_SPACE_HAS_STREAM_METHODS

# XXXNH not yet
#options 	__HAVE_CPU_UAREA_ALLOC_IDLELWP

makeoptions	BOARDMKFRAG="${THISARM}/conf/mk.generic64"

# initrd support
options 	MEMORY_DISK_HOOKS
options 	MEMORY_DISK_DYNAMIC
pseudo-device 	md

# General options
options 	CHILD_MAX=1024	# 160 is too few
options 	OPEN_MAX=1024	# 128 is too few
@


1.19
log
@Remove GIC_SPLFUNCS.
@
text
@d1 1
a1 1
#	$NetBSD: std.generic64,v 1.18 2021/10/31 12:34:48 jmcneill Exp $
d22 1
@


1.18
log
@Disable GIC_SPLFUNCS (still crashy)
@
text
@d1 1
a1 1
#	$NetBSD: std.generic64,v 1.17 2021/10/30 19:28:40 jmcneill Exp $
a18 1
#options 	GIC_SPLFUNCS			# Experimental
@


1.17
log
@Enable GIC_SPLFUNCS again. Hopefully stable now.
@
text
@d1 1
a1 1
#	$NetBSD: std.generic64,v 1.16 2021/10/03 23:19:26 jmcneill Exp $
d19 1
a19 1
options 	GIC_SPLFUNCS
@


1.16
log
@disable GIC_SPLFUNCS until remaining issues are sorted out
@
text
@d1 1
a1 1
#	$NetBSD: std.generic64,v 1.15 2021/09/18 12:25:07 jmcneill Exp $
d19 1
a19 1
#options 	GIC_SPLFUNCS
@


1.15
log
@gic_splx: performance optimizations

Avoid any kind of register access (DAIF, PMR, etc), barriers, and atomic
operations in the common case where no interrupt fires between spl being
raised and lowered.

This introduces a per-CPU return address (ci_splx_restart) used by the
vector handler to restart a sequence in splx that compares the new ipl
with the per-CPU hardware priority state stored in ci_hwpl.
@
text
@d1 1
a1 1
#	$NetBSD: std.generic64,v 1.14 2021/08/08 12:31:42 jmcneill Exp $
d19 1
a19 1
options 	GIC_SPLFUNCS
@


1.14
log
@Enable options PCI_SMCCC on 64-bit Arm.
@
text
@d1 1
a1 1
#	$NetBSD: std.generic64,v 1.13 2020/09/08 17:39:04 jakllsch Exp $
d19 1
@


1.13
log
@Enable __BUS_SPACE_HAS_STREAM_METHODS in std.generic64

These are needed for virtio_pci on aarch64eb.
@
text
@d1 1
a1 1
#	$NetBSD: std.generic64,v 1.12 2019/12/07 16:00:09 jmcneill Exp $
d22 1
@


1.12
log
@Define __BUS_SPACE_HAS_PROBING_METHODS
@
text
@d1 1
a1 1
#	$NetBSD: std.generic64,v 1.11 2019/09/06 21:09:11 jmcneill Exp $
d27 1
@


1.11
log
@Add __HAVE_GENERIC_CPU_INITCLOCKS
@
text
@d1 1
a1 1
#	$NetBSD: std.generic64,v 1.10 2019/07/03 19:45:14 jmcneill Exp $
d26 1
@


1.10
log
@Define _ARM32_NEED_BUS_DMA_BOUNCE for aarch64 so we can use bus_dmamap_subregion
@
text
@d1 1
a1 1
#	$NetBSD: std.generic64,v 1.9 2018/11/13 06:06:29 ryo Exp $
d23 1
@


1.10.2.1
log
@Pull up following revision(s) (requested by jmcneill in ticket #224):

	sys/arch/evbarm/conf/std.generic64: revision 1.11

Add __HAVE_GENERIC_CPU_INITCLOCKS
@
text
@d1 1
a1 1
#	$NetBSD: std.generic64,v 1.10 2019/07/03 19:45:14 jmcneill Exp $
a22 1
options 	__HAVE_GENERIC_CPU_INITCLOCKS
@


1.10.2.2
log
@Pull up following revision(s) (requested by jmcneill in ticket #529):

	sys/arch/evbarm/conf/std.generic64: revision 1.12
	sys/arch/arm/rockchip/rk3399_pcie.c: revision 1.8

Define __BUS_SPACE_HAS_PROBING_METHODS
Use bus_space_{peek,poke}_4 for pci conf reg access.
@
text
@d1 1
a1 1
#	$NetBSD: std.generic64,v 1.10.2.1 2019/09/22 12:35:56 martin Exp $
a25 1
options 	__BUS_SPACE_HAS_PROBING_METHODS
@


1.9
log
@turn on MODULAR by default on aarch64
@
text
@d1 1
a1 1
#	$NetBSD: std.generic64,v 1.8 2018/10/21 00:42:06 jmcneill Exp $
d22 1
@


1.8
log
@Add support for PCI MSI using ARM GICv2m.
@
text
@d1 1
a1 1
#	$NetBSD: std.generic64,v 1.7 2018/10/16 10:25:33 jmcneill Exp $
d19 2
a26 2
#options 	MODULAR
#options 	MODULAR_DEFAULT_AUTOLOAD
@


1.7
log
@Rename options ACPI_REDUCED_HARDWARE to ACPI_REDUCED_HW. The former is
a boolean in the acpica build, so use the latter to select the correct
value.
@
text
@d1 1
a1 1
#	$NetBSD: std.generic64,v 1.6 2018/10/16 00:32:07 jmcneill Exp $
d21 1
@


1.6
log
@Use ACPI_REDUCED_HARDWARE on arm64 to shrink the kernel
@
text
@d1 1
a1 1
#	$NetBSD: std.generic64,v 1.5 2018/10/15 05:14:07 skrll Exp $
d12 1
a12 1
options 	ACPI_REDUCED_HARDWARE
@


1.5
log
@Sort options
@
text
@d1 1
a1 1
#	$NetBSD: std.generic64,v 1.4 2018/10/15 05:11:08 skrll Exp $
d12 1
@


1.4
log
@G/C
@
text
@d1 1
a1 1
#	$NetBSD: std.generic64,v 1.3 2018/10/07 07:48:44 skrll Exp $
a11 2
options 	__HAVE_PCI_CONF_HOOK

d14 2
a17 2
options 	DRAM_BLOCKS=256
options 	EVBARM_BOARDTYPE="FDT"
d19 1
@


1.3
log
@Whitespace consistency.

{make,}options<space><tab>
everything else just <tab?
@
text
@d1 1
a1 1
#	$NetBSD: std.generic64,v 1.2 2018/09/08 00:42:24 jmcneill Exp $
a25 2
#options 	ARM_HAS_VBAR
#options 	KERNEL_BASE_EXT=0x80000000
@


1.2
log
@Add initrd options
@
text
@d1 1
a1 1
#	$NetBSD: std.generic64,v 1.1 2018/04/01 04:35:04 ryo Exp $
d3 1
a3 1
# 	generic NetBSD/evbarm64 with FDT support
d32 3
a34 3
options		MEMORY_DISK_HOOKS
options		MEMORY_DISK_DYNAMIC
pseudo-device	md
@


1.1
log
@Add initial support for ARMv8 (AARCH64) (by nisimura@@ and ryo@@)

- sys/arch/evbarm64 is gone and integrated into sys/arch/evbarm. (by skrll@@)
- add support fdt. evbarm/conf/GENERIC64 fdt (bcm2837,sunxi,tegra) based generic 64bit kernel config. (by skrll@@, jmcneill@@)
@
text
@d1 1
a1 1
#	$NetBSD$
d31 5
@


1.1.4.1
log
@Sync with HEAD
@
text
@d1 1
a1 1
#	$NetBSD: std.generic64,v 1.9 2018/11/13 06:06:29 ryo Exp $
d3 1
a3 1
#	generic NetBSD/evbarm64 with FDT support
d12 2
a13 1
options 	ACPI_REDUCED_HW
d16 2
a19 4
options 	FDT				# Flattened Device Tree support
options 	FPU_VFP
options 	MODULAR
options 	MODULAR_DEFAULT_AUTOLOAD
a20 2
options 	__HAVE_PCI_CONF_HOOK
options 	__HAVE_PCI_MSI_MSIX
d24 4
a30 5
# initrd support
options 	MEMORY_DISK_HOOKS
options 	MEMORY_DISK_DYNAMIC
pseudo-device 	md

@


1.1.4.2
log
@Merge changes from current as of 20200406
@
text
@d1 1
a1 1
#	$NetBSD$
a23 1
options 	__BUS_SPACE_HAS_PROBING_METHODS
@


1.1.4.3
log
@Mostly merge changes from HEAD upto 20200411
@
text
@a21 2
options 	_ARM32_NEED_BUS_DMA_BOUNCE
options 	__HAVE_GENERIC_CPU_INITCLOCKS
@


1.1.2.1
log
@file std.generic64 was added on branch pgoyette-compat on 2018-04-07 04:12:12 +0000
@
text
@d1 33
@


1.1.2.2
log
@Sync with HEAD.  77 conflicts resolved - all of them $NetBSD$
@
text
@a0 33
#	$NetBSD: std.generic64,v 1.1 2018/04/01 04:35:04 ryo Exp $
#
# 	generic NetBSD/evbarm64 with FDT support

machine		evbarm aarch64
include		"conf/std"
include		"arch/aarch64/conf/std.aarch64"	# arch standard options

# Architecture options
options 	AARCH64

options 	__HAVE_PCI_CONF_HOOK

options 	ARM_GENERIC_TODR
options 	ARM_INTR_IMPL="<arch/arm/fdt/fdt_intr.h>"
options 	FDT				# Flattened Device Tree support
options 	FPU_VFP
options 	DRAM_BLOCKS=256
options 	EVBARM_BOARDTYPE="FDT"
options 	PCI_NETBSD_CONFIGURE

# XXXNH not yet
#options 	__HAVE_CPU_UAREA_ALLOC_IDLELWP
#options 	MODULAR
#options 	MODULAR_DEFAULT_AUTOLOAD
#options 	ARM_HAS_VBAR
#options 	KERNEL_BASE_EXT=0x80000000

makeoptions	BOARDMKFRAG="${THISARM}/conf/mk.generic64"

# General options
options 	CHILD_MAX=1024	# 160 is too few
options 	OPEN_MAX=1024	# 128 is too few
@


1.1.2.3
log
@Ssync with HEAD
@
text
@d1 1
a1 1
#	$NetBSD: std.generic64,v 1.2 2018/09/08 00:42:24 jmcneill Exp $
a30 5
# initrd support
options		MEMORY_DISK_HOOKS
options		MEMORY_DISK_DYNAMIC
pseudo-device	md

@


1.1.2.4
log
@Sync with head
@
text
@d1 1
a1 1
#	$NetBSD: std.generic64,v 1.7 2018/10/16 10:25:33 jmcneill Exp $
d3 1
a3 1
#	generic NetBSD/evbarm64 with FDT support
d12 2
a13 1
options 	ACPI_REDUCED_HW
d16 2
a19 2
options 	FDT				# Flattened Device Tree support
options 	FPU_VFP
a20 1
options 	__HAVE_PCI_CONF_HOOK
d26 2
d32 3
a34 3
options 	MEMORY_DISK_HOOKS
options 	MEMORY_DISK_DYNAMIC
pseudo-device 	md
@


1.1.2.5
log
@Sync with HEAD, resolve a couple of conflicts
@
text
@d1 1
a1 1
#	$NetBSD: std.generic64,v 1.9 2018/11/13 06:06:29 ryo Exp $
a18 2
options 	MODULAR
options 	MODULAR_DEFAULT_AUTOLOAD
a20 1
options 	__HAVE_PCI_MSI_MSIX
d24 2
@


