You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6
* 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6: mtd/m25p80: add support to parse the partitions by OF node of/irq: of_irq.c needs to include linux/irq.h of/mips: Cleanup some include directives/files. of/mips: Add device tree support to MIPS of/flattree: Eliminate need to provide early_init_dt_scan_chosen_arch of/device: Rework to use common platform_device_alloc() for allocating devices of/xsysace: Fix OF probing on little-endian systems of: use __be32 types for big-endian device tree data of/irq: remove references to NO_IRQ in drivers/of/platform.c of/promtree: add package-to-path support to pdt of/promtree: add of_pdt namespace to pdt code of/promtree: no longer call prom_ functions directly; use an ops structure of/promtree: make drivers/of/pdt.c no longer sparc-only sparc: break out some PROM device-tree building code out into drivers/of of/sparc: convert various prom_* functions to use phandle sparc: stop exporting openprom.h header powerpc, of_serial: Endianness issues setting up the serial ports of: MTD: Fix OF probing on little-endian systems of: GPIO: Fix OF probing on little-endian systems
This commit is contained in:
@@ -42,11 +42,6 @@
|
||||
#include <asm/sections.h>
|
||||
#include <asm/pci-bridge.h>
|
||||
|
||||
void __init early_init_dt_scan_chosen_arch(unsigned long node)
|
||||
{
|
||||
/* No Microblaze specific code here */
|
||||
}
|
||||
|
||||
void __init early_init_dt_add_memory_arch(u64 base, u64 size)
|
||||
{
|
||||
memblock_add(base, size);
|
||||
|
||||
@@ -2128,6 +2128,13 @@ config SECCOMP
|
||||
|
||||
If unsure, say Y. Only embedded should say N here.
|
||||
|
||||
config USE_OF
|
||||
bool "Flattened Device Tree support"
|
||||
select OF
|
||||
select OF_FLATTREE
|
||||
help
|
||||
Include support for flattened device tree machine descriptions.
|
||||
|
||||
endmenu
|
||||
|
||||
config LOCKDEP_SUPPORT
|
||||
|
||||
@@ -16,6 +16,11 @@
|
||||
|
||||
#include <irq.h>
|
||||
|
||||
static inline void irq_dispose_mapping(unsigned int virq)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_I8259
|
||||
static inline int irq_canonicalize(int irq)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* arch/mips/include/asm/prom.h
|
||||
*
|
||||
* Copyright (C) 2010 Cisco Systems Inc. <dediao@cisco.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
*/
|
||||
#ifndef __ASM_MIPS_PROM_H
|
||||
#define __ASM_MIPS_PROM_H
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
#include <asm/bootinfo.h>
|
||||
|
||||
/* which is compatible with the flattened device tree (FDT) */
|
||||
#define cmd_line arcs_cmdline
|
||||
|
||||
extern int early_init_dt_scan_memory_arch(unsigned long node,
|
||||
const char *uname, int depth, void *data);
|
||||
|
||||
extern int reserve_mem_mach(unsigned long addr, unsigned long size);
|
||||
extern void free_mem_mach(unsigned long addr, unsigned long size);
|
||||
|
||||
extern void device_tree_init(void);
|
||||
#else /* CONFIG_OF */
|
||||
static inline void device_tree_init(void) { }
|
||||
#endif /* CONFIG_OF */
|
||||
|
||||
#endif /* _ASM_MIPS_PROM_H */
|
||||
@@ -96,6 +96,8 @@ obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
|
||||
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
|
||||
obj-$(CONFIG_SPINLOCK_TEST) += spinlock_test.o
|
||||
|
||||
obj-$(CONFIG_OF) += prom.o
|
||||
|
||||
CFLAGS_cpu-bugs64.o = $(shell if $(CC) $(KBUILD_CFLAGS) -Wa,-mdaddi -c -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi)
|
||||
|
||||
obj-$(CONFIG_HAVE_STD_PC_SERIAL_PORT) += 8250-platform.o
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
* MIPS support for CONFIG_OF device tree support
|
||||
*
|
||||
* Copyright (C) 2010 Cisco Systems Inc. <dediao@cisco.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/bootmem.h>
|
||||
#include <linux/initrd.h>
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_fdt.h>
|
||||
#include <linux/of_irq.h>
|
||||
#include <linux/of_platform.h>
|
||||
|
||||
#include <asm/page.h>
|
||||
#include <asm/prom.h>
|
||||
|
||||
int __init early_init_dt_scan_memory_arch(unsigned long node,
|
||||
const char *uname, int depth,
|
||||
void *data)
|
||||
{
|
||||
return early_init_dt_scan_memory(node, uname, depth, data);
|
||||
}
|
||||
|
||||
void __init early_init_dt_add_memory_arch(u64 base, u64 size)
|
||||
{
|
||||
return add_memory_region(base, size, BOOT_MEM_RAM);
|
||||
}
|
||||
|
||||
int __init reserve_mem_mach(unsigned long addr, unsigned long size)
|
||||
{
|
||||
return reserve_bootmem(addr, size, BOOTMEM_DEFAULT);
|
||||
}
|
||||
|
||||
void __init free_mem_mach(unsigned long addr, unsigned long size)
|
||||
{
|
||||
return free_bootmem(addr, size);
|
||||
}
|
||||
|
||||
u64 __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
|
||||
{
|
||||
return virt_to_phys(
|
||||
__alloc_bootmem(size, align, __pa(MAX_DMA_ADDRESS))
|
||||
);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BLK_DEV_INITRD
|
||||
void __init early_init_dt_setup_initrd_arch(unsigned long start,
|
||||
unsigned long end)
|
||||
{
|
||||
initrd_start = (unsigned long)__va(start);
|
||||
initrd_end = (unsigned long)__va(end);
|
||||
initrd_below_start_ok = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* irq_create_of_mapping - Hook to resolve OF irq specifier into a Linux irq#
|
||||
*
|
||||
* Currently the mapping mechanism is trivial; simple flat hwirq numbers are
|
||||
* mapped 1:1 onto Linux irq numbers. Cascaded irq controllers are not
|
||||
* supported.
|
||||
*/
|
||||
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);
|
||||
|
||||
void __init early_init_devtree(void *params)
|
||||
{
|
||||
/* Setup flat device-tree pointer */
|
||||
initial_boot_params = params;
|
||||
|
||||
/* Retrieve various informations from the /chosen node of the
|
||||
* device-tree, including the platform type, initrd location and
|
||||
* size, and more ...
|
||||
*/
|
||||
of_scan_flat_dt(early_init_dt_scan_chosen, NULL);
|
||||
|
||||
/* Scan memory nodes */
|
||||
of_scan_flat_dt(early_init_dt_scan_root, NULL);
|
||||
of_scan_flat_dt(early_init_dt_scan_memory_arch, NULL);
|
||||
}
|
||||
|
||||
void __init device_tree_init(void)
|
||||
{
|
||||
unsigned long base, size;
|
||||
|
||||
if (!initial_boot_params)
|
||||
return;
|
||||
|
||||
base = virt_to_phys((void *)initial_boot_params);
|
||||
size = initial_boot_params->totalsize;
|
||||
|
||||
/* Before we do anything, lets reserve the dt blob */
|
||||
reserve_mem_mach(base, size);
|
||||
|
||||
unflatten_device_tree();
|
||||
|
||||
/* free the space reserved for the dt blob */
|
||||
free_mem_mach(base, size);
|
||||
}
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <asm/setup.h>
|
||||
#include <asm/smp-ops.h>
|
||||
#include <asm/system.h>
|
||||
#include <asm/prom.h>
|
||||
|
||||
struct cpuinfo_mips cpu_data[NR_CPUS] __read_mostly;
|
||||
|
||||
@@ -487,6 +488,7 @@ static void __init arch_mem_init(char **cmdline_p)
|
||||
}
|
||||
|
||||
bootmem_init();
|
||||
device_tree_init();
|
||||
sparse_init();
|
||||
paging_init();
|
||||
}
|
||||
|
||||
@@ -162,13 +162,10 @@ static int ibmebus_create_device(struct device_node *dn)
|
||||
dev->dev.bus = &ibmebus_bus_type;
|
||||
dev->dev.archdata.dma_ops = &ibmebus_dma_ops;
|
||||
|
||||
ret = of_device_register(dev);
|
||||
if (ret) {
|
||||
of_device_free(dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
ret = of_device_add(dev);
|
||||
if (ret)
|
||||
platform_device_put(dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int ibmebus_create_devices(const struct of_device_id *matches)
|
||||
|
||||
@@ -52,14 +52,14 @@ static int __init add_legacy_port(struct device_node *np, int want_index,
|
||||
phys_addr_t taddr, unsigned long irq,
|
||||
upf_t flags, int irq_check_parent)
|
||||
{
|
||||
const u32 *clk, *spd;
|
||||
const __be32 *clk, *spd;
|
||||
u32 clock = BASE_BAUD * 16;
|
||||
int index;
|
||||
|
||||
/* get clock freq. if present */
|
||||
clk = of_get_property(np, "clock-frequency", NULL);
|
||||
if (clk && *clk)
|
||||
clock = *clk;
|
||||
clock = be32_to_cpup(clk);
|
||||
|
||||
/* get default speed if present */
|
||||
spd = of_get_property(np, "current-speed", NULL);
|
||||
@@ -109,7 +109,7 @@ static int __init add_legacy_port(struct device_node *np, int want_index,
|
||||
legacy_serial_infos[index].taddr = taddr;
|
||||
legacy_serial_infos[index].np = of_node_get(np);
|
||||
legacy_serial_infos[index].clock = clock;
|
||||
legacy_serial_infos[index].speed = spd ? *spd : 0;
|
||||
legacy_serial_infos[index].speed = spd ? be32_to_cpup(spd) : 0;
|
||||
legacy_serial_infos[index].irq_check_parent = irq_check_parent;
|
||||
|
||||
printk(KERN_DEBUG "Found legacy serial port %d for %s\n",
|
||||
@@ -168,7 +168,7 @@ static int __init add_legacy_soc_port(struct device_node *np,
|
||||
static int __init add_legacy_isa_port(struct device_node *np,
|
||||
struct device_node *isa_brg)
|
||||
{
|
||||
const u32 *reg;
|
||||
const __be32 *reg;
|
||||
const char *typep;
|
||||
int index = -1;
|
||||
u64 taddr;
|
||||
@@ -181,7 +181,7 @@ static int __init add_legacy_isa_port(struct device_node *np,
|
||||
return -1;
|
||||
|
||||
/* Verify it's an IO port, we don't support anything else */
|
||||
if (!(reg[0] & 0x00000001))
|
||||
if (!(be32_to_cpu(reg[0]) & 0x00000001))
|
||||
return -1;
|
||||
|
||||
/* Now look for an "ibm,aix-loc" property that gives us ordering
|
||||
@@ -202,7 +202,7 @@ static int __init add_legacy_isa_port(struct device_node *np,
|
||||
taddr = 0;
|
||||
|
||||
/* Add port, irq will be dealt with later */
|
||||
return add_legacy_port(np, index, UPIO_PORT, reg[1], taddr,
|
||||
return add_legacy_port(np, index, UPIO_PORT, be32_to_cpu(reg[1]), taddr,
|
||||
NO_IRQ, UPF_BOOT_AUTOCONF, 0);
|
||||
|
||||
}
|
||||
@@ -251,9 +251,9 @@ static int __init add_legacy_pci_port(struct device_node *np,
|
||||
* we get to their "reg" property
|
||||
*/
|
||||
if (np != pci_dev) {
|
||||
const u32 *reg = of_get_property(np, "reg", NULL);
|
||||
if (reg && (*reg < 4))
|
||||
index = lindex = *reg;
|
||||
const __be32 *reg = of_get_property(np, "reg", NULL);
|
||||
if (reg && (be32_to_cpup(reg) < 4))
|
||||
index = lindex = be32_to_cpup(reg);
|
||||
}
|
||||
|
||||
/* Local index means it's the Nth port in the PCI chip. Unfortunately
|
||||
@@ -507,7 +507,7 @@ static int __init check_legacy_serial_console(void)
|
||||
struct device_node *prom_stdout = NULL;
|
||||
int i, speed = 0, offset = 0;
|
||||
const char *name;
|
||||
const u32 *spd;
|
||||
const __be32 *spd;
|
||||
|
||||
DBG(" -> check_legacy_serial_console()\n");
|
||||
|
||||
@@ -547,7 +547,7 @@ static int __init check_legacy_serial_console(void)
|
||||
}
|
||||
spd = of_get_property(prom_stdout, "current-speed", NULL);
|
||||
if (spd)
|
||||
speed = *spd;
|
||||
speed = be32_to_cpup(spd);
|
||||
|
||||
if (strcmp(name, "serial") != 0)
|
||||
goto not_found;
|
||||
|
||||
@@ -364,10 +364,15 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
|
||||
return 0;
|
||||
}
|
||||
|
||||
void __init early_init_dt_scan_chosen_arch(unsigned long node)
|
||||
int __init early_init_dt_scan_chosen_ppc(unsigned long node, const char *uname,
|
||||
int depth, void *data)
|
||||
{
|
||||
unsigned long *lprop;
|
||||
|
||||
/* Use common scan routine to determine if this is the chosen node */
|
||||
if (early_init_dt_scan_chosen(node, uname, depth, data) == 0)
|
||||
return 0;
|
||||
|
||||
#ifdef CONFIG_PPC64
|
||||
/* check if iommu is forced on or off */
|
||||
if (of_get_flat_dt_prop(node, "linux,iommu-off", NULL) != NULL)
|
||||
@@ -399,6 +404,9 @@ void __init early_init_dt_scan_chosen_arch(unsigned long node)
|
||||
if (lprop)
|
||||
crashk_res.end = crashk_res.start + *lprop - 1;
|
||||
#endif
|
||||
|
||||
/* break now */
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PPC_PSERIES
|
||||
@@ -683,7 +691,7 @@ void __init early_init_devtree(void *params)
|
||||
* device-tree, including the platform type, initrd location and
|
||||
* size, TCE reserve, and more ...
|
||||
*/
|
||||
of_scan_flat_dt(early_init_dt_scan_chosen, NULL);
|
||||
of_scan_flat_dt(early_init_dt_scan_chosen_ppc, NULL);
|
||||
|
||||
/* Scan memory nodes and rebuild MEMBLOCKs */
|
||||
memblock_init();
|
||||
|
||||
@@ -19,6 +19,7 @@ config SPARC
|
||||
bool
|
||||
default y
|
||||
select OF
|
||||
select OF_PROMTREE
|
||||
select HAVE_IDE
|
||||
select HAVE_OPROFILE
|
||||
select HAVE_ARCH_KGDB if !SMP || SPARC64
|
||||
|
||||
@@ -7,7 +7,6 @@ header-y += display7seg.h
|
||||
header-y += envctrl.h
|
||||
header-y += fbio.h
|
||||
header-y += jsflash.h
|
||||
header-y += openprom.h
|
||||
header-y += openpromio.h
|
||||
header-y += perfctr.h
|
||||
header-y += psrcompat.h
|
||||
|
||||
@@ -304,7 +304,8 @@ static struct linux_prom_registers fd_regs[2];
|
||||
static int sun_floppy_init(void)
|
||||
{
|
||||
char state[128];
|
||||
int tnode, fd_node, num_regs;
|
||||
phandle tnode, fd_node;
|
||||
int num_regs;
|
||||
struct resource r;
|
||||
|
||||
use_virtual_dma = 1;
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
#define LINUX_OPPROM_MAGIC 0x10010407
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#include <linux/of.h>
|
||||
|
||||
/* V0 prom device operations. */
|
||||
struct linux_dev_v0_funcs {
|
||||
int (*v0_devopen)(char *device_str);
|
||||
@@ -26,7 +28,7 @@ struct linux_dev_v0_funcs {
|
||||
|
||||
/* V2 and later prom device operations. */
|
||||
struct linux_dev_v2_funcs {
|
||||
int (*v2_inst2pkg)(int d); /* Convert ihandle to phandle */
|
||||
phandle (*v2_inst2pkg)(int d); /* Convert ihandle to phandle */
|
||||
char * (*v2_dumb_mem_alloc)(char *va, unsigned sz);
|
||||
void (*v2_dumb_mem_free)(char *va, unsigned sz);
|
||||
|
||||
@@ -168,12 +170,12 @@ struct linux_romvec {
|
||||
|
||||
/* Routines for traversing the prom device tree. */
|
||||
struct linux_nodeops {
|
||||
int (*no_nextnode)(int node);
|
||||
int (*no_child)(int node);
|
||||
int (*no_proplen)(int node, const char *name);
|
||||
int (*no_getprop)(int node, const char *name, char *val);
|
||||
int (*no_setprop)(int node, const char *name, char *val, int len);
|
||||
char * (*no_nextprop)(int node, char *name);
|
||||
phandle (*no_nextnode)(phandle node);
|
||||
phandle (*no_child)(phandle node);
|
||||
int (*no_proplen)(phandle node, const char *name);
|
||||
int (*no_getprop)(phandle node, const char *name, char *val);
|
||||
int (*no_setprop)(phandle node, const char *name, char *val, int len);
|
||||
char * (*no_nextprop)(phandle node, char *name);
|
||||
};
|
||||
|
||||
/* More fun PROM structures for device probing. */
|
||||
|
||||
@@ -30,7 +30,7 @@ extern unsigned int prom_rev, prom_prev;
|
||||
/* Root node of the prom device tree, this stays constant after
|
||||
* initialization is complete.
|
||||
*/
|
||||
extern int prom_root_node;
|
||||
extern phandle prom_root_node;
|
||||
|
||||
/* Pointer to prom structure containing the device tree traversal
|
||||
* and usage utility functions. Only prom-lib should use these,
|
||||
@@ -178,68 +178,68 @@ extern void prom_putsegment(int context, unsigned long virt_addr,
|
||||
/* PROM device tree traversal functions... */
|
||||
|
||||
/* Get the child node of the given node, or zero if no child exists. */
|
||||
extern int prom_getchild(int parent_node);
|
||||
extern phandle prom_getchild(phandle parent_node);
|
||||
|
||||
/* Get the next sibling node of the given node, or zero if no further
|
||||
* siblings exist.
|
||||
*/
|
||||
extern int prom_getsibling(int node);
|
||||
extern phandle prom_getsibling(phandle node);
|
||||
|
||||
/* Get the length, at the passed node, of the given property type.
|
||||
* Returns -1 on error (ie. no such property at this node).
|
||||
*/
|
||||
extern int prom_getproplen(int thisnode, const char *property);
|
||||
extern int prom_getproplen(phandle thisnode, const char *property);
|
||||
|
||||
/* Fetch the requested property using the given buffer. Returns
|
||||
* the number of bytes the prom put into your buffer or -1 on error.
|
||||
*/
|
||||
extern int __must_check prom_getproperty(int thisnode, const char *property,
|
||||
extern int __must_check prom_getproperty(phandle thisnode, const char *property,
|
||||
char *prop_buffer, int propbuf_size);
|
||||
|
||||
/* Acquire an integer property. */
|
||||
extern int prom_getint(int node, char *property);
|
||||
extern int prom_getint(phandle node, char *property);
|
||||
|
||||
/* Acquire an integer property, with a default value. */
|
||||
extern int prom_getintdefault(int node, char *property, int defval);
|
||||
extern int prom_getintdefault(phandle node, char *property, int defval);
|
||||
|
||||
/* Acquire a boolean property, 0=FALSE 1=TRUE. */
|
||||
extern int prom_getbool(int node, char *prop);
|
||||
extern int prom_getbool(phandle node, char *prop);
|
||||
|
||||
/* Acquire a string property, null string on error. */
|
||||
extern void prom_getstring(int node, char *prop, char *buf, int bufsize);
|
||||
extern void prom_getstring(phandle node, char *prop, char *buf, int bufsize);
|
||||
|
||||
/* Does the passed node have the given "name"? YES=1 NO=0 */
|
||||
extern int prom_nodematch(int thisnode, char *name);
|
||||
extern int prom_nodematch(phandle thisnode, char *name);
|
||||
|
||||
/* Search all siblings starting at the passed node for "name" matching
|
||||
* the given string. Returns the node on success, zero on failure.
|
||||
*/
|
||||
extern int prom_searchsiblings(int node_start, char *name);
|
||||
extern phandle prom_searchsiblings(phandle node_start, char *name);
|
||||
|
||||
/* Return the first property type, as a string, for the given node.
|
||||
* Returns a null string on error.
|
||||
*/
|
||||
extern char *prom_firstprop(int node, char *buffer);
|
||||
extern char *prom_firstprop(phandle node, char *buffer);
|
||||
|
||||
/* Returns the next property after the passed property for the given
|
||||
* node. Returns null string on failure.
|
||||
*/
|
||||
extern char *prom_nextprop(int node, char *prev_property, char *buffer);
|
||||
extern char *prom_nextprop(phandle node, char *prev_property, char *buffer);
|
||||
|
||||
/* Returns phandle of the path specified */
|
||||
extern int prom_finddevice(char *name);
|
||||
extern phandle prom_finddevice(char *name);
|
||||
|
||||
/* Returns 1 if the specified node has given property. */
|
||||
extern int prom_node_has_property(int node, char *property);
|
||||
extern int prom_node_has_property(phandle node, char *property);
|
||||
|
||||
/* Set the indicated property at the given node with the passed value.
|
||||
* Returns the number of bytes of your value that the prom took.
|
||||
*/
|
||||
extern int prom_setprop(int node, const char *prop_name, char *prop_value,
|
||||
extern int prom_setprop(phandle node, const char *prop_name, char *prop_value,
|
||||
int value_size);
|
||||
|
||||
extern int prom_pathtoinode(char *path);
|
||||
extern int prom_inst2pkg(int);
|
||||
extern phandle prom_pathtoinode(char *path);
|
||||
extern phandle prom_inst2pkg(int);
|
||||
|
||||
/* Dorking with Bus ranges... */
|
||||
|
||||
@@ -247,13 +247,13 @@ extern int prom_inst2pkg(int);
|
||||
extern void prom_apply_obio_ranges(struct linux_prom_registers *obioregs, int nregs);
|
||||
|
||||
/* Apply ranges of any prom node (and optionally parent node as well) to registers. */
|
||||
extern void prom_apply_generic_ranges(int node, int parent,
|
||||
extern void prom_apply_generic_ranges(phandle node, phandle parent,
|
||||
struct linux_prom_registers *sbusregs, int nregs);
|
||||
|
||||
/* CPU probing helpers. */
|
||||
int cpu_find_by_instance(int instance, int *prom_node, int *mid);
|
||||
int cpu_find_by_mid(int mid, int *prom_node);
|
||||
int cpu_get_hwmid(int prom_node);
|
||||
int cpu_find_by_instance(int instance, phandle *prom_node, int *mid);
|
||||
int cpu_find_by_mid(int mid, phandle *prom_node);
|
||||
int cpu_get_hwmid(phandle prom_node);
|
||||
|
||||
extern spinlock_t prom_lock;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ extern char prom_version[];
|
||||
/* Root node of the prom device tree, this stays constant after
|
||||
* initialization is complete.
|
||||
*/
|
||||
extern int prom_root_node;
|
||||
extern phandle prom_root_node;
|
||||
|
||||
/* PROM stdin and stdout */
|
||||
extern int prom_stdin, prom_stdout;
|
||||
@@ -24,7 +24,7 @@ extern int prom_stdin, prom_stdout;
|
||||
/* /chosen node of the prom device tree, this stays constant after
|
||||
* initialization is complete.
|
||||
*/
|
||||
extern int prom_chosen_node;
|
||||
extern phandle prom_chosen_node;
|
||||
|
||||
/* Helper values and strings in arch/sparc64/kernel/head.S */
|
||||
extern const char prom_peer_name[];
|
||||
@@ -218,68 +218,69 @@ extern void prom_unmap(unsigned long size, unsigned long vaddr);
|
||||
/* PROM device tree traversal functions... */
|
||||
|
||||
/* Get the child node of the given node, or zero if no child exists. */
|
||||
extern int prom_getchild(int parent_node);
|
||||
extern phandle prom_getchild(phandle parent_node);
|
||||
|
||||
/* Get the next sibling node of the given node, or zero if no further
|
||||
* siblings exist.
|
||||
*/
|
||||
extern int prom_getsibling(int node);
|
||||
extern phandle prom_getsibling(phandle node);
|
||||
|
||||
/* Get the length, at the passed node, of the given property type.
|
||||
* Returns -1 on error (ie. no such property at this node).
|
||||
*/
|
||||
extern int prom_getproplen(int thisnode, const char *property);
|
||||
extern int prom_getproplen(phandle thisnode, const char *property);
|
||||
|
||||
/* Fetch the requested property using the given buffer. Returns
|
||||
* the number of bytes the prom put into your buffer or -1 on error.
|
||||
*/
|
||||
extern int prom_getproperty(int thisnode, const char *property,
|
||||
extern int prom_getproperty(phandle thisnode, const char *property,
|
||||
char *prop_buffer, int propbuf_size);
|
||||
|
||||
/* Acquire an integer property. */
|
||||
extern int prom_getint(int node, const char *property);
|
||||
extern int prom_getint(phandle node, const char *property);
|
||||
|
||||
/* Acquire an integer property, with a default value. */
|
||||
extern int prom_getintdefault(int node, const char *property, int defval);
|
||||
extern int prom_getintdefault(phandle node, const char *property, int defval);
|
||||
|
||||
/* Acquire a boolean property, 0=FALSE 1=TRUE. */
|
||||
extern int prom_getbool(int node, const char *prop);
|
||||
extern int prom_getbool(phandle node, const char *prop);
|
||||
|
||||
/* Acquire a string property, null string on error. */
|
||||
extern void prom_getstring(int node, const char *prop, char *buf, int bufsize);
|
||||
extern void prom_getstring(phandle node, const char *prop, char *buf,
|
||||
int bufsize);
|
||||
|
||||
/* Does the passed node have the given "name"? YES=1 NO=0 */
|
||||
extern int prom_nodematch(int thisnode, const char *name);
|
||||
extern int prom_nodematch(phandle thisnode, const char *name);
|
||||
|
||||
/* Search all siblings starting at the passed node for "name" matching
|
||||
* the given string. Returns the node on success, zero on failure.
|
||||
*/
|
||||
extern int prom_searchsiblings(int node_start, const char *name);
|
||||
extern phandle prom_searchsiblings(phandle node_start, const char *name);
|
||||
|
||||
/* Return the first property type, as a string, for the given node.
|
||||
* Returns a null string on error. Buffer should be at least 32B long.
|
||||
*/
|
||||
extern char *prom_firstprop(int node, char *buffer);
|
||||
extern char *prom_firstprop(phandle node, char *buffer);
|
||||
|
||||
/* Returns the next property after the passed property for the given
|
||||
* node. Returns null string on failure. Buffer should be at least 32B long.
|
||||
*/
|
||||
extern char *prom_nextprop(int node, const char *prev_property, char *buffer);
|
||||
extern char *prom_nextprop(phandle node, const char *prev_property, char *buf);
|
||||
|
||||
/* Returns 1 if the specified node has given property. */
|
||||
extern int prom_node_has_property(int node, const char *property);
|
||||
extern int prom_node_has_property(phandle node, const char *property);
|
||||
|
||||
/* Returns phandle of the path specified */
|
||||
extern int prom_finddevice(const char *name);
|
||||
extern phandle prom_finddevice(const char *name);
|
||||
|
||||
/* Set the indicated property at the given node with the passed value.
|
||||
* Returns the number of bytes of your value that the prom took.
|
||||
*/
|
||||
extern int prom_setprop(int node, const char *prop_name, char *prop_value,
|
||||
extern int prom_setprop(phandle node, const char *prop_name, char *prop_value,
|
||||
int value_size);
|
||||
|
||||
extern int prom_pathtoinode(const char *path);
|
||||
extern int prom_inst2pkg(int);
|
||||
extern phandle prom_pathtoinode(const char *path);
|
||||
extern phandle prom_inst2pkg(int);
|
||||
extern int prom_service_exists(const char *service_name);
|
||||
extern void prom_sun4v_guest_soft_state(void);
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
#include <linux/types.h>
|
||||
#include <linux/of_pdt.h>
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <asm/atomic.h>
|
||||
@@ -67,8 +68,8 @@ extern struct device_node *of_console_device;
|
||||
extern char *of_console_path;
|
||||
extern char *of_console_options;
|
||||
|
||||
extern void (*prom_build_more)(struct device_node *dp, struct device_node ***nextp);
|
||||
extern char *build_full_name(struct device_node *dp);
|
||||
extern void irq_trans_init(struct device_node *dp);
|
||||
extern char *build_path_component(struct device_node *dp);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* _SPARC_PROM_H */
|
||||
|
||||
@@ -23,7 +23,7 @@ static DEFINE_SPINLOCK(auxio_lock);
|
||||
|
||||
void __init auxio_probe(void)
|
||||
{
|
||||
int node, auxio_nd;
|
||||
phandle node, auxio_nd;
|
||||
struct linux_prom_registers auxregs[1];
|
||||
struct resource r;
|
||||
|
||||
@@ -113,7 +113,7 @@ volatile unsigned char * auxio_power_register = NULL;
|
||||
void __init auxio_power_probe(void)
|
||||
{
|
||||
struct linux_prom_registers regs;
|
||||
int node;
|
||||
phandle node;
|
||||
struct resource r;
|
||||
|
||||
/* Attempt to find the sun4m power control node. */
|
||||
|
||||
@@ -40,7 +40,7 @@ static unsigned char *dispDeviceBase __force_data;
|
||||
|
||||
static unsigned char vga_font[cmapsz];
|
||||
|
||||
static int __init btext_initialize(unsigned int node)
|
||||
static int __init btext_initialize(phandle node)
|
||||
{
|
||||
unsigned int width, height, depth, pitch;
|
||||
unsigned long address = 0;
|
||||
@@ -309,7 +309,7 @@ static struct console btext_console = {
|
||||
|
||||
int __init btext_find_display(void)
|
||||
{
|
||||
unsigned int node;
|
||||
phandle node;
|
||||
char type[32];
|
||||
int ret;
|
||||
|
||||
|
||||
+12
-11
@@ -31,9 +31,9 @@ static char *cpu_mid_prop(void)
|
||||
return "mid";
|
||||
}
|
||||
|
||||
static int check_cpu_node(int nd, int *cur_inst,
|
||||
int (*compare)(int, int, void *), void *compare_arg,
|
||||
int *prom_node, int *mid)
|
||||
static int check_cpu_node(phandle nd, int *cur_inst,
|
||||
int (*compare)(phandle, int, void *), void *compare_arg,
|
||||
phandle *prom_node, int *mid)
|
||||
{
|
||||
if (!compare(nd, *cur_inst, compare_arg)) {
|
||||
if (prom_node)
|
||||
@@ -51,8 +51,8 @@ static int check_cpu_node(int nd, int *cur_inst,
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static int __cpu_find_by(int (*compare)(int, int, void *), void *compare_arg,
|
||||
int *prom_node, int *mid)
|
||||
static int __cpu_find_by(int (*compare)(phandle, int, void *),
|
||||
void *compare_arg, phandle *prom_node, int *mid)
|
||||
{
|
||||
struct device_node *dp;
|
||||
int cur_inst;
|
||||
@@ -71,7 +71,7 @@ static int __cpu_find_by(int (*compare)(int, int, void *), void *compare_arg,
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static int cpu_instance_compare(int nd, int instance, void *_arg)
|
||||
static int cpu_instance_compare(phandle nd, int instance, void *_arg)
|
||||
{
|
||||
int desired_instance = (int) _arg;
|
||||
|
||||
@@ -80,13 +80,13 @@ static int cpu_instance_compare(int nd, int instance, void *_arg)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
int cpu_find_by_instance(int instance, int *prom_node, int *mid)
|
||||
int cpu_find_by_instance(int instance, phandle *prom_node, int *mid)
|
||||
{
|
||||
return __cpu_find_by(cpu_instance_compare, (void *)instance,
|
||||
prom_node, mid);
|
||||
}
|
||||
|
||||
static int cpu_mid_compare(int nd, int instance, void *_arg)
|
||||
static int cpu_mid_compare(phandle nd, int instance, void *_arg)
|
||||
{
|
||||
int desired_mid = (int) _arg;
|
||||
int this_mid;
|
||||
@@ -98,7 +98,7 @@ static int cpu_mid_compare(int nd, int instance, void *_arg)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
int cpu_find_by_mid(int mid, int *prom_node)
|
||||
int cpu_find_by_mid(int mid, phandle *prom_node)
|
||||
{
|
||||
return __cpu_find_by(cpu_mid_compare, (void *)mid,
|
||||
prom_node, NULL);
|
||||
@@ -108,7 +108,7 @@ int cpu_find_by_mid(int mid, int *prom_node)
|
||||
* address (0-3). This gives us the true hardware mid, which might have
|
||||
* some other bits set. On 4d hardware and software mids are the same.
|
||||
*/
|
||||
int cpu_get_hwmid(int prom_node)
|
||||
int cpu_get_hwmid(phandle prom_node)
|
||||
{
|
||||
return prom_getintdefault(prom_node, cpu_mid_prop(), -ENODEV);
|
||||
}
|
||||
@@ -119,7 +119,8 @@ void __init device_scan(void)
|
||||
|
||||
#ifndef CONFIG_SMP
|
||||
{
|
||||
int err, cpu_node;
|
||||
phandle cpu_node;
|
||||
int err;
|
||||
err = cpu_find_by_instance(0, &cpu_node, NULL);
|
||||
if (err) {
|
||||
/* Probably a sun4e, Sun is trying to trick us ;-) */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user