From: "Pali Rohár" <pali@kernel.org>
To: u-boot@lists.denx.de
Cc: Stefan Roese <sr@denx.de>, Tony Dinh <mibodhi@gmail.com>,
Josua Mayer <josua@solid-run.com>
Subject: [PATCH RFC u-boot-mvebu 21/59] cmd: mvebu/bubt: Add support for writing image to SATA disk
Date: Tue, 21 Feb 2023 21:18:47 +0100 [thread overview]
Message-ID: <20230221201925.9644-22-pali@kernel.org> (raw)
In-Reply-To: <20230221201925.9644-1-pali@kernel.org>
All 32-bit Armada SoCs and also 64-bit Armada 3720 SoC can load and boot
firmware from SATA disk. This adds support for updating firmware binary for
these SoCs. On 32-bit Armada SoC is firmware stored at sector 1 and on
Armada 3720 is stored at MBR partition 0x4d or GPT partition with type GUID
6828311A-BA55-42A4-BCDE-A89BB5EDECAE (Marvell Armada 3700 Boot partition).
Signed-off-by: Pali Rohár <pali@kernel.org>
---
cmd/mvebu/Kconfig | 12 +++++
cmd/mvebu/bubt.c | 109 ++++++++++++++++++++++++++++++++++++++++-
doc/mvebu/cmd/bubt.txt | 2 +-
3 files changed, 121 insertions(+), 2 deletions(-)
diff --git a/cmd/mvebu/Kconfig b/cmd/mvebu/Kconfig
index 9ec3aa983a51..8f30a0c22be3 100644
--- a/cmd/mvebu/Kconfig
+++ b/cmd/mvebu/Kconfig
@@ -5,6 +5,9 @@ config CMD_MVEBU_BUBT
bool "bubt"
select SHA256 if ARMADA_3700
select SHA512 if ARMADA_3700
+ select DOS_PARTITION if ARMADA_3700
+ select EFI_PARTITION if ARMADA_3700
+ select PARTITION_TYPE_GUID if ARMADA_3700
select MVEBU_EFUSE if ARMADA_38X || ARMADA_3700
help
bubt - Burn a u-boot image to flash
@@ -44,6 +47,15 @@ config MVEBU_MMC_BOOT
For details about bubt command please see the documentation
in doc/mvebu/cmd/bubt.txt
+config MVEBU_SATA_BOOT
+ bool "SATA flash boot"
+ depends on SCSI
+ help
+ Enable boot from SATA disk.
+ Allow usage of SATA disk as a target for "bubt" command
+ For details about bubt command please see the documentation
+ in doc/mvebu/cmd/bubt.txt
+
endchoice
config MVEBU_UBOOT_DFLT_NAME
diff --git a/cmd/mvebu/bubt.c b/cmd/mvebu/bubt.c
index 4bad9a69527c..1d51fde579b5 100644
--- a/cmd/mvebu/bubt.c
+++ b/cmd/mvebu/bubt.c
@@ -19,6 +19,7 @@
#include <spi_flash.h>
#include <spi.h>
#include <nand.h>
+#include <scsi.h>
#include <usb.h>
#include <fs.h>
#include <mmc.h>
@@ -333,6 +334,108 @@ static int is_mmc_active(void)
}
#endif /* CONFIG_DM_MMC */
+/********************************************************************
+ * SATA services
+ ********************************************************************/
+#if defined(CONFIG_SCSI) && defined(CONFIG_BLK)
+static int sata_burn_image(size_t image_size)
+{
+#if defined(CONFIG_ARMADA_3700) || defined(CONFIG_ARMADA_32BIT)
+ lbaint_t start_lba;
+ lbaint_t blk_count;
+ ulong blk_written;
+ struct blk_desc *blk_desc;
+#ifdef CONFIG_ARMADA_3700
+ struct disk_partition info;
+ int part;
+#endif
+
+ scsi_scan(false);
+
+ blk_desc = blk_get_devnum_by_uclass_id(UCLASS_SCSI, 0);
+ if (!blk_desc)
+ return -ENODEV;
+
+#ifdef CONFIG_ARMADA_3700
+ /*
+ * 64-bit Armada 3700 BootROM loads SATA firmware from
+ * GPT 'Marvell Armada 3700 Boot partition' or from
+ * MBR 'M' (0x4d) partition.
+ */
+ switch (blk_desc->part_type) {
+ case PART_TYPE_DOS:
+ for (part = 1; part <= 4; part++) {
+ info.sys_ind = 0;
+ if (part_get_info(blk_desc, part, &info))
+ continue;
+ if (info.sys_ind == 'M')
+ break;
+ }
+ if (part > 4) {
+ printf("Error - cannot find MBR 'M' (0x4d) partition on SATA disk\n");
+ return -ENODEV;
+ }
+ start_lba = info.start;
+ break;
+ case PART_TYPE_EFI:
+ for (part = 1; part <= 64; part++) {
+ info.type_guid[0] = 0;
+ if (part_get_info(blk_desc, part, &info))
+ continue;
+ /* Check for GPT type GUID of 'Marvell Armada 3700 Boot partition' */
+ if (strcmp(info.type_guid, "6828311A-BA55-42A4-BCDE-A89BB5EDECAE") == 0)
+ break;
+ }
+ if (part > 64) {
+ printf("Error - cannot find GPT 'Marvell Armada 3700 Boot partition' on SATA disk\n");
+ return -ENODEV;
+ }
+ start_lba = info.start;
+ break;
+ default:
+ printf("Error - no partitions on SATA disk\n");
+ return -ENODEV;
+ }
+#else
+ /* 32-bit Armada BootROM loads SATA firmware from the sector 1. */
+ start_lba = 1;
+#endif
+
+ blk_count = image_size / blk_desc->blksz;
+ if (image_size % blk_desc->blksz)
+ blk_count += 1;
+
+ blk_written = blk_dwrite(blk_desc, start_lba, blk_count,
+ (void *)get_load_addr());
+
+ if (blk_written != blk_count) {
+ printf("Error - written %#lx blocks\n", blk_written);
+ return -ENOSPC;
+ }
+
+ printf("Done!\n");
+ return 0;
+#else
+ return -ENODEV;
+#endif
+}
+
+static int is_sata_active(void)
+{
+ return 1;
+}
+#else /* CONFIG_SCSI */
+static int sata_burn_image(size_t image_size)
+{
+ return -ENODEV;
+}
+
+static int is_sata_active(void)
+{
+ return 0;
+}
+#endif /* CONFIG_SCSI */
+
/********************************************************************
* SPI services
********************************************************************/
@@ -542,6 +645,7 @@ enum bubt_devices {
BUBT_DEV_NET = 0,
BUBT_DEV_USB,
BUBT_DEV_MMC,
+ BUBT_DEV_SATA,
BUBT_DEV_SPI,
BUBT_DEV_NAND,
@@ -552,6 +656,7 @@ struct bubt_dev bubt_devs[BUBT_MAX_DEV] = {
{"tftp", tftp_read_file, NULL, is_tftp_active},
{"usb", usb_read_file, NULL, is_usb_active},
{"mmc", mmc_read_file, mmc_burn_image, is_mmc_active},
+ {"sata", NULL, sata_burn_image, is_sata_active},
{"spi", NULL, spi_burn_image, is_spi_active},
{"nand", NULL, nand_burn_image, is_nand_active},
};
@@ -1021,6 +1126,8 @@ struct bubt_dev *find_bubt_dev(char *dev_name)
#define DEFAULT_BUBT_DST "nand"
#elif defined(CONFIG_MVEBU_MMC_BOOT)
#define DEFAULT_BUBT_DST "mmc"
+#elif defined(CONFIG_MVEBU_SATA_BOOT)
+#define DEFAULT_BUBT_DST "sata"
#else
#define DEFAULT_BUBT_DST "error"
#endif
@@ -1098,7 +1205,7 @@ U_BOOT_CMD(
"Burn a u-boot image to flash",
"[file-name] [destination [source]]\n"
"\t-file-name The image file name to burn. Default = " CONFIG_MVEBU_UBOOT_DFLT_NAME "\n"
- "\t-destination Flash to burn to [spi, nand, mmc]. Default = " DEFAULT_BUBT_DST "\n"
+ "\t-destination Flash to burn to [spi, nand, mmc, sata]. Default = " DEFAULT_BUBT_DST "\n"
"\t-source The source to load image from [tftp, usb, mmc]. Default = " DEFAULT_BUBT_SRC "\n"
"Examples:\n"
"\tbubt - Burn flash-image.bin from tftp to active boot device\n"
diff --git a/doc/mvebu/cmd/bubt.txt b/doc/mvebu/cmd/bubt.txt
index 1fe1f07dd187..515e4fb1b0e8 100644
--- a/doc/mvebu/cmd/bubt.txt
+++ b/doc/mvebu/cmd/bubt.txt
@@ -5,7 +5,7 @@ Bubt command is used to burn a new ATF image to flash device.
The bubt command gets the following parameters: ATF file name, destination device and source device.
bubt [file-name] [destination [source]]
- file-name Image file name to burn. default = flash-image.bin
- - destination Flash to burn to [spi, nand, mmc]. default = active flash
+ - destination Flash to burn to [spi, nand, mmc, sata]. default = active flash
- source Source to load image from [tftp, usb]. default = tftp
Examples:
--
2.20.1
next prev parent reply other threads:[~2023-02-21 22:48 UTC|newest]
Thread overview: 143+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-21 20:18 [PATCH RFC u-boot-mvebu 00/59] arm: mvebu: Various fixes Pali Rohár
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 01/59] tools: kwbimage: Fix generating, verifying and extracting SDIO kwbimage Pali Rohár
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 02/59] tools: kwboot: Fix parsing " Pali Rohár
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 03/59] arm: mvebu: spl: " Pali Rohár
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 04/59] cmd: mvebu/bubt: " Pali Rohár
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 05/59] tools: kwbimage: Fix generating, verifying and extracting SATA kwbimage Pali Rohár
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 06/59] tools: kwboot: Fix parsing " Pali Rohár
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 07/59] arm: mvebu: spl: " Pali Rohár
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 08/59] cmd: mvebu/bubt: " Pali Rohár
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 09/59] arm: mvebu: spl: Remove checks for BOOT_DEVICE_MMC2 and BOOT_DEVICE_MMC2_2 Pali Rohár
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 10/59] arm: mvebu: spl: Load proper U-Boot from selected eMMC boot partition Pali Rohár
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 11/59] spl: mmc: Allow to disable SYS_MMCSD_FS_BOOT_PARTITION Pali Rohár
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 12/59] arm: mvebu: spl: Fix support for loading U-Boot proper from SD card Pali Rohár
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 13/59] tools: kwboot: Add more documentation references Pali Rohár
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 14/59] tools: kwboot: Add image type documentation Pali Rohár
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 15/59] tools: kwboot: Fix parsing UART image without data checksum Pali Rohár
2023-02-23 5:23 ` Tony Dinh
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 16/59] tools: kwboot: Validate optional kwbimage v1 headers Pali Rohár
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 17/59] tools: kwboot: Add check that kwbimage contains DDR init code Pali Rohár
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 18/59] tools: kwboot: Fix patching of SPI/NOR XIP images Pali Rohár
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 19/59] tools: kwboot: Show image type and error parsing reasons Pali Rohár
2023-02-22 5:51 ` Tony Dinh
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 20/59] cmd: mvebu/bubt: Add support for selecting eMMC HW partition Pali Rohár
2023-02-22 9:55 ` Stefan Roese
2023-02-22 18:06 ` Pali Rohár
2023-02-23 6:17 ` Stefan Roese
2023-02-23 7:55 ` Pali Rohár
2023-02-23 8:15 ` Stefan Roese
2023-02-21 20:18 ` Pali Rohár [this message]
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 22/59] cmd: mvebu/bubt: Add support for reading image from the SATA disk partition Pali Rohár
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 23/59] cmd: mvebu/bubt: Rename variable image_size to hdr_size Pali Rohár
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 24/59] cmd: mvebu/bubt: Mark all local symbols as static Pali Rohár
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 25/59] cmd: mvebu/bubt: Do not modify image in A8K check_image_header() Pali Rohár
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 26/59] cmd: mvebu/bubt: Check also A8K boot image checksum Pali Rohár
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 27/59] cmd: mvebu/bubt: Set correct default image name for 32-bit Armada SoCs Pali Rohár
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 28/59] cmd: mvebu/bubt: Better guess default MVEBU_*_BOOT option Pali Rohár
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 29/59] cmd: mvebu/bubt: Fix warnings: unused variable 'secure_mode' and 'fuse_read_u64' defined but not used Pali Rohár
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 30/59] cmd: mvebu/bubt: Enable command by default Pali Rohár
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 31/59] tools: kwbimage: Fix dumping register set / DATA commands Pali Rohár
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 32/59] tools: kwbimage: Fix endianity when dumping NAND_PAGE_SIZE Pali Rohár
2023-02-21 20:18 ` [PATCH RFC u-boot-mvebu 33/59] tools: kwbimage: Fix dumping NAND_BADBLK_LOCATION Pali Rohár
2023-02-21 20:19 ` [PATCH RFC u-boot-mvebu 34/59] tools: kwbimage: Fix dumping NAND_BLKSZ Pali Rohár
2023-02-21 20:19 ` [PATCH RFC u-boot-mvebu 35/59] tools: kwbimage: Fix generating of kwbimage v0 header checksum Pali Rohár
2023-02-21 20:19 ` [PATCH RFC u-boot-mvebu 36/59] tools: kwbimage: Fix endianity when printing kwbimage header Pali Rohár
2023-02-21 20:19 ` [PATCH RFC u-boot-mvebu 37/59] tools: kwbimage: Reject mkimage -F option Pali Rohár
2023-02-21 20:19 ` [PATCH RFC u-boot-mvebu 38/59] tools: kwbimage: Add support for dumping NAND_BLKSZ for v0 images Pali Rohár
2023-02-21 20:19 ` [PATCH RFC u-boot-mvebu 39/59] tools: kwbimage: Print binary image offset as size Pali Rohár
2023-02-21 20:19 ` [PATCH RFC u-boot-mvebu 40/59] tools: kwbimage: Print image data offset when printing kwbimage header Pali Rohár
2023-02-21 20:19 ` [PATCH RFC u-boot-mvebu 41/59] tools: kwbimage: Simplify add_secure_header_v1() Pali Rohár
2023-02-21 20:19 ` [PATCH RFC u-boot-mvebu 42/59] tools: kwbimage: Rename imagesz to dataoff Pali Rohár
2023-02-21 20:19 ` [PATCH RFC u-boot-mvebu 43/59] tools: kwbimage: Fix generating secure boot data image signature Pali Rohár
2023-02-21 20:19 ` [PATCH RFC u-boot-mvebu 44/59] tools: kwbimage: Fix invalid secure boot header signature Pali Rohár
2023-02-21 20:19 ` [PATCH RFC u-boot-mvebu 45/59] tools: mkimage: Do not fill legacy_img_hdr for non-legacy XIP images Pali Rohár
2023-02-21 20:19 ` [PATCH RFC u-boot-mvebu 46/59] tools: kwbimage: Add support for XIP SPI/NOR images Pali Rohár
2023-02-21 20:19 ` [PATCH RFC u-boot-mvebu 47/59] tools: mkimage: Print human readable error when -d is not specified Pali Rohár
2023-02-21 20:19 ` [PATCH RFC u-boot-mvebu 48/59] tools: mkimage: Do not try to open datafile when it is skipped Pali Rohár
2023-02-21 20:19 ` [PATCH RFC u-boot-mvebu 49/59] tools: kwbimage: Add support for creating an image with no data Pali Rohár
2023-02-21 20:19 ` [PATCH RFC u-boot-mvebu 50/59] arm: mvebu: Add support for generating NAND kwbimage Pali Rohár
2023-02-21 20:19 ` [PATCH RFC u-boot-mvebu 51/59] arm: mvebu: Add support for generating PEX kwbimage Pali Rohár
2023-02-21 20:19 ` [PATCH RFC u-boot-mvebu 52/59] arm: mvebu: Fix description of MVEBU_SPL_BOOT_DEVICE_(SPI|MMC) options Pali Rohár
2023-02-21 20:19 ` [PATCH RFC u-boot-mvebu 53/59] arm: mvebu: db-88f6820-amc: Add defconfig for NAND booting Pali Rohár
2023-02-21 20:19 ` [PATCH RFC u-boot-mvebu 54/59] arm: mvebu: clearfog: Add defconfig for SATA booting Pali Rohár
2023-02-21 20:19 ` [PATCH RFC u-boot-mvebu 55/59] arm: mvebu: Remove A39x relicts Pali Rohár
2023-02-21 20:19 ` [PATCH RFC u-boot-mvebu 56/59] arm: mvebu: Fix comment about CPU_ATTR_BOOTROM mapping Pali Rohár
2023-02-21 20:19 ` [PATCH RFC u-boot-mvebu 57/59] arm: mvebu: Define env_sf_get_env_addr() also for Proper U-Boot Pali Rohár
2023-02-25 3:58 ` Tony Dinh
2023-02-25 21:13 ` Pali Rohár
2023-02-25 22:37 ` Tony Dinh
2023-02-21 20:19 ` [PATCH RFC u-boot-mvebu 58/59] arm: mvebu: Define SPL memory maps Pali Rohár
2023-02-21 20:19 ` [PATCH RFC u-boot-mvebu 59/59] doc/kwboot.1: Update example description Pali Rohár
2023-02-21 23:06 ` [PATCH RFC u-boot-mvebu 00/59] arm: mvebu: Various fixes Tony Dinh
2023-02-21 23:14 ` Pali Rohár
2023-02-22 5:45 ` Tony Dinh
2023-02-22 7:58 ` Pali Rohár
2023-02-22 11:59 ` Martin Rowe
2023-02-22 18:03 ` Pali Rohár
2023-02-22 21:20 ` Martin Rowe
2023-02-22 21:23 ` Pali Rohár
2023-02-23 12:11 ` Martin Rowe
2023-02-23 18:02 ` Pali Rohár
2023-02-24 6:27 ` Martin Rowe
2023-02-24 15:07 ` Martin Rowe
2023-02-24 22:34 ` Pali Rohár
2023-02-25 1:18 ` Martin Rowe
2023-02-25 21:16 ` Pali Rohár
2023-02-26 1:56 ` Martin Rowe
2023-02-26 8:14 ` Pali Rohár
2023-03-08 20:36 ` kwbimage config file documentation (Was: Re: [PATCH RFC u-boot-mvebu 00/59] arm: mvebu: Various fixes) Pali Rohár
2023-02-24 22:33 ` [PATCH RFC u-boot-mvebu 00/59] arm: mvebu: Various fixes Pali Rohár
2023-02-24 15:07 ` Martin Rowe
2023-02-24 15:22 ` Stefan Roese
2023-02-24 15:41 ` Martin Rowe
2023-02-23 7:56 ` Pali Rohár
2023-02-22 22:16 ` Tony Dinh
2023-02-22 23:06 ` Pali Rohár
2023-02-22 23:16 ` Tony Dinh
2023-02-22 23:39 ` Pali Rohár
2023-02-23 0:17 ` Tony Dinh
2023-02-23 7:46 ` Pali Rohár
2023-02-25 1:42 ` [PATCH 0/2] arm: mvebu: clearfog: defconfig updates Martin Rowe
2023-02-25 1:42 ` [PATCH 1/2] arm: mvebu: clearfog: Fix MMC detection Martin Rowe
2023-02-25 21:49 ` Pali Rohár
2023-02-25 22:14 ` Pali Rohár
2023-02-26 1:45 ` Martin Rowe
2023-02-26 11:18 ` Pali Rohár
2023-02-26 11:28 ` Martin Rowe
2023-02-25 1:42 ` [PATCH 2/2] arm: mvebu: clearfog: Add defconfig for SPI booting Martin Rowe
2023-02-25 7:41 ` Pali Rohár
2023-02-25 9:48 ` Martin Rowe
2023-02-25 10:51 ` Josua Mayer
2023-02-25 11:47 ` Martin Rowe
2023-02-25 13:41 ` Pali Rohár
2023-02-25 22:46 ` Tony Dinh
2023-02-26 2:17 ` Martin Rowe
2023-02-26 4:56 ` Tony Dinh
2023-02-26 10:52 ` Pali Rohár
2023-02-27 0:11 ` Tony Dinh
2023-02-27 7:40 ` Stefan Roese
2023-02-27 21:57 ` Tony Dinh
2023-02-27 23:41 ` Tony Dinh
2023-02-28 0:42 ` Tony Dinh
2023-02-28 1:17 ` Tony Dinh
2023-02-28 9:48 ` Pali Rohár
2023-02-28 18:51 ` Pali Rohár
2023-02-28 21:51 ` Tony Dinh
2023-02-28 22:19 ` Pali Rohár
2023-03-01 1:32 ` Tony Dinh
2023-03-03 1:28 ` Tony Dinh
2023-02-25 21:55 ` Pali Rohár
2023-02-25 22:00 ` [PATCH RFC u-boot-mvebu 00/59] arm: mvebu: Various fixes Pali Rohár
2023-02-27 7:44 ` Stefan Roese
2023-02-27 8:04 ` Pali Rohár
2023-02-27 11:29 ` Martin Rowe
2023-02-28 7:03 ` Stefan Roese
2023-02-28 9:16 ` Stefan Roese
2023-02-28 9:54 ` Pali Rohár
2023-02-28 10:01 ` Stefan Roese
2023-02-28 10:10 ` Pali Rohár
2023-02-28 10:16 ` Stefan Roese
2023-02-28 22:41 ` Pali Rohár
2023-03-01 6:01 ` Stefan Roese
2023-02-28 10:22 ` Pali Rohár
2023-03-01 15:48 ` Stefan Roese
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=20230221201925.9644-22-pali@kernel.org \
--to=pali@kernel.org \
--cc=josua@solid-run.com \
--cc=mibodhi@gmail.com \
--cc=sr@denx.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox