Re: [U-Boot] [PATCH V13 12/12] arm: Add Prep subcommand support to bootm

2012-02-12 Thread Albert ARIBAUD

Hi all,

Le 04/02/2012 11:22, Stefano Babic a écrit :


From: Simon Schwarzsimonschwarz...@googlemail.com

Adds prep subcommand to bootm implementation of ARM. When bootm is called
with the subcommand prep the function stops right after ATAGS creation and
before announce_and_cleanup.

This is used in command cmd_spl export

Signed-off-by: Simon Schwarzsimonschwarz...@gmail.com
Acked-by: Stefano Babicsba...@denx.de
Tested-by: Stefano Babicsba...@denx.de
---


That one's assigned to me on patchwork, but already resides in several 
branches of the imx tree.


Stefano, why not put it in imx master for pulling?

Amicalement,
--
Albert.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V13 12/12] arm: Add Prep subcommand support to bootm

2012-02-12 Thread Tom Rini
On Sun, Feb 12, 2012 at 7:48 AM, Albert ARIBAUD
albert.u.b...@aribaud.net wrote:
 Hi all,

 Le 04/02/2012 11:22, Stefano Babic a écrit :

 From: Simon Schwarzsimonschwarz...@googlemail.com

 Adds prep subcommand to bootm implementation of ARM. When bootm is called
 with the subcommand prep the function stops right after ATAGS creation and
 before announce_and_cleanup.

 This is used in command cmd_spl export

 Signed-off-by: Simon Schwarzsimonschwarz...@gmail.com
 Acked-by: Stefano Babicsba...@denx.de
 Tested-by: Stefano Babicsba...@denx.de
 ---


 That one's assigned to me on patchwork, but already resides in several
 branches of the imx tree.

 Stefano, why not put it in imx master for pulling?

What happened was that Stefano has working with me on getting the
series into u-boot-ti (since it's just booting on OMAP*ish boards
right now) so there's a branch or two for testing / avoiding a repost
just to get ToT again.  I expect to include it in a pull request next
week (need to double check the MAKEALL -s arm before/after, then do
the same for ppc).

-- 
Tom
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V13 12/12] arm: Add Prep subcommand support to bootm

2012-02-12 Thread Stefano Babic
On 12/02/2012 15:58, Tom Rini wrote:
 On Sun, Feb 12, 2012 at 7:48 AM, Albert ARIBAUD
 albert.u.b...@aribaud.net wrote:
 Hi all,

 Le 04/02/2012 11:22, Stefano Babic a écrit :

 From: Simon Schwarzsimonschwarz...@googlemail.com

 Adds prep subcommand to bootm implementation of ARM. When bootm is called
 with the subcommand prep the function stops right after ATAGS creation and
 before announce_and_cleanup.

 This is used in command cmd_spl export

 Signed-off-by: Simon Schwarzsimonschwarz...@gmail.com
 Acked-by: Stefano Babicsba...@denx.de
 Tested-by: Stefano Babicsba...@denx.de
 ---


 That one's assigned to me on patchwork, but already resides in several
 branches of the imx tree.

 Stefano, why not put it in imx master for pulling?
 
 What happened was that Stefano has working with me on getting the
 series into u-boot-ti (since it's just booting on OMAP*ish boards
 right now) so there's a branch or two for testing / avoiding a repost
 just to get ToT again.  I expect to include it in a pull request next
 week (need to double check the MAKEALL -s arm before/after, then do
 the same for ppc).

Right - the patches were tested and run  on OMAP-3 platform at the
moment. Making this code available for the other SOCs will come later.

My branches on u-boot-imx are only for testing, for anyone who wants to
try booting the Kernel from SPL without having to fight with the
different version of the patchset.

It is planned that the whole series will be pulled by Tom soon. It is
surely right if you assign this patch to Tom on patchwork ;-).

Best regards,
Stefano

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V13 12/12] arm: Add Prep subcommand support to bootm

2012-02-12 Thread Tom Rini
On Sun, Feb 12, 2012 at 8:21 AM, Stefano Babic sba...@denx.de wrote:
 On 12/02/2012 15:58, Tom Rini wrote:
 On Sun, Feb 12, 2012 at 7:48 AM, Albert ARIBAUD
 albert.u.b...@aribaud.net wrote:
 Hi all,

 Le 04/02/2012 11:22, Stefano Babic a écrit :

 From: Simon Schwarzsimonschwarz...@googlemail.com

 Adds prep subcommand to bootm implementation of ARM. When bootm is called
 with the subcommand prep the function stops right after ATAGS creation and
 before announce_and_cleanup.

 This is used in command cmd_spl export

 Signed-off-by: Simon Schwarzsimonschwarz...@gmail.com
 Acked-by: Stefano Babicsba...@denx.de
 Tested-by: Stefano Babicsba...@denx.de
 ---


 That one's assigned to me on patchwork, but already resides in several
 branches of the imx tree.

 Stefano, why not put it in imx master for pulling?

 What happened was that Stefano has working with me on getting the
 series into u-boot-ti (since it's just booting on OMAP*ish boards
 right now) so there's a branch or two for testing / avoiding a repost
 just to get ToT again.  I expect to include it in a pull request next
 week (need to double check the MAKEALL -s arm before/after, then do
 the same for ppc).

 Right - the patches were tested and run  on OMAP-3 platform at the
 moment. Making this code available for the other SOCs will come later.

 My branches on u-boot-imx are only for testing, for anyone who wants to
 try booting the Kernel from SPL without having to fight with the
 different version of the patchset.

 It is planned that the whole series will be pulled by Tom soon. It is
 surely right if you assign this patch to Tom on patchwork ;-).

I'll hit up patchwork tomorrow since I thought I had gotten all of the
old versions marked as superseded and assigned the latest to me.

-- 
Tom
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V13 12/12] arm: Add Prep subcommand support to bootm

2012-02-04 Thread Stefano Babic
From: Simon Schwarz simonschwarz...@googlemail.com

Adds prep subcommand to bootm implementation of ARM. When bootm is called
with the subcommand prep the function stops right after ATAGS creation and
before announce_and_cleanup.

This is used in command cmd_spl export

Signed-off-by: Simon Schwarz simonschwarz...@gmail.com
Acked-by: Stefano Babic sba...@denx.de
Tested-by: Stefano Babic sba...@denx.de
---
 arch/arm/include/asm/bootm.h |   26 
 arch/arm/lib/bootm.c |  341 ++
 2 files changed, 202 insertions(+), 165 deletions(-)
 create mode 100644 arch/arm/include/asm/bootm.h

diff --git a/arch/arm/include/asm/bootm.h b/arch/arm/include/asm/bootm.h
new file mode 100644
index 000..db2ff94
--- /dev/null
+++ b/arch/arm/include/asm/bootm.h
@@ -0,0 +1,26 @@
+/* Copyright (C) 2011
+ * Corscience GmbH  Co. KG - Simon Schwarz schw...@corscience.de
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+#ifndef ARM_BOOTM_H
+#define ARM_BOOTM_H
+
+#ifdef CONFIG_USB_DEVICE
+extern void udc_disconnect(void);
+#endif
+
+#endif
diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index afa0093..03c25e9 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -1,4 +1,8 @@
-/*
+/* Copyright (C) 2011
+ * Corscience GmbH  Co. KG - Simon Schwarz schw...@corscience.de
+ *  - Added prep subcommand support
+ *  - Reorganized source - modeled after powerpc version
+ *
  * (C) Copyright 2002
  * Sysgo Real-Time Solutions, GmbH www.elinos.com
  * Marius Groeger mgroe...@sysgo.de
@@ -29,35 +33,26 @@
 #include fdt.h
 #include libfdt.h
 #include fdt_support.h
+#include asm/bootm.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if defined (CONFIG_SETUP_MEMORY_TAGS) || \
-defined (CONFIG_CMDLINE_TAG) || \
-defined (CONFIG_INITRD_TAG) || \
-defined (CONFIG_SERIAL_TAG) || \
-defined (CONFIG_REVISION_TAG)
-static void setup_start_tag (bd_t *bd);
-
-# ifdef CONFIG_SETUP_MEMORY_TAGS
-static void setup_memory_tags (bd_t *bd);
-# endif
-static void setup_commandline_tag (bd_t *bd, char *commandline);
-
-# ifdef CONFIG_INITRD_TAG
-static void setup_initrd_tag (bd_t *bd, ulong initrd_start,
- ulong initrd_end);
-# endif
-static void setup_end_tag (bd_t *bd);
-
+#if defined(CONFIG_SETUP_MEMORY_TAGS) || \
+   defined(CONFIG_CMDLINE_TAG) || \
+   defined(CONFIG_INITRD_TAG) || \
+   defined(CONFIG_SERIAL_TAG) || \
+   defined(CONFIG_REVISION_TAG)
 static struct tag *params;
-#endif /* CONFIG_SETUP_MEMORY_TAGS || CONFIG_CMDLINE_TAG || CONFIG_INITRD_TAG 
*/
-
-static ulong get_sp(void);
-#if defined(CONFIG_OF_LIBFDT)
-static int bootm_linux_fdt(int machid, bootm_headers_t *images);
 #endif
 
+static ulong get_sp(void)
+{
+   ulong ret;
+
+   asm(mov %0, sp : =r(ret) : );
+   return ret;
+}
+
 void arch_lmb_reserve(struct lmb *lmb)
 {
ulong sp;
@@ -80,85 +75,7 @@ void arch_lmb_reserve(struct lmb *lmb)
gd-bd-bi_dram[0].start + gd-bd-bi_dram[0].size - sp);
 }
 
-static void announce_and_cleanup(void)
-{
-   printf(\nStarting kernel ...\n\n);
-
-#ifdef CONFIG_USB_DEVICE
-   {
-   extern void udc_disconnect(void);
-   udc_disconnect();
-   }
-#endif
-   cleanup_before_linux();
-}
-
-int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
-{
-   bd_t*bd = gd-bd;
-   char*s;
-   int machid = bd-bi_arch_number;
-   void(*kernel_entry)(int zero, int arch, uint params);
-
-#ifdef CONFIG_CMDLINE_TAG
-   char *commandline = getenv (bootargs);
-#endif
-
-   if ((flag != 0)  (flag != BOOTM_STATE_OS_GO))
-   return 1;
-
-   s = getenv (machid);
-   if (s) {
-   machid = simple_strtoul (s, NULL, 16);
-   printf (Using machid 0x%x from environment\n, machid);
-   }
-
-   show_boot_progress (15);
-
 #ifdef CONFIG_OF_LIBFDT
-   if (images-ft_len)
-   return bootm_linux_fdt(machid, images);
-#endif
-
-   kernel_entry = (void (*)(int, int, uint))images-ep;
-
-   debug (## Transferring control to Linux (at address %08lx) ...\n,
-  (ulong) kernel_entry);
-
-#if defined (CONFIG_SETUP_MEMORY_TAGS) || \
-defined (CONFIG_CMDLINE_TAG) || \
-defined