qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/9] escc: fix reset and R_STATUS when SDLC mode is enabled
@ 2021-09-02 10:21 Mark Cave-Ayland
  2021-09-02 10:21 ` [PATCH v2 1/9] escc: checkpatch fixes Mark Cave-Ayland
                   ` (8 more replies)
  0 siblings, 9 replies; 15+ messages in thread
From: Mark Cave-Ayland @ 2021-09-02 10:21 UTC (permalink / raw)
  To: qemu-devel, laurent

Here are another set of ESCC fixes from my attempts to boot MacOS on the q800
machine.

Patch 1 fixes up the formatting so that the remainder of the patchset keeps
checkpatch happy.

Patches 2-8 rework the reset handling so that the QEMU device reset is separate
from the ESCC in-built hardware and software reset as defined in the datasheet.
The aim here is two-fold: allow QEMU's device reset to place the ESCC device in
a known state (although we assume all registers are zeroed whilst their values are
undefined according to the datasheet) and ensure that the reset commands sent by
the MacOS OpenTransport extension on boot don't re-assert the active low
STATUS_SYNC bit in R_STATUS.

Finally patch 9 is the real fix: when entering SDLC mode using an "Enter hunt"
command the STATUS_SYNC bit in R_STATUS must remain high until the flag byte
is detected. Without this fix the active low STATUS_SYNC is continually asserted
causing the MacOS OpenTransport extension to hang on startup as it believes it is
constantly receiving LocalTalk traffic during its initial negotiation phase.

NOTE: this patchset currently fails CI because it exposed a bug that OpenBIOS
doesn't send ESCC channel reset commands before attempting to configure and use
the serial port. Those patches have just been posted to the OpenBIOS mailing list
here: https://mail.coreboot.org/hyperkitty/list/openbios@openbios.org/thread/PQCW5RDIDIEUYBVAHNIY3OMHCEVYYWPU/.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>


v2:
- Rebase onto master
- Rewrite cover letter to cover new reset changes
- Change reset to separate out QEMU device reset, soft reset and hard reset
  (ensuring register values are updated as specified in the datasheet)
- Add R-B tags from Peter


Mark Cave-Ayland (9):
  escc: checkpatch fixes
  escc: reset register values to zero in escc_reset()
  escc: introduce escc_soft_reset_chn() for software reset
  escc: introduce escc_hard_reset_chn() for hardware reset
  escc: implement soft reset as described in the datasheet
  escc: implement hard reset as described in the datasheet
  escc: remove register changes from escc_reset_chn()
  escc: re-use escc_reset_chn() for hard and soft reset
  escc: fix STATUS_SYNC bit in R_STATUS register

 hw/char/escc.c | 281 ++++++++++++++++++++++++++++++++++---------------
 1 file changed, 197 insertions(+), 84 deletions(-)

-- 
2.20.1



^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-09-02 19:37 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-02 10:21 [PATCH v2 0/9] escc: fix reset and R_STATUS when SDLC mode is enabled Mark Cave-Ayland
2021-09-02 10:21 ` [PATCH v2 1/9] escc: checkpatch fixes Mark Cave-Ayland
2021-09-02 10:21 ` [PATCH v2 2/9] escc: reset register values to zero in escc_reset() Mark Cave-Ayland
2021-09-02 10:21 ` [PATCH v2 3/9] escc: introduce escc_soft_reset_chn() for software reset Mark Cave-Ayland
2021-09-02 10:22 ` [PATCH v2 4/9] escc: introduce escc_hard_reset_chn() for hardware reset Mark Cave-Ayland
2021-09-02 15:42   ` Peter Maydell
2021-09-02 17:46     ` Mark Cave-Ayland
2021-09-02 19:31       ` Peter Maydell
2021-09-02 19:36         ` Mark Cave-Ayland
2021-09-02 10:22 ` [PATCH v2 5/9] escc: implement soft reset as described in the datasheet Mark Cave-Ayland
2021-09-02 10:22 ` [PATCH v2 6/9] escc: implement hard " Mark Cave-Ayland
2021-09-02 10:22 ` [PATCH v2 7/9] escc: remove register changes from escc_reset_chn() Mark Cave-Ayland
2021-09-02 10:22 ` [PATCH v2 8/9] escc: re-use escc_reset_chn() for hard and soft reset Mark Cave-Ayland
2021-09-02 10:26   ` Philippe Mathieu-Daudé
2021-09-02 10:22 ` [PATCH v2 9/9] escc: fix STATUS_SYNC bit in R_STATUS register Mark Cave-Ayland

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).