From patchwork Thu Jul 29 09:39:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1511142 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=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) 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.a=rsa-sha256 header.s=20150623 header.b=koCE0OU2; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Gb5B32zJcz9sSs for ; Thu, 29 Jul 2021 19:40:43 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 768D482EA7; Thu, 29 Jul 2021 11:40:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; 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="koCE0OU2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 74A5F82E54; Thu, 29 Jul 2021 11:39:59 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 805E082E02 for ; Thu, 29 Jul 2021 11:39:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=monstr@monstr.eu Received: by mail-wr1-x429.google.com with SMTP id m12so1297368wru.12 for ; Thu, 29 Jul 2021 02:39:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LH3hABlLjNtOXZpjcHSsRK47Y+TOh+0TpskUqN/K8dI=; b=koCE0OU2UoXy7ouLGqaKN4zzSDTxfQUY8YbRU4ZiDRf5UzaZF0xMOyZmVPwH7hyReE SrjnXiz2xEwgu8OTDRq9DunhJtuh1Z9+yhh1sXenDkVk4gCTN0ltt/8bAZkOTS2jvq40 eAzDgnq12pXGm8qfuO3HLWMJTBLay2m9WQVJWuKmf8qZzkI2HQ05MK14DlbGtaiRkJaJ hIa9fft19PniM5ij8IQ/y5Wvai0Rck5yqSbOJvkQ06/cE8vK8P9TRVYG7hpuxG7AuanE NdaGkDJk1rk2IvgBqUhFGKN8xp1kCkQRul67y77C9FCho4/jXn2HxJusdEVtx5TEHEpu YJQQ== 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:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=LH3hABlLjNtOXZpjcHSsRK47Y+TOh+0TpskUqN/K8dI=; b=P9uk+jMuKGq6ofHnv2PvC5st2H6sNW/XBFLhSbhASy1tm899g3+qAUrC1fvde0dDyO KfhzdI5++IHoZ/GwStLKvFEKlYnYWGn6MVueZ83OMSgR86mQlI+PoL4wyuGo3q2yl1Cm NJfu4Q2Gri/4gwbH2Qlxn3zBe+MpyxbMM5kcuZlJ4QUV1u9u3eGpBH5ZjBG0vztPlWTP IDZ6wyCXagnHESRO52wPtp3WAuzrkC1+Zw9oI2X+/i+F3+ZPYuf4t/Uu/0ulnq8eVsD6 q0ZcsbHrBI32sdhZAFPmUZEDLjwegB4i6wt9hc5RqUWOX6E/pFeLcrMSBebvIS/zhOYb x6DA== X-Gm-Message-State: AOAM530ngHjYoqhNDHzFaiM2wKorxWQR4mXwVVuDuId/VdocZp8ZQdrh RAQyet4I/3X6POP01+6RCStkMM1UpzP/HoQp X-Google-Smtp-Source: ABdhPJzr9PkI7O9ZBxFMsqrAHAdsdI6q+y08/HhywXbVsZk1lfwnChQm92T6eIACoRqLPNWR4IXcew== X-Received: by 2002:a5d:5141:: with SMTP id u1mr3999623wrt.50.1627551589949; Thu, 29 Jul 2021 02:39:49 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6:f666:9af6:3fed:e53b]) by smtp.gmail.com with ESMTPSA id a8sm2669725wmj.8.2021.07.29.02.39.49 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Jul 2021 02:39:49 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: Ibai Erkiaga , Michal Simek , Simon Glass , T Karthik Reddy Subject: [PATCH v2 1/4] xilinx: zynqmp: Change multi_boot() to return value Date: Thu, 29 Jul 2021 11:39:25 +0200 Message-Id: <5f633206d0b9fcb08a824577a37ffa5bf4adfb2f.1627551566.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Change multi_boot() to return multiboot value and move print out of this function and let this function to be used by other functions without duplicating message. Signed-off-by: Michal Simek --- Changes in v2: None board/xilinx/zynqmp/zynqmp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index 2cb97f42bec3..eb67116d5b44 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -350,9 +350,7 @@ static int multi_boot(void) multiboot = readl(&csu_base->multi_boot); - printf("Multiboot:\t%d\n", multiboot); - - return 0; + return multiboot; } #define PS_SYSMON_ANALOG_BUS_VAL 0x3210 @@ -392,7 +390,7 @@ int board_init(void) #endif if (current_el() == 3) - multi_boot(); + printf("Multiboot:\t%d\n", multi_boot()); return 0; } From patchwork Thu Jul 29 09:39:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1511140 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=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) 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.a=rsa-sha256 header.s=20150623 header.b=DzhkA16a; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Gb59f2QL9z9sSs for ; Thu, 29 Jul 2021 19:40:22 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 39D7B82AE5; Thu, 29 Jul 2021 11:40:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; 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="DzhkA16a"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9254782E8D; Thu, 29 Jul 2021 11:39:57 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2646782E0D for ; Thu, 29 Jul 2021 11:39:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=monstr@monstr.eu Received: by mail-wm1-x32b.google.com with SMTP id l11-20020a7bc34b0000b029021f84fcaf75so6379422wmj.1 for ; Thu, 29 Jul 2021 02:39:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Qjc5+JQgcdvHqxvbNd6C6LqnNUe3+xMYjNpFwdV3TVU=; b=DzhkA16apqOF0FxOSnWBT8dK7OHOfL8uQEFl8jZVVhKoCf1qFhcNbBBqf+FEc5ODGj whxsFR++2rD3Z34NdcpwOM26OHaBVtSHE9tyA3v8YkkVB88LbWsAUJX2js4Lndjl3xt6 hFG8yiPzpWcy6GqQ1HInKTlL2FIeW+WjCIAR9TTwdIoKSIlch0GGZwLqaWnSfMMnGy3v u97j2IrVLBWg3+Ojj59Eo/y6kWt58r2FuUQpYXbuQW+/92sVbRvbqh51No+S46WnQjY0 Mnc8EVNgWSxNi4dsoxq4BkrpmbialUDUtseXTQ+JcLj8UM39mJMh6VKMB8deuOqPzV5s B59w== 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:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Qjc5+JQgcdvHqxvbNd6C6LqnNUe3+xMYjNpFwdV3TVU=; b=MfPBs/6vst6frjEC4+dhTnvPj6v+w4RdzP0w0t2ZROgE9R9XIZsIPTFkh0a5luqqex JHDQMmxBZJMqDJySydVwXtjCdXX0iQz6iuMJgJcTuoTsyMQLHyqIv/Xs1aWJIlwFqPUi EQ+/RVGw86lYO9X9jyEhHFdR/0jAEsJ4y/hahZZQJo3o4gAJD/yUhCFxDEUSCAlEYPkG fF/FcY1olRiDTOZDW6BQY0REqXKVsqjgZZ7lm07sOvns0uHF106TmDhygYoDg3rMCiew FYBwH+zWR+sz2ZOg4U+MUMTHyb67iTF+C7mZbpaNHox6a3OZhadyc58N6ryElETq4vwE Eg5A== X-Gm-Message-State: AOAM533PjrhAhBgey8rO2+4lp4MPthudq8/TAHygQJQIuEJwRYrCGUVR SYSc6DSgdCPwKzzDmGt9OMbywLv1Dw8bC7O8 X-Google-Smtp-Source: ABdhPJxTMParABGAt+7itYDIQpaH+7qudiaS5oqj5UnRSsiHY9EaUwE5WiKZnsZ+0Ti+VVpzfEv+vg== X-Received: by 2002:a7b:c7d1:: with SMTP id z17mr13555206wmk.50.1627551591540; Thu, 29 Jul 2021 02:39:51 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6:f666:9af6:3fed:e53b]) by smtp.gmail.com with ESMTPSA id p4sm2878378wre.83.2021.07.29.02.39.50 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Jul 2021 02:39:51 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: Ibai Erkiaga , Michal Simek , Simon Glass , T Karthik Reddy Subject: [PATCH v2 2/4] xilinx: zynqmp: use zynqmp_mmio_read() in multi_boot() Date: Thu, 29 Jul 2021 11:39:26 +0200 Message-Id: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean When U-Boot runs in EL2 there is no access to csu_base registers that's why this has to be done via firmware interface to find out multi boot register value. Till now this function is called only from SPL in EL3. Signed-off-by: Michal Simek --- Changes in v2: None board/xilinx/zynqmp/zynqmp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index eb67116d5b44..1b0356c84c5c 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -346,9 +346,12 @@ int board_early_init_f(void) static int multi_boot(void) { - u32 multiboot; + u32 multiboot = 0; + int ret; - multiboot = readl(&csu_base->multi_boot); + ret = zynqmp_mmio_read((ulong)&csu_base->multi_boot, &multiboot); + if (ret) + return -EINVAL; return multiboot; } From patchwork Thu Jul 29 09:39:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1511141 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=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) 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.a=rsa-sha256 header.s=20150623 header.b=Yo1DTqXu; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Gb59r7095z9sWd for ; Thu, 29 Jul 2021 19:40:32 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3E68C82E6A; Thu, 29 Jul 2021 11:40:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; 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="Yo1DTqXu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0191682E6A; Thu, 29 Jul 2021 11:39:58 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 788CC8290A for ; Thu, 29 Jul 2021 11:39:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=monstr@monstr.eu Received: by mail-wr1-x42a.google.com with SMTP id h14so6076585wrx.10 for ; Thu, 29 Jul 2021 02:39:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tsq21GDMOE4mO0s+dl7SAYAYFmUR53gGd060jZ2626A=; b=Yo1DTqXuXGDasRKbptMTL9/b2PY4R9e0lccVXUmcaT5WBd4wVREKqXJTc1UDg7lsL6 beFrVb3D55qJtiP1VlhLAWmCSYpDm8qW1Pj0drcufiH6KrkQoF6ex7mJG1lZUyxLWQmV GFdX5AOK+9hchNHAqp3OUI3pQVmJJ/ghSCtXy5jaoik9pBVWyapKBLK88w5qMjBs9mIZ K8u/VVTfTwx/BS1gozXEImHqpyDcTkjXtIZu4UwDWzZ+JKp853eOcrq2OW2h/AX1ccBi rlqnbnPXrrQ/a0pNxxnRAFCfD5+WRb8xhpB/D3UhqJdHIDcA0EsfPxQRmUPUfvYmDFSq FqnA== 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:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=tsq21GDMOE4mO0s+dl7SAYAYFmUR53gGd060jZ2626A=; b=uhkoRmEqCHzebnxSYtqcqbr5KxBXkuTJ1QKpxeJNmjjIEcnvfjgBVxWm3hAzO3I+62 37ugcOTisviQztSGUt+kQY+V2XxmSDfFe8Y4OlhVZrmWympjD0TdpnQJM7SO0YFHriMH moeVAYzjZ2ox1Cca3F1sb0PbaBKMXOHftJNC3YnAMxZwsWcMHMIEdvUuIvog0R9fxx9X EqpP3qTMH76vPAqFJdZM7gXEJFw8tFyEfpF8SIltvrqTo4mSldO7n4N8t624Ey0oC6qL HPjIKrKfmtKYQOC5UaS8HG3qinzgGW9PqUHeZd5ZTVdEClkQRH5E56LpAOIs81MKfoDG RAZg== X-Gm-Message-State: AOAM530pWwXMYGB7tTXOsvQmdvB+zLdxvNKmfa8HFbeDIB6BZBJTJ+xJ mNd1HaU4KFSS0IFAsCV7Kqoo4tifOAt9l3YC X-Google-Smtp-Source: ABdhPJypGPHmnQPySxEdAeCpHClFVbw9SvKHJKgT/3orh7aB0g2rnfqx9/hw6oapPDIZi5OYyeh/zQ== X-Received: by 2002:a05:6000:100a:: with SMTP id a10mr3885916wrx.42.1627551592948; Thu, 29 Jul 2021 02:39:52 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6:f666:9af6:3fed:e53b]) by smtp.gmail.com with ESMTPSA id h4sm2853664wru.2.2021.07.29.02.39.52 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Jul 2021 02:39:52 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: Ashok Reddy Soma , Ilias Apalodimas , Michal Simek , T Karthik Reddy Subject: [PATCH v2 3/4] xilinx: zynqmp: Config non zero SYS_SPI_U_BOOT_OFFS Date: Thu, 29 Jul 2021 11:39:27 +0200 Message-Id: <846902c505aca09b67e1b287837bbae42d75824d.1627551566.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean This variable is pointing to offset is qspi where u-boot image is placed. In our case it is location of u-boot.itb file. Offset is the same as is used by Xilinx Zynq SoC. Signed-off-by: Michal Simek --- Changes in v2: None configs/xilinx_zynqmp_virt_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/xilinx_zynqmp_virt_defconfig b/configs/xilinx_zynqmp_virt_defconfig index bac1e181d265..095260403d95 100644 --- a/configs/xilinx_zynqmp_virt_defconfig +++ b/configs/xilinx_zynqmp_virt_defconfig @@ -5,6 +5,7 @@ CONFIG_SYS_TEXT_BASE=0x8000000 CONFIG_SYS_MALLOC_F_LEN=0x8000 CONFIG_SYS_MEMTEST_START=0x00000000 CONFIG_SYS_MEMTEST_END=0x00001000 +CONFIG_SYS_SPI_U_BOOT_OFFS=0x100000 CONFIG_DM_GPIO=y CONFIG_DEFAULT_DEVICE_TREE="zynqmp-zcu100-revC" CONFIG_SPL=y From patchwork Thu Jul 29 09:39:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1511144 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=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) 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.a=rsa-sha256 header.s=20150623 header.b=MNob4FO6; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Gb5BH2D7Zz9sSs for ; Thu, 29 Jul 2021 19:40:54 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6861C82EC0; Thu, 29 Jul 2021 11:40:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; 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="MNob4FO6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B870A82C8B; Thu, 29 Jul 2021 11:40:09 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 136BC82E16 for ; Thu, 29 Jul 2021 11:39:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=monstr@monstr.eu Received: by mail-wm1-x335.google.com with SMTP id n21so3285397wmq.5 for ; Thu, 29 Jul 2021 02:39:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8w2sUez8xDXlXrDNr/m4zjFqQW34t3M+HnYLTwvRoPU=; b=MNob4FO66LUOhlTgwDS665Wct7hYS3secdwo4TxTZuwi5GUtm6T3n08F1VgyZMPU8a H2m8sqeMgql9WndHDIGIGj3gMmWQ5e5yqEhefWvB6dlt3XP5SNzHRj3Dy6Y3YpXgyAMH AlpHydEPJY6jrc7tpNIBn4ACIZHzWaBmvhz4BP9n2Cqu/pUEAN/IZzLca9+yYcu4RuHr CE7wJfoqHKO3juifYxDwzkU/gYjuzRfVNxoFrCv4hCTMjTSUqxD99bH0WP6fN8i6/VJD Moh42Oej/kyoPANdRWb4FlsM8VCZHHg6SYhqX373rBSkvrsYVlcL8z8CUWt93O0gjy1n oJjQ== 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:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=8w2sUez8xDXlXrDNr/m4zjFqQW34t3M+HnYLTwvRoPU=; b=MrXcIxTZy86Y/ixSRNKg79mYuSrJmbPqhpIB0231Jl3KeXxRbs7fhFUwB0cPp2yRUR sUKtDr7XBilYNT3MZpnEFtj5UxDtXnR9VmD2JSJ0U9DKFI7a1X+1A0Ep39lNgqRjyE9x sys/H9/cuT9j3xvATeB4Z+IUnLjD1OtLk4QqVBYJSbM4TMXqigsaAJVP3XdNajSWjfOk U1Z3ermFAJijLDHY9fi3WKsxeOo3ltKtcblRy/Vl2CgBj9hGKsE77uMn+OUn/fN/zHF9 zw5r2AUsMIfjJfLgNhuuclzAupZ3tJm33uW//YvaSIcI9Yg2x54J70Xj+o2GINiufmme H62w== X-Gm-Message-State: AOAM533ADFKTl5Y83+RPyz438B2P54SY7wFlKoIbpGAozxg+jalofUj9 rrLS/YPhuANa4unKSeltYF2H4hL01m8127K4 X-Google-Smtp-Source: ABdhPJzlpSXU7eO7DPpclgiwDWu9DuambYklAPbmK07uR7m0vNZtsGqrm1NgLhmwXtA/ImID9WaFqA== X-Received: by 2002:a05:600c:1c93:: with SMTP id k19mr3794546wms.125.1627551594441; Thu, 29 Jul 2021 02:39:54 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6:f666:9af6:3fed:e53b]) by smtp.gmail.com with ESMTPSA id b15sm2722151wrx.73.2021.07.29.02.39.53 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Jul 2021 02:39:54 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: Ashok Reddy Soma , Ibai Erkiaga , Ilias Apalodimas , Michal Simek , Simon Glass , T Karthik Reddy Subject: [PATCH v2 4/4] xilinx: zynqmp: Add support for runtime dfu_alt_info setup Date: Thu, 29 Jul 2021 11:39:28 +0200 Message-Id: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean The main reason for this to be implemented is capsule update. Two memories are supported and tested which is MMC FAT based and QSPI based. For creating capsule these commands are used: ./tools/mkeficapsule --raw spl/boot.bin --index 1 capsule1.bin ./tools/mkeficapsule --raw u-boot.itb --index 2 capsule2.bin Then transfer to SD card where these commands run: load mmc 0 10000000 capsule1.bin efidebug capsule update -v 10000000 load mmc 0 10000000 capsule2.bin efidebug capsule update -v 10000000 Depends on the boot device used are binaries loaded to qspi or mmc fat partition. Also multiboot register is handled to make sure that the same location(id) is used as image which is upgraded. Two locations are used by purpose for SPL flow. If only boot.bin is used create only one capsule. Signed-off-by: Michal Simek --- Changes in v2: - no need to free local buf variable board/xilinx/zynqmp/zynqmp.c | 54 ++++++++++++++++++++++++++++ configs/xilinx_zynqmp_virt_defconfig | 1 + 2 files changed, 55 insertions(+) diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index 1b0356c84c5c..27bb2b056c58 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -19,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -818,3 +820,55 @@ enum env_location env_get_location(enum env_operation op, int prio) return ENVL_NOWHERE; } } + +#if defined(CONFIG_SET_DFU_ALT_INFO) + +#define DFU_ALT_BUF_LEN SZ_1K + +void set_dfu_alt_info(char *interface, char *devstr) +{ + u8 multiboot; + int bootseq = 0; + + ALLOC_CACHE_ALIGN_BUFFER(char, buf, DFU_ALT_BUF_LEN); + + if (env_get("dfu_alt_info")) + return; + + memset(buf, 0, sizeof(buf)); + + multiboot = multi_boot(); + debug("Multiboot: %d\n", multiboot); + + switch (zynqmp_get_bootmode()) { + case EMMC_MODE: + case SD_MODE: + case SD1_LSHFT_MODE: + case SD_MODE1: + bootseq = mmc_get_env_dev(); + if (!multiboot) + snprintf(buf, DFU_ALT_BUF_LEN, + "mmc %d:1=boot.bin fat %d 1;" + "u-boot.itb fat %d 1", + bootseq, bootseq, bootseq); + else + snprintf(buf, DFU_ALT_BUF_LEN, + "mmc %d:1=boot%04d.bin fat %d 1;" + "u-boot.itb fat %d 1", + bootseq, multiboot, bootseq, bootseq); + break; + case QSPI_MODE_24BIT: + case QSPI_MODE_32BIT: + snprintf(buf, DFU_ALT_BUF_LEN, + "sf 0:0=boot.bin raw %x 0x1500000;" + "u-boot.itb raw 0x%x 0x500000", + multiboot * SZ_32K, CONFIG_SYS_SPI_U_BOOT_OFFS); + break; + default: + return; + } + + env_set("dfu_alt_info", buf); + puts("DFU alt info setting: done\n"); +} +#endif diff --git a/configs/xilinx_zynqmp_virt_defconfig b/configs/xilinx_zynqmp_virt_defconfig index 095260403d95..2b80292fb687 100644 --- a/configs/xilinx_zynqmp_virt_defconfig +++ b/configs/xilinx_zynqmp_virt_defconfig @@ -94,6 +94,7 @@ CONFIG_DFU_NAND=y CONFIG_DFU_RAM=y CONFIG_DFU_SF=y CONFIG_DFU_MTD=y +CONFIG_SET_DFU_ALT_INFO=y CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1800000 CONFIG_USB_FUNCTION_FASTBOOT=y CONFIG_FASTBOOT_FLASH=y