| b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | From d0e3e315f49a0a35c7e0bdae934f33ee6b3042a0 Mon Sep 17 00:00:00 2001 |
| 2 | From: Roy Pledge <roy.pledge@nxp.com> |
| 3 | Date: Wed, 1 May 2019 16:08:53 -0400 |
| 4 | Subject: [PATCH] sdk_dpaa: Rework QBMan portal mappings |
| 5 | |
| 6 | Rework the QBMan portal mappings in the SDK driver to |
| 7 | match the mechanism used in the upstream varient. |
| 8 | |
| 9 | Signed-off-by: Roy Pledge <roy.pledge@nxp.com> |
| 10 | --- |
| 11 | drivers/staging/fsl_qbman/bman_driver.c | 16 ++++++++-------- |
| 12 | drivers/staging/fsl_qbman/qman_driver.c | 17 +++++++++-------- |
| 13 | 2 files changed, 17 insertions(+), 16 deletions(-) |
| 14 | |
| 15 | --- a/drivers/staging/fsl_qbman/bman_driver.c |
| 16 | +++ b/drivers/staging/fsl_qbman/bman_driver.c |
| 17 | @@ -199,14 +199,14 @@ static struct bm_portal_config * __init |
| 18 | resource_size(&pcfg->addr_phys[DPA_PORTAL_CI])); |
| 19 | |
| 20 | #else |
| 21 | - pcfg->addr_virt[DPA_PORTAL_CE] = ioremap_prot( |
| 22 | - pcfg->addr_phys[DPA_PORTAL_CE].start, |
| 23 | - (unsigned long)len, |
| 24 | - 0); |
| 25 | - pcfg->addr_virt[DPA_PORTAL_CI] = ioremap_prot( |
| 26 | - pcfg->addr_phys[DPA_PORTAL_CI].start, |
| 27 | - resource_size(&pcfg->addr_phys[DPA_PORTAL_CI]), |
| 28 | - _PAGE_GUARDED | _PAGE_NO_CACHE); |
| 29 | + pcfg->addr_virt[DPA_PORTAL_CE] = |
| 30 | + memremap(pcfg->addr_phys[DPA_PORTAL_CE].start, |
| 31 | + (unsigned long)len, MEMREMAP_WB); |
| 32 | + |
| 33 | + pcfg->addr_virt[DPA_PORTAL_CI] = |
| 34 | + ioremap(pcfg->addr_phys[DPA_PORTAL_CI].start, |
| 35 | + resource_size(&pcfg->addr_phys[DPA_PORTAL_CI])); |
| 36 | + |
| 37 | #endif |
| 38 | /* disable bp depletion */ |
| 39 | __raw_writel(0x0, pcfg->addr_virt[DPA_PORTAL_CI] + BM_REG_SCN(0)); |
| 40 | --- a/drivers/staging/fsl_qbman/qman_driver.c |
| 41 | +++ b/drivers/staging/fsl_qbman/qman_driver.c |
| 42 | @@ -459,14 +459,15 @@ static struct qm_portal_config * __init |
| 43 | pcfg->addr_phys[DPA_PORTAL_CI].start, |
| 44 | resource_size(&pcfg->addr_phys[DPA_PORTAL_CI])); |
| 45 | #else |
| 46 | - pcfg->addr_virt[DPA_PORTAL_CE] = ioremap_prot( |
| 47 | - pcfg->addr_phys[DPA_PORTAL_CE].start, |
| 48 | - (unsigned long)len, |
| 49 | - 0); |
| 50 | - pcfg->addr_virt[DPA_PORTAL_CI] = ioremap_prot( |
| 51 | - pcfg->addr_phys[DPA_PORTAL_CI].start, |
| 52 | - resource_size(&pcfg->addr_phys[DPA_PORTAL_CI]), |
| 53 | - _PAGE_GUARDED | _PAGE_NO_CACHE); |
| 54 | + |
| 55 | + pcfg->addr_virt[DPA_PORTAL_CE] = |
| 56 | + memremap(pcfg->addr_phys[DPA_PORTAL_CE].start, |
| 57 | + (unsigned long)len, MEMREMAP_WB); |
| 58 | + |
| 59 | + pcfg->addr_virt[DPA_PORTAL_CI] = |
| 60 | + ioremap(pcfg->addr_phys[DPA_PORTAL_CI].start, |
| 61 | + resource_size(&pcfg->addr_phys[DPA_PORTAL_CI])); |
| 62 | + |
| 63 | #endif |
| 64 | return pcfg; |
| 65 | err: |