Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id EB167C433F5 for ; Sat, 5 Feb 2022 16:42:09 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7C69183BBB; Sat, 5 Feb 2022 17:40:13 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1644079213; bh=uUqxedyNw+BAC4HK9zhcblHaIN7fM16XyTdofuBCrcc=; h=From:To:Subject:In-reply-to:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From; b=BZX1hFfZ+Yf0BZAu/bKtCRXPs91YKH0B3lQ6072Y6YquIWOAdY8pJbM8BRkNsJLDn UKBbKHIhokrPxQxxlJOowJVDaoHtfsh5heRlogdrCYxSXx+UwoAmTqtqFec8F/oLlC 0IjYgIVB4xCzKTmIKr6c6E8MhilcC7xkf+q8EcWfenc45PFVhTdBFWraXfXm7wiSSy tfwYV7KTpsDBwSFdm6oTT9J0PrrkCbRNEc/KzgudF0UKbItX4J779z+1PG6r+aoNrF IeermdtaX+DE1EX08YpTzxUkcjHwrd6CdFdHVQopVDU+1aWHufTd0CUPvPzdcBYrad b/3ik4VATU/UQ== Received: by phobos.denx.de (Postfix, from userid 109) id B918A83B54; Sat, 5 Feb 2022 17:40:11 +0100 (CET) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) (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 63F8B83B69 for ; Sat, 5 Feb 2022 17:40:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sbabic@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4JrdRr0wXfz1sYfM; Sat, 5 Feb 2022 17:40:08 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4JrdRr0lKPz1qqkC; Sat, 5 Feb 2022 17:40:08 +0100 (CET) X-Amavis-Alert: BAD HEADER SECTION, Missing required header field: "Date" Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id fxqNTrI84mfR; Sat, 5 Feb 2022 17:40:07 +0100 (CET) Received: from papero (host-88-217-136-221.customer.m-online.net [88.217.136.221]) by mail.mnet-online.de (Postfix) with ESMTP; Sat, 5 Feb 2022 17:40:07 +0100 (CET) From: sbabic@denx.de X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 1570128 X-Patchwork-Delegate: sbabic@denx.de To: Lukasz Majewski ,u-boot@lists.denx.de Subject: [PATCH] spl: Provide more space to be used for storing SPL on imx28 OCRAM In-reply-to: <20211217154125.32294-1-lukma@denx.de> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Message-Id: <20220205164011.B918A83B54@phobos.denx.de> Date: Sat, 5 Feb 2022 17:40:08 +0100 (CET) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean > With the current configuration provided in mxsimage{-spl}.mx28.cfg the > size of SPL binary has been constrained to 32 KiB, due to "LOAD IVT" > command with 0x8000 offset. > The problem was that, the imx28 ROM takes the u-boot.sb and then > extracts from it the IVT header and places it on the 0x8000 OCRAM offset > overwriting any valid (i.e. loaded from eMMC or SPI-NOR) SPL code. This > bug was unnoticed as the overwrite size was just 32 bytes, so the > probability that some important code is altered was low. > However, in the XEA board (where the SPL size is ~39KiB), the overwritten > data was `(struct dm_spi_ops *) 0x800c `, which is used > during the boot process. > As a result the SPL execution code hanged with "undefined instruction" > abort as callbacks (with wrong addresses) from it were called. > The fix is to change the OCRAM's offset where IVT is loaded to 0xE000, > so the SPL can grow up to ~57KiB (the maximal size of OCRAM memory > available is 0xE3FC). > Signed-off-by: Lukasz Majewski Applied to u-boot-imx, master, thanks ! Best regards, Stefano Babic -- ===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de =====================================================================