Commit 5325e65cd2d3fc884bccc7e2b9526e4c384cb801
Committed by
Lokesh Vutla
1 parent
c5e13e1cad
Exists in
v2015.07-smarct4x
and in
3 other branches
keystone2: use appropriate HD field for destination port
[https://patchwork.ozlabs.org/patch/492997/] K2L and L2E have different from K2HK EthSS version, which uses tag_info field for destination slave port. This commit configures appropriate BD filed tag_info or pkt_info depending on navigator HW version. Before that commit the swinfo[2] was used for that purpose. Even if that worked on K2HK devices, the correct field for K2HK is the pkt_info. Signed-off-by: Vitaly Andrianov <vitalya@ti.com> Acked-by: Murali Karicheri <m-karicheri2@ti.com>
Showing 3 changed files with 15 additions and 5 deletions Side-by-side Diff
arch/arm/include/asm/ti-common/keystone_nav.h
... | ... | @@ -184,7 +184,8 @@ |
184 | 184 | |
185 | 185 | int ksnav_close(struct pktdma_cfg *pktdma); |
186 | 186 | int ksnav_init(struct pktdma_cfg *pktdma, struct rx_buff_desc *rx_buffers); |
187 | -int ksnav_send(struct pktdma_cfg *pktdma, u32 *pkt, int num_bytes, u32 swinfo2); | |
187 | +int ksnav_send(struct pktdma_cfg *pktdma, u32 *pkt, int num_bytes, | |
188 | + u32 dest_port); | |
188 | 189 | void *ksnav_recv(struct pktdma_cfg *pktdma, u32 **pkt, int *num_bytes); |
189 | 190 | void ksnav_release_rxhd(struct pktdma_cfg *pktdma, void *hd); |
190 | 191 |
drivers/dma/keystone_nav.c
... | ... | @@ -278,7 +278,8 @@ |
278 | 278 | return QM_OK; |
279 | 279 | } |
280 | 280 | |
281 | -int ksnav_send(struct pktdma_cfg *pktdma, u32 *pkt, int num_bytes, u32 swinfo2) | |
281 | +int ksnav_send(struct pktdma_cfg *pktdma, u32 *pkt, int num_bytes, | |
282 | + u32 dest_port) | |
282 | 283 | { |
283 | 284 | struct qm_host_desc *hd; |
284 | 285 | |
285 | 286 | |
... | ... | @@ -286,8 +287,17 @@ |
286 | 287 | if (hd == NULL) |
287 | 288 | return QM_ERR; |
288 | 289 | |
290 | + dest_port &= 0xf; | |
289 | 291 | hd->desc_info = num_bytes; |
290 | - hd->swinfo[2] = swinfo2; | |
292 | +#if defined CONFIG_KSNET_NETCP_V1_0 | |
293 | + hd->packet_info = qm_cfg->qpool_num | (dest_port << 16); | |
294 | +#elif defined CONFIG_KSNET_NETCP_V1_5 | |
295 | + hd->packet_info = qm_cfg->qpool_num; | |
296 | + hd->tag_info = dest_port; | |
297 | +#else | |
298 | +#error "Unknown NETCP version" | |
299 | +#endif | |
300 | + | |
291 | 301 | hd->packet_info = qm_cfg->qpool_num; |
292 | 302 | |
293 | 303 | qm_buff_push(hd, pktdma->tx_snd_q, pkt, num_bytes); |
drivers/net/keystone_net.c
... | ... | @@ -381,8 +381,7 @@ |
381 | 381 | if (num_bytes < EMAC_MIN_ETHERNET_PKT_SIZE) |
382 | 382 | num_bytes = EMAC_MIN_ETHERNET_PKT_SIZE; |
383 | 383 | |
384 | - return ksnav_send(&netcp_pktdma, buffer, | |
385 | - num_bytes, (slave_port_num) << 16); | |
384 | + return ksnav_send(&netcp_pktdma, buffer, num_bytes, slave_port_num); | |
386 | 385 | } |
387 | 386 | |
388 | 387 | /* Eth device open */ |