Received: from eggs.gnu.org ([2001:4830:134:3::10]:49379) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X6zuM-00081u-1f for qemu-devel@nongnu.org; Tue, 15 Jul 2014 06:24:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X6zuE-0006Rb-Mb for qemu-devel@nongnu.org; Tue, 15 Jul 2014 06:24:25 -0400 Received: from mail.tu-berlin.de ([130.149.7.33]:63297) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X6zuE-0006Nx-Es for qemu-devel@nongnu.org; Tue, 15 Jul 2014 06:24:18 -0400 Message-ID: <53C501DD.3090805@ilr.tu-berlin.de> Date: Tue, 15 Jul 2014 12:26:37 +0200 From: Alexander Graf MIME-Version: 1.0 References: <53C295C8.5040309@antistatix.de> <53C3C32A.4060705@redhat.com> <53C41CEC.5030705@campus.tu-berlin.de> <53C43F9B.6090907@redhat.com> <53C44742.2010104@campus.tu-berlin.de> <53C4D2FC.50402@redhat.com> In-Reply-To: <53C4D2FC.50402@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] hw/arm: add Lego NXT board List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , Peter Maydell , Alexander Graf Cc: QEMU Developers On 07/15/2014 12:48 AM, Peter Maydell wrote: > Right, but this is an optional part of Paolo's proposal as I understand > it. You could just have your fake sensors be implemented by some > userspace process on the other end of a filedescriptor, as you do now > but with i2c rather than custom protocol. This would also let you run > the same bit of firmware in the guest as would be on the real h/w. > Ah, thank you, I finally realised that you are talking about the -chardev argument (I just discovered that option.) and not only about linux character devices. It seems I reinvented the wheel while implementing the pipes. What a waste of time :) On 07/15/2014 09:06 AM, Paolo Bonzini wrote: > As to the protocol, I found a datasheet of an I2C-to-UART bridge that > could provide ideas: > http://www.nxp.com/documents/data_sheet/SC18IM700.pdf chapter 7, it's > very simple (just two commands, start and stop). Thanks for the idea. I still don't get why it should be better to fake an I2C device rather than a universal memory IO. I don't want to emulate the controllers hardware, but only communicate the abstract sensor/actuator values. In addition not all Sensors are I2C devices, so there is no value in doing it via an I2C bus. Even the simple I2C protocol mentioned in the data sheet is more complex than mine. Could you point me to the code where the chardev devices are defined in qemu? Alexander