aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze/include
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2010-08-31 03:45:21 -0400
committerIngo Molnar <mingo@elte.hu>2010-08-31 03:45:46 -0400
commitdaab7fc734a53fdeaf844b7c03053118ad1769da (patch)
tree575deb3cdcc6dda562acaed6f7c29bc81ae01cf2 /arch/microblaze/include
parent774ea0bcb27f57b6fd521b3b6c43237782fed4b9 (diff)
parent2bfc96a127bc1cc94d26bfaa40159966064f9c8c (diff)
Merge commit 'v2.6.36-rc3' into x86/memblock
Conflicts: arch/x86/kernel/trampoline.c mm/memblock.c Merge reason: Resolve the conflicts, update to latest upstream. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/microblaze/include')
-rw-r--r--arch/microblaze/include/asm/cacheflush.h18
-rw-r--r--arch/microblaze/include/asm/dma-mapping.h12
-rw-r--r--arch/microblaze/include/asm/elf.h2
-rw-r--r--arch/microblaze/include/asm/exceptions.h21
-rw-r--r--arch/microblaze/include/asm/irq.h24
-rw-r--r--arch/microblaze/include/asm/kgdb.h28
-rw-r--r--arch/microblaze/include/asm/local64.h1
-rw-r--r--arch/microblaze/include/asm/of_device.h44
-rw-r--r--arch/microblaze/include/asm/of_platform.h54
-rw-r--r--arch/microblaze/include/asm/page.h21
-rw-r--r--arch/microblaze/include/asm/pci-bridge.h5
-rw-r--r--arch/microblaze/include/asm/prom.h115
-rw-r--r--arch/microblaze/include/asm/pvr.h2
-rw-r--r--arch/microblaze/include/asm/scatterlist.h2
-rw-r--r--arch/microblaze/include/asm/setup.h2
-rw-r--r--arch/microblaze/include/asm/system.h4
-rw-r--r--arch/microblaze/include/asm/topology.h10
-rw-r--r--arch/microblaze/include/asm/uaccess.h4
-rw-r--r--arch/microblaze/include/asm/unwind.h29
19 files changed, 105 insertions, 293 deletions
diff --git a/arch/microblaze/include/asm/cacheflush.h b/arch/microblaze/include/asm/cacheflush.h
index a6edd356cd08..7ebd955460d9 100644
--- a/arch/microblaze/include/asm/cacheflush.h
+++ b/arch/microblaze/include/asm/cacheflush.h
@@ -17,6 +17,7 @@
17 17
18/* Somebody depends on this; sigh... */ 18/* Somebody depends on this; sigh... */
19#include <linux/mm.h> 19#include <linux/mm.h>
20#include <linux/io.h>
20 21
21/* Look at Documentation/cachetlb.txt */ 22/* Look at Documentation/cachetlb.txt */
22 23
@@ -60,7 +61,6 @@ void microblaze_cache_init(void);
60#define invalidate_icache() mbc->iin(); 61#define invalidate_icache() mbc->iin();
61#define invalidate_icache_range(start, end) mbc->iinr(start, end); 62#define invalidate_icache_range(start, end) mbc->iinr(start, end);
62 63
63
64#define flush_icache_user_range(vma, pg, adr, len) flush_icache(); 64#define flush_icache_user_range(vma, pg, adr, len) flush_icache();
65#define flush_icache_page(vma, pg) do { } while (0) 65#define flush_icache_page(vma, pg) do { } while (0)
66 66
@@ -72,9 +72,15 @@ void microblaze_cache_init(void);
72#define flush_dcache() mbc->dfl(); 72#define flush_dcache() mbc->dfl();
73#define flush_dcache_range(start, end) mbc->dflr(start, end); 73#define flush_dcache_range(start, end) mbc->dflr(start, end);
74 74
75#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0 75#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
76/* D-cache aliasing problem can't happen - cache is between MMU and ram */ 76/* MS: We have to implement it because of rootfs-jffs2 issue on WB */
77#define flush_dcache_page(page) do { } while (0) 77#define flush_dcache_page(page) \
78do { \
79 unsigned long addr = (unsigned long) page_address(page); /* virtual */ \
80 addr = (u32)virt_to_phys((void *)addr); \
81 flush_dcache_range((unsigned) (addr), (unsigned) (addr) + PAGE_SIZE); \
82} while (0);
83
78#define flush_dcache_mmap_lock(mapping) do { } while (0) 84#define flush_dcache_mmap_lock(mapping) do { } while (0)
79#define flush_dcache_mmap_unlock(mapping) do { } while (0) 85#define flush_dcache_mmap_unlock(mapping) do { } while (0)
80 86
@@ -97,8 +103,10 @@ void microblaze_cache_init(void);
97 103
98#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ 104#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
99do { \ 105do { \
106 u32 addr = virt_to_phys(dst); \
107 invalidate_icache_range((unsigned) (addr), (unsigned) (addr) + (len));\
100 memcpy((dst), (src), (len)); \ 108 memcpy((dst), (src), (len)); \
101 flush_icache_range((unsigned) (dst), (unsigned) (dst) + (len)); \ 109 flush_dcache_range((unsigned) (addr), (unsigned) (addr) + (len));\
102} while (0) 110} while (0)
103 111
104#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ 112#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
diff --git a/arch/microblaze/include/asm/dma-mapping.h b/arch/microblaze/include/asm/dma-mapping.h
index 18b3731c8509..8fbb0ec10233 100644
--- a/arch/microblaze/include/asm/dma-mapping.h
+++ b/arch/microblaze/include/asm/dma-mapping.h
@@ -79,12 +79,6 @@ static inline int dma_supported(struct device *dev, u64 mask)
79 return ops->dma_supported(dev, mask); 79 return ops->dma_supported(dev, mask);
80} 80}
81 81
82#ifdef CONFIG_PCI
83/* We have our own implementation of pci_set_dma_mask() */
84#define HAVE_ARCH_PCI_SET_DMA_MASK
85
86#endif
87
88static inline int dma_set_mask(struct device *dev, u64 dma_mask) 82static inline int dma_set_mask(struct device *dev, u64 dma_mask)
89{ 83{
90 struct dma_map_ops *ops = get_dma_ops(dev); 84 struct dma_map_ops *ops = get_dma_ops(dev);
@@ -112,7 +106,6 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
112 106
113#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) 107#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
114#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) 108#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
115#define dma_is_consistent(d, h) (1)
116 109
117static inline void *dma_alloc_coherent(struct device *dev, size_t size, 110static inline void *dma_alloc_coherent(struct device *dev, size_t size,
118 dma_addr_t *dma_handle, gfp_t flag) 111 dma_addr_t *dma_handle, gfp_t flag)
@@ -138,11 +131,6 @@ static inline void dma_free_coherent(struct device *dev, size_t size,
138 ops->free_coherent(dev, size, cpu_addr, dma_handle); 131 ops->free_coherent(dev, size, cpu_addr, dma_handle);
139} 132}
140 133
141static inline int dma_get_cache_alignment(void)
142{
143 return L1_CACHE_BYTES;
144}
145
146static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, 134static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
147 enum dma_data_direction direction) 135 enum dma_data_direction direction)
148{ 136{
diff --git a/arch/microblaze/include/asm/elf.h b/arch/microblaze/include/asm/elf.h
index 7d4acf2b278e..732caf1be741 100644
--- a/arch/microblaze/include/asm/elf.h
+++ b/arch/microblaze/include/asm/elf.h
@@ -77,7 +77,7 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
77#define ELF_DATA ELFDATA2MSB 77#define ELF_DATA ELFDATA2MSB
78#endif 78#endif
79 79
80#define ELF_EXEC_PAGESIZE 4096 80#define ELF_EXEC_PAGESIZE PAGE_SIZE
81 81
82 82
83#define ELF_CORE_COPY_REGS(_dest, _regs) \ 83#define ELF_CORE_COPY_REGS(_dest, _regs) \
diff --git a/arch/microblaze/include/asm/exceptions.h b/arch/microblaze/include/asm/exceptions.h
index 4c7b5d037c88..6479097b802b 100644
--- a/arch/microblaze/include/asm/exceptions.h
+++ b/arch/microblaze/include/asm/exceptions.h
@@ -14,6 +14,11 @@
14#define _ASM_MICROBLAZE_EXCEPTIONS_H 14#define _ASM_MICROBLAZE_EXCEPTIONS_H
15 15
16#ifdef __KERNEL__ 16#ifdef __KERNEL__
17
18#ifndef CONFIG_MMU
19#define EX_HANDLER_STACK_SIZ (4*19)
20#endif
21
17#ifndef __ASSEMBLY__ 22#ifndef __ASSEMBLY__
18 23
19/* Macros to enable and disable HW exceptions in the MSR */ 24/* Macros to enable and disable HW exceptions in the MSR */
@@ -64,22 +69,6 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type,
64void die(const char *str, struct pt_regs *fp, long err); 69void die(const char *str, struct pt_regs *fp, long err);
65void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr); 70void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr);
66 71
67#if defined(CONFIG_KGDB)
68void (*debugger)(struct pt_regs *regs);
69int (*debugger_bpt)(struct pt_regs *regs);
70int (*debugger_sstep)(struct pt_regs *regs);
71int (*debugger_iabr_match)(struct pt_regs *regs);
72int (*debugger_dabr_match)(struct pt_regs *regs);
73void (*debugger_fault_handler)(struct pt_regs *regs);
74#else
75#define debugger(regs) do { } while (0)
76#define debugger_bpt(regs) 0
77#define debugger_sstep(regs) 0
78#define debugger_iabr_match(regs) 0
79#define debugger_dabr_match(regs) 0
80#define debugger_fault_handler ((void (*)(struct pt_regs *))0)
81#endif
82
83#endif /*__ASSEMBLY__ */ 72#endif /*__ASSEMBLY__ */
84#endif /* __KERNEL__ */ 73#endif /* __KERNEL__ */
85#endif /* _ASM_MICROBLAZE_EXCEPTIONS_H */ 74#endif /* _ASM_MICROBLAZE_EXCEPTIONS_H */
diff --git a/arch/microblaze/include/asm/irq.h b/arch/microblaze/include/asm/irq.h
index 31a35c33df63..ec5583d6111c 100644
--- a/arch/microblaze/include/asm/irq.h
+++ b/arch/microblaze/include/asm/irq.h
@@ -27,17 +27,6 @@ extern unsigned int nr_irq;
27struct pt_regs; 27struct pt_regs;
28extern void do_IRQ(struct pt_regs *regs); 28extern void do_IRQ(struct pt_regs *regs);
29 29
30/**
31 * irq_of_parse_and_map - Parse and Map an interrupt into linux virq space
32 * @device: Device node of the device whose interrupt is to be mapped
33 * @index: Index of the interrupt to map
34 *
35 * This function is a wrapper that chains of_irq_map_one() and
36 * irq_create_of_mapping() to make things easier to callers
37 */
38struct device_node;
39extern unsigned int irq_of_parse_and_map(struct device_node *dev, int index);
40
41/** FIXME - not implement 30/** FIXME - not implement
42 * irq_dispose_mapping - Unmap an interrupt 31 * irq_dispose_mapping - Unmap an interrupt
43 * @virq: linux virq number of the interrupt to unmap 32 * @virq: linux virq number of the interrupt to unmap
@@ -62,17 +51,4 @@ struct irq_host;
62extern unsigned int irq_create_mapping(struct irq_host *host, 51extern unsigned int irq_create_mapping(struct irq_host *host,
63 irq_hw_number_t hwirq); 52 irq_hw_number_t hwirq);
64 53
65/**
66 * irq_create_of_mapping - Map a hardware interrupt into linux virq space
67 * @controller: Device node of the interrupt controller
68 * @inspec: Interrupt specifier from the device-tree
69 * @intsize: Size of the interrupt specifier from the device-tree
70 *
71 * This function is identical to irq_create_mapping except that it takes
72 * as input informations straight from the device-tree (typically the results
73 * of the of_irq_map_*() functions.
74 */
75extern unsigned int irq_create_of_mapping(struct device_node *controller,
76 u32 *intspec, unsigned int intsize);
77
78#endif /* _ASM_MICROBLAZE_IRQ_H */ 54#endif /* _ASM_MICROBLAZE_IRQ_H */
diff --git a/arch/microblaze/include/asm/kgdb.h b/arch/microblaze/include/asm/kgdb.h
new file mode 100644
index 000000000000..78b17d40b235
--- /dev/null
+++ b/arch/microblaze/include/asm/kgdb.h
@@ -0,0 +1,28 @@
1#ifdef __KERNEL__
2#ifndef __MICROBLAZE_KGDB_H__
3#define __MICROBLAZE_KGDB_H__
4
5#ifndef __ASSEMBLY__
6
7#define CACHE_FLUSH_IS_SAFE 1
8#define BUFMAX 2048
9
10/*
11 * 32 32-bit general purpose registers (r0-r31)
12 * 6 32-bit special registers (pc, msr, ear, esr, fsr, btr)
13 * 12 32-bit PVR
14 * 7 32-bit MMU Regs (redr, rpid, rzpr, rtlbx, rtlbsx, rtlblo, rtlbhi)
15 * ------
16 * 57 registers
17 */
18#define NUMREGBYTES (57 * 4)
19
20#define BREAK_INSTR_SIZE 4
21static inline void arch_kgdb_breakpoint(void)
22{
23 __asm__ __volatile__("brki r16, 0x18;");
24}
25
26#endif /* __ASSEMBLY__ */
27#endif /* __MICROBLAZE_KGDB_H__ */
28#endif /* __KERNEL__ */
diff --git a/arch/microblaze/include/asm/local64.h b/arch/microblaze/include/asm/local64.h
new file mode 100644
index 000000000000..36c93b5cc239
--- /dev/null
+++ b/arch/microblaze/include/asm/local64.h
@@ -0,0 +1 @@
#include <asm-generic/local64.h>
diff --git a/arch/microblaze/include/asm/of_device.h b/arch/microblaze/include/asm/of_device.h
deleted file mode 100644
index 73cb98040982..000000000000
--- a/arch/microblaze/include/asm/of_device.h
+++ /dev/null
@@ -1,44 +0,0 @@
1/*
2 * Copyright (C) 2007-2008 Michal Simek <monstr@monstr.eu>
3 *
4 * based on PowerPC of_device.h
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#ifndef _ASM_MICROBLAZE_OF_DEVICE_H
12#define _ASM_MICROBLAZE_OF_DEVICE_H
13#ifdef __KERNEL__
14
15#include <linux/device.h>
16#include <linux/of.h>
17
18/*
19 * The of_device is a kind of "base class" that is a superset of
20 * struct device for use by devices attached to an OF node and
21 * probed using OF properties.
22 */
23struct of_device {
24 struct device dev; /* Generic device interface */
25 struct pdev_archdata archdata;
26};
27
28extern ssize_t of_device_get_modalias(struct of_device *ofdev,
29 char *str, ssize_t len);
30
31extern struct of_device *of_device_alloc(struct device_node *np,
32 const char *bus_id,
33 struct device *parent);
34
35extern int of_device_uevent(struct device *dev,
36 struct kobj_uevent_env *env);
37
38extern void of_device_make_bus_id(struct of_device *dev);
39
40/* This is just here during the transition */
41#include <linux/of_device.h>
42
43#endif /* __KERNEL__ */
44#endif /* _ASM_MICROBLAZE_OF_DEVICE_H */
diff --git a/arch/microblaze/include/asm/of_platform.h b/arch/microblaze/include/asm/of_platform.h
deleted file mode 100644
index 37491276c6ca..000000000000
--- a/arch/microblaze/include/asm/of_platform.h
+++ /dev/null
@@ -1,54 +0,0 @@
1/*
2 * Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp.
3 * <benh@kernel.crashing.org>
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10
11#ifndef _ASM_MICROBLAZE_OF_PLATFORM_H
12#define _ASM_MICROBLAZE_OF_PLATFORM_H
13
14/* This is just here during the transition */
15#include <linux/of_platform.h>
16
17/*
18 * The list of OF IDs below is used for matching bus types in the
19 * system whose devices are to be exposed as of_platform_devices.
20 *
21 * This is the default list valid for most platforms. This file provides
22 * functions who can take an explicit list if necessary though
23 *
24 * The search is always performed recursively looking for children of
25 * the provided device_node and recursively if such a children matches
26 * a bus type in the list
27 */
28
29static const struct of_device_id of_default_bus_ids[] = {
30 { .type = "soc", },
31 { .compatible = "soc", },
32 { .type = "plb5", },
33 { .type = "plb4", },
34 { .type = "opb", },
35 { .type = "simple", },
36 {},
37};
38
39/* Platform devices and busses creation */
40extern struct of_device *of_platform_device_create(struct device_node *np,
41 const char *bus_id,
42 struct device *parent);
43/* pseudo "matches" value to not do deep probe */
44#define OF_NO_DEEP_PROBE ((struct of_device_id *)-1)
45
46extern int of_platform_bus_probe(struct device_node *root,
47 const struct of_device_id *matches,
48 struct device *parent);
49
50extern struct of_device *of_find_device_by_phandle(phandle ph);
51
52extern void of_instantiate_rtc(void);
53
54#endif /* _ASM_MICROBLAZE_OF_PLATFORM_H */
diff --git a/arch/microblaze/include/asm/page.h b/arch/microblaze/include/asm/page.h
index 464ff32bee3d..cf377d91da71 100644
--- a/arch/microblaze/include/asm/page.h
+++ b/arch/microblaze/include/asm/page.h
@@ -23,8 +23,16 @@
23#ifdef __KERNEL__ 23#ifdef __KERNEL__
24 24
25/* PAGE_SHIFT determines the page size */ 25/* PAGE_SHIFT determines the page size */
26#define PAGE_SHIFT (12) 26#if defined(CONFIG_MICROBLAZE_32K_PAGES)
27#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT) 27#define PAGE_SHIFT 15
28#elif defined(CONFIG_MICROBLAZE_16K_PAGES)
29#define PAGE_SHIFT 14
30#elif defined(CONFIG_MICROBLAZE_8K_PAGES)
31#define PAGE_SHIFT 13
32#else
33#define PAGE_SHIFT 12
34#endif
35#define PAGE_SIZE (ASM_CONST(1) << PAGE_SHIFT)
28#define PAGE_MASK (~(PAGE_SIZE-1)) 36#define PAGE_MASK (~(PAGE_SIZE-1))
29 37
30#define LOAD_OFFSET ASM_CONST((CONFIG_KERNEL_START-CONFIG_KERNEL_BASE_ADDR)) 38#define LOAD_OFFSET ASM_CONST((CONFIG_KERNEL_START-CONFIG_KERNEL_BASE_ADDR))
@@ -32,20 +40,13 @@
32#ifndef __ASSEMBLY__ 40#ifndef __ASSEMBLY__
33 41
34/* MS be sure that SLAB allocates aligned objects */ 42/* MS be sure that SLAB allocates aligned objects */
35#define ARCH_KMALLOC_MINALIGN L1_CACHE_BYTES 43#define ARCH_DMA_MINALIGN L1_CACHE_BYTES
36 44
37#define ARCH_SLAB_MINALIGN L1_CACHE_BYTES 45#define ARCH_SLAB_MINALIGN L1_CACHE_BYTES
38 46
39#define PAGE_UP(addr) (((addr)+((PAGE_SIZE)-1))&(~((PAGE_SIZE)-1))) 47#define PAGE_UP(addr) (((addr)+((PAGE_SIZE)-1))&(~((PAGE_SIZE)-1)))
40#define PAGE_DOWN(addr) ((addr)&(~((PAGE_SIZE)-1))) 48#define PAGE_DOWN(addr) ((addr)&(~((PAGE_SIZE)-1)))
41 49
42/* align addr on a size boundary - adjust address up/down if needed */
43#define _ALIGN_UP(addr, size) (((addr)+((size)-1))&(~((size)-1)))
44#define _ALIGN_DOWN(addr, size) ((addr)&(~((size)-1)))
45
46/* align addr on a size boundary - adjust address up if needed */
47#define _ALIGN(addr, size) _ALIGN_UP(addr, size)
48
49#ifndef CONFIG_MMU 50#ifndef CONFIG_MMU
50/* 51/*
51 * PAGE_OFFSET -- the first address of the first page of memory. When not 52 * PAGE_OFFSET -- the first address of the first page of memory. When not
diff --git a/arch/microblaze/include/asm/pci-bridge.h b/arch/microblaze/include/asm/pci-bridge.h
index 0c77cda9f5d8..0c68764ab547 100644
--- a/arch/microblaze/include/asm/pci-bridge.h
+++ b/arch/microblaze/include/asm/pci-bridge.h
@@ -172,13 +172,8 @@ static inline int pci_has_flag(int flag)
172 172
173extern struct list_head hose_list; 173extern struct list_head hose_list;
174 174
175extern unsigned long pci_address_to_pio(phys_addr_t address);
176extern int pcibios_vaddr_is_ioport(void __iomem *address); 175extern int pcibios_vaddr_is_ioport(void __iomem *address);
177#else 176#else
178static inline unsigned long pci_address_to_pio(phys_addr_t address)
179{
180 return (unsigned long)-1;
181}
182static inline int pcibios_vaddr_is_ioport(void __iomem *address) 177static inline int pcibios_vaddr_is_ioport(void __iomem *address)
183{ 178{
184 return 0; 179 return 0;
diff --git a/arch/microblaze/include/asm/prom.h b/arch/microblaze/include/asm/prom.h
index e7d67a329bd7..101fa098f62a 100644
--- a/arch/microblaze/include/asm/prom.h
+++ b/arch/microblaze/include/asm/prom.h
@@ -20,9 +20,6 @@
20#ifndef __ASSEMBLY__ 20#ifndef __ASSEMBLY__
21 21
22#include <linux/types.h> 22#include <linux/types.h>
23#include <linux/of_fdt.h>
24#include <linux/proc_fs.h>
25#include <linux/platform_device.h>
26#include <asm/irq.h> 23#include <asm/irq.h>
27#include <asm/atomic.h> 24#include <asm/atomic.h>
28 25
@@ -50,29 +47,10 @@ extern void pci_create_OF_bus_map(void);
50 * OF address retreival & translation 47 * OF address retreival & translation
51 */ 48 */
52 49
53/* Translate an OF address block into a CPU physical address 50#ifdef CONFIG_PCI
54 */ 51extern unsigned long pci_address_to_pio(phys_addr_t address);
55extern u64 of_translate_address(struct device_node *np, const u32 *addr); 52#define pci_address_to_pio pci_address_to_pio
56 53#endif /* CONFIG_PCI */
57/* Extract an address from a device, returns the region size and
58 * the address space flags too. The PCI version uses a BAR number
59 * instead of an absolute index
60 */
61extern const u32 *of_get_address(struct device_node *dev, int index,
62 u64 *size, unsigned int *flags);
63extern const u32 *of_get_pci_address(struct device_node *dev, int bar_no,
64 u64 *size, unsigned int *flags);
65
66/* Get an address as a resource. Note that if your address is
67 * a PIO address, the conversion will fail if the physical address
68 * can't be internally converted to an IO token with
69 * pci_address_to_pio(), that is because it's either called to early
70 * or it can't be matched to any host bridge IO space
71 */
72extern int of_address_to_resource(struct device_node *dev, int index,
73 struct resource *r);
74extern int of_pci_address_to_resource(struct device_node *dev, int bar,
75 struct resource *r);
76 54
77/* Parse the ibm,dma-window property of an OF node into the busno, phys and 55/* Parse the ibm,dma-window property of an OF node into the busno, phys and
78 * size parameters. 56 * size parameters.
@@ -88,69 +66,6 @@ struct device_node *of_get_cpu_node(int cpu, unsigned int *thread);
88/* Get the MAC address */ 66/* Get the MAC address */
89extern const void *of_get_mac_address(struct device_node *np); 67extern const void *of_get_mac_address(struct device_node *np);
90 68
91/*
92 * OF interrupt mapping
93 */
94
95/* This structure is returned when an interrupt is mapped. The controller
96 * field needs to be put() after use
97 */
98
99#define OF_MAX_IRQ_SPEC 4 /* We handle specifiers of at most 4 cells */
100
101struct of_irq {
102 struct device_node *controller; /* Interrupt controller node */
103 u32 size; /* Specifier size */
104 u32 specifier[OF_MAX_IRQ_SPEC]; /* Specifier copy */
105};
106
107/**
108 * of_irq_map_init - Initialize the irq remapper
109 * @flags: flags defining workarounds to enable
110 *
111 * Some machines have bugs in the device-tree which require certain workarounds
112 * to be applied. Call this before any interrupt mapping attempts to enable
113 * those workarounds.
114 */
115#define OF_IMAP_OLDWORLD_MAC 0x00000001
116#define OF_IMAP_NO_PHANDLE 0x00000002
117
118extern void of_irq_map_init(unsigned int flags);
119
120/**
121 * of_irq_map_raw - Low level interrupt tree parsing
122 * @parent: the device interrupt parent
123 * @intspec: interrupt specifier ("interrupts" property of the device)
124 * @ointsize: size of the passed in interrupt specifier
125 * @addr: address specifier (start of "reg" property of the device)
126 * @out_irq: structure of_irq filled by this function
127 *
128 * Returns 0 on success and a negative number on error
129 *
130 * This function is a low-level interrupt tree walking function. It
131 * can be used to do a partial walk with synthetized reg and interrupts
132 * properties, for example when resolving PCI interrupts when no device
133 * node exist for the parent.
134 *
135 */
136
137extern int of_irq_map_raw(struct device_node *parent, const u32 *intspec,
138 u32 ointsize, const u32 *addr,
139 struct of_irq *out_irq);
140
141/**
142 * of_irq_map_one - Resolve an interrupt for a device
143 * @device: the device whose interrupt is to be resolved
144 * @index: index of the interrupt to resolve
145 * @out_irq: structure of_irq filled by this function
146 *
147 * This function resolves an interrupt, walking the tree, for a given
148 * device-tree node. It's the high level pendant to of_irq_map_raw().
149 * It also implements the workarounds for OldWolrd Macs.
150 */
151extern int of_irq_map_one(struct device_node *device, int index,
152 struct of_irq *out_irq);
153
154/** 69/**
155 * of_irq_map_pci - Resolve the interrupt for a PCI device 70 * of_irq_map_pci - Resolve the interrupt for a PCI device
156 * @pdev: the device whose interrupt is to be resolved 71 * @pdev: the device whose interrupt is to be resolved
@@ -163,20 +78,18 @@ extern int of_irq_map_one(struct device_node *device, int index,
163 * resolving using the OF tree walking. 78 * resolving using the OF tree walking.
164 */ 79 */
165struct pci_dev; 80struct pci_dev;
81struct of_irq;
166extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq); 82extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq);
167 83
168extern int of_irq_to_resource(struct device_node *dev, int index,
169 struct resource *r);
170
171/**
172 * of_iomap - Maps the memory mapped IO for a given device_node
173 * @device: the device whose io range will be mapped
174 * @index: index of the io range
175 *
176 * Returns a pointer to the mapped memory
177 */
178extern void __iomem *of_iomap(struct device_node *device, int index);
179
180#endif /* __ASSEMBLY__ */ 84#endif /* __ASSEMBLY__ */
181#endif /* __KERNEL__ */ 85#endif /* __KERNEL__ */
86
87/* These includes are put at the bottom because they may contain things
88 * that are overridden by this file. Ideally they shouldn't be included
89 * by this file, but there are a bunch of .c files that currently depend
90 * on it. Eventually they will be cleaned up. */
91#include <linux/of_fdt.h>
92#include <linux/of_irq.h>
93#include <linux/platform_device.h>
94
182#endif /* _ASM_MICROBLAZE_PROM_H */ 95#endif /* _ASM_MICROBLAZE_PROM_H */
diff --git a/arch/microblaze/include/asm/pvr.h b/arch/microblaze/include/asm/pvr.h
index e38abc7714b6..9578666e98ba 100644
--- a/arch/microblaze/include/asm/pvr.h
+++ b/arch/microblaze/include/asm/pvr.h
@@ -16,7 +16,7 @@
16#define PVR_MSR_BIT 0x400 16#define PVR_MSR_BIT 0x400
17 17
18struct pvr_s { 18struct pvr_s {
19 unsigned pvr[16]; 19 unsigned pvr[12];
20}; 20};
21 21
22/* The following taken from Xilinx's standalone BSP pvr.h */ 22/* The following taken from Xilinx's standalone BSP pvr.h */
diff --git a/arch/microblaze/include/asm/scatterlist.h b/arch/microblaze/include/asm/scatterlist.h
index dc4a8900cc80..35d786fe93ae 100644
--- a/arch/microblaze/include/asm/scatterlist.h
+++ b/arch/microblaze/include/asm/scatterlist.h
@@ -1,3 +1 @@
1#include <asm-generic/scatterlist.h> #include <asm-generic/scatterlist.h>
2
3#define ISA_DMA_THRESHOLD (~0UL)
diff --git a/arch/microblaze/include/asm/setup.h b/arch/microblaze/include/asm/setup.h
index 7f31394985e0..782b5c89248e 100644
--- a/arch/microblaze/include/asm/setup.h
+++ b/arch/microblaze/include/asm/setup.h
@@ -28,8 +28,6 @@ void disable_early_printk(void);
28void heartbeat(void); 28void heartbeat(void);
29void setup_heartbeat(void); 29void setup_heartbeat(void);
30 30
31unsigned long long sched_clock(void);
32
33# ifdef CONFIG_MMU 31# ifdef CONFIG_MMU
34extern void mmu_reset(void); 32extern void mmu_reset(void);
35extern void early_console_reg_tlb_alloc(unsigned int addr); 33extern void early_console_reg_tlb_alloc(unsigned int addr);
diff --git a/arch/microblaze/include/asm/system.h b/arch/microblaze/include/asm/system.h
index 48c4f0335e3f..e6a2284571dc 100644
--- a/arch/microblaze/include/asm/system.h
+++ b/arch/microblaze/include/asm/system.h
@@ -45,7 +45,6 @@ extern struct task_struct *_switch_to(struct thread_info *prev,
45#define smp_rmb() rmb() 45#define smp_rmb() rmb()
46#define smp_wmb() wmb() 46#define smp_wmb() wmb()
47 47
48void show_trace(struct task_struct *task, unsigned long *stack);
49void __bad_xchg(volatile void *ptr, int size); 48void __bad_xchg(volatile void *ptr, int size);
50 49
51static inline unsigned long __xchg(unsigned long x, volatile void *ptr, 50static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
@@ -101,10 +100,7 @@ extern struct dentry *of_debugfs_root;
101 * MicroBlaze doesn't handle unaligned accesses in hardware. 100 * MicroBlaze doesn't handle unaligned accesses in hardware.
102 * 101 *
103 * Based on this we force the IP header alignment in network drivers. 102 * Based on this we force the IP header alignment in network drivers.
104 * We also modify NET_SKB_PAD to be a cacheline in size, thus maintaining
105 * cacheline alignment of buffers.
106 */ 103 */
107#define NET_IP_ALIGN 2 104#define NET_IP_ALIGN 2
108#define NET_SKB_PAD L1_CACHE_BYTES
109 105
110#endif /* _ASM_MICROBLAZE_SYSTEM_H */ 106#endif /* _ASM_MICROBLAZE_SYSTEM_H */
diff --git a/arch/microblaze/include/asm/topology.h b/arch/microblaze/include/asm/topology.h
index 96bcea5a9920..5428f333a02c 100644
--- a/arch/microblaze/include/asm/topology.h
+++ b/arch/microblaze/include/asm/topology.h
@@ -1,11 +1 @@
1#include <asm-generic/topology.h> #include <asm-generic/topology.h>
2
3#ifndef _ASM_MICROBLAZE_TOPOLOGY_H
4#define _ASM_MICROBLAZE_TOPOLOGY_H
5
6struct device_node;
7static inline int of_node_to_nid(struct device_node *device)
8{
9 return 0;
10}
11#endif /* _ASM_MICROBLAZE_TOPOLOGY_H */
diff --git a/arch/microblaze/include/asm/uaccess.h b/arch/microblaze/include/asm/uaccess.h
index 26460d15b338..d840f4a2d3c9 100644
--- a/arch/microblaze/include/asm/uaccess.h
+++ b/arch/microblaze/include/asm/uaccess.h
@@ -359,7 +359,7 @@ extern long __user_bad(void);
359 __copy_tofrom_user((__force void __user *)(to), \ 359 __copy_tofrom_user((__force void __user *)(to), \
360 (void __user *)(from), (n)) 360 (void __user *)(from), (n))
361#define __copy_from_user_inatomic(to, from, n) \ 361#define __copy_from_user_inatomic(to, from, n) \
362 copy_from_user((to), (from), (n)) 362 __copy_from_user((to), (from), (n))
363 363
364static inline long copy_from_user(void *to, 364static inline long copy_from_user(void *to,
365 const void __user *from, unsigned long n) 365 const void __user *from, unsigned long n)
@@ -373,7 +373,7 @@ static inline long copy_from_user(void *to,
373#define __copy_to_user(to, from, n) \ 373#define __copy_to_user(to, from, n) \
374 __copy_tofrom_user((void __user *)(to), \ 374 __copy_tofrom_user((void __user *)(to), \
375 (__force const void __user *)(from), (n)) 375 (__force const void __user *)(from), (n))
376#define __copy_to_user_inatomic(to, from, n) copy_to_user((to), (from), (n)) 376#define __copy_to_user_inatomic(to, from, n) __copy_to_user((to), (from), (n))
377 377
378static inline long copy_to_user(void __user *to, 378static inline long copy_to_user(void __user *to,
379 const void *from, unsigned long n) 379 const void *from, unsigned long n)
diff --git a/arch/microblaze/include/asm/unwind.h b/arch/microblaze/include/asm/unwind.h
new file mode 100644
index 000000000000..d248b7de4b13
--- /dev/null
+++ b/arch/microblaze/include/asm/unwind.h
@@ -0,0 +1,29 @@
1/*
2 * Backtrace support for Microblaze
3 *
4 * Copyright (C) 2010 Digital Design Corporation
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#ifndef __MICROBLAZE_UNWIND_H
12#define __MICROBLAZE_UNWIND_H
13
14struct stack_trace;
15
16struct trap_handler_info {
17 unsigned long start_addr;
18 unsigned long end_addr;
19 const char *trap_name;
20};
21extern struct trap_handler_info microblaze_trap_handlers;
22
23extern const char _hw_exception_handler;
24extern const char ex_handler_unhandled;
25
26void microblaze_unwind(struct task_struct *task, struct stack_trace *trace);
27
28#endif /* __MICROBLAZE_UNWIND_H */
29