From patchwork Wed Oct 7 13:40:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1378008 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; 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.a=rsa-sha256 header.s=20150623 header.b=vNCConxD; 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 4C5wTf20mqz9sTm for ; Thu, 8 Oct 2020 00:41:10 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 00A0C82351; Wed, 7 Oct 2020 15:40:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (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="vNCConxD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 72CDD81BD2; Wed, 7 Oct 2020 15:40: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,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) (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 31AA281260 for ; Wed, 7 Oct 2020 15:40:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=monstr@monstr.eu Received: by mail-ej1-x643.google.com with SMTP id md26so2988172ejb.10 for ; Wed, 07 Oct 2020 06:40: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=HXYbqShHlMDTPX2GL/sHPUJOW/IyxR0qDCM3xkD0G9E=; b=vNCConxDY3Bl9pkMCKA+Qx7qwz+l20WIBwb+w2Ia2XhkMd/8IofxppEspycbMJ00UE XAzSB4PlBm6hl/E1jmOIsFYnEKapAvsU9Oz7+RmHPn6lhcAwtOj3VJnkx1FzHVrxyF4d 8OIDS2OKoph83edczHVdptnl8kyYSuvrH/D1qBNdn6STktdwNti/bDW/gn89OVrUnPcf vB1/EkIdGP5VYsT/JPvgySXGgKFkWapiwtKRZPYZbHUYxJhyDyBKFOC9ka40+oJDWh3o ZrSZPEUo/ihDUw87o3/lD2cLYW7E+PQhLdw6g/mpvtIckCKI38PI71GUbA+QHEzFq6qS Vn1g== 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=HXYbqShHlMDTPX2GL/sHPUJOW/IyxR0qDCM3xkD0G9E=; b=aPezbt45IIweYXVXq887YOsVSAeMZqQyUf6IiRz2HSoDNI4sx4539nDKyVjemN+2W8 EEz0l9Tbyrdpzye460QPJvYRNTr75uv8YS/YDxutvvtnkYw9qA8d3LVqsZMMXg81hmlV CkOWhGau3TSTpyjWH2sARX+xPGLjUVRJ45fTG+uN/W4bTcjTPmvASo2hwnAvVB34YSfx 3Y//HnRbc6+UhvCmWiidYh3PA0TMpvpZQAVZ5qo3yhARlTyZi+dDWLHUdbC7EmYXQMKS rOgWjRUAm6stCkZeBDaw73vmuvVerMLgDtrTXAv497yr2mDV9NgPTOCuaZj4z2ePFNbG Iufg== X-Gm-Message-State: AOAM530M3C5PL0Rh/5wiomz4B/Sgn7XfUvblanzvRg9hcnhC9SOEU5xS QtPGCxYQERQgd5VYOWtK/t5xfAta/PoIRQ== X-Google-Smtp-Source: ABdhPJy/3wWVm72HEWYL6e2iqPo4GvxUioYQx6alh42kNMewNEWfK4l0wtKVoQY1aWfuGO7g17i7dg== X-Received: by 2002:a17:906:1955:: with SMTP id b21mr3563894eje.42.1602078054545; Wed, 07 Oct 2020 06:40:54 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id u18sm1524994ejm.115.2020.10.07.06.40.53 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Oct 2020 06:40:54 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: Ibai Erkiaga , Luca Ceresoli , Rajan Vaja , Simon Glass Subject: [PATCH 1/4] firmware: zynqmp: Swap addr_hi/low when PM_FPGA_LOAD is called Date: Wed, 7 Oct 2020 15:40:45 +0200 Message-Id: <7fe9889b0e45ad68f8eb760ad0d13687aeb231e0.1602078045.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.28.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.102.3 at phobos.denx.de X-Virus-Status: Clean Don't know reason but in regular flow addr_hi/low are swapped in ATF. It means when fpga load is done from EL3 there is a need to swap it for PMUFW to load bitstream. Signed-off-by: Michal Simek Reviewed-by: Simon Glass --- drivers/firmware/firmware-zynqmp.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/firmware/firmware-zynqmp.c b/drivers/firmware/firmware-zynqmp.c index 7583f24a200d..d4dc856bafa4 100644 --- a/drivers/firmware/firmware-zynqmp.c +++ b/drivers/firmware/firmware-zynqmp.c @@ -165,6 +165,14 @@ int __maybe_unused xilinx_pm_request(u32 api_id, u32 arg0, u32 arg1, u32 arg2, */ u32 regs[] = {api_id, arg0, arg1, arg2, arg3}; + if (api_id == PM_FPGA_LOAD) { + /* Swap addr_hi/low because of incompatibility */ + u32 temp = regs[1]; + + regs[1] = regs[2]; + regs[2] = temp; + } + ipi_req(regs, PAYLOAD_ARG_CNT, ret_payload, PAYLOAD_ARG_CNT); #else return -EPERM; From patchwork Wed Oct 7 13:40:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1378009 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; 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.a=rsa-sha256 header.s=20150623 header.b=RJJVRKB8; 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 4C5wTr2Csqz9sTR for ; Thu, 8 Oct 2020 00:41:19 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2F3C782399; Wed, 7 Oct 2020 15:41:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (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="RJJVRKB8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4B76B8236F; Wed, 7 Oct 2020 15:40: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,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) (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 BE1B2806C5 for ; Wed, 7 Oct 2020 15:40:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=monstr@monstr.eu Received: by mail-ed1-x542.google.com with SMTP id g4so2247504edk.0 for ; Wed, 07 Oct 2020 06:40:56 -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=pAM+EHyIIKUxDbunqaUxfnmDJnku5IiOuD7eAJaBAbE=; b=RJJVRKB8dolmSqyynf79EeFcn5mrolCHMx6kq5zdLCBvKROFThSgIqY/GKcB+jwaDy fHyyQkQyg3ZtTMSRnocu5V0rAKa/0s1VJ/AusN14/EBCMMRVCOsnsODQ0gQBhJ7aN6sy LstnC3SfabC1gHxASW7Fe1jwdCqKcQenRS8q+yngSWoe0PbXbIvGPYAgtN27+CWgbz8V iW5I25D1m1SUvmbGUWfqYWWNGckXsYO6bA2qbWe+CJ2jqYyQmbcLBNX/qf2D6zqZLJAB zzCd1HKdKpT7rDKk4YKzFxneqy6A9bg5NgoALidtS4p7PCPSA64ccpc9oJqbWxWwL3l3 AeUQ== 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=pAM+EHyIIKUxDbunqaUxfnmDJnku5IiOuD7eAJaBAbE=; b=bx3sjDRNl02Z1gHJEIDvxmDkQPEnV/iZTnLZGXSAa6cbWF/odCp+iAttHAZgkJ56ZC XByCsLwgwU03Rqd9PiD3PFEFGi/XKKMcSUdx81t+GoLnup0rYmm5qQaOKHndBj7DcRWx RbWr0WPcJSdx4jOXn/bS2z5uI16/uoCnk2GmqN1U7iFOByHhwEeZVHrhPhJE8JdMS/U5 kpvwS0JJv09LDhEY0QX4Nl9l54dFaTpqszbUjFhfml09iGwNdlOUFXxSuGg3H42tRrjQ tisdQ+2bS2IJIJmk9M2TkcDv89ETcH2Y8rBMRj9p5vyl2N+9iAMIXcFiQfYuCKm03vXz 754g== X-Gm-Message-State: AOAM5309ocej903l/h694tz6UeBWbo/D27l7wVHpECbU+jRGoUtl6jud nU2um6ukmxOCUDYrrpvcWYTxWNzFAP8CaQ== X-Google-Smtp-Source: ABdhPJxpr1czfVvwtFtLSLTZ85M6fgkcazOoKvWkqIG+/ORrtPh7Wn7Ag/+aePBNMmX8WmDYSKNuPA== X-Received: by 2002:a50:fb13:: with SMTP id d19mr3728022edq.215.1602078056187; Wed, 07 Oct 2020 06:40:56 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id jr9sm1528906ejb.87.2020.10.07.06.40.55 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Oct 2020 06:40:55 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: Michal Simek Subject: [PATCH 2/4] mailbox: zynqmp: Extend timeout for getting observation bit Date: Wed, 7 Oct 2020 15:40:46 +0200 Message-Id: X-Mailer: git-send-email 2.28.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.102.3 at phobos.denx.de X-Virus-Status: Clean In case of fpga loading (which can be huge) 100ms is not enough. That's why extend timeout 10 times to wait maximum 1s to get ACK back. Signed-off-by: Michal Simek --- drivers/mailbox/zynqmp-ipi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mailbox/zynqmp-ipi.c b/drivers/mailbox/zynqmp-ipi.c index 9483ed9cefcf..847a03648b8a 100644 --- a/drivers/mailbox/zynqmp-ipi.c +++ b/drivers/mailbox/zynqmp-ipi.c @@ -56,7 +56,7 @@ static int zynqmp_ipi_send(struct mbox_chan *chan, const void *data) /* Wait until observation bit is cleared */ ret = wait_for_bit_le32(&ipi_int_apu->obs, IPI_BIT_MASK_PMU0, false, - 100, false); + 1000, false); debug("%s, send %ld bytes\n", __func__, msg->len); return ret; From patchwork Wed Oct 7 13:40:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1378010 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; 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.a=rsa-sha256 header.s=20150623 header.b=1euqb0EO; 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 4C5wV40Sxgz9sTm for ; Thu, 8 Oct 2020 00:41:31 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 15E558237E; Wed, 7 Oct 2020 15:41:04 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (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="1euqb0EO"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 069BD82396; Wed, 7 Oct 2020 15:41:01 +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,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) (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 8FE2182339 for ; Wed, 7 Oct 2020 15:40:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=monstr@monstr.eu Received: by mail-ed1-x541.google.com with SMTP id cq12so2231146edb.2 for ; Wed, 07 Oct 2020 06:40:58 -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 :mime-version:content-transfer-encoding; bh=4DPzxI30MPrzL3eLwk0oYjrdzwzTi8gKm1RSQBRYAWM=; b=1euqb0EObTRov5o18ehysG5FDNsQvNgpAx65U8Bk354kObhoetvbSj7XmLo4Utr+Ts HqB+kbd/J8c1G5I01Bs5WqzHaNIatJqTB0CcY/FT0s/h1dmBBLp7cSHYFpM+51zZJbHP QXuRG0v/fA6DhRoJpw9udyWQxnOz0mNAJ8h80LkH9rLE7MbBHfcdQ+GgT4+QI979Mar4 JeIQ+W7Bd7wIbIhd5IITUmuvTFcW//+euhn4DTL0Xys1XPzHybL+m1L0TGhBMMR0v/s/ rPt57SZLrculQW/+P6A11HuvsEsWry+uFmbnCvaMX4Y7vJCaKVsiBMUzPkbzXSUx3AQ4 E4tA== 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:mime-version:content-transfer-encoding; bh=4DPzxI30MPrzL3eLwk0oYjrdzwzTi8gKm1RSQBRYAWM=; b=NKXwNuhUHctJhjKcIc/qm9vgPH0NuKUt3vEieVyQPBJvdfq1P59WW3UU2ZcssukopK q1F93B7TepKI8DcsyHBzFEza8pSHIW6+onYSJ3ztMOlSOP8UVoE6mpVXt00+ouweSNU8 TqXgv37oJqJZJg65u3LvIl2o8yG8rf5aE9Y1s3C8OpvqKIySRyIbpsiiMRJ8YxS5ebLF 0o0XhfgbT5iKyXyz84UxIUZgyaY+Xu1PZYlannAKPrZU6pjXzb58BZd/RQuWWtCUOFFB 4UZmHdXmK7eDoOku2piW6pBl+rdCXjWDG167qxA9PRD9dQCL8m6TbcsXmGLWkFT/Cq+l IlCA== X-Gm-Message-State: AOAM531AukmC1Uk7V0XJ2HibsJHIVTx3uiiZA7mlL/DXF2ODORq3DSL3 QHism4LXDO7Mmd5etuzAqTAJuuzsnpvxZw== X-Google-Smtp-Source: ABdhPJxZH38c6hCtKehs0poMnvOF5RIUfOcTScBaB8n99e1I3hqfJfoH3Cb0fsfKifqsauivZc4kug== X-Received: by 2002:aa7:d504:: with SMTP id y4mr3698859edq.336.1602078057927; Wed, 07 Oct 2020 06:40:57 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id qq10sm1538127ejb.31.2020.10.07.06.40.57 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Oct 2020 06:40:57 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Subject: [PATCH 3/4] arm64: zynqmp: Get rid of simple_itoa and replace it by snprintf Date: Wed, 7 Oct 2020 15:40:47 +0200 Message-Id: X-Mailer: git-send-email 2.28.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.102.3 at phobos.denx.de X-Virus-Status: Clean simple_itoa() is implemented only for !CONFIG_USE_TINY_PRINTF. Tiny printf is normally used by SPL that's code which uses simple_itoa() has missing reference. That's why refactor code by using on snprintf() instead of strncpy()/strncat() combination. This change also descrease code size by saving 24B based on buildman. aarch64: (for 1/1 boards) all -22.0 rodata +2.0 text -24.0 xilinx_zynqmp_virt: all -22 rodata +2 text -24 u-boot: add: 0/0, grow: 0/-1 bytes: 0/-24 (-24) function old new delta board_init 520 496 -24 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 70d6fd422eb1..362c6e3dd6fb 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -190,6 +190,7 @@ static char *zynqmp_get_silicon_idcode_name(void) u32 idcode, idcode2; char name[ZYNQMP_VERSION_SIZE]; u32 ret_payload[PAYLOAD_ARG_CNT]; + int ret; xilinx_pm_request(PM_GET_CHIPID, 0, 0, 0, 0, ret_payload); @@ -216,8 +217,10 @@ static char *zynqmp_get_silicon_idcode_name(void) return "unknown"; /* Add device prefix to the name */ - strncpy(name, "zu", ZYNQMP_VERSION_SIZE); - strncat(&name[2], simple_itoa(zynqmp_devices[i].device), 2); + ret = snprintf(name, ZYNQMP_VERSION_SIZE, "zu%d", + zynqmp_devices[i].device); + if (ret <= 0) + return "unknown"; if (zynqmp_devices[i].variants & ZYNQMP_VARIANT_EV) { /* Devices with EV variant might be EG/CG/EV family */ From patchwork Wed Oct 7 13:40:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1378011 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; 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.a=rsa-sha256 header.s=20150623 header.b=bULt2Pl+; 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 4C5wVG4mg9z9sTm for ; Thu, 8 Oct 2020 00:41:42 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4B5408239B; Wed, 7 Oct 2020 15:41:06 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (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="bULt2Pl+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C441A823AD; Wed, 7 Oct 2020 15:41:02 +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,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) (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 0E4908236F for ; Wed, 7 Oct 2020 15:41:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=monstr@monstr.eu Received: by mail-ej1-x62c.google.com with SMTP id ly6so3003182ejb.8 for ; Wed, 07 Oct 2020 06:41:00 -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 :mime-version:content-transfer-encoding; bh=ORpgRpFvcRG8cweHPF+DK4GdnlLN2tE0rQdc3N+OBzg=; b=bULt2Pl+By0pI1zazWWRf94ju/lYFhx4eLYrxqbjfwuDNMmAz1wX2ZnhXAMnhCS8qZ i1VVbI+/Qsmad6cMYKT3RSA2tUkrt/X9V4cy9MD5ezgxPXrwe9KZm7aAqVYQpTToetbH 3CpD+FhGrWXU0PyUD90CUktDokwRTWp+mWUQQxuVX/VDbT/pUoHQD/0Gbbbwsdp4m1pu GZlG+miw2LX/XcPRVun1f2pd0MDVHfYTY7e4AAZ7OifA9Bo52S4Pw/FmTVObBZ3B536M kypm49CAX20tiwJ+E4XnVRFcELhELEyiQQpQ2Q8NlfHc7xvIVE4WnNPamAt0nr2OWPC3 nFeA== 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:mime-version:content-transfer-encoding; bh=ORpgRpFvcRG8cweHPF+DK4GdnlLN2tE0rQdc3N+OBzg=; b=IzY01nW74KJU4jVGmxGq0y+MXi90ynFZlogeAdqdxmlywBhzHIfOzGYHLE5nan4/Yf 5e+se9Ww2FiX0dLEnK8uv6+sm2pfR8Xc48d6BtGA3fKjwWpzTKjAvNfMKTMSDAOaKjFH 03qUDDWIlI3gPTjrpaJ3NL7wcsx2KGCIoXU+PGJ/0GF4sjV4bP5iE7xGKv8JuRE73Nlt iXo5fyzN2Xg6hGHjQ35CG5FRndk9sdCk76hY+7RXloBOrviTSz1tZsddDFzJgZnyS2TI o8ToifTgwuLUk2+GIsi7tsZxBdx4mWHIyzimAjuxx8I+n8Tq7BvNmeYP6tH+j2QFVBpv PcuQ== X-Gm-Message-State: AOAM53114YjHFk25ASKMSudPJb4vWNhuKWx/CoqnBQ7FnclnXG9B2h5Z HKt/ZDb1osvujcE6nfVDYtPpDylYI8s9ig== X-Google-Smtp-Source: ABdhPJw7P3AJnan5fyJRaiHwqRYa17AA8pAnTKM+HtkcHBBnslo0/shQyPKvk+fmOd6tecdIh+97xg== X-Received: by 2002:a17:906:1bea:: with SMTP id t10mr3361648ejg.305.1602078059483; Wed, 07 Oct 2020 06:40:59 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id q3sm1526616edv.17.2020.10.07.06.40.58 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Oct 2020 06:40:59 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Subject: [PATCH 4/4] arm64: zynqmp: Enable FPGA loading from SPL Date: Wed, 7 Oct 2020 15:40:48 +0200 Message-Id: <861a1c152b58b8c99bd56b083c13a138f10cfaeb.1602078045.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.28.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.102.3 at phobos.denx.de X-Virus-Status: Clean fpga bitstream needs to be listed in config node in FIT image. Only tested option is bitstream in BIN format. Enabling this feature increase code size by almost 4k. 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 c54ddffdd6f3..79a0091b1981 100644 --- a/configs/xilinx_zynqmp_virt_defconfig +++ b/configs/xilinx_zynqmp_virt_defconfig @@ -21,6 +21,7 @@ CONFIG_USE_PREBOOT=y # CONFIG_DISPLAY_CPUINFO is not set CONFIG_BOARD_EARLY_INIT_F=y CONFIG_BOARD_EARLY_INIT_R=y +CONFIG_SPL_FPGA=y CONFIG_SPL_OS_BOOT=y CONFIG_SPL_RAM_SUPPORT=y CONFIG_SPL_RAM_DEVICE=y