{"id":817866,"url":"http://patchwork.ozlabs.org/api/patches/817866/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/1506232825-27448-4-git-send-email-uri.mashiach@compulab.co.il/","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":"<1506232825-27448-4-git-send-email-uri.mashiach@compulab.co.il>","list_archive_url":null,"date":"2017-09-24T06:00:24","name":"[U-Boot,3/4] imx: mx7: SPL support for i.MX7","commit_ref":null,"pull_url":null,"state":"awaiting-upstream","archived":false,"hash":"fee28ed543ecd84884000e0a5e2a5752dc4b5bfd","submitter":{"id":67462,"url":"http://patchwork.ozlabs.org/api/people/67462/?format=json","name":"Uri Mashiach","email":"uri.mashiach@compulab.co.il"},"delegate":{"id":1693,"url":"http://patchwork.ozlabs.org/api/users/1693/?format=json","username":"sbabic","first_name":"Stefano","last_name":"Babic","email":"sbabic@denx.de"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/1506232825-27448-4-git-send-email-uri.mashiach@compulab.co.il/mbox/","series":[{"id":4801,"url":"http://patchwork.ozlabs.org/api/series/4801/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=4801","date":"2017-09-24T06:00:21","name":"cl-som-imx7: initial support","version":1,"mbox":"http://patchwork.ozlabs.org/series/4801/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/817866/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/817866/checks/","tags":{},"related":[],"headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"key not found in DNS\" (0-bit key;\n\tunprotected) header.d=compulab.co.il header.i=@compulab.co.il\n\theader.b=\"UIzrOvBd\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3y0Gqg6Bjpz9tX6\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 24 Sep 2017 16:03:43 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid A0DB4C22075; Sun, 24 Sep 2017 06:02:52 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 466A0C21E21;\n\tSun, 24 Sep 2017 06:01:57 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 49B3EC22081; Sun, 24 Sep 2017 06:01:50 +0000 (UTC)","from compulab.co.il (softlayer.compulab.co.il [50.23.254.55])\n\tby lists.denx.de (Postfix) with ESMTPS id 01DC0C2203C\n\tfor <u-boot@lists.denx.de>; Sun, 24 Sep 2017 06:01:50 +0000 (UTC)","from [37.142.126.90] (port=36975 helo=zimbra-mta.compulab.co.il)\n\tby softlayer.compulab.co.il with esmtp (Exim 4.87)\n\t(envelope-from <uri.mashiach@compulab.co.il>)\n\tid 1dvzz9-0002wc-Lq; Sun, 24 Sep 2017 09:01:47 +0300","from localhost (localhost [127.0.0.1])\n\tby zimbra-mta.compulab.co.il (Postfix) with ESMTP id BD3E648109D;\n\tSun, 24 Sep 2017 09:01:46 +0300 (IDT)","from zimbra-mta.compulab.co.il ([127.0.0.1])\n\tby localhost (zimbra-mta.compulab.co.il [127.0.0.1]) (amavisd-new,\n\tport 10032)\n\twith ESMTP id xxtYDq9L3LGU; Sun, 24 Sep 2017 09:01:46 +0300 (IDT)","from localhost (localhost [127.0.0.1])\n\tby zimbra-mta.compulab.co.il (Postfix) with ESMTP id 1D13D4810B1;\n\tSun, 24 Sep 2017 09:01:46 +0300 (IDT)","from zimbra-mta.compulab.co.il ([127.0.0.1])\n\tby localhost (zimbra-mta.compulab.co.il [127.0.0.1]) (amavisd-new,\n\tport 10026)\n\twith ESMTP id tZNi2QnNlOe8; Sun, 24 Sep 2017 09:01:46 +0300 (IDT)","from urim-desk.compulab.local (uri-ipc.compulab.local\n\t[192.168.11.218])\n\tby zimbra-mta.compulab.co.il (Postfix) with ESMTP id DE07448109D;\n\tSun, 24 Sep 2017 09:01:45 +0300 (IDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=0.0 required=5.0 tests=SPF_HELO_PASS, T_DKIM_INVALID\n\tautolearn=unavailable autolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=compulab.co.il; s=default;\n\th=References:In-Reply-To:Message-Id:Date:Subject\n\t:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type:\n\tContent-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:\n\tResent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:\n\tList-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive;\n\tbh=Skt+OFcGIDYG/DVrClH7CXFJ8yEqWQzu/Cgxt+D1bnE=;\n\tb=UIzrOvBdWYRgwZN7i8BtAG9aW\n\tsyI8qY1M5QKgstor1xxXdU9FejfXglppU8izEN/uGqAe02PFypubOcObgJ/uQrphYRgopFy61oxtn\n\tfyUN1IW4iKaaJpKR8UNrz4LEwkX5fszl8uvgnxwswGYaekqpYROhtTfYQe+Bw0458ogWghRVDF1Ri\n\tfhjJmzK9W32GkVFRhG9aLzwXNlPiocTJ4yklNAHvXpUMfePPP1/OkPXsDwKl7Q8Dcqk+JI9FXbuf0\n\tyybrWwocUJ1zBrMOEA2KtLtbiGgkDAqbkT0YppnUAZ9wD4wlYPjBsvfa9XdftZ6GyxusaJ+StJQts\n\t5pCAlmVeQ==;","X-Virus-Scanned":"amavisd-new at zimbra-mta.compulab.co.il","From":"Uri Mashiach <uri.mashiach@compulab.co.il>","To":"Stefano Babic <sbabic@denx.de>","Date":"Sun, 24 Sep 2017 09:00:24 +0300","Message-Id":"<1506232825-27448-4-git-send-email-uri.mashiach@compulab.co.il>","X-Mailer":"git-send-email 2.7.4","In-Reply-To":"<1506232825-27448-1-git-send-email-uri.mashiach@compulab.co.il>","References":"<1506232825-27448-1-git-send-email-uri.mashiach@compulab.co.il>","X-AntiAbuse":["This header was added to track abuse,\n\tplease include it with any abuse report","Primary Hostname - softlayer.compulab.co.il","Original Domain - lists.denx.de","Originator/Caller UID/GID - [47 12] / [47 12]","Sender Address Domain - compulab.co.il"],"X-Get-Message-Sender-Via":"softlayer.compulab.co.il: acl_c_recent_authed_mail_ips_text_entry:\n\turi.mashiach@compulab.co.il|compulab.co.il","X-Authenticated-Sender":"softlayer.compulab.co.il: uri.mashiach@compulab.co.il","Cc":"Fabio Estevam <fabio.estevam@nxp.com>, u-boot@lists.denx.de","Subject":"[U-Boot] [PATCH 3/4] imx: mx7: SPL support for i.MX7","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://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\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"},"content":"Add configuration file and spl_boot_device function for the i.MX7 SPL.\n\nSigned-off-by: Uri Mashiach <uri.mashiach@compulab.co.il>\n---\n arch/arm/include/asm/arch-mx7/sys_proto.h |  1 +\n arch/arm/mach-imx/spl.c                   | 23 ++++++++++-\n include/configs/imx7_spl.h                | 67 +++++++++++++++++++++++++++++++\n 3 files changed, 90 insertions(+), 1 deletion(-)\n create mode 100644 include/configs/imx7_spl.h","diff":"diff --git a/arch/arm/include/asm/arch-mx7/sys_proto.h b/arch/arm/include/asm/arch-mx7/sys_proto.h\nindex 15e24d4..fa62424 100644\n--- a/arch/arm/include/asm/arch-mx7/sys_proto.h\n+++ b/arch/arm/include/asm/arch-mx7/sys_proto.h\n@@ -7,3 +7,4 @@\n #include <asm/mach-imx/sys_proto.h>\n \n void set_wdog_reset(struct wdog_regs *wdog);\n+enum boot_device get_boot_device(void);\ndiff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c\nindex 258578a..c41f40c 100644\n--- a/arch/arm/mach-imx/spl.c\n+++ b/arch/arm/mach-imx/spl.c\n@@ -14,6 +14,7 @@\n #include <asm/spl.h>\n #include <spl.h>\n #include <asm/mach-imx/hab.h>\n+#include <asm/mach-imx/boot_mode.h>\n \n DECLARE_GLOBAL_DATA_PTR;\n \n@@ -82,7 +83,27 @@ u32 spl_boot_device(void)\n \t}\n \treturn BOOT_DEVICE_NONE;\n }\n-#endif\n+\n+#elif defined(CONFIG_MX7)\n+/* Translate iMX7 boot device to the SPL boot device enumeration */\n+u32 spl_boot_device(void)\n+{\n+\tenum boot_device boot_device_spl = get_boot_device();\n+\n+\tswitch (boot_device_spl) {\n+\tcase SD1_BOOT:\n+\tcase MMC1_BOOT:\n+\t\treturn BOOT_DEVICE_MMC1;\n+\tcase SD2_BOOT:\n+\tcase MMC2_BOOT:\n+\t\treturn BOOT_DEVICE_MMC2;\n+\tcase SPI_NOR_BOOT:\n+\t\treturn BOOT_DEVICE_SPI;\n+\tdefault:\n+\t\treturn BOOT_DEVICE_NONE;\n+\t}\n+}\n+#endif /* CONFIG_MX6 || CONFIG_MX7 */\n \n #if defined(CONFIG_SPL_MMC_SUPPORT)\n /* called from spl_mmc to see type of boot mode for storage (RAW or FAT) */\ndiff --git a/include/configs/imx7_spl.h b/include/configs/imx7_spl.h\nnew file mode 100644\nindex 0000000..e562cdb\n--- /dev/null\n+++ b/include/configs/imx7_spl.h\n@@ -0,0 +1,67 @@\n+/*\n+ * SPL definitions for the i.MX7 SPL\n+ *\n+ * (C) Copyright 2017 CompuLab, Ltd. http://www.compulab.com\n+ *\n+ * Author: Uri Mashiach <uri.mashiach@compulab.co.il>\n+ *\n+ * SPDX-License-Identifier:\tGPL-2.0+\n+ */\n+\n+#ifndef __IMX7_SPL_CONFIG_H\n+#define __IMX7_SPL_CONFIG_H\n+\n+#ifdef CONFIG_SPL\n+\n+#define CONFIG_SPL_FRAMEWORK\n+\n+/*\n+ * see figure 6-22 in i.MX 7Dual/Solo Reference manuals:\n+ *  - IMX7D/S OCRAM free area RAM (OCRAM) is from 0x00910000 to\n+ *    0x00946C00.\n+ *  - Set the stack at the end of the free area section, at 0x00946BB8.\n+ *  - The BOOT ROM loads what they consider the firmware image\n+ *    which consists of a 4K header in front of us that contains the IVT, DCD\n+ *    and some padding thus 'our' max size is really 0x00946BB8 - 0x00911000.\n+ *    64KB is more then enough for the SPL.\n+ */\n+#define CONFIG_SPL_TEXT_BASE\t\t0x00911000\n+#define CONFIG_SPL_MAX_SIZE\t\t0x10000\n+#define CONFIG_SPL_STACK\t\t0x00946BB8\n+/*\n+ * Pad SPL to 68KB (4KB header + 64KB max size). This allows to write the\n+ * SPL/U-Boot combination generated with u-boot-with-spl.imx directly to a\n+ * boot media (given that boot media specific offset is configured properly).\n+ */\n+#define CONFIG_SPL_PAD_TO\t\t0x11000\n+\n+/* MMC support */\n+#if defined(CONFIG_SPL_MMC_SUPPORT)\n+#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION\t1\n+#define CONFIG_SYS_MONITOR_LEN\t\t\t409600\t/* 400 KB */\n+#endif\n+\n+/* SATA support */\n+#if defined(CONFIG_SPL_SATA_SUPPORT)\n+#define CONFIG_SPL_SATA_BOOT_DEVICE\t\t0\n+#define CONFIG_SYS_SATA_FAT_BOOT_PARTITION\t1\n+#endif\n+\n+/* Define the payload for FAT/EXT support */\n+#if defined(CONFIG_SPL_FAT_SUPPORT) || defined(CONFIG_SPL_EXT_SUPPORT)\n+# ifdef CONFIG_OF_CONTROL\n+#  define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME\t\"u-boot-dtb.img\"\n+# else\n+#  define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME\t\"u-boot.img\"\n+# endif\n+#endif\n+\n+#define CONFIG_SPL_BSS_START_ADDR      0x88200000\n+#define CONFIG_SPL_BSS_MAX_SIZE        0x100000\t\t/* 1 MB */\n+#define CONFIG_SYS_SPL_MALLOC_START    0x88300000\n+#define CONFIG_SYS_SPL_MALLOC_SIZE     0x100000\t\t/* 1 MB */\n+#define CONFIG_SYS_TEXT_BASE           0x87800000\n+\n+#endif /* CONFIG_SPL */\n+\n+#endif /* __IMX7_SPL_CONFIG_H */\n","prefixes":["U-Boot","3/4"]}