mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ian Abbott <abbotti@mev.co.uk>
To: barebox@lists.infradead.org
Cc: Ian Abbott <abbotti@mev.co.uk>
Subject: [PATCH] scripts: socfpga_import_preloader: Use SDK-supplied Python
Date: Thu, 15 Jun 2023 13:30:20 +0100	[thread overview]
Message-ID: <20230615123020.25927-1-abbotti@mev.co.uk> (raw)

Change `generate_spl()` to use the `python` bundled with the SDK (SoC
EDS) instead of using `python2.7`.  In version 20.1 of SoC EDS, the
`iswgen.py` script was updated to work with Python 3.8 and no longer
works with Python 2.7, leading to an error similar to this when
generating the SPL:

```
Generating file: /tmp/tmp.0xSiyYqAU2//sdram//sdram_config.h...
Traceback (most recent call last):
  File "/opt/intelFPGA/20.1/embedded/ip/altera/preloader/scripts/iswgen.py", line 63, in <module>
    hps = hps.HPSGrokker(inputDir, outputDir)
  File "/opt/intelFPGA/20.1/embedded/ip/altera/preloader/scripts/hps.py", line 54, in __init__
    self.createFilesFromHPS()
  File "/opt/intelFPGA/20.1/embedded/ip/altera/preloader/scripts/hps.py", line 546, in createFilesFromHPS
    self.handleHPSPeripheralsNode(childNode)
  File "/opt/intelFPGA/20.1/embedded/ip/altera/preloader/scripts/hps.py", line 413, in handleHPSPeripheralsNode
    self.pinmuxHeaderBuffer.write("#define " + name + ' ' + '(' + str(used) + ')' + '\n')
TypeError: unicode argument expected, got 'str'
```

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
 scripts/socfpga_import_preloader | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/socfpga_import_preloader b/scripts/socfpga_import_preloader
index bd54e1b913..a555c9174b 100755
--- a/scripts/socfpga_import_preloader
+++ b/scripts/socfpga_import_preloader
@@ -112,7 +112,10 @@ copy_source() {
 }
 
 generate_spl() {
-	python2.7 ${embeddedsw}/embedded/ip/altera/preloader/scripts/iswgen.py -i ${handoff} -o ${splroot}/
+	USE_SOCEDS_PYTHON=1 SOCEDS_DESTROY_PATH=1 \
+		${embeddedsw}/embedded/embedded_command_shell.sh python \
+		${embeddedsw}/embedded/ip/altera/preloader/scripts/iswgen.py \
+		-i ${handoff} -o ${splroot}/
 }
 
 if [ -z $splroot ] || [ -z $boardroot ] || [ -z $handoff ]; then
-- 
2.39.2




             reply	other threads:[~2023-06-15 12:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-15 12:30 Ian Abbott [this message]
2023-06-21  8:31 ` Sascha Hauer

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=20230615123020.25927-1-abbotti@mev.co.uk \
    --to=abbotti@mev.co.uk \
    --cc=barebox@lists.infradead.org \
    /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