login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
April
»
21
Re: [PATCH 1/2] OLPC: Add support for calling into Open Firmware
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Mitch Bradley
Subject:
Re: [PATCH 1/2] OLPC: Add support for calling into Open Firmware
Date: Sunday, April 20, 2008 - 8:09 pm
Yinghai Lu wrote:
quoted text
> On Sat, Apr 19, 2008 at 10:39 AM, Andres Salomon <dilinger@queued.net> wrote: > >> This adds 32-bit support for calling into OFW from the kernel. It's useful >> for querying the firmware for misc hardware information, fetching the device >> tree, etc. >> >> There's potentially no reason why other platforms couldn't use this, but >> currently OLPC is the main user of it. >> >> This work was originally done by Mitch Bradley. >> >> Signed-off-by: Andres Salomon <dilinger@debian.org> >> --- >> arch/x86/Kconfig | 8 +++++ >> arch/x86/kernel/Makefile | 1 + >> arch/x86/kernel/head_32.S | 27 ++++++++++++++++ >> arch/x86/kernel/ofw.c | 75 +++++++++++++++++++++++++++++++++++++++++++++ >> include/asm-x86/ofw.h | 50 ++++++++++++++++++++++++++++++ >> include/asm-x86/setup.h | 1 + >> 6 files changed, 162 insertions(+), 0 deletions(-) >> create mode 100644 arch/x86/kernel/ofw.c >> create mode 100644 include/asm-x86/ofw.h >> >> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig >> index 3b9089b..ce56105 100644 >> --- a/arch/x86/Kconfig >> +++ b/arch/x86/Kconfig >> @@ -661,6 +661,14 @@ config I8K >> Say Y if you intend to run this kernel on a Dell Inspiron 8000. >> Say N otherwise. >> >> +config OPEN_FIRMWARE >> + bool "Support for Open Firmware" >> + default y if OLPC >> + ---help--- >> + This option adds support for the implementation of Open Firmware >> + that is used on the OLPC XO laptop. >> + If unsure, say N here. >> + >> config X86_REBOOTFIXUPS >> def_bool n >> prompt "Enable X86 board specific fixups for reboot" >> diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile >> index 9575754..d33600e 100644 >> --- a/arch/x86/kernel/Makefile >> +++ b/arch/x86/kernel/Makefile >> @@ -54,6 +54,7 @@ obj-$(CONFIG_X86_TRAMPOLINE) += trampoline_$(BITS).o >> obj-$(CONFIG_X86_MPPARSE) += mpparse_$(BITS).o >> obj-$(CONFIG_X86_LOCAL_APIC) += apic_$(BITS).o nmi_$(BITS).o >> obj-$(CONFIG_X86_IO_APIC) += io_apic_$(BITS).o >> +obj-$(CONFIG_OPEN_FIRMWARE) += ofw.o >> obj-$(CONFIG_X86_REBOOTFIXUPS) += reboot_fixups_32.o >> obj-$(CONFIG_KEXEC) += machine_kexec_$(BITS).o >> obj-$(CONFIG_KEXEC) += relocate_kernel_$(BITS).o crash.o >> diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S >> index 74d87ea..c9d2d00 100644 >> --- a/arch/x86/kernel/head_32.S >> +++ b/arch/x86/kernel/head_32.S >> @@ -132,6 +132,33 @@ ENTRY(startup_32) >> movsl >> 1: >> >> +#ifdef CONFIG_OPEN_FIRMWARE >> +/* >> + * If Open Firmware booted us, save the OFW client interface callback address >> + * and preserve the OFW page mappings by priming the kernel's new page >> + * directory area with a copy of the OFW page directory. That lets OFW stay >> + * resident in high memory (high in both the virtual and physical spaces) >> + * for at least long enough to copy out the device tree. >> + */ >> + movl $pa(boot_params + OFW_INFO_OFFSET), %ebp >> + cmpl __PLACEHOLDER__0_x2057464F, (%ebp) /* Magic number "OFW " */ >> + jne 4f >> + >> + mov 0x8(%ebp), %eax /* Save callback address */ >> + mov %eax, pa(call_firmware) >> + >> + /* Copy the OFW pdir into swapper_pg_dir */ >> + movl %esi, %edx /* save %esi */ >> + movl $pa(swapper_pg_dir), %edi >> + movl %cr3, %esi /* Source is current pg_dir base address */ >> + movl 24, %ecx /* Number of page directory entries */ >> + rep >> + movsl >> + movl %edx, %esi /* restore %esi */ >> +4: >> + >> +#endif >> + >> #ifdef CONFIG_PARAVIRT >> /* This is can only trip for a broken bootloader... */ >> cmpw __PLACEHOLDER__0_x207, pa(boot_params + BP_version) >> diff --git a/arch/x86/kernel/ofw.c b/arch/x86/kernel/ofw.c >> new file mode 100644 >> index 0000000..14036aa >> --- /dev/null >> +++ b/arch/x86/kernel/ofw.c >> @@ -0,0 +1,75 @@ >> +/* >> + * Open Firmware client interface for 32-bit systems. >> + * >> + * Copyright (c) 2007 Mitch Bradley <wmb@firmworks.com> >> + * Copyright (c) 2007-2008 Andres Salomon <dilinger@debian.org> >> + * >> + * 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; either version 2 of the License, or >> + * (at your option) any later version. >> + */ >> + >> +#include <linux/kernel.h> >> +#include <linux/spinlock.h> >> +#include <linux/module.h> >> +#include <asm/ofw.h> >> + >> +/* >> + * This code is intended to be portable to any 32-bit Open Firmware >> + * implementation with a standard client interface that can be >> + * called when Linux is running. >> > > how about changing to ofw_32.c? > > YH >
Is your suggestion to change the filename from "ofw.c" to "ofw_32.c"? That seems like a good idea to me. --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
2.6.25-mm1
, Andrew Morton
, (Fri Apr 18, 1:47 am)
[PATCH] 2.6.25-mm1 - Build Failure with PWRficient onchip ...
, Kamalesh Babulal
, (Fri Apr 18, 4:26 am)
StackProtector Oopses - Re: 2.6.25-mm1
, Reuben Farrelly
, (Fri Apr 18, 6:02 am)
Re: StackProtector Oopses - Re: 2.6.25-mm1
, Ingo Molnar
, (Fri Apr 18, 6:36 am)
Re: StackProtector Oopses - Re: 2.6.25-mm1
, Arjan van de Ven
, (Fri Apr 18, 6:51 am)
Re: StackProtector Oopses - Re: 2.6.25-mm1
, Reuben Farrelly
, (Fri Apr 18, 7:41 am)
Re: StackProtector Oopses - Re: 2.6.25-mm1
, Reuben Farrelly
, (Fri Apr 18, 7:49 am)
Re: 2.6.25-mm1 (build error: driver core)
, Randy Dunlap
, (Fri Apr 18, 9:40 am)
Re: 2.6.25-mm1 (build error: trace selftest)
, Randy Dunlap
, (Fri Apr 18, 9:45 am)
Re: 2.6.25-mm1 (build error: driver core)
, Greg KH
, (Fri Apr 18, 9:56 am)
Re: 2.6.25-mm1 (build error: driver core)
, Dan Williams
, (Fri Apr 18, 11:38 am)
Re: 2.6.25-mm1
, Valdis.Kletnieks
, (Fri Apr 18, 1:14 pm)
2.6.25-mm1: orphaned files after build
, Alexey Dobriyan
, (Fri Apr 18, 4:09 pm)
Re: 2.6.25-mm1
, Joseph Fannin
, (Fri Apr 18, 7:13 pm)
Re: 2.6.25-mm1
, Joseph Fannin
, (Fri Apr 18, 7:25 pm)
Re: 2.6.25-mm1
, Andrew Morton
, (Fri Apr 18, 8:02 pm)
Re: 2.6.25-mm1
, Andrew Morton
, (Fri Apr 18, 8:08 pm)
Re: 2.6.25-mm1
, Joseph Fannin
, (Fri Apr 18, 8:10 pm)
Re: 2.6.25-mm1
, Andrew Morton
, (Fri Apr 18, 8:29 pm)
Re: 2.6.25-mm1
, Dmitry Torokhov
, (Fri Apr 18, 9:14 pm)
Re: 2.6.25-mm1
, Andrew Morton
, (Fri Apr 18, 9:29 pm)
Re: 2.6.25-mm1
, Joseph Fannin
, (Fri Apr 18, 11:33 pm)
Re: 2.6.25-mm1
, Andres Salomon
, (Sat Apr 19, 6:25 am)
Re: 2.6.25-mm1
, Andrew Morton
, (Sat Apr 19, 10:38 am)
[PATCH 1/2] OLPC: Add support for calling into Open Firmware
, Andres Salomon
, (Sat Apr 19, 10:39 am)
[PATCH 2/2] OLPC: drop pre-OpenFirmware workarounds
, Andres Salomon
, (Sat Apr 19, 10:39 am)
Re: 2.6.25-mm1
, Andres Salomon
, (Sat Apr 19, 10:50 am)
Re: 2.6.25-mm1
, Arjan van de Ven
, (Sat Apr 19, 11:21 am)
Re: [PATCH 1/2] OLPC: Add support for calling into Open Fi ...
, Yinghai Lu
, (Sun Apr 20, 3:34 am)
internal compiler error: SIGSEGV [Was: 2.6.25-mm1]
, Jiri Slaby
, (Sun Apr 20, 4:29 am)
Re: [PATCH 1/2] OLPC: Add support for calling into Open Fi ...
, H. Peter Anvin
, (Sun Apr 20, 5:07 am)
Re: [PATCH 1/2] OLPC: Add support for calling into Open Fi ...
, Andres Salomon
, (Sun Apr 20, 10:59 am)
Re: [PATCH 1/2] OLPC: Add support for calling into Open Fi ...
, Mitch Bradley
, (Sun Apr 20, 11:42 am)
Re: [PATCH 1/2] OLPC: Add support for calling into Open Fi ...
, H. Peter Anvin
, (Sun Apr 20, 12:12 pm)
Re: [PATCH 1/2] OLPC: Add support for calling into Open Fi ...
, H. Peter Anvin
, (Sun Apr 20, 12:13 pm)
Re: [PATCH 1/2] OLPC: Add support for calling into Open Fi ...
, Mitch Bradley
, (Sun Apr 20, 8:09 pm)
Re: [PATCH 1/2] OLPC: Add support for calling into Open Fi ...
, Yinghai Lu
, (Sun Apr 20, 8:15 pm)
Re: [PATCH 1/2] OLPC: Add support for calling into Open Fi ...
, Mitch Bradley
, (Sun Apr 20, 8:39 pm)
Re: [PATCH 1/2] OLPC: Add support for calling into Open Fi ...
, Mitch Bradley
, (Sun Apr 20, 9:05 pm)
Re: [PATCH 1/2] OLPC: Add support for calling into Open Fi ...
, David Miller
, (Sun Apr 20, 9:26 pm)
Re: [PATCH 1/2] OLPC: Add support for calling into Open Fi ...
, Yinghai Lu
, (Sun Apr 20, 9:50 pm)
Re: [PATCH 1/2] OLPC: Add support for calling into Open Fi ...
, Yinghai Lu
, (Sun Apr 20, 9:54 pm)
Re: [PATCH 1/2] OLPC: Add support for calling into Open Fi ...
, Mitch Bradley
, (Mon Apr 21, 1:03 am)
Re: [PATCH 1/2] OLPC: Add support for calling into Open Fi ...
, Mitch Bradley
, (Mon Apr 21, 1:22 am)
[Was: 2.6.25-mm1]
, Jiri Slaby
, (Mon Apr 21, 1:31 am)
Re: [Was: 2.6.25-mm1]
, Al Viro
, (Mon Apr 21, 2:06 am)
fault in __d_lookup [Was: 2.6.25-mm1]
, Jiri Slaby
, (Mon Apr 21, 2:37 am)
Re: fault in __d_lookup [Was: 2.6.25-mm1]
, Al Viro
, (Mon Apr 21, 2:45 am)
Re: fault in __d_lookup [Was: 2.6.25-mm1]
, Jiri Slaby
, (Mon Apr 21, 2:59 am)
Re: 2.6.25-mm1
, Takashi Iwai
, (Mon Apr 21, 4:07 am)
Re: [PATCH 1/2] OLPC: Add support for calling into Open Fi ...
, H. Peter Anvin
, (Mon Apr 21, 4:36 am)
Re: [PATCH 1/2] OLPC: Add support for calling into Open Fi ...
, H. Peter Anvin
, (Mon Apr 21, 6:09 am)
Re: [PATCH 1/2] OLPC: Add support for calling into Open Fi ...
, H. Peter Anvin
, (Mon Apr 21, 6:13 am)
Re: [PATCH 1/2] OLPC: Add support for calling into Open Fi ...
, H. Peter Anvin
, (Mon Apr 21, 6:19 am)
Re: fault in __d_lookup [Was: 2.6.25-mm1]
, Rafael J. Wysocki
, (Mon Apr 21, 6:42 am)
Re: 2.6.25-mm1
, Takashi Iwai
, (Mon Apr 21, 7:06 am)
Re: [PATCH 1/2] OLPC: Add support for calling into Open Fi ...
, Andres Salomon
, (Mon Apr 21, 7:24 am)
Re: 2.6.25-mm1
, Jordan Crouse
, (Mon Apr 21, 7:56 am)
Re: OLPC: Add support for calling into Open Firmware
, H. Peter Anvin
, (Mon Apr 21, 7:58 am)
Re: 2.6.25-mm1
, Andres Salomon
, (Mon Apr 21, 8:05 am)
Re: OLPC: Add support for calling into Open Firmware
, Jordan Crouse
, (Mon Apr 21, 8:05 am)
Re: StackProtector Oopses - Re: 2.6.25-mm1
, Ingo Molnar
, (Mon Apr 21, 8:06 am)
Re: 2.6.25-mm1
, Jordan Crouse
, (Mon Apr 21, 8:12 am)
Re: [PATCH 1/2] OLPC: Add support for calling into Open Fi ...
, David Woodhouse
, (Mon Apr 21, 8:54 am)
Re: [PATCH 1/2] OLPC: Add support for calling into Open Fi ...
, H. Peter Anvin
, (Mon Apr 21, 9:57 am)
Re: [PATCH 1/2] OLPC: Add support for calling into Open Fi ...
, Andres Salomon
, (Mon Apr 21, 10:03 am)
Re: fault in __d_lookup [Was: 2.6.25-mm1]
, Matthew Wilcox
, (Mon Apr 21, 10:23 am)
Re: 2.6.25-mm1 (snd-pcsp causes driver conflict)
, Stas Sergeev
, (Mon Apr 21, 10:44 am)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC)
, Stas Sergeev
, (Mon Apr 21, 10:55 am)
Re: [PATCH 1/2] OLPC: Add support for calling into Open Fi ...
, David Woodhouse
, (Mon Apr 21, 11:54 am)
Re: [PATCH 1/2] OLPC: Add support for calling into Open Fi ...
, David Woodhouse
, (Mon Apr 21, 12:18 pm)
Re: 2.6.25-mm1
, Stas Sergeev
, (Mon Apr 21, 12:45 pm)
Re: [PATCH 1/2] OLPC: Add support for calling into Open Fi ...
, Andres Salomon
, (Mon Apr 21, 12:46 pm)
Re: [PATCH 1/2] OLPC: Add support for calling into Open Fi ...
, David Woodhouse
, (Mon Apr 21, 1:25 pm)
[PATCH] OLPC: only check for OFW signature on VSA-less Geodes
, Andres Salomon
, (Mon Apr 21, 2:02 pm)
Re: OLPC: only check for OFW signature on VSA-less Geodes
, Jordan Crouse
, (Mon Apr 21, 2:17 pm)
Re: [PATCH] OLPC: only check for OFW signature on VSA-less ...
, David Woodhouse
, (Mon Apr 21, 2:17 pm)
Re: StackProtector Oopses - Re: 2.6.25-mm1
, Arjan van de Ven
, (Mon Apr 21, 6:48 pm)
Re: StackProtector Oopses - Re: 2.6.25-mm1
, Valdis.Kletnieks
, (Mon Apr 21, 7:04 pm)
Re: StackProtector Oopses - Re: 2.6.25-mm1
, Ingo Molnar
, (Tue Apr 22, 1:34 am)
Re: 2.6.25-mm1 (snd-pcsp causes driver conflict)
, Takashi Iwai
, (Tue Apr 22, 3:09 am)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC)
, Takashi Iwai
, (Tue Apr 22, 3:13 am)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC)
, Dmitry Torokhov
, (Tue Apr 22, 7:01 am)
Re: StackProtector Oopses - Re: 2.6.25-mm1
, Arjan van de Ven
, (Tue Apr 22, 7:29 am)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC)
, Stas Sergeev
, (Tue Apr 22, 9:42 am)
Re: 2.6.25-mm1 (snd-pcsp causes driver conflict)
, Stas Sergeev
, (Tue Apr 22, 10:54 am)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC)
, Stas Sergeev
, (Tue Apr 22, 11:31 am)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC)
, Takashi Iwai
, (Wed Apr 23, 1:49 am)
Re: 2.6.25-mm1 (snd-pcsp causes driver conflict)
, Takashi Iwai
, (Wed Apr 23, 1:55 am)
Re: 2.6.25-mm1 (snd-pcsp causes driver conflict)
, Takashi Iwai
, (Wed Apr 23, 7:14 am)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC)
, Takashi Iwai
, (Wed Apr 23, 7:18 am)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC)
, Stas Sergeev
, (Wed Apr 23, 1:02 pm)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC)
, Takashi Iwai
, (Thu Apr 24, 2:40 am)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC)
, Stas Sergeev
, (Thu Apr 24, 8:51 pm)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC)
, Takashi Iwai
, (Thu Apr 24, 11:28 pm)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC)
, Stas Sergeev
, (Fri Apr 25, 9:45 am)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC)
, Takashi Iwai
, (Fri Apr 25, 9:51 am)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC)
, Stas Sergeev
, (Fri Apr 25, 10:25 am)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC)
, Dmitry Torokhov
, (Fri Apr 25, 11:09 am)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC)
, Stas Sergeev
, (Fri Apr 25, 11:31 am)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC)
, Dmitry Torokhov
, (Fri Apr 25, 11:37 am)
Re: [PATCH] OLPC: only check for OFW signature on VSA-less ...
, Andrew Morton
, (Mon Apr 28, 8:06 pm)
[PATCH] x86: GEODE: cache results from geode_has_vsa2() an ...
, Andres Salomon
, (Mon Apr 28, 10:32 pm)
Re: [PATCH] x86: GEODE: cache results from geode_has_vsa2( ...
, Andrew Morton
, (Tue Apr 29, 1:35 pm)
Re: [PATCH] x86: GEODE: cache results from geode_has_vsa2( ...
, Andres Salomon
, (Tue Apr 29, 1:57 pm)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC)
, Takashi Iwai
, (Fri May 2, 9:44 am)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC)
, Stas Sergeev
, (Fri May 2, 9:57 am)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC)
, Takashi Iwai
, (Tue May 6, 3:20 am)
Re: 2.6.25-mm1 (snd-pcsp doesn't like DEBUG_PAGEALLOC)
, Stas Sergeev
, (Tue May 6, 9:51 am)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Greg Kroah-Hartman
[PATCH 041/196] kobject: add kobject_init_and_add function
Lukas Hejtmanek
Re: Another libata error related to OCZ SSD
Greg Kroah-Hartman
[PATCH 023/196] MCP_UCB1200: Convert from class_device to device
Florian Fainelli
Re: System clock runs too fast after 2.6.27 -> 2.6.28.1 upgrade
Christoph Lameter
[patch 1/4] mmu_notifier: Core code
git
:
Johannes Schindelin
Re: [PATCH 1/2] Add strbuf_initf()
John Bito
[EGIT] Push to GitHub caused corruption
Jakub Narebski
Re: [PATCH 0/2] gitweb: patch view
Junio C Hamano
Re: [PATCH] When a remote is added but not fetched, tell the user.
Andy Parkins
Re: [RFC] Submodules in GIT
git-commits-head
:
Linux Kernel Mailing List
ahci: Workaround HW bug for SB600/700 SATA controller PMP support
Linux Kernel Mailing List
V4L/DVB (11086): au0828: rename macro for currently non-function VBI support
Linux Kernel Mailing List
ceph: client types
Linux Kernel Mailing List
ceph: on-wire types
Linux Kernel Mailing List
crypto: chainiv - Use kcrypto_wq instead of keventd_wq
linux-netdev
:
Andrew Morton
Re: [Bugme-new] [Bug 14969] New: b44: WOL does not work in suspended state
Giuseppe CAVALLARO
Re: [PATCH 03/13] stmmac: add the new Header file for stmmac platform data
Taku Izumi
[PATCH 3/3] ixgbe: add registers etc. printout code just before resetting adapters
Eric Dumazet
rps: some comments
Thomas Gleixner
Re: [RFC PATCH 02/12] On Tue, 23 Sep 2008, David Miller wrote:
openbsd-misc
:
Stephan Andreas
problems with login after xlock in OpenBSD release 4.7
pmc
Make A Change. Alcoholism and Drug Addiction Treatment
ropers
Re: what exactly is enc0?
Fuad NAHDI
Re: What does your environment look like?
Matthew Szudzik
Typo on OpenBSD 4.4 CD Set
Colocation donated by:
Syndicate