From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60A68C47080 for ; Mon, 31 May 2021 17:38:09 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3F1B461108 for ; Mon, 31 May 2021 17:38:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F1B461108 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EBA3F82D4E; Mon, 31 May 2021 19:38:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="CERHqrsj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8819A82D73; Mon, 31 May 2021 19:38:04 +0200 (CEST) Received: from mail-oi1-x234.google.com (mail-oi1-x234.google.com [IPv6:2607:f8b0:4864:20::234]) (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 A839C80412 for ; Mon, 31 May 2021 19:38:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=mr.nuke.me@gmail.com Received: by mail-oi1-x234.google.com with SMTP id h9so12966793oih.4 for ; Mon, 31 May 2021 10:38:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=O2IzwFWXK2tuJ20Poowg/07JBKwqGn/ROokppDbQUOw=; b=CERHqrsj/bA/vsmMCtqSMlDHX+R/EkwYCYVULDTODqMeW0gLn5Qt7dWYeNr209q6vT fcU5CstHMU26XR83iNvhPTjOg/94ZxztISNjU+YWmSPw6F2BCa0seqmKiBPLhz05CZNd I6o+QSkn6QODbrvXohjXdkek56EjrRRW8yrypKQODpjC9dbRMzioaz91uw5cuBrw1sc/ FGxPrl7x5IZ/CO56WWIwes5LQ8+Z3/MjKTZodlvj2YMKXgcKRRyOir+nKXgUCt3SfhGn 1Lj1v/idBriRTjMg4r6124n8tyHo0PPuD9pjJJfWN/neYn+rjqDAvcgHutxfGFsByzb5 jmFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=O2IzwFWXK2tuJ20Poowg/07JBKwqGn/ROokppDbQUOw=; b=HKcqrEPoUIKxgRa1HFNgWTWWoo5RPdO00BVfQaeZcIKCmQcuOFTrnC3olD+tZ6vxyT Ttj/za91ngDnmU8Z0RDs0Pgl3GvxEiNj3e0cRzv3/efkU9DjJr0MTso2a1IKgulwehVY grj3gnDo6/d9Sgm2Onv/ecShvdXIPatz7GGMQsYnQhs5Hf3YR3HR2cQHRON6GC/7VhYR qyf97dvo02xr739AzZw1AqUwO9P9nCu6sNbePlc2v2MA27sLrkVFGWA3Nra7d11G+2Th nbfRMItwOgIyctLAla478HJsMkOJInO816zvWPU4jOKVtTWLnSEQk3NWc//UpGzxmKPQ IquQ== X-Gm-Message-State: AOAM531T3Dwsn16I+imTsvXEF16zajavYZqe+sQIDyns+Oi8CcGbGxup LbqwgsgR3G1026Pwtmo4HT0= X-Google-Smtp-Source: ABdhPJwK+WjquZtknqL9kco1BDoHClB/8TW1dq+npE2iIuHgS3Y4c8Xs0qeiNfowQscsaTR+XPNDEA== X-Received: by 2002:aca:488f:: with SMTP id v137mr14681392oia.173.1622482680044; Mon, 31 May 2021 10:38:00 -0700 (PDT) Received: from nuclearis3.gtech (c-98-195-139-126.hsd1.tx.comcast.net. [98.195.139.126]) by smtp.gmail.com with ESMTPSA id i11sm3276872otk.70.2021.05.31.10.37.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 31 May 2021 10:37:59 -0700 (PDT) Subject: Re: [PATCH v3 4/5] stm32mp1: spl: Configure TrustZone controller for OP-TEE To: Patrick DELAUNAY , u-boot@lists.denx.de, trini@konsulko.com Cc: sjg@chromium.org, etienne.carriere@linaro.org References: <20210415164829.2302939-1-mr.nuke.me@gmail.com> <20210415164829.2302939-5-mr.nuke.me@gmail.com> From: "Alex G." Message-ID: Date: Mon, 31 May 2021 12:37:59 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit 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 On 5/28/21 5:22 AM, Patrick DELAUNAY wrote: > Hi, > > On 4/15/21 6:48 PM, Alexandru Gagniuc wrote: [snip] >> +    fdt_start = ofnode_get_addr_size(node, "reg", size); > > warning here because size is 'fdt_size_t *' not 'u32*' > > arch/arm/mach-stm32mp/spl.c:122:48: warning: passing argument 3 of > ‘ofnode_get_addr_size’ from inc > Fixed in v4 >> + >> +    tzc_configure(tzc, optee_config); >> +    tzc_dump_config(tzc); > Dump is always require, even for nomal boot, or only for debug cases ? Because tzc_dump_config() uses log_info(), only prints when the appropriate log level is enabled. This is by design, so that we don't need extra logic here to invoke dump(). >> + >> +    dcache_disable(); > > > You disable cache why, > > it is not supported by OP-TEE ? > > => if it is a generic issue it should be in spl.c for case IH_OS_TEE or in > >       spl_optee_entry() and not in board specific weak function > >       as it done in bl31_entry for TF-A I don't know if this can be safely generalized. stm32mp is the only platform to enable TZC in SPL, which brings special constraints: We're running in secure mode, and we've touched memory that will be reserved to the normal world, for example the linux devicetree. Once we enable TZC, we can't touch that memory anymore. This could happen later as the CPU is evicting cache lines. To make sure we don't hit a TZC violation as cache lines are evicted, we both flush the dcache, and disable the dcache. Doing this another way is not tested, and I can't guarantee that other variations will work reliably. Alex