summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorKhoronzhuk, Ivan <ivan.khoronzhuk@ti.com>2014-09-05 19:02:46 +0300
committerTom Rini <trini@ti.com>2014-10-23 11:27:04 -0400
commited948e2959acbad5289de1c733b3aeddd93208fe (patch)
treed952f0cdd432a15c7bb5b50ea882d7e676c87eb7 /arch
parentafa479cf66dcc3e3648ff714d61995bf132d8ea9 (diff)
keystone2: keystone_nav: don't use hard addresses in netcp_pktdma
Use definitions in netcp_pktdma instead direct addresses. The definitions can be set specifically for SoC, so there is no reason to check SoC type while initialization. Acked-by: Vitaly Andrianov <vitalya@ti.com> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/cpu/armv7/keystone/keystone_nav.c39
-rw-r--r--arch/arm/include/asm/arch-keystone/hardware-k2hk.h13
-rw-r--r--arch/arm/include/asm/arch-keystone/keystone_nav.h4
3 files changed, 27 insertions, 29 deletions
diff --git a/arch/arm/cpu/armv7/keystone/keystone_nav.c b/arch/arm/cpu/armv7/keystone/keystone_nav.c
index 5219f84bfb..46483b185d 100644
--- a/arch/arm/cpu/armv7/keystone/keystone_nav.c
+++ b/arch/arm/cpu/armv7/keystone/keystone_nav.c
@@ -10,11 +10,6 @@
#include <asm/io.h>
#include <asm/arch/keystone_nav.h>
-static int soc_type =
-#ifdef CONFIG_SOC_K2HK
- k2hk;
-#endif
-
struct qm_config qm_memmap = {
.stat_cfg = KS2_QM_QUEUE_STATUS_BASE,
.queue = (void *)KS2_QM_MANAGER_QUEUES_BASE,
@@ -158,22 +153,21 @@ void queue_close(u32 qnum)
;
}
-/*
+/**
* DMA API
*/
-
-struct pktdma_cfg k2hk_netcp_pktdma = {
- .global = (struct global_ctl_regs *)0x02004000,
- .tx_ch = (struct tx_chan_regs *)0x02004400,
- .tx_ch_num = 9,
- .rx_ch = (struct rx_chan_regs *)0x02004800,
- .rx_ch_num = 26,
- .tx_sched = (u32 *)0x02004c00,
- .rx_flows = (struct rx_flow_regs *)0x02005000,
- .rx_flow_num = 32,
- .rx_free_q = 4001,
- .rx_rcv_q = 4002,
- .tx_snd_q = 648,
+struct pktdma_cfg netcp_pktdma = {
+ .global = (void *)KS2_NETCP_PDMA_CTRL_BASE,
+ .tx_ch = (void *)KS2_NETCP_PDMA_TX_BASE,
+ .tx_ch_num = KS2_NETCP_PDMA_TX_CH_NUM,
+ .rx_ch = (void *)KS2_NETCP_PDMA_RX_BASE,
+ .rx_ch_num = KS2_NETCP_PDMA_RX_CH_NUM,
+ .tx_sched = (u32 *)KS2_NETCP_PDMA_SCHED_BASE,
+ .rx_flows = (void *)KS2_NETCP_PDMA_RX_FLOW_BASE,
+ .rx_flow_num = KS2_NETCP_PDMA_RX_FLOW_NUM,
+ .rx_free_q = KS2_NETCP_PDMA_RX_FREE_QUEUE,
+ .rx_rcv_q = KS2_NETCP_PDMA_RX_RCV_QUEUE,
+ .tx_snd_q = KS2_NETCP_PDMA_TX_SND_QUEUE,
};
struct pktdma_cfg *netcp;
@@ -300,12 +294,7 @@ static int _netcp_init(struct pktdma_cfg *netcp_cfg,
int netcp_init(struct rx_buff_desc *rx_buffers)
{
- switch (soc_type) {
- case k2hk:
- _netcp_init(&k2hk_netcp_pktdma, rx_buffers);
- return QM_OK;
- }
- return QM_ERR;
+ return _netcp_init(&netcp_pktdma, rx_buffers);
}
int netcp_close(void)
diff --git a/arch/arm/include/asm/arch-keystone/hardware-k2hk.h b/arch/arm/include/asm/arch-keystone/hardware-k2hk.h
index eb132f73e6..43c2c42d8e 100644
--- a/arch/arm/include/asm/arch-keystone/hardware-k2hk.h
+++ b/arch/arm/include/asm/arch-keystone/hardware-k2hk.h
@@ -84,4 +84,17 @@
/* Number of DSP cores */
#define KS2_NUM_DSPS 8
+/* NETCP pktdma */
+#define KS2_NETCP_PDMA_CTRL_BASE 0x02004000
+#define KS2_NETCP_PDMA_TX_BASE 0x02004400
+#define KS2_NETCP_PDMA_TX_CH_NUM 9
+#define KS2_NETCP_PDMA_RX_BASE 0x02004800
+#define KS2_NETCP_PDMA_RX_CH_NUM 26
+#define KS2_NETCP_PDMA_SCHED_BASE 0x02004c00
+#define KS2_NETCP_PDMA_RX_FLOW_BASE 0x02005000
+#define KS2_NETCP_PDMA_RX_FLOW_NUM 32
+#define KS2_NETCP_PDMA_RX_FREE_QUEUE 4001
+#define KS2_NETCP_PDMA_RX_RCV_QUEUE 4002
+#define KS2_NETCP_PDMA_TX_SND_QUEUE 648
+
#endif /* __ASM_ARCH_HARDWARE_H */
diff --git a/arch/arm/include/asm/arch-keystone/keystone_nav.h b/arch/arm/include/asm/arch-keystone/keystone_nav.h
index ab81eaf1fd..646c2f3a56 100644
--- a/arch/arm/include/asm/arch-keystone/keystone_nav.h
+++ b/arch/arm/include/asm/arch-keystone/keystone_nav.h
@@ -13,10 +13,6 @@
#include <asm/arch/hardware.h>
#include <asm/io.h>
-enum soc_type_t {
- k2hk
-};
-
#define QM_OK 0
#define QM_ERR -1
#define QM_DESC_TYPE_HOST 0