summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/qemu/qemu-zynqmp-mainline/0007-net-cadence_gem-Split-state-struct-and-type-into-hea.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-devtools/qemu/qemu-zynqmp-mainline/0007-net-cadence_gem-Split-state-struct-and-type-into-hea.patch')
-rw-r--r--recipes-devtools/qemu/qemu-zynqmp-mainline/0007-net-cadence_gem-Split-state-struct-and-type-into-hea.patch143
1 files changed, 0 insertions, 143 deletions
diff --git a/recipes-devtools/qemu/qemu-zynqmp-mainline/0007-net-cadence_gem-Split-state-struct-and-type-into-hea.patch b/recipes-devtools/qemu/qemu-zynqmp-mainline/0007-net-cadence_gem-Split-state-struct-and-type-into-hea.patch
deleted file mode 100644
index e468563b..00000000
--- a/recipes-devtools/qemu/qemu-zynqmp-mainline/0007-net-cadence_gem-Split-state-struct-and-type-into-hea.patch
+++ /dev/null
@@ -1,143 +0,0 @@
1From 9f9cd8a67975d0973bf5d0dd0bdf6e0bff168774 Mon Sep 17 00:00:00 2001
2From: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
3Date: Mon, 23 Mar 2015 04:05:15 -0700
4Subject: [PATCH 07/15] net: cadence_gem: Split state struct and type into
5 header
6
7To allow using the device with modern SoC programming conventions. The
8state struct needs to be visible to embed the device in SoC containers.
9
10Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
11Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
12---
13 hw/net/cadence_gem.c | 43 +-----------------------------------
14 include/hw/net/cadence_gem.h | 49 ++++++++++++++++++++++++++++++++++++++++++
15 2 files changed, 50 insertions(+), 42 deletions(-)
16 create mode 100644 include/hw/net/cadence_gem.h
17
18diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c
19index 5994306..dafe914 100644
20--- a/hw/net/cadence_gem.c
21+++ b/hw/net/cadence_gem.c
22@@ -24,8 +24,7 @@
23
24 #include <zlib.h> /* For crc32 */
25
26-#include "hw/sysbus.h"
27-#include "net/net.h"
28+#include "hw/net/cadence_gem.h"
29 #include "net/checksum.h"
30
31 #ifdef CADENCE_GEM_ERR_DEBUG
32@@ -141,8 +140,6 @@
33 #define GEM_DESCONF6 (0x00000294/4)
34 #define GEM_DESCONF7 (0x00000298/4)
35
36-#define CADENCE_GEM_MAXREG (0x00000640/4) /* Last valid GEM address */
37-
38 /*****************************************/
39 #define GEM_NWCTRL_TXSTART 0x00000200 /* Transmit Enable */
40 #define GEM_NWCTRL_TXENA 0x00000008 /* Transmit Enable */
41@@ -349,44 +346,6 @@ static inline void rx_desc_set_sar(unsigned *desc, int sar_idx)
42 desc[1] |= R_DESC_1_RX_SAR_MATCH;
43 }
44
45-#define TYPE_CADENCE_GEM "cadence_gem"
46-#define CADENCE_GEM(obj) OBJECT_CHECK(CadenceGEMState, (obj), TYPE_CADENCE_GEM)
47-
48-typedef struct CadenceGEMState {
49- SysBusDevice parent_obj;
50-
51- MemoryRegion iomem;
52- NICState *nic;
53- NICConf conf;
54- qemu_irq irq;
55-
56- /* GEM registers backing store */
57- uint32_t regs[CADENCE_GEM_MAXREG];
58- /* Mask of register bits which are write only */
59- uint32_t regs_wo[CADENCE_GEM_MAXREG];
60- /* Mask of register bits which are read only */
61- uint32_t regs_ro[CADENCE_GEM_MAXREG];
62- /* Mask of register bits which are clear on read */
63- uint32_t regs_rtc[CADENCE_GEM_MAXREG];
64- /* Mask of register bits which are write 1 to clear */
65- uint32_t regs_w1c[CADENCE_GEM_MAXREG];
66-
67- /* PHY registers backing store */
68- uint16_t phy_regs[32];
69-
70- uint8_t phy_loop; /* Are we in phy loopback? */
71-
72- /* The current DMA descriptor pointers */
73- uint32_t rx_desc_addr;
74- uint32_t tx_desc_addr;
75-
76- uint8_t can_rx_state; /* Debug only */
77-
78- unsigned rx_desc[2];
79-
80- bool sar_active[4];
81-} CadenceGEMState;
82-
83 /* The broadcast MAC address: 0xFFFFFFFFFFFF */
84 static const uint8_t broadcast_addr[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
85
86diff --git a/include/hw/net/cadence_gem.h b/include/hw/net/cadence_gem.h
87new file mode 100644
88index 0000000..12de820
89--- /dev/null
90+++ b/include/hw/net/cadence_gem.h
91@@ -0,0 +1,49 @@
92+#ifndef CADENCE_GEM_H_
93+
94+#define TYPE_CADENCE_GEM "cadence_gem"
95+#define CADENCE_GEM(obj) OBJECT_CHECK(CadenceGEMState, (obj), TYPE_CADENCE_GEM)
96+
97+#include "net/net.h"
98+#include "hw/sysbus.h"
99+
100+#define CADENCE_GEM_MAXREG (0x00000640/4) /* Last valid GEM address */
101+
102+typedef struct CadenceGEMState {
103+ /*< private >*/
104+ SysBusDevice parent_obj;
105+
106+ /*< public >*/
107+ MemoryRegion iomem;
108+ NICState *nic;
109+ NICConf conf;
110+ qemu_irq irq;
111+
112+ /* GEM registers backing store */
113+ uint32_t regs[CADENCE_GEM_MAXREG];
114+ /* Mask of register bits which are write only */
115+ uint32_t regs_wo[CADENCE_GEM_MAXREG];
116+ /* Mask of register bits which are read only */
117+ uint32_t regs_ro[CADENCE_GEM_MAXREG];
118+ /* Mask of register bits which are clear on read */
119+ uint32_t regs_rtc[CADENCE_GEM_MAXREG];
120+ /* Mask of register bits which are write 1 to clear */
121+ uint32_t regs_w1c[CADENCE_GEM_MAXREG];
122+
123+ /* PHY registers backing store */
124+ uint16_t phy_regs[32];
125+
126+ uint8_t phy_loop; /* Are we in phy loopback? */
127+
128+ /* The current DMA descriptor pointers */
129+ uint32_t rx_desc_addr;
130+ uint32_t tx_desc_addr;
131+
132+ uint8_t can_rx_state; /* Debug only */
133+
134+ unsigned rx_desc[2];
135+
136+ bool sar_active[4];
137+} CadenceGEMState;
138+
139+#define CADENCE_GEM_H_
140+#endif
141--
1421.7.10.4
143