Introduce a debug control register. It can be used to lock the gdbstub ROM and enable/disable bus errors. The gdbstub ROM will be read/writeable until one writes the corresponding lock bit to this register. This will ease future gdbstub updates.
…y to bios Signed-off-by: Xiangfu Liu <email@example.com>
Along with the logic to handle multiple interfaces, commit a26dc51 also introduced the following bug: When a keyboard or composite device with keyboard was replaced by a mouse after enumeration, the stack would still poll the "keyboard", which most likely resulted in the mouse data to be b drained and discarded. This patch clears the EP roles on disconnect.
Since usb_rx is now only used to receive ACK/NAK, we can replace it with a more streamlined version. This should also marginally improve error handling.
This patch partially unrolls usb_in and takes decisions on the further disposition of a packet at early as possible. The objective is to minimize the processing needed between EOP of the DATAx packet and the sending of an ACK. The patch also changes error handling in two ways: 1) when deciding to discard a packet, always wait until the device really stops sending 2) packets with a garbled PID are treated as non-fatal errors
This is mainly cosmetic, to reduce the amount of code. It adds retry on timeout, though. Again, as a side-effect, debug messages become a bit less detailed.
Besides reducing some redundancy, this patch also makes the following changes: - retry on timeout (e.g., if the DATAx packet was garbled) in the data stage of control transfers instead of failing the entire transfer - retry IN tranfers in the status stage - reject IN transfers in the status stage if they have the wrong sequence bit (more USB 1.1 sec 8.5.2 and USB 2.0 sec 8.5.3) - slightly reduce the information in debugging output since control and bulk/interrupt now use the same code path for IN transfers The streamlined code path also makes full-speed work occasionally.