All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Delevoryas <pdel@fb.com>
Cc: "patrick@stwcx.xyz" <patrick@stwcx.xyz>,
	"qemu-arm@nongnu.org" <qemu-arm@nongnu.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Klaus Jensen" <its@irrelevant.dk>,
	"Cédric Le Goater" <clg@kaod.org>
Subject: Re: [PATCH v2 1/1] hw/arm/aspeed: Add fby35 machine type
Date: Fri, 6 May 2022 17:16:56 +0000	[thread overview]
Message-ID: <97A49820-76B2-4FAA-95C4-C1A5CD75C9CE@fb.com> (raw)
In-Reply-To: <97674ac7-17c5-06cf-6bd0-0e7acc37abcc@kaod.org>



> On May 5, 2022, at 11:30 PM, Cédric Le Goater <clg@kaod.org> wrote:
> 
> On 5/4/22 18:34, Peter Delevoryas wrote:
>>> On May 4, 2022, at 12:39 AM, Cédric Le Goater <clg@kaod.org> wrote:
>>> 
>>> On 5/4/22 00:59, Peter Delevoryas wrote:
>>>> Add the 'fby35-bmc' machine type based on the kernel DTS[1] and userspace
>>>> i2c setup scripts[2]. Undefined values are inherited from the AST2600-EVB.
>>>> Reference images can be found in Facebook OpenBMC Github Release assets
>>>> as "fby35.mtd". [3]
>>>> You can boot the reference images as follows (fby35 uses dual-flash):
>>>> qemu-system-arm -machine fby35-bmc \
>>>> -drive file=fby35.mtd,format=raw,if=mtd \
>>>> -drive file=fby35.mtd,format=raw,if=mtd \
>>>> -nographic
>>>> [1] https://github.com/facebook/openbmc-linux/blob/412d5053258007117e94b1e36015aefc1301474b/arch/arm/boot/dts/aspeed-bmc-facebook-fby35.dts
>>>> [2] https://github.com/facebook/openbmc/blob/e2294ff5d31dd65c248fe396a385286d6d5c463d/meta-facebook/meta-fby35/recipes-fby35/plat-utils/files/setup-dev.sh
>>>> [3] https://github.com/facebook/openbmc/releases
>>>> Signed-off-by: Peter Delevoryas <pdel@fb.com>
>>> 
>>> Reviewed-by: Cédric Le Goater <clg@kaod.org>
>> Thanks!
> 
> Could you please send a v2 with an update of the documentation ?
> or a follow up ? no need to resend the first patch unless you
> want to change something. A one-liner in :
> 
> https://qemu.readthedocs.io/en/latest/system/arm/aspeed.html 
> [ ... ]
> 

Oh, yeah I’ll send a follow-up, I don’t have anything else to change on the first patch I suppose.

>> As a matter of fact yes! I tested booting our OpenBIC Zephyr kernel last week with the 1030, that worked. I also used the experimental i2c multi-master patches from Klaus to make a i2c-netdev device that connects two separate QEMU instances through a socket and sends their i2c messages back and forth. I was able to test a basic MCTP transaction.
> 
> Nice ! And do you need anything special from the I2C Aspeed models ?
> Apart from :
> 
> https://patchwork.ozlabs.org/project/qemu-devel/list/?series=292928 

Nope, I don’t need anything else, those exact patches were sufficient. I didn’t need any additional
modifications to the i2c send_async model Klaus made.

My code was not very sophisticated though, it just assumes ACK for every byte in an i2c message,
buffers them, and then sends the i2c message as a UDP packet. The receiver buffers the i2c message
and asynchronously dequeues each byte through send_async (after mastering the bus). I’ll post the
diff as an RFC soon, in case it helps with evaluating Klaus’s changes.

https://github.com/facebook/openbmc-qemu/commit/c03730986d521ca2a06fd4570d29f2452d13f8da

The problem I foresee is that people are interested in NACK emulation, Smbus ARP, and generally,
emulating an i2c _bus_ with a multicast UDP socket and not point-to-point i2c device connections.
That way you can have multiple QEMU’s listen to a single multicast UDP socket or something
and filter out messages that are directed at other i2c devices, something like that. And, probably
send each byte individually instead of buffering and sending. But, buffering stuff works for
my purposes for now, since I’m more interested in enabling higher level MCTP testing than
simulating i2c multi-master contention.

>> I’m hoping to help however possible with merging Klaus’s changes, 
> 
> They don't need much work. Klaus doesn't have the datasheet, so we
> should help him with the changes requiring some internal knowledge.
> 
>> and then propose the i2c-netdev thing too.
> 
> I was going to ask since I didn't see any models for such devices.
> 
> I hope to do something similar with the usb-net device but it needs
> fixes first.

Oh I wasn’t aware anyone was doing something similar, I’ll have to look at how you did
that.

> 
> Thanks,
> 
> C.


  parent reply	other threads:[~2022-05-06 17:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-03 22:59 [PATCH v2 0/1] hw/arm/aspeed: Add fby35 machine type Peter Delevoryas
2022-05-03 22:59 ` [PATCH v2 1/1] " Peter Delevoryas
2022-05-04  7:39   ` Cédric Le Goater
2022-05-04 16:34     ` Peter Delevoryas
2022-05-04 19:07       ` Peter Delevoryas
2022-05-06  6:36         ` Cédric Le Goater
2022-05-06  6:30       ` Cédric Le Goater
2022-05-06  6:56         ` Klaus Jensen
2022-05-06 17:16         ` Peter Delevoryas [this message]
2022-05-25  8:40   ` Cédric Le Goater
2022-05-25 15:27     ` Peter Delevoryas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=97A49820-76B2-4FAA-95C4-C1A5CD75C9CE@fb.com \
    --to=pdel@fb.com \
    --cc=clg@kaod.org \
    --cc=its@irrelevant.dk \
    --cc=patrick@stwcx.xyz \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.