All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] xilinx: Align dfu ram with booti command
@ 2020-07-15 13:51 Michal Simek
  2020-07-15 13:51 ` [PATCH 2/2] xilinx: zynqmp: Enable DFU tftp support Michal Simek
  2020-07-24 12:18 ` [PATCH 1/2] xilinx: Align dfu ram with booti command Michal Simek
  0 siblings, 2 replies; 4+ messages in thread
From: Michal Simek @ 2020-07-15 13:51 UTC (permalink / raw)
  To: u-boot

Image should be loaded to 0x80000 address and not to $kernel_addr_r.
Also kernel_addr, fdt_addr and fdt_size in zynqmp case are not defined
that's why define it to be aligned with Versal.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 include/configs/xilinx_versal.h | 2 +-
 include/configs/xilinx_zynqmp.h | 6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/include/configs/xilinx_versal.h b/include/configs/xilinx_versal.h
index 804525dcad26..32cd5b21f7b7 100644
--- a/include/configs/xilinx_versal.h
+++ b/include/configs/xilinx_versal.h
@@ -54,7 +54,7 @@
 #define DFU_ALT_INFO_RAM \
 	"dfu_ram_info=" \
 	"setenv dfu_alt_info " \
-	"Image ram $kernel_addr_r $kernel_size_r\\\\;" \
+	"Image ram 80000 $kernel_size_r\\\\;" \
 	"system.dtb ram $fdt_addr_r $fdt_size_r\0" \
 	"dfu_ram=run dfu_ram_info && dfu 0 ram 0\0" \
 	"thor_ram=run dfu_ram_info && thordown 0 ram 0\0"
diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h
index e7cfebee7c46..86f292761b38 100644
--- a/include/configs/xilinx_zynqmp.h
+++ b/include/configs/xilinx_zynqmp.h
@@ -58,8 +58,8 @@
 #define DFU_ALT_INFO_RAM \
 	"dfu_ram_info=" \
 	"setenv dfu_alt_info " \
-	"Image ram $kernel_addr $kernel_size\\\\;" \
-	"system.dtb ram $fdt_addr $fdt_size\0" \
+	"Image ram 80000 $kernel_size_r\\\\;" \
+	"system.dtb ram $fdt_addr_r $fdt_size_r\0" \
 	"dfu_ram=run dfu_ram_info && dfu 0 ram 0\0" \
 	"thor_ram=run dfu_ram_info && thordown 0 ram 0\0"
 
@@ -101,8 +101,10 @@
 #define ENV_MEM_LAYOUT_SETTINGS \
 	"fdt_high=10000000\0" \
 	"fdt_addr_r=0x40000000\0" \
+	"fdt_size_r=0x400000\0" \
 	"pxefile_addr_r=0x10000000\0" \
 	"kernel_addr_r=0x18000000\0" \
+	"kernel_size_r=0x10000000\0" \
 	"scriptaddr=0x20000000\0" \
 	"ramdisk_addr_r=0x02100000\0" \
 	"script_size_f=0x80000\0" \
-- 
2.27.0

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

* [PATCH 2/2] xilinx: zynqmp: Enable DFU tftp support
  2020-07-15 13:51 [PATCH 1/2] xilinx: Align dfu ram with booti command Michal Simek
@ 2020-07-15 13:51 ` Michal Simek
  2020-07-24 12:18   ` Michal Simek
  2020-07-24 12:18 ` [PATCH 1/2] xilinx: Align dfu ram with booti command Michal Simek
  1 sibling, 1 reply; 4+ messages in thread
From: Michal Simek @ 2020-07-15 13:51 UTC (permalink / raw)
  To: u-boot

Enable DFU tftp support for firmware update. Fill dfu_ram_tftp variable to
have command present for showing how to use it.

boot FIT image has been created from below fragment. Key part is that type
of image has to be firmware. Also based on experiment load property is
completely ignored and base addresses are taken from dfu_alt_info variable.

$ cat update_uboot.its
/dts-v1/;

/ {
	description = "Automatic U-Boot update";
	#address-cells = <1>;

	images {
		Image {
			description = "Kernel";
			data = /incbin/("/tftpboot/Image");
			compression = "none";
			arch = "arm64";
			type = "firmware";
			os = "linux";
			load = <0x80000>;
			entry = <0x80000>;
			hash-1 {
				algo = "sha1";
			};
		};
		system.dtb {
			description = "DTB";
			data = /incbin/("/tftpboot/system.dtb");
			compression = "none";
			arch = "arm64";
			type = "firmware";
			load = <0>;
			hash-1 {
				algo = "sha1";
			};
		};
	};
};

$ mkimage -f update_uboot.its /tftpboot/boot

When U-Boot starts get IP address and server IP.
dhcp
setenv serverip 192.168.0.105

And then run prepared command.
run dfu_ram_tftp

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 configs/xilinx_zynqmp_virt_defconfig | 1 +
 include/configs/xilinx_zynqmp.h      | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/configs/xilinx_zynqmp_virt_defconfig b/configs/xilinx_zynqmp_virt_defconfig
index d77ba051624e..2d84f0c04e12 100644
--- a/configs/xilinx_zynqmp_virt_defconfig
+++ b/configs/xilinx_zynqmp_virt_defconfig
@@ -69,6 +69,7 @@ CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_SCSI_AHCI=y
 CONFIG_SATA_CEVA=y
 CONFIG_CLK_ZYNQMP=y
+CONFIG_DFU_TFTP=y
 CONFIG_DFU_RAM=y
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_FLASH=y
diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h
index 86f292761b38..f45a1a2272d3 100644
--- a/include/configs/xilinx_zynqmp.h
+++ b/include/configs/xilinx_zynqmp.h
@@ -61,7 +61,9 @@
 	"Image ram 80000 $kernel_size_r\\\\;" \
 	"system.dtb ram $fdt_addr_r $fdt_size_r\0" \
 	"dfu_ram=run dfu_ram_info && dfu 0 ram 0\0" \
-	"thor_ram=run dfu_ram_info && thordown 0 ram 0\0"
+	"thor_ram=run dfu_ram_info && thordown 0 ram 0\0" \
+	"dfu_ram_tftp=run dfu_ram_info && setenv updatefile boot && " \
+	"setenv loadaddr 10000000 && dfu tftp ram 0\0"
 
 #define DFU_ALT_INFO  \
 		DFU_ALT_INFO_RAM
-- 
2.27.0

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

* [PATCH 1/2] xilinx: Align dfu ram with booti command
  2020-07-15 13:51 [PATCH 1/2] xilinx: Align dfu ram with booti command Michal Simek
  2020-07-15 13:51 ` [PATCH 2/2] xilinx: zynqmp: Enable DFU tftp support Michal Simek
@ 2020-07-24 12:18 ` Michal Simek
  1 sibling, 0 replies; 4+ messages in thread
From: Michal Simek @ 2020-07-24 12:18 UTC (permalink / raw)
  To: u-boot

st 15. 7. 2020 v 15:51 odes?latel Michal Simek <michal.simek@xilinx.com> napsal:
>
> Image should be loaded to 0x80000 address and not to $kernel_addr_r.
> Also kernel_addr, fdt_addr and fdt_size in zynqmp case are not defined
> that's why define it to be aligned with Versal.
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
>  include/configs/xilinx_versal.h | 2 +-
>  include/configs/xilinx_zynqmp.h | 6 ++++--
>  2 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/include/configs/xilinx_versal.h b/include/configs/xilinx_versal.h
> index 804525dcad26..32cd5b21f7b7 100644
> --- a/include/configs/xilinx_versal.h
> +++ b/include/configs/xilinx_versal.h
> @@ -54,7 +54,7 @@
>  #define DFU_ALT_INFO_RAM \
>         "dfu_ram_info=" \
>         "setenv dfu_alt_info " \
> -       "Image ram $kernel_addr_r $kernel_size_r\\\\;" \
> +       "Image ram 80000 $kernel_size_r\\\\;" \
>         "system.dtb ram $fdt_addr_r $fdt_size_r\0" \
>         "dfu_ram=run dfu_ram_info && dfu 0 ram 0\0" \
>         "thor_ram=run dfu_ram_info && thordown 0 ram 0\0"
> diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h
> index e7cfebee7c46..86f292761b38 100644
> --- a/include/configs/xilinx_zynqmp.h
> +++ b/include/configs/xilinx_zynqmp.h
> @@ -58,8 +58,8 @@
>  #define DFU_ALT_INFO_RAM \
>         "dfu_ram_info=" \
>         "setenv dfu_alt_info " \
> -       "Image ram $kernel_addr $kernel_size\\\\;" \
> -       "system.dtb ram $fdt_addr $fdt_size\0" \
> +       "Image ram 80000 $kernel_size_r\\\\;" \
> +       "system.dtb ram $fdt_addr_r $fdt_size_r\0" \
>         "dfu_ram=run dfu_ram_info && dfu 0 ram 0\0" \
>         "thor_ram=run dfu_ram_info && thordown 0 ram 0\0"
>
> @@ -101,8 +101,10 @@
>  #define ENV_MEM_LAYOUT_SETTINGS \
>         "fdt_high=10000000\0" \
>         "fdt_addr_r=0x40000000\0" \
> +       "fdt_size_r=0x400000\0" \
>         "pxefile_addr_r=0x10000000\0" \
>         "kernel_addr_r=0x18000000\0" \
> +       "kernel_size_r=0x10000000\0" \
>         "scriptaddr=0x20000000\0" \
>         "ramdisk_addr_r=0x02100000\0" \
>         "script_size_f=0x80000\0" \
> --
> 2.27.0
>

Applied.
M

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs

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

* [PATCH 2/2] xilinx: zynqmp: Enable DFU tftp support
  2020-07-15 13:51 ` [PATCH 2/2] xilinx: zynqmp: Enable DFU tftp support Michal Simek
@ 2020-07-24 12:18   ` Michal Simek
  0 siblings, 0 replies; 4+ messages in thread
From: Michal Simek @ 2020-07-24 12:18 UTC (permalink / raw)
  To: u-boot

st 15. 7. 2020 v 15:51 odes?latel Michal Simek <michal.simek@xilinx.com> napsal:
>
> Enable DFU tftp support for firmware update. Fill dfu_ram_tftp variable to
> have command present for showing how to use it.
>
> boot FIT image has been created from below fragment. Key part is that type
> of image has to be firmware. Also based on experiment load property is
> completely ignored and base addresses are taken from dfu_alt_info variable.
>
> $ cat update_uboot.its
> /dts-v1/;
>
> / {
>         description = "Automatic U-Boot update";
>         #address-cells = <1>;
>
>         images {
>                 Image {
>                         description = "Kernel";
>                         data = /incbin/("/tftpboot/Image");
>                         compression = "none";
>                         arch = "arm64";
>                         type = "firmware";
>                         os = "linux";
>                         load = <0x80000>;
>                         entry = <0x80000>;
>                         hash-1 {
>                                 algo = "sha1";
>                         };
>                 };
>                 system.dtb {
>                         description = "DTB";
>                         data = /incbin/("/tftpboot/system.dtb");
>                         compression = "none";
>                         arch = "arm64";
>                         type = "firmware";
>                         load = <0>;
>                         hash-1 {
>                                 algo = "sha1";
>                         };
>                 };
>         };
> };
>
> $ mkimage -f update_uboot.its /tftpboot/boot
>
> When U-Boot starts get IP address and server IP.
> dhcp
> setenv serverip 192.168.0.105
>
> And then run prepared command.
> run dfu_ram_tftp
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
>  configs/xilinx_zynqmp_virt_defconfig | 1 +
>  include/configs/xilinx_zynqmp.h      | 4 +++-
>  2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/configs/xilinx_zynqmp_virt_defconfig b/configs/xilinx_zynqmp_virt_defconfig
> index d77ba051624e..2d84f0c04e12 100644
> --- a/configs/xilinx_zynqmp_virt_defconfig
> +++ b/configs/xilinx_zynqmp_virt_defconfig
> @@ -69,6 +69,7 @@ CONFIG_SPL_DM_SEQ_ALIAS=y
>  CONFIG_SCSI_AHCI=y
>  CONFIG_SATA_CEVA=y
>  CONFIG_CLK_ZYNQMP=y
> +CONFIG_DFU_TFTP=y
>  CONFIG_DFU_RAM=y
>  CONFIG_USB_FUNCTION_FASTBOOT=y
>  CONFIG_FASTBOOT_FLASH=y
> diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h
> index 86f292761b38..f45a1a2272d3 100644
> --- a/include/configs/xilinx_zynqmp.h
> +++ b/include/configs/xilinx_zynqmp.h
> @@ -61,7 +61,9 @@
>         "Image ram 80000 $kernel_size_r\\\\;" \
>         "system.dtb ram $fdt_addr_r $fdt_size_r\0" \
>         "dfu_ram=run dfu_ram_info && dfu 0 ram 0\0" \
> -       "thor_ram=run dfu_ram_info && thordown 0 ram 0\0"
> +       "thor_ram=run dfu_ram_info && thordown 0 ram 0\0" \
> +       "dfu_ram_tftp=run dfu_ram_info && setenv updatefile boot && " \
> +       "setenv loadaddr 10000000 && dfu tftp ram 0\0"
>
>  #define DFU_ALT_INFO  \
>                 DFU_ALT_INFO_RAM
> --
> 2.27.0
>

Applied.
M

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs

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

end of thread, other threads:[~2020-07-24 12:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-15 13:51 [PATCH 1/2] xilinx: Align dfu ram with booti command Michal Simek
2020-07-15 13:51 ` [PATCH 2/2] xilinx: zynqmp: Enable DFU tftp support Michal Simek
2020-07-24 12:18   ` Michal Simek
2020-07-24 12:18 ` [PATCH 1/2] xilinx: Align dfu ram with booti command Michal Simek

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.