From patchwork Wed Oct 21 10:29:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1385482 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=L1msJ8vz; 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 4CGRb11QP9z9sSC for ; Wed, 21 Oct 2020 21:30:21 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 26B1282426; Wed, 21 Oct 2020 12:29:49 +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="L1msJ8vz"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F2707823FC; Wed, 21 Oct 2020 12:29: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,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) (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 7433281B79 for ; Wed, 21 Oct 2020 12:29:31 +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-x52e.google.com with SMTP id l16so2058292eds.3 for ; Wed, 21 Oct 2020 03:29:31 -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=uqkRv2uTrRQb6Ka5VW2cdHZASwkrxm0KgmY73AGpYFE=; b=L1msJ8vzqIiyHn04JSNdcBHHuk1Z9+TyLE7gPZbX6OkZfubFioSOaDkhFMrwLRphiC u3Avg6a70HbSAvWJfz5/mgDv2jDeFtU52qDrGlTPciG3XoeXpf7fDpMCNaV83GvBKldE cArco6xwHt6XV6ip36GiNb8zwEL8wzkvOArL8F6ny8Tl9L4ElSuF/0gzYVb3lNTisffJ Wsbn9oXugo9F7Af8l07wHNvusdCyTNJLnR4+KXYlz+Df46VqHB0C6HqDbd2uencqqVTu iF9j1oJrUcfxU1l1kiQ242Vp7eRBd+/s0gGMp/02lvB9/4ERxFCI8tB2bfIXCoMhrC8b 49Wg== 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=uqkRv2uTrRQb6Ka5VW2cdHZASwkrxm0KgmY73AGpYFE=; b=nMG7LR86UF29IobsIq5nc3Dag263zhkGjiOWpjLDkv932f10n+LtHYvK+beOFPefxm okGPVgYgUeDZ2Tr20xoAxmFPreZYgV/pt1n4Y9Wx5Vj/KHZ9n+rp+luj4ROcn9g5SNYB /tsMV1SWu//ds7B5x2IK+3m34nNiy9U090ZGeT7lYTGUVxVe/uDBB2Jw358FGutKSf93 e0q538m9WCBz9lG6o9jc0KFy3l1pAjLyxKBuUKDqy/ySAphD4OJ2W51eQI0bQdgmnB3l upW42sXVcN4M6mXC3LOXmijC97w0ywCau8LrI7aqqAKRZkI+3ZikAKBqCdHVKfL/9Y1k ByPg== X-Gm-Message-State: AOAM5308RV7gCH+sBuMf7+LVTDd3Vo6L+3KYBQjUFRExwsbdXLtvxXjj tfol35JZ2qCXdy6IRfyhsNYK3wawEsVRqhDX X-Google-Smtp-Source: ABdhPJyp/n+zN/1traWyQxOCsW1oGT9rzBs2g/c+CaxVvtNYtYpVJTIzQwxCYdnZv3+pXqH91LKwzA== X-Received: by 2002:a50:a454:: with SMTP id v20mr2319282edb.98.1603276166058; Wed, 21 Oct 2020 03:29:26 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id o11sm2046024ejd.60.2020.10.21.03.29.25 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Oct 2020 03:29:25 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Subject: [PATCH 1/4] xilinx: zynqmp: Check return value from xilinx_pm_request() Date: Wed, 21 Oct 2020 12:29:16 +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 xilinx_pm_request() can failed that's why also check return value. Fixes: 050f10f103cd ("xilinx: zynqmp: remove chip_id function") Signed-off-by: Michal Simek --- board/xilinx/zynqmp/zynqmp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index db3f5978a928..e65824540809 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -192,7 +192,11 @@ static char *zynqmp_get_silicon_idcode_name(void) u32 ret_payload[PAYLOAD_ARG_CNT]; int ret; - xilinx_pm_request(PM_GET_CHIPID, 0, 0, 0, 0, ret_payload); + ret = xilinx_pm_request(PM_GET_CHIPID, 0, 0, 0, 0, ret_payload); + if (ret) { + debug("%s: Getting chipid failed\n", __func__); + return "unknown"; + } /* * Firmware returns: From patchwork Wed Oct 21 10:29:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1385480 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=TynvZqNx; 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 4CGRZJ4ktTz9sPB for ; Wed, 21 Oct 2020 21:29:44 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B2486823DD; Wed, 21 Oct 2020 12:29:37 +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="TynvZqNx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 409F781B79; Wed, 21 Oct 2020 12:29: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,URIBL_BLOCKED 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 7841A81B79 for ; Wed, 21 Oct 2020 12:29:28 +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-x62d.google.com with SMTP id qp15so2454136ejb.3 for ; Wed, 21 Oct 2020 03:29:28 -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=ZS4Lrncs5gN/INns5hBByiqihtxYzGHWxlk5GP2M9WA=; b=TynvZqNx71qRKcfBwiDSy/ALFOwoPlaxYu8MglYjv06XeGUX4sEeXBWzjtTjkWDfHC o8EaHAVCZLlZmUdbZ5Mizbi2d2Xw9fOALDc4hFIiNXonDt4hWAc3AAuPZ8FFWgRM9AWj /ZQuoYQr2HFtIanVUO+Qe38ayivSzGJWSd5pDECado0aLfLYPxJKJaTYCuas7DtjBptU MKSdziSniLyDtpNUFe1ZtQhCO9iRt2Jfa4yxx5Fjmz3sAuhvo2i9RpElc5+X93MFFb/D jCGXprcrU8loBY9CcdEW2Ac7G4ABbse9B2iNCMeUhXno6f4toGSzxtTWTRi0YgpBctdS 2X1A== 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=ZS4Lrncs5gN/INns5hBByiqihtxYzGHWxlk5GP2M9WA=; b=Cfua1Ir9aW4vdkxh8+Uw+xYx2conH02s2CizSu9D4Kaxymj7LZvDnKQPGv/9ewEa+f mH7V66sLWt820h45JFHTgFN8a/UMC4xCF/ml8aGUpZn6UR3pKOKI8MKjkqW5aItd1nxs zvb5LmdWJHperwJLvjn5Z2+p4cWxXqDMpBPMG+ezeBkwCQ9l8V35NRobNwxzAqR4Isxq iTjpp5rqUyziBoeagbnB1TkgsyI2caXgrg8399KEnzqi+6Cw+jUWNXpM1kK/tqh4FcIu Da+v8MqKi7URWKmMS6vpx5D56lx4Oq1qBbhWJRwfz0h3Wmw1V6CkTAnGnyfxIJbBaAEJ 4hxA== X-Gm-Message-State: AOAM531npJgd4ZtgDdTMer72AGDCGzueAC+qUzF9acn/9WvOr3BLpa1/ xuC5SVmLyzy8Ng7zyNdlsDRdxiCy/jiJdqg3 X-Google-Smtp-Source: ABdhPJzY3v77I6FNloTpbRpo479o2XIfbF57zrhAZAzO55RWeC5tGb55NwmPpyGxiekDohPehvaVhQ== X-Received: by 2002:a17:906:3150:: with SMTP id e16mr2747444eje.266.1603276167857; Wed, 21 Oct 2020 03:29:27 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id si13sm2082722ejb.49.2020.10.21.03.29.27 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Oct 2020 03:29:27 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Subject: [PATCH 2/4] xilinx: zynqmp: Fix debug message in zynqmp_get_silicon_idcode_name() Date: Wed, 21 Oct 2020 12:29:17 +0200 Message-Id: <3f756ad6f03786ad7a206ef9a8c4378d3f8bc7e0.1603276156.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 Fix hex format from 0x%0X to 0x%0x to show correct numbers. Fixes: fa793165daf7 ("xilinx: zynqmp: refactor silicon name function") Signed-off-by: Michal Simek --- board/xilinx/zynqmp/zynqmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index e65824540809..7ba2c789751e 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -209,7 +209,7 @@ static char *zynqmp_get_silicon_idcode_name(void) idcode = ret_payload[1]; idcode2 = ret_payload[2] >> ZYNQMP_CSU_VERSION_EMPTY_SHIFT; - debug("%s, IDCODE: 0x%0X, IDCODE2: 0x%0X\r\n", __func__, idcode, + debug("%s, IDCODE: 0x%0x, IDCODE2: 0x%0x\r\n", __func__, idcode, idcode2); for (i = 0; i < ARRAY_SIZE(zynqmp_devices); i++) { From patchwork Wed Oct 21 10:29:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1385484 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=S5WltRtj; 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 4CGRbg1js4z9sPB for ; Wed, 21 Oct 2020 21:30:55 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B350B82442; Wed, 21 Oct 2020 12:29:52 +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="S5WltRtj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B7ACE823FC; Wed, 21 Oct 2020 12:29:43 +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-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) (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 0528281F7C for ; Wed, 21 Oct 2020 12:29:30 +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-x642.google.com with SMTP id z5so2426505ejw.7 for ; Wed, 21 Oct 2020 03:29: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:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Aui9rAc0y/0pNsT3wxG6R4eGG5oX6rX7EPFwPDFMwxY=; b=S5WltRtjTBIixGKtr9tpeNwKTt6Z4qCciWFlwEXezo5TpFA/cJCcUfBAd6vymSC3Zt N/jhw2eh0leRBF/qNtDDDUHOqLPxphpaxc7VGHWRli+WLnvJXNH0pG+pxyRSFOMOG3KK ut6tLABq3on3tiLcbZf1mW7RhY9RT5IUR5l9oBoDnKCeqVr0fAbvNUKXvtQnGeaqbkk+ EH/PSQusIMyP8xwdahbd3lwEM6ix8KeArtCehTlaHYUGqnArAy6QmpYiC0BOorjB9S3Q cBqQq1A60br1PFYyrF7QhcjoRZVlOFm1x3gPBsps9R+u61bMWBgpRlHY/q51j9F8taG1 zyoQ== 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=Aui9rAc0y/0pNsT3wxG6R4eGG5oX6rX7EPFwPDFMwxY=; b=rh5DN6Q4zCeuorybtW0J1ZwzvD86PhEvAVWAeAY4gYRBvrWDYYCIh+1jqJg689V55y S/gRVLpo6cSkNVAVXDOBt888UZ4T5RZuIC1UfPwCJtDQCdIdwWjUTDExgpu99Y0QTs3I 4QpPphohiVtiwzqU3QFjRyOa0AMDOPOBWaxt4J/kJZpNUywNSq1HyOa+N2ub1aTe+k54 aPHKc3CBGyzkBcN8YrzFjAAeKgIOToQmQ92XOpmjo+IuQEA9/tLQ/VOqf6s1qlizGQdU ixMK4mozSD5MfyGYBPGrm7tWUtMv0J5tJUC/fJ86npryG635sAnTfqVRJd4MSjvsVpke pHDg== X-Gm-Message-State: AOAM532OfP/pcnw+uB37QHyiht3GaEZ8X/lroaQfm2gbY9FseYlKruen 0R7OKf8uLeB6BB9A1qweRhSF8UGIX2yclPyz X-Google-Smtp-Source: ABdhPJy0D1iPz5GE9etVwJ4vsrPrQ+p0LLxv9xOYGfsDmxq5fC30HuQQ4h29XmR4mFmL2XBgu5k+0Q== X-Received: by 2002:a17:907:2677:: with SMTP id ci23mr2728633ejc.270.1603276169436; Wed, 21 Oct 2020 03:29:29 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id q3sm1870700edv.17.2020.10.21.03.29.28 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Oct 2020 03:29:28 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Subject: [PATCH 3/4] xilinx: zynqmp: Do not check 0 as invalid return from snprintf Date: Wed, 21 Oct 2020 12:29:18 +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 U-Boot SPL on ZynqMP is using CONFIG_SPL_USE_TINY_PRINTF which doesn't return any return value and all the time returns 0. That's why even correct snprintf was returning in SPL chip ID as "unknown". Change checking condition and allow snprintf to return 0 which is according manual patch successful return. "If an output error is encountered, a negative value is returned." Fixes: 43a138956f7e ("arm64: zynqmp: Get rid of simple_itoa and replace it by snprintf") Signed-off-by: Michal Simek --- board/xilinx/zynqmp/zynqmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index 7ba2c789751e..c4f24982843e 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -223,7 +223,7 @@ static char *zynqmp_get_silicon_idcode_name(void) /* Add device prefix to the name */ ret = snprintf(name, ZYNQMP_VERSION_SIZE, "zu%d", zynqmp_devices[i].device); - if (ret <= 0) + if (ret < 0) return "unknown"; if (zynqmp_devices[i].variants & ZYNQMP_VARIANT_EV) { From patchwork Wed Oct 21 10:29:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1385483 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=h1pCEmfG; 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 4CGRbQ6F7Vz9sSC for ; Wed, 21 Oct 2020 21:30:42 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0224E8243C; Wed, 21 Oct 2020 12:29:51 +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="h1pCEmfG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E96B5823FC; Wed, 21 Oct 2020 12:29:38 +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-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) (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 49BF282287 for ; Wed, 21 Oct 2020 12:29:31 +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-x642.google.com with SMTP id lw21so2440564ejb.6 for ; Wed, 21 Oct 2020 03:29:31 -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=rgHiUdXVGLPgyIExUBAlhTKbKtMZszf4JcaIygPLu5U=; b=h1pCEmfGaZRqa0SUNK0mnljCx41Efob7r+Tl7L0upypTB+3nuYQIKpX7BvXhf6m01Q BMpfz2DXA1EKJw9cI5LrXk8akU57QzOT7H8ysVYBCd5kE59rVcKAgmX3IbxMk0qsz7uM krPPgSpYDSs8nsHJ3fYlaull361Oi+Cf6DIB24ptlkPRW8A5OT0hDZGUvmfM68YJbjeC cdgntp+OZveYjZAdMeLQaydfZMjtUj6NQptMzkthiywysBVDfYJjTvHQIuuHzMd3q10D 1tHQ4DF65tNZQFdFlQQqSlJhFjV/Z5C16vXHd350eDwdEmB1UsPEY/dU2iHv7xyReh6/ X5pw== 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=rgHiUdXVGLPgyIExUBAlhTKbKtMZszf4JcaIygPLu5U=; b=B46VqxHSJbVpf1lP9YBqhGCJ/Je0ZkPsVm+KIeC9UbXerhMSqmCkcivkUY7H6ABfdV CPzYEJig7aturqQ/ZsQ4VudiBaVLeYWzwVRq3Ra9ExuEZBj9hKeoxLEwJt1Nd2CXMF29 lSClicviH013ZGTX5/k2OG+dI9kEyOODtnCjtSgbCxD7Whx2cbJVqN4eh7YmBbk0fINO xjjl9Qglht0/33UlKev7p34f+/47IrP+YSSsF9qzDV25pNVnfzw6hkEVPU4iWplubHJr Etw3Nw3x0m9nsFrinEZ8Q2v4Nt6/SCkXAr9hfb3N/cpiLB9wulzKo/4KWPv94vafiukk SiNQ== X-Gm-Message-State: AOAM530/n2vcjWrlIunmu4R23D7W3Uxvb3gbVpqCs1hzLjVwSx5wcSOw KCOPqX5gj+NlA/8Vhz3DyQIV+wmdvP5ZJpHi X-Google-Smtp-Source: ABdhPJx0N9xauj8gK+iexInKuLyOEbpp1trNztYa/i0qPRLGkhCM7g9GApxEh5Dz8w7S6DPWxC2oaQ== X-Received: by 2002:a17:906:b24c:: with SMTP id ce12mr2291214ejb.386.1603276171005; Wed, 21 Oct 2020 03:29:31 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id c17sm1869397edv.19.2020.10.21.03.29.30 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Oct 2020 03:29:30 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Subject: [PATCH 4/4] xilinx: zynqmp: Use tab for macro indentation Date: Wed, 21 Oct 2020 12:29:19 +0200 Message-Id: <2e80d71294424871193cfbf3a7ca3438e697a94c.1603276156.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 Trivial fix. Fixes: fa793165daf7 ("xilinx: zynqmp: refactor silicon name function") Signed-off-by: Michal Simek --- board/xilinx/zynqmp/zynqmp.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index c4f24982843e..731285a73674 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -40,12 +40,12 @@ #include "pm_cfg_obj.h" #define ZYNQMP_VERSION_SIZE 7 -#define EFUSE_VCU_DIS_MASK 0x100 -#define EFUSE_VCU_DIS_SHIFT 8 -#define EFUSE_GPU_DIS_MASK 0x20 -#define EFUSE_GPU_DIS_SHIFT 5 -#define IDCODE2_PL_INIT_MASK 0x200 -#define IDCODE2_PL_INIT_SHIFT 9 +#define EFUSE_VCU_DIS_MASK 0x100 +#define EFUSE_VCU_DIS_SHIFT 8 +#define EFUSE_GPU_DIS_MASK 0x20 +#define EFUSE_GPU_DIS_SHIFT 5 +#define IDCODE2_PL_INIT_MASK 0x200 +#define IDCODE2_PL_INIT_SHIFT 9 DECLARE_GLOBAL_DATA_PTR;