From patchwork Mon May 13 15:37:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 16886 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f71.google.com (mail-qa0-f71.google.com [209.85.216.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AA31C25E14 for ; Mon, 13 May 2013 15:37:35 +0000 (UTC) Received: by mail-qa0-f71.google.com with SMTP id g10sf3830613qah.6 for ; Mon, 13 May 2013 08:37:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-beenthere:x-received:received-spf:x-received :x-forwarded-to:x-forwarded-for:delivered-to:x-received:received-spf :x-received:date:from:to:cc:subject:message-id:mime-version :user-agent:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type:content-disposition; bh=9wF1ey7c66asmAltQ1B7l3QFLoJkmTdoExjg6FH2C/o=; b=KWI9QCx9aN4Xzg6m6snQb+5u2BO9DvbWs0p6V4tyyEoIcdxOFSb3yAaooeLBUigCPk e5frHp36XRNNjvFOPaX2n/7qztWgAXM07gCBZtTlOSN/KNa6F0B1ZGowx+hEzzmH/wRY cTuKjvBCohhXxbcObIhgtHZLvdM2BVYq4K7wLCS+RzlFDJi6sFt1kUfXV1dBaGf/QV8u Bq347Y5UwtSC5jR07koJjpsuFvz0IR/9G9OlHvtRVK4z9j+IA7vngjPFg3zxmIT3UFy4 hrQynztxnasP2U4E2gIZQ3McS8leGpsPJOpDGgxPqdof0xFEQQE9DagHGrbwrR6PB6BB Q2dg== X-Received: by 10.236.161.234 with SMTP id w70mr15265039yhk.22.1368459422847; Mon, 13 May 2013 08:37:02 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.105.7 with SMTP id gi7ls515273qeb.56.gmail; Mon, 13 May 2013 08:37:02 -0700 (PDT) X-Received: by 10.58.234.134 with SMTP id ue6mr18994003vec.20.1368459422556; Mon, 13 May 2013 08:37:02 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id by3si8684537vdc.134.2013.05.13.08.37.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 13 May 2013 08:37:02 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id id13so2270149vcb.23 for ; Mon, 13 May 2013 08:37:02 -0700 (PDT) X-Received: by 10.220.189.9 with SMTP id dc9mr18673665vcb.8.1368459422481; Mon, 13 May 2013 08:37:02 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.217.15 with SMTP id hk15csp23399vcb; Mon, 13 May 2013 08:37:01 -0700 (PDT) X-Received: by 10.15.21.9 with SMTP id c9mr80435883eeu.7.1368459421310; Mon, 13 May 2013 08:37:01 -0700 (PDT) Received: from mail-ea0-x232.google.com (mail-ea0-x232.google.com [2a00:1450:4013:c01::232]) by mx.google.com with ESMTPS id m7si23480475eeu.94.2013.05.13.08.37.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 13 May 2013 08:37:01 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:4013:c01::232 is neither permitted nor denied by best guess record for domain of leif.lindholm@linaro.org) client-ip=2a00:1450:4013:c01::232; Received: by mail-ea0-f178.google.com with SMTP id q16so642957ead.9 for ; Mon, 13 May 2013 08:37:00 -0700 (PDT) X-Received: by 10.14.0.129 with SMTP id 1mr79282621eeb.43.1368459420583; Mon, 13 May 2013 08:37:00 -0700 (PDT) Received: from rocoto.smurfnet.nu ([2001:4b98:dc0:41:216:3eff:fea7:75f3]) by mx.google.com with ESMTPSA id c42sm3255170eeb.10.2013.05.13.08.36.58 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 13 May 2013 08:36:59 -0700 (PDT) Date: Mon, 13 May 2013 15:37:32 +0000 From: Leif Lindholm To: grub-devel@gnu.org Cc: patches@linaro.org Subject: [PATCH] ARM U-Boot BSS zeroing Message-ID: <20130513153729.GL28516@rocoto.smurfnet.nu> MIME-Version: 1.0 User-Agent: Mutt/1.5.20 (2009-06-14) X-Gm-Message-State: ALoCoQljh5ao+Rr5TV6M5fgAkW7Hlf2m9c09W7NK1/N5DFefBlXZH07/4WiLrZmvNKbZhY8RTA86 X-Original-Sender: leif.lindholm@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Content-Disposition: inline The import into the collaborative branch discarded the call to get_real_bss_start before starting the BSS zeroing operation. While get_real_bss_start might have been a bit of an ugly hack, simply discarding it means that we now end up doing unaligned STR operations, and any platform with MMU disabled fails to boot. The attached patch prepends a bytewise zeroing loop until word-aligned, and then continue as before. / Leif === modified file 'grub-core/kern/arm/uboot/startup.S' --- grub-core/kern/arm/uboot/startup.S 2013-05-03 13:07:39 +0000 +++ grub-core/kern/arm/uboot/startup.S 2013-05-13 14:59:43 +0000 @@ -100,7 +100,13 @@ @ Since we _are_ the C run-time, we need to manually zero the BSS @ region before continuing ldr r0, =EXT_C(__bss_start) @ zero from here - ldr r1, =EXT_C(_end) @ to here + @ If unaligned, bytewise zero until base address aligned. + mov r1, #0 +1: tst r0, #3 + beq 2f + strb r1, [r0], #1 + b 1b +2: ldr r1, =EXT_C(_end) @ to here mov r2, #0 1: str r2, [r0], #4 cmp r0, r1