~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arm/mach-omap1/include/mach/memory.h

Version: ~ [ linux-5.16-rc3 ] ~ [ linux-5.15.5 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.82 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.162 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.218 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.256 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.291 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.293 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * arch/arm/mach-omap1/include/mach/memory.h
  3  */
  4 
  5 #ifndef __ASM_ARCH_MEMORY_H
  6 #define __ASM_ARCH_MEMORY_H
  7 
  8 /* REVISIT: omap1 legacy drivers still rely on this */
  9 #include <mach/soc.h>
 10 
 11 /*
 12  * Bus address is physical address, except for OMAP-1510 Local Bus.
 13  * OMAP-1510 bus address is translated into a Local Bus address if the
 14  * OMAP bus type is lbus. We do the address translation based on the
 15  * device overriding the defaults used in the dma-mapping API.
 16  * Note that the is_lbus_device() test is not very efficient on 1510
 17  * because of the strncmp().
 18  */
 19 #if defined(CONFIG_ARCH_OMAP15XX) && !defined(__ASSEMBLER__)
 20 
 21 /*
 22  * OMAP-1510 Local Bus address offset
 23  */
 24 #define OMAP1510_LB_OFFSET      UL(0x30000000)
 25 
 26 #define virt_to_lbus(x)         ((x) - PAGE_OFFSET + OMAP1510_LB_OFFSET)
 27 #define lbus_to_virt(x)         ((x) - OMAP1510_LB_OFFSET + PAGE_OFFSET)
 28 #define is_lbus_device(dev)     (cpu_is_omap15xx() && dev && (strncmp(dev_name(dev), "ohci", 4) == 0))
 29 
 30 #define __arch_pfn_to_dma(dev, pfn)     \
 31         ({ dma_addr_t __dma = __pfn_to_phys(pfn); \
 32            if (is_lbus_device(dev)) \
 33                 __dma = __dma - PHYS_OFFSET + OMAP1510_LB_OFFSET; \
 34            __dma; })
 35 
 36 #define __arch_dma_to_pfn(dev, addr)    \
 37         ({ dma_addr_t __dma = addr;                             \
 38            if (is_lbus_device(dev))                             \
 39                 __dma += PHYS_OFFSET - OMAP1510_LB_OFFSET;      \
 40            __phys_to_pfn(__dma);                                \
 41         })
 42 
 43 #define __arch_dma_to_virt(dev, addr)   ({ (void *) (is_lbus_device(dev) ? \
 44                                                 lbus_to_virt(addr) : \
 45                                                 __phys_to_virt(addr)); })
 46 
 47 #define __arch_virt_to_dma(dev, addr)   ({ unsigned long __addr = (unsigned long)(addr); \
 48                                            (dma_addr_t) (is_lbus_device(dev) ? \
 49                                                 virt_to_lbus(__addr) : \
 50                                                 __virt_to_phys(__addr)); })
 51 
 52 #endif  /* CONFIG_ARCH_OMAP15XX */
 53 
 54 #endif
 55 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp