1 /* 2 * Copyright (C) 2014 Freescale Semiconductor 3 * 4 * SPDX-License-Identifier: GPL-2.0+ 5 */ 6 7 #ifndef _FSL_MC_PRIVATE_H_ 8 #define _FSL_MC_PRIVATE_H_ 9 10 #include <errno.h> 11 #include <malloc.h> 12 #include <asm/io.h> 13 #include <linux/compat.h> 14 #include <linux/types.h> 15 #include <linux/stringify.h> 16 #include <phy.h> 17 18 #include <fsl-mc/fsl_mc_sys.h> 19 #include <fsl-mc/fsl_mc_cmd.h> 20 #include <fsl-mc/fsl_dprc.h> 21 #include <fsl-mc/fsl_dpbp.h> 22 #include <fsl-mc/fsl_dpni.h> 23 24 extern struct fsl_mc_io *dflt_mc_io; 25 26 /** 27 * struct dpbp_node - DPBP strucuture 28 * @uint16_t handle: DPBP object handle 29 * @struct dpbp_attr: DPBP attribute 30 */ 31 struct fsl_dpbp_obj { 32 uint16_t dpbp_handle; 33 struct dpbp_attr dpbp_attr; 34 }; 35 36 extern struct fsl_dpbp_obj *dflt_dpbp; 37 38 /** 39 * struct fsl_dpio_obj - DPIO strucuture 40 * @int dpio_id: DPIO id 41 * @struct qbman_swp *sw_portal: SW portal object 42 */ 43 struct fsl_dpio_obj { 44 int dpio_id; 45 uint16_t dpio_handle; 46 struct qbman_swp *sw_portal; /** SW portal object */ 47 }; 48 49 extern struct fsl_dpio_obj *dflt_dpio; 50 51 /** 52 * struct dpni_node - DPNI strucuture 53 * @int dpni_id: DPNI id 54 * @uint16_t handle: DPNI object handle 55 * @struct dpni_attr: DPNI attributes 56 * @struct dpni_buffer_layout: DPNI buffer layout 57 */ 58 struct fsl_dpni_obj { 59 int dpni_id; 60 uint16_t dpni_handle; 61 struct dpni_attr dpni_attrs; 62 struct dpni_buffer_layout buf_layout; 63 }; 64 65 extern struct fsl_dpni_obj *dflt_dpni; 66 67 int mc_init(u64 mc_fw_addr, u64 mc_dpc_addr); 68 int ldpaa_eth_init(int dpmac_id, phy_interface_t enet_if); 69 int mc_apply_dpl(u64 mc_dpl_addr); 70 #endif /* _FSL_MC_PRIVATE_H_ */ 71