blob: 17e061196408eefea1c7e0f5b180f82412b82ce6 [file] [log] [blame]
Prabhakar Kushwahaa2a55e52015-03-19 09:20:45 -07001/*
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>
Prabhakar Kushwahac919ab92015-11-04 12:26:00 +053016#include <phy.h>
Prabhakar Kushwahaa2a55e52015-03-19 09:20:45 -070017
18#include <fsl-mc/fsl_mc_sys.h>
19#include <fsl-mc/fsl_mc_cmd.h>
Prabhakar Kushwahac5177712015-03-19 09:20:46 -070020#include <fsl-mc/fsl_dprc.h>
Prabhakar Kushwahaa2a55e52015-03-19 09:20:45 -070021#include <fsl-mc/fsl_dpbp.h>
Prabhakar Kushwaha1730a172015-11-04 12:25:59 +053022#include <fsl-mc/fsl_dpni.h>
Prabhakar Kushwahaa2a55e52015-03-19 09:20:45 -070023
24extern struct fsl_mc_io *dflt_mc_io;
25
26/**
27 * struct dpbp_node - DPBP strucuture
28 * @uint16_t handle: DPBP object handle
Prabhakar Kushwaha1730a172015-11-04 12:25:59 +053029 * @struct dpbp_attr: DPBP attribute
Prabhakar Kushwahaa2a55e52015-03-19 09:20:45 -070030 */
31struct fsl_dpbp_obj {
32 uint16_t dpbp_handle;
33 struct dpbp_attr dpbp_attr;
34};
35
36extern 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 */
43struct fsl_dpio_obj {
44 int dpio_id;
Prabhakar Kushwaha1730a172015-11-04 12:25:59 +053045 uint16_t dpio_handle;
Prabhakar Kushwahaa2a55e52015-03-19 09:20:45 -070046 struct qbman_swp *sw_portal; /** SW portal object */
47};
48
49extern struct fsl_dpio_obj *dflt_dpio;
50
Prabhakar Kushwaha1730a172015-11-04 12:25:59 +053051/**
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 */
58struct 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
65extern struct fsl_dpni_obj *dflt_dpni;
66
Prabhakar Kushwahafb4a87a2015-11-04 12:25:58 +053067int mc_init(u64 mc_fw_addr, u64 mc_dpc_addr);
Prabhakar Kushwahac919ab92015-11-04 12:26:00 +053068int ldpaa_eth_init(int dpmac_id, phy_interface_t enet_if);
Prabhakar Kushwaha1730a172015-11-04 12:25:59 +053069int mc_apply_dpl(u64 mc_dpl_addr);
Prabhakar Kushwahaa2a55e52015-03-19 09:20:45 -070070#endif /* _FSL_MC_PRIVATE_H_ */