Lines Matching +full:qman +full:- +full:portal +full:- +full:1
1 /*-
8 * 1. Redistributions of source code must retain the above copyright
48 #include "qman.h"
67 /* Map bman portal to physical address space */ in qman_portals_attach()
68 if (law_enable(OCP85XX_TGTIF_QMAN, sc->sc_dp_pa, sc->sc_dp_size)) { in qman_portals_attach()
72 /* Set portal properties for XX_VirtToPhys() */ in qman_portals_attach()
88 for (i = 0; i < ARRAY_SIZE(sc->sc_dp); i++) { in qman_portals_detach()
89 if (sc->sc_dp[i].dp_ph != NULL) { in qman_portals_detach()
94 QM_PORTAL_Free(sc->sc_dp[i].dp_ph); in qman_portals_detach()
101 if (sc->sc_dp[i].dp_ires != NULL) { in qman_portals_detach()
102 XX_DeallocIntr((uintptr_t)sc->sc_dp[i].dp_ires); in qman_portals_detach()
104 sc->sc_dp[i].dp_irid, sc->sc_dp[i].dp_ires); in qman_portals_detach()
107 for (i = 0; i < ARRAY_SIZE(sc->sc_rres); i++) { in qman_portals_detach()
108 if (sc->sc_rres[i] != NULL) in qman_portals_detach()
110 sc->sc_rrid[i], in qman_portals_detach()
111 sc->sc_rres[i]); in qman_portals_detach()
124 t_Handle portal; in qman_portal_setup() local
133 portal = NULL; in qman_portal_setup()
136 /* Check if portal is ready */ in qman_portal_setup()
137 while (atomic_cmpset_acq_ptr((uintptr_t *)&sc->sc_dp[cpu].dp_ph, in qman_portal_setup()
138 0, -1) == 0) { in qman_portal_setup()
139 p = atomic_load_acq_ptr((uintptr_t *)&sc->sc_dp[cpu].dp_ph); in qman_portal_setup()
141 /* Return if portal is already initialized */ in qman_portal_setup()
142 if (p != 0 && p != -1) { in qman_portal_setup()
151 /* Map portal registers */ in qman_portal_setup()
154 /* Configure and initialize portal */ in qman_portal_setup()
155 qpp.ceBaseAddress = rman_get_bushandle(sc->sc_rres[0]); in qman_portal_setup()
156 qpp.ciBaseAddress = rman_get_bushandle(sc->sc_rres[1]); in qman_portal_setup()
157 qpp.h_Qm = qsc->sc_qh; in qman_portal_setup()
159 qpp.irq = (uintptr_t)sc->sc_dp[cpu].dp_ires; in qman_portal_setup()
165 portal = QM_PORTAL_Config(&qpp); in qman_portal_setup()
166 if (portal == NULL) in qman_portal_setup()
169 if (QM_PORTAL_Init(portal) != E_OK) in qman_portal_setup()
172 if (QM_PORTAL_AddPoolChannel(portal, QMAN_COMMON_POOL_CHANNEL) != E_OK) in qman_portal_setup()
175 atomic_store_rel_ptr((uintptr_t *)&sc->sc_dp[cpu].dp_ph, in qman_portal_setup()
176 (uintptr_t)portal); in qman_portal_setup()
179 return (portal); in qman_portal_setup()
182 if (portal != NULL) in qman_portal_setup()
183 QM_PORTAL_Free(portal); in qman_portal_setup()
185 atomic_store_rel_32((uint32_t *)&sc->sc_dp[cpu].dp_ph, 0); in qman_portal_setup()