diff mbox series

[1/8] mac_via: update comment for VIA1B_vMystery bit

Message ID 20211013212132.31519-2-mark.cave-ayland@ilande.co.uk
State New
Headers show
Series q800: GLUE updates for A/UX mode | expand

Commit Message

Mark Cave-Ayland Oct. 13, 2021, 9:21 p.m. UTC
According to both Linux and NetBSD, port B bit 6 is used on the Quadra 800 to
configure the GLUE logic in A/UX mode. Whilst the name VIA1B_vMystery isn't
particularly descriptive, the patch leaves this to ensure that the constants
in mac_via.c remain in sync with Linux's mac_via.h.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
 hw/misc/mac_via.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Laurent Vivier Oct. 15, 2021, 6:14 a.m. UTC | #1
Le 13/10/2021 à 23:21, Mark Cave-Ayland a écrit :
> According to both Linux and NetBSD, port B bit 6 is used on the Quadra 800 to
> configure the GLUE logic in A/UX mode. Whilst the name VIA1B_vMystery isn't
> particularly descriptive, the patch leaves this to ensure that the constants
> in mac_via.c remain in sync with Linux's mac_via.h.
> 
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> ---
>  hw/misc/mac_via.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/hw/misc/mac_via.c b/hw/misc/mac_via.c
> index 993bac017d..7a53a8b4c0 100644
> --- a/hw/misc/mac_via.c
> +++ b/hw/misc/mac_via.c
> @@ -130,6 +130,10 @@
>                                  * On SE/30, vertical sync interrupt enable.
>                                  * 0=enabled. This vSync interrupt shows up
>                                  * as a slot $E interrupt.
> +                                * On Quadra 800 this bit toggles A/UX mode which
> +                                * configures the glue logic to deliver some IRQs
> +                                * at different levels compared to a classic
> +                                * Mac.
>                                  */
>  #define VIA1B_vADBS2   0x20    /* ADB state input bit 1 (unused on IIfx) */
>  #define VIA1B_vADBS1   0x10    /* ADB state input bit 0 (unused on IIfx) */
> 

I'm not sure we need to keep in sync a word that neither used by linux or qemu (for now).

Perhaps you can put a word from where it is (NetBSD)?

It seems it's supported by all Quadra, not only Quadra 800 (see NetBSD comment in mac68k/machdep.c

Anyway:

Reviewed-by: Laurent Vivier <laurent@vivier.Eu>
Mark Cave-Ayland Oct. 15, 2021, 7:30 p.m. UTC | #2
On 15/10/2021 07:14, Laurent Vivier wrote:

> Le 13/10/2021 à 23:21, Mark Cave-Ayland a écrit :
>> According to both Linux and NetBSD, port B bit 6 is used on the Quadra 800 to
>> configure the GLUE logic in A/UX mode. Whilst the name VIA1B_vMystery isn't
>> particularly descriptive, the patch leaves this to ensure that the constants
>> in mac_via.c remain in sync with Linux's mac_via.h.
>>
>> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
>> ---
>>   hw/misc/mac_via.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/hw/misc/mac_via.c b/hw/misc/mac_via.c
>> index 993bac017d..7a53a8b4c0 100644
>> --- a/hw/misc/mac_via.c
>> +++ b/hw/misc/mac_via.c
>> @@ -130,6 +130,10 @@
>>                                   * On SE/30, vertical sync interrupt enable.
>>                                   * 0=enabled. This vSync interrupt shows up
>>                                   * as a slot $E interrupt.
>> +                                * On Quadra 800 this bit toggles A/UX mode which
>> +                                * configures the glue logic to deliver some IRQs
>> +                                * at different levels compared to a classic
>> +                                * Mac.
>>                                   */
>>   #define VIA1B_vADBS2   0x20    /* ADB state input bit 1 (unused on IIfx) */
>>   #define VIA1B_vADBS1   0x10    /* ADB state input bit 0 (unused on IIfx) */
>>
> 
> I'm not sure we need to keep in sync a word that neither used by linux or qemu (for now).
> 
> Perhaps you can put a word from where it is (NetBSD)?
> 
> It seems it's supported by all Quadra, not only Quadra 800 (see NetBSD comment in mac68k/machdep.c
> 
> Anyway:
> 
> Reviewed-by: Laurent Vivier <laurent@vivier.Eu>

Yeah, it's a hard one: you can see the bit referenced in the via_alt_mapping logic in 
Linux but mac_via.h still shows it as VIA1B_vMystery (and indeed, it seems to have 
different uses on different machines). The thought behind adding the comment was to 
better explain the purpose of VIA1B_vMystery within the series.


ATB,

Mark.
diff mbox series

Patch

diff --git a/hw/misc/mac_via.c b/hw/misc/mac_via.c
index 993bac017d..7a53a8b4c0 100644
--- a/hw/misc/mac_via.c
+++ b/hw/misc/mac_via.c
@@ -130,6 +130,10 @@ 
                                 * On SE/30, vertical sync interrupt enable.
                                 * 0=enabled. This vSync interrupt shows up
                                 * as a slot $E interrupt.
+                                * On Quadra 800 this bit toggles A/UX mode which
+                                * configures the glue logic to deliver some IRQs
+                                * at different levels compared to a classic
+                                * Mac.
                                 */
 #define VIA1B_vADBS2   0x20    /* ADB state input bit 1 (unused on IIfx) */
 #define VIA1B_vADBS1   0x10    /* ADB state input bit 0 (unused on IIfx) */