From patchwork Wed Apr 11 12:36:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 897167 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="A2i7GPKR"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 40LkDw0gRHz9s35 for ; Wed, 11 Apr 2018 22:41:35 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 776A7C21E02; Wed, 11 Apr 2018 12:38:34 +0000 (UTC) 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=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 4D91BC21DB6; Wed, 11 Apr 2018 12:38:32 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 94C52C21C51; Wed, 11 Apr 2018 12:36:59 +0000 (UTC) Received: from mail-pl0-f66.google.com (mail-pl0-f66.google.com [209.85.160.66]) by lists.denx.de (Postfix) with ESMTPS id C854CC21D72 for ; Wed, 11 Apr 2018 12:36:55 +0000 (UTC) Received: by mail-pl0-f66.google.com with SMTP id b6-v6so1298827pla.11 for ; Wed, 11 Apr 2018 05:36:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lAKY2Mjjdsq5t57ytXbg+a/2EGBVxP2O+c/Ecko7JbU=; b=A2i7GPKRr9mKKYI+QvD04Lg+bLmabx384KwKBcw50aMP2qXrXKN8ngdbO5psKK7iTi /33graxIIbuDzYWENe2qG2FkqREH9yh5NAewAwtiRykBkb3RLUPDT/ZYCxGvFpfrvxfS OFMTf7aoxkAvAkpGwNg+1pprGFSLWd3pnujgM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=lAKY2Mjjdsq5t57ytXbg+a/2EGBVxP2O+c/Ecko7JbU=; b=IqmHpVkKktjP7mGiAB9RH0dUuaV+W1sR5kCemyv0mMLoevEUZQxsouvj6/a6ePaFMM 0GxqzjqJL305BBZVlAHQ/0rISHY9nWXs44lAmgPmn46oc5ScpJ6RaLfY3OXEGp4i7WOw eBpxYg8XrADXlq7ylEPC+FcnT3h+Po2W7C2ULahwtBmTUH7Xep0fsq4MglD50EMun2s7 +rmrIdGdUnCeS2wIOJWV5oWQS7TcXjN+hEj4amqoOzw/mYQVoB+aJ8G1ffV3+KHFljiG yDS7riGRb0oGzwFySPiAOwM7CK+BMn+9fHa42sjdtRNCKc07dNVzLAzZQ9QebFkexRNY A4bg== X-Gm-Message-State: ALQs6tAziJm+ufQNa7Tn0bzrtbwxwT2sscMN7AvpbgE09cQn2lfWN/6B QJ2kKqWVK+6k8A56vWKgS2an/Q== X-Google-Smtp-Source: AIpwx4+HH1UOMF/LqGQQibZyc4fBtlsTMzHwUNNky11v8+fb1jeABfp5NzZpBLbEJCHkGrSWcxKmaA== X-Received: by 2002:a17:902:9892:: with SMTP id s18-v6mr4908839plp.95.1523450214424; Wed, 11 Apr 2018 05:36:54 -0700 (PDT) Received: from localhost.localdomain ([115.97.190.51]) by smtp.gmail.com with ESMTPSA id l10sm2316021pgp.35.2018.04.11.05.36.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Apr 2018 05:36:53 -0700 (PDT) From: Jagan Teki To: Stefano Babic Date: Wed, 11 Apr 2018 18:06:14 +0530 Message-Id: <20180411123615.15130-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180411123615.15130-1-jagan@amarulasolutions.com> References: <20180411123615.15130-1-jagan@amarulasolutions.com> Cc: Shyam Saini , u-boot@lists.denx.de, Davide Bonfanti , Andrea CORTESE , Fabio maggi , Fabio Estevam , Raffaele RECALCATI , lamiaposta71@gmail.com Subject: [U-Boot] [PATCH v2 6/7] configs: imx6dl-mamoj: Add Falcon mode support X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add Falcon mode support to boot Linux directly after SPL. Signed-off-by: Jagan Teki --- board/bticino/mamoj/README | 27 +++++++++++++++++++++++++++ board/bticino/mamoj/spl.c | 11 +++++++++++ configs/imx6dl_mamoj_defconfig | 1 + include/configs/imx6dl-mamoj.h | 12 ++++++++++++ 4 files changed, 51 insertions(+) diff --git a/board/bticino/mamoj/README b/board/bticino/mamoj/README index 8b0e9c3e0c..5333c72537 100644 --- a/board/bticino/mamoj/README +++ b/board/bticino/mamoj/README @@ -15,6 +15,8 @@ The following methods can be used for booting Mamoj boards: 2. eMMC boot (via DFU) +3. Falcon mode + 1. USB SDP boot: --------------- @@ -92,6 +94,31 @@ The following methods can be used for booting Mamoj boards: Poweroff and Poweron the board and see U-Boot booting from eMMC. +3. Falcon mode: +-------------- + + - Skip 10M space and create dual partitions for eMMC, start sector is 20480 + + Partition Map for MMC device 2 -- Partition Type: DOS + + Part Start Sector Num Sectors UUID Type + 1 20480 131072 c52e78be-01 83 + 2 151552 7581696 c52e78be-02 83 + + - Write uImage + + => fatload mmc 2:1 $kernel_addr_r uImage + => mmc write $kernel_addr_r 0x1000 0x4000 + + - Write dtb and args + + => setenv bootargs console=ttymxc2,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait rw quiet + => fatload mmc 2:1 $fdt_addr_r imx6dl-mamoj.dtb + => spl export fdt $kernel_addr_r - $fdt_addr_r + => mmc write 0x13000000 0x800 0x800 + + Poweroff and Poweron the board and see Linux booting directly after SPL. + -- Jagan Teki 03/12/18 diff --git a/board/bticino/mamoj/spl.c b/board/bticino/mamoj/spl.c index 82568f7af5..531064995f 100644 --- a/board/bticino/mamoj/spl.c +++ b/board/bticino/mamoj/spl.c @@ -27,6 +27,17 @@ static iomux_v3_cfg_t const uart3_pads[] = { IOMUX_PADS(PAD_EIM_D25__UART3_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL)), }; +#ifdef CONFIG_SPL_OS_BOOT +int spl_start_uboot(void) +{ + /* break into full u-boot on 'c' */ + if (serial_tstc() && serial_getc() == 'c') + return 1; + + return 0; +} +#endif + static int mx6dl_dcd_table[] = { 0x020e0774, 0x000C0000, /* MX6_IOM_GRP_DDR_TYPE */ 0x020e0754, 0x00000000, /* MX6_IOM_GRP_DDRPKE */ diff --git a/configs/imx6dl_mamoj_defconfig b/configs/imx6dl_mamoj_defconfig index e34c2d9be3..d789496dff 100644 --- a/configs/imx6dl_mamoj_defconfig +++ b/configs/imx6dl_mamoj_defconfig @@ -3,6 +3,7 @@ CONFIG_ARCH_MX6=y CONFIG_SYS_TEXT_BASE=0x17800000 CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_TARGET_MX6DL_MAMOJ=y +CONFIG_SPL_OS_BOOT=y # CONFIG_CMD_BMODE is not set CONFIG_DEFAULT_DEVICE_TREE="imx6dl-mamoj" CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg" diff --git a/include/configs/imx6dl-mamoj.h b/include/configs/imx6dl-mamoj.h index 0ac238b82d..2f5e212b88 100644 --- a/include/configs/imx6dl-mamoj.h +++ b/include/configs/imx6dl-mamoj.h @@ -64,6 +64,18 @@ #define CONFIG_MXC_USB_FLAGS 0 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 +/* Falcon */ +#define CONFIG_SPL_FS_LOAD_ARGS_NAME "args" +#define CONFIG_SPL_FS_LOAD_KERNEL_NAME "uImage" +#define CONFIG_CMD_SPL +#define CONFIG_SYS_SPL_ARGS_ADDR 0x13000000 +#define CONFIG_CMD_SPL_WRITE_SIZE (128 * SZ_1K) + +/* MMC support: args@1MB kernel@2MB */ +#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x800 /* 1MB */ +#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (CONFIG_CMD_SPL_WRITE_SIZE / 512) +#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x1000 /* 2MB */ + /* Miscellaneous configurable options */ #define CONFIG_SYS_MEMTEST_START 0x80000000 #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 0x8000000)