Skip to contentSkip to conversation

mv64361: Add dummy gigabit ethernet PHY access registers

PATCH Applied BALATON Zoltan 3 participants 7 messages Jun 5, 2023 – Jun 30, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mv64361: Add dummy gigabit ethernet PHY access registers

We don't emulate the gigabit ethernet part of the chip but the MorphOS driver accesses these and expects to get some valid looking result otherwise it hangs. Add some minimal dummy implementation to avoid rhis.

---
This is only used by MorphOS on pegasos2 so most likely could go via the ppc queue.

 hw/pci-host/mv64361.c | 6 ++++++
 hw/pci-host/mv643xx.h | 3 +++
 2 files changed, 9 insertions(+)
hw/pci-host/mv64361.c +6 -0
index 19e8031a3f..01bd8c887f 100644
@@ -541,6 +541,12 @@ static uint64_t mv64361_read(void *opaque, hwaddr addr, unsigned int size)
             }
         }
         break;
+    case MV64340_ETH_PHY_ADDR:
+        ret = 0x98;
+        break;
+    case MV64340_ETH_SMI:
+        ret = BIT(27);
+        break;
     case MV64340_CUNIT_ARBITER_CONTROL_REG:
         ret = 0x11ff0000 | (s->gpp_int_level << 10);
         break;
hw/pci-host/mv643xx.h +3 -0
index cd26a43f18..f2e1baea88 100644
@@ -656,6 +656,9 @@
 /*        Ethernet Unit Registers       */
 /****************************************/
 
+#define MV64340_ETH_PHY_ADDR                                        0x2000
+#define MV64340_ETH_SMI                                             0x2004
+
 /*******************************************/
 /*          CUNIT  Registers               */
 /*******************************************/
Signature · 1 line
2.30.9
#1 lore raw
Quoted 8 lines · BALATON Zoltan

We don't emulate the gigabit ethernet part of the chip but the MorphOS driver accesses these and expects to get some valid looking result otherwise it hangs. Add some minimal dummy implementation to avoid rhis.

---
This is only used by MorphOS on pegasos2 so most likely could go via the ppc queue.

Ping?

Regards,
BALATON Zoltan

Quoted 36 lines

hw/pci-host/mv64361.c | 6 ++++++
hw/pci-host/mv643xx.h | 3 +++

2 files changed, 9 insertions(+)
hw/pci-host/mv64361.c +6 -0
index 19e8031a3f..01bd8c887f 100644
@@ -541,6 +541,12 @@ static uint64_t mv64361_read(void *opaque, hwaddr addr, unsigned int size)
            }
        }
        break;
+    case MV64340_ETH_PHY_ADDR:
+        ret = 0x98;
+        break;
+    case MV64340_ETH_SMI:
+        ret = BIT(27);
+        break;
    case MV64340_CUNIT_ARBITER_CONTROL_REG:
        ret = 0x11ff0000 | (s->gpp_int_level << 10);
        break;
hw/pci-host/mv643xx.h +3 -0
index cd26a43f18..f2e1baea88 100644
@@ -656,6 +656,9 @@
 /*        Ethernet Unit Registers       */
 /****************************************/
 
+#define MV64340_ETH_PHY_ADDR                                        0x2000
+#define MV64340_ETH_SMI                                             0x2004
+
 /*******************************************/
 /*          CUNIT  Registers               */
 /*******************************************/
#2 lore raw
Quoted 11 lines · BALATON Zoltan
Quoted 8 lines · BALATON Zoltan

We don't emulate the gigabit ethernet part of the chip but the MorphOS driver accesses these and expects to get some valid looking result otherwise it hangs. Add some minimal dummy implementation to avoid rhis.

---
This is only used by MorphOS on pegasos2 so most likely could go via the ppc queue.

Ping?

Ping?

Quoted 42 lines

Regards,
BALATON Zoltan

Quoted 37 lines

hw/pci-host/mv64361.c | 6 ++++++
hw/pci-host/mv643xx.h | 3 +++

2 files changed, 9 insertions(+)
hw/pci-host/mv64361.c +6 -0
index 19e8031a3f..01bd8c887f 100644
@@ -541,6 +541,12 @@ static uint64_t mv64361_read(void *opaque, hwaddr 
 addr, unsigned int size)
            }
        }
        break;
+    case MV64340_ETH_PHY_ADDR:
+        ret = 0x98;
+        break;
+    case MV64340_ETH_SMI:
+        ret = BIT(27);
+        break;
    case MV64340_CUNIT_ARBITER_CONTROL_REG:
        ret = 0x11ff0000 | (s->gpp_int_level << 10);
        break;
hw/pci-host/mv643xx.h +3 -0
index cd26a43f18..f2e1baea88 100644
@@ -656,6 +656,9 @@
 /*        Ethernet Unit Registers       */
 /****************************************/
 
+#define MV64340_ETH_PHY_ADDR                                        0x2000
+#define MV64340_ETH_SMI                                             0x2004
+
 /*******************************************/
 /*          CUNIT  Registers               */
 /*******************************************/
#3 lore raw
Quoted 6 lines · BALATON Zoltan
Quoted 5 lines · BALATON Zoltan
Quoted 4 lines · BALATON Zoltan

We don't emulate the gigabit ethernet part of the chip but the MorphOS driver accesses these and expects to get some valid looking result otherwise it hangs. Add some minimal dummy implementation to avoid rhis.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

---
This is only used by MorphOS on pegasos2 so most likely could go via the ppc queue.

Ping?

Ping?

Ping?
https://patchew.org/QEMU/[email protected]/
It's unlikely this will get a review so can you please just merge it? It's my code so if I break it I'll fix it but this was tested a bit and no problem reported so far.

Regards,
BALATON Zoltan

Quoted 43 lines
Quoted 41 lines
Quoted 39 lines

hw/pci-host/mv64361.c | 6 ++++++
hw/pci-host/mv643xx.h | 3 +++

2 files changed, 9 insertions(+)
hw/pci-host/mv64361.c +6 -0
index 19e8031a3f..01bd8c887f 100644
@@ -541,6 +541,12 @@ static uint64_t mv64361_read(void *opaque, hwaddr 
 addr, unsigned int size)
            }
        }
        break;
+    case MV64340_ETH_PHY_ADDR:
+        ret = 0x98;
+        break;
+    case MV64340_ETH_SMI:
+        ret = BIT(27);
+        break;
    case MV64340_CUNIT_ARBITER_CONTROL_REG:
        ret = 0x11ff0000 | (s->gpp_int_level << 10);
        break;
hw/pci-host/mv643xx.h +1 -0
index cd26a43f18..f2e1baea88 100644
@@ -656,6 +656,9 @@
 /*        Ethernet Unit Registers       */
 /****************************************/
 
+#define MV64340_ETH_PHY_ADDR 

0x2000
+#define MV64340_ETH_SMI
0x2004
+
/*******************************************/
/* CUNIT Registers */
/*******************************************/

#4 lore raw
Quoted 12 lines · BALATON Zoltan
Quoted 11 lines · BALATON Zoltan
Quoted 10 lines · BALATON Zoltan
Quoted 8 lines · BALATON Zoltan

We don't emulate the gigabit ethernet part of the chip but the MorphOS driver accesses these and expects to get some valid looking result otherwise it hangs. Add some minimal dummy implementation to avoid rhis.

---
This is only used by MorphOS on pegasos2 so most likely could go via the ppc queue.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Ping?

Ping?

Ping?
https://patchew.org/QEMU/[email protected]/
It's unlikely this will get a review so can you please just merge it? It's my code so if I break it I'll fix it but this was tested a bit and no problem reported so far.

Thanks,

C.

Quoted 44 lines

Regards,
BALATON Zoltan

Quoted 40 lines
Quoted 38 lines
Quoted 36 lines

hw/pci-host/mv64361.c | 6 ++++++
hw/pci-host/mv643xx.h | 3 +++

2 files changed, 9 insertions(+)
hw/pci-host/mv64361.c +6 -0
index 19e8031a3f..01bd8c887f 100644
@@ -541,6 +541,12 @@ static uint64_t mv64361_read(void *opaque, hwaddr addr, unsigned int size)
             }
         }
         break;
+    case MV64340_ETH_PHY_ADDR:
+        ret = 0x98;
+        break;
+    case MV64340_ETH_SMI:
+        ret = BIT(27);
+        break;

    case MV64340_CUNIT_ARBITER_CONTROL_REG:
        ret = 0x11ff0000 | (s->gpp_int_level << 10); break;

hw/pci-host/mv643xx.h +3 -0
index cd26a43f18..f2e1baea88 100644
@@ -656,6 +656,9 @@
 /*        Ethernet Unit Registers       */
 /****************************************/
 
+#define MV64340_ETH_PHY_ADDR 0x2000
+#define MV64340_ETH_SMI 0x2004
+
 /*******************************************/
 /*          CUNIT  Registers               */
 /*******************************************/
#5 lore raw
In reply to BALATON Zoltan
Quoted 12 lines · BALATON Zoltan
Quoted 11 lines · BALATON Zoltan
Quoted 10 lines · BALATON Zoltan
Quoted 8 lines · BALATON Zoltan

We don't emulate the gigabit ethernet part of the chip but the MorphOS driver accesses these and expects to get some valid looking result otherwise it hangs. Add some minimal dummy implementation to avoid rhis.

---
This is only used by MorphOS on pegasos2 so most likely could go via the ppc queue.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

Ping?

Ping?

Ping?
https://patchew.org/QEMU/[email protected]/
It's unlikely this will get a review so can you please just merge it? It's my code so if I break it I'll fix it but this was tested a bit and no problem reported so far.

Don't worry about it. I'll queue this up.

Daniel

Quoted 43 lines

Regards,
BALATON Zoltan

Quoted 40 lines
Quoted 38 lines
Quoted 36 lines

hw/pci-host/mv64361.c | 6 ++++++
hw/pci-host/mv643xx.h | 3 +++

2 files changed, 9 insertions(+)
hw/pci-host/mv64361.c +6 -0
index 19e8031a3f..01bd8c887f 100644
@@ -541,6 +541,12 @@ static uint64_t mv64361_read(void *opaque, hwaddr addr, unsigned int size)
             }
         }
         break;
+    case MV64340_ETH_PHY_ADDR:
+        ret = 0x98;
+        break;
+    case MV64340_ETH_SMI:
+        ret = BIT(27);
+        break;

    case MV64340_CUNIT_ARBITER_CONTROL_REG:
        ret = 0x11ff0000 | (s->gpp_int_level << 10); break;

hw/pci-host/mv643xx.h +3 -0
index cd26a43f18..f2e1baea88 100644
@@ -656,6 +656,9 @@
 /*        Ethernet Unit Registers       */
 /****************************************/
 
+#define MV64340_ETH_PHY_ADDR 0x2000
+#define MV64340_ETH_SMI 0x2004
+
 /*******************************************/
 /*          CUNIT  Registers               */
 /*******************************************/
#6 lore raw
In reply to BALATON Zoltan
Quoted 9 lines · BALATON Zoltan
Quoted 8 lines · BALATON Zoltan

We don't emulate the gigabit ethernet part of the chip but the MorphOS driver accesses these and expects to get some valid looking result otherwise it hangs. Add some minimal dummy implementation to avoid rhis.

---
This is only used by MorphOS on pegasos2 so most likely could go via the ppc queue.

And it will.

Queued in gitlab.com/danielhb/qemu/tree/ppc-next. Thanks,

Daniel

Quoted 42 lines

Ping?

Regards,
BALATON Zoltan

Quoted 36 lines

hw/pci-host/mv64361.c | 6 ++++++
hw/pci-host/mv643xx.h | 3 +++

2 files changed, 9 insertions(+)
hw/pci-host/mv64361.c +6 -0
index 19e8031a3f..01bd8c887f 100644
@@ -541,6 +541,12 @@ static uint64_t mv64361_read(void *opaque, hwaddr addr, unsigned int size)
             }
         }
         break;
+    case MV64340_ETH_PHY_ADDR:
+        ret = 0x98;
+        break;
+    case MV64340_ETH_SMI:
+        ret = BIT(27);
+        break;

    case MV64340_CUNIT_ARBITER_CONTROL_REG:
        ret = 0x11ff0000 | (s->gpp_int_level << 10); break;

hw/pci-host/mv643xx.h +3 -0
index cd26a43f18..f2e1baea88 100644
@@ -656,6 +656,9 @@
 /*        Ethernet Unit Registers       */
 /****************************************/
 
+#define MV64340_ETH_PHY_ADDR                                        0x2000
+#define MV64340_ETH_SMI                                             0x2004
+
 /*******************************************/
 /*          CUNIT  Registers               */
 /*******************************************/