All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 0/3] x86: Early platform detection based on boot param subarch id
@ 2009-08-30 13:46 Thomas Gleixner
  2009-08-30 13:46 ` [patch 1/3] x86: Add early platform detection Thomas Gleixner
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Thomas Gleixner @ 2009-08-30 13:46 UTC (permalink / raw)
  To: LKML; +Cc: Ingo Molnar, Peter Anvin, Arjan van de Veen, Pan Jacob jun

Moorestown needs to tweak x86_init functions in the early boot
process. Moorestown can be identified by subarch id in the boot
params. The following series implements the necessary change in the
early boot code and hooks up MRST early setup.

Thanks,

	tglx


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [patch 1/3] x86: Add early platform detection
  2009-08-30 13:46 [patch 0/3] x86: Early platform detection based on boot param subarch id Thomas Gleixner
@ 2009-08-30 13:46 ` Thomas Gleixner
  2009-08-30 13:46 ` [patch 2/3] x86/boot: adding hw subarch ID for Moorestown Thomas Gleixner
  2009-08-30 13:46 ` [patch 3/3] x86: Add Moorestown early detection Thomas Gleixner
  2 siblings, 0 replies; 6+ messages in thread
From: Thomas Gleixner @ 2009-08-30 13:46 UTC (permalink / raw)
  To: LKML; +Cc: Ingo Molnar, Peter Anvin, Arjan van de Veen, Pan Jacob jun

[-- Attachment #1: x86-add-early-platform-detection.patch --]
[-- Type: text/plain, Size: 3980 bytes --]

Platforms like Moorestown require early setup and want to avoid the
call to reserve_ebda_region. The x86_init override is too late when
the MRST detection happens in setup_arch. Move the default i386
x86_init overrides and the call to reserve_ebda_region into a separate
function which is called as the default of a switch case depending on
the hardware_subarch id in boot params. This allows us to add a case
for MRST and let MRST have its own early setup function.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/include/asm/x86_init.h |    3 +--
 arch/x86/kernel/head32.c        |   22 +++++++++++++++++-----
 arch/x86/kernel/head64.c        |    3 ++-
 arch/x86/kernel/x86_init.c      |    1 -
 4 files changed, 20 insertions(+), 9 deletions(-)

Index: linux-2.6-tip/arch/x86/include/asm/x86_init.h
===================================================================
--- linux-2.6-tip.orig/arch/x86/include/asm/x86_init.h
+++ linux-2.6-tip/arch/x86/include/asm/x86_init.h
@@ -2,6 +2,7 @@
 #define _ASM_X86_PLATFORM_H
 
 #include <asm/pgtable_types.h>
+#include <asm/bootparam.h>
 
 struct mpc_bus;
 struct mpc_cpu;
@@ -34,14 +35,12 @@ struct x86_init_mpparse {
  * @probe_roms:			probe BIOS roms
  * @reserve_resources:		reserve the standard resources for the
  *				platform
- * @reserve_ebda_region:	reserve the extended bios data area
  * @memory_setup:		platform specific memory setup
  *
  */
 struct x86_init_resources {
 	void (*probe_roms)(void);
 	void (*reserve_resources)(void);
-	void (*reserve_ebda_region)(void);
 	char *(*memory_setup)(void);
 };
 
Index: linux-2.6-tip/arch/x86/kernel/head32.c
===================================================================
--- linux-2.6-tip.orig/arch/x86/kernel/head32.c
+++ linux-2.6-tip/arch/x86/kernel/head32.c
@@ -15,6 +15,17 @@
 #include <asm/trampoline.h>
 #include <asm/apic.h>
 #include <asm/io_apic.h>
+#include <asm/bios_ebda.h>
+
+static void __init i386_default_early_setup(void)
+{
+	/* Initilize 32bit specific setup functions */
+	x86_init.resources.probe_roms = probe_roms;
+	x86_init.resources.reserve_resources = i386_reserve_resources;
+	x86_init.mpparse.setup_ioapic_ids = setup_ioapic_ids_from_mpc;
+
+	reserve_ebda_region();
+}
 
 void __init i386_start_kernel(void)
 {
@@ -31,12 +42,13 @@ void __init i386_start_kernel(void)
 		reserve_early(ramdisk_image, ramdisk_end, "RAMDISK");
 	}
 #endif
-	/* Initilize 32bit specific setup functions */
-	x86_init.resources.probe_roms = probe_roms;
-	x86_init.resources.reserve_resources = i386_reserve_resources;
-	x86_init.mpparse.setup_ioapic_ids = setup_ioapic_ids_from_mpc;
 
-	x86_init.resources.reserve_ebda_region();
+	/* Call the subarch specific early setup function */
+	switch (boot_params.hdr.hardware_subarch) {
+	default:
+		i386_default_early_setup();
+		break;
+	}
 
 	/*
 	 * At this point everything still needed from the boot loader
Index: linux-2.6-tip/arch/x86/kernel/head64.c
===================================================================
--- linux-2.6-tip.orig/arch/x86/kernel/head64.c
+++ linux-2.6-tip/arch/x86/kernel/head64.c
@@ -24,6 +24,7 @@
 #include <asm/kdebug.h>
 #include <asm/e820.h>
 #include <asm/trampoline.h>
+#include <asm/bios_ebda.h>
 
 static void __init zap_identity_mappings(void)
 {
@@ -111,7 +112,7 @@ void __init x86_64_start_reservations(ch
 	}
 #endif
 
-	x86_init.resources.reserve_ebda_region();
+	reserve_ebda_region();
 
 	/*
 	 * At this point everything still needed from the boot loader
Index: linux-2.6-tip/arch/x86/kernel/x86_init.c
===================================================================
--- linux-2.6-tip.orig/arch/x86/kernel/x86_init.c
+++ linux-2.6-tip/arch/x86/kernel/x86_init.c
@@ -28,7 +28,6 @@ struct __initdata x86_init_ops x86_init 
 	.resources = {
 		.probe_roms		= x86_init_noop,
 		.reserve_resources	= reserve_standard_io_resources,
-		.reserve_ebda_region	= reserve_ebda_region,
 		.memory_setup		= default_machine_specific_memory_setup,
 	},
 



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [patch 2/3] x86/boot: adding hw subarch ID for Moorestown
  2009-08-30 13:46 [patch 0/3] x86: Early platform detection based on boot param subarch id Thomas Gleixner
  2009-08-30 13:46 ` [patch 1/3] x86: Add early platform detection Thomas Gleixner
@ 2009-08-30 13:46 ` Thomas Gleixner
  2009-08-31 11:13   ` Daniele Calore
  2009-08-30 13:46 ` [patch 3/3] x86: Add Moorestown early detection Thomas Gleixner
  2 siblings, 1 reply; 6+ messages in thread
From: Thomas Gleixner @ 2009-08-30 13:46 UTC (permalink / raw)
  To: LKML; +Cc: Ingo Molnar, Peter Anvin, Arjan van de Veen, Pan Jacob jun

[-- Attachment #1: x86-boot-adding-hw-subarch-id-for-moorestown.patch --]
[-- Type: text/plain, Size: 2131 bytes --]

From: Jacob Pan <jacob.jun.pan@intel.com>
Date: Thu, 11 Jun 2009 20:34:47 -0700
Subject: [patch 2/3] [PATCH] x86/boot: adding hw subarch ID for Moorestown

x86 bootprotocol 2.07 has introduced hardware_subarch ID in the boot
parameters provided by FW. We use it to identify Moorestown platforms.

The subarchitecture ID will help select a set of platform features and
x86_quirks.

[ tglx: Cleanup and paravirt fix ]

Signed-off-by: Jacob Pan <jacob.jun.pan@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 Documentation/x86/boot.txt       |    1 +
 arch/x86/include/asm/bootparam.h |   10 ++++++++++
 arch/x86/kernel/head_32.S        |    1 +
 3 files changed, 12 insertions(+)

Index: linux-2.6-tip/Documentation/x86/boot.txt
===================================================================
--- linux-2.6-tip.orig/Documentation/x86/boot.txt
+++ linux-2.6-tip/Documentation/x86/boot.txt
@@ -599,6 +599,7 @@ Protocol:	2.07+
   0x00000000	The default x86/PC environment
   0x00000001	lguest
   0x00000002	Xen
+  0x00000003	Moorestown MID
 
 Field name:	hardware_subarch_data
 Type:		write (subarch-dependent)
Index: linux-2.6-tip/arch/x86/include/asm/bootparam.h
===================================================================
--- linux-2.6-tip.orig/arch/x86/include/asm/bootparam.h
+++ linux-2.6-tip/arch/x86/include/asm/bootparam.h
@@ -109,4 +109,14 @@ struct boot_params {
 	__u8  _pad9[276];				/* 0xeec */
 } __attribute__((packed));
 
+enum {
+	X86_SUBARCH_PC = 0,
+	X86_SUBARCH_LGUEST,
+	X86_SUBARCH_XEN,
+	X86_SUBARCH_MRST,
+	X86_NR_SUBARCHS,
+};
+
+
+
 #endif /* _ASM_X86_BOOTPARAM_H */
Index: linux-2.6-tip/arch/x86/kernel/head_32.S
===================================================================
--- linux-2.6-tip.orig/arch/x86/kernel/head_32.S
+++ linux-2.6-tip/arch/x86/kernel/head_32.S
@@ -157,6 +157,7 @@ subarch_entries:
 	.long default_entry		/* normal x86/PC */
 	.long lguest_entry		/* lguest hypervisor */
 	.long xen_entry			/* Xen hypervisor */
+	.long default_entry		/* Moorestown MID */
 num_subarch_entries = (. - subarch_entries) / 4
 .previous
 #endif /* CONFIG_PARAVIRT */



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [patch 3/3] x86: Add Moorestown early detection
  2009-08-30 13:46 [patch 0/3] x86: Early platform detection based on boot param subarch id Thomas Gleixner
  2009-08-30 13:46 ` [patch 1/3] x86: Add early platform detection Thomas Gleixner
  2009-08-30 13:46 ` [patch 2/3] x86/boot: adding hw subarch ID for Moorestown Thomas Gleixner
@ 2009-08-30 13:46 ` Thomas Gleixner
  2 siblings, 0 replies; 6+ messages in thread
From: Thomas Gleixner @ 2009-08-30 13:46 UTC (permalink / raw)
  To: LKML; +Cc: Ingo Molnar, Peter Anvin, Arjan van de Veen, Pan Jacob jun

[-- Attachment #1: x86-add-moorestown-early-detection.patch --]
[-- Type: text/plain, Size: 4038 bytes --]

Moorestown MID devices need to be detected early in the boot process
to setup and do not call x86_default_early_setup as there is no EBDA
region to reserve.

[ Copied the minimal code from Jacobs latest MRST series ]

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/Kconfig             |   13 +++++++++++++
 arch/x86/include/asm/setup.h |    6 ++++++
 arch/x86/kernel/Makefile     |    1 +
 arch/x86/kernel/head32.c     |    3 +++
 arch/x86/kernel/mrst.c       |   24 ++++++++++++++++++++++++
 5 files changed, 47 insertions(+)

Index: linux-2.6-tip/arch/x86/Kconfig
===================================================================
--- linux-2.6-tip.orig/arch/x86/Kconfig
+++ linux-2.6-tip/arch/x86/Kconfig
@@ -318,6 +318,7 @@ config X86_EXTENDED_PLATFORM
 		SGI 320/540 (Visual Workstation)
 		Summit/EXA (IBM x440)
 		Unisys ES7000 IA32 series
+		Moorestown MID devices
 
 	  If you have one of these systems, or if you want to build a
 	  generic distribution kernel, say Y here - otherwise say N.
@@ -377,6 +378,18 @@ config X86_ELAN
 
 	  If unsure, choose "PC-compatible" instead.
 
+config X86_MRST
+       bool "Moorestown MID platform"
+	depends on X86_32
+	depends on X86_EXTENDED_PLATFORM
+	---help---
+	  Moorestown is Intel's Low Power Intel Architecture (LPIA) based Moblin
+	  Internet Device(MID) platform. Moorestown consists of two chips:
+	  Lincroft (CPU core, graphics, and memory controller) and Langwell IOH.
+	  Unlike standard x86 PCs, Moorestown does not have many legacy devices
+	  nor standard legacy replacement devices/features. e.g. Moorestown does
+	  not contain i8259, i8254, HPET, legacy BIOS, most of the io ports.
+
 config X86_RDC321X
 	bool "RDC R-321x SoC"
 	depends on X86_32
Index: linux-2.6-tip/arch/x86/include/asm/setup.h
===================================================================
--- linux-2.6-tip.orig/arch/x86/include/asm/setup.h
+++ linux-2.6-tip/arch/x86/include/asm/setup.h
@@ -49,6 +49,12 @@ extern void reserve_standard_io_resource
 extern void i386_reserve_resources(void);
 extern void setup_default_timer_irq(void);
 
+#ifdef CONFIG_X86_MRST
+extern void x86_mrst_early_setup(void);
+#else
+static inline void x86_mrst_early_setup(void) { }
+#endif
+
 #ifndef _SETUP
 
 /*
Index: linux-2.6-tip/arch/x86/kernel/Makefile
===================================================================
--- linux-2.6-tip.orig/arch/x86/kernel/Makefile
+++ linux-2.6-tip/arch/x86/kernel/Makefile
@@ -104,6 +104,7 @@ obj-$(CONFIG_SCx200)		+= scx200.o
 scx200-y			+= scx200_32.o
 
 obj-$(CONFIG_OLPC)		+= olpc.o
+obj-$(CONFIG_X86_MRST)		+= mrst.o
 
 microcode-y				:= microcode_core.o
 microcode-$(CONFIG_MICROCODE_INTEL)	+= microcode_intel.o
Index: linux-2.6-tip/arch/x86/kernel/head32.c
===================================================================
--- linux-2.6-tip.orig/arch/x86/kernel/head32.c
+++ linux-2.6-tip/arch/x86/kernel/head32.c
@@ -45,6 +45,9 @@ void __init i386_start_kernel(void)
 
 	/* Call the subarch specific early setup function */
 	switch (boot_params.hdr.hardware_subarch) {
+	case X86_SUBARCH_MRST:
+		x86_mrst_early_setup();
+		break;
 	default:
 		i386_default_early_setup();
 		break;
Index: linux-2.6-tip/arch/x86/kernel/mrst.c
===================================================================
--- /dev/null
+++ linux-2.6-tip/arch/x86/kernel/mrst.c
@@ -0,0 +1,24 @@
+/*
+ * mrst.c: Intel Moorestown platform specific setup code
+ *
+ * (C) Copyright 2008 Intel Corporation
+ * Author: Jacob Pan (jacob.jun.pan@intel.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; version 2
+ * of the License.
+ */
+#include <linux/init.h>
+
+#include <asm/setup.h>
+
+/*
+ * Moorestown specific x86_init function overrides and early setup
+ * calls.
+ */
+void __init x86_mrst_early_setup(void)
+{
+	x86_init.resources.probe_roms = x86_init_noop;
+	x86_init.resources.reserve_resources = x86_init_noop;
+}



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch 2/3] x86/boot: adding hw subarch ID for Moorestown
  2009-08-31 11:13   ` Daniele Calore
@ 2009-08-31 10:01     ` Thomas Gleixner
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Gleixner @ 2009-08-31 10:01 UTC (permalink / raw)
  To: Daniele Calore
  Cc: LKML, Ingo Molnar, Peter Anvin, Arjan van de Veen, Pan Jacob jun

On Mon, 31 Aug 2009, Daniele Calore wrote:
> I think there is a typo (copy/paste error), see below:
>
> >  #endif /* _ASM_X86_BOOTPARAM_H */
> > Index: linux-2.6-tip/arch/x86/kernel/head_32.S
> > ===================================================================
> > --- linux-2.6-tip.orig/arch/x86/kernel/head_32.S
> > +++ linux-2.6-tip/arch/x86/kernel/head_32.S
> > @@ -157,6 +157,7 @@ subarch_entries:
> >  	.long default_entry		/* normal x86/PC */
> >  	.long lguest_entry		/* lguest hypervisor */
> >  	.long xen_entry			/* Xen hypervisor */
> > +	.long default_entry		/* Moorestown MID */
> 
> Typo: s/default_entry/mrst_entry

That's not a typo. :)

MRST will not go via an separate entry it uses the default one and we
evaluate the hardware_subarch id later in i386_start_kernel. That
change is just necessecary that a paravirt enabled kernel does not end
up in bad_subarch for the MRST id.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch 2/3] x86/boot: adding hw subarch ID for Moorestown
  2009-08-30 13:46 ` [patch 2/3] x86/boot: adding hw subarch ID for Moorestown Thomas Gleixner
@ 2009-08-31 11:13   ` Daniele Calore
  2009-08-31 10:01     ` Thomas Gleixner
  0 siblings, 1 reply; 6+ messages in thread
From: Daniele Calore @ 2009-08-31 11:13 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: LKML, Ingo Molnar, Peter Anvin, Arjan van de Veen, Pan Jacob jun

Hi,

I think there is a typo (copy/paste error), see below:

On Sun, 30 Aug 2009 13:46:28 -0000
Thomas Gleixner <tglx@linutronix.de> wrote:

> From: Jacob Pan <jacob.jun.pan@intel.com>
> Date: Thu, 11 Jun 2009 20:34:47 -0700
> Subject: [patch 2/3] [PATCH] x86/boot: adding hw subarch ID for
> Moorestown
> 
> x86 bootprotocol 2.07 has introduced hardware_subarch ID in the boot
> parameters provided by FW. We use it to identify Moorestown platforms.
> 
> The subarchitecture ID will help select a set of platform features and
> x86_quirks.
> 
> [ tglx: Cleanup and paravirt fix ]
> 
> Signed-off-by: Jacob Pan <jacob.jun.pan@intel.com>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> ---
>  Documentation/x86/boot.txt       |    1 +
>  arch/x86/include/asm/bootparam.h |   10 ++++++++++
>  arch/x86/kernel/head_32.S        |    1 +
>  3 files changed, 12 insertions(+)
> 
> Index: linux-2.6-tip/Documentation/x86/boot.txt
> ===================================================================
> --- linux-2.6-tip.orig/Documentation/x86/boot.txt
> +++ linux-2.6-tip/Documentation/x86/boot.txt
> @@ -599,6 +599,7 @@ Protocol:	2.07+
>    0x00000000	The default x86/PC environment
>    0x00000001	lguest
>    0x00000002	Xen
> +  0x00000003	Moorestown MID
>  
>  Field name:	hardware_subarch_data
>  Type:		write (subarch-dependent)
> Index: linux-2.6-tip/arch/x86/include/asm/bootparam.h
> ===================================================================
> --- linux-2.6-tip.orig/arch/x86/include/asm/bootparam.h
> +++ linux-2.6-tip/arch/x86/include/asm/bootparam.h
> @@ -109,4 +109,14 @@ struct boot_params {
>  	__u8  _pad9[276];				/* 0xeec */
>  } __attribute__((packed));
>  
> +enum {
> +	X86_SUBARCH_PC = 0,
> +	X86_SUBARCH_LGUEST,
> +	X86_SUBARCH_XEN,
> +	X86_SUBARCH_MRST,
> +	X86_NR_SUBARCHS,
> +};
> +
> +
> +
>  #endif /* _ASM_X86_BOOTPARAM_H */
> Index: linux-2.6-tip/arch/x86/kernel/head_32.S
> ===================================================================
> --- linux-2.6-tip.orig/arch/x86/kernel/head_32.S
> +++ linux-2.6-tip/arch/x86/kernel/head_32.S
> @@ -157,6 +157,7 @@ subarch_entries:
>  	.long default_entry		/* normal x86/PC */
>  	.long lguest_entry		/* lguest hypervisor */
>  	.long xen_entry			/* Xen hypervisor */
> +	.long default_entry		/* Moorestown MID */

Typo: s/default_entry/mrst_entry

>  num_subarch_entries = (. - subarch_entries) / 4
>  .previous
>  #endif /* CONFIG_PARAVIRT */


Daniele
--

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-09-01 10:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-30 13:46 [patch 0/3] x86: Early platform detection based on boot param subarch id Thomas Gleixner
2009-08-30 13:46 ` [patch 1/3] x86: Add early platform detection Thomas Gleixner
2009-08-30 13:46 ` [patch 2/3] x86/boot: adding hw subarch ID for Moorestown Thomas Gleixner
2009-08-31 11:13   ` Daniele Calore
2009-08-31 10:01     ` Thomas Gleixner
2009-08-30 13:46 ` [patch 3/3] x86: Add Moorestown early detection Thomas Gleixner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.