From patchwork Wed Apr 25 12:38:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 904201 X-Patchwork-Delegate: monstr@monstr.eu 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=xilinx.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20150623.gappssmtp.com header.i=@monstr-eu.20150623.gappssmtp.com header.b="NLsbAtNX"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 40WKWB1PDGz9s1j for ; Wed, 25 Apr 2018 22:38:46 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id B7168C21FCF; Wed, 25 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_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 9D910C21FC7; Wed, 25 Apr 2018 12:38:14 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A29B0C21F16; Wed, 25 Apr 2018 12:38:12 +0000 (UTC) Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by lists.denx.de (Postfix) with ESMTPS id E03E0C21EE8 for ; Wed, 25 Apr 2018 12:38:11 +0000 (UTC) Received: by mail-wm0-f68.google.com with SMTP id j4so6901011wme.1 for ; Wed, 25 Apr 2018 05:38:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=3MQuxDgRRsrELhMOXJaFiatsBSIynjonkx7jliVPx3A=; b=NLsbAtNXPLUk2qhzUHoX+oyMk6lKFnisC0RccqtdtsQ+Wcxium5Bhjxmo0aABIZoqz E8biqZLCpgZhAQrwOH7aEHJGMzggLvI7yJKoaJH7QH86dCNqjxQKclhFMLYThAh1+AD4 PUgGmvyHHDfCzK1NBTu0Wv2e3eiGKNIirUOoKmTtC2g8jglm3IzxwlCn67zc+i4a1GQC rGOKqliRJQ15KbjDP6//2WQl7CA4OoTdz3X4fzndUCA94Sb7cGqq9GQklMpMJuqK1qR3 aNI+wZtGN6RqeaSQLWZyqFhknqJw+waBp3kv00XRCIvo9XTp6ON/LnLKkB38b+tJEHfE ViNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:in-reply-to:references; bh=3MQuxDgRRsrELhMOXJaFiatsBSIynjonkx7jliVPx3A=; b=sLOkMDbOgNIgVkiYZ7ZC2Sdq3yfZomJF6XtVszMIubH6HZ9q5qiudxCj01bDiMxYi1 28dk3eg11Oi49/+hx6BTclthG6b082NErEQPIgCedt5hs+a+4UNNzOmsqBvFBuSb/b1b LJm1DBu5K6Mk3HBRt2C9SHSziiD09Q5nPeFGaUAFdpU56IFSsypZ6qkKwhjpmNHH8WxN uhTXviXym8WV64MFOVYMclq+WqwvWl8vMNIIr0iwBQ2XdhAWCGCnqGrl9TPfwT88mr+3 Mv5B22iOAApJoyiOzybcgbJn2QUyiaNCDR+vLINB/FVwNv5zHHdRq/9wkbf7S9/SpCm9 6i2A== X-Gm-Message-State: ALQs6tCD/TwTDzVR0UY8+cBLIhsENqIu7uLvTRg7nx+ljcUf7uguLO6U KjG6GFY0vz45BZyQhKCfFA1r71qz X-Google-Smtp-Source: AB8JxZruH4t0IByeV0WVAIS2/QS5/pENB8qSROXg9SXETWQH/ayLSmIEcRSybiTn2NSFhvY9gJdLpg== X-Received: by 10.28.51.79 with SMTP id z76mr16267321wmz.113.1524659891349; Wed, 25 Apr 2018 05:38:11 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id u10sm14743822wme.12.2018.04.25.05.38.10 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 25 Apr 2018 05:38:10 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, Alexander Graf Date: Wed, 25 Apr 2018 14:38:08 +0200 Message-Id: <8a301ac42ef1dc24fd5ee67759365593e6324548.1524659886.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <8fad3265d924092e94aae75d4141a61872a61685.1524659886.git.michal.simek@xilinx.com> References: <8fad3265d924092e94aae75d4141a61872a61685.1524659886.git.michal.simek@xilinx.com> In-Reply-To: <8fad3265d924092e94aae75d4141a61872a61685.1524659886.git.michal.simek@xilinx.com> References: <8fad3265d924092e94aae75d4141a61872a61685.1524659886.git.michal.simek@xilinx.com> Subject: [U-Boot] [RFC PATCH 2/2] arm64: zynqmp: Try to create bootcm_mmcX at run time 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" Just an attept to create boot commands for mmcs above 2 which is not generated. Signed-off-by: Michal Simek --- Probably some ifdefs around are missing. --- board/xilinx/zynqmp/zynqmp.c | 28 ++++++++++++++++++++++++++++ include/configs/xilinx_zynqmp.h | 7 ------- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index 96ea0f578d30..37fa8f4f4d3f 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -451,6 +451,32 @@ void reset_cpu(ulong addr) { } +static int create_mmc_boot_commands(void) +{ +/* Size of strings below + one terminating char \0 + 3 possitions for seq */ +#define MAX_COMMAND_LEN 15 +#define MAX_BODY_LEN 32 + + int ret; + struct uclass *uc; + struct udevice *dev; + char body[MAX_BODY_LEN]; + char command[MAX_COMMAND_LEN]; + + ret = uclass_get(UCLASS_MMC, &uc); + if (ret) + return ret; + + uclass_foreach_dev(dev, uc) { + snprintf(body, MAX_BODY_LEN, "setenv devnum %x; run mmc_boot", + dev->seq); + snprintf(command, MAX_COMMAND_LEN, "bootcmd_mmc%x", dev->seq); + env_set(command, body); + } + + return 0; +} + int board_late_init(void) { u32 reg = 0; @@ -546,6 +572,8 @@ int board_late_init(void) debug("Bootseq len: %x\n", bootseq_len); } + create_mmc_boot_commands(); + /* * One terminating char + one byte for space between mode * and default boot_targets diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h index c8a0dbb7e3b5..a2590998429e 100644 --- a/include/configs/xilinx_zynqmp.h +++ b/include/configs/xilinx_zynqmp.h @@ -155,12 +155,6 @@ "scriptaddr=0x02000000\0" \ "ramdisk_addr_r=0x02100000\0" \ -#if defined(CONFIG_MMC_SDHCI_ZYNQ) -# define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1) -#else -# define BOOT_TARGET_DEVICES_MMC(func) -#endif - #if defined(CONFIG_SATA_CEVA) # define BOOT_TARGET_DEVICES_SCSI(func) func(SCSI, scsi, 0) #else @@ -186,7 +180,6 @@ #endif #define BOOT_TARGET_DEVICES(func) \ - BOOT_TARGET_DEVICES_MMC(func) \ BOOT_TARGET_DEVICES_USB(func) \ BOOT_TARGET_DEVICES_SCSI(func) \ BOOT_TARGET_DEVICES_PXE(func) \