From patchwork Fri Nov 16 21:19:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 199738 X-Patchwork-Delegate: trini@ti.com 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 CCDFA2C0090 for ; Sat, 17 Nov 2012 08:30:01 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A3A324A196; Fri, 16 Nov 2012 22:29:57 +0100 (CET) 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 kVRDVWfgSJgb; Fri, 16 Nov 2012 22:29:57 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 36F8F4A1BC; Fri, 16 Nov 2012 22:29:03 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 087164A1BC for ; Fri, 16 Nov 2012 22:28:56 +0100 (CET) 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 qCG8TO7HB8W6 for ; Fri, 16 Nov 2012 22:28:55 +0100 (CET) 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-la0-f74.google.com (mail-la0-f74.google.com [209.85.215.74]) by theia.denx.de (Postfix) with ESMTPS id 9C41D4A186 for ; Fri, 16 Nov 2012 22:28:49 +0100 (CET) Received: by mail-la0-f74.google.com with SMTP id v3so234655lag.3 for ; Fri, 16 Nov 2012 13:28:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=U25xNW+D2jEQzsy76b8wm7cHAsvAWbH7fPVMSX8ggpA=; b=mV3lGAeFlStzZbI0ZNFIHEk3D6/VXPOedvePabxdrg83NEHBEVryFOOIwe6v2dJzUS dGULgNIcMr+UTyVgLG+aVq7J/Ntu0C+LUDJGgCmDWU6sQiXYem2e7VBOhOSHkkDCJ7mX N5g1NW4j6LwsfMTc8jqGKYVkyGWn30G+cE9KuqciELD2DtoOCcMSd1suQ2zP9FKRtE0+ rZXoo8PJRS6O6kyL9qXcwO9nsmn5/UQIYOSyG7rvv34rUKiXi+m9Ernncl2yy/m76vQL xoaLgPFJYk/LX+yiAacOBtRNFJvraUc+6RVRu8KKk646vAsicHfGQU3BVY09HVIyiOju sL/g== Received: by 10.14.199.6 with SMTP id w6mr471128een.0.1353101329314; Fri, 16 Nov 2012 13:28:49 -0800 (PST) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id u8si633142een.1.2012.11.16.13.28.49 (version=TLSv1/SSLv3 cipher=AES128-SHA); Fri, 16 Nov 2012 13:28:49 -0800 (PST) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.73.79]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id ED68F200059; Fri, 16 Nov 2012 13:28:48 -0800 (PST) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 575571608F7; Fri, 16 Nov 2012 13:28:48 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Date: Fri, 16 Nov 2012 13:19:56 -0800 Message-Id: <1353100842-20126-12-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1353100842-20126-1-git-send-email-sjg@chromium.org> References: <1353100842-20126-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQlOWeNMKmPGhnL5G5GdhawtH8Ot/owYbS056Hwv+bsuVaJWM8e3afYBMSKIsP61Ns7DeychIcKmFyz5ZQmcssHsbVT7UyNv0WisE8GLRHw7BKqMy7/wXH/JDquMncel2jUI6vLt8CoLpK3XH7PkSnm+iOD+1xGQzZT/ZxFm4iC5oXat3yU5Lg3I2CvBCWOmhdFAkuAS Cc: Tom Rini Subject: [U-Boot] [PATCH 11/57] x86: Move gdt_addr, new_gd_addr to arch_global_data X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 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 Move these field into arch_global_data and tidy up. Signed-off-by: Simon Glass --- arch/x86/include/asm/global_data.h | 4 ++-- arch/x86/lib/init_helpers.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/x86/include/asm/global_data.h b/arch/x86/include/asm/global_data.h index b4b749b..ce96efb 100644 --- a/arch/x86/include/asm/global_data.h +++ b/arch/x86/include/asm/global_data.h @@ -28,6 +28,8 @@ /* Architecture-specific global data */ struct arch_global_data { + unsigned long gdt_addr; /* Location of GDT */ + unsigned long new_gd_addr; /* New location of Global Data */ }; /* @@ -56,8 +58,6 @@ typedef struct global_data { unsigned long bus_clk; unsigned long relocaddr; /* Start address of U-Boot in RAM */ unsigned long start_addr_sp; /* start_addr_stackpointer */ - unsigned long gdt_addr; /* Location of GDT */ - unsigned long new_gd_addr; /* New location of Global Data */ phys_size_t ram_size; /* RAM size */ unsigned long reset_status; /* reset status register at boot */ void **jt; /* jump table */ diff --git a/arch/x86/lib/init_helpers.c b/arch/x86/lib/init_helpers.c index 9ec34ff..05cadcd 100644 --- a/arch/x86/lib/init_helpers.c +++ b/arch/x86/lib/init_helpers.c @@ -87,12 +87,12 @@ int calculate_relocation_address(void) dest_addr = gd->ram_size; dest_addr -= GENERATED_GBL_DATA_SIZE; dest_addr &= ~15; - gd->new_gd_addr = dest_addr; + gd->arch.new_gd_addr = dest_addr; /* GDT is below Global Data */ dest_addr -= X86_GDT_SIZE; dest_addr &= ~15; - gd->gdt_addr = dest_addr; + gd->arch.gdt_addr = dest_addr; /* Stack is below GDT */ gd->start_addr_sp = dest_addr; @@ -113,12 +113,12 @@ int copy_gd_to_ram_f_r(void) /* * Global data is still in temporary memory (the CPU cache). - * calculate_relocation_address() has set gd->new_gd_addr to + * calculate_relocation_address() has set gd->arch.new_gd_addr to * where the global data lives in RAM but getting it there * safely is a bit tricky due to the 'F-Segment Hack' that * we need to use for x86 */ - ram_gd = (gd_t *)gd->new_gd_addr; + ram_gd = (gd_t *)gd->arch.new_gd_addr; memcpy((void *)ram_gd, gd, sizeof(gd_t)); /* @@ -127,7 +127,7 @@ int copy_gd_to_ram_f_r(void) * has already calculated the in-RAM location of the GDT) */ ram_gd->gd_addr = (ulong)ram_gd; - init_gd(ram_gd, (u64 *)gd->gdt_addr); + init_gd(ram_gd, (u64 *)gd->arch.gdt_addr); return 0; }