CVS commit: src/sys/arch/arm/conf

2024-02-18 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Feb 18 10:49:43 UTC 2024

Modified Files:
src/sys/arch/arm/conf: Makefile.arm

Log Message:
if we're building with GCC and MACHINE_CPU is aarch64, error out since
that isn't going to work.

doing this better in config(1) is difficult, but at least we can
detect and give a useful error message for this case instead of just
erroring out with some compiler options aren't supported.  if we have
a good solution for config(1) we can remove this hack here..

might want to copy this hack for riscv too.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/arm/conf/Makefile.arm

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/conf/Makefile.arm
diff -u src/sys/arch/arm/conf/Makefile.arm:1.57 src/sys/arch/arm/conf/Makefile.arm:1.58
--- src/sys/arch/arm/conf/Makefile.arm:1.57	Fri Jul 28 02:41:30 2023
+++ src/sys/arch/arm/conf/Makefile.arm	Sun Feb 18 10:49:43 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.arm,v 1.57 2023/07/28 02:41:30 rin Exp $
+#	$NetBSD: Makefile.arm,v 1.58 2024/02/18 10:49:43 mrg Exp $
 
 # Makefile for NetBSD
 #
@@ -21,6 +21,11 @@ USETOOLS?=	no
 NEED_OWN_INSTALL_TARGET?=no
 .include 
 
+.if ${MACHINE_CPU} == "aarch64" && ${HAVE_GCC} != "no"
+. info (Building GENERIC instead of GENERIC64?)
+. error Don't build 32-bit kernel with 64-bit toolchain
+.endif
+
 ##
 ## (1) port identification
 ##



CVS commit: src/sys/arch/arm/conf

2024-02-18 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Feb 18 10:49:43 UTC 2024

Modified Files:
src/sys/arch/arm/conf: Makefile.arm

Log Message:
if we're building with GCC and MACHINE_CPU is aarch64, error out since
that isn't going to work.

doing this better in config(1) is difficult, but at least we can
detect and give a useful error message for this case instead of just
erroring out with some compiler options aren't supported.  if we have
a good solution for config(1) we can remove this hack here..

might want to copy this hack for riscv too.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/arm/conf/Makefile.arm

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/arm/conf

2019-08-26 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Aug 26 17:18:42 UTC 2019

Modified Files:
src/sys/arch/arm/conf: Makefile.arm

Log Message:
PR kern/54486

Workaround for alignment faults on ARMv6+, at least occur with
axe(4) and athn(4) drivers.

For ARMv6+, unaligned access is enabled by default. However, it
cannot be used for non-cacheable memory, which is used as DMA
buffers. This results in alignment faults above. A real fix is
to use cacheable memory as DMA buffers. However, it breaks some
drivers, awge(4) and vchiq(4) at least.

Until we figure out problems and fix them, we choose a fail-safe
workaround here; forbid unaligned memory access for whole kernel.
Affects on performance is negligibly small as far as we can see.

XXX
pullup netbsd-9


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/arm/conf/Makefile.arm

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/arm/conf

2019-08-26 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Aug 26 17:18:42 UTC 2019

Modified Files:
src/sys/arch/arm/conf: Makefile.arm

Log Message:
PR kern/54486

Workaround for alignment faults on ARMv6+, at least occur with
axe(4) and athn(4) drivers.

For ARMv6+, unaligned access is enabled by default. However, it
cannot be used for non-cacheable memory, which is used as DMA
buffers. This results in alignment faults above. A real fix is
to use cacheable memory as DMA buffers. However, it breaks some
drivers, awge(4) and vchiq(4) at least.

Until we figure out problems and fix them, we choose a fail-safe
workaround here; forbid unaligned memory access for whole kernel.
Affects on performance is negligibly small as far as we can see.

XXX
pullup netbsd-9


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/arm/conf/Makefile.arm

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/conf/Makefile.arm
diff -u src/sys/arch/arm/conf/Makefile.arm:1.49 src/sys/arch/arm/conf/Makefile.arm:1.50
--- src/sys/arch/arm/conf/Makefile.arm:1.49	Sat Sep 22 12:24:01 2018
+++ src/sys/arch/arm/conf/Makefile.arm	Mon Aug 26 17:18:42 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.arm,v 1.49 2018/09/22 12:24:01 rin Exp $
+#	$NetBSD: Makefile.arm,v 1.50 2019/08/26 17:18:42 rin Exp $
 
 # Makefile for NetBSD
 #
@@ -53,6 +53,26 @@ CPPFLAGS.cpufunc_asm_armv6.S+=	-mcpu=arm
 CPPFLAGS.cpufunc_asm_arm11.S+=	-mcpu=arm1136j-s
 CPPFLAGS.cpufunc_asm_xscale.S+=	-mcpu=xscale
 
+.if !empty(MACHINE_ARCH:Mearmv6*) || !empty(MACHINE_ARCH:Mearmv7*)
+# XXX
+#
+# Workaround for alignment faults on ARMv6+, at least occur with
+# axe(4) and athn(4) drivers.
+#
+# For ARMv6+, unaligned access is enabled by default. However, it
+# cannot be used for non-cacheable memory, which is used as DMA
+# buffers. This results in alignment faults above. A real fix is
+# to use cacheable memory as DMA buffers. However, it breaks some
+# drivers, awge(4) and vchiq(4) at least.
+#
+# Until we figure out problems and fix them, we choose a fail-safe
+# workaround here; forbid unaligned memory access for whole kernel.
+# Affects on performance is negligibly small as far as we can see.
+#
+# See PR kern/54486 for more details.
+CFLAGS+=	-mno-unaligned-access
+.endif
+
 ##
 ## (3) libkern and compat
 ##