blob: f4b5a99e15de26be930c290c9d0198bbaa374557 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Prabhakar Kushwahaa2a55e52015-03-19 09:20:45 -07002/*
Yogesh Gaur2557c5a2017-11-15 11:59:31 +05303 * Copyright (C) 2014-2016 Freescale Semiconductor
4 * Copyright 2017 NXP
Prabhakar Kushwahaa2a55e52015-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 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 {
Yogesh Gaur2557c5a2017-11-15 11:59:31 +053032 uint32_t dpbp_id;
Prabhakar Kushwahaa2a55e52015-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 Gaur2557c5a2017-11-15 11:59:31 +053045 uint32_t dpio_id;
Prabhakar Kushwaha1730a172015-11-04 12:25:59 +053046 uint16_t dpio_handle;
Prabhakar Kushwahaa2a55e52015-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 Kushwaha1730a172015-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 Gaur2557c5a2017-11-15 11:59:31 +053060 uint32_t dpni_id;
Prabhakar Kushwaha1730a172015-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 Kushwahafb4a87a2015-11-04 12:25:58 +053068int mc_init(u64 mc_fw_addr, u64 mc_dpc_addr);
Prabhakar Kushwahac919ab92015-11-04 12:26:00 +053069int ldpaa_eth_init(int dpmac_id, phy_interface_t enet_if);
Prabhakar Kushwaha1730a172015-11-04 12:25:59 +053070int mc_apply_dpl(u64 mc_dpl_addr);
Prabhakar Kushwahaa2a55e52015-03-19 09:20:45 -070071#endif /* _FSL_MC_PRIVATE_H_ */