-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This patch adds minimal support for device tree on x86. The device tree blob is passed to the kernel via setup_data which requires at least boot protocol 2.09. Memory size, restricted memory regions, boot arguments are gathered the traditional way so things like cmd_line are just here to let the code compile. The current plan is use the device tree as an extension and to gather information which can not be enumerated and would have to be hardcoded otherwise. This includes things like - which devices are on this I2C/SPI bus? - how are the interrupts wired to IO APIC? - where could my hpet be? Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com> Acked-by: Grant Likely <grant.likely@secretlab.ca> Cc: sodaville@linutronix.de Cc: devicetree-discuss@lists.ozlabs.org LKML-Reference: <1298405266-1624-3-git-send-email-bigeasy@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
- Loading branch information
Sebastian Andrzej Siewior
authored and
Thomas Gleixner
committed
Feb 23, 2011
1 parent
f1c2b35
commit da6b737
Showing
9 changed files
with
126 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,47 @@ | ||
/* dummy prom.h; here to make linux/of.h's #includes happy */ | ||
/* | ||
* Definitions for Device tree / OpenFirmware handling on X86 | ||
* | ||
* based on arch/powerpc/include/asm/prom.h which is | ||
* Copyright (C) 1996-2005 Paul Mackerras. | ||
* | ||
* 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. | ||
*/ | ||
|
||
#ifndef _ASM_X86_PROM_H | ||
#define _ASM_X86_PROM_H | ||
#ifndef __ASSEMBLY__ | ||
|
||
#include <linux/of.h> | ||
#include <linux/types.h> | ||
|
||
#include <asm/irq.h> | ||
#include <asm/atomic.h> | ||
#include <asm/setup.h> | ||
|
||
#ifdef CONFIG_OF | ||
extern void add_dtb(u64 data); | ||
#else | ||
static inline void add_dtb(u64 data) { } | ||
#endif | ||
|
||
extern char cmd_line[COMMAND_LINE_SIZE]; | ||
|
||
#define pci_address_to_pio pci_address_to_pio | ||
unsigned long pci_address_to_pio(phys_addr_t addr); | ||
|
||
/** | ||
* irq_dispose_mapping - Unmap an interrupt | ||
* @virq: linux virq number of the interrupt to unmap | ||
* | ||
* FIXME: We really should implement proper virq handling like power, | ||
* but that's going to be major surgery. | ||
*/ | ||
static inline void irq_dispose_mapping(unsigned int virq) { } | ||
|
||
#define HAVE_ARCH_DEVTREE_FIXUPS | ||
|
||
#endif /* __ASSEMBLY__ */ | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Architecture specific OF callbacks. | ||
*/ | ||
#include <linux/bootmem.h> | ||
#include <linux/io.h> | ||
#include <linux/list.h> | ||
#include <linux/of.h> | ||
#include <linux/of_fdt.h> | ||
#include <linux/of_platform.h> | ||
#include <linux/slab.h> | ||
|
||
char __initdata cmd_line[COMMAND_LINE_SIZE]; | ||
|
||
unsigned int irq_create_of_mapping(struct device_node *controller, | ||
const u32 *intspec, unsigned int intsize) | ||
{ | ||
return intspec[0]; | ||
|
||
} | ||
EXPORT_SYMBOL_GPL(irq_create_of_mapping); | ||
|
||
unsigned long pci_address_to_pio(phys_addr_t address) | ||
{ | ||
/* | ||
* The ioport address can be directly used by inX / outX | ||
*/ | ||
BUG_ON(address >= (1 << 16)); | ||
return (unsigned long)address; | ||
} | ||
EXPORT_SYMBOL_GPL(pci_address_to_pio); | ||
|
||
void __init early_init_dt_scan_chosen_arch(unsigned long node) | ||
{ | ||
BUG(); | ||
} | ||
|
||
void __init early_init_dt_add_memory_arch(u64 base, u64 size) | ||
{ | ||
BUG(); | ||
} | ||
|
||
void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align) | ||
{ | ||
return __alloc_bootmem(size, align, __pa(MAX_DMA_ADDRESS)); | ||
} | ||
|
||
void __init add_dtb(u64 data) | ||
{ | ||
initial_boot_params = phys_to_virt((u64) (u32) data + | ||
offsetof(struct setup_data, data)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters