All of lore.kernel.org
 help / color / mirror / Atom feed
From: Magnus Damm <damm@opensource.se>
To: linux-renesas-soc@vger.kernel.org
Cc: Magnus Damm <damm@opensource.se>, geert+renesas@glider.be
Subject: [PATCH/RFC] ARM: dts: kzm9g: Extend DTS with hints on how to build
Date: Sun, 21 Mar 2021 20:33:03 +0900	[thread overview]
Message-ID: <161632638364.9010.14149594685878279298.sendpatchset@octo> (raw)

From: Magnus Damm <damm+renesas@opensource.se>

Include hints in the DTS for KZM9G on how to build a kernel that may be booted
using the old on-board boot loader. Special handling includes:
 - The DTB needs to be appended to the zImage before generating the uImage
 - LOADADDR needs to be set to 0x48008000 to be able to generate an uImage
 - CONFIG_ATAGS=n is needed for the board to boot

Perhaps there is a better place where this kind of information should be
placed? Many years ago the LOADADDR information used to be part of the kernel
makefiles (and make uImage just worked out of the box) but when going DTS
and zImage this seems to have been dropped. So these days special care is
needed to build a uImage file which is required by the boot loader.

Not-Yet-Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
---

 arch/arm/boot/dts/sh73a0-kzm9g.dts |   19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

--- 0001/arch/arm/boot/dts/sh73a0-kzm9g.dts
+++ work/arch/arm/boot/dts/sh73a0-kzm9g.dts	2021-03-21 18:10:53.515741849 +0900
@@ -2,9 +2,24 @@
 /*
  * Device Tree Source for the KZM-A9-GT board
  *
- * Copyright (C) 2012 Horms Solutions Ltd.
+ * The KZM9G board comes with on-board out-of-tree U-Boot from 2012 with:
+ *  uImage support but without zImage support
+ *  one way or the other busted ATAGs
+ *
+ * Generate an uImage at the correct load address with apppended DTB like this:
+ *  make ARCH=arm CROSS_COMPILE=_ uImage LOADADDR=0x48008000
+ *  rm arch/arm/boot/zImage
+ *  make ARCH=arm CROSS_COMPILE=_ dtbs zImage
+ *  cat arch/arm/boot/dts/sh73a0-kzm9g.dtb >> arch/arm/boot/zImage
+ *  $(cut -f 3- -d ' ' < arch/arm/boot/.uImage.cmd)
+ *
+ * For a working recent kernel (v5.10+) the following configuration is needed:
+ *  CONFIG_ARM_APPENDED_DTB=y
+ *  CONFIG_ATAGS=n
  *
- * Based on sh73a0-kzm9g.dts
+ * The shmobile_defconfig works well after setting CONFIG_ATAGS=n
+ *
+ * Copyright (C) 2012 Horms Solutions Ltd.
  * Copyright (C) 2012 Renesas Solutions Corp.
  */
 

             reply	other threads:[~2021-03-21 12:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-21 11:33 Magnus Damm [this message]
2021-03-21 14:03 ` [PATCH/RFC] ARM: dts: kzm9g: Extend DTS with hints on how to build Geert Uytterhoeven
2021-03-22  2:21   ` Magnus Damm
2021-03-22  8:16     ` Geert Uytterhoeven

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=161632638364.9010.14149594685878279298.sendpatchset@octo \
    --to=damm@opensource.se \
    --cc=geert+renesas@glider.be \
    --cc=linux-renesas-soc@vger.kernel.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 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.