From patchwork Wed Jul 28 10:51:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1510797 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=1M7OBPI6; 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 4GZVpV4gJyz9sRR for ; Wed, 28 Jul 2021 20:51:46 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D12E882C89; Wed, 28 Jul 2021 12:51:42 +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="1M7OBPI6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 372CD82C60; Wed, 28 Jul 2021 12:51:30 +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-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) (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 5648482C4D for ; Wed, 28 Jul 2021 12:51:26 +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-ed1-x534.google.com with SMTP id x90so2555322ede.8 for ; Wed, 28 Jul 2021 03:51:26 -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=brvuin6zoPaRTiD2B1VntGR2SlojZC0XLlgRXJLbcMU=; b=1M7OBPI6N1varLPYps04t4ctU2C3/btmGkNCZObIN3BNYUYiv3X6eovjEZy0/ftQ+l U/LZu5PVSNxPZei8uTi2T3EOnMJzXL0qcUHRm5w0LR9o2g9gRMPAPF6A2c/vcR3pnKJ+ n6iw9hlMCRNc4IO1L9uGdF9eX2q0zIKixeBgB4VIVIeag9MnIoF1G4AYTkX0HcfuD6lm w8oOr0Frx2mzwrdGcxp7fK0sO4Yy/vNyp2j8mK/u3PDIdy+f51xyylD9xhBz5BUM/qIk 4kOgknQancCGfX6eIAjJs9EMnyRfEDXaK3E5uQvFkJNpzfocJfchrPdnmKFnFWgmoUGc PUFA== 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=brvuin6zoPaRTiD2B1VntGR2SlojZC0XLlgRXJLbcMU=; b=XyzR1KVHzPYkqlu3spyqS9X5tIiW2vNM+w8dSyclOtyM5veJ8fP/iKF2AStkBsZxyI OgltfQ/o4w95rNzf4aJ9yZs9CDQ+pgc9TA7pYl6XuedaNXsEMfDygFDz1Loi2F9LeRu2 onCx6mY6XpbguPbnZQOp8NMsgaySMkAHFN+acFBGrdUCqhH/jD7hfcp3IITYDsm3ArqY 7Q6HwZXVpdOHPipysG0FWRLZTEaRynWUc0MmgctmZSrFOIUNNV7jJZRL9f7uf6olPxxM oesj/P7SD3gXVsi74zoyF8iwXQDFt4AMT2SLjyNna+NncyORa5Z4VgM5/WgXxKVmCwxr Rzww== X-Gm-Message-State: AOAM531h01LD1Bqczrc18vVxAL1UDlzEytKoHFA90FPrJY/K/OegoL5g D5MxPKhihkNKmio8AvbCLXLCYimkvNb/33/+ X-Google-Smtp-Source: ABdhPJx0sWKV0vIXD0TEVIK/Q4KiEDQnTdizBhv1bh8w1HfNSEEeCjj0EnQbkxzRVRjoleRhf8bFPw== X-Received: by 2002:aa7:cd92:: with SMTP id x18mr26385964edv.325.1627469485841; Wed, 28 Jul 2021 03:51:25 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6:f666:9af6:3fed:e53b]) by smtp.gmail.com with ESMTPSA id kf3sm1906035ejc.118.2021.07.28.03.51.25 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Jul 2021 03:51:25 -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 1/4] xilinx: zynqmp: Change multi_boot() to return value Date: Wed, 28 Jul 2021 12:51:20 +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 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 --- 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 Wed Jul 28 10:51:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1510798 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=REa5p798; 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 4GZVph0nJhz9sRR for ; Wed, 28 Jul 2021 20:51:56 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CB70482C5D; Wed, 28 Jul 2021 12:51:46 +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="REa5p798"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 44FA182C7F; Wed, 28 Jul 2021 12:51:31 +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-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) (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 CC20D82C5D for ; Wed, 28 Jul 2021 12:51:27 +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-ej1-x62a.google.com with SMTP id gs8so3790306ejc.13 for ; Wed, 28 Jul 2021 03:51:27 -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=HSq/oUCTdTgSbB8u5Do85X+fkK1ciBJaA4TcKEA7zYg=; b=REa5p798JY9nVCrO6PYq5WW/wrW8dB3xcAb/pFQ60CJ6RDmenJvN+t9jVDVIwc+Vif TgQspQOnd99t+0kKvfgxFeqQDN1CIjGfr5lmXEjk7b2LSZyMCGm5DcyZGW1AxP7R6emR GGNITXTRyxOgL9nrnfnijPI5+GQ+TwBatu1NiQfvEf9+dJ9stxPR3BtqsCubRr7Wsf4M Z/9y7Mso2DQm7zyWQPcIAzAgGgzwhFt6hwJumvqag67/i7CGHmWYHgdwvYyt0kXEvhb5 8jbvfQ+dUqh9SybHtpQ7rT+JKYsE7sAIHH111Cx3/C4ox7dW4t1hyagmz/4pxuYnUMM5 TNVw== 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=HSq/oUCTdTgSbB8u5Do85X+fkK1ciBJaA4TcKEA7zYg=; b=accANiwsC4RpCn7/sAjOKtyIE7J2Xz7OnLO5ZEWI9SEkn1NY/g1ZYlwiqHKVd7LrZC JTQKFOH4k/IVxyRAb7iomEpBn+FIXWkNyO3/TX0WlEJZA2xyFeiCZhx1OHFWvyZsczea s6g4LQZ0e7E1ZpxkXCVaRxv6lgEcD9wnBjdDzCcG25GTE8jKJdls9dalYqTkFP4wCPb+ WXu14j0mz4bwN/NnUTMnpb1k9w+HwDTR/z/wnN08zdVIA9zeHai3YTfCprxk5tlix+IJ s1viqe+7h13JQZfZOYopTpW/lQOU6gCSlNCBGcLYvkXnnTRmBuAEdGJKH+VsxFePw1QI 5xaQ== X-Gm-Message-State: AOAM532vzKioWxsca25tMc0lOSRfUD9RkWMW+AR1isSeLdLhHyOOxyUZ M/P2WeJO9XKcxUALvhsv5d2rpPw/7Cf/cvXv X-Google-Smtp-Source: ABdhPJwTkYcDJ/k2KSHrf/yroYVhBXaDG88LQHURHcNym+kCE9BahOG0IFfMr0hlb+AEP+NYbDSm+Q== X-Received: by 2002:a17:906:5d05:: with SMTP id g5mr17186640ejt.277.1627469487270; Wed, 28 Jul 2021 03:51:27 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6:f666:9af6:3fed:e53b]) by smtp.gmail.com with ESMTPSA id yc29sm546970ejb.104.2021.07.28.03.51.26 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Jul 2021 03:51:27 -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 2/4] xilinx: zynqmp: use zynqmp_mmio_read() in multi_boot() Date: Wed, 28 Jul 2021 12:51:21 +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 --- 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 Wed Jul 28 10:51:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1510799 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=RablRB1F; 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 4GZVpv4B6qz9sS8 for ; Wed, 28 Jul 2021 20:52:07 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8383382CF1; Wed, 28 Jul 2021 12:51:52 +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="RablRB1F"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D176382C84; Wed, 28 Jul 2021 12:51:33 +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-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) (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 4C38882956 for ; Wed, 28 Jul 2021 12:51:29 +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-ej1-x62d.google.com with SMTP id o5so3898778ejy.2 for ; Wed, 28 Jul 2021 03:51:29 -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=8C4uq38/ADiTWXCIe5fJ8xAhNTln9/2cS/zd6Osefpw=; b=RablRB1FAsvTksAEJOKflxDo4ZndncqRM6pe1nF4TTAQ5FXOwMfufsVUGGopR6jRm5 cIr0WCUZqdx6yF9L0njJuhpq3HNN8zSD4Z8l4FTOjdQK9v2bNQKhYW317WAf+3uju27a zb5TOJ3w3q1zGoMCGfX8zuvmCpnRFSrU5gwqKvHFmAmPPg7ByQZi4J4pbSy78xYfxxu0 nz3QYbFrbKsr5DipGZSNHHdiLHnKglKTlEQOV9p3m5ui2HVIk2GhroZdWgdH8+8nj245 afzrzorVxGiJGOp2AntdIsIZRbmCz2eGmjSARGFZ703uCPoh5r0TGe8KBFzts3MON0AX G5Zg== 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=8C4uq38/ADiTWXCIe5fJ8xAhNTln9/2cS/zd6Osefpw=; b=kxK0hFWHtDSGZQmL/2PENjykei3VSOutiZdRrhiAPOlZotK5d/Wq+8x9HewYTfKCVr /Y+fupZ3P1ISnpvhQAjB7Jf7jzHaE+1m81IPhO22eQj0QvorEUO/TdPJCMLRqmhiygRv MsgiIYX0ABK6CYuck4HnXxM/jVkdb01pwRxkvXk9F4ETkmzhSfvrl/dSI6txgcQKkYnR fWiKVBsUIv8np20VAytmtHd/jgSRx5iA2H/Mu/pEW8QcRQzg0fmxKRJ/pk0MUR77iHXy uK0IcGwgLuPN4mIDqwVJf1p4Lwi/tRpZtQwIHLcimeij2Hu7AGoPu36WPjNlCrUc2ZpP fkog== X-Gm-Message-State: AOAM530yE1JwVW48VNg206sLasMPSQWvQ8X6hqzG09etEjLVCWFV669x 5Qf/UpMIjdoK5irra6p+wtJ9oW1+TJIOD2tw X-Google-Smtp-Source: ABdhPJyH3RtxHg15LEBRYuyY+I4aWXr3WAg9r34qimathmmYmM1XqpcDuH/SBaz5FF23ePKPB6W7bQ== X-Received: by 2002:a17:907:1c08:: with SMTP id nc8mr12525360ejc.514.1627469488761; Wed, 28 Jul 2021 03:51:28 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6:f666:9af6:3fed:e53b]) by smtp.gmail.com with ESMTPSA id s24sm1936071ejd.19.2021.07.28.03.51.28 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Jul 2021 03:51:28 -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 3/4] xilinx: zynqmp: Config non zero SYS_SPI_U_BOOT_OFFS Date: Wed, 28 Jul 2021 12:51:22 +0200 Message-Id: <0dc5d50db21597018fd6504372eaffb0402c5110.1627469480.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 --- 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 fa6a7f1de6ee..6f72a9f50ed3 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 Wed Jul 28 10:51:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1510801 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=EW2phqsL; 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 4GZVq55kntz9sRR for ; Wed, 28 Jul 2021 20:52:17 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C2EF082D58; Wed, 28 Jul 2021 12:51:58 +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="EW2phqsL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 42B8982C7F; Wed, 28 Jul 2021 12:51:37 +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-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) (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 D864E82C64 for ; Wed, 28 Jul 2021 12:51:30 +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-ej1-x62b.google.com with SMTP id nb11so3882971ejc.4 for ; Wed, 28 Jul 2021 03:51:30 -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=D5SQgR7bey0vMCifLb+rEooi3Lf81ZOUF9Kj+FuUlHE=; b=EW2phqsLbGgLAcyA6mp2RT/f2NdrK2mtUkIhAaeBZPpHUXaU1JakJVSLq8qyRh+sn+ lpa39AzdWVvXEGBVBiADx5QMv8HmCrTmhV066irjODmFfKmg9JvpHyVVkPfEPjHAaP6j Ya/RljhdivT0ss8pmwRXsvs6ls+8+cyTcv6rgifQZ6TmrCKpyz04rciGMoF7EYnfI54L W9A1hCVNA/VcKUMY4XOEpV1YXobumSPni6OL3A3yU3ocl7CEBfFex9XjGcXEwogGFm4c edEkgyQhCqyNG70ZCMTEfbShVKwdb4n4nK6o/Feb4PGCcwv3vt95PzW9nsPxSv2yZwDi 3QSw== 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=D5SQgR7bey0vMCifLb+rEooi3Lf81ZOUF9Kj+FuUlHE=; b=JZhFvHVcY9WbhsrdR0EijRHypk5EqfEQMN8gsgno2RlVqlT1Jgezs132c/ikJhcheD A36gL8d//qioKb0Sd287nzBOORW+eNPwkOuLv48RRu/KuOwvEs5sDGvplVG1bWceftS4 gD3o58yVLSgxRGp8XY46H4g3A/wvhV5an/sULuoIOYVLYEj2fwcnre8aYyiUozdUgclt /8xc/entsYfHeni5A5WitIYSkVRdsn6ldSxrHoOSQwpQez3I6wkmpoaFBM84vTJF5pjD rcBc4zOx5ryPJU5XGTvBJ/J7x+n4Z4zchMYCzcaDDwxv0ib6vS13O2at1hJElUUoH566 rOtQ== X-Gm-Message-State: AOAM5331W5df0HMdNan7RhOWpwD2UEDhSEAFSXIn5dXiI4OzF9LmgZ8e 6Qzkz/crhL4o5OERi2m34n6irBTnwwfA0ayJ X-Google-Smtp-Source: ABdhPJyAv31ifGLJEHpTRs/57m0c1HWH8lhkVXLX8Pk6CTTllbCLcnl41PKEWugXWnb+HPs5WLvyCA== X-Received: by 2002:a17:907:2058:: with SMTP id pg24mr21289829ejb.315.1627469490312; Wed, 28 Jul 2021 03:51:30 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6:f666:9af6:3fed:e53b]) by smtp.gmail.com with ESMTPSA id e13sm1906667ejz.79.2021.07.28.03.51.29 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Jul 2021 03:51:29 -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 4/4] xilinx: zynqmp: Add support for runtime dfu_alt_info setup Date: Wed, 28 Jul 2021 12:51:23 +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 --- board/xilinx/zynqmp/zynqmp.c | 56 ++++++++++++++++++++++++++++ configs/xilinx_zynqmp_virt_defconfig | 1 + 2 files changed, 57 insertions(+) diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index 1b0356c84c5c..f9390fbb3957 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,57 @@ 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: + goto end; + } + + env_set("dfu_alt_info", buf); + puts("DFU alt info setting: done\n"); +end: + free(buf); +} +#endif diff --git a/configs/xilinx_zynqmp_virt_defconfig b/configs/xilinx_zynqmp_virt_defconfig index 6f72a9f50ed3..02e165f3b2bc 100644 --- a/configs/xilinx_zynqmp_virt_defconfig +++ b/configs/xilinx_zynqmp_virt_defconfig @@ -96,6 +96,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