Hello Cedríc, Thanks for your response. I created and attached the patch. You are right the code snipped turns out unreadable.
In the patch I enable the MAC's depending on the value in hwstrap1 just as in the real hardware. In the Palmetto both nics will be enabled (just as in the real palmetto). I added a 2nd AST2400 BMC the Eltan Piestewa Peak. Here I enabled the 2nd NIC only. What I see is that when I use Palmetto I get an assert in net/net.c line 256, this is in the "qemu_net_client_setup()". I assume I have to prepare something regarding the host side of the network implementation but I this point I have no clue what and I have a hard time figuring out how the networking architecture really works. If you could point me in the right direction I would really appreciate it. Best Regards, Wim Vervoorn Eltan B.V. Ambachtstraat 23 5481 SM Schijndel The Netherlands T : +31-(0)73-594 46 64 E : wvervo...@eltan.com W : http://www.eltan.com -----Original Message----- From: Cédric Le Goater [mailto:c...@kaod.org] Sent: Thursday, May 16, 2019 5:06 PM To: Wim Vervoorn <wvervo...@eltan.com> Subject: Re: aspeed qemu question Hello Wim, On 5/16/19 10:46 AM, Wim Vervoorn wrote: > Hello Cédric, > > > > I noticed you are responsible for most of the Aspeed additions to Qemu > perhaps you can help me. Sure, > > > I am trying to add support for the 2^nd NIC on the Aspeed SoC. ok. This should be possible. > This seemed not that hard. Basically I added a 2^nd structure for the device > and initialized that. I included the code below. hmm. This is difficult for me to read. Do you know how to send patches ? It would be good to send a patch to the QEMU devel and the QEMU ARM mailing list so that we can discuss openly. I can help you doing that. Cheers, C. > The code is building fine no problem about that. > > > > The issue is that I get an assert net.c line 256, this only happens if I > realize both NICs if I realize only one all works as expected. My question > is, am I overlooking something here? Do I need to take more actions to be > able to support the 2^nd NIC? If you could point me in the right direction or > know where I can find more information on the qemu architecture I would > really appreciate it. > > > > > > > > staticvoidqemu_net_client_setup(NetClientState *nc, > > NetClientInfo *info, > > NetClientState *peer, > > constchar*model, > > constchar*name, > > NetClientDestructor *destructor) > > { > > nc->info= info; > > nc->model= g_strdup(model); > > if(name) { > > nc->name= g_strdup(name); > > } else{ > > nc->name= assign_name(nc, model); > > } > > > > if(peer) { > > à> assert(!peer->peer); > > nc->peer= peer; > > peer->peer= nc; > > } > > > > > > object_initialize(&s->ftgmac100[0], sizeof(s->ftgmac100), > TYPE_FTGMAC100); > > object_property_add_child(obj, "ftgmac100[0]", > OBJECT(&s->ftgmac100[0]), NULL); > > qdev_set_parent_bus(DEVICE(&s->ftgmac100[0]), > sysbus_get_default()); > > > > object_initialize(&s->ftgmac100[1], sizeof(s->ftgmac100), > TYPE_FTGMAC100); > > object_property_add_child(obj, "ftgmac100[1]", > OBJECT(&s->ftgmac100[1]), NULL); > > qdev_set_parent_bus(DEVICE(&s->ftgmac100[1]), > sysbus_get_default()); > > > > > > > > /* Net LAN 0*/ > > #if(0) > > qemu_log_mask(LOG_GUEST_ERROR, "%s: LAN0\n", __func__); > > qdev_set_nic_properties(DEVICE(&s->ftgmac100[0]), &nd_table[0]); > > object_property_set_bool(OBJECT(&s->ftgmac100[0]), true, "aspeed", > &err); > > object_property_set_bool(OBJECT(&s->ftgmac100[0]), true, > "realized", > > &local_err); > > error_propagate(&err, local_err); > > if (err) { > > error_propagate(errp, err); > > return; > > } > > sysbus_mmio_map(SYS_BUS_DEVICE(&s->ftgmac100[0]), 0, > ASPEED_SOC_ETH1_BASE); > > sysbus_connect_irq(SYS_BUS_DEVICE(&s->ftgmac100[0]), 0, > > qdev_get_gpio_in(DEVICE(&s->vic), 2)); > > #endif > > > > /* Net LAN 1*/ > > #if(1) > > qemu_log_mask(LOG_GUEST_ERROR, "%s: LAN1\n", __func__); > > qdev_set_nic_properties(DEVICE(&s->ftgmac100[1]), &nd_table[1]); > > object_property_set_bool(OBJECT(&s->ftgmac100[1]), true, "aspeed", > &err); > > object_property_set_bool(OBJECT(&s->ftgmac100[1]), true, > "realized", > > &local_err); > > error_propagate(&err, local_err); > > if(err) { > > error_propagate(errp, err); > > return; > > } > > sysbus_mmio_map(SYS_BUS_DEVICE(&s->ftgmac100[1]), 0, > ASPEED_SOC_ETH2_BASE); > > sysbus_connect_irq(SYS_BUS_DEVICE(&s->ftgmac100[1]), 0, > > qdev_get_gpio_in(DEVICE(&s->vic), 3)); > > #endif > > > > > > Best Regards, > > Wim Vervoorn > > > > Eltan B.V. > > Ambachtstraat 23 > > 5481 SM Schijndel > > The Netherlands > > > > T : +31-(0)73-594 46 64 > > E : wvervo...@eltan.com > > W : http://www.eltan.com <http://www.eltan.com/> > > > > > > "THIS MESSAGE CONTAINS CONFIDENTIAL INFORMATION. UNLESS YOU ARE THE > INTENDED RECIPIENT OF THIS MESSAGE, ANY USE OF THIS MESSAGE IS STRICTLY > PROHIBITED. IF YOU HAVE RECEIVED THIS MESSAGE IN ERROR, PLEASE IMMEDIATELY > NOTIFY THE SENDER BY TELEPHONE +31-(0)73-5944664 OR REPLY EMAIL, AND > IMMEDIATELY DELETE THIS MESSAGE AND ALL COPIES." > > >
0002-ASPEED-BMC-Add-support-for-2nd-NIC.patch
Description: 0002-ASPEED-BMC-Add-support-for-2nd-NIC.patch