From patchwork Wed Nov 25 11:28:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick DELAUNAY X-Patchwork-Id: 1406032 X-Patchwork-Delegate: patrick.delaunay73@gmail.com 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; dmarc=pass (p=reject dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.a=rsa-sha256 header.s=STMicroelectronics header.b=ycj7qVPZ; 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 4CgzDl6t0Sz9sT6 for ; Wed, 25 Nov 2020 22:29:11 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 09E1C8263B; Wed, 25 Nov 2020 12:29:00 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=st.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=st.com header.i=@st.com header.b="ycj7qVPZ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 882BC8262A; Wed, 25 Nov 2020 12:28:57 +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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) (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 1CDD98262A for ; Wed, 25 Nov 2020 12:28:48 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=patrick.delaunay@st.com Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 0APBSC1r025531; Wed, 25 Nov 2020 12:28:48 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=STMicroelectronics; bh=czT8YO7R4vjuOcr11MZjBRaP+FJP0Nwz/A30jcFU90s=; b=ycj7qVPZJxR6ehgMLGyuSRz+azopOPWcZp3jjau7IMxqz1WnQ4UVSPr+nXgYDpaKAGLT Qvfr8OID8rVHp8TA/h7q4tcFg6uS2Tc5TsJal4wPpavAw5J3F45ey+faAE9/6UqIPuB/ tPiKRYwz5+R1Nm7T3nFTo4poTiKnvdXl4NicqATjRgd/pNkdmJH53P2OHmLqeoaseyQm YDZhvFlIrDsU2vi+VXslYXr9QGdf/4+pclbAoAjtHaGQZ6WiVWC3EnivUtAL0VC5Lvu7 9uoM1gqO5UEI7yW+uL1ZOzYTgWh0boq4KWEnkBVqFHK5p6VYmg9g3MCGAxRsHB+kGK5o vA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 34y05hdpgt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 25 Nov 2020 12:28:48 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id AD7C3100034; Wed, 25 Nov 2020 12:28:47 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag2node3.st.com [10.75.127.6]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id A3A9B238E06; Wed, 25 Nov 2020 12:28:47 +0100 (CET) Received: from localhost (10.75.127.46) by SFHDAG2NODE3.st.com (10.75.127.6) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 25 Nov 2020 12:28:47 +0100 From: Patrick Delaunay To: CC: Patrick Delaunay , Patrice Chotard , U-Boot STM32 Subject: [PATCH] board: st: stm32mp1: update load address for FIT examples Date: Wed, 25 Nov 2020 12:28:10 +0100 Message-ID: <20201125122806.1.I077eed496ea5fded723418afa845e759df8e6c9b@changeid> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.75.127.46] X-ClientProxiedBy: SFHDAG1NODE3.st.com (10.75.127.3) To SFHDAG2NODE3.st.com (10.75.127.6) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312, 18.0.737 definitions=2020-11-25_06:2020-11-25, 2020-11-25 signatures=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.3 at phobos.denx.de X-Virus-Status: Clean Update kernel load address for FIT examples to avoid relocation: - Kernel example uses Image.gz with U-Boot gzip decompression at final kernel location 0x0xC0008000. - Copro example loads zImage at a correct location (0xC4000000), to avoid zImage relocation before decompression by kernel code. An other solution to avoid zImage relocation is to align the kernel load and entry address with the real location in FIT (the relocation of zImage is skipped in U-Boot bootm command for identical address) but it is less flexible because this offset depends on FIT content: For example: ## Loading kernel from FIT Image at c2000000 ... Using 'ev1' configuration Trying 'kernel' kernel subimage Description: Linux kernel Created: 2020-10-22 9:08:32 UTC Type: Kernel Image Compression: uncompressed Data Start: 0xc20000cc The kernel offset in FIT is 0xCC in FIT and zImage is decompressed at 0xC0008000 by kernel code: kernel { description = "Linux kernel"; data = /incbin/("zImage"); type = "kernel"; arch = "arm"; os = "linux"; compression = "none"; load = <0xC20000cc>; entry = <0xC20000cc>; hash-1 { algo = "sha1"; }; }; Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- board/st/stm32mp1/fit_copro_kernel_dtb.its | 18 ++++++++++++++++-- board/st/stm32mp1/fit_kernel_dtb.its | 6 +++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/board/st/stm32mp1/fit_copro_kernel_dtb.its b/board/st/stm32mp1/fit_copro_kernel_dtb.its index 3e08fd943e..dc43639af4 100644 --- a/board/st/stm32mp1/fit_copro_kernel_dtb.its +++ b/board/st/stm32mp1/fit_copro_kernel_dtb.its @@ -1,6 +1,20 @@ /* * Compilation: * mkimage -f fit_copro_kernel_dtb.its fit_copro_kernel_dtb.itb + * + * M4 firmware to load with remoteproc: rproc-m4-fw.elf + * + * Files in linux build dir: + * - arch/arm/boot/zImage + * - arch/arm/boot/dts/stm32mp157c-dk2.dtb + * - arch/arm/boot/dts/stm32mp157c-ev1.dtb + * + * load mmc 0:4 $kernel_addr_r fit_copro_kernel_dtb.itb + * bootm $kernel_addr_r + * bootm $kernel_addr_r#dk2 + * bootm $kernel_addr_r#ev1 + * bootm $kernel_addr_r#dk2-m4 + * bootm $kernel_addr_r#ev1-m4 */ /dts-v1/; @@ -29,8 +43,8 @@ arch = "arm"; os = "linux"; compression = "none"; - load = <0xC0008000>; - entry = <0xC0008000>; + load = <0xC4000000>; + entry = <0xC4000000>; hash-1 { algo = "sha1"; }; diff --git a/board/st/stm32mp1/fit_kernel_dtb.its b/board/st/stm32mp1/fit_kernel_dtb.its index 18d03ebf3c..8456a3c460 100644 --- a/board/st/stm32mp1/fit_kernel_dtb.its +++ b/board/st/stm32mp1/fit_kernel_dtb.its @@ -3,7 +3,7 @@ * mkimage -f fit_kernel_dtb.its fit_kernel_dtb.itb * * Files in linux build dir: - * - arch/arm/boot/zImage + * - arch/arm/boot/Image (gzipped in Image.gz) * - arch/arm/boot/dts/stm32mp157c-dk2.dtb * - arch/arm/boot/dts/stm32mp157c-ev1.dtb * @@ -23,11 +23,11 @@ images { kernel { description = "Linux kernel"; - data = /incbin/("zImage"); + data = /incbin/("Image.gz"); type = "kernel"; arch = "arm"; os = "linux"; - compression = "none"; + compression = "gzip"; load = <0xC0008000>; entry = <0xC0008000>; hash-1 {