aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-21 18:50:49 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-21 18:50:49 -0400
commit9a64388d83f6ef08dfff405a9d122e3dbcb6bf38 (patch)
treea77532ce4d6d56be6c6c7f405cd901a0184250fb /include/linux
parente80ab411e589e00550e2e6e5a6a02d59cc730357 (diff)
parent14b3ca4022f050f8622ed282b734ddf445464583 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: (202 commits) [POWERPC] Fix compile breakage for 64-bit UP configs [POWERPC] Define copy_siginfo_from_user32 [POWERPC] Add compat handler for PTRACE_GETSIGINFO [POWERPC] i2c: Fix build breakage introduced by OF helpers [POWERPC] Optimize fls64() on 64-bit processors [POWERPC] irqtrace support for 64-bit powerpc [POWERPC] Stacktrace support for lockdep [POWERPC] Move stackframe definitions to common header [POWERPC] Fix device-tree locking vs. interrupts [POWERPC] Make pci_bus_to_host()'s struct pci_bus * argument const [POWERPC] Remove unused __max_memory variable [POWERPC] Simplify xics direct/lpar irq_host setup [POWERPC] Use pseries_setup_i8259_cascade() in pseries_mpic_init_IRQ() [POWERPC] Turn xics_setup_8259_cascade() into a generic pseries_setup_i8259_cascade() [POWERPC] Move xics_setup_8259_cascade() into platforms/pseries/setup.c [POWERPC] Use asm-generic/bitops/find.h in bitops.h [POWERPC] 83xx: mpc8315 - fix USB UTMI Host setup [POWERPC] 85xx: Fix the size of qe muram for MPC8568E [POWERPC] 86xx: mpc86xx_hpcn - Temporarily accept old dts node identifier. [POWERPC] 86xx: mark functions static, other minor cleanups ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/lmb.h85
-rw-r--r--include/linux/of.h1
-rw-r--r--include/linux/of_gpio.h69
-rw-r--r--include/linux/of_i2c.h24
4 files changed, 179 insertions, 0 deletions
diff --git a/include/linux/lmb.h b/include/linux/lmb.h
new file mode 100644
index 000000000000..271153d27fba
--- /dev/null
+++ b/include/linux/lmb.h
@@ -0,0 +1,85 @@
1#ifndef _LINUX_LMB_H
2#define _LINUX_LMB_H
3#ifdef __KERNEL__
4
5/*
6 * Logical memory blocks.
7 *
8 * Copyright (C) 2001 Peter Bergner, IBM Corp.
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
14 */
15
16#include <linux/init.h>
17#include <linux/mm.h>
18
19#define MAX_LMB_REGIONS 128
20
21struct lmb_property {
22 u64 base;
23 u64 size;
24};
25
26struct lmb_region {
27 unsigned long cnt;
28 u64 size;
29 struct lmb_property region[MAX_LMB_REGIONS+1];
30};
31
32struct lmb {
33 unsigned long debug;
34 u64 rmo_size;
35 struct lmb_region memory;
36 struct lmb_region reserved;
37};
38
39extern struct lmb lmb;
40
41extern void __init lmb_init(void);
42extern void __init lmb_analyze(void);
43extern long __init lmb_add(u64 base, u64 size);
44extern long __init lmb_reserve(u64 base, u64 size);
45extern u64 __init lmb_alloc_nid(u64 size, u64 align, int nid,
46 u64 (*nid_range)(u64, u64, int *));
47extern u64 __init lmb_alloc(u64 size, u64 align);
48extern u64 __init lmb_alloc_base(u64 size,
49 u64, u64 max_addr);
50extern u64 __init __lmb_alloc_base(u64 size,
51 u64 align, u64 max_addr);
52extern u64 __init lmb_phys_mem_size(void);
53extern u64 __init lmb_end_of_DRAM(void);
54extern void __init lmb_enforce_memory_limit(u64 memory_limit);
55extern int __init lmb_is_reserved(u64 addr);
56
57extern void lmb_dump_all(void);
58
59static inline u64
60lmb_size_bytes(struct lmb_region *type, unsigned long region_nr)
61{
62 return type->region[region_nr].size;
63}
64static inline u64
65lmb_size_pages(struct lmb_region *type, unsigned long region_nr)
66{
67 return lmb_size_bytes(type, region_nr) >> PAGE_SHIFT;
68}
69static inline u64
70lmb_start_pfn(struct lmb_region *type, unsigned long region_nr)
71{
72 return type->region[region_nr].base >> PAGE_SHIFT;
73}
74static inline u64
75lmb_end_pfn(struct lmb_region *type, unsigned long region_nr)
76{
77 return lmb_start_pfn(type, region_nr) +
78 lmb_size_pages(type, region_nr);
79}
80
81#include <asm/lmb.h>
82
83#endif /* __KERNEL__ */
84
85#endif /* _LINUX_LMB_H */
diff --git a/include/linux/of.h b/include/linux/of.h
index 6981016dcc25..59a61bdc98b6 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -62,6 +62,7 @@ extern struct property *of_find_property(const struct device_node *np,
62 int *lenp); 62 int *lenp);
63extern int of_device_is_compatible(const struct device_node *device, 63extern int of_device_is_compatible(const struct device_node *device,
64 const char *); 64 const char *);
65extern int of_device_is_available(const struct device_node *device);
65extern const void *of_get_property(const struct device_node *node, 66extern const void *of_get_property(const struct device_node *node,
66 const char *name, 67 const char *name,
67 int *lenp); 68 int *lenp);
diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h
new file mode 100644
index 000000000000..2ee97e9877a7
--- /dev/null
+++ b/include/linux/of_gpio.h
@@ -0,0 +1,69 @@
1/*
2 * OF helpers for the GPIO API
3 *
4 * Copyright (c) 2007-2008 MontaVista Software, Inc.
5 *
6 * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 */
13
14#ifndef __LINUX_OF_GPIO_H
15#define __LINUX_OF_GPIO_H
16
17#include <linux/errno.h>
18#include <asm/gpio.h>
19
20#ifdef CONFIG_OF_GPIO
21
22/*
23 * Generic OF GPIO chip
24 */
25struct of_gpio_chip {
26 struct gpio_chip gc;
27 int gpio_cells;
28 int (*xlate)(struct of_gpio_chip *of_gc, struct device_node *np,
29 const void *gpio_spec);
30};
31
32static inline struct of_gpio_chip *to_of_gpio_chip(struct gpio_chip *gc)
33{
34 return container_of(gc, struct of_gpio_chip, gc);
35}
36
37/*
38 * OF GPIO chip for memory mapped banks
39 */
40struct of_mm_gpio_chip {
41 struct of_gpio_chip of_gc;
42 void (*save_regs)(struct of_mm_gpio_chip *mm_gc);
43 void __iomem *regs;
44};
45
46static inline struct of_mm_gpio_chip *to_of_mm_gpio_chip(struct gpio_chip *gc)
47{
48 struct of_gpio_chip *of_gc = to_of_gpio_chip(gc);
49
50 return container_of(of_gc, struct of_mm_gpio_chip, of_gc);
51}
52
53extern int of_get_gpio(struct device_node *np, int index);
54extern int of_mm_gpiochip_add(struct device_node *np,
55 struct of_mm_gpio_chip *mm_gc);
56extern int of_gpio_simple_xlate(struct of_gpio_chip *of_gc,
57 struct device_node *np,
58 const void *gpio_spec);
59#else
60
61/* Drivers may not strictly depend on the GPIO support, so let them link. */
62static inline int of_get_gpio(struct device_node *np, int index)
63{
64 return -ENOSYS;
65}
66
67#endif /* CONFIG_OF_GPIO */
68
69#endif /* __LINUX_OF_GPIO_H */
diff --git a/include/linux/of_i2c.h b/include/linux/of_i2c.h
new file mode 100644
index 000000000000..2e5a96732042
--- /dev/null
+++ b/include/linux/of_i2c.h
@@ -0,0 +1,24 @@
1/*
2 * Generic I2C API implementation for PowerPC.
3 *
4 * Copyright (c) 2008 Jochen Friedrich <jochen@scram.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11
12#ifndef __LINUX_OF_I2C_H
13#define __LINUX_OF_I2C_H
14
15#include <linux/i2c.h>
16
17#ifdef CONFIG_OF_I2C
18
19void of_register_i2c_devices(struct i2c_adapter *adap,
20 struct device_node *adap_node);
21
22#endif /* CONFIG_OF_I2C */
23
24#endif /* __LINUX_OF_I2C_H */