diff mbox

[U-Boot,5/6] x86: qemu: Create i440fx and q35 board configuration and device tree

Message ID BLU437-SMTP35EACB464768C13CBBC38DBFCD0@phx.gbl
State Superseded
Delegated to: Simon Glass
Headers show

Commit Message

Bin Meng May 25, 2015, 2:36 p.m. UTC
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 <bmeng.cn@gmail.com>
---

 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

Comments

Simon Glass May 27, 2015, 3:13 a.m. UTC | #1
Hi Bin,

On 25 May 2015 at 08:36, Bin Meng <bmeng.cn@gmail.com> wrote:
> 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 <bmeng.cn@gmail.com>
> ---
>
>  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

Do we need a separate config file? It would be good if all the changes
were in the device tree so that we don't need a separate config. Or at
least that the configs are the same except for the device tree.

Regards,
Simon
Bin Meng May 27, 2015, 3:55 a.m. UTC | #2
Hi Simon,

On Wed, May 27, 2015 at 11:13 AM, Simon Glass <sjg@chromium.org> wrote:
> Hi Bin,
>
> On 25 May 2015 at 08:36, Bin Meng <bmeng.cn@gmail.com> wrote:
>> 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 <bmeng.cn@gmail.com>
>> ---
>>
>>  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
>
> Do we need a separate config file? It would be good if all the changes
> were in the device tree so that we don't need a separate config. Or at
> least that the configs are the same except for the device tree.
>

So far the only difference between two separate config files are the
ATA/SATA settings. i440fx has legacy IDE support while q35 has the
AHCI support. We can enable them both in just one config files,
however turning on legacy IDE support on q35 causes significant boot
delay as the legacy IDE driver has some big timeout in probing the
attached devices. Do you think this is something we are tolerant of?
If yes, I can just do separate device trees.

Regards,
Bin
Simon Glass May 27, 2015, 3:59 a.m. UTC | #3
Hi Bin,

On 26 May 2015 at 21:55, Bin Meng <bmeng.cn@gmail.com> wrote:
> Hi Simon,
>
> On Wed, May 27, 2015 at 11:13 AM, Simon Glass <sjg@chromium.org> wrote:
>> Hi Bin,
>>
>> On 25 May 2015 at 08:36, Bin Meng <bmeng.cn@gmail.com> wrote:
>>> 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 <bmeng.cn@gmail.com>
>>> ---
>>>
>>>  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
>>
>> Do we need a separate config file? It would be good if all the changes
>> were in the device tree so that we don't need a separate config. Or at
>> least that the configs are the same except for the device tree.
>>
>
> So far the only difference between two separate config files are the
> ATA/SATA settings. i440fx has legacy IDE support while q35 has the
> AHCI support. We can enable them both in just one config files,
> however turning on legacy IDE support on q35 causes significant boot
> delay as the legacy IDE driver has some big timeout in probing the
> attached devices. Do you think this is something we are tolerant of?
> If yes, I can just do separate device trees.

I think it is OK. But another option would be to add an IDE node to
the device tree and check it when CONFIG_OF_CONTROL is defined...

Regards,
Simon
Bin Meng May 27, 2015, 4:06 a.m. UTC | #4
Hi Simon,

On Wed, May 27, 2015 at 11:59 AM, Simon Glass <sjg@chromium.org> wrote:
> Hi Bin,
>
> On 26 May 2015 at 21:55, Bin Meng <bmeng.cn@gmail.com> wrote:
>> Hi Simon,
>>
>> On Wed, May 27, 2015 at 11:13 AM, Simon Glass <sjg@chromium.org> wrote:
>>> Hi Bin,
>>>
>>> On 25 May 2015 at 08:36, Bin Meng <bmeng.cn@gmail.com> wrote:
>>>> 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 <bmeng.cn@gmail.com>
>>>> ---
>>>>
>>>>  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
>>>
>>> Do we need a separate config file? It would be good if all the changes
>>> were in the device tree so that we don't need a separate config. Or at
>>> least that the configs are the same except for the device tree.
>>>
>>
>> So far the only difference between two separate config files are the
>> ATA/SATA settings. i440fx has legacy IDE support while q35 has the
>> AHCI support. We can enable them both in just one config files,
>> however turning on legacy IDE support on q35 causes significant boot
>> delay as the legacy IDE driver has some big timeout in probing the
>> attached devices. Do you think this is something we are tolerant of?
>> If yes, I can just do separate device trees.
>
> I think it is OK. But another option would be to add an IDE node to
> the device tree and check it when CONFIG_OF_CONTROL is defined...
>

I feel that we need convert all block drivers to driver model, so that
the driver can probe and initialize IDE/AHCI based on device tree
node. But I guess that's a long term goal?

Regards,
Bin
Simon Glass May 27, 2015, 3:42 p.m. UTC | #5
Hi Bin,

On 26 May 2015 at 22:06, Bin Meng <bmeng.cn@gmail.com> wrote:
> Hi Simon,
>
> On Wed, May 27, 2015 at 11:59 AM, Simon Glass <sjg@chromium.org> wrote:
>> Hi Bin,
>>
>> On 26 May 2015 at 21:55, Bin Meng <bmeng.cn@gmail.com> wrote:
>>> Hi Simon,
>>>
>>> On Wed, May 27, 2015 at 11:13 AM, Simon Glass <sjg@chromium.org> wrote:
>>>> Hi Bin,
>>>>
>>>> On 25 May 2015 at 08:36, Bin Meng <bmeng.cn@gmail.com> wrote:
>>>>> 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 <bmeng.cn@gmail.com>
>>>>> ---
>>>>>
>>>>>  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
>>>>
>>>> Do we need a separate config file? It would be good if all the changes
>>>> were in the device tree so that we don't need a separate config. Or at
>>>> least that the configs are the same except for the device tree.
>>>>
>>>
>>> So far the only difference between two separate config files are the
>>> ATA/SATA settings. i440fx has legacy IDE support while q35 has the
>>> AHCI support. We can enable them both in just one config files,
>>> however turning on legacy IDE support on q35 causes significant boot
>>> delay as the legacy IDE driver has some big timeout in probing the
>>> attached devices. Do you think this is something we are tolerant of?
>>> If yes, I can just do separate device trees.
>>
>> I think it is OK. But another option would be to add an IDE node to
>> the device tree and check it when CONFIG_OF_CONTROL is defined...
>>
>
> I feel that we need convert all block drivers to driver model, so that
> the driver can probe and initialize IDE/AHCI based on device tree
> node. But I guess that's a long term goal?

Yes, perhaps latter in the year. I did create a simple MMC uclass that
uses the block driver library just as now, and it seems easy enough. I
suppose you could do the same with IDE. But in the meantime just some
sort of DT config is good enough to avoid your device.

Regards,
Simon
Bin Meng May 27, 2015, 4:27 p.m. UTC | #6
Hi Simon,

On Wed, May 27, 2015 at 11:42 PM, Simon Glass <sjg@chromium.org> wrote:
> Hi Bin,
>
> On 26 May 2015 at 22:06, Bin Meng <bmeng.cn@gmail.com> wrote:
>> Hi Simon,
>>
>> On Wed, May 27, 2015 at 11:59 AM, Simon Glass <sjg@chromium.org> wrote:
>>> Hi Bin,
>>>
>>> On 26 May 2015 at 21:55, Bin Meng <bmeng.cn@gmail.com> wrote:
>>>> Hi Simon,
>>>>
>>>> On Wed, May 27, 2015 at 11:13 AM, Simon Glass <sjg@chromium.org> wrote:
>>>>> Hi Bin,
>>>>>
>>>>> On 25 May 2015 at 08:36, Bin Meng <bmeng.cn@gmail.com> wrote:
>>>>>> 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 <bmeng.cn@gmail.com>
>>>>>> ---
>>>>>>
>>>>>>  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
>>>>>
>>>>> Do we need a separate config file? It would be good if all the changes
>>>>> were in the device tree so that we don't need a separate config. Or at
>>>>> least that the configs are the same except for the device tree.
>>>>>
>>>>
>>>> So far the only difference between two separate config files are the
>>>> ATA/SATA settings. i440fx has legacy IDE support while q35 has the
>>>> AHCI support. We can enable them both in just one config files,
>>>> however turning on legacy IDE support on q35 causes significant boot
>>>> delay as the legacy IDE driver has some big timeout in probing the
>>>> attached devices. Do you think this is something we are tolerant of?
>>>> If yes, I can just do separate device trees.
>>>
>>> I think it is OK. But another option would be to add an IDE node to
>>> the device tree and check it when CONFIG_OF_CONTROL is defined...
>>>
>>
>> I feel that we need convert all block drivers to driver model, so that
>> the driver can probe and initialize IDE/AHCI based on device tree
>> node. But I guess that's a long term goal?
>
> Yes, perhaps latter in the year. I did create a simple MMC uclass that
> uses the block driver library just as now, and it seems easy enough. I
> suppose you could do the same with IDE. But in the meantime just some
> sort of DT config is good enough to avoid your device.
>

I am not sure I understand your point. Do you mean for now I need
modify common/cmd_ide.c::ide_init() to probe the existence of an IDE
node in the device tree? I am afraid that's a lot of work too since
there are many boards use the IDE driver.

Regards,
Bin
Simon Glass May 27, 2015, 5:47 p.m. UTC | #7
Hi Bin,

On 27 May 2015 at 10:27, Bin Meng <bmeng.cn@gmail.com> wrote:
> Hi Simon,
>
> On Wed, May 27, 2015 at 11:42 PM, Simon Glass <sjg@chromium.org> wrote:
>> Hi Bin,
>>
>> On 26 May 2015 at 22:06, Bin Meng <bmeng.cn@gmail.com> wrote:
>>> Hi Simon,
>>>
>>> On Wed, May 27, 2015 at 11:59 AM, Simon Glass <sjg@chromium.org> wrote:
>>>> Hi Bin,
>>>>
>>>> On 26 May 2015 at 21:55, Bin Meng <bmeng.cn@gmail.com> wrote:
>>>>> Hi Simon,
>>>>>
>>>>> On Wed, May 27, 2015 at 11:13 AM, Simon Glass <sjg@chromium.org> wrote:
>>>>>> Hi Bin,
>>>>>>
>>>>>> On 25 May 2015 at 08:36, Bin Meng <bmeng.cn@gmail.com> wrote:
>>>>>>> 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 <bmeng.cn@gmail.com>
>>>>>>> ---
>>>>>>>
>>>>>>>  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
>>>>>>
>>>>>> Do we need a separate config file? It would be good if all the changes
>>>>>> were in the device tree so that we don't need a separate config. Or at
>>>>>> least that the configs are the same except for the device tree.
>>>>>>
>>>>>
>>>>> So far the only difference between two separate config files are the
>>>>> ATA/SATA settings. i440fx has legacy IDE support while q35 has the
>>>>> AHCI support. We can enable them both in just one config files,
>>>>> however turning on legacy IDE support on q35 causes significant boot
>>>>> delay as the legacy IDE driver has some big timeout in probing the
>>>>> attached devices. Do you think this is something we are tolerant of?
>>>>> If yes, I can just do separate device trees.
>>>>
>>>> I think it is OK. But another option would be to add an IDE node to
>>>> the device tree and check it when CONFIG_OF_CONTROL is defined...
>>>>
>>>
>>> I feel that we need convert all block drivers to driver model, so that
>>> the driver can probe and initialize IDE/AHCI based on device tree
>>> node. But I guess that's a long term goal?
>>
>> Yes, perhaps latter in the year. I did create a simple MMC uclass that
>> uses the block driver library just as now, and it seems easy enough. I
>> suppose you could do the same with IDE. But in the meantime just some
>> sort of DT config is good enough to avoid your device.
>>
>
> I am not sure I understand your point. Do you mean for now I need
> modify common/cmd_ide.c::ide_init() to probe the existence of an IDE
> node in the device tree? I am afraid that's a lot of work too since
> there are many boards use the IDE driver.

Maybe for now you could do:

#ifdef CONFIG_OF_CONTROL
   if (!fdtdec_get_config_bool("legacy-ide"))
       return;  /* skip IDE */
#endif

Regards,
Simon
diff mbox

Patch

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 <bmeng.cn@gmail.com>
+ *
+ * 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 <bmeng.cn@gmail.com>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+/*
+ * board/config.h - configuration options, board specific
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#include <configs/x86-common.h>
+
+#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 */