]> git.sur5r.net Git - u-boot/blobdiff - drivers/net/ldpaa_eth/ldpaa_eth.h
ARM: omap3: evm: Refactor 'board_eth_init'
[u-boot] / drivers / net / ldpaa_eth / ldpaa_eth.h
index c7760ef69ff3f951b0c8d76d1fc6d2c095ff644e..1e26630043a097e0c6ad4f2d0434dc3fb85aed67 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright (C) 2014 Freescale Semiconductor
+ * Copyright (C) 2014-2016 Freescale Semiconductor
+ * Copyright 2017 NXP
  *
  * SPDX-License-Identifier:    GPL-2.0+
  */
@@ -24,14 +25,14 @@ enum ldpaa_eth_type {
 };
 
 /* Arbitrary values for now, but we'll need to tune */
-#define LDPAA_ETH_NUM_BUFS             (2 * 7)
+#define LDPAA_ETH_NUM_BUFS             (7 * 7)
 #define LDPAA_ETH_REFILL_THRESH                (LDPAA_ETH_NUM_BUFS/2)
 #define LDPAA_ETH_RX_BUFFER_SIZE       2048
 
-/* Hardware requires alignment for ingress/egress buffer addresses
- * and ingress buffer lengths.
+/* Hardware requires alignment for buffer address and length: 256-byte
+ * for ingress, 64-byte for egress. Using 256 for both.
  */
-#define LDPAA_ETH_BUF_ALIGN            64
+#define LDPAA_ETH_BUF_ALIGN            256
 
 /* So far we're only accomodating a skb backpointer in the frame's
  * software annotation, but the hardware options are either 0 or 64.
@@ -117,31 +118,27 @@ 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;
+       uint32_t dpmac_id;
+       uint16_t dpmac_handle;
+
        uint16_t tx_data_offset;
 
        uint32_t rx_dflt_fqid;
        uint16_t tx_qdid;
-       uint32_t tx_conf_fqid;
        uint16_t tx_flow_id;
 
        enum ldpaa_eth_type type;       /* 1G or 10G ethernet */
-       phy_interface_t enet_if;
-       struct mii_dev *bus;
        struct phy_device *phydev;
-       int phyaddr;
-
 };
 
+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);
@@ -150,4 +147,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 */