mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-30 12:46:40 +07:00
285f5fa7e9
The iop348 processor integrates an Xscale (XSC3 512KB L2 Cache) core with a Serial Attached SCSI (SAS) controller, multi-ported DDR2 memory controller, 3 Application Direct Memory Access (DMA) controllers, a 133Mhz PCI-X interface, a x8 PCI-Express interface, and other peripherals to form a system-on-a-chip RAID subsystem engine. The iop342 processor replaces the SAS controller with a second Xscale core for dual core embedded applications. The iop341 processor is the single core version of iop342. This patch supports the two Intel customer reference platforms iq81340mc for external storage and iq81340sc for direct attach (HBA) development. The developer's manual is available here: ftp://download.intel.com/design/iio/docs/31503701.pdf Changelog: * removed virtual addresses from resource definitions * cleaned up some unnecessary #include's Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
65 lines
2.1 KiB
C
65 lines
2.1 KiB
C
#ifndef __ASM_ARCH_MEMORY_H
|
|
#define __ASM_ARCH_MEMORY_H
|
|
|
|
#include <asm/arch/hardware.h>
|
|
|
|
/*
|
|
* Physical DRAM offset.
|
|
*/
|
|
#define PHYS_OFFSET UL(0x00000000)
|
|
#define TASK_SIZE UL(0x3f000000)
|
|
#define PAGE_OFFSET UL(0x40000000)
|
|
#define TASK_UNMAPPED_BASE ((TASK_SIZE + 0x01000000) / 3)
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
#if defined(CONFIG_ARCH_IOP13XX)
|
|
#define IOP13XX_PMMR_V_START (IOP13XX_PMMR_VIRT_MEM_BASE)
|
|
#define IOP13XX_PMMR_V_END (IOP13XX_PMMR_VIRT_MEM_BASE + IOP13XX_PMMR_SIZE)
|
|
#define IOP13XX_PMMR_P_START (IOP13XX_PMMR_PHYS_MEM_BASE)
|
|
#define IOP13XX_PMMR_P_END (IOP13XX_PMMR_PHYS_MEM_BASE + IOP13XX_PMMR_SIZE)
|
|
|
|
/*
|
|
* Virtual view <-> PCI DMA view memory address translations
|
|
* virt_to_bus: Used to translate the virtual address to an
|
|
* address suitable to be passed to set_dma_addr
|
|
* bus_to_virt: Used to convert an address for DMA operations
|
|
* to an address that the kernel can use.
|
|
*/
|
|
|
|
/* RAM has 1:1 mapping on the PCIe/x Busses */
|
|
#define __virt_to_bus(x) (__virt_to_phys(x))
|
|
#define __bus_to_virt(x) (__phys_to_virt(x))
|
|
|
|
#define virt_to_lbus(x) \
|
|
(( ((void*)(x) >= (void*)IOP13XX_PMMR_V_START) && \
|
|
((void*)(x) < (void*)IOP13XX_PMMR_V_END) ) ? \
|
|
((x) - IOP13XX_PMMR_VIRT_MEM_BASE + IOP13XX_PMMR_PHYS_MEM_BASE) : \
|
|
((x) - PAGE_OFFSET + PHYS_OFFSET))
|
|
|
|
#define lbus_to_virt(x) \
|
|
(( ((x) >= IOP13XX_PMMR_P_START) && ((x) < IOP13XX_PMMR_P_END) ) ? \
|
|
((x) - IOP13XX_PMMR_PHYS_MEM_BASE + IOP13XX_PMMR_VIRT_MEM_BASE ) : \
|
|
((x) - PHYS_OFFSET + PAGE_OFFSET))
|
|
|
|
/* Device is an lbus device if it is on the platform bus of the IOP13XX */
|
|
#define is_lbus_device(dev) (dev &&\
|
|
(strncmp(dev->bus->name, "platform", 8) == 0))
|
|
|
|
#define __arch_page_to_dma(dev, page) \
|
|
({is_lbus_device(dev) ? (dma_addr_t)virt_to_lbus(page_address(page)) : \
|
|
(dma_addr_t)__virt_to_bus(page_address(page));})
|
|
|
|
#define __arch_dma_to_virt(dev, addr) \
|
|
({is_lbus_device(dev) ? lbus_to_virt(addr) : __bus_to_virt(addr);})
|
|
|
|
#define __arch_virt_to_dma(dev, addr) \
|
|
({is_lbus_device(dev) ? virt_to_lbus(addr) : __virt_to_bus(addr);})
|
|
|
|
#endif /* CONFIG_ARCH_IOP13XX */
|
|
#endif /* !ASSEMBLY */
|
|
|
|
#define PFN_TO_NID(addr) (0)
|
|
|
|
#endif
|