]> git.sur5r.net Git - u-boot/blobdiff - include/tsec.h
Merge branch 'master' of git://git.denx.de/u-boot-sunxi
[u-boot] / include / tsec.h
index f2aa11abe6917204e922ddf28955cf554e44eb4a..e90095121bdd40f85b01615ac946cc6fc98ef7b6 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  *  tsec.h
  *
@@ -7,8 +8,6 @@
  * (C) Copyright 2003, Motorola, Inc.
  * maintained by Xianghua Xiao (x.xiao@motorola.com)
  * author Andy Fleming
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #ifndef __TSEC_H
@@ -18,7 +17,9 @@
 #include <config.h>
 #include <phy.h>
 
-#ifdef CONFIG_LS102XA
+#ifndef CONFIG_DM_ETH
+
+#ifdef CONFIG_ARCH_LS1021A
 #define TSEC_SIZE              0x40000
 #define TSEC_MDIO_OFFSET       0x40000
 #else
@@ -64,6 +65,8 @@
        x.mii_devname = DEFAULT_MII_NAME;\
 }
 
+#endif /* CONFIG_DM_ETH */
+
 #define MAC_ADDR_LEN           6
 
 /* #define TSEC_TIMEOUT        1000000 */
@@ -387,15 +390,27 @@ struct tsec {
 #define TSEC_REDUCED   (1 << 1)        /* MAC-PHY interface uses RGMII */
 #define TSEC_SGMII     (1 << 2)        /* MAC-PHY interface uses SGMII */
 
+#define TX_BUF_CNT     2
+
 struct tsec_private {
+       struct txbd8 __iomem txbd[TX_BUF_CNT];
+       struct rxbd8 __iomem rxbd[PKTBUFSRX];
        struct tsec __iomem *regs;
        struct tsec_mii_mng __iomem *phyregs_sgmii;
        struct phy_device *phydev;
        phy_interface_t interface;
        struct mii_dev *bus;
        uint phyaddr;
+       uint tbiaddr;
        char mii_devname[16];
        u32 flags;
+       uint rx_idx;    /* index of the current RX buffer */
+       uint tx_idx;    /* index of the current TX buffer */
+#ifndef CONFIG_DM_ETH
+       struct eth_device *dev;
+#else
+       struct udevice *dev;
+#endif
 };
 
 struct tsec_info_struct {
@@ -408,7 +423,9 @@ struct tsec_info_struct {
        u32 flags;
 };
 
+#ifndef CONFIG_DM_ETH
 int tsec_standard_init(bd_t *bis);
 int tsec_eth_init(bd_t *bis, struct tsec_info_struct *tsec_info, int num);
+#endif
 
 #endif /* __TSEC_H */