Skip to contentSkip to conversation

hw/net: Move MV88W8618 network device out of hw/arm/ directory

PATCH Superseded Philippe Mathieu-Daudé 1 participant 4 messages Dec 16, 2021 Arm/Amlogic Meson SoC support

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

cover hw/net: Move MV88W8618 network device out of hw/arm/ directory

This series simply extract the MV88W8618 device from the ARM machine in hw/arm/ and move it to hw/net/.

I was expecting for this to get merged before posting a generic network code rework series, then figured I never posted it >_<

Philippe Mathieu-Daudé (2):
hw/arm/musicpal: Fix coding style of code related to MV88W8618 device hw/net: Move MV88W8618 network device out of hw/arm/ directory

 include/hw/net/mv88w8618_eth.h |  16 ++
 hw/arm/musicpal.c              | 380 +-----------------------------
 hw/net/mv88w8618_eth.c         | 406 +++++++++++++++++++++++++++++++++
 MAINTAINERS                    |   2 +
 hw/net/meson.build             |   1 +
 5 files changed, 426 insertions(+), 379 deletions(-)
 create mode 100644 include/hw/net/mv88w8618_eth.h
 create mode 100644 hw/net/mv88w8618_eth.c
Signature · 1 line
2.33.1
#1 lore raw

PATCH 1/2 hw/arm/musicpal: Fix coding style of code related to MV88W8618 device

We are going to move this code, so fix its style first to avoid:

ERROR: spaces required around that '/' (ctx:VxV)

---
 hw/arm/musicpal.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
hw/arm/musicpal.c +7 -7
index 2d612cc0c9b..6b5310117b8 100644
@@ -309,13 +309,13 @@ static uint64_t mv88w8618_eth_read(void *opaque, hwaddr offset,
         return s->imr;
 
     case MP_ETH_FRDP0 ... MP_ETH_FRDP3:
-        return s->frx_queue[(offset - MP_ETH_FRDP0)/4];
+        return s->frx_queue[(offset - MP_ETH_FRDP0) / 4];
 
     case MP_ETH_CRDP0 ... MP_ETH_CRDP3:
-        return s->rx_queue[(offset - MP_ETH_CRDP0)/4];
+        return s->rx_queue[(offset - MP_ETH_CRDP0) / 4];
 
     case MP_ETH_CTDP0 ... MP_ETH_CTDP1:
-        return s->tx_queue[(offset - MP_ETH_CTDP0)/4];
+        return s->tx_queue[(offset - MP_ETH_CTDP0) / 4];
 
     default:
         return 0;
@@ -360,16 +360,16 @@ static void mv88w8618_eth_write(void *opaque, hwaddr offset,
         break;
 
     case MP_ETH_FRDP0 ... MP_ETH_FRDP3:
-        s->frx_queue[(offset - MP_ETH_FRDP0)/4] = value;
+        s->frx_queue[(offset - MP_ETH_FRDP0) / 4] = value;
         break;
 
     case MP_ETH_CRDP0 ... MP_ETH_CRDP3:
-        s->rx_queue[(offset - MP_ETH_CRDP0)/4] =
-            s->cur_rx[(offset - MP_ETH_CRDP0)/4] = value;
+        s->rx_queue[(offset - MP_ETH_CRDP0) / 4] =
+            s->cur_rx[(offset - MP_ETH_CRDP0) / 4] = value;
         break;
 
     case MP_ETH_CTDP0 ... MP_ETH_CTDP1:
-        s->tx_queue[(offset - MP_ETH_CTDP0)/4] = value;
+        s->tx_queue[(offset - MP_ETH_CTDP0) / 4] = value;
         break;
     }
 }
Signature · 1 line
2.33.1
#2 lore raw

PATCH 2/2 hw/net: Move MV88W8618 network device out of hw/arm/ directory

In reply to Philippe Mathieu-Daudé

The Marvell 88W8618 network device is hidden in the Musicpal machine. Move it into a new unit file under the hw/net/ directory.

---
 include/hw/net/mv88w8618_eth.h |  16 ++
 hw/arm/musicpal.c              | 380 +-----------------------------
 hw/net/mv88w8618_eth.c         | 406 +++++++++++++++++++++++++++++++++
 MAINTAINERS                    |   2 +
 hw/net/meson.build             |   1 +
 5 files changed, 426 insertions(+), 379 deletions(-)
 create mode 100644 include/hw/net/mv88w8618_eth.h
 create mode 100644 hw/net/mv88w8618_eth.c
include/hw/net/mv88w8618_eth.h new file +16 -0
new file mode 100644
index 00000000000..65e880e0eb7
@@ -0,0 +1,16 @@
+/*
+ * Marvell MV88W8618 / Freecom MusicPal emulation.
+ *
+ * Copyright (c) 2008 Jan Kiszka
+ *
+ * This code is licensed under the GNU GPL v2.
+ *
+ * Contributions after 2012-01-13 are licensed under the terms of the
+ * GNU GPL, version 2 or (at your option) any later version.
+ */
+#ifndef HW_NET_MV88W8618_H
+#define HW_NET_MV88W8618_H
+
+#define TYPE_MV88W8618_ETH "mv88w8618_eth"
+
+#endif
hw/arm/musicpal.c +1 -379

403 lines not on this page · raw message

hw/net/mv88w8618_eth.c new file +406 -0

406 lines not on this page · raw message

MAINTAINERS +2 -0
index 7543eb4d597..ffc1b57fb37 100644
@@ -781,6 +781,8 @@ M: Peter Maydell <[email protected]>
 L: [email protected]
 S: Odd Fixes
 F: hw/arm/musicpal.c
+F: hw/net/mv88w8618_eth.c
+F: include/hw/net/mv88w8618_eth.h
 F: docs/system/arm/musicpal.rst
 
 Nuvoton NPCM7xx
hw/net/meson.build +1 -0
index bdf71f1f405..bbc77d48548 100644
@@ -26,6 +26,7 @@
 softmmu_ss.add(when: 'CONFIG_ALLWINNER_SUN8I_EMAC', if_true: files('allwinner-sun8i-emac.c'))
 softmmu_ss.add(when: 'CONFIG_IMX_FEC', if_true: files('imx_fec.c'))
 softmmu_ss.add(when: 'CONFIG_MSF2', if_true: files('msf2-emac.c'))
+softmmu_ss.add(when: 'CONFIG_MUSICPAL', if_true: files('mv88w8618_eth.c'))
 
 softmmu_ss.add(when: 'CONFIG_CADENCE', if_true: files('cadence_gem.c'))
 softmmu_ss.add(when: 'CONFIG_STELLARIS_ENET', if_true: files('stellaris_enet.c'))
Signature · 1 line
2.33.1
#3 lore raw
Quoted 20 lines · Philippe Mathieu-Daudé

The Marvell 88W8618 network device is hidden in the Musicpal machine. Move it into a new unit file under the hw/net/ directory.

---
 include/hw/net/mv88w8618_eth.h |  16 ++
 hw/arm/musicpal.c              | 380 +-----------------------------
 hw/net/mv88w8618_eth.c         | 406 +++++++++++++++++++++++++++++++++
 MAINTAINERS                    |   2 +
 hw/net/meson.build             |   1 +
 5 files changed, 426 insertions(+), 379 deletions(-)
 create mode 100644 include/hw/net/mv88w8618_eth.h
 create mode 100644 hw/net/mv88w8618_eth.c
include/hw/net/mv88w8618_eth.h new file +0 -0
new file mode 100644
index 00000000000..65e880e0eb7

include/hw/net/mv88w8618_eth.h line 9

Quoted 9 lines
include/hw/net/mv88w8618_eth.h new file +9 -0
@@ -0,0 +1,16 @@
+/*
+ * Marvell MV88W8618 / Freecom MusicPal emulation.
+ *
+ * Copyright (c) 2008 Jan Kiszka
+ *
+ * This code is licensed under the GNU GPL v2.
+ *
+ * Contributions after 2012-01-13 are licensed under the terms of the
+ * GNU GPL, version 2 or (at your option) any later version.

These 2 lines are probably irrelevant here.

Quoted 7 lines
include/hw/net/mv88w8618_eth.h new file +7 -0
+ */
+#ifndef HW_NET_MV88W8618_H
+#define HW_NET_MV88W8618_H
+
+#define TYPE_MV88W8618_ETH "mv88w8618_eth"
+
+#endif