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