mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
Merge branch 'kbuild/rc-fixes' into kbuild/kconfig
We need to revert the temporary hack in 71ebc01, hence the merge.
This commit is contained in:
commit
239060b93b
8483 changed files with 523357 additions and 574807 deletions
|
|
@ -12,6 +12,7 @@ config 64BIT
|
|||
config SPARC
|
||||
bool
|
||||
default y
|
||||
select OF
|
||||
select HAVE_IDE
|
||||
select HAVE_OPROFILE
|
||||
select HAVE_ARCH_KGDB if !SMP || SPARC64
|
||||
|
|
@ -60,9 +61,6 @@ config BITS
|
|||
default 32 if SPARC32
|
||||
default 64 if SPARC64
|
||||
|
||||
config GENERIC_TIME
|
||||
def_bool y
|
||||
|
||||
config ARCH_USES_GETTIMEOFFSET
|
||||
bool
|
||||
default y if SPARC32
|
||||
|
|
@ -142,9 +140,6 @@ config GENERIC_GPIO
|
|||
config ARCH_NO_VIRT_TO_BUS
|
||||
def_bool y
|
||||
|
||||
config OF
|
||||
def_bool y
|
||||
|
||||
config ARCH_SUPPORTS_DEBUG_PAGEALLOC
|
||||
def_bool y if SPARC64
|
||||
|
||||
|
|
|
|||
|
|
@ -30,18 +30,4 @@ config FRAME_POINTER
|
|||
depends on MCOUNT
|
||||
default y
|
||||
|
||||
config DEBUG_STRICT_USER_COPY_CHECKS
|
||||
bool "Strict copy size checks"
|
||||
depends on DEBUG_KERNEL && !TRACE_BRANCH_PROFILING
|
||||
---help---
|
||||
Enabling this option turns a certain set of sanity checks for user
|
||||
copy operations into compile time failures.
|
||||
|
||||
The copy_from_user() etc checks are there to help test if there
|
||||
are sufficient security checks on the length argument of
|
||||
the copy operation, by having gcc prove that the argument is
|
||||
within bounds.
|
||||
|
||||
If unsure, or if you run an older (pre 4.4) gcc, say N.
|
||||
|
||||
endmenu
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ main1:
|
|||
switch (buffer[nbase+3]) {
|
||||
case 'f':
|
||||
if (initval) {
|
||||
fprintf(stderr, "Cannot use pre-initalized fixups for calls\n%s\n", buffer);
|
||||
fprintf(stderr, "Cannot use pre-initialized fixups for calls\n%s\n", buffer);
|
||||
exit(1);
|
||||
}
|
||||
if (!strcmp (sect, "__ksymtab")) {
|
||||
|
|
@ -273,7 +273,7 @@ main1:
|
|||
break;
|
||||
case 'i':
|
||||
if (initval) {
|
||||
fprintf(stderr, "Cannot use pre-initalized fixups for INT\n%s\n", buffer);
|
||||
fprintf(stderr, "Cannot use pre-initialized fixups for INT\n%s\n", buffer);
|
||||
exit(1);
|
||||
}
|
||||
if (strncmp (buffer + mode+9, "HI22 ", 10) && strncmp (buffer + mode+9, "LO10 ", 10)) {
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -6,18 +6,25 @@
|
|||
#ifndef _ASM_SPARC_DEVICE_H
|
||||
#define _ASM_SPARC_DEVICE_H
|
||||
|
||||
#include <asm/openprom.h>
|
||||
|
||||
struct device_node;
|
||||
struct of_device;
|
||||
struct platform_device;
|
||||
|
||||
struct dev_archdata {
|
||||
void *iommu;
|
||||
void *stc;
|
||||
void *host_controller;
|
||||
struct of_device *op;
|
||||
struct platform_device *op;
|
||||
int numa_node;
|
||||
};
|
||||
|
||||
extern void of_propagate_archdata(struct platform_device *bus);
|
||||
|
||||
struct pdev_archdata {
|
||||
struct resource resource[PROMREG_MAX];
|
||||
unsigned int irqs[PROMINTR_MAX];
|
||||
int num_irqs;
|
||||
};
|
||||
|
||||
#endif /* _ASM_SPARC_DEVICE_H */
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ extern int dma_supported(struct device *dev, u64 mask);
|
|||
|
||||
#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
|
||||
#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
|
||||
#define dma_is_consistent(d, h) (1)
|
||||
|
||||
extern struct dma_map_ops *dma_ops, pci32_dma_ops;
|
||||
extern struct bus_type pci_bus_type;
|
||||
|
|
@ -52,15 +51,6 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
|
|||
return (dma_addr == DMA_ERROR_CODE);
|
||||
}
|
||||
|
||||
static inline int dma_get_cache_alignment(void)
|
||||
{
|
||||
/*
|
||||
* no easy way to get cache size on all processors, so return
|
||||
* the maximum possible, to be safe
|
||||
*/
|
||||
return (1 << INTERNODE_CACHE_SHIFT);
|
||||
}
|
||||
|
||||
static inline int dma_set_mask(struct device *dev, u64 mask)
|
||||
{
|
||||
#ifdef CONFIG_PCI
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ struct sun_flpy_controller {
|
|||
/* You'll only ever find one controller on an Ultra anyways. */
|
||||
static struct sun_flpy_controller *sun_fdc = (struct sun_flpy_controller *)-1;
|
||||
unsigned long fdc_status;
|
||||
static struct of_device *floppy_op = NULL;
|
||||
static struct platform_device *floppy_op = NULL;
|
||||
|
||||
struct sun_floppy_ops {
|
||||
unsigned char (*fd_inb) (unsigned long port);
|
||||
|
|
@ -548,7 +548,7 @@ static unsigned long __init sun_floppy_init(void)
|
|||
{
|
||||
static int initialized = 0;
|
||||
struct device_node *dp;
|
||||
struct of_device *op;
|
||||
struct platform_device *op;
|
||||
const char *prop;
|
||||
char state[128];
|
||||
|
||||
|
|
@ -567,7 +567,7 @@ static unsigned long __init sun_floppy_init(void)
|
|||
}
|
||||
if (op) {
|
||||
floppy_op = op;
|
||||
FLOPPY_IRQ = op->irqs[0];
|
||||
FLOPPY_IRQ = op->archdata.irqs[0];
|
||||
} else {
|
||||
struct device_node *ebus_dp;
|
||||
void __iomem *auxio_reg;
|
||||
|
|
@ -593,7 +593,7 @@ static unsigned long __init sun_floppy_init(void)
|
|||
if (state_prop && !strncmp(state_prop, "disabled", 8))
|
||||
return 0;
|
||||
|
||||
FLOPPY_IRQ = op->irqs[0];
|
||||
FLOPPY_IRQ = op->archdata.irqs[0];
|
||||
|
||||
/* Make sure the high density bit is set, some systems
|
||||
* (most notably Ultra5/Ultra10) come up with it clear.
|
||||
|
|
@ -661,7 +661,7 @@ static unsigned long __init sun_floppy_init(void)
|
|||
config = 0;
|
||||
for (dp = ebus_dp->child; dp; dp = dp->sibling) {
|
||||
if (!strcmp(dp->name, "ecpp")) {
|
||||
struct of_device *ecpp_op;
|
||||
struct platform_device *ecpp_op;
|
||||
|
||||
ecpp_op = of_find_device_by_node(dp);
|
||||
if (ecpp_op)
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ static inline void kunmap(struct page *page)
|
|||
}
|
||||
|
||||
extern void *kmap_atomic(struct page *page, enum km_type type);
|
||||
extern void kunmap_atomic(void *kvaddr, enum km_type type);
|
||||
extern void kunmap_atomic_notypecheck(void *kvaddr, enum km_type type);
|
||||
extern struct page *kmap_atomic_to_page(void *vaddr);
|
||||
|
||||
#define flush_cache_kmaps() flush_cache_all()
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@
|
|||
/* Get minor device of a pty master's FD -- Solaris equiv is ISPTM */
|
||||
#define TIOCGPTN _IOR('t', 134, unsigned int) /* Get Pty Number */
|
||||
#define TIOCSPTLCK _IOW('t', 135, int) /* Lock/unlock PTY */
|
||||
#define TIOCSIG _IOW('t', 136, int) /* Generate signal on Pty slave */
|
||||
|
||||
/* Little f */
|
||||
#define FIOCLEX _IO('f', 1)
|
||||
|
|
@ -132,5 +133,6 @@
|
|||
#define TIOCPKT_START 8
|
||||
#define TIOCPKT_NOSTOP 16
|
||||
#define TIOCPKT_DOSTOP 32
|
||||
#define TIOCPKT_IOCTL 64
|
||||
|
||||
#endif /* !(_ASM_SPARC_IOCTLS_H) */
|
||||
|
|
|
|||
1
arch/sparc/include/asm/local64.h
Normal file
1
arch/sparc/include/asm/local64.h
Normal file
|
|
@ -0,0 +1 @@
|
|||
#include <asm-generic/local64.h>
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
#ifndef _ASM_SPARC_OF_DEVICE_H
|
||||
#define _ASM_SPARC_OF_DEVICE_H
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <asm/openprom.h>
|
||||
|
||||
/*
|
||||
* The of_device is a kind of "base class" that is a superset of
|
||||
* struct device for use by devices attached to an OF node and
|
||||
* probed using OF properties.
|
||||
*/
|
||||
struct of_device
|
||||
{
|
||||
struct device dev;
|
||||
struct resource resource[PROMREG_MAX];
|
||||
unsigned int irqs[PROMINTR_MAX];
|
||||
int num_irqs;
|
||||
|
||||
void *sysdata;
|
||||
|
||||
int slot;
|
||||
int portid;
|
||||
int clock_freq;
|
||||
};
|
||||
|
||||
extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name);
|
||||
extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size);
|
||||
|
||||
extern void of_propagate_archdata(struct of_device *bus);
|
||||
|
||||
/* This is just here during the transition */
|
||||
#include <linux/of_platform.h>
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* _ASM_SPARC_OF_DEVICE_H */
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
#ifndef ___ASM_SPARC_OF_PLATFORM_H
|
||||
#define ___ASM_SPARC_OF_PLATFORM_H
|
||||
/*
|
||||
* Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp.
|
||||
* <benh@kernel.crashing.org>
|
||||
* Modified for Sparc by merging parts of asm/of_device.h
|
||||
* by Stephen Rothwell
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#define of_bus_type of_platform_bus_type /* for compatibility */
|
||||
|
||||
#endif
|
||||
|
|
@ -103,7 +103,7 @@ static inline unsigned int get_dma_residue(unsigned int dmanr)
|
|||
return ebus_dma_residue(&sparc_ebus_dmas[dmanr].info);
|
||||
}
|
||||
|
||||
static int __devinit ecpp_probe(struct of_device *op, const struct of_device_id *match)
|
||||
static int __devinit ecpp_probe(struct platform_device *op, const struct of_device_id *match)
|
||||
{
|
||||
unsigned long base = op->resource[0].start;
|
||||
unsigned long config = op->resource[1].start;
|
||||
|
|
@ -116,7 +116,7 @@ static int __devinit ecpp_probe(struct of_device *op, const struct of_device_id
|
|||
parent = op->dev.of_node->parent;
|
||||
if (!strcmp(parent->name, "dma")) {
|
||||
p = parport_pc_probe_port(base, base + 0x400,
|
||||
op->irqs[0], PARPORT_DMA_NOFIFO,
|
||||
op->archdata.irqs[0], PARPORT_DMA_NOFIFO,
|
||||
op->dev.parent->parent, 0);
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
|
|
@ -166,7 +166,7 @@ static int __devinit ecpp_probe(struct of_device *op, const struct of_device_id
|
|||
0, PTR_LPT_REG_DIR);
|
||||
|
||||
p = parport_pc_probe_port(base, base + 0x400,
|
||||
op->irqs[0],
|
||||
op->archdata.irqs[0],
|
||||
slot,
|
||||
op->dev.parent,
|
||||
0);
|
||||
|
|
@ -192,7 +192,7 @@ out_err:
|
|||
return err;
|
||||
}
|
||||
|
||||
static int __devexit ecpp_remove(struct of_device *op)
|
||||
static int __devexit ecpp_remove(struct platform_device *op)
|
||||
{
|
||||
struct parport *p = dev_get_drvdata(&op->dev);
|
||||
int slot = p->dma;
|
||||
|
|
@ -228,6 +228,10 @@ static const struct of_device_id ecpp_match[] = {
|
|||
.name = "parallel",
|
||||
.compatible = "ns87317-ecpp",
|
||||
},
|
||||
{
|
||||
.name = "parallel",
|
||||
.compatible = "pnpALI,1533,3",
|
||||
},
|
||||
{},
|
||||
};
|
||||
|
||||
|
|
@ -243,9 +247,7 @@ static struct of_platform_driver ecpp_driver = {
|
|||
|
||||
static int parport_pc_find_nonpci_ports(int autoirq, int autodma)
|
||||
{
|
||||
of_register_driver(&ecpp_driver, &of_bus_type);
|
||||
|
||||
return 0;
|
||||
return of_register_platform_driver(&ecpp_driver);
|
||||
}
|
||||
|
||||
#endif /* !(_ASM_SPARC64_PARPORT_H */
|
||||
|
|
|
|||
|
|
@ -6,7 +6,30 @@ extern void set_perf_event_pending(void);
|
|||
#define PERF_EVENT_INDEX_OFFSET 0
|
||||
|
||||
#ifdef CONFIG_PERF_EVENTS
|
||||
#include <asm/ptrace.h>
|
||||
|
||||
extern void init_hw_perf_events(void);
|
||||
|
||||
#define perf_arch_fetch_caller_regs(regs, ip) \
|
||||
do { \
|
||||
unsigned long _pstate, _asi, _pil, _i7, _fp; \
|
||||
__asm__ __volatile__("rdpr %%pstate, %0\n\t" \
|
||||
"rd %%asi, %1\n\t" \
|
||||
"rdpr %%pil, %2\n\t" \
|
||||
"mov %%i7, %3\n\t" \
|
||||
"mov %%i6, %4\n\t" \
|
||||
: "=r" (_pstate), \
|
||||
"=r" (_asi), \
|
||||
"=r" (_pil), \
|
||||
"=r" (_i7), \
|
||||
"=r" (_fp)); \
|
||||
(regs)->tstate = (_pstate << 8) | \
|
||||
(_asi << 24) | (_pil << 20); \
|
||||
(regs)->tpc = (ip); \
|
||||
(regs)->tnpc = (regs)->tpc + 4; \
|
||||
(regs)->u_regs[UREG_I6] = _fp; \
|
||||
(regs)->u_regs[UREG_I7] = _i7; \
|
||||
} while (0)
|
||||
#else
|
||||
static inline void init_hw_perf_events(void) { }
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -43,20 +43,22 @@ extern int of_getintprop_default(struct device_node *np,
|
|||
extern int of_find_in_proplist(const char *list, const char *match, int len);
|
||||
#ifdef CONFIG_NUMA
|
||||
extern int of_node_to_nid(struct device_node *dp);
|
||||
#else
|
||||
#define of_node_to_nid(dp) (-1)
|
||||
#define of_node_to_nid of_node_to_nid
|
||||
#endif
|
||||
|
||||
extern void prom_build_devicetree(void);
|
||||
extern void of_populate_present_mask(void);
|
||||
extern void of_fill_in_cpu_data(void);
|
||||
|
||||
struct resource;
|
||||
extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name);
|
||||
extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size);
|
||||
|
||||
/* These routines are here to provide compatibility with how powerpc
|
||||
* handles IRQ mapping for OF device nodes. We precompute and permanently
|
||||
* register them in the of_device objects, whereas powerpc computes them
|
||||
* register them in the platform_device objects, whereas powerpc computes them
|
||||
* on request.
|
||||
*/
|
||||
extern unsigned int irq_of_parse_and_map(struct device_node *node, int index);
|
||||
static inline void irq_dispose_mapping(unsigned int virq)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
#include <asm-generic/scatterlist.h>
|
||||
|
||||
#define ISA_DMA_THRESHOLD (~0UL)
|
||||
#define ARCH_HAS_SG_CHAIN
|
||||
|
||||
#endif /* !(_SPARC_SCATTERLIST_H) */
|
||||
|
|
|
|||
|
|
@ -225,6 +225,7 @@ struct ktermios {
|
|||
#define FLUSHO 0x00002000
|
||||
#define PENDIN 0x00004000
|
||||
#define IEXTEN 0x00008000
|
||||
#define EXTPROC 0x00010000
|
||||
|
||||
/* modem lines */
|
||||
#define TIOCM_LE 0x001
|
||||
|
|
|
|||
|
|
@ -260,23 +260,8 @@ static inline unsigned long __copy_to_user(void __user *to, const void *from, un
|
|||
return __copy_user(to, (__force void __user *) from, n);
|
||||
}
|
||||
|
||||
extern void copy_from_user_overflow(void)
|
||||
#ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS
|
||||
__compiletime_error("copy_from_user() buffer size is not provably correct")
|
||||
#else
|
||||
__compiletime_warning("copy_from_user() buffer size is not provably correct")
|
||||
#endif
|
||||
;
|
||||
|
||||
static inline unsigned long copy_from_user(void *to, const void __user *from, unsigned long n)
|
||||
{
|
||||
int sz = __compiletime_object_size(to);
|
||||
|
||||
if (unlikely(sz != -1 && sz < n)) {
|
||||
copy_from_user_overflow();
|
||||
return n;
|
||||
}
|
||||
|
||||
if (n && __access_ok((unsigned long) from, n))
|
||||
return __copy_user((__force void __user *) to, from, n);
|
||||
else
|
||||
|
|
|
|||
|
|
@ -205,14 +205,6 @@ __asm__ __volatile__( \
|
|||
|
||||
extern int __get_user_bad(void);
|
||||
|
||||
extern void copy_from_user_overflow(void)
|
||||
#ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS
|
||||
__compiletime_error("copy_from_user() buffer size is not provably correct")
|
||||
#else
|
||||
__compiletime_warning("copy_from_user() buffer size is not provably correct")
|
||||
#endif
|
||||
;
|
||||
|
||||
extern unsigned long __must_check ___copy_from_user(void *to,
|
||||
const void __user *from,
|
||||
unsigned long size);
|
||||
|
|
@ -221,16 +213,11 @@ extern unsigned long copy_from_user_fixup(void *to, const void __user *from,
|
|||
static inline unsigned long __must_check
|
||||
copy_from_user(void *to, const void __user *from, unsigned long size)
|
||||
{
|
||||
int sz = __compiletime_object_size(to);
|
||||
unsigned long ret = size;
|
||||
unsigned long ret = ___copy_from_user(to, from, size);
|
||||
|
||||
if (unlikely(ret))
|
||||
ret = copy_from_user_fixup(to, from, size);
|
||||
|
||||
if (likely(sz == -1 || sz >= size)) {
|
||||
ret = ___copy_from_user(to, from, size);
|
||||
if (unlikely(ret))
|
||||
ret = copy_from_user_fixup(to, from, size);
|
||||
} else {
|
||||
copy_from_user_overflow();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
#define __copy_from_user copy_from_user
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ static void apc_swift_idle(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
static inline void apc_free(struct of_device *op)
|
||||
static inline void apc_free(struct platform_device *op)
|
||||
{
|
||||
of_iounmap(&op->resource[0], regs, resource_size(&op->resource[0]));
|
||||
}
|
||||
|
|
@ -136,7 +136,7 @@ static const struct file_operations apc_fops = {
|
|||
|
||||
static struct miscdevice apc_miscdev = { APC_MINOR, APC_DEVNAME, &apc_fops };
|
||||
|
||||
static int __devinit apc_probe(struct of_device *op,
|
||||
static int __devinit apc_probe(struct platform_device *op,
|
||||
const struct of_device_id *match)
|
||||
{
|
||||
int err;
|
||||
|
|
@ -184,7 +184,7 @@ static struct of_platform_driver apc_driver = {
|
|||
|
||||
static int __init apc_init(void)
|
||||
{
|
||||
return of_register_driver(&apc_driver, &of_bus_type);
|
||||
return of_register_platform_driver(&apc_driver);
|
||||
}
|
||||
|
||||
/* This driver is not critical to the boot process
|
||||
|
|
|
|||
|
|
@ -102,7 +102,8 @@ static struct of_device_id __initdata auxio_match[] = {
|
|||
|
||||
MODULE_DEVICE_TABLE(of, auxio_match);
|
||||
|
||||
static int __devinit auxio_probe(struct of_device *dev, const struct of_device_id *match)
|
||||
static int __devinit auxio_probe(struct platform_device *dev,
|
||||
const struct of_device_id *match)
|
||||
{
|
||||
struct device_node *dp = dev->dev.of_node;
|
||||
unsigned long size;
|
||||
|
|
@ -142,7 +143,7 @@ static struct of_platform_driver auxio_driver = {
|
|||
|
||||
static int __init auxio_init(void)
|
||||
{
|
||||
return of_register_driver(&auxio_driver, &of_platform_bus_type);
|
||||
return of_register_platform_driver(&auxio_driver);
|
||||
}
|
||||
|
||||
/* Must be after subsys_initcall() so that busses are probed. Must
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ static int __devinit clock_board_calc_nslots(struct clock_board *p)
|
|||
}
|
||||
}
|
||||
|
||||
static int __devinit clock_board_probe(struct of_device *op,
|
||||
static int __devinit clock_board_probe(struct platform_device *op,
|
||||
const struct of_device_id *match)
|
||||
{
|
||||
struct clock_board *p = kzalloc(sizeof(*p), GFP_KERNEL);
|
||||
|
|
@ -157,7 +157,7 @@ static struct of_platform_driver clock_board_driver = {
|
|||
},
|
||||
};
|
||||
|
||||
static int __devinit fhc_probe(struct of_device *op,
|
||||
static int __devinit fhc_probe(struct platform_device *op,
|
||||
const struct of_device_id *match)
|
||||
{
|
||||
struct fhc *p = kzalloc(sizeof(*p), GFP_KERNEL);
|
||||
|
|
@ -265,8 +265,8 @@ static struct of_platform_driver fhc_driver = {
|
|||
|
||||
static int __init sunfire_init(void)
|
||||
{
|
||||
(void) of_register_driver(&fhc_driver, &of_platform_bus_type);
|
||||
(void) of_register_driver(&clock_board_driver, &of_platform_bus_type);
|
||||
(void) of_register_platform_driver(&fhc_driver);
|
||||
(void) of_register_platform_driver(&clock_board_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -392,7 +392,7 @@ static void __devinit jbusmc_construct_dimm_groups(struct jbusmc *p,
|
|||
}
|
||||
}
|
||||
|
||||
static int __devinit jbusmc_probe(struct of_device *op,
|
||||
static int __devinit jbusmc_probe(struct platform_device *op,
|
||||
const struct of_device_id *match)
|
||||
{
|
||||
const struct linux_prom64_registers *mem_regs;
|
||||
|
|
@ -690,7 +690,7 @@ static void chmc_fetch_decode_regs(struct chmc *p)
|
|||
chmc_read_mcreg(p, CHMCTRL_DECODE4));
|
||||
}
|
||||
|
||||
static int __devinit chmc_probe(struct of_device *op,
|
||||
static int __devinit chmc_probe(struct platform_device *op,
|
||||
const struct of_device_id *match)
|
||||
{
|
||||
struct device_node *dp = op->dev.of_node;
|
||||
|
|
@ -765,7 +765,7 @@ out_free:
|
|||
goto out;
|
||||
}
|
||||
|
||||
static int __devinit us3mc_probe(struct of_device *op,
|
||||
static int __devinit us3mc_probe(struct platform_device *op,
|
||||
const struct of_device_id *match)
|
||||
{
|
||||
if (mc_type == MC_TYPE_SAFARI)
|
||||
|
|
@ -775,21 +775,21 @@ static int __devinit us3mc_probe(struct of_device *op,
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
static void __devexit chmc_destroy(struct of_device *op, struct chmc *p)
|
||||
static void __devexit chmc_destroy(struct platform_device *op, struct chmc *p)
|
||||
{
|
||||
list_del(&p->list);
|
||||
of_iounmap(&op->resource[0], p->regs, 0x48);
|
||||
kfree(p);
|
||||
}
|
||||
|
||||
static void __devexit jbusmc_destroy(struct of_device *op, struct jbusmc *p)
|
||||
static void __devexit jbusmc_destroy(struct platform_device *op, struct jbusmc *p)
|
||||
{
|
||||
mc_list_del(&p->list);
|
||||
of_iounmap(&op->resource[0], p->regs, JBUSMC_REGS_SIZE);
|
||||
kfree(p);
|
||||
}
|
||||
|
||||
static int __devexit us3mc_remove(struct of_device *op)
|
||||
static int __devexit us3mc_remove(struct platform_device *op)
|
||||
{
|
||||
void *p = dev_get_drvdata(&op->dev);
|
||||
|
||||
|
|
@ -848,7 +848,7 @@ static int __init us3mc_init(void)
|
|||
ret = register_dimm_printer(us3mc_dimm_printer);
|
||||
|
||||
if (!ret) {
|
||||
ret = of_register_driver(&us3mc_driver, &of_bus_type);
|
||||
ret = of_register_platform_driver(&us3mc_driver);
|
||||
if (ret)
|
||||
unregister_dimm_printer(us3mc_dimm_printer);
|
||||
}
|
||||
|
|
@ -859,7 +859,7 @@ static void __exit us3mc_cleanup(void)
|
|||
{
|
||||
if (us3mc_platform()) {
|
||||
unregister_dimm_printer(us3mc_dimm_printer);
|
||||
of_unregister_driver(&us3mc_driver);
|
||||
of_unregister_platform_driver(&us3mc_driver);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,81 +46,6 @@ stack_trace_flush:
|
|||
nop
|
||||
.size stack_trace_flush,.-stack_trace_flush
|
||||
|
||||
#ifdef CONFIG_PERF_EVENTS
|
||||
.globl perf_arch_fetch_caller_regs
|
||||
.type perf_arch_fetch_caller_regs,#function
|
||||
perf_arch_fetch_caller_regs:
|
||||
/* We always read the %pstate into %o5 since we will use
|
||||
* that to construct a fake %tstate to store into the regs.
|
||||
*/
|
||||
rdpr %pstate, %o5
|
||||
brz,pn %o2, 50f
|
||||
mov %o2, %g7
|
||||
|
||||
/* Turn off interrupts while we walk around the register
|
||||
* window by hand.
|
||||
*/
|
||||
wrpr %o5, PSTATE_IE, %pstate
|
||||
|
||||
/* The %canrestore tells us how many register windows are
|
||||
* still live in the chip above us, past that we have to
|
||||
* walk the frame as saved on the stack. We stash away
|
||||
* the %cwp in %g1 so we can return back to the original
|
||||
* register window.
|
||||
*/
|
||||
rdpr %cwp, %g1
|
||||
rdpr %canrestore, %g2
|
||||
sub %g1, 1, %g3
|
||||
|
||||
/* We have the skip count in %g7, if it hits zero then
|
||||
* %fp/%i7 are the registers we need. Otherwise if our
|
||||
* %canrestore count maintained in %g2 hits zero we have
|
||||
* to start traversing the stack.
|
||||
*/
|
||||
10: brz,pn %g2, 4f
|
||||
sub %g2, 1, %g2
|
||||
wrpr %g3, %cwp
|
||||
subcc %g7, 1, %g7
|
||||
bne,pt %xcc, 10b
|
||||
sub %g3, 1, %g3
|
||||
|
||||
/* We found the values we need in the cpu's register
|
||||
* windows.
|
||||
*/
|
||||
mov %fp, %g3
|
||||
ba,pt %xcc, 3f
|
||||
mov %i7, %g2
|
||||
|
||||
50: mov %fp, %g3
|
||||
ba,pt %xcc, 2f
|
||||
mov %i7, %g2
|
||||
|
||||
/* We hit the end of the valid register windows in the
|
||||
* cpu, start traversing the stack frame.
|
||||
*/
|
||||
4: mov %fp, %g3
|
||||
|
||||
20: ldx [%g3 + STACK_BIAS + RW_V9_I7], %g2
|
||||
subcc %g7, 1, %g7
|
||||
bne,pn %xcc, 20b
|
||||
ldx [%g3 + STACK_BIAS + RW_V9_I6], %g3
|
||||
|
||||
/* Restore the current register window position and
|
||||
* re-enable interrupts.
|
||||
*/
|
||||
3: wrpr %g1, %cwp
|
||||
wrpr %o5, %pstate
|
||||
|
||||
2: stx %g3, [%o0 + PT_V9_FP]
|
||||
sllx %o5, 8, %o5
|
||||
stx %o5, [%o0 + PT_V9_TSTATE]
|
||||
stx %g2, [%o0 + PT_V9_TPC]
|
||||
add %g2, 4, %g2
|
||||
retl
|
||||
stx %g2, [%o0 + PT_V9_TNPC]
|
||||
.size perf_arch_fetch_caller_regs,.-perf_arch_fetch_caller_regs
|
||||
#endif /* CONFIG_PERF_EVENTS */
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
.globl hard_smp_processor_id
|
||||
.type hard_smp_processor_id,#function
|
||||
|
|
|
|||
|
|
@ -253,7 +253,7 @@ EXPORT_SYMBOL(sbus_set_sbus64);
|
|||
static void *sbus_alloc_coherent(struct device *dev, size_t len,
|
||||
dma_addr_t *dma_addrp, gfp_t gfp)
|
||||
{
|
||||
struct of_device *op = to_of_device(dev);
|
||||
struct platform_device *op = to_platform_device(dev);
|
||||
unsigned long len_total = (len + PAGE_SIZE-1) & PAGE_MASK;
|
||||
unsigned long va;
|
||||
struct resource *res;
|
||||
|
|
|
|||
|
|
@ -241,10 +241,10 @@ static int __init use_1to1_mapping(struct device_node *pp)
|
|||
|
||||
static int of_resource_verbose;
|
||||
|
||||
static void __init build_device_resources(struct of_device *op,
|
||||
static void __init build_device_resources(struct platform_device *op,
|
||||
struct device *parent)
|
||||
{
|
||||
struct of_device *p_op;
|
||||
struct platform_device *p_op;
|
||||
struct of_bus *bus;
|
||||
int na, ns;
|
||||
int index, num_reg;
|
||||
|
|
@ -253,7 +253,7 @@ static void __init build_device_resources(struct of_device *op,
|
|||
if (!parent)
|
||||
return;
|
||||
|
||||
p_op = to_of_device(parent);
|
||||
p_op = to_platform_device(parent);
|
||||
bus = of_match_bus(p_op->dev.of_node);
|
||||
bus->count_cells(op->dev.of_node, &na, &ns);
|
||||
|
||||
|
|
@ -267,6 +267,8 @@ static void __init build_device_resources(struct of_device *op,
|
|||
/* Conver to num-entries. */
|
||||
num_reg /= na + ns;
|
||||
|
||||
op->resource = op->archdata.resource;
|
||||
op->num_resources = num_reg;
|
||||
for (index = 0; index < num_reg; index++) {
|
||||
struct resource *r = &op->resource[index];
|
||||
u32 addr[OF_MAX_ADDR_CELLS];
|
||||
|
|
@ -333,10 +335,10 @@ static void __init build_device_resources(struct of_device *op,
|
|||
}
|
||||
}
|
||||
|
||||
static struct of_device * __init scan_one_device(struct device_node *dp,
|
||||
static struct platform_device * __init scan_one_device(struct device_node *dp,
|
||||
struct device *parent)
|
||||
{
|
||||
struct of_device *op = kzalloc(sizeof(*op), GFP_KERNEL);
|
||||
struct platform_device *op = kzalloc(sizeof(*op), GFP_KERNEL);
|
||||
const struct linux_prom_irqs *intr;
|
||||
struct dev_archdata *sd;
|
||||
int len, i;
|
||||
|
|
@ -349,27 +351,21 @@ static struct of_device * __init scan_one_device(struct device_node *dp,
|
|||
|
||||
op->dev.of_node = dp;
|
||||
|
||||
op->clock_freq = of_getintprop_default(dp, "clock-frequency",
|
||||
(25*1000*1000));
|
||||
op->portid = of_getintprop_default(dp, "upa-portid", -1);
|
||||
if (op->portid == -1)
|
||||
op->portid = of_getintprop_default(dp, "portid", -1);
|
||||
|
||||
intr = of_get_property(dp, "intr", &len);
|
||||
if (intr) {
|
||||
op->num_irqs = len / sizeof(struct linux_prom_irqs);
|
||||
for (i = 0; i < op->num_irqs; i++)
|
||||
op->irqs[i] = intr[i].pri;
|
||||
op->archdata.num_irqs = len / sizeof(struct linux_prom_irqs);
|
||||
for (i = 0; i < op->archdata.num_irqs; i++)
|
||||
op->archdata.irqs[i] = intr[i].pri;
|
||||
} else {
|
||||
const unsigned int *irq =
|
||||
of_get_property(dp, "interrupts", &len);
|
||||
|
||||
if (irq) {
|
||||
op->num_irqs = len / sizeof(unsigned int);
|
||||
for (i = 0; i < op->num_irqs; i++)
|
||||
op->irqs[i] = irq[i];
|
||||
op->archdata.num_irqs = len / sizeof(unsigned int);
|
||||
for (i = 0; i < op->archdata.num_irqs; i++)
|
||||
op->archdata.irqs[i] = irq[i];
|
||||
} else {
|
||||
op->num_irqs = 0;
|
||||
op->archdata.num_irqs = 0;
|
||||
}
|
||||
}
|
||||
if (sparc_cpu_model == sun4d) {
|
||||
|
|
@ -411,8 +407,8 @@ static struct of_device * __init scan_one_device(struct device_node *dp,
|
|||
goto build_resources;
|
||||
}
|
||||
|
||||
for (i = 0; i < op->num_irqs; i++) {
|
||||
int this_irq = op->irqs[i];
|
||||
for (i = 0; i < op->archdata.num_irqs; i++) {
|
||||
int this_irq = op->archdata.irqs[i];
|
||||
int sbusl = pil_to_sbus[this_irq];
|
||||
|
||||
if (sbusl)
|
||||
|
|
@ -420,7 +416,7 @@ static struct of_device * __init scan_one_device(struct device_node *dp,
|
|||
(sbusl << 2) +
|
||||
slot);
|
||||
|
||||
op->irqs[i] = this_irq;
|
||||
op->archdata.irqs[i] = this_irq;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -428,7 +424,7 @@ build_resources:
|
|||
build_device_resources(op, parent);
|
||||
|
||||
op->dev.parent = parent;
|
||||
op->dev.bus = &of_platform_bus_type;
|
||||
op->dev.bus = &platform_bus_type;
|
||||
if (!parent)
|
||||
dev_set_name(&op->dev, "root");
|
||||
else
|
||||
|
|
@ -447,7 +443,7 @@ build_resources:
|
|||
static void __init scan_tree(struct device_node *dp, struct device *parent)
|
||||
{
|
||||
while (dp) {
|
||||
struct of_device *op = scan_one_device(dp, parent);
|
||||
struct platform_device *op = scan_one_device(dp, parent);
|
||||
|
||||
if (op)
|
||||
scan_tree(dp->child, &op->dev);
|
||||
|
|
@ -456,30 +452,19 @@ static void __init scan_tree(struct device_node *dp, struct device *parent)
|
|||
}
|
||||
}
|
||||
|
||||
static void __init scan_of_devices(void)
|
||||
static int __init scan_of_devices(void)
|
||||
{
|
||||
struct device_node *root = of_find_node_by_path("/");
|
||||
struct of_device *parent;
|
||||
struct platform_device *parent;
|
||||
|
||||
parent = scan_one_device(root, NULL);
|
||||
if (!parent)
|
||||
return;
|
||||
return 0;
|
||||
|
||||
scan_tree(root->child, &parent->dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __init of_bus_driver_init(void)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = of_bus_type_init(&of_platform_bus_type, "of");
|
||||
if (!err)
|
||||
scan_of_devices();
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
postcore_initcall(of_bus_driver_init);
|
||||
postcore_initcall(scan_of_devices);
|
||||
|
||||
static int __init of_debug(char *str)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -310,10 +310,10 @@ static int __init use_1to1_mapping(struct device_node *pp)
|
|||
|
||||
static int of_resource_verbose;
|
||||
|
||||
static void __init build_device_resources(struct of_device *op,
|
||||
static void __init build_device_resources(struct platform_device *op,
|
||||
struct device *parent)
|
||||
{
|
||||
struct of_device *p_op;
|
||||
struct platform_device *p_op;
|
||||
struct of_bus *bus;
|
||||
int na, ns;
|
||||
int index, num_reg;
|
||||
|
|
@ -322,7 +322,7 @@ static void __init build_device_resources(struct of_device *op,
|
|||
if (!parent)
|
||||
return;
|
||||
|
||||
p_op = to_of_device(parent);
|
||||
p_op = to_platform_device(parent);
|
||||
bus = of_match_bus(p_op->dev.of_node);
|
||||
bus->count_cells(op->dev.of_node, &na, &ns);
|
||||
|
||||
|
|
@ -344,6 +344,8 @@ static void __init build_device_resources(struct of_device *op,
|
|||
num_reg = PROMREG_MAX;
|
||||
}
|
||||
|
||||
op->resource = op->archdata.resource;
|
||||
op->num_resources = num_reg;
|
||||
for (index = 0; index < num_reg; index++) {
|
||||
struct resource *r = &op->resource[index];
|
||||
u32 addr[OF_MAX_ADDR_CELLS];
|
||||
|
|
@ -526,7 +528,7 @@ static unsigned int __init pci_irq_swizzle(struct device_node *dp,
|
|||
|
||||
static int of_irq_verbose;
|
||||
|
||||
static unsigned int __init build_one_device_irq(struct of_device *op,
|
||||
static unsigned int __init build_one_device_irq(struct platform_device *op,
|
||||
struct device *parent,
|
||||
unsigned int irq)
|
||||
{
|
||||
|
|
@ -628,10 +630,10 @@ out:
|
|||
return irq;
|
||||
}
|
||||
|
||||
static struct of_device * __init scan_one_device(struct device_node *dp,
|
||||
static struct platform_device * __init scan_one_device(struct device_node *dp,
|
||||
struct device *parent)
|
||||
{
|
||||
struct of_device *op = kzalloc(sizeof(*op), GFP_KERNEL);
|
||||
struct platform_device *op = kzalloc(sizeof(*op), GFP_KERNEL);
|
||||
const unsigned int *irq;
|
||||
struct dev_archdata *sd;
|
||||
int len, i;
|
||||
|
|
@ -644,34 +646,28 @@ static struct of_device * __init scan_one_device(struct device_node *dp,
|
|||
|
||||
op->dev.of_node = dp;
|
||||
|
||||
op->clock_freq = of_getintprop_default(dp, "clock-frequency",
|
||||
(25*1000*1000));
|
||||
op->portid = of_getintprop_default(dp, "upa-portid", -1);
|
||||
if (op->portid == -1)
|
||||
op->portid = of_getintprop_default(dp, "portid", -1);
|
||||
|
||||
irq = of_get_property(dp, "interrupts", &len);
|
||||
if (irq) {
|
||||
op->num_irqs = len / 4;
|
||||
op->archdata.num_irqs = len / 4;
|
||||
|
||||
/* Prevent overrunning the op->irqs[] array. */
|
||||
if (op->num_irqs > PROMINTR_MAX) {
|
||||
if (op->archdata.num_irqs > PROMINTR_MAX) {
|
||||
printk(KERN_WARNING "%s: Too many irqs (%d), "
|
||||
"limiting to %d.\n",
|
||||
dp->full_name, op->num_irqs, PROMINTR_MAX);
|
||||
op->num_irqs = PROMINTR_MAX;
|
||||
dp->full_name, op->archdata.num_irqs, PROMINTR_MAX);
|
||||
op->archdata.num_irqs = PROMINTR_MAX;
|
||||
}
|
||||
memcpy(op->irqs, irq, op->num_irqs * 4);
|
||||
memcpy(op->archdata.irqs, irq, op->archdata.num_irqs * 4);
|
||||
} else {
|
||||
op->num_irqs = 0;
|
||||
op->archdata.num_irqs = 0;
|
||||
}
|
||||
|
||||
build_device_resources(op, parent);
|
||||
for (i = 0; i < op->num_irqs; i++)
|
||||
op->irqs[i] = build_one_device_irq(op, parent, op->irqs[i]);
|
||||
for (i = 0; i < op->archdata.num_irqs; i++)
|
||||
op->archdata.irqs[i] = build_one_device_irq(op, parent, op->archdata.irqs[i]);
|
||||
|
||||
op->dev.parent = parent;
|
||||
op->dev.bus = &of_platform_bus_type;
|
||||
op->dev.bus = &platform_bus_type;
|
||||
if (!parent)
|
||||
dev_set_name(&op->dev, "root");
|
||||
else
|
||||
|
|
@ -690,7 +686,7 @@ static struct of_device * __init scan_one_device(struct device_node *dp,
|
|||
static void __init scan_tree(struct device_node *dp, struct device *parent)
|
||||
{
|
||||
while (dp) {
|
||||
struct of_device *op = scan_one_device(dp, parent);
|
||||
struct platform_device *op = scan_one_device(dp, parent);
|
||||
|
||||
if (op)
|
||||
scan_tree(dp->child, &op->dev);
|
||||
|
|
@ -699,30 +695,19 @@ static void __init scan_tree(struct device_node *dp, struct device *parent)
|
|||
}
|
||||
}
|
||||
|
||||
static void __init scan_of_devices(void)
|
||||
static int __init scan_of_devices(void)
|
||||
{
|
||||
struct device_node *root = of_find_node_by_path("/");
|
||||
struct of_device *parent;
|
||||
struct platform_device *parent;
|
||||
|
||||
parent = scan_one_device(root, NULL);
|
||||
if (!parent)
|
||||
return;
|
||||
return 0;
|
||||
|
||||
scan_tree(root->child, &parent->dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __init of_bus_driver_init(void)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = of_bus_type_init(&of_platform_bus_type, "of");
|
||||
if (!err)
|
||||
scan_of_devices();
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
postcore_initcall(of_bus_driver_init);
|
||||
postcore_initcall(scan_of_devices);
|
||||
|
||||
static int __init of_debug(char *str)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,48 +11,28 @@
|
|||
|
||||
#include "of_device_common.h"
|
||||
|
||||
static int node_match(struct device *dev, void *data)
|
||||
{
|
||||
struct of_device *op = to_of_device(dev);
|
||||
struct device_node *dp = data;
|
||||
|
||||
return (op->dev.of_node == dp);
|
||||
}
|
||||
|
||||
struct of_device *of_find_device_by_node(struct device_node *dp)
|
||||
{
|
||||
struct device *dev = bus_find_device(&of_platform_bus_type, NULL,
|
||||
dp, node_match);
|
||||
|
||||
if (dev)
|
||||
return to_of_device(dev);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
EXPORT_SYMBOL(of_find_device_by_node);
|
||||
|
||||
unsigned int irq_of_parse_and_map(struct device_node *node, int index)
|
||||
{
|
||||
struct of_device *op = of_find_device_by_node(node);
|
||||
struct platform_device *op = of_find_device_by_node(node);
|
||||
|
||||
if (!op || index >= op->num_irqs)
|
||||
if (!op || index >= op->archdata.num_irqs)
|
||||
return 0;
|
||||
|
||||
return op->irqs[index];
|
||||
return op->archdata.irqs[index];
|
||||
}
|
||||
EXPORT_SYMBOL(irq_of_parse_and_map);
|
||||
|
||||
/* Take the archdata values for IOMMU, STC, and HOSTDATA found in
|
||||
* BUS and propagate to all child of_device objects.
|
||||
* BUS and propagate to all child platform_device objects.
|
||||
*/
|
||||
void of_propagate_archdata(struct of_device *bus)
|
||||
void of_propagate_archdata(struct platform_device *bus)
|
||||
{
|
||||
struct dev_archdata *bus_sd = &bus->dev.archdata;
|
||||
struct device_node *bus_dp = bus->dev.of_node;
|
||||
struct device_node *dp;
|
||||
|
||||
for (dp = bus_dp->child; dp; dp = dp->sibling) {
|
||||
struct of_device *op = of_find_device_by_node(dp);
|
||||
struct platform_device *op = of_find_device_by_node(dp);
|
||||
|
||||
op->dev.archdata.iommu = bus_sd->iommu;
|
||||
op->dev.archdata.stc = bus_sd->stc;
|
||||
|
|
@ -64,9 +44,6 @@ void of_propagate_archdata(struct of_device *bus)
|
|||
}
|
||||
}
|
||||
|
||||
struct bus_type of_platform_bus_type;
|
||||
EXPORT_SYMBOL(of_platform_bus_type);
|
||||
|
||||
static void get_cells(struct device_node *dp, int *addrc, int *sizec)
|
||||
{
|
||||
if (addrc)
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ static unsigned long pci_parse_of_flags(u32 addr0)
|
|||
* into physical address resources, we only have to figure out the register
|
||||
* mapping.
|
||||
*/
|
||||
static void pci_parse_of_addrs(struct of_device *op,
|
||||
static void pci_parse_of_addrs(struct platform_device *op,
|
||||
struct device_node *node,
|
||||
struct pci_dev *dev)
|
||||
{
|
||||
|
|
@ -248,7 +248,7 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
|
|||
{
|
||||
struct dev_archdata *sd;
|
||||
struct pci_slot *slot;
|
||||
struct of_device *op;
|
||||
struct platform_device *op;
|
||||
struct pci_dev *dev;
|
||||
const char *type;
|
||||
u32 class;
|
||||
|
|
@ -340,7 +340,7 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
|
|||
dev->hdr_type = PCI_HEADER_TYPE_NORMAL;
|
||||
dev->rom_base_reg = PCI_ROM_ADDRESS;
|
||||
|
||||
dev->irq = sd->op->irqs[0];
|
||||
dev->irq = sd->op->archdata.irqs[0];
|
||||
if (dev->irq == 0xffffffff)
|
||||
dev->irq = PCI_IRQ_NONE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -410,7 +410,7 @@ static void pci_fire_hw_init(struct pci_pbm_info *pbm)
|
|||
}
|
||||
|
||||
static int __devinit pci_fire_pbm_init(struct pci_pbm_info *pbm,
|
||||
struct of_device *op, u32 portid)
|
||||
struct platform_device *op, u32 portid)
|
||||
{
|
||||
const struct linux_prom64_registers *regs;
|
||||
struct device_node *dp = op->dev.of_node;
|
||||
|
|
@ -455,7 +455,7 @@ static int __devinit pci_fire_pbm_init(struct pci_pbm_info *pbm,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int __devinit fire_probe(struct of_device *op,
|
||||
static int __devinit fire_probe(struct platform_device *op,
|
||||
const struct of_device_id *match)
|
||||
{
|
||||
struct device_node *dp = op->dev.of_node;
|
||||
|
|
@ -518,7 +518,7 @@ static struct of_platform_driver fire_driver = {
|
|||
|
||||
static int __init fire_init(void)
|
||||
{
|
||||
return of_register_driver(&fire_driver, &of_bus_type);
|
||||
return of_register_platform_driver(&fire_driver);
|
||||
}
|
||||
|
||||
subsys_initcall(fire_init);
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ struct pci_pbm_info {
|
|||
char *name;
|
||||
|
||||
/* OBP specific information. */
|
||||
struct of_device *op;
|
||||
struct platform_device *op;
|
||||
u64 ino_bitmap;
|
||||
|
||||
/* PBM I/O and Memory space resources. */
|
||||
|
|
|
|||
|
|
@ -285,7 +285,7 @@ static irqreturn_t psycho_ce_intr(int irq, void *dev_id)
|
|||
#define PSYCHO_ECCCTRL_CE 0x2000000000000000UL /* Enable CE INterrupts */
|
||||
static void psycho_register_error_handlers(struct pci_pbm_info *pbm)
|
||||
{
|
||||
struct of_device *op = of_find_device_by_node(pbm->op->dev.of_node);
|
||||
struct platform_device *op = of_find_device_by_node(pbm->op->dev.of_node);
|
||||
unsigned long base = pbm->controller_regs;
|
||||
u64 tmp;
|
||||
int err;
|
||||
|
|
@ -302,23 +302,23 @@ static void psycho_register_error_handlers(struct pci_pbm_info *pbm)
|
|||
* 5: POWER MANAGEMENT
|
||||
*/
|
||||
|
||||
if (op->num_irqs < 6)
|
||||
if (op->archdata.num_irqs < 6)
|
||||
return;
|
||||
|
||||
/* We really mean to ignore the return result here. Two
|
||||
* PCI controller share the same interrupt numbers and
|
||||
* drive the same front-end hardware.
|
||||
*/
|
||||
err = request_irq(op->irqs[1], psycho_ue_intr, IRQF_SHARED,
|
||||
err = request_irq(op->archdata.irqs[1], psycho_ue_intr, IRQF_SHARED,
|
||||
"PSYCHO_UE", pbm);
|
||||
err = request_irq(op->irqs[2], psycho_ce_intr, IRQF_SHARED,
|
||||
err = request_irq(op->archdata.irqs[2], psycho_ce_intr, IRQF_SHARED,
|
||||
"PSYCHO_CE", pbm);
|
||||
|
||||
/* This one, however, ought not to fail. We can just warn
|
||||
* about it since the system can still operate properly even
|
||||
* if this fails.
|
||||
*/
|
||||
err = request_irq(op->irqs[0], psycho_pcierr_intr, IRQF_SHARED,
|
||||
err = request_irq(op->archdata.irqs[0], psycho_pcierr_intr, IRQF_SHARED,
|
||||
"PSYCHO_PCIERR", pbm);
|
||||
if (err)
|
||||
printk(KERN_WARNING "%s: Could not register PCIERR, "
|
||||
|
|
@ -483,7 +483,7 @@ static void psycho_pbm_strbuf_init(struct pci_pbm_info *pbm,
|
|||
#define PSYCHO_MEMSPACE_SIZE 0x07fffffffUL
|
||||
|
||||
static void __devinit psycho_pbm_init(struct pci_pbm_info *pbm,
|
||||
struct of_device *op, int is_pbm_a)
|
||||
struct platform_device *op, int is_pbm_a)
|
||||
{
|
||||
psycho_pbm_init_common(pbm, op, "PSYCHO", PBM_CHIP_TYPE_PSYCHO);
|
||||
psycho_pbm_strbuf_init(pbm, is_pbm_a);
|
||||
|
|
@ -503,7 +503,7 @@ static struct pci_pbm_info * __devinit psycho_find_sibling(u32 upa_portid)
|
|||
|
||||
#define PSYCHO_CONFIGSPACE 0x001000000UL
|
||||
|
||||
static int __devinit psycho_probe(struct of_device *op,
|
||||
static int __devinit psycho_probe(struct platform_device *op,
|
||||
const struct of_device_id *match)
|
||||
{
|
||||
const struct linux_prom64_registers *pr_regs;
|
||||
|
|
@ -612,7 +612,7 @@ static struct of_platform_driver psycho_driver = {
|
|||
|
||||
static int __init psycho_init(void)
|
||||
{
|
||||
return of_register_driver(&psycho_driver, &of_bus_type);
|
||||
return of_register_platform_driver(&psycho_driver);
|
||||
}
|
||||
|
||||
subsys_initcall(psycho_init);
|
||||
|
|
|
|||
|
|
@ -311,7 +311,7 @@ static irqreturn_t sabre_ce_intr(int irq, void *dev_id)
|
|||
static void sabre_register_error_handlers(struct pci_pbm_info *pbm)
|
||||
{
|
||||
struct device_node *dp = pbm->op->dev.of_node;
|
||||
struct of_device *op;
|
||||
struct platform_device *op;
|
||||
unsigned long base = pbm->controller_regs;
|
||||
u64 tmp;
|
||||
int err;
|
||||
|
|
@ -329,7 +329,7 @@ static void sabre_register_error_handlers(struct pci_pbm_info *pbm)
|
|||
* 2: CE ERR
|
||||
* 3: POWER FAIL
|
||||
*/
|
||||
if (op->num_irqs < 4)
|
||||
if (op->archdata.num_irqs < 4)
|
||||
return;
|
||||
|
||||
/* We clear the error bits in the appropriate AFSR before
|
||||
|
|
@ -341,7 +341,7 @@ static void sabre_register_error_handlers(struct pci_pbm_info *pbm)
|
|||
SABRE_UEAFSR_SDTE | SABRE_UEAFSR_PDTE),
|
||||
base + SABRE_UE_AFSR);
|
||||
|
||||
err = request_irq(op->irqs[1], sabre_ue_intr, 0, "SABRE_UE", pbm);
|
||||
err = request_irq(op->archdata.irqs[1], sabre_ue_intr, 0, "SABRE_UE", pbm);
|
||||
if (err)
|
||||
printk(KERN_WARNING "%s: Couldn't register UE, err=%d.\n",
|
||||
pbm->name, err);
|
||||
|
|
@ -351,11 +351,11 @@ static void sabre_register_error_handlers(struct pci_pbm_info *pbm)
|
|||
base + SABRE_CE_AFSR);
|
||||
|
||||
|
||||
err = request_irq(op->irqs[2], sabre_ce_intr, 0, "SABRE_CE", pbm);
|
||||
err = request_irq(op->archdata.irqs[2], sabre_ce_intr, 0, "SABRE_CE", pbm);
|
||||
if (err)
|
||||
printk(KERN_WARNING "%s: Couldn't register CE, err=%d.\n",
|
||||
pbm->name, err);
|
||||
err = request_irq(op->irqs[0], psycho_pcierr_intr, 0,
|
||||
err = request_irq(op->archdata.irqs[0], psycho_pcierr_intr, 0,
|
||||
"SABRE_PCIERR", pbm);
|
||||
if (err)
|
||||
printk(KERN_WARNING "%s: Couldn't register PCIERR, err=%d.\n",
|
||||
|
|
@ -443,7 +443,7 @@ static void __devinit sabre_scan_bus(struct pci_pbm_info *pbm,
|
|||
}
|
||||
|
||||
static void __devinit sabre_pbm_init(struct pci_pbm_info *pbm,
|
||||
struct of_device *op)
|
||||
struct platform_device *op)
|
||||
{
|
||||
psycho_pbm_init_common(pbm, op, "SABRE", PBM_CHIP_TYPE_SABRE);
|
||||
pbm->pci_afsr = pbm->controller_regs + SABRE_PIOAFSR;
|
||||
|
|
@ -452,7 +452,7 @@ static void __devinit sabre_pbm_init(struct pci_pbm_info *pbm,
|
|||
sabre_scan_bus(pbm, &op->dev);
|
||||
}
|
||||
|
||||
static int __devinit sabre_probe(struct of_device *op,
|
||||
static int __devinit sabre_probe(struct platform_device *op,
|
||||
const struct of_device_id *match)
|
||||
{
|
||||
const struct linux_prom64_registers *pr_regs;
|
||||
|
|
@ -606,7 +606,7 @@ static struct of_platform_driver sabre_driver = {
|
|||
|
||||
static int __init sabre_init(void)
|
||||
{
|
||||
return of_register_driver(&sabre_driver, &of_bus_type);
|
||||
return of_register_platform_driver(&sabre_driver);
|
||||
}
|
||||
|
||||
subsys_initcall(sabre_init);
|
||||
|
|
|
|||
|
|
@ -844,7 +844,7 @@ static int pbm_routes_this_ino(struct pci_pbm_info *pbm, u32 ino)
|
|||
*/
|
||||
static void tomatillo_register_error_handlers(struct pci_pbm_info *pbm)
|
||||
{
|
||||
struct of_device *op = of_find_device_by_node(pbm->op->dev.of_node);
|
||||
struct platform_device *op = of_find_device_by_node(pbm->op->dev.of_node);
|
||||
u64 tmp, err_mask, err_no_mask;
|
||||
int err;
|
||||
|
||||
|
|
@ -857,14 +857,14 @@ static void tomatillo_register_error_handlers(struct pci_pbm_info *pbm)
|
|||
*/
|
||||
|
||||
if (pbm_routes_this_ino(pbm, SCHIZO_UE_INO)) {
|
||||
err = request_irq(op->irqs[1], schizo_ue_intr, 0,
|
||||
err = request_irq(op->archdata.irqs[1], schizo_ue_intr, 0,
|
||||
"TOMATILLO_UE", pbm);
|
||||
if (err)
|
||||
printk(KERN_WARNING "%s: Could not register UE, "
|
||||
"err=%d\n", pbm->name, err);
|
||||
}
|
||||
if (pbm_routes_this_ino(pbm, SCHIZO_CE_INO)) {
|
||||
err = request_irq(op->irqs[2], schizo_ce_intr, 0,
|
||||
err = request_irq(op->archdata.irqs[2], schizo_ce_intr, 0,
|
||||
"TOMATILLO_CE", pbm);
|
||||
if (err)
|
||||
printk(KERN_WARNING "%s: Could not register CE, "
|
||||
|
|
@ -872,10 +872,10 @@ static void tomatillo_register_error_handlers(struct pci_pbm_info *pbm)
|
|||
}
|
||||
err = 0;
|
||||
if (pbm_routes_this_ino(pbm, SCHIZO_PCIERR_A_INO)) {
|
||||
err = request_irq(op->irqs[0], schizo_pcierr_intr, 0,
|
||||
err = request_irq(op->archdata.irqs[0], schizo_pcierr_intr, 0,
|
||||
"TOMATILLO_PCIERR", pbm);
|
||||
} else if (pbm_routes_this_ino(pbm, SCHIZO_PCIERR_B_INO)) {
|
||||
err = request_irq(op->irqs[0], schizo_pcierr_intr, 0,
|
||||
err = request_irq(op->archdata.irqs[0], schizo_pcierr_intr, 0,
|
||||
"TOMATILLO_PCIERR", pbm);
|
||||
}
|
||||
if (err)
|
||||
|
|
@ -883,7 +883,7 @@ static void tomatillo_register_error_handlers(struct pci_pbm_info *pbm)
|
|||
"err=%d\n", pbm->name, err);
|
||||
|
||||
if (pbm_routes_this_ino(pbm, SCHIZO_SERR_INO)) {
|
||||
err = request_irq(op->irqs[3], schizo_safarierr_intr, 0,
|
||||
err = request_irq(op->archdata.irqs[3], schizo_safarierr_intr, 0,
|
||||
"TOMATILLO_SERR", pbm);
|
||||
if (err)
|
||||
printk(KERN_WARNING "%s: Could not register SERR, "
|
||||
|
|
@ -939,7 +939,7 @@ static void tomatillo_register_error_handlers(struct pci_pbm_info *pbm)
|
|||
|
||||
static void schizo_register_error_handlers(struct pci_pbm_info *pbm)
|
||||
{
|
||||
struct of_device *op = of_find_device_by_node(pbm->op->dev.of_node);
|
||||
struct platform_device *op = of_find_device_by_node(pbm->op->dev.of_node);
|
||||
u64 tmp, err_mask, err_no_mask;
|
||||
int err;
|
||||
|
||||
|
|
@ -952,14 +952,14 @@ static void schizo_register_error_handlers(struct pci_pbm_info *pbm)
|
|||
*/
|
||||
|
||||
if (pbm_routes_this_ino(pbm, SCHIZO_UE_INO)) {
|
||||
err = request_irq(op->irqs[1], schizo_ue_intr, 0,
|
||||
err = request_irq(op->archdata.irqs[1], schizo_ue_intr, 0,
|
||||
"SCHIZO_UE", pbm);
|
||||
if (err)
|
||||
printk(KERN_WARNING "%s: Could not register UE, "
|
||||
"err=%d\n", pbm->name, err);
|
||||
}
|
||||
if (pbm_routes_this_ino(pbm, SCHIZO_CE_INO)) {
|
||||
err = request_irq(op->irqs[2], schizo_ce_intr, 0,
|
||||
err = request_irq(op->archdata.irqs[2], schizo_ce_intr, 0,
|
||||
"SCHIZO_CE", pbm);
|
||||
if (err)
|
||||
printk(KERN_WARNING "%s: Could not register CE, "
|
||||
|
|
@ -967,10 +967,10 @@ static void schizo_register_error_handlers(struct pci_pbm_info *pbm)
|
|||
}
|
||||
err = 0;
|
||||
if (pbm_routes_this_ino(pbm, SCHIZO_PCIERR_A_INO)) {
|
||||
err = request_irq(op->irqs[0], schizo_pcierr_intr, 0,
|
||||
err = request_irq(op->archdata.irqs[0], schizo_pcierr_intr, 0,
|
||||
"SCHIZO_PCIERR", pbm);
|
||||
} else if (pbm_routes_this_ino(pbm, SCHIZO_PCIERR_B_INO)) {
|
||||
err = request_irq(op->irqs[0], schizo_pcierr_intr, 0,
|
||||
err = request_irq(op->archdata.irqs[0], schizo_pcierr_intr, 0,
|
||||
"SCHIZO_PCIERR", pbm);
|
||||
}
|
||||
if (err)
|
||||
|
|
@ -978,7 +978,7 @@ static void schizo_register_error_handlers(struct pci_pbm_info *pbm)
|
|||
"err=%d\n", pbm->name, err);
|
||||
|
||||
if (pbm_routes_this_ino(pbm, SCHIZO_SERR_INO)) {
|
||||
err = request_irq(op->irqs[3], schizo_safarierr_intr, 0,
|
||||
err = request_irq(op->archdata.irqs[3], schizo_safarierr_intr, 0,
|
||||
"SCHIZO_SERR", pbm);
|
||||
if (err)
|
||||
printk(KERN_WARNING "%s: Could not register SERR, "
|
||||
|
|
@ -1307,7 +1307,7 @@ static void schizo_pbm_hw_init(struct pci_pbm_info *pbm)
|
|||
}
|
||||
|
||||
static int __devinit schizo_pbm_init(struct pci_pbm_info *pbm,
|
||||
struct of_device *op, u32 portid,
|
||||
struct platform_device *op, u32 portid,
|
||||
int chip_type)
|
||||
{
|
||||
const struct linux_prom64_registers *regs;
|
||||
|
|
@ -1413,7 +1413,7 @@ static struct pci_pbm_info * __devinit schizo_find_sibling(u32 portid,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static int __devinit __schizo_init(struct of_device *op, unsigned long chip_type)
|
||||
static int __devinit __schizo_init(struct platform_device *op, unsigned long chip_type)
|
||||
{
|
||||
struct device_node *dp = op->dev.of_node;
|
||||
struct pci_pbm_info *pbm;
|
||||
|
|
@ -1460,7 +1460,7 @@ out_err:
|
|||
return err;
|
||||
}
|
||||
|
||||
static int __devinit schizo_probe(struct of_device *op,
|
||||
static int __devinit schizo_probe(struct platform_device *op,
|
||||
const struct of_device_id *match)
|
||||
{
|
||||
return __schizo_init(op, (unsigned long) match->data);
|
||||
|
|
@ -1501,7 +1501,7 @@ static struct of_platform_driver schizo_driver = {
|
|||
|
||||
static int __init schizo_init(void)
|
||||
{
|
||||
return of_register_driver(&schizo_driver, &of_bus_type);
|
||||
return of_register_platform_driver(&schizo_driver);
|
||||
}
|
||||
|
||||
subsys_initcall(schizo_init);
|
||||
|
|
|
|||
|
|
@ -879,7 +879,7 @@ static void pci_sun4v_msi_init(struct pci_pbm_info *pbm)
|
|||
#endif /* !(CONFIG_PCI_MSI) */
|
||||
|
||||
static int __devinit pci_sun4v_pbm_init(struct pci_pbm_info *pbm,
|
||||
struct of_device *op, u32 devhandle)
|
||||
struct platform_device *op, u32 devhandle)
|
||||
{
|
||||
struct device_node *dp = op->dev.of_node;
|
||||
int err;
|
||||
|
|
@ -918,7 +918,7 @@ static int __devinit pci_sun4v_pbm_init(struct pci_pbm_info *pbm,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int __devinit pci_sun4v_probe(struct of_device *op,
|
||||
static int __devinit pci_sun4v_probe(struct platform_device *op,
|
||||
const struct of_device_id *match)
|
||||
{
|
||||
const struct linux_prom64_registers *regs;
|
||||
|
|
@ -1019,7 +1019,7 @@ static struct of_platform_driver pci_sun4v_driver = {
|
|||
|
||||
static int __init pci_sun4v_init(void)
|
||||
{
|
||||
return of_register_driver(&pci_sun4v_driver, &of_bus_type);
|
||||
return of_register_platform_driver(&pci_sun4v_driver);
|
||||
}
|
||||
|
||||
subsys_initcall(pci_sun4v_init);
|
||||
|
|
|
|||
|
|
@ -572,18 +572,18 @@ static u64 sparc_perf_event_update(struct perf_event *event,
|
|||
s64 delta;
|
||||
|
||||
again:
|
||||
prev_raw_count = atomic64_read(&hwc->prev_count);
|
||||
prev_raw_count = local64_read(&hwc->prev_count);
|
||||
new_raw_count = read_pmc(idx);
|
||||
|
||||
if (atomic64_cmpxchg(&hwc->prev_count, prev_raw_count,
|
||||
if (local64_cmpxchg(&hwc->prev_count, prev_raw_count,
|
||||
new_raw_count) != prev_raw_count)
|
||||
goto again;
|
||||
|
||||
delta = (new_raw_count << shift) - (prev_raw_count << shift);
|
||||
delta >>= shift;
|
||||
|
||||
atomic64_add(delta, &event->count);
|
||||
atomic64_sub(delta, &hwc->period_left);
|
||||
local64_add(delta, &event->count);
|
||||
local64_sub(delta, &hwc->period_left);
|
||||
|
||||
return new_raw_count;
|
||||
}
|
||||
|
|
@ -591,27 +591,27 @@ again:
|
|||
static int sparc_perf_event_set_period(struct perf_event *event,
|
||||
struct hw_perf_event *hwc, int idx)
|
||||
{
|
||||
s64 left = atomic64_read(&hwc->period_left);
|
||||
s64 left = local64_read(&hwc->period_left);
|
||||
s64 period = hwc->sample_period;
|
||||
int ret = 0;
|
||||
|
||||
if (unlikely(left <= -period)) {
|
||||
left = period;
|
||||
atomic64_set(&hwc->period_left, left);
|
||||
local64_set(&hwc->period_left, left);
|
||||
hwc->last_period = period;
|
||||
ret = 1;
|
||||
}
|
||||
|
||||
if (unlikely(left <= 0)) {
|
||||
left += period;
|
||||
atomic64_set(&hwc->period_left, left);
|
||||
local64_set(&hwc->period_left, left);
|
||||
hwc->last_period = period;
|
||||
ret = 1;
|
||||
}
|
||||
if (left > MAX_PERIOD)
|
||||
left = MAX_PERIOD;
|
||||
|
||||
atomic64_set(&hwc->prev_count, (u64)-left);
|
||||
local64_set(&hwc->prev_count, (u64)-left);
|
||||
|
||||
write_pmc(idx, (u64)(-left) & 0xffffffff);
|
||||
|
||||
|
|
@ -1006,7 +1006,7 @@ static int sparc_pmu_enable(struct perf_event *event)
|
|||
* skip the schedulability test here, it will be peformed
|
||||
* at commit time(->commit_txn) as a whole
|
||||
*/
|
||||
if (cpuc->group_flag & PERF_EVENT_TXN_STARTED)
|
||||
if (cpuc->group_flag & PERF_EVENT_TXN)
|
||||
goto nocheck;
|
||||
|
||||
if (check_excludes(cpuc->event, n0, 1))
|
||||
|
|
@ -1088,7 +1088,7 @@ static int __hw_perf_event_init(struct perf_event *event)
|
|||
if (!hwc->sample_period) {
|
||||
hwc->sample_period = MAX_PERIOD;
|
||||
hwc->last_period = hwc->sample_period;
|
||||
atomic64_set(&hwc->period_left, hwc->sample_period);
|
||||
local64_set(&hwc->period_left, hwc->sample_period);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
@ -1103,7 +1103,7 @@ static void sparc_pmu_start_txn(const struct pmu *pmu)
|
|||
{
|
||||
struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events);
|
||||
|
||||
cpuhw->group_flag |= PERF_EVENT_TXN_STARTED;
|
||||
cpuhw->group_flag |= PERF_EVENT_TXN;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1115,7 +1115,7 @@ static void sparc_pmu_cancel_txn(const struct pmu *pmu)
|
|||
{
|
||||
struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events);
|
||||
|
||||
cpuhw->group_flag &= ~PERF_EVENT_TXN_STARTED;
|
||||
cpuhw->group_flag &= ~PERF_EVENT_TXN;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1138,6 +1138,7 @@ static int sparc_pmu_commit_txn(const struct pmu *pmu)
|
|||
if (sparc_check_constraints(cpuc->event, cpuc->events, n))
|
||||
return -EAGAIN;
|
||||
|
||||
cpuc->group_flag &= ~PERF_EVENT_TXN;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ static void pmc_swift_idle(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
static int __devinit pmc_probe(struct of_device *op,
|
||||
static int __devinit pmc_probe(struct platform_device *op,
|
||||
const struct of_device_id *match)
|
||||
{
|
||||
regs = of_ioremap(&op->resource[0], 0,
|
||||
|
|
@ -89,7 +89,7 @@ static struct of_platform_driver pmc_driver = {
|
|||
|
||||
static int __init pmc_init(void)
|
||||
{
|
||||
return of_register_driver(&pmc_driver, &of_bus_type);
|
||||
return of_register_platform_driver(&pmc_driver);
|
||||
}
|
||||
|
||||
/* This driver is not critical to the boot process
|
||||
|
|
|
|||
|
|
@ -33,10 +33,10 @@ static int __devinit has_button_interrupt(unsigned int irq, struct device_node *
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int __devinit power_probe(struct of_device *op, const struct of_device_id *match)
|
||||
static int __devinit power_probe(struct platform_device *op, const struct of_device_id *match)
|
||||
{
|
||||
struct resource *res = &op->resource[0];
|
||||
unsigned int irq= op->irqs[0];
|
||||
unsigned int irq = op->archdata.irqs[0];
|
||||
|
||||
power_reg = of_ioremap(res, 0, 0x4, "power");
|
||||
|
||||
|
|
@ -70,7 +70,7 @@ static struct of_platform_driver power_driver = {
|
|||
|
||||
static int __init power_init(void)
|
||||
{
|
||||
return of_register_driver(&power_driver, &of_platform_bus_type);
|
||||
return of_register_platform_driver(&power_driver);
|
||||
}
|
||||
|
||||
device_initcall(power_init);
|
||||
|
|
|
|||
|
|
@ -9,14 +9,6 @@ extern void irq_trans_init(struct device_node *dp);
|
|||
|
||||
extern unsigned int prom_unique_id;
|
||||
|
||||
static inline int is_root_node(const struct device_node *dp)
|
||||
{
|
||||
if (!dp)
|
||||
return 0;
|
||||
|
||||
return (dp->parent == NULL);
|
||||
}
|
||||
|
||||
extern char *build_path_component(struct device_node *dp);
|
||||
extern void of_console_init(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#include <linux/mm.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/memblock.h>
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/of.h>
|
||||
|
||||
#include <asm/prom.h>
|
||||
#include <asm/oplib.h>
|
||||
|
|
@ -81,7 +81,7 @@ static void __init sun4v_path_component(struct device_node *dp, char *tmp_buf)
|
|||
return;
|
||||
|
||||
regs = rprop->value;
|
||||
if (!is_root_node(dp->parent)) {
|
||||
if (!of_node_is_root(dp->parent)) {
|
||||
sprintf(tmp_buf, "%s@%x,%x",
|
||||
dp->name,
|
||||
(unsigned int) (regs->phys_addr >> 32UL),
|
||||
|
|
@ -121,7 +121,7 @@ static void __init sun4u_path_component(struct device_node *dp, char *tmp_buf)
|
|||
return;
|
||||
|
||||
regs = prop->value;
|
||||
if (!is_root_node(dp->parent)) {
|
||||
if (!of_node_is_root(dp->parent)) {
|
||||
sprintf(tmp_buf, "%s@%x,%x",
|
||||
dp->name,
|
||||
(unsigned int) (regs->phys_addr >> 32UL),
|
||||
|
|
|
|||
|
|
@ -244,7 +244,7 @@ char * __init build_full_name(struct device_node *dp)
|
|||
|
||||
n = prom_early_alloc(len);
|
||||
strcpy(n, dp->parent->full_name);
|
||||
if (!is_root_node(dp->parent)) {
|
||||
if (!of_node_is_root(dp->parent)) {
|
||||
strcpy(n + plen, "/");
|
||||
plen++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -719,7 +719,7 @@ static unsigned int central_build_irq(struct device_node *dp,
|
|||
void *_data)
|
||||
{
|
||||
struct device_node *central_dp = _data;
|
||||
struct of_device *central_op = of_find_device_by_node(central_dp);
|
||||
struct platform_device *central_op = of_find_device_by_node(central_dp);
|
||||
struct resource *res;
|
||||
unsigned long imap, iclr;
|
||||
u32 tmp;
|
||||
|
|
|
|||
|
|
@ -447,7 +447,7 @@ int psycho_iommu_init(struct pci_pbm_info *pbm, int tsbsize,
|
|||
|
||||
}
|
||||
|
||||
void psycho_pbm_init_common(struct pci_pbm_info *pbm, struct of_device *op,
|
||||
void psycho_pbm_init_common(struct pci_pbm_info *pbm, struct platform_device *op,
|
||||
const char *chip_name, int chip_type)
|
||||
{
|
||||
struct device_node *dp = op->dev.of_node;
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ extern int psycho_iommu_init(struct pci_pbm_info *pbm, int tsbsize,
|
|||
unsigned long write_complete_offset);
|
||||
|
||||
extern void psycho_pbm_init_common(struct pci_pbm_info *pbm,
|
||||
struct of_device *op,
|
||||
struct platform_device *op,
|
||||
const char *chip_name, int chip_type);
|
||||
|
||||
#endif /* _PSYCHO_COMMON_H */
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
void sbus_set_sbus64(struct device *dev, int bursts)
|
||||
{
|
||||
struct iommu *iommu = dev->archdata.iommu;
|
||||
struct of_device *op = to_of_device(dev);
|
||||
struct platform_device *op = to_platform_device(dev);
|
||||
const struct linux_prom_registers *regs;
|
||||
unsigned long cfg_reg;
|
||||
int slot;
|
||||
|
|
@ -204,7 +204,7 @@ static unsigned long sysio_imap_to_iclr(unsigned long imap)
|
|||
return imap + diff;
|
||||
}
|
||||
|
||||
static unsigned int sbus_build_irq(struct of_device *op, unsigned int ino)
|
||||
static unsigned int sbus_build_irq(struct platform_device *op, unsigned int ino)
|
||||
{
|
||||
struct iommu *iommu = op->dev.archdata.iommu;
|
||||
unsigned long reg_base = iommu->write_complete_reg - 0x2000UL;
|
||||
|
|
@ -267,7 +267,7 @@ static unsigned int sbus_build_irq(struct of_device *op, unsigned int ino)
|
|||
#define SYSIO_UEAFSR_RESV2 0x0000001fffffffffUL /* Reserved */
|
||||
static irqreturn_t sysio_ue_handler(int irq, void *dev_id)
|
||||
{
|
||||
struct of_device *op = dev_id;
|
||||
struct platform_device *op = dev_id;
|
||||
struct iommu *iommu = op->dev.archdata.iommu;
|
||||
unsigned long reg_base = iommu->write_complete_reg - 0x2000UL;
|
||||
unsigned long afsr_reg, afar_reg;
|
||||
|
|
@ -341,7 +341,7 @@ static irqreturn_t sysio_ue_handler(int irq, void *dev_id)
|
|||
#define SYSIO_CEAFSR_RESV2 0x0000001fffffffffUL /* Reserved */
|
||||
static irqreturn_t sysio_ce_handler(int irq, void *dev_id)
|
||||
{
|
||||
struct of_device *op = dev_id;
|
||||
struct platform_device *op = dev_id;
|
||||
struct iommu *iommu = op->dev.archdata.iommu;
|
||||
unsigned long reg_base = iommu->write_complete_reg - 0x2000UL;
|
||||
unsigned long afsr_reg, afar_reg;
|
||||
|
|
@ -420,7 +420,7 @@ static irqreturn_t sysio_ce_handler(int irq, void *dev_id)
|
|||
#define SYSIO_SBAFSR_RESV3 0x0000001fffffffffUL /* Reserved */
|
||||
static irqreturn_t sysio_sbus_error_handler(int irq, void *dev_id)
|
||||
{
|
||||
struct of_device *op = dev_id;
|
||||
struct platform_device *op = dev_id;
|
||||
struct iommu *iommu = op->dev.archdata.iommu;
|
||||
unsigned long afsr_reg, afar_reg, reg_base;
|
||||
unsigned long afsr, afar, error_bits;
|
||||
|
|
@ -488,7 +488,7 @@ static irqreturn_t sysio_sbus_error_handler(int irq, void *dev_id)
|
|||
#define SYSIO_CE_INO 0x35
|
||||
#define SYSIO_SBUSERR_INO 0x36
|
||||
|
||||
static void __init sysio_register_error_handlers(struct of_device *op)
|
||||
static void __init sysio_register_error_handlers(struct platform_device *op)
|
||||
{
|
||||
struct iommu *iommu = op->dev.archdata.iommu;
|
||||
unsigned long reg_base = iommu->write_complete_reg - 0x2000UL;
|
||||
|
|
@ -534,7 +534,7 @@ static void __init sysio_register_error_handlers(struct of_device *op)
|
|||
}
|
||||
|
||||
/* Boot time initialization. */
|
||||
static void __init sbus_iommu_init(struct of_device *op)
|
||||
static void __init sbus_iommu_init(struct platform_device *op)
|
||||
{
|
||||
const struct linux_prom64_registers *pr;
|
||||
struct device_node *dp = op->dev.of_node;
|
||||
|
|
@ -663,7 +663,7 @@ static int __init sbus_init(void)
|
|||
struct device_node *dp;
|
||||
|
||||
for_each_node_by_name(dp, "sbus") {
|
||||
struct of_device *op = of_find_device_by_node(dp);
|
||||
struct platform_device *op = of_find_device_by_node(dp);
|
||||
|
||||
sbus_iommu_init(op);
|
||||
of_propagate_archdata(op);
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ static int cp_compat_stat64(struct kstat *stat,
|
|||
return err;
|
||||
}
|
||||
|
||||
asmlinkage long compat_sys_stat64(char __user * filename,
|
||||
asmlinkage long compat_sys_stat64(const char __user * filename,
|
||||
struct compat_stat64 __user *statbuf)
|
||||
{
|
||||
struct kstat stat;
|
||||
|
|
@ -173,7 +173,7 @@ asmlinkage long compat_sys_stat64(char __user * filename,
|
|||
return error;
|
||||
}
|
||||
|
||||
asmlinkage long compat_sys_lstat64(char __user * filename,
|
||||
asmlinkage long compat_sys_lstat64(const char __user * filename,
|
||||
struct compat_stat64 __user *statbuf)
|
||||
{
|
||||
struct kstat stat;
|
||||
|
|
@ -195,7 +195,8 @@ asmlinkage long compat_sys_fstat64(unsigned int fd,
|
|||
return error;
|
||||
}
|
||||
|
||||
asmlinkage long compat_sys_fstatat64(unsigned int dfd, char __user *filename,
|
||||
asmlinkage long compat_sys_fstatat64(unsigned int dfd,
|
||||
const char __user *filename,
|
||||
struct compat_stat64 __user * statbuf, int flag)
|
||||
{
|
||||
struct kstat stat;
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ static struct platform_device m48t59_rtc = {
|
|||
},
|
||||
};
|
||||
|
||||
static int __devinit clock_probe(struct of_device *op, const struct of_device_id *match)
|
||||
static int __devinit clock_probe(struct platform_device *op, const struct of_device_id *match)
|
||||
{
|
||||
struct device_node *dp = op->dev.of_node;
|
||||
const char *model = of_get_property(dp, "model", NULL);
|
||||
|
|
@ -189,7 +189,7 @@ static struct of_platform_driver clock_driver = {
|
|||
/* Probe for the mostek real time clock chip. */
|
||||
static int __init clock_init(void)
|
||||
{
|
||||
return of_register_driver(&clock_driver, &of_platform_bus_type);
|
||||
return of_register_platform_driver(&clock_driver);
|
||||
}
|
||||
/* Must be after subsys_initcall() so that busses are probed. Must
|
||||
* be before device_initcall() because things like the RTC driver
|
||||
|
|
|
|||
|
|
@ -419,7 +419,7 @@ static struct platform_device rtc_cmos_device = {
|
|||
.num_resources = 1,
|
||||
};
|
||||
|
||||
static int __devinit rtc_probe(struct of_device *op, const struct of_device_id *match)
|
||||
static int __devinit rtc_probe(struct platform_device *op, const struct of_device_id *match)
|
||||
{
|
||||
struct resource *r;
|
||||
|
||||
|
|
@ -477,7 +477,7 @@ static struct platform_device rtc_bq4802_device = {
|
|||
.num_resources = 1,
|
||||
};
|
||||
|
||||
static int __devinit bq4802_probe(struct of_device *op, const struct of_device_id *match)
|
||||
static int __devinit bq4802_probe(struct platform_device *op, const struct of_device_id *match)
|
||||
{
|
||||
|
||||
printk(KERN_INFO "%s: BQ4802 regs at 0x%llx\n",
|
||||
|
|
@ -534,7 +534,7 @@ static struct platform_device m48t59_rtc = {
|
|||
},
|
||||
};
|
||||
|
||||
static int __devinit mostek_probe(struct of_device *op, const struct of_device_id *match)
|
||||
static int __devinit mostek_probe(struct platform_device *op, const struct of_device_id *match)
|
||||
{
|
||||
struct device_node *dp = op->dev.of_node;
|
||||
|
||||
|
|
@ -586,9 +586,9 @@ static int __init clock_init(void)
|
|||
if (tlb_type == hypervisor)
|
||||
return platform_device_register(&rtc_sun4v_device);
|
||||
|
||||
(void) of_register_driver(&rtc_driver, &of_platform_bus_type);
|
||||
(void) of_register_driver(&mostek_driver, &of_platform_bus_type);
|
||||
(void) of_register_driver(&bq4802_driver, &of_platform_bus_type);
|
||||
(void) of_register_platform_driver(&rtc_driver);
|
||||
(void) of_register_platform_driver(&mostek_driver);
|
||||
(void) of_register_platform_driver(&bq4802_driver);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ void *kmap_atomic(struct page *page, enum km_type type)
|
|||
}
|
||||
EXPORT_SYMBOL(kmap_atomic);
|
||||
|
||||
void kunmap_atomic(void *kvaddr, enum km_type type)
|
||||
void kunmap_atomic_notypecheck(void *kvaddr, enum km_type type)
|
||||
{
|
||||
#ifdef CONFIG_DEBUG_HIGHMEM
|
||||
unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK;
|
||||
|
|
@ -100,7 +100,7 @@ void kunmap_atomic(void *kvaddr, enum km_type type)
|
|||
|
||||
pagefault_enable();
|
||||
}
|
||||
EXPORT_SYMBOL(kunmap_atomic);
|
||||
EXPORT_SYMBOL(kunmap_atomic_notypecheck);
|
||||
|
||||
/* We may be fed a pagetable here by ptep_to_xxx and others. */
|
||||
struct page *kmap_atomic_to_page(void *ptr)
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
#define IOPERM (IOUPTE_CACHE | IOUPTE_WRITE | IOUPTE_VALID)
|
||||
#define MKIOPTE(phys) __iopte((((phys)>>4) & IOUPTE_PAGE) | IOPERM)
|
||||
|
||||
static void __init iounit_iommu_init(struct of_device *op)
|
||||
static void __init iounit_iommu_init(struct platform_device *op)
|
||||
{
|
||||
struct iounit_struct *iounit;
|
||||
iopte_t *xpt, *xptend;
|
||||
|
|
@ -74,7 +74,7 @@ static int __init iounit_init(void)
|
|||
struct device_node *dp;
|
||||
|
||||
for_each_node_by_name(dp, "sbi") {
|
||||
struct of_device *op = of_find_device_by_node(dp);
|
||||
struct platform_device *op = of_find_device_by_node(dp);
|
||||
|
||||
iounit_iommu_init(op);
|
||||
of_propagate_archdata(op);
|
||||
|
|
|
|||
|
|
@ -56,14 +56,14 @@ static pgprot_t dvma_prot; /* Consistent mapping pte flags */
|
|||
#define IOPERM (IOPTE_CACHE | IOPTE_WRITE | IOPTE_VALID)
|
||||
#define MKIOPTE(pfn, perm) (((((pfn)<<8) & IOPTE_PAGE) | (perm)) & ~IOPTE_WAZ)
|
||||
|
||||
static void __init sbus_iommu_init(struct of_device *op)
|
||||
static void __init sbus_iommu_init(struct platform_device *op)
|
||||
{
|
||||
struct iommu_struct *iommu;
|
||||
unsigned int impl, vers;
|
||||
unsigned long *bitmap;
|
||||
unsigned long tmp;
|
||||
|
||||
iommu = kmalloc(sizeof(struct iommu_struct), GFP_ATOMIC);
|
||||
iommu = kmalloc(sizeof(struct iommu_struct), GFP_KERNEL);
|
||||
if (!iommu) {
|
||||
prom_printf("Unable to allocate iommu structure\n");
|
||||
prom_halt();
|
||||
|
|
@ -132,7 +132,7 @@ static int __init iommu_init(void)
|
|||
struct device_node *dp;
|
||||
|
||||
for_each_node_by_name(dp, "iommu") {
|
||||
struct of_device *op = of_find_device_by_node(dp);
|
||||
struct platform_device *op = of_find_device_by_node(dp);
|
||||
|
||||
sbus_iommu_init(op);
|
||||
of_propagate_archdata(op);
|
||||
|
|
|
|||
Loading…
Reference in a new issue