From patchwork Tue Nov 8 12:33:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Graeme Russ X-Patchwork-Id: 124346 X-Patchwork-Delegate: graeme.russ@gmail.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 863FA1007D3 for ; Tue, 8 Nov 2011 23:35:51 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3BA3829927; Tue, 8 Nov 2011 13:34: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 DOMLiKwZyIcj; Tue, 8 Nov 2011 13:34:56 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AF8EC29928; Tue, 8 Nov 2011 13:34:15 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F32E82943B for ; Tue, 8 Nov 2011 13:34:06 +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 q7Z6U93nW6T1 for ; Tue, 8 Nov 2011 13:34:06 +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-f172.google.com (mail-gy0-f172.google.com [209.85.160.172]) by theia.denx.de (Postfix) with ESMTPS id 04EE4297F9 for ; Tue, 8 Nov 2011 13:33:53 +0100 (CET) Received: by mail-gy0-f172.google.com with SMTP id 5so469058gye.3 for ; Tue, 08 Nov 2011 04:33:53 -0800 (PST) Received: by 10.236.136.167 with SMTP id w27mr41292952yhi.65.1320755633316; Tue, 08 Nov 2011 04:33:53 -0800 (PST) Received: from localhost.localdomain (d122-104-32-210.sbr6.nsw.optusnet.com.au. [122.104.32.210]) by mx.google.com with ESMTPS id u19sm3948194ank.11.2011.11.08.04.33.51 (version=SSLv3 cipher=OTHER); Tue, 08 Nov 2011 04:33:52 -0800 (PST) From: Graeme Russ To: u-boot@lists.denx.de Date: Tue, 8 Nov 2011 23:33:20 +1100 Message-Id: <1320755603-8695-10-git-send-email-graeme.russ@gmail.com> X-Mailer: git-send-email 1.7.5.2.317.g391b14 In-reply-to: <1320459711-20257-5-git-send-email-graeme.russ@gmail.com> Cc: Graeme Russ Subject: [U-Boot] [PATCH v2 09/12] x86: Provide more configuration granularity 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 Planned future ports requires more granularity for some options Signed-off-by: Graeme Russ --- Changes for v1: - None (skipped to set single version for consolidated series) Changes for v2: - Consolidated patch series - Fixed checkpatch issues - Removed non x86 modification to common/cmd_bdinfo.c arch/x86/lib/Makefile | 18 +++++++++--------- arch/x86/lib/board.c | 9 +++++++++ arch/x86/lib/bootm.c | 4 +++- arch/x86/lib/pci.c | 36 ++++++++++++++++++++++++++++++++++++ arch/x86/lib/video_bios.c | 41 ----------------------------------------- common/cmd_bdinfo.c | 3 ++- include/configs/eNET.h | 5 +++++ 7 files changed, 64 insertions(+), 52 deletions(-) -- 1.7.5.2.317.g391b14 diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile index 71e94f7..eb5fa10 100644 --- a/arch/x86/lib/Makefile +++ b/arch/x86/lib/Makefile @@ -25,11 +25,11 @@ include $(TOPDIR)/config.mk LIB = $(obj)lib$(ARCH).o -SOBJS-y += bios.o -SOBJS-y += bios_pci.o -SOBJS-y += realmode_switch.o +SOBJS-$(CONFIG_SYS_PC_BIOS) += bios.o +SOBJS-$(CONFIG_SYS_PCI_BIOS) += bios_pci.o +SOBJS-$(CONFIG_SYS_X86_REALMODE) += realmode_switch.o -COBJS-y += bios_setup.o +COBJS-$(CONFIG_SYS_PC_BIOS) += bios_setup.o COBJS-y += board.o COBJS-y += bootm.o COBJS-y += interrupts.o @@ -37,11 +37,11 @@ COBJS-$(CONFIG_SYS_PCAT_INTERRUPTS) += pcat_interrupts.o COBJS-$(CONFIG_SYS_GENERIC_TIMER) += pcat_timer.o COBJS-$(CONFIG_PCI) += pci.o COBJS-$(CONFIG_PCI) += pci_type1.o -COBJS-y += realmode.o -COBJS-y += timer.o -COBJS-y += video_bios.o -COBJS-y += video.o -COBJS-y += zimage.o +COBJS-$(CONFIG_SYS_X86_REALMODE) += realmode.o +COBJS-$(CONFIG_SYS_X86_ISR_TIMER) += timer.o +COBJS-$(CONFIG_VIDEO) += video_bios.o +COBJS-$(CONFIG_VIDEO) += video.o +COBJS-$(CONFIG_CMD_ZBOOT) += zimage.o SRCS := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c) OBJS := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y)) diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c index e8227b1..b445179 100644 --- a/arch/x86/lib/board.c +++ b/arch/x86/lib/board.c @@ -91,11 +91,13 @@ static int display_dram_config(void) return 0; } +#ifndef CONFIG_SYS_NO_FLASH static void display_flash_config(ulong size) { puts("Flash: "); print_size(size, "\n"); } +#endif /* * Breath some life into the board... @@ -254,8 +256,12 @@ void board_init_f(ulong boot_flags) void board_init_r(gd_t *id, ulong dest_addr) { +#if defined(CONFIG_CMD_NET) char *s; +#endif +#ifndef CONFIG_SYS_NO_FLASH ulong size; +#endif static bd_t bd_data; static gd_t gd_data; init_fnc_t **init_fnc_ptr; @@ -287,10 +293,13 @@ void board_init_r(gd_t *id, ulong dest_addr) #ifdef CONFIG_SERIAL_MULTI serial_initialize(); #endif + +#ifndef CONFIG_SYS_NO_FLASH /* configure available FLASH banks */ size = flash_init(); display_flash_config(size); show_boot_progress(0x24); +#endif show_boot_progress(0x25); diff --git a/arch/x86/lib/bootm.c b/arch/x86/lib/bootm.c index 836803c..bac7b4f 100644 --- a/arch/x86/lib/bootm.c +++ b/arch/x86/lib/bootm.c @@ -35,7 +35,7 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *images) { - void *base_ptr; + void *base_ptr = NULL; ulong os_data, os_len; image_header_t *hdr; @@ -73,8 +73,10 @@ int do_bootm_linux(int flag, int argc, char * const argv[], goto error; } +#ifdef CONFIG_CMD_ZBOOT base_ptr = load_zimage((void *)os_data, os_len, images->rd_start, images->rd_end - images->rd_start, 0); +#endif if (NULL == base_ptr) { printf("## Kernel loading failed ...\n"); diff --git a/arch/x86/lib/pci.c b/arch/x86/lib/pci.c index f3018b7..286029e 100644 --- a/arch/x86/lib/pci.c +++ b/arch/x86/lib/pci.c @@ -151,3 +151,39 @@ int pci_shadow_rom(pci_dev_t dev, unsigned char *dest) return res; } + +#ifdef PCI_BIOS_DEBUG + +void print_bios_bios_stat(void) +{ + printf("16 bit functions:\n"); + printf("pci_bios_present: %d\n", + RELOC_16_LONG(0xf000, num_pci_bios_present)); + printf("pci_bios_find_device: %d\n", + RELOC_16_LONG(0xf000, num_pci_bios_find_device)); + printf("pci_bios_find_class: %d\n", + RELOC_16_LONG(0xf000, num_pci_bios_find_class)); + printf("pci_bios_generate_special_cycle: %d\n", + RELOC_16_LONG(0xf000, + num_pci_bios_generate_special_cycle)); + printf("pci_bios_read_cfg_byte: %d\n", + RELOC_16_LONG(0xf000, num_pci_bios_read_cfg_byte)); + printf("pci_bios_read_cfg_word: %d\n", + RELOC_16_LONG(0xf000, num_pci_bios_read_cfg_word)); + printf("pci_bios_read_cfg_dword: %d\n", + RELOC_16_LONG(0xf000, num_pci_bios_read_cfg_dword)); + printf("pci_bios_write_cfg_byte: %d\n", + RELOC_16_LONG(0xf000, num_pci_bios_write_cfg_byte)); + printf("pci_bios_write_cfg_word: %d\n", + RELOC_16_LONG(0xf000, num_pci_bios_write_cfg_word)); + printf("pci_bios_write_cfg_dword: %d\n", + RELOC_16_LONG(0xf000, num_pci_bios_write_cfg_dword)); + printf("pci_bios_get_irq_routing: %d\n", + RELOC_16_LONG(0xf000, num_pci_bios_get_irq_routing)); + printf("pci_bios_set_irq: %d\n", + RELOC_16_LONG(0xf000, num_pci_bios_set_irq)); + printf("pci_bios_unknown_function: %d\n", + RELOC_16_LONG(0xf000, num_pci_bios_unknown_function)); +} +#endif + diff --git a/arch/x86/lib/video_bios.c b/arch/x86/lib/video_bios.c index f89f7d6..1e06759 100644 --- a/arch/x86/lib/video_bios.c +++ b/arch/x86/lib/video_bios.c @@ -39,45 +39,6 @@ #define PRINTF(fmt, args...) #endif -#ifdef CONFIG_PCI - -#ifdef PCI_BIOS_DEBUG -void print_bios_bios_stat(void) -{ - printf("16 bit functions:\n"); - printf("pci_bios_present: %d\n", - RELOC_16_LONG(0xf000, num_pci_bios_present)); - printf("pci_bios_find_device: %d\n", - RELOC_16_LONG(0xf000, num_pci_bios_find_device)); - printf("pci_bios_find_class: %d\n", - RELOC_16_LONG(0xf000, num_pci_bios_find_class)); - printf("pci_bios_generate_special_cycle: %d\n", - RELOC_16_LONG(0xf000, - num_pci_bios_generate_special_cycle)); - printf("pci_bios_read_cfg_byte: %d\n", - RELOC_16_LONG(0xf000, num_pci_bios_read_cfg_byte)); - printf("pci_bios_read_cfg_word: %d\n", - RELOC_16_LONG(0xf000, num_pci_bios_read_cfg_word)); - printf("pci_bios_read_cfg_dword: %d\n", - RELOC_16_LONG(0xf000, num_pci_bios_read_cfg_dword)); - printf("pci_bios_write_cfg_byte: %d\n", - RELOC_16_LONG(0xf000, num_pci_bios_write_cfg_byte)); - printf("pci_bios_write_cfg_word: %d\n", - RELOC_16_LONG(0xf000, num_pci_bios_write_cfg_word)); - printf("pci_bios_write_cfg_dword: %d\n", - RELOC_16_LONG(0xf000, num_pci_bios_write_cfg_dword)); - printf("pci_bios_get_irq_routing: %d\n", - RELOC_16_LONG(0xf000, num_pci_bios_get_irq_routing)); - printf("pci_bios_set_irq: %d\n", - RELOC_16_LONG(0xf000, num_pci_bios_set_irq)); - printf("pci_bios_unknown_function: %d\n", - RELOC_16_LONG(0xf000, num_pci_bios_unknown_function)); - -} -#endif - -#ifdef CONFIG_VIDEO - #define PCI_CLASS_VIDEO 3 #define PCI_CLASS_VIDEO_STD 0 #define PCI_CLASS_VIDEO_PROG_IF_VGA 0 @@ -233,5 +194,3 @@ int video_bios_init(void) return 1; } -#endif -#endif diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index 688b238..6c48594 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -31,7 +31,8 @@ DECLARE_GLOBAL_DATA_PTR; static void print_num(const char *, ulong); -#if !(defined(CONFIG_ARM) || defined(CONFIG_M68K) || defined(CONFIG_SANDBOX)) \ +#if !(defined(CONFIG_ARM) || defined(CONFIG_M68K) || \ + defined(CONFIG_SANDBOX) || defined(CONFIG_X86)) \ || defined(CONFIG_CMD_NET) #define HAVE_PRINT_ETH static void print_eth(int idx); diff --git a/include/configs/eNET.h b/include/configs/eNET.h index 70c74f6..d5c9cad 100644 --- a/include/configs/eNET.h +++ b/include/configs/eNET.h @@ -105,6 +105,7 @@ #define CONFIG_CMD_SETGETDCR #define CONFIG_CMD_SOURCE #define CONFIG_CMD_XIMG +#define CONFIG_CMD_ZBOOT #define CONFIG_BOOTDELAY 15 #define CONFIG_BOOTARGS "root=/dev/mtdblock0 console=ttyS0,9600" @@ -153,6 +154,10 @@ #undef CONFIG_SYS_GENERIC_TIMER #define CONFIG_SYS_PCAT_INTERRUPTS #define CONFIG_SYS_NUM_IRQS 16 +#define CONFIG_SYS_PC_BIOS +#define CONFIG_SYS_PCI_BIOS +#define CONFIG_SYS_X86_REALMODE +#define CONFIG_SYS_X86_ISR_TIMER /*----------------------------------------------------------------------- * Memory organization: