All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Pitre <nico@fluxnic.net>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
	Russell King <linux@armlinux.org.uk>,
	Arnd Bergmann <arnd@arndb.de>, Eric Miao <eric.miao@nvidia.com>,
	Chris Brandt <chris.brandt@renesas.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH/RFC] ARM: boot: Relax kernel image alignment for RZ/A with CS3 SDRAM
Date: Wed, 13 Nov 2019 11:56:53 -0500 (EST)	[thread overview]
Message-ID: <nycvar.YSQ.7.76.1911131151510.7180@knanqh.ubzr> (raw)
In-Reply-To: <20191113104037.e45j37xoxeztvut3@pengutronix.de>

[-- Attachment #1: Type: text/plain, Size: 1512 bytes --]

On Wed, 13 Nov 2019, Uwe Kleine-König wrote:

> On Wed, Nov 13, 2019 at 11:27:29AM +0100, Geert Uytterhoeven wrote:
> > The RZA2MEVB sub board has 64 MiB of SDRAM at 0x0C000000 (CS3 space).
> 
> This wording is misleading. You don't adapt the limit because 128 MiB >
> the amount of RAM on that platform but because the alignment of the CS3
> space isn't a multiple of 128 MiB. So I suggest:
> 
> 	On the RZA2MEVB the SDRAM's base is at 0x0C000000 which isn't
> 	aligned to 128 MiB. So to ensure the assumptions of the
> 	decompressor are valid the used alignment must be decreased.
> 
> > Hence the mask for CONFIG_AUTO_ZRELADDR needs to be changed, otherwise
> > the system will crash because it will try to decompress a zImage or
> > uImage to a non-RAM garbage address.
> > 
> > Based on a patch in the BSP by Chris Brandt <chris.brandt@renesas.com>.
> > 
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > ---
> > No idea what to do with the rest of the comment, or if this breaks
> > existing platforms.
> 
> I would assume that it indeed breaks existing platforms. So maybe better
> make this configurable, default to 128 MiB and select it to 64 MiB on
> the affected platform? If the resulting kernel supports also other
> machines a warning (at compile time) might be a good idea.

Better yet could involve fetching the actual physical RAM start address 
from the DTB when present. This 128 MB mask was just a shortcut to keep 
things simple.


Nicolas

WARNING: multiple messages have this Message-ID (diff)
From: Nicolas Pitre <nico@fluxnic.net>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
	Arnd Bergmann <arnd@arndb.de>,
	Russell King <linux@armlinux.org.uk>,
	linux-renesas-soc@vger.kernel.org,
	Chris Brandt <chris.brandt@renesas.com>,
	Eric Miao <eric.miao@nvidia.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH/RFC] ARM: boot: Relax kernel image alignment for RZ/A with CS3 SDRAM
Date: Wed, 13 Nov 2019 11:56:53 -0500 (EST)	[thread overview]
Message-ID: <nycvar.YSQ.7.76.1911131151510.7180@knanqh.ubzr> (raw)
In-Reply-To: <20191113104037.e45j37xoxeztvut3@pengutronix.de>

[-- Attachment #1: Type: text/plain, Size: 1512 bytes --]

On Wed, 13 Nov 2019, Uwe Kleine-König wrote:

> On Wed, Nov 13, 2019 at 11:27:29AM +0100, Geert Uytterhoeven wrote:
> > The RZA2MEVB sub board has 64 MiB of SDRAM at 0x0C000000 (CS3 space).
> 
> This wording is misleading. You don't adapt the limit because 128 MiB >
> the amount of RAM on that platform but because the alignment of the CS3
> space isn't a multiple of 128 MiB. So I suggest:
> 
> 	On the RZA2MEVB the SDRAM's base is at 0x0C000000 which isn't
> 	aligned to 128 MiB. So to ensure the assumptions of the
> 	decompressor are valid the used alignment must be decreased.
> 
> > Hence the mask for CONFIG_AUTO_ZRELADDR needs to be changed, otherwise
> > the system will crash because it will try to decompress a zImage or
> > uImage to a non-RAM garbage address.
> > 
> > Based on a patch in the BSP by Chris Brandt <chris.brandt@renesas.com>.
> > 
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > ---
> > No idea what to do with the rest of the comment, or if this breaks
> > existing platforms.
> 
> I would assume that it indeed breaks existing platforms. So maybe better
> make this configurable, default to 128 MiB and select it to 64 MiB on
> the affected platform? If the resulting kernel supports also other
> machines a warning (at compile time) might be a good idea.

Better yet could involve fetching the actual physical RAM start address 
from the DTB when present. This 128 MB mask was just a shortcut to keep 
things simple.


Nicolas

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2019-11-13 16:57 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-13 10:27 [PATCH/RFC] ARM: boot: Relax kernel image alignment for RZ/A with CS3 SDRAM Geert Uytterhoeven
2019-11-13 10:27 ` Geert Uytterhoeven
2019-11-13 10:39 ` Russell King - ARM Linux admin
2019-11-13 10:39   ` Russell King - ARM Linux admin
2019-11-13 10:50   ` Uwe Kleine-König
2019-11-13 10:50     ` Uwe Kleine-König
2019-11-13 13:32   ` Geert Uytterhoeven
2019-11-13 13:32     ` Geert Uytterhoeven
2019-11-13 17:04     ` Russell King - ARM Linux admin
2019-11-13 17:04       ` Russell King - ARM Linux admin
2019-11-13 18:34       ` Geert Uytterhoeven
2019-11-13 18:34         ` Geert Uytterhoeven
2019-11-13 10:40 ` Uwe Kleine-König
2019-11-13 10:40   ` Uwe Kleine-König
2019-11-13 10:44   ` Russell King - ARM Linux admin
2019-11-13 10:44     ` Russell King - ARM Linux admin
2019-11-13 13:16   ` Geert Uytterhoeven
2019-11-13 13:16     ` Geert Uytterhoeven
2019-11-13 16:56   ` Nicolas Pitre [this message]
2019-11-13 16:56     ` Nicolas Pitre

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=nycvar.YSQ.7.76.1911131151510.7180@knanqh.ubzr \
    --to=nico@fluxnic.net \
    --cc=arnd@arndb.de \
    --cc=chris.brandt@renesas.com \
    --cc=eric.miao@nvidia.com \
    --cc=geert+renesas@glider.be \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=u.kleine-koenig@pengutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.