From patchwork Tue Sep 13 07:10:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 114449 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 43B8AB70C7 for ; Tue, 13 Sep 2011 17:14:17 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 34C7D282D1; Tue, 13 Sep 2011 09:13:24 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DbFv-ItHwuqu; Tue, 13 Sep 2011 09:13:23 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A3C0A28328; Tue, 13 Sep 2011 09:11:44 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DA4792826F for ; Tue, 13 Sep 2011 09:11:42 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6NxFEk5+AwKA for ; Tue, 13 Sep 2011 09:11:42 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-bw0-f44.google.com (mail-bw0-f44.google.com [209.85.214.44]) by theia.denx.de (Postfix) with ESMTPS id 3150E282D1 for ; Tue, 13 Sep 2011 09:10:58 +0200 (CEST) Received: by mail-bw0-f44.google.com with SMTP id q10so195011bka.3 for ; Tue, 13 Sep 2011 00:10:58 -0700 (PDT) Received: by 10.204.152.76 with SMTP id f12mr2278572bkw.291.1315897858363; Tue, 13 Sep 2011 00:10:58 -0700 (PDT) Received: from localhost ([178.23.216.97]) by mx.google.com with ESMTPS id y8sm455665bkb.4.2011.09.13.00.10.57 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 13 Sep 2011 00:10:57 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de Date: Tue, 13 Sep 2011 09:10:13 +0200 Message-Id: <1315897821-23049-19-git-send-email-monstr@monstr.eu> X-Mailer: git-send-email 1.5.5.1 In-Reply-To: <1315897821-23049-18-git-send-email-monstr@monstr.eu> References: <1315897821-23049-1-git-send-email-monstr@monstr.eu> <1315897821-23049-2-git-send-email-monstr@monstr.eu> <1315897821-23049-3-git-send-email-monstr@monstr.eu> <1315897821-23049-4-git-send-email-monstr@monstr.eu> <1315897821-23049-5-git-send-email-monstr@monstr.eu> <1315897821-23049-6-git-send-email-monstr@monstr.eu> <1315897821-23049-7-git-send-email-monstr@monstr.eu> <1315897821-23049-8-git-send-email-monstr@monstr.eu> <1315897821-23049-9-git-send-email-monstr@monstr.eu> <1315897821-23049-10-git-send-email-monstr@monstr.eu> <1315897821-23049-11-git-send-email-monstr@monstr.eu> <1315897821-23049-12-git-send-email-monstr@monstr.eu> <1315897821-23049-13-git-send-email-monstr@monstr.eu> <1315897821-23049-14-git-send-email-monstr@monstr.eu> <1315897821-23049-15-git-send-email-monstr@monstr.eu> <1315897821-23049-16-git-send-email-monstr@monstr.eu> <1315897821-23049-17-git-send-email-monstr@monstr.eu> <1315897821-23049-18-git-send-email-monstr@monstr.eu> Subject: [U-Boot] [PATCH 18/26] microblaze: Save and restore first unused vector X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Use one memory space to detect little/big endian platforms. The first unused address(0x28) is used instead 0x0 address (reset vectors). Detection rewrited reset vector setup from first stage bootloader. Workflow: 1. Store 0x28 to r7 2. Do little/big endian test 3. Restore r7 to 0x28 Signed-off-by: Michal Simek --- arch/microblaze/cpu/start.S | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/microblaze/cpu/start.S b/arch/microblaze/cpu/start.S index 17c0e28..42104fa 100644 --- a/arch/microblaze/cpu/start.S +++ b/arch/microblaze/cpu/start.S @@ -51,8 +51,10 @@ _start: * 4b) BIG endian - r10 contains 0x0 because 0x2 offset is on addr 0x3 */ addik r6, r0, 0x2 /* BIG/LITTLE endian offset */ - swi r6, r0, 0 - lbui r10, r0, 0 + lwi r7, r0, 0x28 + swi r6, r0, 0x28 /* used first unused MB vector */ + lbui r10, r0, 0x28 /* used first unused MB vector */ + swi r7, r0, 0x28 /* add opcode instruction for 32bit jump - 2 instruction imm & brai */ addi r2, r0, 0xb0000000 /* hex b000 opcode imm */