Skip to contentSkip to conversation

x86/platform changes for v2.6.40

GIT PULL Ingo Molnar 1 participant 1 message May 19, 2011 x86

lore
Share & tools
lore
#0 lore raw

Linus,

Please pull the latest x86-platform-for-linus git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git x86-platform-for-linus

Thanks,

Ingo

------------------>
Dan Williams (1):
x86: Introduce pci_map_biosrom()

Daniel Drake (1):
x86, olpc: Use device tree for platform identification

 arch/x86/Kconfig                  |    2 +-
 arch/x86/include/asm/olpc_ofw.h   |    9 +-
 arch/x86/include/asm/probe_roms.h |    8 +
 arch/x86/include/asm/setup.h      |    2 +-
 arch/x86/kernel/Makefile          |    2 +-
 arch/x86/kernel/head32.c          |    1 -
 arch/x86/kernel/probe_roms.c      |  267 +++++++++++++++++++++++++++++++++++++
 arch/x86/kernel/probe_roms_32.c   |  166 -----------------------
 arch/x86/kernel/x86_init.c        |    2 +-
 arch/x86/platform/olpc/Makefile   |    4 +-
 arch/x86/platform/olpc/olpc.c     |   51 ++++----
 arch/x86/platform/olpc/olpc_dt.c  |   19 +++
 12 files changed, 329 insertions(+), 204 deletions(-)
 create mode 100644 arch/x86/include/asm/probe_roms.h
 create mode 100644 arch/x86/kernel/probe_roms.c
 delete mode 100644 arch/x86/kernel/probe_roms_32.c
arch/x86/Kconfig +1 -1
index b4c2e9c..471221b 100644
@@ -2071,7 +2071,7 @@ config OLPC
 	depends on !X86_PAE
 	select GPIOLIB
 	select OF
-	select OF_PROMTREE if PROC_DEVICETREE
+	select OF_PROMTREE
 	---help---
 	  Add support for detecting the unique features of the OLPC
 	  XO hardware.
arch/x86/include/asm/olpc_ofw.h +3 -6
index c5d3a5a..2448771 100644
@@ -26,15 +26,12 @@ extern void setup_olpc_ofw_pgd(void);
 /* check if OFW was detected during boot */
 extern bool olpc_ofw_present(void);
 
+extern void olpc_dt_build_devicetree(void);
+
 #else /* !CONFIG_OLPC */
 static inline void olpc_ofw_detect(void) { }
 static inline void setup_olpc_ofw_pgd(void) { }
-#endif /* !CONFIG_OLPC */
-
-#ifdef CONFIG_OF_PROMTREE
-extern void olpc_dt_build_devicetree(void);
-#else
 static inline void olpc_dt_build_devicetree(void) { }
-#endif
+#endif /* !CONFIG_OLPC */
 
 #endif /* _ASM_X86_OLPC_OFW_H */
arch/x86/include/asm/probe_roms.h new file +8 -0
new file mode 100644
index 0000000..4950a0b
@@ -0,0 +1,8 @@
+#ifndef _PROBE_ROMS_H_
+#define _PROBE_ROMS_H_
+struct pci_dev;
+
+extern void __iomem *pci_map_biosrom(struct pci_dev *pdev);
+extern void pci_unmap_biosrom(void __iomem *rom);
+extern size_t pci_biosrom_size(struct pci_dev *pdev);
+#endif
arch/x86/include/asm/setup.h +1 -1
index db8aa19..03d3a32 100644
@@ -104,10 +104,10 @@ void *extend_brk(size_t size, size_t align);
 	type *name;					\
 	RESERVE_BRK(name, sizeof(type) * entries)
 
+extern void probe_roms(void);
 #ifdef __i386__
 
 void __init i386_start_kernel(void);
-extern void probe_roms(void);
 
 #else
 void __init x86_64_start_kernel(char *real_mode);
arch/x86/kernel/Makefile +1 -1
index 62445ba..f33d738 100644
@@ -36,7 +36,7 @@ obj-y			+= traps.o irq.o irq_$(BITS).o dumpstack_$(BITS).o
 obj-y			+= time.o ioport.o ldt.o dumpstack.o
 obj-y			+= setup.o x86_init.o i8259.o irqinit.o jump_label.o
 obj-$(CONFIG_IRQ_WORK)  += irq_work.o
-obj-$(CONFIG_X86_32)	+= probe_roms_32.o
+obj-y			+= probe_roms.o
 obj-$(CONFIG_X86_32)	+= sys_i386_32.o i386_ksyms_32.o
 obj-$(CONFIG_X86_64)	+= sys_x86_64.o x8664_ksyms_64.o
 obj-$(CONFIG_X86_64)	+= syscall_64.o vsyscall_64.o
arch/x86/kernel/head32.c +0 -1
index 7f138b3..eab4940 100644
@@ -23,7 +23,6 @@
 static void __init i386_default_early_setup(void)
 {
 	/* Initialize 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;
 
arch/x86/kernel/probe_roms.c new file +267 -0

267 lines not on this page · raw message

arch/x86/kernel/probe_roms_32.c deleted +0 -166

166 lines not on this page · raw message

arch/x86/kernel/x86_init.c +1 -1
index c11514e..6eee082 100644
@@ -35,7 +35,7 @@ void iommu_shutdown_noop(void) { }
 struct x86_init_ops x86_init __initdata = {
 
 	.resources = {
-		.probe_roms		= x86_init_noop,
+		.probe_roms		= probe_roms,
 		.reserve_resources	= reserve_standard_io_resources,
 		.memory_setup		= default_machine_specific_memory_setup,
 	},
arch/x86/platform/olpc/Makefile +1 -3
index c2a8cab..81c5e21 100644
@@ -1,4 +1,2 @@
-obj-$(CONFIG_OLPC)		+= olpc.o
+obj-$(CONFIG_OLPC)		+= olpc.o olpc_ofw.o olpc_dt.o
 obj-$(CONFIG_OLPC_XO1)		+= olpc-xo1.o
-obj-$(CONFIG_OLPC)		+= olpc_ofw.o
-obj-$(CONFIG_OF_PROMTREE)	+= olpc_dt.o
arch/x86/platform/olpc/olpc.c +27 -24

74 lines not on this page · raw message

arch/x86/platform/olpc/olpc_dt.c +19 -0
index dab8746..4ce208f 100644
@@ -19,7 +19,9 @@
 #include <linux/kernel.h>
 #include <linux/bootmem.h>
 #include <linux/of.h>
+#include <linux/of_platform.h>
 #include <linux/of_pdt.h>
+#include <asm/olpc.h>
 #include <asm/olpc_ofw.h>
 
 static phandle __init olpc_dt_getsibling(phandle node)
@@ -181,3 +183,20 @@ void __init olpc_dt_build_devicetree(void)
 	pr_info("PROM DT: Built device tree with %u bytes of memory.\n",
 			prom_early_allocated);
 }
+
+/* A list of DT node/bus matches that we want to expose as platform devices */
+static struct of_device_id __initdata of_ids[] = {
+	{ .compatible = "olpc,xo1-battery" },
+	{ .compatible = "olpc,xo1-dcon" },
+	{ .compatible = "olpc,xo1-rtc" },
+	{},
+};
+
+static int __init olpc_create_platform_devices(void)
+{
+	if (machine_is_olpc())
+		return of_platform_bus_probe(NULL, of_ids, NULL);
+	else
+		return 0;
+}
+device_initcall(olpc_create_platform_devices);