{"id":1745909,"url":"http://patchwork.ozlabs.org/api/patches/1745909/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20230221201925.9644-15-pali@kernel.org/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20230221201925.9644-15-pali@kernel.org>","list_archive_url":null,"date":"2023-02-21T20:18:40","name":"[RFC,u-boot-mvebu,14/59] tools: kwboot: Add image type documentation","commit_ref":"fa03279e198d220d05898e2d35a139fd599b4acf","pull_url":null,"state":"accepted","archived":false,"hash":"c2329e913f30eda67f6de21d628b541a86ee1693","submitter":{"id":78810,"url":"http://patchwork.ozlabs.org/api/people/78810/?format=json","name":"Pali Rohár","email":"pali@kernel.org"},"delegate":{"id":1696,"url":"http://patchwork.ozlabs.org/api/users/1696/?format=json","username":"stroese","first_name":"Stefan","last_name":"Roese","email":"sr@denx.de"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20230221201925.9644-15-pali@kernel.org/mbox/","series":[{"id":343058,"url":"http://patchwork.ozlabs.org/api/series/343058/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=343058","date":"2023-02-21T20:18:27","name":"arm: mvebu: Various fixes","version":1,"mbox":"http://patchwork.ozlabs.org/series/343058/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/1745909/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/1745909/checks/","tags":{},"related":[],"headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>)","legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=oKFpb3Fh;\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=kernel.org","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.b=\"oKFpb3Fh\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=kernel.org","phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org"],"Received":["from phobos.denx.de (phobos.denx.de [85.214.62.61])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4PLrc95QKxz23j7\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Feb 2023 07:34:17 +1100 (AEDT)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 40B2D85A94;\n\tTue, 21 Feb 2023 21:25:17 +0100 (CET)","by phobos.denx.de (Postfix, from userid 109)\n id A4A3985AA2; Tue, 21 Feb 2023 21:24:01 +0100 (CET)","from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75])\n (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 7DE4185AB4\n for <u-boot@lists.denx.de>; Tue, 21 Feb 2023 21:22:42 +0100 (CET)","from smtp.kernel.org (relay.kernel.org [52.25.139.140])\n (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n (No client certificate requested)\n by ams.source.kernel.org (Postfix) with ESMTPS id 29123B810CB;\n Tue, 21 Feb 2023 20:22:33 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id 42C7DC433EF;\n Tue, 21 Feb 2023 20:22:31 +0000 (UTC)","by pali.im (Postfix)\n id A47D127B3; Tue, 21 Feb 2023 21:22:29 +0100 (CET)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,\n SPF_PASS autolearn=ham autolearn_force=no version=3.4.2","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n s=k20201202; t=1677010951;\n bh=BSaIHkH36fyEtd/XxxQZnMfB9VowMJCVA5cjakYcm94=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=oKFpb3Fh4H7MGIsQg/UoOZkhVDMgGtUQAr9NCpGa2Bj8DZ5xP404siZeq2ynD+nsN\n NA0uP9+sU9/RaBD7QyzSBZa9FeUbJMullFN6wwyk8H0+2fqPMZgWDA0eWb54Udiv48\n BTgGmSxrDvofqR08/2Gs0GVXhL1OJg7G4WQcgEtohEOaL7ef4tODZwmVvkbAxIbMih\n 0+7/m+3lhrakZe1IsjSOQvya580IEPmjUP1ir3giMpUrXWoq9WWqMRxhXrwiRlHIDo\n WQ0Bt35bVjvznlI/pfrDI2pD64+BxEw4NkPzzZuKMjRCD70sLbCJ2EOLUF0j1X8wml\n ka97JbhCkIRAg==","From":"=?utf-8?q?Pali_Roh=C3=A1r?= <pali@kernel.org>","To":"u-boot@lists.denx.de","Cc":"Stefan Roese <sr@denx.de>, Tony Dinh <mibodhi@gmail.com>,\n Josua Mayer <josua@solid-run.com>","Subject":"[PATCH RFC u-boot-mvebu 14/59] tools: kwboot: Add image type\n documentation","Date":"Tue, 21 Feb 2023 21:18:40 +0100","Message-Id":"<20230221201925.9644-15-pali@kernel.org>","X-Mailer":"git-send-email 2.20.1","In-Reply-To":"<20230221201925.9644-1-pali@kernel.org>","References":"<20230221201925.9644-1-pali@kernel.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.6 at phobos.denx.de","X-Virus-Status":"Clean"},"content":"Add information of all available image types and where they should be\nstored. Storage location offsets where documented from the disassembly of\nthe A385 BootROM image dump.\n\nSigned-off-by: Pali Rohár <pali@kernel.org>\n---\n tools/kwboot.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 62 insertions(+)","diff":"diff --git a/tools/kwboot.c b/tools/kwboot.c\nindex aae7393aeef6..7a7dd5bf3d7b 100644\n--- a/tools/kwboot.c\n+++ b/tools/kwboot.c\n@@ -54,6 +54,68 @@\n  *   https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/blob/u-boot-2013.01-armada-18.06/tools/marvell/doimage_mv/hdrparser.c\n  * - \"Marvell doimage Tool\", Marvell U-Boot 2013.01, version 18.06. August 30, 2015.\n  *   https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/blob/u-boot-2013.01-armada-18.06/tools/marvell/doimage_mv/doimage.c\n+ *\n+ * Storage location / offset of different image types:\n+ * - IBR_HDR_SPI_ID (0x5A):\n+ *   SPI image can be stored at any 2 MB aligned offset in the first 16 MB of\n+ *   SPI-NOR or parallel-NOR. Despite the type name it really can be stored on\n+ *   parallel-NOR and cannot be stored on other SPI devices, like SPI-NAND.\n+ *   So it should have been named NOR image, not SPI image. This image type\n+ *   supports XIP - Execute In Place directly from NOR memory.\n+ *\n+ * - IBR_HDR_NAND_ID (0x8B):\n+ *   NAND image can be stored either at any 2 MB aligned offset in the first\n+ *   16 MB of SPI-NAND or at any blocksize aligned offset in the first 64 MB\n+ *   of parallel-NAND.\n+ *\n+ * - IBR_HDR_PEX_ID (0x9C):\n+ *   PEX image is used for booting from PCI Express device. Source address\n+ *   stored in image is ignored by BootROM. It is not the BootROM who parses\n+ *   or loads data part of the PEX image. BootROM just configures SoC to the\n+ *   PCIe endpoint mode and let the PCIe device on the other end of the PCIe\n+ *   link (which must be in Root Complex mode) to load kwbimage into SoC's\n+ *   memory and tell BootROM physical address.\n+ *\n+ * - IBR_HDR_UART_ID (0x69):\n+ *   UART image can be transfered via xmodem protocol over first UART.\n+ *\n+ * - IBR_HDR_I2C_ID (0x4D):\n+ *   It is unknown for what kind of storage is used this image. It is not\n+ *   specified in any document from References section.\n+ *\n+ * - IBR_HDR_SATA_ID (0x78):\n+ *   SATA image can be stored at sector 1 (after the MBR table), sector 34\n+ *   (after the GPT table) or at any next sector which is aligned to 2 MB and\n+ *   is in the first 16 MB of SATA disk. Note that source address in SATA image\n+ *   is stored in sector unit and not in bytes like for any other images.\n+ *   Unfortunately sector size is disk specific, in most cases it is 512 bytes\n+ *   but there are also Native 4K SATA disks which have 4096 bytes long sectors.\n+ *\n+ * - IBR_HDR_SDIO_ID (0xAE):\n+ *   SDIO image can be stored on different medias:\n+ *   - SD(SC) card\n+ *   - SDHC/SDXC card\n+ *   - eMMC HW boot partition\n+ *   - eMMC user data partition / MMC card\n+ *   It cannot be stored on SDIO card despite the image name.\n+ *\n+ *   For SD(SC)/SDHC/SDXC cards, image can be stored at the same locations as\n+ *   the SATA image (sector 1, sector 34 or any 2 MB aligned sector) but within\n+ *   the first 64 MB. SDHC and SDXC cards have fixed 512 bytes long sector size.\n+ *   Old SD(SC) cards unfortunately can have also different sector sizes, mostly\n+ *   1024 bytes long sector sizes and also can be changed at runtime.\n+ *\n+ *   For MMC-compatible devices, image can be stored at offset 0 or at offset\n+ *   2 MB. If MMC device supports HW boot partitions then image must be stored\n+ *   on the HW partition as is configured in the EXT_CSC register (it can be\n+ *   either boot or user data).\n+ *\n+ *   Note that source address for SDIO image is stored in byte unit, like for\n+ *   any other images (except SATA). Marvell Functional Specifications for\n+ *   A38x and A39x SoCs say that source address is in sector units, but this\n+ *   is purely incorrect information. A385 BootROM really expects source address\n+ *   for SDIO images in bytes and also Marvell tools generate SDIO image with\n+ *   source address in byte units.\n  */\n \n #include \"kwbimage.h\"\n","prefixes":["RFC","u-boot-mvebu","14/59"]}