summaryrefslogtreecommitdiff
path: root/include/pfe_eth/pfe_driver.h
diff options
context:
space:
mode:
authorCalvin Johnson <calvin.johnson@nxp.com>2017-10-03 06:05:26 (GMT)
committerPrabhakar Kushwaha <prabhakar.kushwaha@nxp.com>2017-10-11 03:26:05 (GMT)
commitaf5f82203668bbdefc7a69cec5b5ac6a728674bf (patch)
tree85470178069ebc40160c27465918f72f233c15a8 /include/pfe_eth/pfe_driver.h
parent676ef263ec38e182fde66d5ff676de7635939408 (diff)
downloadu-boot-af5f82203668bbdefc7a69cec5b5ac6a728674bf.tar.xz
drivers: net: pfe_eth: LS1012A PFE headers
Contains all the pfe header files. Signed-off-by: Calvin Johnson <calvin.johnson@nxp.com> Signed-off-by: Anjaneyulu Jagarlmudi <anji.jagarlmudi@nxp.com>
Diffstat (limited to 'include/pfe_eth/pfe_driver.h')
-rw-r--r--include/pfe_eth/pfe_driver.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/include/pfe_eth/pfe_driver.h b/include/pfe_eth/pfe_driver.h
new file mode 100644
index 0000000..28997b4
--- /dev/null
+++ b/include/pfe_eth/pfe_driver.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2015-2016 Freescale Semiconductor, Inc.
+ * Copyright 2017 NXP
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef __PFE_DRIVER_H__
+#define __PFE_DRIVER_H__
+
+#include "pfe/pfe.h"
+
+#define HIF_RX_DESC_NT 64
+#define HIF_TX_DESC_NT 64
+
+#define RX_BD_BASEADDR (HIF_DESC_BASEADDR)
+#define TX_BD_BASEADDR (HIF_DESC_BASEADDR + HIF_TX_DESC_SIZE)
+
+#define MIN_PKT_SIZE 56
+#define MAX_FRAME_SIZE 2048
+
+struct __packed hif_header_s {
+ u8 port_no; /* Carries input port no for host rx packets and
+ * output port no for tx pkts
+ */
+ u8 reserved0;
+ u32 reserved2;
+};
+
+struct __packed buf_desc {
+ u32 ctrl;
+ u32 status;
+ u32 data;
+ u32 next;
+};
+
+struct rx_desc_s {
+ struct buf_desc *rx_base;
+ unsigned int rx_base_pa;
+ int rx_to_read;
+ int rx_ring_size;
+};
+
+struct tx_desc_s {
+ struct buf_desc *tx_base;
+ unsigned int tx_base_pa;
+ int tx_to_send;
+ int tx_ring_size;
+};
+
+int pfe_send(int phy_port, void *data, int length);
+int pfe_recv(unsigned int *pkt_ptr, int *phy_port);
+int pfe_tx_done(void);
+
+#endif