blob: ba0bc379d5b8b3690888868a47a815bb3ab8a75d [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Prabhakar Kushwahacfd9fbf2015-03-19 09:20:45 -07002/*
Yogesh Gaur1a0c4ae2018-05-09 10:52:17 +05303 * Copyright 2014-2016 Freescale Semiconductor, Inc.
Yogesh Gaur318c32f2017-11-15 11:59:31 +05304 * Copyright 2017 NXP
Prabhakar Kushwahacfd9fbf2015-03-19 09:20:45 -07005 */
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 Kushwaha52d2e2c2015-11-04 12:26:00 +053016#include <phy.h>
Prabhakar Kushwahacfd9fbf2015-03-19 09:20:45 -070017
18#include <fsl-mc/fsl_mc_sys.h>
19#include <fsl-mc/fsl_mc_cmd.h>
Prabhakar Kushwaha5350b992015-03-19 09:20:46 -070020#include <fsl-mc/fsl_dprc.h>
Prabhakar Kushwahacfd9fbf2015-03-19 09:20:45 -070021#include <fsl-mc/fsl_dpbp.h>
Prabhakar Kushwaha316b71c2015-11-04 12:25:59 +053022#include <fsl-mc/fsl_dpni.h>
Prabhakar Kushwahacfd9fbf2015-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 Kushwaha316b71c2015-11-04 12:25:59 +053029 * @struct dpbp_attr: DPBP attribute
Prabhakar Kushwahacfd9fbf2015-03-19 09:20:45 -070030 */
31struct fsl_dpbp_obj {
Yogesh Gaur318c32f2017-11-15 11:59:31 +053032 uint32_t dpbp_id;
Prabhakar Kushwahacfd9fbf2015-03-19 09:20:45 -070033 uint16_t dpbp_handle;
34 struct dpbp_attr dpbp_attr;
35};
36
37extern 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 */
44struct fsl_dpio_obj {
Yogesh Gaur318c32f2017-11-15 11:59:31 +053045 uint32_t dpio_id;
Prabhakar Kushwaha316b71c2015-11-04 12:25:59 +053046 uint16_t dpio_handle;
Prabhakar Kushwahacfd9fbf2015-03-19 09:20:45 -070047 struct qbman_swp *sw_portal; /** SW portal object */
48};
49
50extern struct fsl_dpio_obj *dflt_dpio;
51
Prabhakar Kushwaha316b71c2015-11-04 12:25:59 +053052/**
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 */
59struct fsl_dpni_obj {
Yogesh Gaur318c32f2017-11-15 11:59:31 +053060 uint32_t dpni_id;
Prabhakar Kushwaha316b71c2015-11-04 12:25:59 +053061 uint16_t dpni_handle;
62 struct dpni_attr dpni_attrs;
63 struct dpni_buffer_layout buf_layout;
64};
65
66extern struct fsl_dpni_obj *dflt_dpni;
67
Prabhakar Kushwaha29a63e42015-11-04 12:25:58 +053068int mc_init(u64 mc_fw_addr, u64 mc_dpc_addr);
Prabhakar Kushwaha52d2e2c2015-11-04 12:26:00 +053069int ldpaa_eth_init(int dpmac_id, phy_interface_t enet_if);
Prabhakar Kushwaha316b71c2015-11-04 12:25:59 +053070int mc_apply_dpl(u64 mc_dpl_addr);
Prabhakar Kushwahacfd9fbf2015-03-19 09:20:45 -070071#endif /* _FSL_MC_PRIVATE_H_ */