qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 935cac: mac_via: switch rtc pram trace-events


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 935cac: mac_via: switch rtc pram trace-events to use hex r...
Date: Thu, 18 Mar 2021 03:11:26 -0700

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: 935cac9c80cdbf2654d5aaa37524941967e44c98
      
https://github.com/qemu/qemu/commit/935cac9c80cdbf2654d5aaa37524941967e44c98
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-16 (Tue, 16 Mar 2021)

  Changed paths:
    M hw/misc/trace-events

  Log Message:
  -----------
  mac_via: switch rtc pram trace-events to use hex rather than decimal for 
addresses

Since all the documentation uses the hex offsets, this makes it much easier
to see what is going on.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210311100505.22596-2-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 9d39ec70f41450766cf1c41ad992706fd6507307
      
https://github.com/qemu/qemu/commit/9d39ec70f41450766cf1c41ad992706fd6507307
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-16 (Tue, 16 Mar 2021)

  Changed paths:
    M hw/misc/mac_via.c

  Log Message:
  -----------
  mac_via: fix up adb_via_receive() trace events

The use of the post-increment operator on adb_data_in_index meant that the
trace-event was accidentally displaying the next byte in the incoming ADB
data buffer rather than the current byte.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210311100505.22596-3-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: add4dbfbfc426719d16bdfdc4e5be1a5138ceccd
      
https://github.com/qemu/qemu/commit/add4dbfbfc426719d16bdfdc4e5be1a5138ceccd
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-16 (Tue, 16 Mar 2021)

  Changed paths:
    M hw/misc/mac_via.c

  Log Message:
  -----------
  mac_via: allow long accesses to VIA registers

The MacOS SCSI driver uses a long access to read the VIA registers rather than
just a single byte during the message out phase.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210311100505.22596-4-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: a67ffaf0ec0b38f62fa27e09c69b00518e5945f3
      
https://github.com/qemu/qemu/commit/a67ffaf0ec0b38f62fa27e09c69b00518e5945f3
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-16 (Tue, 16 Mar 2021)

  Changed paths:
    M hw/misc/mac_via.c

  Log Message:
  -----------
  mac_via: don't re-inject ADB response when switching to IDLE state

The current workaround for the Linux ADB state machine in kernels < 5.6 
switching
the VIA back to IDLE state between send and receive modes is to re-inject the
first byte of the response in the IDLE state, and then force the state machine
into generating an autopoll reply.

In fact what is happening is much simpler: analysis of traces from a real Quadra
suggest that the existing data is returned as the first autopoll response rather
than generating an immediate response starting whilst still in IDLE state.

Update the ADB receive code to work in the same way, which allows the 
re-injection
code to be completely removed from adb_via_receive() and for adb_via_poll() to
be simplified accordingly.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20210311100505.22596-5-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 4c8f4ab41c3a057430c789cc7bf3f6dfaa00dc18
      
https://github.com/qemu/qemu/commit/4c8f4ab41c3a057430c789cc7bf3f6dfaa00dc18
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-16 (Tue, 16 Mar 2021)

  Changed paths:
    M hw/misc/mac_via.c
    M include/hw/misc/mac_via.h

  Log Message:
  -----------
  mac_via: rename VBL timer to 60Hz timer

According to the "Guide To The Macintosh Family Hardware", the 60Hz VIA1 timer
on newer Macs such as the Quadra only exists for compatibility with old software
and is no longer synced to the VBL interval.

Rename the VBL timer to 60Hz timer to emphasise this and to prevent confusion
when the real VBL interrupt (now handled as a NuBus slot interrupt) is added in
future.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu>
Message-Id: <20210311100505.22596-6-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 82ff856fe7f6bc6dfba2c60ba6ec24e045696562
      
https://github.com/qemu/qemu/commit/82ff856fe7f6bc6dfba2c60ba6ec24e045696562
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-16 (Tue, 16 Mar 2021)

  Changed paths:
    M hw/misc/mac_via.c

  Log Message:
  -----------
  mac_via: fix 60Hz VIA1 timer interval

The 60Hz timer is initialised using timer_new_ns() meaning that the timer
interval should be measured in ns, and therefore its period is a thousand
times too short.

Use a define for the 60Hz timer period taking the more precise value as
documented in the Guide To The Macintosh Family Hardware.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu>
Message-Id: <20210311100505.22596-7-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 30ca7eddc486646fa19c9619fcf233ceaa65e28c
      
https://github.com/qemu/qemu/commit/30ca7eddc486646fa19c9619fcf233ceaa65e28c
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-16 (Tue, 16 Mar 2021)

  Changed paths:
    M hw/misc/mac_via.c

  Log Message:
  -----------
  mac_via: remove VIA1 timer optimisations

The original implementation of the Macintosh VIA devices in commit 6dca62a000
"hw/m68k: add VIA support" used timer optimisations to reduce high CPU usage on
the host when booting Linux. These optimisations worked by waiting until VIA1
port B was accessed before re-arming the timers.

The MacOS toolbox ROM constantly writes to VIA1 port B which calls
via1_one_second_update() and via1_sixty_hz_update() to calculate the new expiry
time, causing the timers to constantly reset and never fire. The effect of this
is that the Ticks (0x16a) global variable holding the number of 60Hz timer ticks
since reset is never incremented by the interrupt causing time to stand still.

Whilst the code was introduced as a performance optimisation, it is likely that
the high CPU usage was actually caused by the incorrect 60Hz timer interval
fixed in the previous patch. Remove the optimisation to keep everything simple
and enable the MacOS toolbox ROM to start keeping time.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210311100505.22596-8-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: b12498fc575f2ad30f09fe78badc7fef526e2d76
      
https://github.com/qemu/qemu/commit/b12498fc575f2ad30f09fe78badc7fef526e2d76
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2021-03-18 (Thu, 18 Mar 2021)

  Changed paths:
    M hw/misc/mac_via.c
    M hw/misc/trace-events
    M include/hw/misc/mac_via.h

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/vivier/tags/q800-for-6.0-pull-request' 
into staging

q800 pull request 20210316

Several fixes for mac_via needed for future support of MacOS ROM

# gpg: Signature made Tue 16 Mar 2021 21:14:42 GMT
# gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg:                issuer "laurent@vivier.eu"
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" 
[full]
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier/tags/q800-for-6.0-pull-request:
  mac_via: remove VIA1 timer optimisations
  mac_via: fix 60Hz VIA1 timer interval
  mac_via: rename VBL timer to 60Hz timer
  mac_via: don't re-inject ADB response when switching to IDLE state
  mac_via: allow long accesses to VIA registers
  mac_via: fix up adb_via_receive() trace events
  mac_via: switch rtc pram trace-events to use hex rather than decimal for 
addresses

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/56b89f455894...b12498fc575f



reply via email to

[Prev in Thread] Current Thread [Next in Thread]