Prabhakar Kushwaha | cfd9fbf | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 1 | /* |
Yogesh Gaur | 318c32f | 2017-11-15 11:59:31 +0530 | [diff] [blame^] | 2 | * Copyright (C) 2014-2016 Freescale Semiconductor |
| 3 | * Copyright 2017 NXP |
Prabhakar Kushwaha | cfd9fbf | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 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> |
Prabhakar Kushwaha | 52d2e2c | 2015-11-04 12:26:00 +0530 | [diff] [blame] | 17 | #include <phy.h> |
Prabhakar Kushwaha | cfd9fbf | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 18 | |
| 19 | #include <fsl-mc/fsl_mc_sys.h> |
| 20 | #include <fsl-mc/fsl_mc_cmd.h> |
Prabhakar Kushwaha | 5350b99 | 2015-03-19 09:20:46 -0700 | [diff] [blame] | 21 | #include <fsl-mc/fsl_dprc.h> |
Prabhakar Kushwaha | cfd9fbf | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 22 | #include <fsl-mc/fsl_dpbp.h> |
Prabhakar Kushwaha | 316b71c | 2015-11-04 12:25:59 +0530 | [diff] [blame] | 23 | #include <fsl-mc/fsl_dpni.h> |
Prabhakar Kushwaha | cfd9fbf | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 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 |
Prabhakar Kushwaha | 316b71c | 2015-11-04 12:25:59 +0530 | [diff] [blame] | 30 | * @struct dpbp_attr: DPBP attribute |
Prabhakar Kushwaha | cfd9fbf | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 31 | */ |
| 32 | struct fsl_dpbp_obj { |
Yogesh Gaur | 318c32f | 2017-11-15 11:59:31 +0530 | [diff] [blame^] | 33 | uint32_t dpbp_id; |
Prabhakar Kushwaha | cfd9fbf | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 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 { |
Yogesh Gaur | 318c32f | 2017-11-15 11:59:31 +0530 | [diff] [blame^] | 46 | uint32_t dpio_id; |
Prabhakar Kushwaha | 316b71c | 2015-11-04 12:25:59 +0530 | [diff] [blame] | 47 | uint16_t dpio_handle; |
Prabhakar Kushwaha | cfd9fbf | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 48 | struct qbman_swp *sw_portal; /** SW portal object */ |
| 49 | }; |
| 50 | |
| 51 | extern struct fsl_dpio_obj *dflt_dpio; |
| 52 | |
Prabhakar Kushwaha | 316b71c | 2015-11-04 12:25:59 +0530 | [diff] [blame] | 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 { |
Yogesh Gaur | 318c32f | 2017-11-15 11:59:31 +0530 | [diff] [blame^] | 61 | uint32_t dpni_id; |
Prabhakar Kushwaha | 316b71c | 2015-11-04 12:25:59 +0530 | [diff] [blame] | 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 | |
Prabhakar Kushwaha | 29a63e4 | 2015-11-04 12:25:58 +0530 | [diff] [blame] | 69 | int mc_init(u64 mc_fw_addr, u64 mc_dpc_addr); |
Prabhakar Kushwaha | 52d2e2c | 2015-11-04 12:26:00 +0530 | [diff] [blame] | 70 | int ldpaa_eth_init(int dpmac_id, phy_interface_t enet_if); |
Prabhakar Kushwaha | 316b71c | 2015-11-04 12:25:59 +0530 | [diff] [blame] | 71 | int mc_apply_dpl(u64 mc_dpl_addr); |
Prabhakar Kushwaha | cfd9fbf | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 72 | #endif /* _FSL_MC_PRIVATE_H_ */ |