get rid of immrbar_virt_to_phys()
Subsystems (5)
cover get rid of immrbar_virt_to_phys()
ucc_geth ethernet driver is the only driver using immrbar_virt_to_phys() and it uses it incorrectly.
This patch fixes ucc_geth driver then removes immrbar_virt_to_phys()
Christophe Leroy (2):
net: ethernet: ucc_geth: fix MEM_PART_MURAM mode soc/fsl/qe: get rid of immrbar_virt_to_phys()
drivers/net/ethernet/freescale/ucc_geth.c | 8 +++----- drivers/soc/fsl/qe/qe.c | 2 -- include/soc/fsl/qe/immap_qe.h | 19 ------------------- include/soc/fsl/qe/qe.h | 1 + 4 files changed, 4 insertions(+), 26 deletions(-)
Signature · 1 line
2.10.1
PATCH 1/2 net: ethernet: ucc_geth: fix MEM_PART_MURAM mode
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.
--- drivers/net/ethernet/freescale/ucc_geth.c | 8 +++----- include/soc/fsl/qe/qe.h | 1 + 2 files changed, 4 insertions(+), 5 deletions(-)
drivers/net/ethernet/freescale/ucc_geth.c +3 -5
@@ -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 */ }
include/soc/fsl/qe/qe.h +1 -0
@@ -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))
Signature · 1 line
2.10.1
Re: [PATCH 1/2] net: ethernet: ucc_geth: fix MEM_PART_MURAM mode
Le 07/02/2017 ? 10:05, Christophe Leroy a ?crit :
Quoted 52 lines
Since commit
5093bb965a163("powerpc/QE: switch to thecpm_muramimplementation"), muram area is not part of immrbar mapping anymore soimmrbar_virt_to_phys()is not usable anymore.Fixes 5093bb965a163 ("powerpc/QE: switch to the cpm_muram implementation)Signed-off-by Christophe Leroy <[email protected]>--- drivers/net/ethernet/freescale/ucc_geth.c | 8 +++----- include/soc/fsl/qe/qe.h | 1 + 2 files changed, 4 insertions(+), 5 deletions(-)drivers/net/ethernet/freescale/ucc_geth.c +3
-5@@ -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 */ }include/soc/fsl/qe/qe.h +1
-0@@ -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))
Re: [PATCH 1/2] net: ethernet: ucc_geth: fix MEM_PART_MURAM mode
In reply to Christophe LeroyQuoted 6 lines · Christophe Leroy
Since commit
5093bb965a163("powerpc/QE: switch to thecpm_muramimplementation"), muram area is not part of immrbar mapping anymore soimmrbar_virt_to_phys()is not usable anymore.Fixes 5093bb965a163 ("powerpc/QE: switch to the cpm_muram implementation)Signed-off-by Christophe Leroy <[email protected]>
Regards,
Leo
PATCH 2/2 soc/fsl/qe: get rid of immrbar_virt_to_phys()
In reply to Christophe Leroyimmrbar_virt_to_phys() is not used anymore
--- drivers/soc/fsl/qe/qe.c | 4 +--- include/soc/fsl/qe/immap_qe.h | 19 ------------------- 2 files changed, 1 insertion(+), 22 deletions(-)
drivers/soc/fsl/qe/qe.c +1 -3
@@ -66,7 +66,7 @@ static unsigned int qe_num_of_snum;static phys_addr_t qebase =-1 ; -phys_addr_t get_qe_base (void ) +static phys_addr_t get_qe_base (void ) {struct device_node *qe;int ret;
@@ -90,8 +90,6 @@ phys_addr_t get_qe_base(void)return qebase; } -EXPORT_SYMBOL (get_qe_base); -void qe_reset (void ) {if (qe_immr ==NULL )
include/soc/fsl/qe/immap_qe.h +0 -19
@@ -464,25 +464,6 @@ struct qe_immap { } __attribute__ ((packed));extern struct qe_immap __iomem *qe_immr; -extern phys_addr_t get_qe_base (void ); - -/* -* Returns the offset within the QE address space of the given pointer. -* -* Note that the QE does not support 36-bit physical addresses, so if -* get_qe_base() returns a number above 4GB, the caller will probably fail. -*/ -static inline phys_addr_t immrbar_virt_to_phys (void *address) -{ -void *q = (void *)qe_immr; - -/* Is it a MURAM address? */ -if ((address >= q) && (address < (q +QE_IMMAP_SIZE ))) -return get_qe_base () + (address - q); - -/* It's an address returned by kmalloc */ -return virt_to_phys (address); -}#endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_IMMAP_QE_H */
Signature · 1 line
2.10.1
Re: [PATCH 2/2] soc/fsl/qe: get rid of immrbar_virt_to_phys()
Quoted 3 lines · Christophe Leroy
immrbar_virt_to_phys()is not used anymoreSigned-off-by Christophe Leroy <[email protected]>
Regards,
Leo
From: Christophe Leroy <[email protected]>
Date: Tue, 7 Feb 2017 10:05:07 +0100 (CET)
Quoted 3 lines
ucc_gethethernet driver is the only driver usingimmrbar_virt_to_phys()and it uses it incorrectly.This patch fixes
ucc_gethdriver then removesimmrbar_virt_to_phys()
Feel free to merge this via whatever tree handles that SOC fsl driver.