Skip to contentSkip to conversation

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

PATCH Applied Philippe Mathieu-Daudé 2 participants 5 messages Jan 7, 2022 – Jan 11, 2022 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

v4 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/.

Since v3:
- Rebased on latest main/master

Since v2:
- declare MARVELL_88W8618 in hw/arm/Kconfig
- use MARVELL_88W8618 Kconfig (rth)

Since v1:
- update (c) notice

Philippe Mathieu-Daudé (3):
hw: Move MARVELL_88W8618 Kconfig from audio/ to arm/ 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 |  12 +
 hw/arm/musicpal.c              | 381 +------------------------------
 hw/net/mv88w8618_eth.c         | 403 +++++++++++++++++++++++++++++++++
 MAINTAINERS                    |   2 +
 hw/arm/Kconfig                 |   3 +
 hw/audio/Kconfig               |   3 -
 hw/net/meson.build             |   1 +
 7 files changed, 422 insertions(+), 383 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 v4 1/3 hw: Move MARVELL_88W8618 Kconfig from audio/ to arm/

The Marvell 88W8618 is a system-on-chip with an ARM core. We implement its audio codecs and network interface. Homogeneous SoC Kconfig are usually defined in the hw/$ARCH directory. Move it there.

---
 hw/arm/Kconfig   | 3 +++
 hw/audio/Kconfig | 3 ---
 2 files changed, 3 insertions(+), 3 deletions(-)
hw/arm/Kconfig +3 -0
index e6525909438..c459c897cc7 100644
@@ -94,6 +94,9 @@ config MUSCA
     select SPLIT_IRQ
     select UNIMP
 
+config MARVELL_88W8618
+    bool
+
 config MUSICPAL
     bool
     select OR_IRQ
hw/audio/Kconfig +0 -3
index e9c6fed8261..e76c69ca7e7 100644
@@ -47,6 +47,3 @@ config PL041
 
 config CS4231
     bool
-
-config MARVELL_88W8618
-    bool
Signature · 1 line
2.33.1
#2 lore raw

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

In reply to Philippe Mathieu-Daudé

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 2680ec55b5a..1291eb98aba 100644
@@ -310,13 +310,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;
@@ -361,16 +361,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
#3 lore raw

PATCH v4 3/3 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 |  12 +
 hw/arm/musicpal.c              | 381 +------------------------------
 hw/net/mv88w8618_eth.c         | 403 +++++++++++++++++++++++++++++++++
 MAINTAINERS                    |   2 +
 hw/net/meson.build             |   1 +
 5 files changed, 419 insertions(+), 380 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 +12 -0
new file mode 100644
index 00000000000..8f4c746092f
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Marvell MV88W8618 / Freecom MusicPal emulation.
+ *
+ * Copyright (c) 2008-2021 QEMU contributors
+ */
+#ifndef HW_NET_MV88W8618_H
+#define HW_NET_MV88W8618_H
+
+#define TYPE_MV88W8618_ETH "mv88w8618_eth"
+
+#endif
hw/arm/musicpal.c +1 -380

404 lines not on this page · raw message

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

403 lines not on this page · raw message

MAINTAINERS +2 -0
index f871d759fdf..f25f92bd74a 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..685b75badb4 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_MARVELL_88W8618', 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
#4 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 6 lines · Philippe Mathieu-Daudé

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

Since v3:
- Rebased on latest main/master

Applied to target-arm.next, thanks.

-- PMM