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=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 5E286C432BE for ; Tue, 31 Aug 2021 18:21:28 +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 CFB5560FC3 for ; Tue, 31 Aug 2021 18:21:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org CFB5560FC3 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 40F4E8347C; Tue, 31 Aug 2021 20:21:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="FLKfiLfF"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AD918831D8; Tue, 31 Aug 2021 20:21:06 +0200 (CEST) Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8C80A83146 for ; Tue, 31 Aug 2021 20:20:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=nm@ti.com Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 17VIKtri115507; Tue, 31 Aug 2021 13:20:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1630434055; bh=qbVyXaqHeNqVfj7t5ZDW7fgW1IHYcKLla8KYPWuvZu8=; h=From:To:CC:Subject:Date; b=FLKfiLfFEMPr8D0skJTLeCR3i62l/pZffnJmBvCSmyaBOTfu6khtlakSS6GMclYEq pLJFm7IDylD4R+T7T5g//emaIT68rLrrOegvaVDf0kkMfz5HZWjfLtLfS8YL+9JOFv HuJ/jOROrqYsHCujNhqeXvWoAx8sj6jbyKf7Ssvc= Received: from DLEE106.ent.ti.com (dlee106.ent.ti.com [157.170.170.36]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 17VIKt4V127619 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 31 Aug 2021 13:20:55 -0500 Received: from DLEE112.ent.ti.com (157.170.170.23) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Tue, 31 Aug 2021 13:20:54 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Tue, 31 Aug 2021 13:20:54 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 17VIKsBU007228; Tue, 31 Aug 2021 13:20:54 -0500 From: Nishanth Menon To: Lokesh Vutla , Tom Rini CC: , Nishanth Menon Subject: [PATCH 0/2] arm: mach-k3: Fix corruption of device manager firmware Date: Tue, 31 Aug 2021 13:20:47 -0500 Message-ID: <20210831182049.24636-1-nm@ti.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 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.103.2 at phobos.denx.de X-Virus-Status: Clean The following series takes care of two problems: a) A potential race when R5 (boot processor) is parsing and loading DM firmware elf sections way slower than A53 executing. b) We load the FIT image to the same address as the elf sections. See [1] as example. NOTE: Though, in theory, the Device Manager's linker file could be constructed such as to avoid the overlap address, there is no guarentee of implicit assumptions and the fact that DM's firmware can be combined with additional functionality could result in unexpected behavior as well. To prevent this, lets just have explicit load address and sequencing. Nishanth Menon (2): arm: mach-k3: common: Make sure firmware sections are loaded prior to armv8 startup tools: k3_fit_atf: Change DM load address to avoid conflict arch/arm/mach-k3/common.c | 30 ++++++++++++++++++------------ tools/k3_fit_atf.sh | 4 ++-- 2 files changed, 20 insertions(+), 14 deletions(-) [1] $ arm-none-linux-gnueabihf-readelf -S ti-dm/j721e/ipc_echo_testb_mcu1_0_release_strip.xer5f There are 39 section headers, starting at offset 0x2aa98: Section Headers: [Nr] Name Type Addr Off Size ES Flg Lk Inf Al [ 0] NULL 00000000 000000 000000 00 0 0 0 [ 1] .freertosrst[...] PROGBITS 41010000 000038 000040 00 AX 0 0 8 [ 2] .bootCode PROGBITS 41010a60 000a98 000118 00 AX 0 0 8 [ 3] .startupCode PROGBITS 41010410 000448 000338 00 AX 0 0 8 [ 4] .startupData PROGBITS 41010748 000780 000318 00 A 0 0 8 [ 5] .text.hwi PROGBITS 41010040 000078 0003d0 00 AX 0 0 8 [ 6] .text.cache NOBITS 41010410 02a680 000000 00 AX 0 0 8 [ 7] .text.mpu NOBITS 41010410 02a680 000000 00 AX 0 0 8 [ 8] .text.boot NOBITS 41010410 02a680 000000 00 AX 0 0 8 [ 9] .text PROGBITS a05b8fb0 002000 016340 00 AX 0 0 8 [10] .const PROGBITS a05cf2f0 018340 00c470 00 A 0 0 8 [11] .cinit PROGBITS a0581400 001100 000818 00 A 0 0 8 [12] .bss NOBITS a0582000 002000 036faa 00 WA 0 0 8192 [13] .far NOBITS 00000000 000000 000000 00 0 0 4 [14] .data NOBITS a05db780 024800 008100 00 WA 0 0 128 [15] .sysmem NOBITS 00000000 000000 000000 00 0 0 1 [16] .data_buffer NOBITS 00000000 02a680 000000 00 WA 0 0 128 [17] .bss.devgroup* NOBITS a05e9700 02a680 0011f8 00 WA 0 0 4 [18] .const.devgroup* PROGBITS a05e3880 024800 004710 00 A 0 0 4 [19] .boardcfg_data PROGBITS a05e8000 028f80 001700 00 A 0 0 128 [20] .benchmark_buffer NOBITS 00000000 000000 000000 00 0 0 8 [21] ipc_data_buffer NOBITS a0400000 001100 181400 00 WA 0 0 128 [22] .resource_table PROGBITS a0180000 001000 00008c 00 A 0 0 4096 [23] .tracebuf NOBITS a0100000 000c00 080000 00 WA 0 0 1024 [24] .stack NOBITS a0ffc000 02a680 004000 00 WA 0 0 8 [25] .irqStack NOBITS a0ffae00 02a880 001000 00 A 0 0 4 [26] .fiqStack NOBITS a0ffbe00 02b880 000100 00 A 0 0 4 [27] .abortStack NOBITS a0ffbf00 02b980 000100 00 A 0 0 4 [28] .undStack NOBITS a0ffac00 02a680 000100 00 A 0 0 4 [29] .svcStack NOBITS a0ffad00 02a780 000100 00 A 0 0 4 [30] .TI.noinit NOBITS 00000000 000000 000000 00 0 0 4 [31] .TI.persistent NOBITS 00000000 000000 000000 00 0 0 128 [32] __llvm_prf_cnts NOBITS a0400000 02a680 000000 00 A 0 0 4 [33] Veneer$$CMSE NOBITS 00000000 000000 000000 00 0 0 1 [34] .ARM.attributes ARM_ATTRIBUTES 00000000 02a680 00005b 00 0 0 0 [35] .symtab SYMTAB 00000000 02a6dc 000030 10 37 1 0 [36] .TI.section.flags PROGBITS 00000000 02a70c 000020 00 0 0 0 [37] .strtab STRTAB 00000000 02a72c 000014 01 S 0 0 0 [38] .shstrtab STRTAB 00000000 02a740 0001b6 01 S 0 0 0 -- 2.32.0