acpiphp: Execute ACPI _REG method for hotadded devices
[linux/fpc-iii.git] / arch / arm / plat-omap / include / plat / memory.h
blob3325f7b49eaa23766d3ea9208230b50972af7226
1 /*
2 * arch/arm/plat-omap/include/mach/memory.h
4 * Memory map for OMAP-1510 and 1610
6 * Copyright (C) 2000 RidgeRun, Inc.
7 * Author: Greg Lonnon <glonnon@ridgerun.com>
9 * This file was derived from arch/arm/mach-intergrator/include/mach/memory.h
10 * Copyright (C) 1999 ARM Limited
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version.
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
20 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 * You should have received a copy of the GNU General Public License along
29 * with this program; if not, write to the Free Software Foundation, Inc.,
30 * 675 Mass Ave, Cambridge, MA 02139, USA.
33 #ifndef __ASM_ARCH_MEMORY_H
34 #define __ASM_ARCH_MEMORY_H
37 * Physical DRAM offset.
39 #if defined(CONFIG_ARCH_OMAP1)
40 #define PHYS_OFFSET UL(0x10000000)
41 #elif defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \
42 defined(CONFIG_ARCH_OMAP4)
43 #define PHYS_OFFSET UL(0x80000000)
44 #endif
47 * Bus address is physical address, except for OMAP-1510 Local Bus.
48 * OMAP-1510 bus address is translated into a Local Bus address if the
49 * OMAP bus type is lbus. We do the address translation based on the
50 * device overriding the defaults used in the dma-mapping API.
51 * Note that the is_lbus_device() test is not very efficient on 1510
52 * because of the strncmp().
54 #ifdef CONFIG_ARCH_OMAP15XX
57 * OMAP-1510 Local Bus address offset
59 #define OMAP1510_LB_OFFSET UL(0x30000000)
61 #define virt_to_lbus(x) ((x) - PAGE_OFFSET + OMAP1510_LB_OFFSET)
62 #define lbus_to_virt(x) ((x) - OMAP1510_LB_OFFSET + PAGE_OFFSET)
63 #define is_lbus_device(dev) (cpu_is_omap15xx() && dev && (strncmp(dev_name(dev), "ohci", 4) == 0))
65 #define __arch_page_to_dma(dev, page) \
66 ({ dma_addr_t __dma = page_to_phys(page); \
67 if (is_lbus_device(dev)) \
68 __dma = __dma - PHYS_OFFSET + OMAP1510_LB_OFFSET; \
69 __dma; })
71 #define __arch_dma_to_page(dev, addr) \
72 ({ dma_addr_t __dma = addr; \
73 if (is_lbus_device(dev)) \
74 __dma += PHYS_OFFSET - OMAP1510_LB_OFFSET; \
75 phys_to_page(__dma); \
78 #define __arch_dma_to_virt(dev, addr) ({ (void *) (is_lbus_device(dev) ? \
79 lbus_to_virt(addr) : \
80 __phys_to_virt(addr)); })
82 #define __arch_virt_to_dma(dev, addr) ({ unsigned long __addr = (unsigned long)(addr); \
83 (dma_addr_t) (is_lbus_device(dev) ? \
84 virt_to_lbus(__addr) : \
85 __virt_to_phys(__addr)); })
87 #endif /* CONFIG_ARCH_OMAP15XX */
89 /* Override the ARM default */
90 #ifdef CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE
92 #if (CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE == 0)
93 #undef CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE
94 #define CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE 2
95 #endif
97 #define CONSISTENT_DMA_SIZE \
98 (((CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE + 1) & ~1) * 1024 * 1024)
100 #endif
102 #endif