From patchwork Mon May 25 14:36:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 476226 X-Patchwork-Delegate: sjg@chromium.org 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 B2EBC1401B5 for ; Tue, 26 May 2015 00:37:27 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=aTc0ZUWW; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DB8AE4B73E; Mon, 25 May 2015 16:37:18 +0200 (CEST) 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 uj4fE09sAOus; Mon, 25 May 2015 16:37:18 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BAA824B758; Mon, 25 May 2015 16:37:10 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A100C4B72A for ; Mon, 25 May 2015 16:37:06 +0200 (CEST) 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 G7_JJMW3SCRt for ; Mon, 25 May 2015 16:37:06 +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-qk0-f175.google.com (mail-qk0-f175.google.com [209.85.220.175]) by theia.denx.de (Postfix) with ESMTPS id 0C49E4B717 for ; Mon, 25 May 2015 16:36:58 +0200 (CEST) Received: by qkdn188 with SMTP id n188so65958454qkd.2 for ; Mon, 25 May 2015 07:36:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:from:to:subject:date:in-reply-to:references:mime-version :content-type; bh=hkcuuy41ZM3qI+B1fe0CYrFiuu0tgXpBPzRqw+tMx7w=; b=aTc0ZUWWpcy9H5QTQBKaU2VtTRURewtUPFnuMgbAZfA0cJLF1JZpQOSPbWaeuU5x+/ wTu9gau722F4MZtTnRmsUlpJPJ/qs4QGBk6xr/ZvDzw6AQ6BKi1niqDPieqbXydwADu3 rWUXt4ihW/RH9k8Qc4RTlBhQE9aeGbe4L0NyRNshW1ueixftfoHgnlFUstoZQ58Cxkg2 5sOv0N9uF6NUynfmGg9x2XsuZvojww/nbkzBaVcOInvkMrRIfArhZK+lzYFlyeNETYXK A6GMXV2VnKhBf0iQDgKf7YVHINzgZVSWLahLB/tqJUTbx8na0G9aSuGnpJz/cZ8y8mi1 A5BA== X-Received: by 10.229.104.67 with SMTP id n3mr29153361qco.29.1432564617905; Mon, 25 May 2015 07:36:57 -0700 (PDT) Received: from mail.hotmail.com (blu004-wss1s3.hotmail.com. [134.170.2.218]) by mx.google.com with ESMTPSA id d11sm6914383qgd.31.2015.05.25.07.36.57 (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 May 2015 07:36:57 -0700 (PDT) Received: from BLU437-SMTP35 ([134.170.2.215]) by BLU004-WSS1S3.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.22751); Mon, 25 May 2015 07:36:57 -0700 X-TMN: [0Ms07iO1f9JQDbc/5UO2A8k562NN1Nxb] Message-ID: From: Bin Meng To: Simon Glass , U-Boot Mailing List Date: Mon, 25 May 2015 22:36:30 +0800 X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1432564591-23963-1-git-send-email-bmeng.cn@gmail.com> References: <1432564591-23963-1-git-send-email-bmeng.cn@gmail.com> X-OriginalArrivalTime: 25 May 2015 14:36:56.0379 (UTC) FILETIME=[4003C8B0:01D096F8] MIME-Version: 1.0 Subject: [U-Boot] [PATCH 5/6] x86: qemu: Create i440fx and q35 board configuration and device tree X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Although the two qemu-x86 targets (i440fx and q35) share a lot in common, they still have something that cannot easily handled in one place (like different configurations, different properties in the device tree). Split to create two dedicated board configuration and device tree files and make the i440fx be the default build target. Signed-off-by: Bin Meng --- arch/x86/dts/Makefile | 3 +- arch/x86/dts/qemu-x86_i440fx.dts | 34 +++++++++++++++ arch/x86/dts/{qemu-x86.dts => qemu-x86_q35.dts} | 2 +- board/coreboot/coreboot/Kconfig | 4 +- board/emulation/qemu-x86/Kconfig | 19 +++++++-- configs/qemu-x86_defconfig | 1 - doc/README.x86 | 13 +++++- include/configs/{qemu-x86.h => qemu-x86_i440fx.h} | 20 ++------- include/configs/qemu-x86_q35.h | 52 +++++++++++++++++++++++ 9 files changed, 122 insertions(+), 26 deletions(-) create mode 100644 arch/x86/dts/qemu-x86_i440fx.dts rename arch/x86/dts/{qemu-x86.dts => qemu-x86_q35.dts} (95%) rename include/configs/{qemu-x86.h => qemu-x86_i440fx.h} (78%) create mode 100644 include/configs/qemu-x86_q35.h diff --git a/arch/x86/dts/Makefile b/arch/x86/dts/Makefile index ca2eab3..f86514c 100644 --- a/arch/x86/dts/Makefile +++ b/arch/x86/dts/Makefile @@ -3,7 +3,8 @@ dtb-y += chromebook_link.dtb \ crownbay.dtb \ galileo.dtb \ minnowmax.dtb \ - qemu-x86.dtb + qemu-x86_i440fx.dtb \ + qemu-x86_q35.dtb targets += $(dtb-y) diff --git a/arch/x86/dts/qemu-x86_i440fx.dts b/arch/x86/dts/qemu-x86_i440fx.dts new file mode 100644 index 0000000..4cf843b --- /dev/null +++ b/arch/x86/dts/qemu-x86_i440fx.dts @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2015, Bin Meng + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/dts-v1/; + +/include/ "skeleton.dtsi" +/include/ "serial.dtsi" + +/ { + model = "QEMU x86 (I440FX)"; + compatible = "qemu,x86"; + + config { + silent_console = <0>; + }; + + chosen { + stdout-path = "/serial"; + }; + + pci { + compatible = "pci-x86"; + #address-cells = <3>; + #size-cells = <2>; + u-boot,dm-pre-reloc; + ranges = <0x02000000 0x0 0xc0000000 0xc0000000 0 0x10000000 + 0x42000000 0x0 0xd0000000 0xd0000000 0 0x10000000 + 0x01000000 0x0 0x2000 0x2000 0 0xe000>; + }; + +}; diff --git a/arch/x86/dts/qemu-x86.dts b/arch/x86/dts/qemu-x86_q35.dts similarity index 95% rename from arch/x86/dts/qemu-x86.dts rename to arch/x86/dts/qemu-x86_q35.dts index f1291b5..6c89283 100644 --- a/arch/x86/dts/qemu-x86.dts +++ b/arch/x86/dts/qemu-x86_q35.dts @@ -10,7 +10,7 @@ /include/ "serial.dtsi" / { - model = "QEMU x86"; + model = "QEMU x86 (Q35)"; compatible = "qemu,x86"; config { diff --git a/board/coreboot/coreboot/Kconfig b/board/coreboot/coreboot/Kconfig index 69e3437..2157c1b 100644 --- a/board/coreboot/coreboot/Kconfig +++ b/board/coreboot/coreboot/Kconfig @@ -16,14 +16,14 @@ comment "coreboot-specific options" config SYS_CONFIG_NAME string "Board configuration file" - default "qemu-x86" + default "qemu-x86_i440fx" help This option selects the board configuration file in include/configs/ directory to be used to build U-Boot for coreboot. config DEFAULT_DEVICE_TREE string "Board Device Tree Source (dts) file" - default "qemu-x86" + default "qemu-x86_i440fx" help This option selects the board Device Tree Source (dts) file in arch/x86/dts/ directory to be used to build U-Boot for coreboot. diff --git a/board/emulation/qemu-x86/Kconfig b/board/emulation/qemu-x86/Kconfig index e777ef4..fbf9018 100644 --- a/board/emulation/qemu-x86/Kconfig +++ b/board/emulation/qemu-x86/Kconfig @@ -9,9 +9,6 @@ config SYS_VENDOR config SYS_SOC default "qemu" -config SYS_CONFIG_NAME - default "qemu-x86" - config SYS_TEXT_BASE default 0xfff00000 @@ -21,4 +18,20 @@ config BOARD_SPECIFIC_OPTIONS # dummy select QEMU select BOARD_ROMSIZE_KB_1024 +comment "qemu-specific options" + +config SYS_CONFIG_NAME + string "Board configuration file" + default "qemu-x86_i440fx" + help + This option selects the board configuration file in include/configs/ + directory to be used to build U-Boot for qemu-x86. + +config DEFAULT_DEVICE_TREE + string "Board Device Tree Source (dts) file" + default "qemu-x86_i440fx" + help + This option selects the board Device Tree Source (dts) file in + arch/x86/dts/ directory to be used to build U-Boot for qemu-x86. + endif diff --git a/configs/qemu-x86_defconfig b/configs/qemu-x86_defconfig index 198ab97..a894db6 100644 --- a/configs/qemu-x86_defconfig +++ b/configs/qemu-x86_defconfig @@ -3,7 +3,6 @@ CONFIG_VENDOR_EMULATION=y CONFIG_TARGET_QEMU_X86=y CONFIG_OF_CONTROL=y CONFIG_OF_SEPARATE=y -CONFIG_DEFAULT_DEVICE_TREE="qemu-x86" CONFIG_VIDEO_VESA=y CONFIG_FRAMEBUFFER_SET_VESA_MODE=y CONFIG_FRAMEBUFFER_VESA_MODE_111=y diff --git a/doc/README.x86 b/doc/README.x86 index 0726205..82b773c 100644 --- a/doc/README.x86 +++ b/doc/README.x86 @@ -39,8 +39,8 @@ configuration during the 'make menuconfig' process. x86 architecture ---> ... - (qemu-x86) Board configuration file - (qemu-x86) Board Device Tree Source (dts) file + (qemu-x86_i440fx) Board configuration file + (qemu-x86_i440fx) Board Device Tree Source (dts) file (0x01920000) Board specific Cache-As-RAM (CAR) address (0x4000) Board specific Cache-As-RAM (CAR) size @@ -186,6 +186,15 @@ To build u-boot.rom for QEMU x86 targets, just simply run $ make qemu-x86_defconfig $ make all +Note this default configuration will build a U-Boot for the QEMU x86 i440FX +board. To build a U-Boot against QEMU x86 Q35 board, you can change the build +configuration during the 'make menuconfig' process like below: + +x86 architecture ---> + ... + (qemu-x86_q35) Board configuration file + (qemu-x86_q35) Board Device Tree Source (dts) file + Test with coreboot ------------------ For testing U-Boot as the coreboot payload, there are things that need be paid diff --git a/include/configs/qemu-x86.h b/include/configs/qemu-x86_i440fx.h similarity index 78% rename from include/configs/qemu-x86.h rename to include/configs/qemu-x86_i440fx.h index d01936b..53d917d 100644 --- a/include/configs/qemu-x86.h +++ b/include/configs/qemu-x86_i440fx.h @@ -37,16 +37,11 @@ "stdout=serial,vga\0" \ "stderr=serial,vga\0" -/* - * ATA/SATA support for QEMU x86 targets - * - Only legacy IDE controller is supported for QEMU '-M pc' target - * - AHCI controller is supported for QEMU '-M q35' target - * - * Default configuraion is to support the QEMU default x86 target - * Undefine CONFIG_CMD_IDE to support q35 target - */ +/* QEMU i440fx target does not have any AHCI controller */ +#undef CONFIG_SCSI_AHCI +#undef CONFIG_CMD_SCSI + #define CONFIG_CMD_IDE -#ifdef CONFIG_CMD_IDE #define CONFIG_SYS_IDE_MAXBUS 2 #define CONFIG_SYS_IDE_MAXDEVICE 4 #define CONFIG_SYS_ATA_BASE_ADDR 0 @@ -57,13 +52,6 @@ #define CONFIG_SYS_ATA_IDE1_OFFSET 0x170 #define CONFIG_ATAPI -#undef CONFIG_SCSI_AHCI -#undef CONFIG_CMD_SCSI -#else -#define CONFIG_SCSI_DEV_LIST \ - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_AHCI} -#endif - /* GPIO is not supported */ #undef CONFIG_INTEL_ICH6_GPIO #undef CONFIG_CMD_GPIO diff --git a/include/configs/qemu-x86_q35.h b/include/configs/qemu-x86_q35.h new file mode 100644 index 0000000..ef81ad3 --- /dev/null +++ b/include/configs/qemu-x86_q35.h @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2015, Bin Meng + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/* + * board/config.h - configuration options, board specific + */ + +#ifndef __CONFIG_H +#define __CONFIG_H + +#include + +#define CONFIG_SYS_MONITOR_LEN (1 << 20) + +#define CONFIG_X86_SERIAL + +#define CONFIG_PCI_MEM_BUS 0xc0000000 +#define CONFIG_PCI_MEM_PHYS CONFIG_PCI_MEM_BUS +#define CONFIG_PCI_MEM_SIZE 0x10000000 + +#define CONFIG_PCI_PREF_BUS 0xd0000000 +#define CONFIG_PCI_PREF_PHYS CONFIG_PCI_PREF_BUS +#define CONFIG_PCI_PREF_SIZE 0x10000000 + +#define CONFIG_PCI_IO_BUS 0x2000 +#define CONFIG_PCI_IO_PHYS CONFIG_PCI_IO_BUS +#define CONFIG_PCI_IO_SIZE 0xe000 + +#define CONFIG_PCI_CONFIG_HOST_BRIDGE +#define CONFIG_PCI_PNP +#define CONFIG_E1000 + +#define CONFIG_STD_DEVICES_SETTINGS "stdin=serial,vga\0" \ + "stdout=serial,vga\0" \ + "stderr=serial,vga\0" + +#define CONFIG_SCSI_DEV_LIST \ + {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_AHCI} + +/* GPIO is not supported */ +#undef CONFIG_INTEL_ICH6_GPIO +#undef CONFIG_CMD_GPIO + +/* SPI is not supported */ +#undef CONFIG_ICH_SPI +#undef CONFIG_ENV_IS_IN_SPI_FLASH +#define CONFIG_ENV_IS_NOWHERE + +#endif /* __CONFIG_H */