From patchwork Thu Mar 15 02:16:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 146807 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 649F3B6F13 for ; Thu, 15 Mar 2012 13:19:39 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D2F1528165; Thu, 15 Mar 2012 03:19:23 +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 3ZZqN0RfarJU; Thu, 15 Mar 2012 03:19:23 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 515DE280E8; Thu, 15 Mar 2012 03:17:31 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 06639280A0 for ; Thu, 15 Mar 2012 03:17:12 +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 cnZM22nYnbeT for ; Thu, 15 Mar 2012 03:17:11 +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-gy0-f202.google.com (mail-gy0-f202.google.com [209.85.160.202]) by theia.denx.de (Postfix) with ESMTPS id 0A03C280AA for ; Thu, 15 Mar 2012 03:17:03 +0100 (CET) Received: by ghbz15 with SMTP id z15so414050ghb.3 for ; Wed, 14 Mar 2012 19:17:01 -0700 (PDT) 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=h4YVvTovyIwLjUOlpSU2/Auhcep3uDZimmS9lKvItAo=; b=R09KFRQXnWkYwOCZHpi6dAjxilcMLW9kTl/EYMgu/TTSr5qQ10c+UnVyRqrV7bm/Lh 7ZDs1DHwtFBMCogB0WcpvLY0dlOxgXfcaAtNFvIeP6Onzupl2AienwZ2SpHpcZ3VLmTk O/IhCHPj1Q0DROSO7nH6PLRriKzZEnRv+PELqiABw/3km698oRmD3+cP5PSIqdLTdBj2 jkSH+JPm/duh4rOUCZ2sKGmea3icagHSO73TAloHRIiDMQ6410YCpyQjn9sjzgFVghw+ WoZA1F5lFjsdL2gECksAuXEIb9MyVoXFVgvhgI+zUE9/y+cVX74wjGlDs1nP0GQ/dXqN 8ojA== Received: by 10.224.1.131 with SMTP id 3mr2791668qaf.2.1331777821664; Wed, 14 Mar 2012 19:17:01 -0700 (PDT) Received: by 10.224.1.131 with SMTP id 3mr2791645qaf.2.1331777821595; Wed, 14 Mar 2012 19:17:01 -0700 (PDT) Received: from wpzn3.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id d64si295957yhn.3.2012.03.14.19.17.01 (version=TLSv1/SSLv3 cipher=AES128-SHA); Wed, 14 Mar 2012 19:17:01 -0700 (PDT) Received: from sglass.mtv.corp.google.com (dhcp-172-22-162-38.mtv.corp.google.com [172.22.162.38]) by wpzn3.hot.corp.google.com (Postfix) with ESMTP id 6AA6D10004D; Wed, 14 Mar 2012 19:17:01 -0700 (PDT) Received: by sglass.mtv.corp.google.com (Postfix, from userid 121222) id 45CCE140F5B; Wed, 14 Mar 2012 19:17:01 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Wed, 14 Mar 2012 19:16:18 -0700 Message-Id: <1331777784-8528-22-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1331777784-8528-1-git-send-email-sjg@chromium.org> References: <1331777784-8528-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQlbvk6gWVD3fWwW5qg9uJ45WqPHdHH68wQe2/GDAqhxlZx/CGBuelbVzE5W3wDj+pXVz1bUojUsrhdDXJTvwXRC93ueLMjOVbMiWY5EE84BB9YrjdvW3aOHBDkJgF3/HR/v3sRg5xpr0FngxvaHbGuPDRoa+02zoV77FeZzxPBs5r1FWQ8= Subject: [U-Boot] [PATCH v4 21/27] x86: Enable generic board support 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 This enables generic board support so that x86 boards can define CONFIG_SYS_GENERIC_BOARD. Signed-off-by: Simon Glass --- arch/x86/config.mk | 3 --- arch/x86/include/asm/global_data.h | 7 +++++++ arch/x86/include/asm/u-boot.h | 11 +++++++++++ arch/x86/lib/Makefile | 4 +++- common/board_r.c | 5 +++++ 5 files changed, 26 insertions(+), 4 deletions(-) diff --git a/arch/x86/config.mk b/arch/x86/config.mk index 7be3036..23cacff 100644 --- a/arch/x86/config.mk +++ b/arch/x86/config.mk @@ -48,6 +48,3 @@ NORMAL_LIBGCC = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name) PREFIXED_LIBGCC = $(OBJTREE)/arch/$(ARCH)/lib/$(shell basename $(NORMAL_LIBGCC)) export USE_PRIVATE_LIBGCC=$(shell dirname $(PREFIXED_LIBGCC)) - -# Move to unified board system later -CONFIG_SYS_LEGACY_BOARD := y diff --git a/arch/x86/include/asm/global_data.h b/arch/x86/include/asm/global_data.h index 908a02c..fe50856 100644 --- a/arch/x86/include/asm/global_data.h +++ b/arch/x86/include/asm/global_data.h @@ -23,6 +23,11 @@ #ifndef __ASM_GBL_DATA_H #define __ASM_GBL_DATA_H + +#ifdef CONFIG_SYS_GENERIC_BOARD +/* Use the generic board which requires a unified global_data */ +#include +#else /* * The following data structure is placed in some memory wich is * available very early after boot (like DPRAM on MPC8xx/MPC82xx, or @@ -86,6 +91,8 @@ static inline gd_t *get_fs_gd_ptr(void) #define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out) */ #define GD_FLG_ENV_READY 0x00080 /* Environment imported into hash table */ +#endif /* nCONFIG_SYS_GENERIC_BOARD */ + #define DECLARE_GLOBAL_DATA_PTR #endif /* __ASM_GBL_DATA_H */ diff --git a/arch/x86/include/asm/u-boot.h b/arch/x86/include/asm/u-boot.h index dd42209..ef8b7d5 100644 --- a/arch/x86/include/asm/u-boot.h +++ b/arch/x86/include/asm/u-boot.h @@ -36,6 +36,13 @@ #ifndef _U_BOOT_H_ #define _U_BOOT_H_ 1 +#ifdef CONFIG_SYS_GENERIC_BOARD +/* Use the generic board which requires a unified bd_info */ +#include +#else + +#ifndef __ASSEMBLY__ + typedef struct bd_info { unsigned long bi_memstart; /* start of DRAM memory */ phys_size_t bi_memsize; /* size of DRAM memory in bytes */ @@ -58,6 +65,10 @@ typedef struct bd_info { }bi_dram[CONFIG_NR_DRAM_BANKS]; } bd_t; +#endif /* __ASSEMBLY__ */ + +#endif /* nCONFIG_SYS_GENERIC_BOARD */ + /* For image.h:image_check_target_arch() */ #define IH_ARCH_DEFAULT IH_ARCH_I386 diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile index 51836da..a2083f4 100644 --- a/arch/x86/lib/Makefile +++ b/arch/x86/lib/Makefile @@ -30,7 +30,9 @@ SOBJS-$(CONFIG_SYS_PCI_BIOS) += bios_pci.o SOBJS-$(CONFIG_SYS_X86_REALMODE) += realmode_switch.o COBJS-$(CONFIG_SYS_PC_BIOS) += bios_setup.o -COBJS-y += board.o +ifeq ($(CONFIG_SYS_GENERIC_BOARD),) +COBJS-y += board.o +endif COBJS-y += bootm.o COBJS-y += cmd_boot.o COBJS-y += gcc.o diff --git a/common/board_r.c b/common/board_r.c index 8b9adc2..f587c03 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -56,12 +56,15 @@ static int initr_reloc(void) * Some of these functions are needed purely because the functions they * call return void. If we change them to return 0, these stubs can go away. */ +#ifdef CONFIG_ARM static int initr_caches(void) { + /* TODO: sort out x86 code here */ /* Enable caches */ enable_caches(); return 0; } +#endif static int initr_reloc_global_data(void) { @@ -232,11 +235,13 @@ static int initr_api(void) #endif /* enable exceptions */ +#ifdef CONFIG_ARM static int initr_enable_interrupts(void) { enable_interrupts(); return 0; } +#endif #ifdef CONFIG_CMD_NET static int initr_ethaddr(void)