From patchwork Fri Jan 14 12:25:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1580014 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=VNrLdr+4; dkim-atps=neutral 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=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4Jb0rl6xNbz9sSs for ; Fri, 14 Jan 2022 23:25:59 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2D68C8343B; Fri, 14 Jan 2022 13:25:51 +0100 (CET) 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.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.b="VNrLdr+4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D761083481; Fri, 14 Jan 2022 13:25:44 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_NONE,SPF_NONE autolearn=no 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 F106F83420 for ; Fri, 14 Jan 2022 13:25:41 +0100 (CET) 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 15so1131709edx.9 for ; Fri, 14 Jan 2022 04:25:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20210112.gappssmtp.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dhy2uzaB+0treUw63Yc01Wpr4a7h5eF8CMeAG1rUuD4=; b=VNrLdr+4Qwy7vi6OPMBSV79F0XS1/AHqNj8CGn9yBQE26V46ap4Qh8MXUNFJ+YdJjG 9MUEMXQjlm/OP+2wE+SNjBSNMVj6qmlVvPs/jQs5Vkfr9BQmtwo17aiV5NMTd6c3+TCD r/SBMMWZJEqkUM/ntsOmSfHSTpca6nf/y1eKSEUd/xzGDQ0LcpN10OL1eio+E0x5yHia Pa/Trc1adzYTmWkTC2edS/NYFV7yURHkrg2QbeD3mcre12HINCfpcnjiO8+KcFSXpnMZ ixHJ8JwJ9dyXQ//7gPuH7lVORN6Pd5H25jF8clefPpGXIAH4qp24kmf3J9+QWhM+1L2G 951A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=dhy2uzaB+0treUw63Yc01Wpr4a7h5eF8CMeAG1rUuD4=; b=2wf1lUIl/8q/txNBb21KmxCCLUlv7p8S7jUKhAEPJlCuXtQ0g1Y/h6kheF7Yt7c16F mRShndg0fM9CAOyDbcP8GXVLPa6v4x8ZEQiDP0wY90V1i5TLuJTOkBTLnWSSKp4ubdvD tHPh+TscGbLUXvEaW2KCqMelE5xzX5DRhbU/Px+nrSwEO6gwpqQJ4F52T+QGhjS1wBrd RYDwFfETfUM1+kIv4PyS7nHWtbP02918WHvZj/XSJkTgYoTZ8AemNBinpgSzvdSPHZ5v 3lmFeepQyzCI3CJN5GhJUT3RCDQLmxUUWYKiiW5u7nqkV/KLP+Td2LVyuxt4YpKTNGRJ YxOQ== X-Gm-Message-State: AOAM532KARrtivmnCpOjVRvHLND5HmM72gUf8OlyALKJVs+U7phS0dPf S1Tqxdmjmzqr++ShFx24RwFwl+087gmDdBZt X-Google-Smtp-Source: ABdhPJzH+JpkcnKubNQde59ZgMQfTWmg6juUHr+JaJ40Vl8HCaV94IeUtTVDAGtST53+so/qxfhgnw== X-Received: by 2002:a17:906:e4b:: with SMTP id q11mr7090282eji.260.1642163141437; Fri, 14 Jan 2022 04:25:41 -0800 (PST) Received: from localhost ([2a02:768:2307:40d6::f9e]) by smtp.gmail.com with ESMTPSA id f5sm2328807edu.38.2022.01.14.04.25.40 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Jan 2022 04:25:41 -0800 (PST) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: Adrian Fiergolski Subject: [PATCH 1/4] xilinx: firmware: Introduce zynqmp_pmufw_node() for loading PMU fragments Date: Fri, 14 Jan 2022 13:25:35 +0100 Message-Id: <636e8150bd4e2b1f988d59795772c685ceeec083.1642163135.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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 Introduce zynqmp_pmufw_node() for loading PMU configuration fragment for enabling IPs. Firmware driver has small overlay where NODE id is added and config fragment is sent to PMUFW. There is a need to build PMUFW with fragment support. Signed-off-by: Michal Simek --- drivers/firmware/firmware-zynqmp.c | 32 ++++++++++++++++++++++++++++++ include/zynqmp_firmware.h | 1 + 2 files changed, 33 insertions(+) diff --git a/drivers/firmware/firmware-zynqmp.c b/drivers/firmware/firmware-zynqmp.c index 342dbc13dfdf..10240ddccd3b 100644 --- a/drivers/firmware/firmware-zynqmp.c +++ b/drivers/firmware/firmware-zynqmp.c @@ -27,6 +27,38 @@ struct zynqmp_power { struct mbox_chan rx_chan; } zynqmp_power; +#define NODE_ID_LOCATION 5 + +static unsigned int xpm_configobject[] = { + /**********************************************************************/ + /* HEADER */ + 2, /* Number of remaining words in the header */ + 1, /* Number of sections included in config object */ + PM_CONFIG_OBJECT_TYPE_OVERLAY, /* Type of Config object as overlay */ + /**********************************************************************/ + /* SLAVE SECTION */ + + PM_CONFIG_SLAVE_SECTION_ID, /* Section ID */ + 1, /* Number of slaves */ + + 0, /* Node ID which will be changed below */ + PM_SLAVE_FLAG_IS_SHAREABLE, + PM_CONFIG_IPI_PSU_CORTEXA53_0_MASK | + PM_CONFIG_IPI_PSU_CORTEXR5_0_MASK | + PM_CONFIG_IPI_PSU_CORTEXR5_1_MASK, /* IPI Mask */ +}; + +int zynqmp_pmufw_node(u32 id) +{ + /* Record power domain id */ + xpm_configobject[NODE_ID_LOCATION] = id; + + zynqmp_pmufw_load_config_object(xpm_configobject, + sizeof(xpm_configobject)); + + return 0; +} + static int ipi_req(const u32 *req, size_t req_len, u32 *res, size_t res_maxlen) { struct zynqmp_ipi_msg msg; diff --git a/include/zynqmp_firmware.h b/include/zynqmp_firmware.h index 19c004e91993..76c161806a0d 100644 --- a/include/zynqmp_firmware.h +++ b/include/zynqmp_firmware.h @@ -367,6 +367,7 @@ enum pm_ioctl_id { #define PAYLOAD_ARG_CNT 5U unsigned int zynqmp_firmware_version(void); +int zynqmp_pmufw_node(u32 id); void zynqmp_pmufw_load_config_object(const void *cfg_obj, size_t size); int xilinx_pm_request(u32 api_id, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 *ret_payload); From patchwork Fri Jan 14 12:25:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1580015 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=sU+goKUc; dkim-atps=neutral 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=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4Jb0ry2K1Jz9sSs for ; Fri, 14 Jan 2022 23:26:10 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D3F8E834A7; Fri, 14 Jan 2022 13:25:54 +0100 (CET) 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.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.b="sU+goKUc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3501C83433; Fri, 14 Jan 2022 13:25:47 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) (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 801FA833A2 for ; Fri, 14 Jan 2022 13:25:43 +0100 (CET) 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-x52d.google.com with SMTP id o6so34402567edc.4 for ; Fri, 14 Jan 2022 04:25:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20210112.gappssmtp.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=m9Vn3kZgNwFBCZPgrkflq0WB/F+ewyTApAdkc0OI/WY=; b=sU+goKUcrpsXJptpRsclxl/mRIzVe2NmoNLJmGmrKHsJqH02npC3eLkkAGGUuRPCuD joxgWbrVmGFj/FzYwFDGEXlWoyAKuOPZhpLkHRfMbFUurTsA/b04AlwbFALkuGPnz/fC BiH7G5tI5yLR8kxI/vL7Lih9UjSk6h76oxtkAh15yg+zP20P83PRmiAjTbZhq4F92hhG 7R1Lgz0u887Ndw+y+u5F0YwP6wxhXvmzdSi1kyGhnf5geju8LRP7ooNvtNrSL74LegnQ ko87/VFt1cO1PV2UmiCXq++j7b6Bj8VzvyPjAqXdavArYHDoS/qf7TB0bacx9UfrJ3IU ToEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=m9Vn3kZgNwFBCZPgrkflq0WB/F+ewyTApAdkc0OI/WY=; b=65CcRf0bS6YZrVRUOTxhixu50fA49KiTSjecizMytH3YUtCgpSrWzJAat/4YF950yp k/zT7sgEDe7i65C5AUPWhQ5VVXuWVQYrPAxGptuuip9xG5V8z4yyn88KpV9TJHMmHX5p hi0uabCcJg1CbZoFQ4Pm/VnQ6AaA1QgBd0wJDWyhk4VdnekV8xGQ/6rfUlg+LtoWuZ3f ch5Ghr2J2sUryfUVb0ugcymZolieMchMXv3yUv7bYmlY2Nsm2xz5hWh8lEYM0SEcNFfc LEfP2w7RyKvZ+u5z8gO0AFafJymC3EZiF1Xa9hrotqrSsZQCZv0RSqa9aAiRsUmjn+Lt gPfg== X-Gm-Message-State: AOAM533ng1iDVMzbtQ69tBBNXPYmf/ltKcn9cFx8XKJySGwSHKxKrHGo MAZa5gITSqS7ewnvX8/gIwYJ7W7hhPJxDX32 X-Google-Smtp-Source: ABdhPJz+KEOMEvy0I8W5T6wDV/BG1voKYJeyRD1pCoaBLAyac2T3kxww3U+m0hHAxjv8C4+16zLODw== X-Received: by 2002:a17:906:364b:: with SMTP id r11mr7103628ejb.666.1642163142942; Fri, 14 Jan 2022 04:25:42 -0800 (PST) Received: from localhost ([2a02:768:2307:40d6::f9e]) by smtp.gmail.com with ESMTPSA id c30sm1855037ejj.190.2022.01.14.04.25.42 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Jan 2022 04:25:42 -0800 (PST) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: Adrian Fiergolski Subject: [PATCH 2/4] firmware: zynqmp: Move loading message to debug Date: Fri, 14 Jan 2022 13:25:36 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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 Power domain driver is using this function for every IP which is PD listed. This can end up with a lot of messages which end up in boot log. That's why show it only in EL3 as was used in past. Signed-off-by: Michal Simek --- drivers/firmware/firmware-zynqmp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/firmware-zynqmp.c b/drivers/firmware/firmware-zynqmp.c index 10240ddccd3b..d6dd5a394ee9 100644 --- a/drivers/firmware/firmware-zynqmp.c +++ b/drivers/firmware/firmware-zynqmp.c @@ -131,7 +131,8 @@ void zynqmp_pmufw_load_config_object(const void *cfg_obj, size_t size) int err; u32 ret_payload[PAYLOAD_ARG_CNT]; - printf("Loading new PMUFW cfg obj (%ld bytes)\n", size); + if (IS_ENABLED(CONFIG_SPL_BUILD)) + printf("Loading new PMUFW cfg obj (%ld bytes)\n", size); flush_dcache_range((ulong)cfg_obj, (ulong)(cfg_obj + size)); From patchwork Fri Jan 14 12:25:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1580016 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=79zLvj+j; dkim-atps=neutral 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=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4Jb0s92FZ8z9sSs for ; Fri, 14 Jan 2022 23:26:21 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6E54783457; Fri, 14 Jan 2022 13:25:58 +0100 (CET) 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.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.b="79zLvj+j"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 845B0833B4; Fri, 14 Jan 2022 13:25:48 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) (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 DEA6F83420 for ; Fri, 14 Jan 2022 13:25:44 +0100 (CET) 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-x52b.google.com with SMTP id z22so34343138edd.12 for ; Fri, 14 Jan 2022 04:25:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20210112.gappssmtp.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8BEQ2XFFVbTI6xL4f0/y9ihzg+yE/9+iW21oM/umNjk=; b=79zLvj+jr58qZo8c4Qk7iC0jayeLyMj6tcal+3oL0ut3fa6bM5CGw9qqlG+EuBgQs+ pRh8r5dyPbEHZUgUVRB82uQRdAEyvcQL4SGaa1cq5omkNzQUsIYkMEdAiqYrT+uvtnpU wD1iJoqR8KsVrcHHLOkGlUxzCH/p3M+HBDzE8xU9JBsLehjIO/IfhI3T+OOYtohUBRvd 2Bec8mB8F8H/m9TG86JpWbeVr5V4TStPb8ZpymErLsLNpKlGeEE55Q6Feq/RxRLoBP+y uaZ6/5wOsZAyKYYLaqeiX5zgOBpkRcXtAyNQaYoMsVQRBBnJJJ+NgCaQOP0esTRODUD2 dBBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=8BEQ2XFFVbTI6xL4f0/y9ihzg+yE/9+iW21oM/umNjk=; b=sVPYzFhzzOOQt6QEVKctcs9sSazCDLyUTGKmmyNcCUcoBWXKycMHqezOh+06UVshjq LD8G9Gp7v9Futi+b2QjhHU2IGuVGas5ErPEqOahliL1nZhtP3N8BU8LctdbXQh03q2jD hRvDJ/YeSla3QV2uWIq8IyrdRX/ssTeb8TlDbvyW+U777TkZl00cn5PmzJJ6uniFP5qq GcylUMXQ0pXHbH3xMbYodXpUXXyGJFK8G7vYJiUa2Y1FTl9tbXMdEsKGlyx38N5sovJo aXPdbQIPNTcd+ceSJfXYRVoKPoKpcttZN5EJC97CEGAsDOm18gKyAqyl9RIDHkVEXHPE ThPg== X-Gm-Message-State: AOAM5324VJ4gkplQiKW9vuJhnOw+XCgWj5Oq2sxaOblPp+FsgP3MT6Jl fN305rKkiJueDpb/MAVzKs3HID5tw4VAmVjd X-Google-Smtp-Source: ABdhPJxdJuAbY4uE6T/3bF8jM5GzqI03pKo2ocsbGxl5lZotuRwup0+HOJ6LYlrUhBS6PMemjQ4yTQ== X-Received: by 2002:a05:6402:34c3:: with SMTP id w3mr8933055edc.149.1642163144389; Fri, 14 Jan 2022 04:25:44 -0800 (PST) Received: from localhost ([2a02:768:2307:40d6::f9e]) by smtp.gmail.com with ESMTPSA id k22sm2356229edv.22.2022.01.14.04.25.43 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Jan 2022 04:25:44 -0800 (PST) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: Adrian Fiergolski Subject: [PATCH 3/4] firmware: zynqmp: Do not report error if node is already configured Date: Fri, 14 Jan 2022 13:25:37 +0100 Message-Id: <8c15ef0b68cf191f693d3d010f70ac24cfd8171f.1642163135.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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 Power domain driver sends PM fragment to PMUFW. It is sent for every node which is listed in DT. But some nodes could be already enabled but driver is not capable to find it out. That's why it blinly sents request for every listed IP. When PMUFW response by XST_PM_ALREADY_CONFIGURED error code there is no need to show any error message because node is already enabled. That's why cover this case with message when DEBUG is enabled. Signed-off-by: Michal Simek --- drivers/firmware/firmware-zynqmp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/firmware/firmware-zynqmp.c b/drivers/firmware/firmware-zynqmp.c index d6dd5a394ee9..a80e73307982 100644 --- a/drivers/firmware/firmware-zynqmp.c +++ b/drivers/firmware/firmware-zynqmp.c @@ -21,6 +21,7 @@ #define PMUFW_PAYLOAD_ARG_CNT 8 #define XST_PM_NO_ACCESS 2002L +#define XST_PM_ALREADY_CONFIGURED 2009L struct zynqmp_power { struct mbox_chan tx_chan; @@ -143,6 +144,11 @@ void zynqmp_pmufw_load_config_object(const void *cfg_obj, size_t size) return; } + if (err == XST_PM_ALREADY_CONFIGURED) { + debug("PMUFW Node is already configured\n"); + return; + } + if (err) printf("Cannot load PMUFW configuration object (%d)\n", err); From patchwork Fri Jan 14 12:25:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1580017 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=l/NcJUif; dkim-atps=neutral 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=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4Jb0sM5jJkz9sSs for ; Fri, 14 Jan 2022 23:26:31 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8E86A83510; Fri, 14 Jan 2022 13:26:05 +0100 (CET) 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.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.b="l/NcJUif"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2AEAF83420; Fri, 14 Jan 2022 13:25:51 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) (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 7D5BF8340A for ; Fri, 14 Jan 2022 13:25:46 +0100 (CET) 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-x536.google.com with SMTP id k15so34231016edk.13 for ; Fri, 14 Jan 2022 04:25:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20210112.gappssmtp.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=98s7IsM79cTNtP5HnNjL73GotctBdNogCzmz3k9xRG4=; b=l/NcJUifdrtVRfrvgLuoJOhy8or2M62mJdsfv5Oj4WORuuX7GNu2P9piwfBC40R0oi lwvNs6uJw94ndtywaNfNL4qoWB/I3lK+t2izena7lAXIZ+E4wkwxpMpiIB3Y6D+xmnwP HLx3KiJKM3BhCNFJrY7VJJ4LvF5ikFJE5x2NH3bMyVlR3SxM/g9fP3ZuCIR7rrfWTqCc 6Md4dsqI9N5+PbV8wXbX29rHECbHZdApSfInXG9HwiXyt1wm1b9DkMVjURGFWCTxQUuc c/02lVnh8XXL9kWusArbUP1Ny/osBC1Uz8TUTDeqy8EelQOm/+l2fvuw7APSDSsPE0wX iY5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=98s7IsM79cTNtP5HnNjL73GotctBdNogCzmz3k9xRG4=; b=SqU9ytbJbMX5AVHES/sb4bkJ0xkdzJinuqAvGzfqGCoXxXAxCZ/hLs38FUULH96TOd ryRNQpn8fRTBYfjGqACCs72c/OR7KdRwRVhw5jmWWr8U+803CWOMgaEsd0WbWagB1Yb+ aEme8gxiJlroe4Sx76iKqsZckufU2UamMU/6AWDfnpVqKD3PEO7ld07xGl2lsNgbnxG9 lPP/zzdyXbHZ9+bo+t1TRpfRXbLPUdpMSLivltj3Y2w7wq6TAPyr0JoglpLuglRQiSM2 Xoekkqf979QIB5QM2txPwnD0nRcAUq3FY/kANHd4GYSxrHn3xhIfTlXvjy0rsHXbn2Ov dTgw== X-Gm-Message-State: AOAM531TAuWIjb3Azo9bXDcCgz700X5Vn0avXbcipYJx4d8FuNy5YaXz wbOfCE0xZ3z/WboE3FgkJZ9Aqpp9JPz7xcCb X-Google-Smtp-Source: ABdhPJy4FKHafzeS3NNOPJ1RC13VUt7uLL4iYNNsj1AAkpBZHCEHbYTJicpafPOTgsAOYdkvWJjA4w== X-Received: by 2002:a17:907:20a3:: with SMTP id pw3mr1275820ejb.688.1642163145865; Fri, 14 Jan 2022 04:25:45 -0800 (PST) Received: from localhost ([2a02:768:2307:40d6::f9e]) by smtp.gmail.com with ESMTPSA id b10sm2319553edu.42.2022.01.14.04.25.45 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Jan 2022 04:25:45 -0800 (PST) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: Adrian Fiergolski Subject: [PATCH 4/4] arm64: zynqmp: Add command for disabling loading other overlays Date: Fri, 14 Jan 2022 13:25:38 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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 Add command "zynqmp pmufw node close" to disable permission to load additional pmufw config overlays. This command will make sure that any other sw will ask for changing permission. Signed-off-by: Michal Simek --- board/xilinx/zynqmp/cmds.c | 16 ++++++++++++++++ drivers/firmware/firmware-zynqmp.c | 19 +++++++++++++++++++ include/zynqmp_firmware.h | 1 + 3 files changed, 36 insertions(+) diff --git a/board/xilinx/zynqmp/cmds.c b/board/xilinx/zynqmp/cmds.c index 5a277c712f60..2ab9596248c0 100644 --- a/board/xilinx/zynqmp/cmds.c +++ b/board/xilinx/zynqmp/cmds.c @@ -209,6 +209,19 @@ static int do_zynqmp_pmufw(struct cmd_tbl *cmdtp, int flag, int argc, if (argc != cmdtp->maxargs) return CMD_RET_USAGE; + if (!strncmp(argv[2], "node", 4)) { + u32 id; + + if (!strncmp(argv[3], "close", 5)) + return zynqmp_pmufw_config_close(); + + id = dectoul(argv[3], NULL); + + printf("Enable permission for node ID %d\n", id); + + return zynqmp_pmufw_node(id); + } + addr = hextoul(argv[2], NULL); size = hextoul(argv[3], NULL); @@ -416,6 +429,9 @@ static char zynqmp_help_text[] = " lock(0)/split(1)\n" #endif "zynqmp pmufw address size - load PMU FW configuration object\n" + "zynqmp pmufw node - load PMU FW configuration object\n" + "zynqmp pmufw node close - disable config object loading\n" + " node: keyword, id: NODE_ID in decimal format\n" "zynqmp rsa srcaddr srclen mod exp rsaop -\n" " Performs RSA encryption and RSA decryption on blob of data\n" " at srcaddr and puts it back in srcaddr using modulus and\n" diff --git a/drivers/firmware/firmware-zynqmp.c b/drivers/firmware/firmware-zynqmp.c index a80e73307982..2ba0b3a7c5c6 100644 --- a/drivers/firmware/firmware-zynqmp.c +++ b/drivers/firmware/firmware-zynqmp.c @@ -49,6 +49,25 @@ static unsigned int xpm_configobject[] = { PM_CONFIG_IPI_PSU_CORTEXR5_1_MASK, /* IPI Mask */ }; +static unsigned int xpm_configobject_close[] = { + /**********************************************************************/ + /* HEADER */ + 2, /* Number of remaining words in the header */ + 1, /* Number of sections included in config object */ + PM_CONFIG_OBJECT_TYPE_OVERLAY, /* Type of Config object as overlay */ + /**********************************************************************/ + /* SET CONFIG SECTION */ + PM_CONFIG_SET_CONFIG_SECTION_ID, + 0U, /* Loading permission to Overlay config object */ +}; + +int zynqmp_pmufw_config_close(void) +{ + zynqmp_pmufw_load_config_object(xpm_configobject_close, + sizeof(xpm_configobject_close)); + return 0; +} + int zynqmp_pmufw_node(u32 id) { /* Record power domain id */ diff --git a/include/zynqmp_firmware.h b/include/zynqmp_firmware.h index 76c161806a0d..50bf4ef39535 100644 --- a/include/zynqmp_firmware.h +++ b/include/zynqmp_firmware.h @@ -368,6 +368,7 @@ enum pm_ioctl_id { unsigned int zynqmp_firmware_version(void); int zynqmp_pmufw_node(u32 id); +int zynqmp_pmufw_config_close(void); void zynqmp_pmufw_load_config_object(const void *cfg_obj, size_t size); int xilinx_pm_request(u32 api_id, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 *ret_payload);