From patchwork Sun Oct 8 15:06:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 823010 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="J2DfxX31"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y96D607fPz9t3C for ; Mon, 9 Oct 2017 02:07:02 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:Message-Id: Date:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=EKrlIjvHj2XkYM/N/3vn/4gG4h/xNUu0zwliMUPQXvY=; b=J2DfxX31h1nNyv Rc55AenYTXrdgZZAiKkFA9X9HxVDc/HNRbUgcCrljwpeO2HOV51SqKjtc3wcNt+qEBnuJ5C7vbSm7 01a4wTvgqdUEjvsXXhSVzJaq/ukQ3h2E8IHYBabGBLyRWve9tkTjqhbeTwsydyMcit5Krjkc0bO6n DrZaZz06CJjGvyhQus+UW42S6uXJr3U5qgQWgrZeEXLE/lS7/fFlRsokAJKvmrz52oMXxKMp3cObS ha8z3iF3CbBDrCcJD7N94pkN5fKmJ4+9K1u8mDPv68iVNsIjB6i98MfpUnI69mg7k3ONZRKhArOFk ibRSnN1S4YNsiUej9/oA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e1DAS-0007F3-K7; Sun, 08 Oct 2017 15:07:00 +0000 Received: from mx2.mailbox.org ([80.241.60.215]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e1DAO-0007AC-72 for lede-dev@lists.infradead.org; Sun, 08 Oct 2017 15:06:58 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id E5E274C8A2; Sun, 8 Oct 2017 17:06:32 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id i8lVZl5KB_pw; Sun, 8 Oct 2017 17:06:30 +0200 (CEST) From: Hauke Mehrtens To: lede-dev@lists.infradead.org Date: Sun, 8 Oct 2017 17:06:14 +0200 Message-Id: <20171008150614.28695-1-hauke@hauke-m.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171008_080656_447533_AB0B8B3B X-CRM114-Status: UNSURE ( 8.66 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [80.241.60.215 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Subject: [LEDE-DEV] [PATCH] brcm47xx: relocate loader to higher address X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hauke Mehrtens , zajec5@gmail.com, p.wassi@gmx.at, jonas.gorski@gmail.com MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The boot process on a WRT54GL works the following way: 1. CFE gets loaded by the boot rom from flash 2. CFE loads the loader from the flash and gzip uncompresses it 3. CFE starts the loader 4. The loader stores the FW arguments and relocates itself to BZ_TEXT_START (now 0x80600000) 5. The loader reads the Linux image from flash 6. The loader lzma decompresses the Linux image to LOADADDR (0x80001000) 7. The loader executes the uncompress Linux image at LOADADDR The BZ_TEXT_START was set to 0x80400000 before. When the kernel gets uncompressed and is bigger than BZ_TEXT_START - LOADADDR it overwrote the loader which was currently uncompressing it and made the board crash. Increase the BZ_TEXT_START my 2 MB to have more space for the kernel. Even on 16MB RAM devices the memory goes till 0x80FFFFFF so this should not be a problem. Signed-off-by: Hauke Mehrtens --- target/linux/brcm47xx/image/lzma-loader/src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/brcm47xx/image/lzma-loader/src/Makefile b/target/linux/brcm47xx/image/lzma-loader/src/Makefile index 3320e565d0..444039c558 100644 --- a/target/linux/brcm47xx/image/lzma-loader/src/Makefile +++ b/target/linux/brcm47xx/image/lzma-loader/src/Makefile @@ -18,7 +18,7 @@ # TEXT_START := 0x80001000 -BZ_TEXT_START := 0x80400000 +BZ_TEXT_START := 0x80600000 OBJCOPY := $(CROSS_COMPILE)objcopy -O binary -R .reginfo -R .note -R .comment -R .mdebug -S