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);