public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [patch v3 1/2] pxe: Fix pxe boot with FIT image
@ 2016-09-01  8:28 Wenbin song
  2016-09-01  8:28 ` [U-Boot] [patch v3 2/2] pxe: Modify README to add the description about " Wenbin song
  2016-09-07 17:59 ` [U-Boot] [U-Boot,v3,1/2] pxe: Fix pxe boot with " Tom Rini
  0 siblings, 2 replies; 4+ messages in thread
From: Wenbin song @ 2016-09-01  8:28 UTC (permalink / raw)
  To: u-boot

From: York Sun <york.sun@nxp.com>

When FIT image is used, a single image provides kernel, device
tree and optionally ramdisk. Argc and argv need to be adjusted
to support this.

Test cases:
	1. Booting with legacy images
	2. Booting with legacy images without initrd
	3. Booting with FIT image
Test commands:
	1. pxe get && pxe boot
	2. sysboot

Signed-off-by: York Sun <york.sun@nxp.com>
Signed-off-by: Wenbin Song <wenbin.song@nxp.com>
---
Changes for v2: no change
---
 cmd/pxe.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/cmd/pxe.c b/cmd/pxe.c
index 9434a18..0a07f14 100644
--- a/cmd/pxe.c
+++ b/cmd/pxe.c
@@ -620,7 +620,7 @@ static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label)
 	char initrd_str[22];
 	char mac_str[29] = "";
 	char ip_str[68] = "";
-	int bootm_argc = 3;
+	int bootm_argc = 2;
 	int len = 0;
 	ulong kernel_addr;
 	void *buf;
@@ -652,8 +652,6 @@ static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label)
 		strcpy(bootm_argv[2], getenv("ramdisk_addr_r"));
 		strcat(bootm_argv[2], ":");
 		strcat(bootm_argv[2], getenv("filesize"));
-	} else {
-		bootm_argv[2] = "-";
 	}
 
 	if (get_relfile_envaddr(cmdtp, label->kernel, "kernel_addr_r") < 0) {
@@ -785,8 +783,11 @@ static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label)
 	if (!bootm_argv[3])
 		bootm_argv[3] = getenv("fdt_addr");
 
-	if (bootm_argv[3])
+	if (bootm_argv[3]) {
+		if (!bootm_argv[2])
+			bootm_argv[2] = "-";
 		bootm_argc = 4;
+	}
 
 	kernel_addr = genimg_get_kernel_addr(bootm_argv[1]);
 	buf = map_sysmem(kernel_addr, 0);
-- 
2.1.0.27.g96db324

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [patch v3 2/2] pxe: Modify README to add the description about FIT image
  2016-09-01  8:28 [U-Boot] [patch v3 1/2] pxe: Fix pxe boot with FIT image Wenbin song
@ 2016-09-01  8:28 ` Wenbin song
  2016-09-07 17:59   ` [U-Boot] [U-Boot, v3, " Tom Rini
  2016-09-07 17:59 ` [U-Boot] [U-Boot,v3,1/2] pxe: Fix pxe boot with " Tom Rini
  1 sibling, 1 reply; 4+ messages in thread
From: Wenbin song @ 2016-09-01  8:28 UTC (permalink / raw)
  To: u-boot

Use environment variable "kernel_addr_r" to indicate the location
in RAM where FIT image will be stored.
Use label command "kernel" to indicate which <path> the FIT image at.

Signed-off-by: Wenbin Song <wenbin.song@nxp.com>
---
Changes for v2: Fixup the email address of author.
---
 doc/README.pxe | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/doc/README.pxe b/doc/README.pxe
index cc182c9..db11658 100644
--- a/doc/README.pxe
+++ b/doc/README.pxe
@@ -78,9 +78,9 @@ pxe boot
      address of the tftp server from which other files will be retrieved.
 
      kernel_addr_r, initrd_addr_r - locations in RAM at which 'pxe boot' will
-     store the kernel and initrd it retrieves from tftp. These locations will
-     be passed to the bootm command to boot the kernel. These environment
-     variables are required to be set.
+     store the kernel(or FIT image) and initrd it retrieves from tftp. These
+     locations will be passed to the bootm command to boot the kernel. These
+     environment variables are required to be set.
 
      fdt_addr_r - location in RAM at which 'pxe boot' will store the fdt blob it
      retrieves from tftp. The retrieval is possible if 'fdt' label is defined in
@@ -138,9 +138,9 @@ menu default	    - set this label as the default label to boot; this is
 		      specified in a different way
 
 kernel <path>	    - if this label is chosen, use tftp to retrieve the kernel
-		      at <path>. it will be stored at the address indicated in
-		      the kernel_addr_r environment variable, and that address
-		      will be passed to bootm to boot this kernel.
+		      (or FIT image) at <path>. it will be stored at the address
+		      indicated in the kernel_addr_r environment variable, and
+		      that address will be passed to bootm to boot this kernel.
 
 append <string>	    - use <string> as the kernel command line when booting this
 		      label.
-- 
2.1.0.27.g96db324

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [U-Boot,v3,1/2] pxe: Fix pxe boot with FIT image
  2016-09-01  8:28 [U-Boot] [patch v3 1/2] pxe: Fix pxe boot with FIT image Wenbin song
  2016-09-01  8:28 ` [U-Boot] [patch v3 2/2] pxe: Modify README to add the description about " Wenbin song
@ 2016-09-07 17:59 ` Tom Rini
  1 sibling, 0 replies; 4+ messages in thread
From: Tom Rini @ 2016-09-07 17:59 UTC (permalink / raw)
  To: u-boot

On Thu, Sep 01, 2016 at 04:28:21PM +0800, Wenbin Song wrote:

> From: York Sun <york.sun@nxp.com>
> 
> When FIT image is used, a single image provides kernel, device
> tree and optionally ramdisk. Argc and argv need to be adjusted
> to support this.
> 
> Test cases:
> 	1. Booting with legacy images
> 	2. Booting with legacy images without initrd
> 	3. Booting with FIT image
> Test commands:
> 	1. pxe get && pxe boot
> 	2. sysboot
> 
> Signed-off-by: York Sun <york.sun@nxp.com>
> Signed-off-by: Wenbin Song <wenbin.song@nxp.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160907/250f1001/attachment.sig>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [U-Boot, v3, 2/2] pxe: Modify README to add the description about FIT image
  2016-09-01  8:28 ` [U-Boot] [patch v3 2/2] pxe: Modify README to add the description about " Wenbin song
@ 2016-09-07 17:59   ` Tom Rini
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2016-09-07 17:59 UTC (permalink / raw)
  To: u-boot

On Thu, Sep 01, 2016 at 04:28:22PM +0800, Wenbin Song wrote:

> Use environment variable "kernel_addr_r" to indicate the location
> in RAM where FIT image will be stored.
> Use label command "kernel" to indicate which <path> the FIT image at.
> 
> Signed-off-by: Wenbin Song <wenbin.song@nxp.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160907/0d2b6128/attachment.sig>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-09-07 17:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-01  8:28 [U-Boot] [patch v3 1/2] pxe: Fix pxe boot with FIT image Wenbin song
2016-09-01  8:28 ` [U-Boot] [patch v3 2/2] pxe: Modify README to add the description about " Wenbin song
2016-09-07 17:59   ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-09-07 17:59 ` [U-Boot] [U-Boot,v3,1/2] pxe: Fix pxe boot with " Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox