Changes in 4.9.174 ALSA: line6: use dynamic buffers ipv4: ip_do_fragment: Preserve skb_iif during fragmentation ipv6/flowlabel: wait rcu grace period before put_pid() ipv6: invert flowlabel sharing check in process and user mode packet: validate msg_namelen in send directly bnxt_en: Improve multicast address setup logic. net: phy: marvell: Fix buffer overrun with stats counters x86/suspend: fix false positive KASAN warning on suspend/resume mm/kasan: Switch to using __pa_symbol and lm_alias x86/unwind: Disable KASAN checks for non-current tasks arm64: kasan: avoid bad virt_to_pfn() kasan: add a prototype of task_struct to avoid warning kasan: avoid -Wmaybe-uninitialized warning kasan: remove redundant initialization of variable 'real_size' arm64: proc: Set PTE_NG for table entries to avoid traversing them twice kasan: prevent compiler from optimizing away memset in tests arm64: mm: print out correct page table entries arm64: mm: don't print out page table entries on EL0 faults caif: reduce stack size with KASAN USB: yurex: Fix protection fault after device removal USB: w1 ds2490: Fix bug caused by improper use of altsetting array usb: usbip: fix isoc packet num validation in get_pipe USB: core: Fix unterminated string returned by usb_string() USB: core: Fix bug caused by duplicate interface PM usage counter nvme-loop: init nvmet_ctrl fatal_err_work when allocate HID: logitech: check the return value of create_singlethread_workqueue HID: debug: fix race condition with between rdesc_show() and device removal rtc: sh: Fix invalid alarm warning for non-enabled alarm batman-adv: Reduce claim hash refcnt only for removed entry batman-adv: Reduce tt_local hash refcnt only for removed entry batman-adv: Reduce tt_global hash refcnt only for removed entry igb: Fix WARN_ONCE on runtime suspend net/mlx5: E-Switch, Fix esw manager vport indication for more vport commands bonding: show full hw address in sysfs for slave entries net: stmmac: don't overwrite discard_frame status net: stmmac: fix dropping of multi-descriptor RX frames net: stmmac: don't log oversized frames jffs2: fix use-after-free on symlink traversal debugfs: fix use-after-free on symlink traversal rtc: da9063: set uie_unsupported when relevant vfio/pci: use correct format characters scsi: core: add new RDAC LENOVO/DE_Series device scsi: storvsc: Fix calculation of sub-channel count net: hns: fix KASAN: use-after-free in hns_nic_net_xmit_hw() net: hns: Use NAPI_POLL_WEIGHT for hns driver net: hns: Fix WARNING when remove HNS driver with SMMU enabled hugetlbfs: fix memory leak for resv_map sh: fix multiple function definition build errors xsysace: Fix error handling in ace_setup ARM: orion: don't use using 64-bit DMA masks ARM: iop: don't use using 64-bit DMA masks perf/x86/amd: Update generic hardware cache events for Family 17h staging: iio: adt7316: allow adt751x to use internal vref for all dacs staging: iio: adt7316: fix the dac read calculation staging: iio: adt7316: fix the dac write calculation scsi: RDMA/srpt: Fix a credit leak for aborted commands Input: snvs_pwrkey - initialize necessary driver data before enabling IRQ selinux: never allow relabeling on context mounts x86/mce: Improve error message when kernel cannot recover, p2 media: v4l2: i2c: ov7670: Fix PLL bypass register values Linux 4.9.174 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
206 lines
5.1 KiB
C
206 lines
5.1 KiB
C
/*
|
|
* platform device definitions for the iop3xx dma/xor engines
|
|
* Copyright © 2006, Intel Corporation.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms and conditions of the GNU General Public License,
|
|
* version 2, as published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
* more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License along with
|
|
* this program; if not, write to the Free Software Foundation, Inc.,
|
|
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
|
*
|
|
*/
|
|
#include <linux/platform_device.h>
|
|
#include <asm/hardware/iop3xx.h>
|
|
#include <linux/dma-mapping.h>
|
|
#include <mach/adma.h>
|
|
#include <asm/hardware/iop_adma.h>
|
|
|
|
#ifdef CONFIG_ARCH_IOP32X
|
|
#define IRQ_DMA0_EOT IRQ_IOP32X_DMA0_EOT
|
|
#define IRQ_DMA0_EOC IRQ_IOP32X_DMA0_EOC
|
|
#define IRQ_DMA0_ERR IRQ_IOP32X_DMA0_ERR
|
|
|
|
#define IRQ_DMA1_EOT IRQ_IOP32X_DMA1_EOT
|
|
#define IRQ_DMA1_EOC IRQ_IOP32X_DMA1_EOC
|
|
#define IRQ_DMA1_ERR IRQ_IOP32X_DMA1_ERR
|
|
|
|
#define IRQ_AA_EOT IRQ_IOP32X_AA_EOT
|
|
#define IRQ_AA_EOC IRQ_IOP32X_AA_EOC
|
|
#define IRQ_AA_ERR IRQ_IOP32X_AA_ERR
|
|
#endif
|
|
#ifdef CONFIG_ARCH_IOP33X
|
|
#define IRQ_DMA0_EOT IRQ_IOP33X_DMA0_EOT
|
|
#define IRQ_DMA0_EOC IRQ_IOP33X_DMA0_EOC
|
|
#define IRQ_DMA0_ERR IRQ_IOP33X_DMA0_ERR
|
|
|
|
#define IRQ_DMA1_EOT IRQ_IOP33X_DMA1_EOT
|
|
#define IRQ_DMA1_EOC IRQ_IOP33X_DMA1_EOC
|
|
#define IRQ_DMA1_ERR IRQ_IOP33X_DMA1_ERR
|
|
|
|
#define IRQ_AA_EOT IRQ_IOP33X_AA_EOT
|
|
#define IRQ_AA_EOC IRQ_IOP33X_AA_EOC
|
|
#define IRQ_AA_ERR IRQ_IOP33X_AA_ERR
|
|
#endif
|
|
/* AAU and DMA Channels */
|
|
static struct resource iop3xx_dma_0_resources[] = {
|
|
[0] = {
|
|
.start = IOP3XX_DMA_PHYS_BASE(0),
|
|
.end = IOP3XX_DMA_UPPER_PA(0),
|
|
.flags = IORESOURCE_MEM,
|
|
},
|
|
[1] = {
|
|
.start = IRQ_DMA0_EOT,
|
|
.end = IRQ_DMA0_EOT,
|
|
.flags = IORESOURCE_IRQ
|
|
},
|
|
[2] = {
|
|
.start = IRQ_DMA0_EOC,
|
|
.end = IRQ_DMA0_EOC,
|
|
.flags = IORESOURCE_IRQ
|
|
},
|
|
[3] = {
|
|
.start = IRQ_DMA0_ERR,
|
|
.end = IRQ_DMA0_ERR,
|
|
.flags = IORESOURCE_IRQ
|
|
}
|
|
};
|
|
|
|
static struct resource iop3xx_dma_1_resources[] = {
|
|
[0] = {
|
|
.start = IOP3XX_DMA_PHYS_BASE(1),
|
|
.end = IOP3XX_DMA_UPPER_PA(1),
|
|
.flags = IORESOURCE_MEM,
|
|
},
|
|
[1] = {
|
|
.start = IRQ_DMA1_EOT,
|
|
.end = IRQ_DMA1_EOT,
|
|
.flags = IORESOURCE_IRQ
|
|
},
|
|
[2] = {
|
|
.start = IRQ_DMA1_EOC,
|
|
.end = IRQ_DMA1_EOC,
|
|
.flags = IORESOURCE_IRQ
|
|
},
|
|
[3] = {
|
|
.start = IRQ_DMA1_ERR,
|
|
.end = IRQ_DMA1_ERR,
|
|
.flags = IORESOURCE_IRQ
|
|
}
|
|
};
|
|
|
|
|
|
static struct resource iop3xx_aau_resources[] = {
|
|
[0] = {
|
|
.start = IOP3XX_AAU_PHYS_BASE,
|
|
.end = IOP3XX_AAU_UPPER_PA,
|
|
.flags = IORESOURCE_MEM,
|
|
},
|
|
[1] = {
|
|
.start = IRQ_AA_EOT,
|
|
.end = IRQ_AA_EOT,
|
|
.flags = IORESOURCE_IRQ
|
|
},
|
|
[2] = {
|
|
.start = IRQ_AA_EOC,
|
|
.end = IRQ_AA_EOC,
|
|
.flags = IORESOURCE_IRQ
|
|
},
|
|
[3] = {
|
|
.start = IRQ_AA_ERR,
|
|
.end = IRQ_AA_ERR,
|
|
.flags = IORESOURCE_IRQ
|
|
}
|
|
};
|
|
|
|
static u64 iop3xx_adma_dmamask = DMA_BIT_MASK(32);
|
|
|
|
static struct iop_adma_platform_data iop3xx_dma_0_data = {
|
|
.hw_id = DMA0_ID,
|
|
.pool_size = PAGE_SIZE,
|
|
};
|
|
|
|
static struct iop_adma_platform_data iop3xx_dma_1_data = {
|
|
.hw_id = DMA1_ID,
|
|
.pool_size = PAGE_SIZE,
|
|
};
|
|
|
|
static struct iop_adma_platform_data iop3xx_aau_data = {
|
|
.hw_id = AAU_ID,
|
|
.pool_size = 3 * PAGE_SIZE,
|
|
};
|
|
|
|
struct platform_device iop3xx_dma_0_channel = {
|
|
.name = "iop-adma",
|
|
.id = 0,
|
|
.num_resources = 4,
|
|
.resource = iop3xx_dma_0_resources,
|
|
.dev = {
|
|
.dma_mask = &iop3xx_adma_dmamask,
|
|
.coherent_dma_mask = DMA_BIT_MASK(32),
|
|
.platform_data = (void *) &iop3xx_dma_0_data,
|
|
},
|
|
};
|
|
|
|
struct platform_device iop3xx_dma_1_channel = {
|
|
.name = "iop-adma",
|
|
.id = 1,
|
|
.num_resources = 4,
|
|
.resource = iop3xx_dma_1_resources,
|
|
.dev = {
|
|
.dma_mask = &iop3xx_adma_dmamask,
|
|
.coherent_dma_mask = DMA_BIT_MASK(32),
|
|
.platform_data = (void *) &iop3xx_dma_1_data,
|
|
},
|
|
};
|
|
|
|
struct platform_device iop3xx_aau_channel = {
|
|
.name = "iop-adma",
|
|
.id = 2,
|
|
.num_resources = 4,
|
|
.resource = iop3xx_aau_resources,
|
|
.dev = {
|
|
.dma_mask = &iop3xx_adma_dmamask,
|
|
.coherent_dma_mask = DMA_BIT_MASK(32),
|
|
.platform_data = (void *) &iop3xx_aau_data,
|
|
},
|
|
};
|
|
|
|
static int __init iop3xx_adma_cap_init(void)
|
|
{
|
|
#ifdef CONFIG_ARCH_IOP32X /* the 32x DMA does not perform CRC32C */
|
|
dma_cap_set(DMA_MEMCPY, iop3xx_dma_0_data.cap_mask);
|
|
dma_cap_set(DMA_INTERRUPT, iop3xx_dma_0_data.cap_mask);
|
|
#else
|
|
dma_cap_set(DMA_MEMCPY, iop3xx_dma_0_data.cap_mask);
|
|
dma_cap_set(DMA_INTERRUPT, iop3xx_dma_0_data.cap_mask);
|
|
#endif
|
|
|
|
#ifdef CONFIG_ARCH_IOP32X /* the 32x DMA does not perform CRC32C */
|
|
dma_cap_set(DMA_MEMCPY, iop3xx_dma_1_data.cap_mask);
|
|
dma_cap_set(DMA_INTERRUPT, iop3xx_dma_1_data.cap_mask);
|
|
#else
|
|
dma_cap_set(DMA_MEMCPY, iop3xx_dma_1_data.cap_mask);
|
|
dma_cap_set(DMA_INTERRUPT, iop3xx_dma_1_data.cap_mask);
|
|
#endif
|
|
|
|
#ifdef CONFIG_ARCH_IOP32X /* the 32x AAU does not perform zero sum */
|
|
dma_cap_set(DMA_XOR, iop3xx_aau_data.cap_mask);
|
|
dma_cap_set(DMA_INTERRUPT, iop3xx_aau_data.cap_mask);
|
|
#else
|
|
dma_cap_set(DMA_XOR, iop3xx_aau_data.cap_mask);
|
|
dma_cap_set(DMA_XOR_VAL, iop3xx_aau_data.cap_mask);
|
|
dma_cap_set(DMA_INTERRUPT, iop3xx_aau_data.cap_mask);
|
|
#endif
|
|
|
|
return 0;
|
|
}
|
|
|
|
arch_initcall(iop3xx_adma_cap_init);
|