From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MiVh6-0003wj-Dy for qemu-devel@nongnu.org; Tue, 01 Sep 2009 11:54:52 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MiVh3-0003uW-CW for qemu-devel@nongnu.org; Tue, 01 Sep 2009 11:54:51 -0400 Received: from [199.232.76.173] (port=41421 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MiVh3-0003ti-1Z for qemu-devel@nongnu.org; Tue, 01 Sep 2009 11:54:49 -0400 Received: from ey-out-1920.google.com ([74.125.78.145]:21312) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MiVh1-0008Fe-Ad for qemu-devel@nongnu.org; Tue, 01 Sep 2009 11:54:47 -0400 Received: by ey-out-1920.google.com with SMTP id 13so48531eye.14 for ; Tue, 01 Sep 2009 08:54:45 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Blue Swirl Date: Tue, 1 Sep 2009 18:54:24 +0300 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: [Qemu-devel] Re: sparc esp dma endianness [patch-rfc] List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Artyom Tarasenko Cc: qemu-devel On Mon, Aug 31, 2009 at 11:48 PM, Artyom Tarasenko wrote: > Trying to find out what could be the mysterious scsi commands 60, 80, > c0 and e0, I found out that OBP during dma exchange has problems with > endianness. > OBP sends commands like this: > 12 20 00 00 05 00 or this 12 80 00 00 05 00, but esp.c expects > that the second byte is the command and the first one is the target. > > The following patch solves the problem, but breaks OpenBIOS. The > question is where do we have wrong endianness? It's not necessarily > esp, it may be something on the way like dma or mmu. Any ideas? In addition to OpenBIOS, I'd also think Linux, NetBSD and OpenBSD should break. Lance needs similar operation, but there the bus is little endian and one bit configures byte swapping for some of data. Usually the first byte is bus id. What if you changed (as a hack) here: DPRINTF("do_cmd: busid 0x%x\n", buf[0]); lun = buf[0] & 7; datalen = s->current_dev->send_command(s->current_dev, 0, &buf[1], lun); &buf[1] to &buf[0]?