OSDN Git Service

net: ethernet: ucc_geth: fix MEM_PART_MURAM mode
authorChristophe Leroy <christophe.leroy@c-s.fr>
Tue, 7 Feb 2017 09:05:09 +0000 (10:05 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 24 Mar 2018 10:00:19 +0000 (11:00 +0100)
[ Upstream commit 8b8642af15ed14b9a7a34d3401afbcc274533e13 ]

Since commit 5093bb965a163 ("powerpc/QE: switch to the cpm_muram
implementation"), muram area is not part of immrbar mapping anymore
so immrbar_virt_to_phys() is not usable anymore.

Fixes: 5093bb965a163 ("powerpc/QE: switch to the cpm_muram implementation")
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Li Yang <pku.leo@gmail.com>
Signed-off-by: Scott Wood <oss@buserror.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/freescale/ucc_geth.c
include/soc/fsl/qe/qe.h

index f76d332..ef9bc26 100644 (file)
@@ -2594,11 +2594,10 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
                } else if (ugeth->ug_info->uf_info.bd_mem_part ==
                           MEM_PART_MURAM) {
                        out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].bd_ring_base,
-                                (u32) immrbar_virt_to_phys(ugeth->
-                                                           p_tx_bd_ring[i]));
+                                (u32)qe_muram_dma(ugeth->p_tx_bd_ring[i]));
                        out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].
                                 last_bd_completed_address,
-                                (u32) immrbar_virt_to_phys(endOfRing));
+                                (u32)qe_muram_dma(endOfRing));
                }
        }
 
@@ -2844,8 +2843,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
                } else if (ugeth->ug_info->uf_info.bd_mem_part ==
                           MEM_PART_MURAM) {
                        out_be32(&ugeth->p_rx_bd_qs_tbl[i].externalbdbaseptr,
-                                (u32) immrbar_virt_to_phys(ugeth->
-                                                           p_rx_bd_ring[i]));
+                                (u32)qe_muram_dma(ugeth->p_rx_bd_ring[i]));
                }
                /* rest of fields handled by QE */
        }
index 70339d7..0cd4c11 100644 (file)
@@ -243,6 +243,7 @@ static inline int qe_alive_during_sleep(void)
 #define qe_muram_free cpm_muram_free
 #define qe_muram_addr cpm_muram_addr
 #define qe_muram_offset cpm_muram_offset
+#define qe_muram_dma cpm_muram_dma
 
 #define qe_setbits32(_addr, _v) iowrite32be(ioread32be(_addr) |  (_v), (_addr))
 #define qe_clrbits32(_addr, _v) iowrite32be(ioread32be(_addr) & ~(_v), (_addr))