Hi Pandor,
the issue that there is no vendor specific byte needed anymore when grounding the wire is exactly the point which I do not understand (yet):
Question is: What is this bit which is set to 1 via mode_b; is this the iopin configuration for the output line?
and what is the purpose of this register (because it seems to skip all vendor specific crap...)?
I red that it is possible to make the TS drive behave in the same way by grounding the wire... So there should be a possibility to have such a command also?
Sorry for not answering questions but raising new ones....
If we can get a clearer picture what is going on inside there it would help improving the live cd with sata drivers...
tray_status is a bidirectional I/O pin. tray_status is initially configured as an output. During drive startup the tray_status line is briefly configured as an input and its value is sampled. If the sampled value is logic 1, then the drive enters modeA. If it is logic 0, then the drive enters modeB. Mode A/B is indicated by (598) bit 6 (0 = modeA, 1 = modeB).
ROM:0000664E mov 0xD98C, A2
ROM:00006651 mov 0x30, D0 ! '0'
ROM:00006653 movbu D0, (A2) ; tray_status = input
ROM:00006655 call sub_628E, [D2], 4 ; delay
ROM:0000665A movbu (word_D98C+1), D0 ; read tray_status
ROM:0000665D btst 0x10, D0 ; is tray_status logic 0?
ROM:00006660 beq loc_6669 ; Yes, branch
ROM:00006662 bclr 0x40, (word_598) ; No, so (598) bit 6 = 0 (modeA)
ROM:00006667 bra loc_6680
ROM:00006669 ! ---------------------------------------------------------------------------
ROM:00006669
ROM:00006669 loc_6669: ! CODE XREF: sub_654A+116j
ROM:00006669 bset 0x40, (word_598) ; (598) bit 6 = 1 (modeB)
ROM:0000666E clr D0
ROM:0000666F movbu D0, (0x8003E6D8)
ROM:00006675 mov 1, D0
ROM:00006677 mov 0x64, D1 ! 'd'
ROM:00006679 call sub_1EEB3, [D2,D3,A2], 0x10
ROM:00006680
ROM:00006680 loc_6680:
ROM:00006680 mov 0x20, D0 ! ' '
ROM:00006682 movbu D0, (A2) ; tray_status = output again
ROM:00006684 ret [D2,A2], 0xC
In modeB, the Inquiry handler code does not require the bits 0xC0 in the Inquiry packet. It checks (598) bit 6 and, if it's set (modeB), then it doesn't bother to check for the 0xC0 bits in the packet. This is why the grounding the tray_status wire at startup does not require the 0xC0 byte.
ROM:00024F61 call sub_1B53B, [], 0 ; D0 = (598) bit 6
ROM:00024F68 extb D0
ROM:00024F69 cmp 0, D0 ; is (598) bit 6 zero?
ROM:00024F6B bne loc_24F80 ; no, so skip vendor specific bits check
ROM:00024F6D movbu (word_5BD), D0 ; yes, so check vendor specific bits
ROM:00024F70 mov 0xC0, D1 ! '+'
ROM:00024F73 and D1, D0 ;
ROM:00024F75 cmp D1, D0 ; Are vendor specific set?
ROM:00024F76 beq loc_24F80 ; yes, so continue
ROM:00024F78 mov 0xD, D0 : no, so fail
I hope this clears things up. As far as I know, modeB does NOT change the configuration of any I/O pins.