From nobody Sun Dec 29 00:36:16 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1719994722; cv=none; d=zohomail.com; s=zohoarc; b=S4Rs9TPrC5OWnSmnJDWulN/R3SrfGpPj+8jQXSdiPxIbk0PxehiRfbQXHtHxKH6ICT2ArpviSHv70NIjV/sUR0WbN+DipGb5D4ksK+EZO2QDHVCzT6rJgucEAj/f95hPQfxc5w71mh4FrdmgXCxVXdbTqtzNAB1Cw38I/VWpkaI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719994722; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=t+oWEIIbtrDWkPJ8pJmkqIF1ll4jxwFCMxYrpoxD5/w=; b=aEgg/qb4uCJW49tMPPz1GqqVe/QDVgEnhY1+anBryya0Rep6nKa2Om1xQDmajnA2LuI4VpNOvt5kaVn2m6rJzicDPlUU5p4kr0lqLHWqMji6IyjstyJcP4Irdd3sod1rTOqTeTHzkxmJybB5YNsuxcDI/5Lu25Os+P1qVZ2pQH4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1719994722013433.5320259250716; Wed, 3 Jul 2024 01:18:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sOvAr-0003Ly-1z; Wed, 03 Jul 2024 04:17:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sOvAp-0003LG-DW; Wed, 03 Jul 2024 04:17:07 -0400 Received: from mail.aspeedtech.com ([211.20.114.72] helo=TWMBX01.aspeed.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sOvAo-00014r-0X; Wed, 03 Jul 2024 04:17:07 -0400 Received: from TWMBX02.aspeed.com (192.168.0.24) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.1258.12; Wed, 3 Jul 2024 16:16:25 +0800 Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX02.aspeed.com (192.168.0.25) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 3 Jul 2024 16:16:25 +0800 Received: from localhost.localdomain (192.168.10.10) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1258.12 via Frontend Transport; Wed, 3 Jul 2024 16:16:25 +0800 To: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Peter Maydell , Steven Lee , Troy Lee , Andrew Jeffery , "Joel Stanley" , Alistair Francis , "Kevin Wolf" , Hanna Reitz , Jason Wang , Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Wainer dos Santos Moschetta" , Beraldo Leal , "open list:ASPEED BMCs" , "open list:All patches CC here" , "open list:Block layer core" CC: , , Subject: [PATCH v2 1/5] hw/net:ftgmac100: update memory region size to 0x200 Date: Wed, 3 Jul 2024 16:16:19 +0800 Message-ID: <20240703081623.2740862-2-jamin_lin@aspeedtech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240703081623.2740862-1-jamin_lin@aspeedtech.com> References: <20240703081623.2740862-1-jamin_lin@aspeedtech.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: Fail (TWMBX02.aspeed.com: domain of jamin_lin@aspeedtech.com does not designate 192.168.10.10 as permitted sender) receiver=TWMBX02.aspeed.com; client-ip=192.168.10.10; helo=localhost.localdomain; Received-SPF: pass client-ip=211.20.114.72; envelope-from=jamin_lin@aspeedtech.com; helo=TWMBX01.aspeed.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_FAIL=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Jamin Lin From: Jamin Lin via Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZM-MESSAGEID: 1719994722615100001 Content-Type: text/plain; charset="utf-8" According to the datasheet of ASPEED SOCs, one MAC controller owns 128KB of register space for AST2500. However, one MAC controller only owns 64KB of register space for AST2600 and AST2700. It set the memory region size 128KB and it occupied another controllers Address Spaces. Currently, the ftgmac100 model use 0x100 register space. To support DMA 64 bits dram address and new future mode(ftgmac100_high) whi= ch have "Normal Priority Transmit Ring Base Address Register High(0x17C)", "High Priority Transmit Ring Base Address Register High(0x184)" and "Receive Ring Base Address Register High(0x18C)" to save the high part phys= ical address of descriptor manager. Update memory region size to 0x200. Signed-off-by: Jamin Lin --- hw/net/ftgmac100.c | 2 +- include/hw/net/ftgmac100.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/net/ftgmac100.c b/hw/net/ftgmac100.c index 25e4c0cd5b..4e88430b2f 100644 --- a/hw/net/ftgmac100.c +++ b/hw/net/ftgmac100.c @@ -1108,7 +1108,7 @@ static void ftgmac100_realize(DeviceState *dev, Error= **errp) } =20 memory_region_init_io(&s->iomem, OBJECT(dev), &ftgmac100_ops, s, - TYPE_FTGMAC100, 0x2000); + TYPE_FTGMAC100, FTGMAC100_NR_REGS); sysbus_init_mmio(sbd, &s->iomem); sysbus_init_irq(sbd, &s->irq); qemu_macaddr_default_if_unset(&s->conf.macaddr); diff --git a/include/hw/net/ftgmac100.h b/include/hw/net/ftgmac100.h index 765d1538a4..5a970676da 100644 --- a/include/hw/net/ftgmac100.h +++ b/include/hw/net/ftgmac100.h @@ -14,6 +14,8 @@ #define TYPE_FTGMAC100 "ftgmac100" OBJECT_DECLARE_SIMPLE_TYPE(FTGMAC100State, FTGMAC100) =20 +#define FTGMAC100_NR_REGS 0x200 + #include "hw/sysbus.h" #include "net/net.h" =20 --=20 2.34.1 From nobody Sun Dec 29 00:36:16 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1719994667; cv=none; d=zohomail.com; s=zohoarc; b=BvdPgiWLeAkwGtl1ad2A4eHD4B+0FUljVC9G0QI5rvsF0Od0M6jmVGN41hrxzEQ6CWpHEP4kCr3oIZILw1gvn0Z1Nqc6h6bzW59g2s6GFPOVvcPRe+cUlxkM81rE4mQ+EVwdT/KfeHLxnO8FK6jYPT9Py4ADWbLj8579Tc6bQjc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719994667; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=IhRA5qHMnIv7ykmeUU/i78tHFhMTyENl3wcXhJ36gJc=; b=eHxfd6gsgXCvs0KOiW2Mk6NJYX69NHQKeKHhDij1nCNzeEAgE3XGc6nqtsLdtqzDLgV2nbwmOlDWpBxLP/FFdLxIZFwI0QJ+mRdYxfn/zWqtFqL2U6jiP3FzKSQm+1e2QZLuUb1GDiTerfie0qKvuBsgHeDTx1h8j6jXsESj+qs= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1719994667201899.5705251961994; Wed, 3 Jul 2024 01:17:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sOvAf-0003GM-K1; Wed, 03 Jul 2024 04:16:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sOvAe-0003Fu-A6; Wed, 03 Jul 2024 04:16:56 -0400 Received: from mail.aspeedtech.com ([211.20.114.72] helo=TWMBX01.aspeed.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sOvAX-00014r-DB; Wed, 03 Jul 2024 04:16:53 -0400 Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12; Wed, 3 Jul 2024 16:16:25 +0800 Received: from localhost.localdomain (192.168.10.10) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1258.12 via Frontend Transport; Wed, 3 Jul 2024 16:16:25 +0800 To: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Peter Maydell , Steven Lee , Troy Lee , Andrew Jeffery , "Joel Stanley" , Alistair Francis , "Kevin Wolf" , Hanna Reitz , Jason Wang , Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Wainer dos Santos Moschetta" , Beraldo Leal , "open list:ASPEED BMCs" , "open list:All patches CC here" , "open list:Block layer core" CC: , , Subject: [PATCH v2 2/5] hw/net:ftgmac100: support 64 bits dma dram address for AST2700 Date: Wed, 3 Jul 2024 16:16:20 +0800 Message-ID: <20240703081623.2740862-3-jamin_lin@aspeedtech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240703081623.2740862-1-jamin_lin@aspeedtech.com> References: <20240703081623.2740862-1-jamin_lin@aspeedtech.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=211.20.114.72; envelope-from=jamin_lin@aspeedtech.com; helo=TWMBX01.aspeed.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_FAIL=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Jamin Lin From: Jamin Lin via Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZM-MESSAGEID: 1719994668716100003 Content-Type: text/plain; charset="utf-8" ASPEED AST2700 SOC is a 64 bits quad core CPUs (Cortex-a35) And the base address of dram is "0x4 00000000" which is 64bits address. It have "Normal Priority Transmit Ring Base Address Register High(0x17C)", "High Priority Transmit Ring Base Address Register High(0x184)" and "Receive Ring Base Address Register High(0x18C)" to save the high part phys= ical address of descriptor manager. Ex: TX descriptor manager address [34:0] The "Normal Priority Transmit Ring Base Address Register High(0x17C)" bits [2:0] which corresponds the bits [34:32] of the 64 bits address of the TX ring buffer address. The "Normal Priority Transmit Ring Base Address Register(0x20)" bits [31:0] which corresponds the bits [31:0] of the 64 bits address of the TX ring buffer address. Besides, it have "TXDES 2" and "RXDES 2" to save the high part physical address of packet buffer. Ex: TX packet buffer address [34:0] The "TXDES 2" bits [18:16] which corresponds the bits [34:32] of the 64 bits address of the TX packet buffer address and "TXDES 3" bits [31:0] which corresponds the bits [31:0] of the 64 bits address of the TX packet buffer address. Update TX/RX ring and descriptor data type to uint64_t and supports TX/RX ring, descriptor and packet buffers 64 bits address for all ASPEED SOCs models. Incrementing the version of vmstate to 2. Introduce a new class(ftgmac100_high), class attribute and memop handlers, the realize handler instantiate a new memory region and map it on top of the current one to read/write FTGMAC100_*_HIGH regs. Signed-off-by: Jamin Lin --- hw/net/ftgmac100.c | 156 ++++++++++++++++++++++++++++++++----- include/hw/net/ftgmac100.h | 24 ++++-- 2 files changed, 151 insertions(+), 29 deletions(-) diff --git a/hw/net/ftgmac100.c b/hw/net/ftgmac100.c index 4e88430b2f..3d13f54efc 100644 --- a/hw/net/ftgmac100.c +++ b/hw/net/ftgmac100.c @@ -56,6 +56,16 @@ #define FTGMAC100_PHYDATA 0x64 #define FTGMAC100_FCR 0x68 =20 +/* + * FTGMAC100 High registers + * + * values below are offset by - FTGMAC100_HIGH_OFFSET from datasheet + * because its memory region is start at FTGMAC100_HIGH_OFFSET + */ +#define FTGMAC100_NPTXR_BADR_HIGH (0x17C - FTGMAC100_HIGH_OFFSET) +#define FTGMAC100_HPTXR_BADR_HIGH (0x184 - FTGMAC100_HIGH_OFFSET) +#define FTGMAC100_RXR_BADR_HIGH (0x18C - FTGMAC100_HIGH_OFFSET) + /* * Interrupt status register & interrupt enable register */ @@ -165,6 +175,8 @@ #define FTGMAC100_TXDES1_TX2FIC (1 << 30) #define FTGMAC100_TXDES1_TXIC (1 << 31) =20 +#define FTGMAC100_TXDES2_TXBUF_BADR_HI(x) (((x) >> 16) & 0x7) + /* * Receive descriptor */ @@ -198,13 +210,15 @@ #define FTGMAC100_RXDES1_UDP_CHKSUM_ERR (1 << 26) #define FTGMAC100_RXDES1_IP_CHKSUM_ERR (1 << 27) =20 +#define FTGMAC100_RXDES2_RXBUF_BADR_HI(x) (((x) >> 16) & 0x7) + /* * Receive and transmit Buffer Descriptor */ typedef struct { uint32_t des0; uint32_t des1; - uint32_t des2; /* not used by HW */ + uint32_t des2; /* used by HW high address */ uint32_t des3; } FTGMAC100Desc; =20 @@ -515,12 +529,14 @@ out: return frame_size; } =20 -static void ftgmac100_do_tx(FTGMAC100State *s, uint32_t tx_ring, - uint32_t tx_descriptor) +static void ftgmac100_do_tx(FTGMAC100State *s, uint64_t tx_ring, + uint64_t tx_descriptor) { + FTGMAC100Class *fc =3D FTGMAC100_GET_CLASS(s); int frame_size =3D 0; uint8_t *ptr =3D s->frame; - uint32_t addr =3D tx_descriptor; + uint64_t addr =3D tx_descriptor; + uint64_t buf_addr =3D 0; uint32_t flags =3D 0; =20 while (1) { @@ -559,7 +575,12 @@ static void ftgmac100_do_tx(FTGMAC100State *s, uint32_= t tx_ring, len =3D sizeof(s->frame) - frame_size; } =20 - if (dma_memory_read(&address_space_memory, bd.des3, + buf_addr =3D bd.des3; + if (fc->is_dma64) { + buf_addr =3D deposit64(buf_addr, 32, 32, + FTGMAC100_TXDES2_TXBUF_BADR_HI(bd.des2)); + } + if (dma_memory_read(&address_space_memory, buf_addr, ptr, len, MEMTXATTRS_UNSPECIFIED)) { qemu_log_mask(LOG_GUEST_ERROR, "%s: failed to read packet @ 0x= %x\n", __func__, bd.des3); @@ -726,9 +747,9 @@ static uint64_t ftgmac100_read(void *opaque, hwaddr add= r, unsigned size) case FTGMAC100_MATH1: return s->math[1]; case FTGMAC100_RXR_BADR: - return s->rx_ring; + return extract64(s->rx_ring, 0, 32); case FTGMAC100_NPTXR_BADR: - return s->tx_ring; + return extract64(s->tx_ring, 0, 32); case FTGMAC100_ITC: return s->itc; case FTGMAC100_DBLAC: @@ -799,9 +820,8 @@ static void ftgmac100_write(void *opaque, hwaddr addr, HWADDR_PRIx "\n", __func__, value); return; } - - s->rx_ring =3D value; - s->rx_descriptor =3D s->rx_ring; + s->rx_ring =3D deposit64(s->rx_ring, 0, 32, value); + s->rx_descriptor =3D deposit64(s->rx_descriptor, 0, 32, value); break; =20 case FTGMAC100_RBSR: /* DMA buffer size */ @@ -814,8 +834,8 @@ static void ftgmac100_write(void *opaque, hwaddr addr, HWADDR_PRIx "\n", __func__, value); return; } - s->tx_ring =3D value; - s->tx_descriptor =3D s->tx_ring; + s->tx_ring =3D deposit64(s->tx_ring, 0, 32, value); + s->tx_descriptor =3D deposit64(s->tx_descriptor, 0, 32, value); break; =20 case FTGMAC100_NPTXPD: /* Trigger transmit */ @@ -914,6 +934,60 @@ static void ftgmac100_write(void *opaque, hwaddr addr, ftgmac100_update_irq(s); } =20 +static uint64_t ftgmac100_high_read(void *opaque, hwaddr addr, unsigned si= ze) +{ + FTGMAC100State *s =3D FTGMAC100(opaque); + uint64_t val =3D 0; + + switch (addr) { + case FTGMAC100_NPTXR_BADR_HIGH: + val =3D extract64(s->tx_ring, 32, 32); + break; + case FTGMAC100_HPTXR_BADR_HIGH: + /* High Priority Transmit Ring Base High Address */ + qemu_log_mask(LOG_UNIMP, "%s: read to unimplemented register 0x%" + HWADDR_PRIx "\n", __func__, addr); + break; + case FTGMAC100_RXR_BADR_HIGH: + val =3D extract64(s->rx_ring, 32, 32); + break; + default: + qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad address at offset 0x%" + HWADDR_PRIx "\n", __func__, addr); + break; + } + + return val; +} + +static void ftgmac100_high_write(void *opaque, hwaddr addr, + uint64_t value, unsigned size) +{ + FTGMAC100State *s =3D FTGMAC100(opaque); + + switch (addr) { + case FTGMAC100_NPTXR_BADR_HIGH: + s->tx_ring =3D deposit64(s->tx_ring, 32, 32, value); + s->tx_descriptor =3D deposit64(s->tx_descriptor, 32, 32, value); + break; + case FTGMAC100_HPTXR_BADR_HIGH: + /* High Priority Transmit Ring Base High Address */ + qemu_log_mask(LOG_UNIMP, "%s: write to unimplemented register 0x%" + HWADDR_PRIx "\n", __func__, addr); + break; + case FTGMAC100_RXR_BADR_HIGH: + s->rx_ring =3D deposit64(s->rx_ring, 32, 32, value); + s->rx_descriptor =3D deposit64(s->rx_descriptor, 32, 32, value); + break; + default: + qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad address at offset 0x%" + HWADDR_PRIx "\n", __func__, addr); + break; + } + + ftgmac100_update_irq(s); +} + static int ftgmac100_filter(FTGMAC100State *s, const uint8_t *buf, size_t = len) { unsigned mcast_idx; @@ -955,11 +1029,12 @@ static ssize_t ftgmac100_receive(NetClientState *nc,= const uint8_t *buf, size_t len) { FTGMAC100State *s =3D FTGMAC100(qemu_get_nic_opaque(nc)); + FTGMAC100Class *fc =3D FTGMAC100_GET_CLASS(s); FTGMAC100Desc bd; uint32_t flags =3D 0; - uint32_t addr; + uint64_t addr; uint32_t crc; - uint32_t buf_addr; + uint64_t buf_addr =3D 0; uint8_t *crc_ptr; uint32_t buf_len; size_t size =3D len; @@ -1024,7 +1099,12 @@ static ssize_t ftgmac100_receive(NetClientState *nc,= const uint8_t *buf, if (size < 4) { buf_len +=3D size - 4; } + buf_addr =3D bd.des3; + if (fc->is_dma64) { + buf_addr =3D deposit64(buf_addr, 32, 32, + FTGMAC100_RXDES2_RXBUF_BADR_HI(bd.des2)); + } if (first && proto =3D=3D ETH_P_VLAN && buf_len >=3D 18) { bd.des1 =3D lduw_be_p(buf + 14) | FTGMAC100_RXDES1_VLANTAG_AVA= IL; =20 @@ -1078,6 +1158,14 @@ static const MemoryRegionOps ftgmac100_ops =3D { .endianness =3D DEVICE_LITTLE_ENDIAN, }; =20 +static const MemoryRegionOps ftgmac100_high_ops =3D { + .read =3D ftgmac100_high_read, + .write =3D ftgmac100_high_write, + .valid.min_access_size =3D 4, + .valid.max_access_size =3D 4, + .endianness =3D DEVICE_LITTLE_ENDIAN, +}; + static void ftgmac100_cleanup(NetClientState *nc) { FTGMAC100State *s =3D FTGMAC100(qemu_get_nic_opaque(nc)); @@ -1097,6 +1185,7 @@ static NetClientInfo net_ftgmac100_info =3D { static void ftgmac100_realize(DeviceState *dev, Error **errp) { FTGMAC100State *s =3D FTGMAC100(dev); + FTGMAC100Class *fc =3D FTGMAC100_GET_CLASS(s); SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); =20 if (s->aspeed) { @@ -1107,9 +1196,17 @@ static void ftgmac100_realize(DeviceState *dev, Erro= r **errp) s->rxdes0_edorr =3D FTGMAC100_RXDES0_EDORR; } =20 - memory_region_init_io(&s->iomem, OBJECT(dev), &ftgmac100_ops, s, + memory_region_init_io(&s->iomem, OBJECT(s), &ftgmac100_ops, s, TYPE_FTGMAC100, FTGMAC100_NR_REGS); sysbus_init_mmio(sbd, &s->iomem); + + if (fc->is_dma64) { + memory_region_init_io(&s->iomem_high, OBJECT(s), &ftgmac100_high_o= ps, + s, TYPE_FTGMAC100_HIGH, FTGMAC100_HIGH_NR_RE= GS); + memory_region_add_subregion(&s->iomem, FTGMAC100_HIGH_OFFSET, + &s->iomem_high); + } + sysbus_init_irq(sbd, &s->irq); qemu_macaddr_default_if_unset(&s->conf.macaddr); =20 @@ -1121,18 +1218,14 @@ static void ftgmac100_realize(DeviceState *dev, Err= or **errp) =20 static const VMStateDescription vmstate_ftgmac100 =3D { .name =3D TYPE_FTGMAC100, - .version_id =3D 1, - .minimum_version_id =3D 1, + .version_id =3D 2, + .minimum_version_id =3D 2, .fields =3D (const VMStateField[]) { VMSTATE_UINT32(irq_state, FTGMAC100State), VMSTATE_UINT32(isr, FTGMAC100State), VMSTATE_UINT32(ier, FTGMAC100State), VMSTATE_UINT32(rx_enabled, FTGMAC100State), - VMSTATE_UINT32(rx_ring, FTGMAC100State), VMSTATE_UINT32(rbsr, FTGMAC100State), - VMSTATE_UINT32(tx_ring, FTGMAC100State), - VMSTATE_UINT32(rx_descriptor, FTGMAC100State), - VMSTATE_UINT32(tx_descriptor, FTGMAC100State), VMSTATE_UINT32_ARRAY(math, FTGMAC100State, 2), VMSTATE_UINT32(itc, FTGMAC100State), VMSTATE_UINT32(aptcr, FTGMAC100State), @@ -1151,6 +1244,10 @@ static const VMStateDescription vmstate_ftgmac100 = =3D { VMSTATE_UINT32(phy_int_mask, FTGMAC100State), VMSTATE_UINT32(txdes0_edotr, FTGMAC100State), VMSTATE_UINT32(rxdes0_edorr, FTGMAC100State), + VMSTATE_UINT64(rx_ring, FTGMAC100State), + VMSTATE_UINT64(tx_ring, FTGMAC100State), + VMSTATE_UINT64(rx_descriptor, FTGMAC100State), + VMSTATE_UINT64(tx_descriptor, FTGMAC100State), VMSTATE_END_OF_LIST() } }; @@ -1180,6 +1277,22 @@ static const TypeInfo ftgmac100_info =3D { .class_init =3D ftgmac100_class_init, }; =20 +static void ftgmac100_high_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(klass); + FTGMAC100Class *fc =3D FTGMAC100_CLASS(klass); + + dc->desc =3D "Faraday FTGMAC100 Gigabit Ethernet High emulation"; + fc->is_dma64 =3D true; +} + +static const TypeInfo ftgmac100_high_info =3D { + .name =3D TYPE_FTGMAC100_HIGH, + .parent =3D TYPE_FTGMAC100, + .instance_size =3D sizeof(FTGMAC100State), + .class_init =3D ftgmac100_high_class_init, +}; + /* * AST2600 MII controller */ @@ -1342,6 +1455,7 @@ static const TypeInfo aspeed_mii_info =3D { static void ftgmac100_register_types(void) { type_register_static(&ftgmac100_info); + type_register_static(&ftgmac100_high_info); type_register_static(&aspeed_mii_info); } =20 diff --git a/include/hw/net/ftgmac100.h b/include/hw/net/ftgmac100.h index 5a970676da..3e44ed97c9 100644 --- a/include/hw/net/ftgmac100.h +++ b/include/hw/net/ftgmac100.h @@ -12,13 +12,15 @@ #include "qom/object.h" =20 #define TYPE_FTGMAC100 "ftgmac100" -OBJECT_DECLARE_SIMPLE_TYPE(FTGMAC100State, FTGMAC100) +#define TYPE_FTGMAC100_HIGH "ftgmac100_high" +OBJECT_DECLARE_TYPE(FTGMAC100State, FTGMAC100Class, FTGMAC100) =20 -#define FTGMAC100_NR_REGS 0x200 +#define FTGMAC100_NR_REGS 0x200 +#define FTGMAC100_HIGH_OFFSET 0x100 +#define FTGMAC100_HIGH_NR_REGS 0x100 =20 #include "hw/sysbus.h" #include "net/net.h" - /* * Max frame size for the receiving buffer */ @@ -33,6 +35,7 @@ struct FTGMAC100State { NICConf conf; qemu_irq irq; MemoryRegion iomem; + MemoryRegion iomem_high; =20 uint8_t frame[FTGMAC100_MAX_FRAME_SIZE]; =20 @@ -40,10 +43,6 @@ struct FTGMAC100State { uint32_t isr; uint32_t ier; uint32_t rx_enabled; - uint32_t rx_ring; - uint32_t rx_descriptor; - uint32_t tx_ring; - uint32_t tx_descriptor; uint32_t math[2]; uint32_t rbsr; uint32_t itc; @@ -56,7 +55,10 @@ struct FTGMAC100State { uint32_t phycr; uint32_t phydata; uint32_t fcr; - + uint64_t rx_ring; + uint64_t rx_descriptor; + uint64_t tx_ring; + uint64_t tx_descriptor; =20 uint32_t phy_status; uint32_t phy_control; @@ -69,6 +71,12 @@ struct FTGMAC100State { uint32_t rxdes0_edorr; }; =20 +struct FTGMAC100Class { + SysBusDeviceClass parent_class; + + bool is_dma64; +}; + #define TYPE_ASPEED_MII "aspeed-mmi" OBJECT_DECLARE_SIMPLE_TYPE(AspeedMiiState, ASPEED_MII) =20 --=20 2.34.1 From nobody Sun Dec 29 00:36:16 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1719994709; cv=none; d=zohomail.com; s=zohoarc; b=li7Y/Gs4gfwZLxN8mHb6udk1c1hkrVPo/Vh8p39abPCQDY3tlHnuC0M2u8EwnGskQQpSteM9f/3n7UXkz9r4wJX9QCddaRmD6Ts/L05oiW+Y7k7GJkoS93QikEewhh/88JY42FrujId0zLEqYQnaQ1fO8TDfxQLcJiew8CopAfw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719994709; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=u/OgqHtzguGTYj3JunW541UYTQVAy/aLoIWqqzLTxrY=; b=KJUCw2PXAKrYk+P8b1YSa352XUv0/etiemqXmI79QBACMRjMvi/0qeDcVYv2qQC5sF9iewxidUNL+885K5UhKTmwTVeMytKQvCoSFdycsupi0y7IpAql2gVnhkAf4QbniMA8SlgZUxNcAiFW2IXtDV4QxueKXtSRhVJw93Tn7lQ= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 171999470991175.71940318618442; Wed, 3 Jul 2024 01:18:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sOvAi-0003I9-Lb; Wed, 03 Jul 2024 04:17:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sOvAg-0003HX-Va; Wed, 03 Jul 2024 04:16:59 -0400 Received: from mail.aspeedtech.com ([211.20.114.72] helo=TWMBX01.aspeed.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sOvAf-00014r-FS; Wed, 03 Jul 2024 04:16:58 -0400 Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12; Wed, 3 Jul 2024 16:16:25 +0800 Received: from localhost.localdomain (192.168.10.10) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1258.12 via Frontend Transport; Wed, 3 Jul 2024 16:16:25 +0800 To: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Peter Maydell , Steven Lee , Troy Lee , Andrew Jeffery , "Joel Stanley" , Alistair Francis , "Kevin Wolf" , Hanna Reitz , Jason Wang , Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Wainer dos Santos Moschetta" , Beraldo Leal , "open list:ASPEED BMCs" , "open list:All patches CC here" , "open list:Block layer core" CC: , , Subject: [PATCH v2 3/5] aspeed/soc: update to ftgmac100_high model for AST2700 Date: Wed, 3 Jul 2024 16:16:21 +0800 Message-ID: <20240703081623.2740862-4-jamin_lin@aspeedtech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240703081623.2740862-1-jamin_lin@aspeedtech.com> References: <20240703081623.2740862-1-jamin_lin@aspeedtech.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=211.20.114.72; envelope-from=jamin_lin@aspeedtech.com; helo=TWMBX01.aspeed.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_FAIL=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Jamin Lin From: Jamin Lin via Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZM-MESSAGEID: 1719994710611100001 Content-Type: text/plain; charset="utf-8" ASPEED AST2700 SOC is a 64 bits quad core CPUs (Cortex-a35) And the base address of dram is "0x4 00000000" which is 64bits address. Update its network model to ftgmac100_high to support 64bits dram address DMA. Signed-off-by: Jamin Lin --- hw/arm/aspeed_ast27x0.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/arm/aspeed_ast27x0.c b/hw/arm/aspeed_ast27x0.c index 18e6a8b10c..04604a4bef 100644 --- a/hw/arm/aspeed_ast27x0.c +++ b/hw/arm/aspeed_ast27x0.c @@ -332,7 +332,7 @@ static void aspeed_soc_ast2700_init(Object *obj) =20 for (i =3D 0; i < sc->macs_num; i++) { object_initialize_child(obj, "ftgmac100[*]", &s->ftgmac100[i], - TYPE_FTGMAC100); + TYPE_FTGMAC100_HIGH); =20 object_initialize_child(obj, "mii[*]", &s->mii[i], TYPE_ASPEED_MII= ); } @@ -552,6 +552,7 @@ static void aspeed_soc_ast2700_realize(DeviceState *dev= , Error **errp) return; } =20 + /* Net */ for (i =3D 0; i < sc->macs_num; i++) { object_property_set_bool(OBJECT(&s->ftgmac100[i]), "aspeed", true, &error_abort); --=20 2.34.1 From nobody Sun Dec 29 00:36:16 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1719994710; cv=none; d=zohomail.com; s=zohoarc; b=gVhdg0eNOdY1Kuka7NSX0VjZ9yfGGezNHbODOAMFgMaHdSr99/0FffEIpWb9LRbZ4G0qL2Kesw0evvKhxJOqgXLUeP5ZTXQ0zzclfws4oN+7c4DplqozsA3TOsjWZzt1NI2lk2LMnYDoi64p7YxhpOGgpL8nQ8GFi5B1uys4muM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719994710; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=qKGYwsTaROH09PBP02IJEcw6k1/sl2IEJ1elPo6SqA8=; b=V5cZRX4xLJLvyvs4K0KW2UHNyqsCP2gtSu8NQrzY0O2V1d4TNUE0kk9PFga1GuxnNM5sbr0Zeb8FdmlOMpc/qCBSSdwaIq4UtDST7R0CzR+v0c9yORT1yeu1z16+qPNYyuwW2Cn3ziDq2WGe9BKsef7Dlen0bPZ46NzE4WigG5U= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 171999471041939.6842019731547; Wed, 3 Jul 2024 01:18:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sOvAm-0003JQ-FZ; Wed, 03 Jul 2024 04:17:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sOvAk-0003Iy-Mr; Wed, 03 Jul 2024 04:17:02 -0400 Received: from mail.aspeedtech.com ([211.20.114.72] helo=TWMBX01.aspeed.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sOvAi-00014r-5c; Wed, 03 Jul 2024 04:17:01 -0400 Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12; Wed, 3 Jul 2024 16:16:26 +0800 Received: from localhost.localdomain (192.168.10.10) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1258.12 via Frontend Transport; Wed, 3 Jul 2024 16:16:26 +0800 To: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Peter Maydell , Steven Lee , Troy Lee , Andrew Jeffery , "Joel Stanley" , Alistair Francis , "Kevin Wolf" , Hanna Reitz , Jason Wang , Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Wainer dos Santos Moschetta" , Beraldo Leal , "open list:ASPEED BMCs" , "open list:All patches CC here" , "open list:Block layer core" CC: , , Subject: [PATCH v2 4/5] hw/block: m25p80: support quad mode for w25q01jvq Date: Wed, 3 Jul 2024 16:16:22 +0800 Message-ID: <20240703081623.2740862-5-jamin_lin@aspeedtech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240703081623.2740862-1-jamin_lin@aspeedtech.com> References: <20240703081623.2740862-1-jamin_lin@aspeedtech.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=211.20.114.72; envelope-from=jamin_lin@aspeedtech.com; helo=TWMBX01.aspeed.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_FAIL=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Jamin Lin From: Jamin Lin via Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZM-MESSAGEID: 1719994710617100002 Content-Type: text/plain; charset="utf-8" According to the w25q01jv datasheet at page 16, it is required to set QE bit in "Status Register 2". Besides, users are able to utilize "Write Status Register 1(0x01)" command to set QE bit in "Status Register 2" and utilize "Read Status Register 2(0x35)" command to get the QE bit status. To support quad mode for w25q01jvq, update collecting data needed 2 bytes for WRSR command in decode_new_cmd function and verify QE bit at the second byte of collecting data bit 2 in complete_collecting_data. Update RDCR_EQIO command to set bit 2 of return data if quad mode enable in decode_new_cmd. Signed-off-by: Troy Lee Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater --- hw/block/m25p80.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c index 8dec134832..9e99107b42 100644 --- a/hw/block/m25p80.c +++ b/hw/block/m25p80.c @@ -416,6 +416,7 @@ typedef enum { /* * Micron: 0x35 - enable QPI * Spansion: 0x35 - read control register + * Winbond: 0x35 - quad enable */ RDCR_EQIO =3D 0x35, RSTQIO =3D 0xf5, @@ -798,6 +799,11 @@ static void complete_collecting_data(Flash *s) s->four_bytes_address_mode =3D extract32(s->data[1], 5, 1); } break; + case MAN_WINBOND: + if (s->len > 1) { + s->quad_enable =3D !!(s->data[1] & 0x02); + } + break; default: break; } @@ -1254,6 +1260,10 @@ static void decode_new_cmd(Flash *s, uint32_t value) s->needed_bytes =3D 2; s->state =3D STATE_COLLECTING_VAR_LEN_DATA; break; + case MAN_WINBOND: + s->needed_bytes =3D 2; + s->state =3D STATE_COLLECTING_VAR_LEN_DATA; + break; default: s->needed_bytes =3D 1; s->state =3D STATE_COLLECTING_DATA; @@ -1431,6 +1441,12 @@ static void decode_new_cmd(Flash *s, uint32_t value) case MAN_MACRONIX: s->quad_enable =3D true; break; + case MAN_WINBOND: + s->data[0] =3D (!!s->quad_enable) << 1; + s->pos =3D 0; + s->len =3D 1; + s->state =3D STATE_READING_DATA; + break; default: break; } --=20 2.34.1 From nobody Sun Dec 29 00:36:16 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1719994681; cv=none; d=zohomail.com; s=zohoarc; b=mJWGTs9QE6Ufc+zcnByKuf2B8feCQf/KQmqaYUmrfIeiUmegMshgnReYeu1ir8eZ/BZZCdLig9921AABVh+z5602u0RgNDQznohjlcY/T0RXVrinVwGAOzoUgMxoaZEdAh9Y7MRfRPnrMgwx3hu391YAPCiF6xgQUkahJEqiR/U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719994681; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=o5InGcdOCObDX0sYn84XC3stgyuiWkwWl5UkNKSFfzY=; b=g2WiR+U5cYThHZOvoCDUCzVMKzioigWzVWYDlocl7LDetseCzVpxbs8kq6cGSjabl41b46oZziGDw9r0oU7+excVQy4Ej+uI0SgjfWj2yFDgBeDJ9lktDVXrsQuy/toQ9EtDdJw1pLywqQlwWpz3sH/aj0Wjp2vVhdgkcqK88Ro= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 171999468172539.69184336405931; Wed, 3 Jul 2024 01:18:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sOvAp-0003Lc-Tg; Wed, 03 Jul 2024 04:17:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sOvAm-0003Js-MV; Wed, 03 Jul 2024 04:17:05 -0400 Received: from mail.aspeedtech.com ([211.20.114.72] helo=TWMBX01.aspeed.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sOvAk-00014r-VI; Wed, 03 Jul 2024 04:17:04 -0400 Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12; Wed, 3 Jul 2024 16:16:26 +0800 Received: from localhost.localdomain (192.168.10.10) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1258.12 via Frontend Transport; Wed, 3 Jul 2024 16:16:26 +0800 To: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Peter Maydell , Steven Lee , Troy Lee , Andrew Jeffery , "Joel Stanley" , Alistair Francis , "Kevin Wolf" , Hanna Reitz , Jason Wang , Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Wainer dos Santos Moschetta" , Beraldo Leal , "open list:ASPEED BMCs" , "open list:All patches CC here" , "open list:Block layer core" CC: , , Subject: [PATCH v2 5/5] test/avocado/machine_aspeed.py: update to test network for AST2700 Date: Wed, 3 Jul 2024 16:16:23 +0800 Message-ID: <20240703081623.2740862-6-jamin_lin@aspeedtech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240703081623.2740862-1-jamin_lin@aspeedtech.com> References: <20240703081623.2740862-1-jamin_lin@aspeedtech.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=211.20.114.72; envelope-from=jamin_lin@aspeedtech.com; helo=TWMBX01.aspeed.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_FAIL=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Jamin Lin From: Jamin Lin via Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZM-MESSAGEID: 1719994682467100001 Content-Type: text/plain; charset="utf-8" Update a test case to test network connection via ssh and changes to test Aspeed OpenBMC SDK v09.02 for AST2700. ASPEED fixed TX mask issue from linux/drivers/ftgmac100.c. It is required to use ASPEED SDK image since v09.02 for AST2700 QEMU network testing. A test image is downloaded from the ASPEED Forked OpenBMC GitHub release repository : https://github.com/AspeedTech-BMC/openbmc/releases/ Test command: ``` cd build pyvenv/bin/avocado run ../qemu/tests/avocado/machine_aspeed.py:AST2x00Machi= neSDK.test_aarch64_ast2700_evb_sdk_v09_02 ``` Signed-off-by: Jamin Lin --- tests/avocado/machine_aspeed.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/avocado/machine_aspeed.py b/tests/avocado/machine_aspeed= .py index 3a20644fb2..855da805ae 100644 --- a/tests/avocado/machine_aspeed.py +++ b/tests/avocado/machine_aspeed.py @@ -313,14 +313,14 @@ def do_test_arm_aspeed_sdk_start(self, image): =20 def do_test_aarch64_aspeed_sdk_start(self, image): self.vm.set_console() - self.vm.add_args('-drive', 'file=3D' + image + ',if=3Dmtd,format= =3Draw') + self.vm.add_args('-drive', 'file=3D' + image + ',if=3Dmtd,format= =3Draw', + '-net', 'nic', '-net', 'user,hostfwd=3D:127.0.0.1= :0-:22') =20 self.vm.launch() =20 self.wait_for_console_pattern('U-Boot 2023.10') self.wait_for_console_pattern('## Loading kernel from FIT Image') self.wait_for_console_pattern('Starting kernel ...') - self.wait_for_console_pattern("systemd[1]: Hostname set to") =20 @skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS'), 'Test is unstable on G= itLab') =20 @@ -387,15 +387,15 @@ def test_arm_ast2600_evb_sdk(self): year =3D time.strftime("%Y") self.ssh_command_output_contains('/sbin/hwclock -f /dev/rtc1', yea= r); =20 - def test_aarch64_ast2700_evb_sdk_v09_01(self): + def test_aarch64_ast2700_evb_sdk_v09_02(self): """ :avocado: tags=3Darch:aarch64 :avocado: tags=3Dmachine:ast2700-evb """ =20 image_url =3D ('https://github.com/AspeedTech-BMC/openbmc/releases= /' - 'download/v09.01/ast2700-default-obmc.tar.gz') - image_hash =3D 'b1cc0fd73c7650d34c9c8459a243f52a91e9e27144b8608b26= 45ab19461d1e07' + 'download/v09.02/ast2700-default-obmc.tar.gz') + image_hash =3D 'ac969c2602f4e6bdb69562ff466b89ae3fe1d86e1f6797bb79= 69d787f82116a7' image_path =3D self.fetch_asset(image_url, asset_hash=3Dimage_hash, algorithm=3D'sha256') archive.extract(image_path, self.workdir) @@ -436,4 +436,5 @@ def test_aarch64_ast2700_evb_sdk_v09_01(self): =20 self.vm.add_args('-smp', str(num_cpu)) self.do_test_aarch64_aspeed_sdk_start(image_dir + 'image-bmc') - + self.wait_for_console_pattern('nodistro.0 ast2700-default ttyS12') + self.ssh_connect('root', '0penBmc', False) --=20 2.34.1