From: Michael Tokarev <mjt@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 <mjt@tls.msk.ru>
@@ -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 -------------------------------------------
@@ -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);
@@ -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 :=