From patchwork Thu Mar 21 15:48:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 1060253 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=lucaceresoli.net Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=lucaceresoli.net header.i=@lucaceresoli.net header.b="joLIW2A4"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44QB7m4WcPz9sRG for ; Fri, 22 Mar 2019 02:50:12 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 49ED0C2208A; Thu, 21 Mar 2019 15:49:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 9C893C22076; Thu, 21 Mar 2019 15:49:16 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 307F6C21C2F; Thu, 21 Mar 2019 15:49:14 +0000 (UTC) Received: from hostingweb31-40.netsons.net (hostingweb31-40.netsons.net [89.40.174.40]) by lists.denx.de (Postfix) with ESMTPS id CF815C21C2F for ; Thu, 21 Mar 2019 15:49:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lucaceresoli.net; s=default; h=Message-Id:Date:Subject:Cc:To:From:Sender: Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=FpiFilGeH7A9bpGO6hxm9ZZZ5m29Q11Evi6c83NwrKs=; b=joLIW2A4+lgwuN3lczQPEmfGOa xUaSrK4xvJlkM37sdbO9N1aLd1tcOM9Ffv+IwPzb6Lgrlv/QLA8T5UxtHzPyyVXDQwhUEmPOB9bTf 4+zC0D6wylgOfTYQ5XBPVEUXk11oA+wTI089SqrBxRWCi7X+lbxHMbTKD4UybqmmsNWo=; Received: from [109.168.11.45] (port=40018 helo=pc-ceresoli.dev.aim) by hostingweb31.netsons.net with esmtpa (Exim 4.91) (envelope-from ) id 1h6zwO-00EWCd-8u; Thu, 21 Mar 2019 16:49:12 +0100 From: Luca Ceresoli To: u-boot@lists.denx.de Date: Thu, 21 Mar 2019 16:48:55 +0100 Message-Id: <20190321154857.29892-1-luca@lucaceresoli.net> X-Mailer: git-send-email 2.17.1 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - hostingweb31.netsons.net X-AntiAbuse: Original Domain - lists.denx.de X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lucaceresoli.net X-Get-Message-Sender-Via: hostingweb31.netsons.net: authenticated_id: luca+lucaceresoli.net/only user confirmed/virtual account not confirmed X-Authenticated-Sender: hostingweb31.netsons.net: luca@lucaceresoli.net X-Source: X-Source-Args: X-Source-Dir: Cc: Luca Ceresoli , Michal Simek Subject: [U-Boot] [RFC v2 0/2] arm64: zynqmp: pass a PMUFW config object X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Hi, a long-standing issue in the ZynqMP users community is the management on the PMU firmware configuration object when U-Boot SPL is used. The Platform Management Unit (PMU) needs a configuration object (cfg obj) to know how to operate the SoC. When using the "Xilinx workflow", the Xilinx FSBL (First Stage Bootloader) has the SPL role. FSBL has a built-in cfg obj and passes it to the PMUFW at runtime before jumping to U-Boot proper. This is just not implemented in the U-Boot code. The best workaround for U-Boot SPL users is to patch [0] the PMUFW itself to have the cfg obj built-in and self-load it. This approach has some drawbacks: among others, it forces to use a different PMUFW binary for each hardware and hardware configuation. It also makes it impossible to change the configuration after boot. This patchset is a first attempt at filling the gap by allowing U-Boot SPL to load the cfg obj firmware at runtime. It adds a Kconfig string option to point to the cfg obj in the form of a C file as produced by Xilinx tools (usually called pm_cfg_obj.c). If the option is non-empty, code is enabled to compile that file in U-Boot SPL and send the configuration to PMUFW. The next development target will be to load the cfg obj from a binary blob instead of compiling it from a .c file. With that in place, patch 1 will be removed and patch 2 cleaned up. These patches are tested on the UltraZed EV board. Since RFC v1 [1] the loading has been reimplemented in SPL (it was in U-Boot proper). Now it does not rely on ARM Trusted Firmware but instead talks directly with the PMU via IPI mailboxes. [0] https://github.com/topic-embedded-products/meta-topic/blob/master/recipes-bsp/pmu-firmware/pmu-firmware/0001-Load-XPm_ConfigObject-at-boot.patch [1] https://lists.denx.de/pipermail/u-boot/2019-February/360450.html Luca Luca Ceresoli (2): zynqmp: add minimal include files to build a pm_cfg_obj.c arm64: zynqmp: spl: install a PMU firmware config object at runtime board/xilinx/zynqmp/Kconfig | 26 ++++ board/xilinx/zynqmp/Makefile | 5 + board/xilinx/zynqmp/pm_defs.h | 254 +++++++++++++++++++++++++++++++ board/xilinx/zynqmp/pmu_global.h | 0 board/xilinx/zynqmp/pmu_ipc.c | 116 ++++++++++++++ board/xilinx/zynqmp/pmu_ipc.h | 14 ++ board/xilinx/zynqmp/xil_types.h | 1 + board/xilinx/zynqmp/zynqmp.c | 11 ++ 8 files changed, 427 insertions(+) create mode 100644 board/xilinx/zynqmp/pm_defs.h create mode 100644 board/xilinx/zynqmp/pmu_global.h create mode 100644 board/xilinx/zynqmp/pmu_ipc.c create mode 100644 board/xilinx/zynqmp/pmu_ipc.h create mode 100644 board/xilinx/zynqmp/xil_types.h