blob: 2932d9d56199cc21e27ad4f53e3d89d7d81a018e [file] [log] [blame]
Prabhakar Kushwahacfd9fbf2015-03-19 09:20:45 -07001/*
Yogesh Gaur318c32f2017-11-15 11:59:31 +05302 * Copyright (C) 2014-2016 Freescale Semiconductor
3 * Copyright 2017 NXP
Prabhakar Kushwahacfd9fbf2015-03-19 09:20:45 -07004 *
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 Kushwaha52d2e2c2015-11-04 12:26:00 +053017#include <phy.h>
Prabhakar Kushwahacfd9fbf2015-03-19 09:20:45 -070018
19#include <fsl-mc/fsl_mc_sys.h>
20#include <fsl-mc/fsl_mc_cmd.h>
Prabhakar Kushwaha5350b992015-03-19 09:20:46 -070021#include <fsl-mc/fsl_dprc.h>
Prabhakar Kushwahacfd9fbf2015-03-19 09:20:45 -070022#include <fsl-mc/fsl_dpbp.h>
Prabhakar Kushwaha316b71c2015-11-04 12:25:59 +053023#include <fsl-mc/fsl_dpni.h>
Prabhakar Kushwahacfd9fbf2015-03-19 09:20:45 -070024
25extern struct fsl_mc_io *dflt_mc_io;
26
27/**
28 * struct dpbp_node - DPBP strucuture
29 * @uint16_t handle: DPBP object handle
Prabhakar Kushwaha316b71c2015-11-04 12:25:59 +053030 * @struct dpbp_attr: DPBP attribute
Prabhakar Kushwahacfd9fbf2015-03-19 09:20:45 -070031 */
32struct fsl_dpbp_obj {
Yogesh Gaur318c32f2017-11-15 11:59:31 +053033 uint32_t dpbp_id;
Prabhakar Kushwahacfd9fbf2015-03-19 09:20:45 -070034 uint16_t dpbp_handle;
35 struct dpbp_attr dpbp_attr;
36};
37
38extern 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 */
45struct fsl_dpio_obj {
Yogesh Gaur318c32f2017-11-15 11:59:31 +053046 uint32_t dpio_id;
Prabhakar Kushwaha316b71c2015-11-04 12:25:59 +053047 uint16_t dpio_handle;
Prabhakar Kushwahacfd9fbf2015-03-19 09:20:45 -070048 struct qbman_swp *sw_portal; /** SW portal object */
49};
50
51extern struct fsl_dpio_obj *dflt_dpio;
52
Prabhakar Kushwaha316b71c2015-11-04 12:25:59 +053053/**
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 */
60struct fsl_dpni_obj {
Yogesh Gaur318c32f2017-11-15 11:59:31 +053061 uint32_t dpni_id;
Prabhakar Kushwaha316b71c2015-11-04 12:25:59 +053062 uint16_t dpni_handle;
63 struct dpni_attr dpni_attrs;
64 struct dpni_buffer_layout buf_layout;
65};
66
67extern struct fsl_dpni_obj *dflt_dpni;
68
Prabhakar Kushwaha29a63e42015-11-04 12:25:58 +053069int mc_init(u64 mc_fw_addr, u64 mc_dpc_addr);
Prabhakar Kushwaha52d2e2c2015-11-04 12:26:00 +053070int ldpaa_eth_init(int dpmac_id, phy_interface_t enet_if);
Prabhakar Kushwaha316b71c2015-11-04 12:25:59 +053071int mc_apply_dpl(u64 mc_dpl_addr);
Prabhakar Kushwahacfd9fbf2015-03-19 09:20:45 -070072#endif /* _FSL_MC_PRIVATE_H_ */