linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Geoff Levand <geoff@infradead.org>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@lists.ozlabs.org,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Markus Elfring <elfring@users.sourceforge.net>,
	Emmanuel Nicolet <emmanuel.nicolet@gmail.com>
Subject: [PATCH v3 7/9] powerpc/ps3: Add check for otheros image size
Date: Sat, 16 May 2020 09:20:46 -0700	[thread overview]
Message-ID: <897c2a59-378e-7c9b-3976-d0a0def90913@infradead.org> (raw)
In-Reply-To: <4e8defeb49d62dd9d435e5ea3ddc5668e56fa496.1589049250.git.geoff@infradead.org>

The ps3's otheros flash loader has a size limit of 16 MiB for the
uncompressed image.  If that limit will be reached output the
flash image file as 'otheros-too-big.bld'.

Signed-off-by: Geoff Levand <geoff@infradead.org>
---
v2: Change from decimal to hex values. Output an INFO message to screen.
v3: Remove the INFO message.

 arch/powerpc/boot/wrapper | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index 35ace40d9fc2..d0b5f202c49c 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -571,7 +571,18 @@ ps3)
         count=$overlay_size bs=1
 
     odir="$(dirname "$ofile.bin")"
-    rm -f "$odir/otheros.bld"
-    gzip -n --force -9 --stdout "$ofile.bin" > "$odir/otheros.bld"
+
+    # The ps3's flash loader has a size limit of 16 MiB for the uncompressed
+    # image.  If a compressed image that exceeded this limit is written to
+    # flash the loader will decompress that image until the 16 MiB limit is
+    # reached, then enter the system reset vector of the partially decompressed
+    # image.  No warning is issued.
+    rm -f "$odir"/{otheros,otheros-too-big}.bld
+    size=$(${CROSS}nm --no-sort --radix=d "$ofile" | egrep ' _end$' | cut -d' ' -f1)
+    bld="otheros.bld"
+    if [ $size -gt $((0x1000000)) ]; then
+        bld="otheros-too-big.bld"
+    fi
+    gzip -n --force -9 --stdout "$ofile.bin" > "$odir/$bld"
     ;;
 esac
-- 
2.20.1


  parent reply	other threads:[~2020-05-16 16:22 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-09 18:58 [PATCH v2 0/9] powerpc + ps3 patches Geoff Levand
2020-05-09 18:58 ` [PATCH v2 3/9] powerpc/head_check: Avoid broken pipe Geoff Levand
2020-05-09 18:58 ` [PATCH v2 4/9] drivers/ps3: Remove duplicate error messages Geoff Levand
2020-05-10 18:15   ` Markus Elfring
2020-05-09 18:58 ` [PATCH v2 1/9] powerpc/head_check: Automatic verbosity Geoff Levand
2020-05-09 18:58 ` [PATCH v2 2/9] powerpc/wrapper: Output linker map file Geoff Levand
2020-05-09 18:58 ` [PATCH v2 9/9] hvc_console: Allow backends to set I/O buffer size Geoff Levand
2020-05-10 19:05   ` Markus Elfring
2020-05-10 22:50   ` [PATCH v3 " Geoff Levand
2020-05-09 18:58 ` [PATCH v2 7/9] powerpc/ps3: Add check for otheros image size Geoff Levand
2020-05-15  2:02   ` Michael Ellerman
2020-05-16 16:03     ` Geoff Levand
2020-05-18  6:31       ` Michael Ellerman
2020-05-16 16:20   ` Geoff Levand [this message]
2020-06-09  5:56     ` [PATCH v3 " Michael Ellerman
2020-05-09 18:58 ` [PATCH v2 8/9] powerpc/ps3: Fix kexec shutdown hang Geoff Levand
2020-05-09 18:58 ` [PATCH v2 6/9] ps3disk: use the default segment boundary Geoff Levand
2020-05-09 18:58 ` [PATCH v2 5/9] net/ps3_gelic_net: Remove duplicate error message Geoff Levand
2020-05-10 18:25   ` Markus Elfring
2020-05-20 10:59 ` [PATCH v2 0/9] powerpc + ps3 patches Michael Ellerman

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=897c2a59-378e-7c9b-3976-d0a0def90913@infradead.org \
    --to=geoff@infradead.org \
    --cc=elfring@users.sourceforge.net \
    --cc=emmanuel.nicolet@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    /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;
as well as URLs for NNTP newsgroup(s).