public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Uladzimir Bely <ubely@ilbers.de>
To: Jan Kiszka <jan.kiszka@siemens.com>, isar-users@googlegroups.com
Subject: Re: [PATCH 1/2] u-boot-starfive-visionfive2: Fix build with swig 4.3.0
Date: Fri, 11 Apr 2025 13:13:29 +0300	[thread overview]
Message-ID: <851cbbc579a026494337310b34a228000276bc8d.camel@ilbers.de> (raw)
In-Reply-To: <660543a4-cb15-4e11-b7d3-842e9cea3ac6@siemens.com>

On Fri, 2025-04-11 at 10:11 +0200, Jan Kiszka wrote:
> On 11.04.25 00:51, Uladzimir Bely wrote:
> > On Wed, 2025-04-09 at 16:06 +0200, Jan Kiszka wrote:
> > > On 08.04.25 13:33, Uladzimir Bely wrote:
> > > > Fixes u-boot build failure on newer trixie that got updated
> > > > swig-
> > > > 4.3.0
> > > > some time ago.
> > > > 
> > > > ```
> > > > scripts/dtc/pylibfdt/libfdt_wrap.c: In function
> > > > ‘_wrap_fdt_next_node’:
> > > > scripts/dtc/pylibfdt/libfdt_wrap.c:5581:17: error: too few
> > > > arguments
> > > >     to function ‘SWIG_Python_AppendOutput’
> > > >  5581 |     resultobj = SWIG_Python_AppendOutput(resultobj,
> > > > val);
> > > >       |                 ^~~~~~~~~~~~~~~~~~~~~~~~
> > > > ```
> > > > ---
> > > >  ...bfdt-libfdt.i_shipped-Use-SWIG_Appen.patch | 60
> > > > +++++++++++++++++++
> > > >  .../u-boot-starfive-visionfive2_2024.01.bb    |  1 +
> > > >  2 files changed, 61 insertions(+)
> > > >  create mode 100644 meta-isar/recipes-bsp/u-boot/files/0001-
> > > > scripts-dtc-pylibfdt-libfdt.i_shipped-Use-SWIG_Appen.patch
> > > > 
> > > > diff --git a/meta-isar/recipes-bsp/u-boot/files/0001-scripts-
> > > > dtc-
> > > > pylibfdt-libfdt.i_shipped-Use-SWIG_Appen.patch b/meta-
> > > > isar/recipes-
> > > > bsp/u-boot/files/0001-scripts-dtc-pylibfdt-libfdt.i_shipped-
> > > > Use-
> > > > SWIG_Appen.patch
> > > > new file mode 100644
> > > > index 00000000..d919eb68
> > > > --- /dev/null
> > > > +++ b/meta-isar/recipes-bsp/u-boot/files/0001-scripts-dtc-
> > > > pylibfdt-
> > > > libfdt.i_shipped-Use-SWIG_Appen.patch
> > > > @@ -0,0 +1,60 @@
> > > > +From a63456b9191fae2fe49f4b121e025792022e3950 Mon Sep 17
> > > > 00:00:00
> > > > 2001
> > > > +From: Markus Volk <f_l_k@t-online.de>
> > > > +Date: Wed, 30 Oct 2024 06:07:16 +0100
> > > > +Subject: [PATCH] scripts/dtc/pylibfdt/libfdt.i_shipped: Use
> > > > SWIG_AppendOutput
> > > > +MIME-Version: 1.0
> > > > +Content-Type: text/plain; charset=UTF-8
> > > > +Content-Transfer-Encoding: 8bit
> > > > +
> > > > +Swig has changed language specific AppendOutput functions. The
> > > > helper
> > > > +macro SWIG_AppendOutput remains unchanged. Use that instead
> > > > +of SWIG_Python_AppendOutput, which would require an extra
> > > > parameter
> > > > +since swig 4.3.0.
> > > > +
> > > > +/home/flk/poky/build-test/tmp/work/qemux86_64-poky-linux/u-
> > > > boot/2024.10/git/arch/x86/cpu/u-boot-64.lds
> > > > +| scripts/dtc/pylibfdt/libfdt_wrap.c: In function
> > > > ‘_wrap_fdt_next_node’:
> > > > +| scripts/dtc/pylibfdt/libfdt_wrap.c:5581:17: error: too few
> > > > arguments to function ‘SWIG_Python_AppendOutput’
> > > > +|  5581 |     resultobj = SWIG_Python_AppendOutput(resultobj,
> > > > val);
> > > > +|       |                 ^~~~~~~~~~~~~~~~~~~~~~~~
> > > > +
> > > > +Signed-off-by: Markus Volk <f_l_k@t-online.de>
> > > > +Reported-by: Rudi Heitbaum <rudi@heitbaum.com>
> > > > +Link: https://github.com/dgibson/dtc/pull/154
> > > > +---
> > > > + scripts/dtc/pylibfdt/libfdt.i_shipped | 6 +++---
> > > > + 1 file changed, 3 insertions(+), 3 deletions(-)
> > > > +
> > > > +diff --git a/scripts/dtc/pylibfdt/libfdt.i_shipped
> > > > b/scripts/dtc/pylibfdt/libfdt.i_shipped
> > > > +index 56cc5d48f4f..e4659489a96 100644
> > > > +--- a/scripts/dtc/pylibfdt/libfdt.i_shipped
> > > > ++++ b/scripts/dtc/pylibfdt/libfdt.i_shipped
> > > > +@@ -1037,7 +1037,7 @@ typedef uint32_t fdt32_t;
> > > > + 			fdt_string(fdt1, fdt32_to_cpu($1-
> > > > > nameoff)));
> > > > + 		buff = PyByteArray_FromStringAndSize(
> > > > + 			(const char *)($1 + 1),
> > > > fdt32_to_cpu($1-
> > > > > len));
> > > > +-		resultobj =
> > > > SWIG_Python_AppendOutput(resultobj,
> > > > buff);
> > > > ++		resultobj = SWIG_AppendOutput(resultobj,
> > > > buff);
> > > > + 	}
> > > > + }
> > > > + 
> > > > +@@ -1076,7 +1076,7 @@ typedef uint32_t fdt32_t;
> > > > + 
> > > > + %typemap(argout) int *depth {
> > > > +         PyObject *val = Py_BuildValue("i", *arg$argnum);
> > > > +-        resultobj = SWIG_Python_AppendOutput(resultobj, val);
> > > > ++        resultobj = SWIG_AppendOutput(resultobj, val);
> > > > + }
> > > > + 
> > > > + %apply int *depth { int *depth };
> > > > +@@ -1092,7 +1092,7 @@ typedef uint32_t fdt32_t;
> > > > +            if (PyTuple_GET_SIZE(resultobj) == 0)
> > > > +               resultobj = val;
> > > > +            else
> > > > +-              resultobj = SWIG_Python_AppendOutput(resultobj,
> > > > val);
> > > > ++              resultobj = SWIG_AppendOutput(resultobj, val);
> > > > +         }
> > > > + }
> > > > + 
> > > > +-- 
> > > > +2.49.0
> > > > +
> > > > diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-starfive-
> > > > visionfive2_2024.01.bb b/meta-isar/recipes-bsp/u-boot/u-boot-
> > > > starfive-visionfive2_2024.01.bb
> > > > index 9f819c3e..becd40da 100644
> > > > --- a/meta-isar/recipes-bsp/u-boot/u-boot-starfive-
> > > > visionfive2_2024.01.bb
> > > > +++ b/meta-isar/recipes-bsp/u-boot/u-boot-starfive-
> > > > visionfive2_2024.01.bb
> > > > @@ -8,6 +8,7 @@ require recipes-bsp/u-boot/u-boot-custom.inc
> > > >  COMPATIBLE_MACHINE = "starfive-visionfive2"
> > > >  
> > > >  SRC_URI +=
> > > > "https://ftp.denx.de/pub/u-boot/u-boot-${PV}.tar.bz2 \
> > > > +   
> > > > file://0001-scripts-dtc-pylibfdt-libfdt.i_shipped-Use-SWIG_Appen.patch
> > > >  \
> > > >      file://starfive-visionfive2-rules.tmpl"
> > > >  SRC_URI[sha256sum] =
> > > > "b99611f1ed237bf3541bdc8434b68c96a6e05967061f992443cb30aabebef5
> > > > b3"
> > > >  
> > > 
> > > Better bump U-boot to v2025.01.
> > > 
> > > Jan
> > 
> > Tried with this version: it build works but requires adding
> > "libgnutls28" to the recipe DEPENDS (errors like "gnutls/gnutls.h"
> > can't be found).
> 
> Might be worth to update u-boot-custom.inc with the new default build
> deps of U-Boot at some point. I'm considering to look into that - for
> too long now.
> 
> > 
> > Will be sent with v2.
> > 
> 
> Thanks,
> Jan

Things are becoming more and more interesting...

U-boot 2024.01 with the patch boots the board well.

Switching to u-boot 2025.04 leads to the following boot log:

```
U-Boot SPL 2025.04 (Jan 01 1970 - 01:00:00 +0000)
DDR version: dc2e84f0.
Trying to boot from MMC2
OpenSBI v1.4
  ____                    _____ ____ _____
 / __ \                  / ____|  _ \_   _|
| |  | |_ __   ___ _ __ | (___ | |_) || |
| |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
| |__| | |_) |  __/ | | |____) | |_) || |_
 \____/| .__/ \___|_| |_|_____/|____/_____|
       | |
       |_|
Platform Name             : StarFive VisionFive 2 v1.3B
Platform Features         : medeleg
Platform HART Count       : 5
Platform IPI Device       : aclint-mswi
Platform Timer Device     : aclint-mtimer @ 4000000Hz
Platform Console Device   : uart8250
Platform HSM Device       : ---
Platform PMU Device       : ---
Platform Reboot Device    : gpio-restart
Platform Shutdown Device  : ---
Platform Suspend Device   : ---
Platform CPPC Device      : ---
Firmware Base             : 0x40000000
Firmware Size             : 363 KB
Firmware RW Offset        : 0x40000
Firmware RW Size          : 107 KB
Firmware Heap Offset      : 0x50000
Firmware Heap Size        : 43 KB (total), 2 KB (reserved), 9 KB
(used), 31 KB (free)
Firmware Scratch Size     : 4096 B (total), 328 B (used), 3768 B (free)
Runtime SBI Version       : 2.0
Domain0 Name              : root
Domain0 Boot HART         : 2
Domain0 HARTs             : 0*,1*,2*,3*,4*
Domain0 Region00          : 0x0000000010000000-0x0000000010000fff M:
(I,R,W) S/U: (R,W)
Domain0 Region01          : 0x0000000002000000-0x000000000200ffff M:
(I,R,W) S/U: ()
Domain0 Region02          : 0x0000000040040000-0x000000004005ffff M:
(R,W) S/U: ()
Domain0 Region03          : 0x0000000040000000-0x000000004003ffff M:
(R,X) S/U: ()
Domain0 Region04          : 0x000000000c000000-0x000000000fffffff M:
(I,R,W) S/U: (R,W)
Domain0 Region05          : 0x0000000000000000-0xffffffffffffffff M: ()
S/U: (R,W,X)
Domain0 Next Address      : 0x0000000040200000
Domain0 Next Arg1         : 0x0000000040400000
Domain0 Next Mode         : S-mode
Domain0 SysReset          : yes
Domain0 SysSuspend        : yes
Boot HART ID              : 2
Boot HART Domain          : root
Boot HART Priv Version    : v1.11
Boot HART Base ISA        : rv64imafdcbx
Boot HART ISA Extensions  : zihpm
Boot HART PMP Count       : 8
Boot HART PMP Granularity : 12 bits
Boot HART PMP Address Bits: 34
Boot HART MHPM Info       : 2 (0x00000018)
Boot HART MIDELEG         : 0x0000000000000222
Boot HART MEDELEG         : 0x000000000000b109

U-Boot 2025.04 (Jan 01 1970 - 01:00:00 +0000)
CPU:   sifive,u74-mc
Model: StarFive VisionFive 2 v1.3B
DRAM:  8 GiB
Core:  154 devices, 26 uclasses, devicetree: board
WDT:   Not starting watchdog@13070000
MMC:   mmc@16010000: 0, mmc@16020000: 1
Loading Environment from SPIFlash... SF: Detected gd25lq128 with page
size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environment
StarFive EEPROM format v2
--------EEPROM INFO--------
Vendor : StarFive Technology Co., Ltd.
Product full SN: VF7110B1-2253-D008E000-00002012
data version: 0x2
PCB revision: 0xb2
BOM revision: A
Ethernet MAC0 address: 6c:cf:39:00:31:81
Ethernet MAC1 address: 6c:cf:39:00:31:82
--------EEPROM INFO--------
starfive_7110_pcie pcie@940000000: Starfive PCIe bus probed.
starfive_7110_pcie pcie@9c0000000: Starfive PCIe bus probed.
In:    serial@10000000
Out:   serial@10000000
Err:   serial@10000000
Net:   eth0: ethernet@16030000, eth1: ethernet@16040000
starting USB...
Bus xhci_pci: Register 5000420 NbrPorts 5
Starting the controller
USB XHCI 1.00
scanning bus xhci_pci for devices... 2 USB Device(s) found
      scanning usb for storage devices... 0 Storage Device(s) found
Working FDT set to ff720a20
Hit any key to stop autoboot:  0  
Card did not respond to voltage select! : -110
** Booting bootflow '<NULL>' with efi_mgr
Booting: mmc 1
EFI stub: Booting Linux Kernel...
EFI stub: Loaded initrd from LINUX_EFI_INITRD_MEDIA_GUID device path
EFI stub: Using DTB from configuration table
EFI stub: Exiting boot services...
Unhandled exception: Store/AMO access fault
EPC: 00000000fff5ddd6 RA: 00000000fff6ccf2 TVAL: 0000000000000000
EPC: 000000004021fdd6 RA: 000000004022ecf2 reloc adjusted
SP:  00000000ff71f350 GP:  00000000ff72de40 TP:  0000000000000002
T0:  00000000ff71f240 T1:  00000000ff787750 T2:  00000000019d8000
S0:  00000000ff731860 S1:  0000000000004600 A0:  00000000ff731988
A1:  0000000000000000 A2:  0000000000004600 A3:  0000000000004000
A4:  0000000000000000 A5:  0000000000000000 A6:  0000000000000001
A7:  0000000000000000 S2:  00000000ff71f468 S3:  00000000fffddd60
S4:  0000000000004600 S5:  fffffffffffffdfb S6:  ffffffffffffff7f
S7:  ffffffffffffffff S8:  00000000fb71a390 S9:  00000000fe6ca030
S10: 0000000000000ac0 S11: 00000000fe6ca008 T3:  00000000fe714fff
T4:  000000000000000a T5:  0000000000cd1000 T6:  00000000ff7877e0
Code: 7402 64e2 6942 69a2 6145 8082 7d1c 6138 (e31c)
UEFI image [0x00000000fe6b2000:0x00000000fe6ce07b]
'/\EFI\BOOT\BOOTRISCV64.EFI'
UEFI image [0x00000000fa8fc000:0x00000000fc2d1fff] '/\vmlinux-6.6.20-
isar'

resetting ...
```

This needs additional time to debug and fix. So, for now we tend to
stay working version now + the patch.

-- 
Best regards,
Uladzimir.


-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/851cbbc579a026494337310b34a228000276bc8d.camel%40ilbers.de.

  reply	other threads:[~2025-04-11 10:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-08 11:33 [PATCH 0/2] Fix riscv64/trixie build Uladzimir Bely
2025-04-08 11:33 ` [PATCH 1/2] u-boot-starfive-visionfive2: Fix build with swig 4.3.0 Uladzimir Bely
2025-04-09 14:06   ` 'Jan Kiszka' via isar-users
2025-04-10 22:51     ` Uladzimir Bely
2025-04-11  8:11       ` 'Jan Kiszka' via isar-users
2025-04-11 10:13         ` Uladzimir Bely [this message]
2025-04-11 13:35           ` 'Jan Kiszka' via isar-users
2025-04-08 11:33 ` [PATCH 2/2] linux-starfive: Fix build with GNU make 4.4 Uladzimir Bely
2025-04-09 14:09   ` 'Jan Kiszka' via isar-users
2025-04-10  7:25     ` Uladzimir Bely
2025-04-10 13:07       ` 'Jan Kiszka' via isar-users
2025-04-10 22:55         ` Uladzimir Bely
2025-04-11  9:50           ` 'Jan Kiszka' via isar-users

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=851cbbc579a026494337310b34a228000276bc8d.camel@ilbers.de \
    --to=ubely@ilbers.de \
    --cc=isar-users@googlegroups.com \
    --cc=jan.kiszka@siemens.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox