From patchwork Wed May 19 08:44:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1480771 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=r1XeX0o7; 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) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FlRJw0LbVz9sV5 for ; Wed, 19 May 2021 18:45:17 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 055F282CB6; Wed, 19 May 2021 10:45:09 +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="r1XeX0o7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ECF0782CDE; Wed, 19 May 2021 10:45:06 +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-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) (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 3B29082CB6 for ; Wed, 19 May 2021 10:45:03 +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-x436.google.com with SMTP id c14so11291772wrx.3 for ; Wed, 19 May 2021 01:45:03 -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:mime-version :content-transfer-encoding; bh=Er3OkzIp3k5o3o62qouZ2wePOD5RDA0pbm6V9jNcvTI=; b=r1XeX0o7uXQqSbfHddm/chPuPZqhsfZb4DYm1JXypu7N4hkbb22Ck9prBYRejQbd+L lHMA6QaQSZCsoJ9rSiPDtgVtm94vGvbl0C6IQHf575pc6qPn7wjkbUM5Y06JmgzpKxTB wAreq3r+7JdVSr/LiUhjDHFccjyQseHmBIcPmdpl0o1CNOaTEYWyewBJMjWqsHILjz51 3UgXKgZClovX3g1GtyXu1cG8C2b6Gt5uu9/Z+OZAMbngQ0cS0eZCIfWnB3Cs2iVidAkI PZWsNNj7tLd0uOJTnt9O3EriyO537uJFAxjf6RHGbr4VEE6QE07KXbdZL3JuUUKuyDHZ tppw== 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 :mime-version:content-transfer-encoding; bh=Er3OkzIp3k5o3o62qouZ2wePOD5RDA0pbm6V9jNcvTI=; b=uPGvVu/l+fNO9hZCVRPMFD4esxxuITx8GuCKaRW/5zTFjComlmNYC3pjxG41Ha2vd9 iQVXwAwlQcDvpmC3JTVjzJXZ1+PPM4QvUt2X3mTj3goBnf1Z+oTYsJo6QjHN3Ky7SpcX kLAM942hxqhm6q83v/DElokUHH8dbbgCIOk+O4qc0E2d/RkO5DdqcjqyjcaQuJdTSq5h X/eo2mAi9tXeZBtijITuAoExaNXS378ilL2D2scJNQnSIdO0ObGuAa1p2tNdq3O+fvKP qJhm6OdCdcBi5g6EtJxSMOpb/FoH00k/JxE4A3QPXgfCvIbJq3CFEXyC0h8KibZFh6M5 I0Ag== X-Gm-Message-State: AOAM530MRqSHj7xJI4N4CvsU9gdbMpda86/21ewbbEIQ3zSM0rDngyTL U8MuRn1k0v00GrPYmyJ6Z3sYkSCDrD2mgoBy X-Google-Smtp-Source: ABdhPJwpO1bEi0FvkRw40uovb525PWJWHZvbpxYm41NC8m3NLMOwEUHBLuuiyR0ESCedOtR3i/RLNw== X-Received: by 2002:a5d:5508:: with SMTP id b8mr12719437wrv.278.1621413902509; Wed, 19 May 2021 01:45:02 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6:f666:9af6:3fed:e53b]) by smtp.gmail.com with ESMTPSA id z18sm5890385wro.33.2021.05.19.01.45.02 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 May 2021 01:45:02 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Subject: [PATCH] arm64: zynqmp: Add support for SVD devices Date: Wed, 19 May 2021 10:44:57 +0200 Message-Id: <606cc8f52ac42b3030cc3675ec75f9374ca74932.1621413896.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.31.1 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.4 at phobos.denx.de X-Virus-Status: Clean SVD (Software Virtual Devices) are using different name which can't be handled via zynqmp_devices structure. That's why introduce zynqmp_detect_svd_name() which checks ID code for these devices and show proper name for them. Signed-off-by: Michal Simek --- board/xilinx/zynqmp/zynqmp.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index d05f0b2e1202..6e353e3b0a57 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -185,6 +185,32 @@ static const struct { }, }; +static const struct { + u32 id; + char *name; +} zynqmp_svd_devices[] = { + { + .id = 0x04714093, + .name = "xck24" + }, + { + .id = 0x04724093, + .name = "xck26", + }, +}; + +static char *zynqmp_detect_svd_name(u32 idcode) +{ + u32 i; + + for (i = 0; i < ARRAY_SIZE(zynqmp_svd_devices); i++) { + if (zynqmp_svd_devices[i].id == (idcode & 0x0FFFFFFF)) + return zynqmp_svd_devices[i].name; + } + + return "unknown"; +} + static char *zynqmp_get_silicon_idcode_name(void) { u32 i; @@ -219,7 +245,7 @@ static char *zynqmp_get_silicon_idcode_name(void) } if (i >= ARRAY_SIZE(zynqmp_devices)) - return "unknown"; + return zynqmp_detect_svd_name(idcode); /* Add device prefix to the name */ ret = snprintf(name, ZYNQMP_VERSION_SIZE, "zu%d",