From patchwork Mon May 31 10:14:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1485624 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=RhNAmXOg; 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 4FtrlY0G1qz9sVb for ; Mon, 31 May 2021 20:15:37 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A3A6A82E81; Mon, 31 May 2021 12:15:15 +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="RhNAmXOg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9D04A82E6D; Mon, 31 May 2021 12:14:57 +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-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) (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 989D882B82 for ; Mon, 31 May 2021 12:14:53 +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-ej1-x631.google.com with SMTP id h24so11967766ejy.2 for ; Mon, 31 May 2021 03:14:53 -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=iherpdeh05RHBc9TLJsRP+0lasnqAdPdfP4OUtL69o0=; b=RhNAmXOgbci0MvDisMzB0Crv2Qz7Rrhnop8Dq+VvCSnfpPvxIYoEw0IOTe5xVbtwjR 0PFdls3TYPwvrcx1kNJGY68lqPOj1BCUrebvqTPv1poQQ0QmUGdGAca2O5Tper5GNGJa wmS4o9qP/WXw+ovseyk9QZfTKb6GMHqA+Wc0U1QKtkBFHe7JSUG6rLePFfPKBKn0oy1m PvAGBUx7M39blWk8esUormdennI+0shf5tG5G0ZN7wSDCUWi+t4dDNPD5ZMmOWcON5EX W2q93VfJZ28268T8Oc+GN5uF+yv83iKoci/HB09KIKr1TAKuY3882jje/pj9QZPAaBln 7J4A== 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=iherpdeh05RHBc9TLJsRP+0lasnqAdPdfP4OUtL69o0=; b=WqdrMU7h/QmoKqCwT6+dVInc2YnqwX44GBeabks4b0t7TdHxS+fEX4zSSudp658Rjq mfNBx4RNBg7qml/uFpbQCz1fpdTlXG3zCbKibYvPaD3XRj8vpGikXTDxZ3N8mG8hSde2 k65zVKsfjNWk3PpirqQ7q89re2TLo8/cUBK5G/SiOKHB3uGcCeZtciyiw7l9vn7o4CjX 14jtYHHvqRyla57dtJVxaP/2Q4SD7jmHU4lirQDT/awGuASU82Fx6kDFIsPaZk3lqIji qWxbKGe3OiK90O/DvA3hcDigfXFdWYZkAAVnil25G+HeKYeDdLR3lk214ugmuFlmxzuj gR2A== X-Gm-Message-State: AOAM531oannKGpOFfya6OxAYLAF5fOHKvYmxHE/KooWumG4QY8l5GbtX 4Ae8QRrTtWNOMQDd7TlmbXMcuPd+jhNbSMvh X-Google-Smtp-Source: ABdhPJxGjJmU0lotlezKxfMtRIsSXcVFPisPuY03Rk9asZkRsbUy0drDZGd2M+nj0JocRpywzaOtig== X-Received: by 2002:a17:906:58d1:: with SMTP id e17mr22196684ejs.179.1622456093079; Mon, 31 May 2021 03:14:53 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6::e05]) by smtp.gmail.com with ESMTPSA id c14sm1228813ejb.2.2021.05.31.03.14.52 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 31 May 2021 03:14:52 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com, Ricardo Salveti Subject: [PATCH 3/3] zynqmp: Pass bl32 entry to TF-A via xilinx handoff structure Date: Mon, 31 May 2021 12:14:47 +0200 Message-Id: <9dab51eb33a63ef892855b11a494283aa50b75c8.1622456084.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.31.1 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.4 at phobos.denx.de X-Virus-Status: Clean There is need to pass entry about secure OS when bl32_entry is defined. Currently only 64bit support is added but /fit-images node have been extended to also record if this is 32bit or 64bit secure OS. When this is tested the code will be update to support this configuration too. Signed-off-by: Michal Simek --- arch/arm/mach-zynqmp/handoff.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-zynqmp/handoff.c b/arch/arm/mach-zynqmp/handoff.c index 7d7ab9da6ec2..31346d9b2e21 100644 --- a/arch/arm/mach-zynqmp/handoff.c +++ b/arch/arm/mach-zynqmp/handoff.c @@ -71,6 +71,7 @@ struct bl31_params *bl2_plat_get_bl31_params(uintptr_t bl32_entry, uintptr_t fdt_addr) { struct xfsbl_atf_handoff_params *atfhandoffparams; + u32 index = 0; atfhandoffparams = (void *)CONFIG_SPL_TEXT_BASE; atfhandoffparams->magic[0] = 'X'; @@ -78,14 +79,22 @@ struct bl31_params *bl2_plat_get_bl31_params(uintptr_t bl32_entry, atfhandoffparams->magic[2] = 'N'; atfhandoffparams->magic[3] = 'X'; - atfhandoffparams->num_entries = 0; + if (bl32_entry) { + atfhandoffparams->partition[index].entry_point = bl32_entry; + atfhandoffparams->partition[index].flags = FSBL_FLAGS_EL1 << FSBL_FLAGS_EL_SHIFT | + FSBL_FLAGS_SECURE << FSBL_FLAGS_TZ_SHIFT; + index++; + } + if (bl33_entry) { - atfhandoffparams->partition[0].entry_point = bl33_entry; - atfhandoffparams->partition[0].flags = FSBL_FLAGS_EL2 << - FSBL_FLAGS_EL_SHIFT; - atfhandoffparams->num_entries++; + atfhandoffparams->partition[index].entry_point = bl33_entry; + atfhandoffparams->partition[index].flags = FSBL_FLAGS_EL2 << + FSBL_FLAGS_EL_SHIFT; + index++; } + atfhandoffparams->num_entries = index; + writel(CONFIG_SPL_TEXT_BASE, &pmu_base->gen_storage6); return NULL;