From 1730a17db9a9ce21380ba99eb4d2f10884186cca Mon Sep 17 00:00:00 2001 From: Prabhakar Kushwaha Date: Wed, 4 Nov 2015 12:25:59 +0530 Subject: driver: net: fsl-mc: Create DPAA2 object at run-time Freescale's DPAA2 ethernet driver depends upon the static DPL for the DPRC, DPNI, DPBP, DPIO objects. Instead of static objects, Create DPNI, DPBP, DPIO objects at run-time. Signed-off-by: Prabhakar Kushwaha Reviewed-by: York Sun --- include/fsl-mc/fsl_mc.h | 5 ++++- include/fsl-mc/fsl_mc_private.h | 23 +++++++++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) (limited to 'include/fsl-mc') diff --git a/include/fsl-mc/fsl_mc.h b/include/fsl-mc/fsl_mc.h index c8f168a..ffe6da5 100644 --- a/include/fsl-mc/fsl_mc.h +++ b/include/fsl-mc/fsl_mc.h @@ -29,6 +29,9 @@ ((void __iomem *)((uintptr_t)SOC_MC_PORTALS_BASE_ADDR + \ (_portal_id) * SOC_MC_PORTAL_STRIDE)) +#define MC_PORTAL_OFFSET_TO_PORTAL_ID(_portal_offset) \ + ((_portal_offset) / SOC_MC_PORTAL_STRIDE) + struct mc_ccsr_registers { u32 reg_gcr1; u32 reserved1; @@ -57,5 +60,5 @@ int get_aiop_apply_status(void); u64 mc_get_dram_addr(void); unsigned long mc_get_dram_block_size(void); int fsl_mc_ldpaa_init(bd_t *bis); -void fsl_mc_ldpaa_exit(bd_t *bis); +int fsl_mc_ldpaa_exit(bd_t *bd); #endif diff --git a/include/fsl-mc/fsl_mc_private.h b/include/fsl-mc/fsl_mc_private.h index 9421362..191783a 100644 --- a/include/fsl-mc/fsl_mc_private.h +++ b/include/fsl-mc/fsl_mc_private.h @@ -18,13 +18,14 @@ #include #include #include +#include extern struct fsl_mc_io *dflt_mc_io; /** * struct dpbp_node - DPBP strucuture * @uint16_t handle: DPBP object handle - * @int dpbp_id: DPBP id + * @struct dpbp_attr: DPBP attribute */ struct fsl_dpbp_obj { uint16_t dpbp_handle; @@ -40,11 +41,29 @@ extern struct fsl_dpbp_obj *dflt_dpbp; */ struct fsl_dpio_obj { int dpio_id; + uint16_t dpio_handle; struct qbman_swp *sw_portal; /** SW portal object */ }; extern struct fsl_dpio_obj *dflt_dpio; +/** + * struct dpni_node - DPNI strucuture + * @int dpni_id: DPNI id + * @uint16_t handle: DPNI object handle + * @struct dpni_attr: DPNI attributes + * @struct dpni_buffer_layout: DPNI buffer layout + */ +struct fsl_dpni_obj { + int dpni_id; + uint16_t dpni_handle; + struct dpni_attr dpni_attrs; + struct dpni_buffer_layout buf_layout; +}; + +extern struct fsl_dpni_obj *dflt_dpni; + int mc_init(u64 mc_fw_addr, u64 mc_dpc_addr); -int ldpaa_eth_init(struct dprc_obj_desc obj_desc); +int ldpaa_eth_init(int dpmac_id); +int mc_apply_dpl(u64 mc_dpl_addr); #endif /* _FSL_MC_PRIVATE_H_ */ -- cgit v1.1