* [PATCH] hw/net/tulip: add chip status register values
@ 2024-02-05 19:47 Sven Schnelle
2024-02-06 11:30 ` Philippe Mathieu-Daudé
2024-02-06 22:33 ` Helge Deller
0 siblings, 2 replies; 4+ messages in thread
From: Sven Schnelle @ 2024-02-05 19:47 UTC (permalink / raw)
To: Sven Schnelle, Jason Wang; +Cc: deller, qemu-devel
Netbsd isn't able to detect a link on the emulated tulip card. That's
because netbsd reads the Chip Status Register of the Phy (address
0x14). The default phy data in the qemu tulip driver is all zero,
which means no link is established and autonegotation isn't complete.
Therefore set the register to 0x3b40, which means:
Link is up, Autonegotation complete, Full Duplex, 100MBit/s Link
speed.
Also clear the mask because this register is read only.
Signed-off-by: Sven Schnelle <svens@stackframe.org>
---
hw/net/tulip.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/net/tulip.c b/hw/net/tulip.c
index 6d4fb06dad..1f2ef20977 100644
--- a/hw/net/tulip.c
+++ b/hw/net/tulip.c
@@ -421,7 +421,7 @@ static uint16_t tulip_mdi_default[] = {
/* MDI Registers 8 - 15 */
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
/* MDI Registers 16 - 31 */
- 0x0003, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0003, 0x0000, 0x0001, 0x0000, 0x3b40, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
};
@@ -429,7 +429,7 @@ static uint16_t tulip_mdi_default[] = {
static const uint16_t tulip_mdi_mask[] = {
0x0000, 0xffff, 0xffff, 0xffff, 0xc01f, 0xffff, 0xffff, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0fff, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
+ 0x0fff, 0x0000, 0xffff, 0xffff, 0x0000, 0xffff, 0xffff, 0xffff,
0xffff, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
};
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] hw/net/tulip: add chip status register values
2024-02-05 19:47 [PATCH] hw/net/tulip: add chip status register values Sven Schnelle
@ 2024-02-06 11:30 ` Philippe Mathieu-Daudé
2024-02-06 22:33 ` Helge Deller
1 sibling, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-02-06 11:30 UTC (permalink / raw)
To: Sven Schnelle, Jason Wang; +Cc: deller, qemu-devel
On 5/2/24 20:47, Sven Schnelle wrote:
> Netbsd isn't able to detect a link on the emulated tulip card. That's
> because netbsd reads the Chip Status Register of the Phy (address
> 0x14). The default phy data in the qemu tulip driver is all zero,
> which means no link is established and autonegotation isn't complete.
>
> Therefore set the register to 0x3b40, which means:
>
> Link is up, Autonegotation complete, Full Duplex, 100MBit/s Link
> speed.
>
> Also clear the mask because this register is read only.
>
> Signed-off-by: Sven Schnelle <svens@stackframe.org>
> ---
> hw/net/tulip.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] hw/net/tulip: add chip status register values
2024-02-05 19:47 [PATCH] hw/net/tulip: add chip status register values Sven Schnelle
2024-02-06 11:30 ` Philippe Mathieu-Daudé
@ 2024-02-06 22:33 ` Helge Deller
2024-02-09 9:33 ` Helge Deller
1 sibling, 1 reply; 4+ messages in thread
From: Helge Deller @ 2024-02-06 22:33 UTC (permalink / raw)
To: Sven Schnelle, Jason Wang; +Cc: qemu-devel
On 2/5/24 20:47, Sven Schnelle wrote:
> Netbsd isn't able to detect a link on the emulated tulip card. That's
> because netbsd reads the Chip Status Register of the Phy (address
> 0x14). The default phy data in the qemu tulip driver is all zero,
> which means no link is established and autonegotation isn't complete.
>
> Therefore set the register to 0x3b40, which means:
>
> Link is up, Autonegotation complete, Full Duplex, 100MBit/s Link
> speed.
>
> Also clear the mask because this register is read only.
>
> Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-by: Helge Deller <deller@gmx.de>
Tested-by: Helge Deller <deller@gmx.de>
Can be easily tested without installation:
Download: wget https://cdn.netbsd.org/pub/NetBSD/NetBSD-9.3/iso/NetBSD-9.3-hppa.iso
Run: ./qemu-system-hppa -cdrom NetBSD-9.3-hppa.iso -nographic
-> a) Installation on English
-> e) Utility Menu
-> c) configure network
Helge
> ---
> hw/net/tulip.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/net/tulip.c b/hw/net/tulip.c
> index 6d4fb06dad..1f2ef20977 100644
> --- a/hw/net/tulip.c
> +++ b/hw/net/tulip.c
> @@ -421,7 +421,7 @@ static uint16_t tulip_mdi_default[] = {
> /* MDI Registers 8 - 15 */
> 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
> /* MDI Registers 16 - 31 */
> - 0x0003, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
> + 0x0003, 0x0000, 0x0001, 0x0000, 0x3b40, 0x0000, 0x0000, 0x0000,
> 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
> };
>
> @@ -429,7 +429,7 @@ static uint16_t tulip_mdi_default[] = {
> static const uint16_t tulip_mdi_mask[] = {
> 0x0000, 0xffff, 0xffff, 0xffff, 0xc01f, 0xffff, 0xffff, 0x0000,
> 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
> - 0x0fff, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
> + 0x0fff, 0x0000, 0xffff, 0xffff, 0x0000, 0xffff, 0xffff, 0xffff,
> 0xffff, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
> };
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] hw/net/tulip: add chip status register values
2024-02-06 22:33 ` Helge Deller
@ 2024-02-09 9:33 ` Helge Deller
0 siblings, 0 replies; 4+ messages in thread
From: Helge Deller @ 2024-02-09 9:33 UTC (permalink / raw)
To: Jason Wang, qemu-devel; +Cc: Sven Schnelle
On 2/6/24 23:33, Helge Deller wrote:
> On 2/5/24 20:47, Sven Schnelle wrote:
>> Netbsd isn't able to detect a link on the emulated tulip card. That's
>> because netbsd reads the Chip Status Register of the Phy (address
>> 0x14). The default phy data in the qemu tulip driver is all zero,
>> which means no link is established and autonegotation isn't complete.
>>
>> Therefore set the register to 0x3b40, which means:
>>
>> Link is up, Autonegotation complete, Full Duplex, 100MBit/s Link
>> speed.
>>
>> Also clear the mask because this register is read only.
>>
>> Signed-off-by: Sven Schnelle <svens@stackframe.org>
>
> Reviewed-by: Helge Deller <deller@gmx.de>
> Tested-by: Helge Deller <deller@gmx.de>
Unless someone complains, I'll include this patch
in the upcoming hppa pull request...
Helge
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-02-09 9:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-05 19:47 [PATCH] hw/net/tulip: add chip status register values Sven Schnelle
2024-02-06 11:30 ` Philippe Mathieu-Daudé
2024-02-06 22:33 ` Helge Deller
2024-02-09 9:33 ` Helge Deller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).