From: Kumar Gala <galak@kernel.crashing.org>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH 2/3] Add ePAPR boot command
Date: Wed, 6 Aug 2008 01:32:11 -0500 [thread overview]
Message-ID: <1218004332-20311-2-git-send-email-galak@kernel.crashing.org> (raw)
In-Reply-To: <1218004332-20311-1-git-send-email-galak@kernel.crashing.org>
Add a boot command that supports the ePAPR client interface on powerpc.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
lib_ppc/bootm.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 63 insertions(+), 0 deletions(-)
diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c
index a872d31..1182c50 100644
--- a/lib_ppc/bootm.c
+++ b/lib_ppc/bootm.c
@@ -821,3 +821,66 @@ error:
return 1;
}
#endif
+
+/*******************************************************************/
+/* boote - boot ePAPR */
+/*******************************************************************/
+#if defined(CONFIG_CMD_BOOT_EPAPR)
+int do_boot_epapr (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+ void (*kernel)(ulong r3, ulong r4, ulong r5, ulong r6,
+ ulong r7, ulong r8, ulong r9);
+ ulong kern, of_flat_tree, epapr_magic;
+
+ if (argc != 3) {
+ printf ("Usage:\n%s\n", cmdtp->usage);
+ return 1;
+ }
+
+ kern = simple_strtoul (argv[1], NULL, 16);
+ of_flat_tree = simple_strtoul (argv[2], NULL, 16);
+
+ if (kern & 0x3) {
+ printf ("kernel address 0x%lx is not 4-byte aligned\n", kern);
+ return 1;
+ }
+
+ if (of_flat_tree & 0x7) {
+ printf ("Flat device tree address 0x%lx is not 8-byte aligned\n", of_flat_tree);
+ return 1;
+ }
+
+ kernel = (void (*)(ulong, ulong, ulong, ulong,
+ ulong, ulong, ulong))kern;
+
+ disable_interrupts();
+
+ /*
+ * Linux Kernel Parameters (passing device tree):
+ * r3: pointer to the fdt
+ * r4: 0
+ * r5: 0
+ * r6: epapr magic
+ * r7: size of IMA in bytes
+ * r8: 0
+ * r9: 0
+ */
+#if defined(CONFIG_85xx) || defined(CONFIG_440)
+ epapr_magic = 0x45504150;
+#else
+ epapr_magic = 0x65504150;
+#endif
+
+ debug (" Booting using OF flat tree...\n");
+ (*kernel) (of_flat_tree, 0, 0, epapr_magic, CFG_BOOTMAPSZ, 0, 0);
+ /* does not return */
+
+ return 0;
+}
+
+U_BOOT_CMD(
+ bootepapr, 3, 1, do_boot_epapr,
+ "bootepapr - boot according to ePAPR client interface\n",
+ "<entry point> <device tree address>\n"
+);
+#endif
--
1.5.5.1
next prev parent reply other threads:[~2008-08-06 6:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-06 6:32 [U-Boot-Users] [PATCH 1/3] ppc: Report back the location we put the device tree if we dont boot Kumar Gala
2008-08-06 6:32 ` Kumar Gala [this message]
2008-08-06 6:32 ` [U-Boot-Users] [PATCH 3/3] add ability to disable ft_board_setup as part of bootm Kumar Gala
2008-08-11 21:56 ` Wolfgang Denk
2008-08-06 8:21 ` [U-Boot-Users] [PATCH 2/3] Add ePAPR boot command Wolfgang Denk
2008-08-06 13:03 ` Kumar Gala
2008-08-06 14:40 ` Wolfgang Denk
2008-08-06 7:08 ` [U-Boot-Users] [PATCH 1/3] ppc: Report back the location we put the device tree if we dont boot Wolfgang Denk
2008-08-06 8:21 ` Bartlomiej Sieka
2008-08-06 8:33 ` Wolfgang Denk
2008-08-06 13:16 ` Kumar Gala
2008-08-06 14:46 ` Wolfgang Denk
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=1218004332-20311-2-git-send-email-galak@kernel.crashing.org \
--to=galak@kernel.crashing.org \
--cc=u-boot@lists.denx.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.