Quellcode durchsuchen

add microblaze gcc 15 patch from buildroot

Waldemar Brodkorb vor 2 Wochen
Ursprung
Commit
490428a3c7

+ 0 - 101
target/linux/patches/6.12.74/armnommu-versatile.patch

@@ -1,101 +0,0 @@
-From 77c038d93769c92ef54cdbb50388564d1b37987b Mon Sep 17 00:00:00 2001
-From: Greg Ungerer <gerg@kernel.org>
-Date: Fri, 23 Sep 2016 13:37:34 +1000
-Subject: [PATCH] ARM: versatile: support configuring versatile machine for no-MMU
-
-Allow the arm versatile machine to be configured for no-MMU operation.
-
-Older kernels had the ability to build the versatile machine with the MMU
-disabled (!CONFIG_MMU). Recent changes to convert the versatile machine
-to device tree lost this ability. (Although older kernels could be built
-they did not run due to a bug in the IO_ADDRESS() mapping on this machine).
-
-The motivation for this is that the versatile machine is well supported
-in qemu. And this provides an excellent platform for development and
-testing no-MMU support on ARM in general.
-
-This patch adds a versatile platform selection in the upper level arm
-system type menu - where it appeared in older kernel versions - when
-configuring for the no-MMU case. There is no visible change to the way
-versatile is selected for the MMU enabled case.
-
-Signed-off-by: Greg Ungerer <gerg@kernel.org>
----
- arch/arm/Kconfig                    |   13 ++++++++++++-
- arch/arm/include/asm/mach/map.h     |    1 +
- arch/arm/mach-versatile/Kconfig     |    2 +-
- arch/arm/mach-versatile/versatile.c |    4 ++++
- 4 files changed, 18 insertions(+), 2 deletions(-)
-
-diff --git a/arch/arm/mach-versatile/versatile.c b/arch/arm/mach-versatile/versatile.c
-index 02ba68abe533..835b51bc597b 100644
---- a/arch/arm/mach-versatile/versatile.c
-+++ b/arch/arm/mach-versatile/versatile.c
-@@ -22,7 +22,11 @@
- #include <asm/mach/map.h>
- 
- /* macro to get at MMIO space when running virtually */
-+#ifdef CONFIG_MMU
- #define IO_ADDRESS(x)		(((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000)
-+#else
-+#define IO_ADDRESS(x)		(x)
-+#endif
- #define __io_address(n)		((void __iomem __force *)IO_ADDRESS(n))
- 
- /*
-diff --git a/arch/arm/include/asm/mach/map.h b/arch/arm/include/asm/mach/map.h
-index 2b8970d8e5a2..41844ab6aec5 100644
---- a/arch/arm/include/asm/mach/map.h
-+++ b/arch/arm/include/asm/mach/map.h
-@@ -60,6 +60,7 @@ extern int ioremap_page(unsigned long virt, unsigned long phys,
- #else
- #define iotable_init(map,num)	do { } while (0)
- #define vm_reserve_area_early(a,s,c)	do { } while (0)
-+#define debug_ll_io_init()	do { } while (0)
- #endif
- 
- #endif
-diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
-index e24a9820e12f..342e1efa583a 100644
---- a/arch/arm/Kconfig
-+++ b/arch/arm/Kconfig
-@@ -307,12 +307,23 @@ config MMU
- 	  Select if you want MMU-based virtualised addressing space
- 	  support by paged memory management. If unsure, say 'Y'.
- 
-+choice
-+	prompt "ARM system type"
-+	depends on !MMU
-+	default ARM_SINGLE_ARMV7M
-+
- config ARM_SINGLE_ARMV7M
--	def_bool !MMU
-+	bool "ARMv7-M based platforms (Cortex-M0/M3/M4)"
- 	select ARM_NVIC
- 	select CPU_V7M
- 	select NO_IOPORT_MAP
- 
-+config ARM_SINGLE_ARM926
-+	bool "ARM926 based platforms"
-+	select CPU_ARM926T
-+
-+endchoice
-+
- config ARCH_MMAP_RND_BITS_MIN
- 	default 8
- 
-diff --git a/arch/arm/mach-versatile/Kconfig b/arch/arm/mach-versatile/Kconfig
-index b1519b4dc03a..2f1bf95daeb0 100644
---- a/arch/arm/mach-versatile/Kconfig
-+++ b/arch/arm/mach-versatile/Kconfig
-@@ -1,7 +1,7 @@
- # SPDX-License-Identifier: GPL-2.0
- config ARCH_VERSATILE
- 	bool "ARM Ltd. Versatile family"
--	depends on ARCH_MULTI_V5
-+	depends on ARCH_MULTI_V5 || ARM_SINGLE_ARM926
- 	depends on CPU_LITTLE_ENDIAN
- 	select ARM_AMBA
- 	select ARM_TIMER_SP804
--- 
-2.25.1

+ 0 - 12
target/linux/patches/6.12.74/hppa-cross-compile.patch

@@ -1,12 +0,0 @@
-diff -Nur linux-6.6.22.orig/arch/parisc/Makefile linux-6.6.22/arch/parisc/Makefile
---- linux-6.6.22.orig/arch/parisc/Makefile	2024-03-15 19:25:07.000000000 +0100
-+++ linux-6.6.22/arch/parisc/Makefile	2024-04-16 03:57:37.515308996 +0200
-@@ -41,7 +41,7 @@
- 
- # Set default 32 bits cross compilers for vdso
- CC_ARCHES_32 = hppa hppa2.0 hppa1.1
--CC_SUFFIXES  = linux linux-gnu unknown-linux-gnu suse-linux
-+CC_SUFFIXES  = linux linux-gnu unknown-linux-gnu suse-linux openadk-linux-uclibc
- CROSS32_COMPILE := $(call cc-cross-prefix, \
- 	$(foreach a,$(CC_ARCHES_32), \
- 	$(foreach s,$(CC_SUFFIXES),$(a)-$(s)-)))

+ 0 - 12
target/linux/patches/6.12.74/linksys-nslu2.patch

@@ -1,12 +0,0 @@
-diff -Nur linux-6.6.82.orig/arch/arm/boot/dts/intel/ixp/intel-ixp42x-linksys-nslu2.dts linux-6.6.82/arch/arm/boot/dts/intel/ixp/intel-ixp42x-linksys-nslu2.dts
---- linux-6.6.82.orig/arch/arm/boot/dts/intel/ixp/intel-ixp42x-linksys-nslu2.dts	2025-03-09 09:55:04.000000000 +0100
-+++ linux-6.6.82/arch/arm/boot/dts/intel/ixp/intel-ixp42x-linksys-nslu2.dts	2025-04-08 19:11:26.464512676 +0200
-@@ -21,7 +21,7 @@
- 	};
- 
- 	chosen {
--		bootargs = "console=ttyS0,115200n8 root=/dev/mtdblock2 rw rootfstype=squashfs,jffs2 rootwait";
-+		bootargs = "console=ttyS0,115200n8 root=/dev/mtdblock4 rootfstype=squashfs,jffs2 rootwait";
- 		stdout-path = "uart0:115200n8";
- 	};
- 

+ 0 - 11
target/linux/patches/6.12.74/macsonic.patch

@@ -1,11 +0,0 @@
-diff -Nur linux-6.6.22.orig/drivers/net/ethernet/natsemi/Kconfig linux-6.6.22/drivers/net/ethernet/natsemi/Kconfig
---- linux-6.6.22.orig/drivers/net/ethernet/natsemi/Kconfig	2024-03-15 19:25:07.000000000 +0100
-+++ linux-6.6.22/drivers/net/ethernet/natsemi/Kconfig	2024-04-16 10:16:50.352443898 +0200
-@@ -19,6 +19,7 @@
- config MACSONIC
- 	tristate "Macintosh SONIC based ethernet (onboard, NuBus, LC, CS)"
- 	depends on MAC
-+	select BITREVERSE
- 	help
- 	  Support for NatSemi SONIC based Ethernet devices.  This includes
- 	  the onboard Ethernet in many Quadras as well as some LC-PDS,

+ 0 - 12
target/linux/patches/6.12.74/mips-vdso-gcc15.patch

@@ -1,12 +0,0 @@
-diff -Nur linux-6.12.25.orig/arch/mips/vdso/Makefile linux-6.12.25/arch/mips/vdso/Makefile
---- linux-6.12.25.orig/arch/mips/vdso/Makefile	2025-04-25 10:48:08.000000000 +0200
-+++ linux-6.12.25/arch/mips/vdso/Makefile	2025-04-30 19:42:08.538362252 +0200
-@@ -30,7 +30,7 @@
- 	-O3 -g -fPIC -fno-strict-aliasing -fno-common -fno-builtin -G 0 \
- 	-mrelax-pic-calls $(call cc-option, -mexplicit-relocs) \
- 	-fno-stack-protector -fno-jump-tables -DDISABLE_BRANCH_PROFILING \
--	$(call cc-option, -fno-asynchronous-unwind-tables)
-+	$(call cc-option, -fno-asynchronous-unwind-tables) -std=gnu11
- aflags-vdso := $(ccflags-vdso) \
- 	-D__ASSEMBLY__ -Wa,-gdwarf-2
- 

+ 0 - 83
target/linux/patches/6.18.18/microblaze-new-gcc.patch

@@ -1,83 +0,0 @@
-diff -Nur linux-6.18.18.orig/arch/microblaze/kernel/entry.S linux-6.18.18/arch/microblaze/kernel/entry.S
---- linux-6.18.18.orig/arch/microblaze/kernel/entry.S	2026-03-13 17:23:30.000000000 +0100
-+++ linux-6.18.18/arch/microblaze/kernel/entry.S	2026-03-27 08:00:11.173928808 +0100
-@@ -339,6 +339,9 @@
-  * Trap entered via brki instruction, so BIP bit is set, and interrupts
-  * are masked. This is nice, means we don't have to CLI before state save
-  */
-+
-+#define SYSCALL_ARGS_SIZE 36
-+
- C_ENTRY(_user_exception):
- 	swi	r1, r0, TOPHYS(PER_CPU(ENTRY_SP)) /* save stack */
- 	addi	r14, r14, 4	/* return address is 4 byte after call */
-@@ -422,16 +425,19 @@
- 	lwi	r12, r12, sys_call_table
- 	/* where the trap should return need -8 to adjust for rtsd r15, 8 */
- 	addi	r15, r0, ret_from_trap-8
-+	addik 	r1, r1, -SYSCALL_ARGS_SIZE
- 	bra	r12
- 
- 	/* The syscall number is invalid, return an error.  */
- 5:
--	braid	ret_from_trap
-+	braid	ret_from_trap2
- 	addi	r3, r0, -ENOSYS;
- 
- /* Entry point used to return from a syscall/trap */
- /* We re-enable BIP bit before state restore */
- C_ENTRY(ret_from_trap):
-+	addik	r1, r1, SYSCALL_ARGS_SIZE
-+C_ENTRY(ret_from_trap2):
- 	swi	r3, r1, PT_R3
- 	swi	r4, r1, PT_R4
- 
-@@ -504,7 +510,7 @@
- 	bralid	r15, schedule_tail; /* ...which is schedule_tail's arg */
- 	add	r5, r3, r0;	/* switch_thread returns the prev task */
- 				/* ( in the delay slot ) */
--	brid	ret_from_trap;	/* Do normal trap return */
-+	brid	ret_from_trap2;	/* Do normal trap return */
- 	add	r3, r0, r0;	/* Child's fork call should return 0. */
- 
- C_ENTRY(ret_from_kernel_thread):
-@@ -513,13 +519,13 @@
- 				/* ( in the delay slot ) */
- 	brald	r15, r20	/* fn was left in r20 */
- 	addk	r5, r0, r19	/* ... and argument - in r19 */
--	brid	ret_from_trap
-+	brid	ret_from_trap2
- 	add	r3, r0, r0
- 
- C_ENTRY(sys_rt_sigreturn_wrapper):
- 	addik	r30, r0, 0		/* no restarts */
- 	brid	sys_rt_sigreturn	/* Do real work */
--	addik	r5, r1, 0;		/* add user context as 1st arg */
-+	addik	r5, r1, SYSCALL_ARGS_SIZE; /* add user context as 1st arg */
- 
- /*
-  * HW EXCEPTION rutine start
-@@ -729,11 +735,13 @@
- 	lwi	CURRENT_TASK, r0, TOPHYS(PER_CPU(CURRENT_SAVE));
- 	tovirt(r1,r1)
- 	addik	r15, r0, irq_call;
-+	addik 	r1, r1, -8
- irq_call:rtbd	r0, do_IRQ;
--	addik	r5, r1, 0;
-+	addik	r5, r1, 8;
- 
- /* MS: we are in virtual mode */
- ret_from_irq:
-+	addik 	r1, r1, 8
- 	lwi	r11, r1, PT_MODE;
- 	bnei	r11, 2f;
- 
-@@ -1302,7 +1310,7 @@
- .global microblaze_trap_handlers
- microblaze_trap_handlers:
- 	/* Exact matches come first */
--	.word ret_from_trap; .word ret_from_trap   ; .word type_SYSCALL
-+	.word ret_from_trap; .word ret_from_trap2  ; .word type_SYSCALL
- 	.word ret_from_irq ; .word ret_from_irq    ; .word type_IRQ
- 	/* Fuzzy matches go here */
- 	.word ret_from_irq ; .word no_intr_resched ; .word type_IRQ_PREEMPT

+ 56 - 0
toolchain/gcc/patches/15.2.0/gcc-config-microblaze-fix-ira-for-GCC15.patch

@@ -0,0 +1,56 @@
+From d2fdbd8c4abe67eea86877dfb3b3b9d8508c165f Mon Sep 17 00:00:00 2001
+From: Romain Naour <romain.naour@gmail.com>
+Date: Wed, 6 Aug 2025 22:32:30 +0200
+Subject: [PATCH] gcc/config/microblaze: fix ira for GCC15
+
+Add new hooks for callee-save on microblaze defined by [1] and
+return 1 to restore the old behavior prior to the commit [3].
+
+Tested with qemu_microblazeel_mmu_defconfig and used to generate
+Microblaze toolchains for the Bootlin toolchains 2025.08-1 [4][5].
+
+Upstream: suggested in the bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121432#c10
+
+[1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=b191e8bdecf881d11c1544c441e38f4c18392a15
+[2] https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/config/i386/i386.cc;h=3128973ba79cccfc6761f451dcb716b9558cc4da;hb=d3ff498c478acefce35de04402f99171b4f64a1a#l20606
+[3] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=3b9b8d6cfdf59337f4b7ce10ce92a98044b2657b
+[4] https://lore.kernel.org/buildroot/87sehzndtp.fsf@dell.be.48ers.dk/T/#mce7decd0b3f6a41008d5de577538a8525c91b374
+[5] https://toolchains.bootlin.com/
+
+Signed-off-by: Romain Naour <romain.naour@gmail.com>
+---
+ gcc/config/microblaze/microblaze.cc | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/gcc/config/microblaze/microblaze.cc b/gcc/config/microblaze/microblaze.cc
+index 78b9428ef3b..84ea7e8d55a 100644
+--- a/gcc/config/microblaze/microblaze.cc
++++ b/gcc/config/microblaze/microblaze.cc
+@@ -3228,6 +3228,14 @@ microblaze_secondary_reload (bool in_p ATTRIBUTE_UNUSED, rtx x ATTRIBUTE_UNUSED,
+   return NO_REGS;
+ }
+ 
++/* Implement TARGET_CALLEE_SAVE_COST.  */
++static int
++microblaze_callee_save_cost (spill_cost_type, unsigned int hard_regno, machine_mode,
++		       unsigned int, int mem_cost, const HARD_REG_SET &, bool)
++{
++  return 1;
++}
++
+ static void
+ microblaze_globalize_label (FILE * stream, const char *name)
+ {
+@@ -4066,6 +4074,9 @@ microblaze_starting_frame_offset (void)
+ #undef TARGET_SECONDARY_RELOAD
+ #define TARGET_SECONDARY_RELOAD		microblaze_secondary_reload
+ 
++#undef TARGET_CALLEE_SAVE_COST
++#define TARGET_CALLEE_SAVE_COST microblaze_callee_save_cost
++
+ #undef  TARGET_ASM_OUTPUT_MI_THUNK
+ #define TARGET_ASM_OUTPUT_MI_THUNK      microblaze_asm_output_mi_thunk
+ 
+-- 
+2.50.1
+