2018-05-07 05:58:06 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2015-03-20 00:20:45 +08:00
|
|
|
/*
|
2018-05-09 13:22:17 +08:00
|
|
|
* Copyright 2014-2016 Freescale Semiconductor, Inc.
|
2019-11-19 18:28:17 +08:00
|
|
|
* Copyright 2017-2018 NXP
|
2015-03-20 00:20:45 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _FSL_MC_PRIVATE_H_
|
|
|
|
#define _FSL_MC_PRIVATE_H_
|
|
|
|
|
|
|
|
#include <errno.h>
|
|
|
|
#include <malloc.h>
|
|
|
|
#include <asm/io.h>
|
|
|
|
#include <linux/compat.h>
|
|
|
|
#include <linux/types.h>
|
|
|
|
#include <linux/stringify.h>
|
2015-11-04 14:56:00 +08:00
|
|
|
#include <phy.h>
|
2015-03-20 00:20:45 +08:00
|
|
|
|
|
|
|
#include <fsl-mc/fsl_mc_sys.h>
|
|
|
|
#include <fsl-mc/fsl_mc_cmd.h>
|
2015-03-20 00:20:46 +08:00
|
|
|
#include <fsl-mc/fsl_dprc.h>
|
2015-03-20 00:20:45 +08:00
|
|
|
#include <fsl-mc/fsl_dpbp.h>
|
2015-11-04 14:55:59 +08:00
|
|
|
#include <fsl-mc/fsl_dpni.h>
|
2015-03-20 00:20:45 +08:00
|
|
|
|
|
|
|
extern struct fsl_mc_io *dflt_mc_io;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct dpbp_node - DPBP strucuture
|
|
|
|
* @uint16_t handle: DPBP object handle
|
2015-11-04 14:55:59 +08:00
|
|
|
* @struct dpbp_attr: DPBP attribute
|
2015-03-20 00:20:45 +08:00
|
|
|
*/
|
|
|
|
struct fsl_dpbp_obj {
|
2017-11-15 14:29:31 +08:00
|
|
|
uint32_t dpbp_id;
|
2015-03-20 00:20:45 +08:00
|
|
|
uint16_t dpbp_handle;
|
|
|
|
struct dpbp_attr dpbp_attr;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern struct fsl_dpbp_obj *dflt_dpbp;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct fsl_dpio_obj - DPIO strucuture
|
|
|
|
* @int dpio_id: DPIO id
|
|
|
|
* @struct qbman_swp *sw_portal: SW portal object
|
|
|
|
*/
|
|
|
|
struct fsl_dpio_obj {
|
2017-11-15 14:29:31 +08:00
|
|
|
uint32_t dpio_id;
|
2015-11-04 14:55:59 +08:00
|
|
|
uint16_t dpio_handle;
|
2015-03-20 00:20:45 +08:00
|
|
|
struct qbman_swp *sw_portal; /** SW portal object */
|
|
|
|
};
|
|
|
|
|
|
|
|
extern struct fsl_dpio_obj *dflt_dpio;
|
|
|
|
|
2015-11-04 14:55:59 +08:00
|
|
|
/**
|
|
|
|
* struct dpni_node - DPNI strucuture
|
|
|
|
* @int dpni_id: DPNI id
|
|
|
|
* @uint16_t handle: DPNI object handle
|
|
|
|
* @struct dpni_attr: DPNI attributes
|
|
|
|
* @struct dpni_buffer_layout: DPNI buffer layout
|
|
|
|
*/
|
|
|
|
struct fsl_dpni_obj {
|
2017-11-15 14:29:31 +08:00
|
|
|
uint32_t dpni_id;
|
2015-11-04 14:55:59 +08:00
|
|
|
uint16_t dpni_handle;
|
|
|
|
struct dpni_attr dpni_attrs;
|
|
|
|
struct dpni_buffer_layout buf_layout;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern struct fsl_dpni_obj *dflt_dpni;
|
|
|
|
|
2019-11-19 18:28:17 +08:00
|
|
|
/**
|
|
|
|
* struct sp_blob_header - SP Blob header structure
|
|
|
|
* @magic: SP Blob magic number
|
|
|
|
* @blob_ver: SP Blob version
|
|
|
|
* @ip_rev: SP IP revision
|
|
|
|
* @length: Length of the SP Blob
|
|
|
|
*/
|
|
|
|
struct sp_blob_header {
|
|
|
|
u32 magic;
|
|
|
|
u32 blob_ver;
|
|
|
|
u32 ip_rev;
|
|
|
|
u32 length;
|
|
|
|
};
|
|
|
|
|
2015-11-04 14:55:58 +08:00
|
|
|
int mc_init(u64 mc_fw_addr, u64 mc_dpc_addr);
|
2015-11-04 14:56:00 +08:00
|
|
|
int ldpaa_eth_init(int dpmac_id, phy_interface_t enet_if);
|
2015-11-04 14:55:59 +08:00
|
|
|
int mc_apply_dpl(u64 mc_dpl_addr);
|
2019-11-19 18:28:17 +08:00
|
|
|
int mc_apply_spb(u64 mc_spb_addr);
|
2015-03-20 00:20:45 +08:00
|
|
|
#endif /* _FSL_MC_PRIVATE_H_ */
|