Commit c919ab9e authored by Prabhakar Kushwaha's avatar Prabhakar Kushwaha Committed by York Sun

driver: net: ldpaa: Use DPMAC as net device

As per current implementation of DPAA2 ethernet driver DPNI is used as
net device. DPNI is tangible objects can be multiple connected to same physical lane.

Use DPMAC as net device where it represents physical lane.
Below modification done in driver
 - Use global DPNI object
 - Connect DPMAC to DPNI
 - Create and destroy DPMAC
Signed-off-by: default avatarPrabhakar Kushwaha <>
Reviewed-by: default avatarYork Sun <>
parent 1730a17d
......@@ -659,6 +659,12 @@ unsigned long mc_get_dram_block_size(void)
int fsl_mc_ldpaa_init(bd_t *bis)
int i;
for (i = WRIOP1_DPMAC1; i < NUM_WRIOP_PORTS; i++)
if ((wriop_is_enabled_dpmac(i) == 1) &&
(wriop_get_phy_address(i) != -1))
ldpaa_eth_init(i, wriop_get_enet_if(i));
return 0;
This diff is collapsed.
......@@ -117,13 +117,9 @@ struct ldpaa_fas {
struct ldpaa_eth_priv {
struct eth_device *net_dev;
int dpni_id;
uint16_t dpni_handle;
struct dpni_attr dpni_attrs;
/* Insofar as the MC is concerned, we're using one layout on all 3 types
* of buffers (Rx, Tx, Tx-Conf).
struct dpni_buffer_layout buf_layout;
int dpmac_id;
uint16_t dpmac_handle;
uint16_t tx_data_offset;
uint32_t rx_dflt_fqid;
......@@ -134,9 +130,14 @@ struct ldpaa_eth_priv {
struct phy_device *phydev;
struct dprc_endpoint dpmac_endpoint;
struct dprc_endpoint dpni_endpoint;
extern struct fsl_mc_io *dflt_mc_io;
extern struct fsl_dpbp_obj *dflt_dpbp;
extern struct fsl_dpio_obj *dflt_dpio;
extern struct fsl_dpni_obj *dflt_dpni;
extern uint16_t dflt_dprc_handle;
static void ldpaa_dpbp_drain_cnt(int count);
static void ldpaa_dpbp_drain(void);
......@@ -145,4 +146,6 @@ static void ldpaa_dpbp_free(void);
static int ldpaa_dpni_setup(struct ldpaa_eth_priv *priv);
static int ldpaa_dpbp_setup(void);
static int ldpaa_dpni_bind(struct ldpaa_eth_priv *priv);
static int ldpaa_dpmac_setup(struct ldpaa_eth_priv *priv);
static int ldpaa_dpmac_bind(struct ldpaa_eth_priv *priv);
#endif /* __LDPAA_H */
......@@ -13,6 +13,7 @@
#include <linux/compat.h>
#include <linux/types.h>
#include <linux/stringify.h>
#include <phy.h>
#include <fsl-mc/fsl_mc_sys.h>
#include <fsl-mc/fsl_mc_cmd.h>
......@@ -64,6 +65,6 @@ struct fsl_dpni_obj {
extern struct fsl_dpni_obj *dflt_dpni;
int mc_init(u64 mc_fw_addr, u64 mc_dpc_addr);
int ldpaa_eth_init(int dpmac_id);
int ldpaa_eth_init(int dpmac_id, phy_interface_t enet_if);
int mc_apply_dpl(u64 mc_dpl_addr);
#endif /* _FSL_MC_PRIVATE_H_ */
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment