From patchwork Thu Nov 18 12:00:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1556594 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=40Td/fLb; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 4HvyzN6nhsz9s5P for ; Thu, 18 Nov 2021 23:00:16 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A3A2F82F85; Thu, 18 Nov 2021 13:00:12 +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="40Td/fLb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E4EA182F85; Thu, 18 Nov 2021 13:00:09 +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-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) (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 44F7082F82 for ; Thu, 18 Nov 2021 13:00:04 +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-wm1-x32e.google.com with SMTP id i8-20020a7bc948000000b0030db7b70b6bso7407129wml.1 for ; Thu, 18 Nov 2021 04:00:04 -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:mime-version :content-transfer-encoding; bh=RekpakutwZL+d6+JQaIhSwSXW4OBCCBEVxCj790Uto4=; b=40Td/fLbw2C6Dcy8wgKCSerqaf0WTwbQ02VMdU+XdYmIFqb7OvK1nu1Q0MTDV7qKNE qDgr1S2swwXdJw2yjH88g82ZU5PlX3bw+fnJRiLQ5he/7m03mhniOiBHXW2mK+mu0Bga mVhyaIFzJEiKQN7YJdCgmKWydqvPdcXBVOE9q6wsjYZDLiCZiCgrMhXHjHvFx34b6M+/ kpG6Hsc8+oP6rM9NG/n6/Pq3ozJip7T3jjf1G4hM3Rn4nVhJStKpahzJRuuyU1jAgKyY ebrh1J/j7IOnxB0V/DhwJ1GC5nwy3zFYHZU99450rIRhO41IUYEAhW+A8icndEKnPRIP qRXg== 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 :mime-version:content-transfer-encoding; bh=RekpakutwZL+d6+JQaIhSwSXW4OBCCBEVxCj790Uto4=; b=l7pPI/vk0cjc6Z0uMdC414sl5TsP2E785lo50tX6G+95KHOor92gGSe1+X+3M9K27+ Sx7CY6K8xkPjFbypD1TkgAAgk0WVktTi6oCG32OLJfN9tSUeXJgfkXsnnL52bUrzVDIr eTd3UrhgQN+KAEvRwwYQtNlufr1B6id7liC8MMQJaK4icXlgLaxqL8bBeixc+pgNKDNM rddReaxgwlBoeLs1AG4WARtpfsiJfx36jqcqBbgg7FXsF9Rd/eBI8jjqD7dCJBtNOzo+ ZHUo4jdIBg37trzJlXpwLvyj1kaWH25dhysKYpFVUT6SZmxxkmn7EBR5CqEXqfGeyGpD 2g4Q== X-Gm-Message-State: AOAM532AX3cE9DEmdg31QFp9qmVgake49dQD3KGL1Q+rKkjrzZnARv3F SqrJhq9wAXuCae0CEYv9sliPhz3NbKizzg== X-Google-Smtp-Source: ABdhPJxk+o6G9o3gSCq5MqlvHrdSOfJQHRDTUMbyT1jw1Usr7IiDRRxfSj+Y7tfy358SdYtXZDBpNA== X-Received: by 2002:a1c:1bd8:: with SMTP id b207mr9476903wmb.114.1637236803499; Thu, 18 Nov 2021 04:00:03 -0800 (PST) Received: from localhost ([2a02:768:2307:40d6::45a]) by smtp.gmail.com with ESMTPSA id y6sm3085673wrh.18.2021.11.18.04.00.03 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Nov 2021 04:00:03 -0800 (PST) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: Adrian Fiergolski Subject: [PATCH] xilinx: firmware: Move dcache handling directly to pmufw load config Date: Thu, 18 Nov 2021 13:00:02 +0100 Message-Id: <8c92edd3650ce34a3cfd1c1e4e9103980830b1fa.1637236800.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.35 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 Core function should make sure that data is stored properly that's why move cache operations directly to zynqmp_pmufw_load_config_object() to be able to call it from other functions. Signed-off-by: Michal Simek --- board/xilinx/zynqmp/cmds.c | 1 - drivers/firmware/firmware-zynqmp.c | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/board/xilinx/zynqmp/cmds.c b/board/xilinx/zynqmp/cmds.c index b15c0f599bda..5a277c712f60 100644 --- a/board/xilinx/zynqmp/cmds.c +++ b/board/xilinx/zynqmp/cmds.c @@ -211,7 +211,6 @@ static int do_zynqmp_pmufw(struct cmd_tbl *cmdtp, int flag, int argc, addr = hextoul(argv[2], NULL); size = hextoul(argv[3], NULL); - flush_dcache_range((ulong)addr, (ulong)(addr + size)); zynqmp_pmufw_load_config_object((const void *)(uintptr_t)addr, (size_t)size); diff --git a/drivers/firmware/firmware-zynqmp.c b/drivers/firmware/firmware-zynqmp.c index b44fede30799..aa20e33b4046 100644 --- a/drivers/firmware/firmware-zynqmp.c +++ b/drivers/firmware/firmware-zynqmp.c @@ -6,6 +6,7 @@ */ #include +#include #include #include #include @@ -99,6 +100,8 @@ void zynqmp_pmufw_load_config_object(const void *cfg_obj, size_t size) printf("Loading new PMUFW cfg obj (%ld bytes)\n", size); + flush_dcache_range((ulong)cfg_obj, (ulong)(cfg_obj + size)); + err = xilinx_pm_request(PM_SET_CONFIGURATION, (u32)(u64)cfg_obj, 0, 0, 0, ret_payload); if (err == XST_PM_NO_ACCESS) {