Hi!

For some time, qemu package in debian carries several patches for 
roms/u-boot-sam460ex,
fixing a number of issues.  It'd be nice to have them in the official 
repository.

Thanks,

/mjt
From: Michael Tokarev <m...@tls.msk.ru>
Subject: u-boot-sam460ex: remove obsolete -mstring gcc option
Date: Sun Oct 22 23:35:45 2023 +0300

Modern gcc complains about it.

Signed-off-by: Michael Tokarev <m...@tls.msk.ru>

diff --git a/roms/u-boot-sam460ex/arch/powerpc/cpu/ppc4xx/config.mk b/roms/u-boot-sam460ex/arch/powerpc/cpu/ppc4xx/config.mk
index 8f47c9b728..cf4414cee6 100644
--- a/roms/u-boot-sam460ex/arch/powerpc/cpu/ppc4xx/config.mk
+++ b/roms/u-boot-sam460ex/arch/powerpc/cpu/ppc4xx/config.mk
@@ -24,3 +24,3 @@
 PLATFORM_RELFLAGS += -fPIC -meabi
-PLATFORM_CPPFLAGS += -DCONFIG_4xx -ffixed-r2 -mstring -msoft-float
+PLATFORM_CPPFLAGS += -DCONFIG_4xx -ffixed-r2 -msoft-float
 
From: Michael Tokarev <m...@tls.msk.ru>
Subject: u-boot-sam460ex: fdi fix
Date: Sat Apr 1 17:34:09 2023 +0300

Fix the missing extern in a variable declaration,
resulting in this variable being repeated each time
this header is included, so the link with modern gcc
fails.

Signed-off-by: Michael Tokarev <m...@tls.msk.ru>

diff --git a/roms/u-boot-sam460ex/board/ACube/common/vesa.h b/roms/u-boot-sam460ex/board/ACube/common/vesa.h
index a6c32c3c2c..99672aa67b 100644
--- a/roms/u-boot-sam460ex/board/ACube/common/vesa.h
+++ b/roms/u-boot-sam460ex/board/ACube/common/vesa.h
@@ -4,7 +4,7 @@
 extern void *DoVesa(int argc, char *argv[]);
 extern void *set_vesa_mode(int mode);
 
-struct FrameBufferInfo
+extern struct FrameBufferInfo
 {
         void *BaseAddress;
         unsigned long XSize;
From: Michael Tokarev <m...@tls.msk.ru>
Date: Sat, 03 Aug 2024 11:18:58 +0300
Subject: u-boot-sam460ex: build fixes

Fixes or works around numerous build issues and one real bug.

Most are due to new defaults in gcc (in debian), like
 -Werror=implicit-function-declarations (there are a lot of missing decls)
 -Werror=incompatible-pointer-types (function types mismatches)
 -Werror=int-conversion (free int <=> pointer conversion)

Bug-Debian: https://bugs.debian.org/1075428
Signed-off-by: Michael Tokarev <m...@tls.msk.ru>

diff --git a/roms/u-boot-sam460ex/board/ACube/Sam460ex/Sam460ex.c b/roms/u-boot-sam460ex/board/ACube/Sam460ex/Sam460ex.c
index 4d5b953c02..5ecf16dbe2 100644
--- a/roms/u-boot-sam460ex/board/ACube/Sam460ex/Sam460ex.c
+++ b/roms/u-boot-sam460ex/board/ACube/Sam460ex/Sam460ex.c
@@ -843,7 +843,7 @@ int last_stage_init (void)
 	// cleanup last 8 bytes of the RTC registers bank -----
 	
 	char arr[8] = { 0 };
-	i2c_write(0x68, 0x08, 1, &arr, 8);
+	i2c_write(0x68, 0x08, 1, arr, 8);
 	
 	// USB Init -------------------------------------------
 
diff --git a/roms/u-boot-sam460ex/common/usb.c b/roms/u-boot-sam460ex/common/usb.c
index 203c9f7795..d645d36c8e 100644
--- a/roms/u-boot-sam460ex/common/usb.c
+++ b/roms/u-boot-sam460ex/common/usb.c
@@ -957,7 +957,7 @@ void usb_scan_devices(void)
 		printf("%d USB Device(s) found\n", dev_index);
 		
 #ifdef CONFIG_SAM460EX
-	static attempts = 0;
+	static int attempts = 0;
 	
     if (dev_index < 3) {  
         u16 fpga_val = in_be16((void *)CONFIG_SYS_FPGA_BASE + 0x2E);
diff --git a/roms/u-boot-sam460ex/config.mk b/roms/u-boot-sam460ex/config.mk
index bcda77611a..9928f5f4c6 100644
--- a/roms/u-boot-sam460ex/config.mk
+++ b/roms/u-boot-sam460ex/config.mk
@@ -191,6 +191,11 @@ endif
 
 CFLAGS += $(call cc-option,-fno-stack-protector)
 
+# this u-boot is an old bad code
+CFLAGS += $(call cc-option,-Wno-error=implicit-function-declaration)
+CFLAGS += $(call cc-option,-Wno-error=incompatible-pointer-types)
+CFLAGS += $(call cc-option,-Wno-error=int-conversion)
+
 # $(CPPFLAGS) sets -g, which causes gcc to pass a suitable -g<format>
 # option to the assembler.
 AFLAGS_DEBUG :=

Reply via email to