Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Prabhakar Kushwaha | a2a55e5 | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 2 | /* |
Yogesh Gaur | a6f2a6e | 2018-05-09 10:52:17 +0530 | [diff] [blame] | 3 | * Copyright 2014-2016 Freescale Semiconductor, Inc. |
Florinel Iordache | 1990cc7 | 2019-11-19 10:28:17 +0000 | [diff] [blame] | 4 | * Copyright 2017-2018 NXP |
Prabhakar Kushwaha | a2a55e5 | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 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> |
Prabhakar Kushwaha | c919ab9 | 2015-11-04 12:26:00 +0530 | [diff] [blame] | 16 | #include <phy.h> |
Prabhakar Kushwaha | a2a55e5 | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 17 | |
| 18 | #include <fsl-mc/fsl_mc_sys.h> |
| 19 | #include <fsl-mc/fsl_mc_cmd.h> |
Prabhakar Kushwaha | c517771 | 2015-03-19 09:20:46 -0700 | [diff] [blame] | 20 | #include <fsl-mc/fsl_dprc.h> |
Prabhakar Kushwaha | a2a55e5 | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 21 | #include <fsl-mc/fsl_dpbp.h> |
Prabhakar Kushwaha | 1730a17 | 2015-11-04 12:25:59 +0530 | [diff] [blame] | 22 | #include <fsl-mc/fsl_dpni.h> |
Prabhakar Kushwaha | a2a55e5 | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 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 |
Prabhakar Kushwaha | 1730a17 | 2015-11-04 12:25:59 +0530 | [diff] [blame] | 29 | * @struct dpbp_attr: DPBP attribute |
Prabhakar Kushwaha | a2a55e5 | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 30 | */ |
| 31 | struct fsl_dpbp_obj { |
Yogesh Gaur | 2557c5a | 2017-11-15 11:59:31 +0530 | [diff] [blame] | 32 | uint32_t dpbp_id; |
Prabhakar Kushwaha | a2a55e5 | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 33 | uint16_t dpbp_handle; |
| 34 | struct dpbp_attr dpbp_attr; |
| 35 | }; |
| 36 | |
| 37 | extern struct fsl_dpbp_obj *dflt_dpbp; |
| 38 | |
| 39 | /** |
| 40 | * struct fsl_dpio_obj - DPIO strucuture |
| 41 | * @int dpio_id: DPIO id |
| 42 | * @struct qbman_swp *sw_portal: SW portal object |
| 43 | */ |
| 44 | struct fsl_dpio_obj { |
Yogesh Gaur | 2557c5a | 2017-11-15 11:59:31 +0530 | [diff] [blame] | 45 | uint32_t dpio_id; |
Prabhakar Kushwaha | 1730a17 | 2015-11-04 12:25:59 +0530 | [diff] [blame] | 46 | uint16_t dpio_handle; |
Prabhakar Kushwaha | a2a55e5 | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 47 | struct qbman_swp *sw_portal; /** SW portal object */ |
| 48 | }; |
| 49 | |
| 50 | extern struct fsl_dpio_obj *dflt_dpio; |
| 51 | |
Prabhakar Kushwaha | 1730a17 | 2015-11-04 12:25:59 +0530 | [diff] [blame] | 52 | /** |
| 53 | * struct dpni_node - DPNI strucuture |
| 54 | * @int dpni_id: DPNI id |
| 55 | * @uint16_t handle: DPNI object handle |
| 56 | * @struct dpni_attr: DPNI attributes |
| 57 | * @struct dpni_buffer_layout: DPNI buffer layout |
| 58 | */ |
| 59 | struct fsl_dpni_obj { |
Yogesh Gaur | 2557c5a | 2017-11-15 11:59:31 +0530 | [diff] [blame] | 60 | uint32_t dpni_id; |
Prabhakar Kushwaha | 1730a17 | 2015-11-04 12:25:59 +0530 | [diff] [blame] | 61 | uint16_t dpni_handle; |
| 62 | struct dpni_attr dpni_attrs; |
| 63 | struct dpni_buffer_layout buf_layout; |
| 64 | }; |
| 65 | |
| 66 | extern struct fsl_dpni_obj *dflt_dpni; |
| 67 | |
Florinel Iordache | 1990cc7 | 2019-11-19 10:28:17 +0000 | [diff] [blame] | 68 | /** |
| 69 | * struct sp_blob_header - SP Blob header structure |
| 70 | * @magic: SP Blob magic number |
| 71 | * @blob_ver: SP Blob version |
| 72 | * @ip_rev: SP IP revision |
| 73 | * @length: Length of the SP Blob |
| 74 | */ |
| 75 | struct sp_blob_header { |
| 76 | u32 magic; |
| 77 | u32 blob_ver; |
| 78 | u32 ip_rev; |
| 79 | u32 length; |
| 80 | }; |
| 81 | |
Prabhakar Kushwaha | fb4a87a | 2015-11-04 12:25:58 +0530 | [diff] [blame] | 82 | int mc_init(u64 mc_fw_addr, u64 mc_dpc_addr); |
Prabhakar Kushwaha | c919ab9 | 2015-11-04 12:26:00 +0530 | [diff] [blame] | 83 | int ldpaa_eth_init(int dpmac_id, phy_interface_t enet_if); |
Prabhakar Kushwaha | 1730a17 | 2015-11-04 12:25:59 +0530 | [diff] [blame] | 84 | int mc_apply_dpl(u64 mc_dpl_addr); |
Florinel Iordache | 1990cc7 | 2019-11-19 10:28:17 +0000 | [diff] [blame] | 85 | int mc_apply_spb(u64 mc_spb_addr); |
Prabhakar Kushwaha | a2a55e5 | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 86 | #endif /* _FSL_MC_PRIVATE_H_ */ |