From nobody Sun Nov 24 18:39:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1720525977; cv=none; d=zohomail.com; s=zohoarc; b=hWBeX9bi6fDvd7ufR733aIAE0wXWLqpPyWNy8ZetBET5imQoCdFDfH/hH5ffs+j3+oXMZOAngo9U3MHwfHwHKANz+cbcJ+HkbmENwgeiuKxbegPCSjZcuVkecInD+TWzcLYPb3AYOMLcrp/gDQ5yMKiph81dbchQkYbozDZMTGg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720525977; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=dEDuTv8Lc1Ps4eGjmhzrrf4rkRo15i2vTl21HQehUUo=; b=lpgBE6WlUzW75IPxP0PbEadfK9RMTaj+YJn69CUBHvQH4egF8v48ImTEPuBB3Dax8zS4uwD8P1n7dJ3XI1va63Pl6Mi4Lt6BwhAPpQNq+jQRrOSHu/UKA5+yiOT8/7jmIu8CItZgT1/sQa1BZcxdmnGBDshqG4Zpm8OTILGMCRA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=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 1720525977134828.5904142116424; Tue, 9 Jul 2024 04:52:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sR9Ou-0000iN-LI; Tue, 09 Jul 2024 07:52:52 -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 1sR9Ot-0000Vl-CT for qemu-devel@nongnu.org; Tue, 09 Jul 2024 07:52:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sR9Oo-0006WX-48 for qemu-devel@nongnu.org; Tue, 09 Jul 2024 07:52:51 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-417-YLozJ8FFN8G1G4rbod1jaQ-1; Tue, 09 Jul 2024 07:52:41 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 553A61956048; Tue, 9 Jul 2024 11:52:34 +0000 (UTC) Received: from corto.redhat.com (unknown [10.39.193.243]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 947423000181; Tue, 9 Jul 2024 11:52:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720525962; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dEDuTv8Lc1Ps4eGjmhzrrf4rkRo15i2vTl21HQehUUo=; b=gl+E5jDbSDg8yEm0GOV7tCLdTM8qI8WKo3pn2tgDsQe9iKhwOtGIb8GnBE3mvFW09YFAQh k+X+LYqjt7bkH5YBdIt1bBfxLWVwWi++wIO53LvIqdTUIuANNxpkTjQZW6H9wFrOIMLY5T zkO2nzzclNcJ5YV896P00aQZrXo0rzE= X-MC-Unique: YLozJ8FFN8G1G4rbod1jaQ-1 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 1/8] hw/net:ftgmac100: update memory region size to 64KB Date: Tue, 9 Jul 2024 13:52:21 +0200 Message-ID: <20240709115228.798904-2-clg@redhat.com> In-Reply-To: <20240709115228.798904-1-clg@redhat.com> References: <20240709115228.798904-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.144, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1720525979108116600 From: Jamin Lin 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. Update one MAC controller memory region size to 0x1000 because AST2500 did not use register spaces over than 64KB. Introduce a new container region size to 0x1000 and its range is from 0 to 0xfff. This container is mapped a sub region for the current set of register. This sub region range is from 0 to 0xff. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater --- include/hw/net/ftgmac100.h | 4 ++++ hw/net/ftgmac100.c | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/include/hw/net/ftgmac100.h b/include/hw/net/ftgmac100.h index 765d1538a49f..269446e85838 100644 --- a/include/hw/net/ftgmac100.h +++ b/include/hw/net/ftgmac100.h @@ -14,6 +14,9 @@ #define TYPE_FTGMAC100 "ftgmac100" OBJECT_DECLARE_SIMPLE_TYPE(FTGMAC100State, FTGMAC100) =20 +#define FTGMAC100_MEM_SIZE 0x1000 +#define FTGMAC100_REG_MEM_SIZE 0x100 + #include "hw/sysbus.h" #include "net/net.h" =20 @@ -30,6 +33,7 @@ struct FTGMAC100State { NICState *nic; NICConf conf; qemu_irq irq; + MemoryRegion iomem_container; MemoryRegion iomem; =20 uint8_t frame[FTGMAC100_MAX_FRAME_SIZE]; diff --git a/hw/net/ftgmac100.c b/hw/net/ftgmac100.c index 25e4c0cd5bfe..9e1f12cd331b 100644 --- a/hw/net/ftgmac100.c +++ b/hw/net/ftgmac100.c @@ -1107,9 +1107,14 @@ 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, - TYPE_FTGMAC100, 0x2000); - sysbus_init_mmio(sbd, &s->iomem); + memory_region_init(&s->iomem_container, OBJECT(s), + TYPE_FTGMAC100 ".container", FTGMAC100_MEM_SIZE); + sysbus_init_mmio(sbd, &s->iomem_container); + + memory_region_init_io(&s->iomem, OBJECT(s), &ftgmac100_ops, s, + TYPE_FTGMAC100 ".regs", FTGMAC100_REG_MEM_SIZE); + memory_region_add_subregion(&s->iomem_container, 0x0, &s->iomem); + sysbus_init_irq(sbd, &s->irq); qemu_macaddr_default_if_unset(&s->conf.macaddr); =20 --=20 2.45.2 From nobody Sun Nov 24 18:39:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1720526026; cv=none; d=zohomail.com; s=zohoarc; b=ZaVDCxT7rxJwcYhfqrGqJdHseQqVA7Ct6DB7b2FxsPeIwl7xCyKjeLZNuo5hyudeSdz7VBanZV0xNl4NG59ikkS/rwJubJA1htC7kHGYTBLlgqfF8D3ClKXBe10V9s/mN4ZenzjNhm+TZ2cqSCs2QIS7ZuZ0ALSiJTlhX8xX9YM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720526026; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=yagtQE17ByL+E5UQb6+itosE17U9MyYIStQijr0aF/o=; b=UByod5g9BxQ3ghUbd+Ka2hoxr3zxCYEpFMXqHRKVdSoKOJFNn00zHJ103lVHemH0/Z30gPfL6XouuhCSRYvEOezI+sJMTnNsUBCYrUWl3dMl5nYOPkINeYtChXE2BK4D7GJxkuUp+nwj1v9Ny/4ab0kwiaNTJ9X9hlWcGjfYDDA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=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 17205260263291013.6506096212662; Tue, 9 Jul 2024 04:53:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sR9Ox-00019j-L0; Tue, 09 Jul 2024 07:52:55 -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 1sR9Ov-0000tI-Nj for qemu-devel@nongnu.org; Tue, 09 Jul 2024 07:52:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sR9Oo-0006W6-3E for qemu-devel@nongnu.org; Tue, 09 Jul 2024 07:52:53 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-83-t36dUyOsOsSBrwhttzf0DA-1; Tue, 09 Jul 2024 07:52:38 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DD44D1955D66; Tue, 9 Jul 2024 11:52:36 +0000 (UTC) Received: from corto.redhat.com (unknown [10.39.193.243]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 955E33000183; Tue, 9 Jul 2024 11:52:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720525959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yagtQE17ByL+E5UQb6+itosE17U9MyYIStQijr0aF/o=; b=HW0r+cFLsaOmeeqhUenLfCqd+MY1YAoGiY7lVziw1B4J1kePF0UIt3SMqsl29yz27QG/Mt vDJEhiirI2QXRWDro1jZQsKUANGfj+ontEcr6LKJio5nj8RyFPd/LpdKnSpI6RNjuVjnko PX0MqmZhXmA+XqfjRzj0qtCOeohNBGM= X-MC-Unique: t36dUyOsOsSBrwhttzf0DA-1 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 2/8] hw/net:ftgmac100: update ring base address to 64 bits Date: Tue, 9 Jul 2024 13:52:22 +0200 Message-ID: <20240709115228.798904-3-clg@redhat.com> In-Reply-To: <20240709115228.798904-1-clg@redhat.com> References: <20240709115228.798904-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.144, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1720526027145116600 From: Jamin Lin Update TX and RX ring base address data type to uint64_t for 64 bits dram address DMA support. Both "Normal Priority Transmit Ring Base Address Register(0x20)" and "Receive Ring Base Address Register (0x24)" are used for saving the low part physical address of descriptor manager. Therefore, changes to set TX and RX descriptor manager address bits [31:0] in ftgmac100_read and ftgmac100_write functions. Incrementing the version of vmstate to 2. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater --- include/hw/net/ftgmac100.h | 9 ++++----- hw/net/ftgmac100.c | 33 ++++++++++++++++----------------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/include/hw/net/ftgmac100.h b/include/hw/net/ftgmac100.h index 269446e85838..aae57ae8cbed 100644 --- a/include/hw/net/ftgmac100.h +++ b/include/hw/net/ftgmac100.h @@ -42,10 +42,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; @@ -58,7 +54,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; diff --git a/hw/net/ftgmac100.c b/hw/net/ftgmac100.c index 9e1f12cd331b..d026242e2b54 100644 --- a/hw/net/ftgmac100.c +++ b/hw/net/ftgmac100.c @@ -515,12 +515,12 @@ 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) { int frame_size =3D 0; uint8_t *ptr =3D s->frame; - uint32_t addr =3D tx_descriptor; + uint64_t addr =3D tx_descriptor; uint32_t flags =3D 0; =20 while (1) { @@ -726,9 +726,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 +799,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 +813,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 */ @@ -957,7 +956,7 @@ static ssize_t ftgmac100_receive(NetClientState *nc, co= nst uint8_t *buf, FTGMAC100State *s =3D FTGMAC100(qemu_get_nic_opaque(nc)); FTGMAC100Desc bd; uint32_t flags =3D 0; - uint32_t addr; + uint64_t addr; uint32_t crc; uint32_t buf_addr; uint8_t *crc_ptr; @@ -1126,18 +1125,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), @@ -1156,6 +1151,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() } }; --=20 2.45.2 From nobody Sun Nov 24 18:39:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1720526093; cv=none; d=zohomail.com; s=zohoarc; b=Fr5AhjW9ppzCplLoWjkMkyL8GbRUaiVTAaR52lJVcpaxSC/ncjfvijohreCnJWo3BPeFFqL7K5UXLkl1Q98Q5SUP911XSjprxOn2io6mrazwIq7AilANYvu4Yz2e56NNBrdGVKySS0yS0kk2bqZfaKyzbKm0qqthh7dQuxOAQjA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720526093; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=3biFDdRU1immrFwaBbGrdEUhaLDtCr2UB++Ns4nktOw=; b=GPzWjsLucT5mGOhiDRRJbKoBQ7qumtBxg/FCLHlRFxzZ3c4yrf6IGmGE7DQ+mEwluMSB0/pG7wiafY7F1BzgmpgoC1v/lKdl+tIZtZcgPnBysuyvqp7w9sCtzJYXO6mlVBHsK/ITrCAOxYY9JnmdxDp1H789RNN1RZIlMcXW+bE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=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 1720526093932494.379603170889; Tue, 9 Jul 2024 04:54:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sR9P0-0001aQ-Mn; Tue, 09 Jul 2024 07:52: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 1sR9Oz-0001Pl-4S for qemu-devel@nongnu.org; Tue, 09 Jul 2024 07:52:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sR9Oo-0006WS-EU for qemu-devel@nongnu.org; Tue, 09 Jul 2024 07:52:56 -0400 Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-528-9mQ6sEmVO0inK5e6obToJg-1; Tue, 09 Jul 2024 07:52:40 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id ADC3A195419C; Tue, 9 Jul 2024 11:52:39 +0000 (UTC) Received: from corto.redhat.com (unknown [10.39.193.243]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 40E1D3000184; Tue, 9 Jul 2024 11:52:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720525962; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3biFDdRU1immrFwaBbGrdEUhaLDtCr2UB++Ns4nktOw=; b=jWSY6rgUm4tSIGE5iszGQQLFwzG57HEgJcQm/Ckzo7bNLhLxn7oj8Exn7EXQkvqlfn0/g9 fad7G+xCNaAhtZ5Vz+7DGTaTHpYXQtyPKpncnbWB0z1KvET7ZNuOIMWrIY6ggUeV0FP1Yx v8WJvxboF7QEKU7izwwAWGcReSP7MCI= X-MC-Unique: 9mQ6sEmVO0inK5e6obToJg-1 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 3/8] hw/net:ftgmac100: introduce TX and RX ring base address high registers to support 64 bits Date: Tue, 9 Jul 2024 13:52:23 +0200 Message-ID: <20240709115228.798904-4-clg@redhat.com> In-Reply-To: <20240709115228.798904-1-clg@redhat.com> References: <20240709115228.798904-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1720526095674116600 From: Jamin Lin 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. Introduce a new sub region which size is 0x100 for the set of new registers and map it at 0x100 in the container region. This sub region range is from 0x100 to 0x1ff. Introduce a new property and object attribute to activate the region for ne= w registers. Introduce a new memop handlers for the new register read and write. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater --- include/hw/net/ftgmac100.h | 4 ++ hw/net/ftgmac100.c | 82 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) diff --git a/include/hw/net/ftgmac100.h b/include/hw/net/ftgmac100.h index aae57ae8cbed..24ccdf0260a9 100644 --- a/include/hw/net/ftgmac100.h +++ b/include/hw/net/ftgmac100.h @@ -16,6 +16,8 @@ OBJECT_DECLARE_SIMPLE_TYPE(FTGMAC100State, FTGMAC100) =20 #define FTGMAC100_MEM_SIZE 0x1000 #define FTGMAC100_REG_MEM_SIZE 0x100 +#define FTGMAC100_REG_HIGH_MEM_SIZE 0x100 +#define FTGMAC100_REG_HIGH_OFFSET 0x100 =20 #include "hw/sysbus.h" #include "net/net.h" @@ -35,6 +37,7 @@ struct FTGMAC100State { qemu_irq irq; MemoryRegion iomem_container; MemoryRegion iomem; + MemoryRegion iomem_high; =20 uint8_t frame[FTGMAC100_MAX_FRAME_SIZE]; =20 @@ -68,6 +71,7 @@ struct FTGMAC100State { bool aspeed; uint32_t txdes0_edotr; uint32_t rxdes0_edorr; + bool dma64; }; =20 #define TYPE_ASPEED_MII "aspeed-mmi" diff --git a/hw/net/ftgmac100.c b/hw/net/ftgmac100.c index d026242e2b54..68956aeb94ae 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 registers high + * + * values below are offset by - FTGMAC100_REG_HIGH_OFFSET from datasheet + * because its memory region is start at FTGMAC100_REG_HIGH_OFFSET + */ +#define FTGMAC100_NPTXR_BADR_HIGH (0x17C - FTGMAC100_REG_HIGH_OFFSET) +#define FTGMAC100_HPTXR_BADR_HIGH (0x184 - FTGMAC100_REG_HIGH_OFFSET) +#define FTGMAC100_RXR_BADR_HIGH (0x18C - FTGMAC100_REG_HIGH_OFFSET) + /* * Interrupt status register & interrupt enable register */ @@ -913,6 +923,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; @@ -1077,6 +1141,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)); @@ -1114,6 +1186,15 @@ static void ftgmac100_realize(DeviceState *dev, Erro= r **errp) TYPE_FTGMAC100 ".regs", FTGMAC100_REG_MEM_SIZE); memory_region_add_subregion(&s->iomem_container, 0x0, &s->iomem); =20 + if (s->dma64) { + memory_region_init_io(&s->iomem_high, OBJECT(s), &ftgmac100_high_o= ps, + s, TYPE_FTGMAC100 ".regs.high", + FTGMAC100_REG_HIGH_MEM_SIZE); + memory_region_add_subregion(&s->iomem_container, + FTGMAC100_REG_HIGH_OFFSET, + &s->iomem_high); + } + sysbus_init_irq(sbd, &s->irq); qemu_macaddr_default_if_unset(&s->conf.macaddr); =20 @@ -1162,6 +1243,7 @@ static const VMStateDescription vmstate_ftgmac100 =3D= { static Property ftgmac100_properties[] =3D { DEFINE_PROP_BOOL("aspeed", FTGMAC100State, aspeed, false), DEFINE_NIC_PROPERTIES(FTGMAC100State, conf), + DEFINE_PROP_BOOL("dma64", FTGMAC100State, dma64, false), DEFINE_PROP_END_OF_LIST(), }; =20 --=20 2.45.2 From nobody Sun Nov 24 18:39:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1720526055; cv=none; d=zohomail.com; s=zohoarc; b=jgD82TkOn8tEAwexFRyN22f7lhDrFBBFnY3cSYEiLUleiQyDJCBtUbXdjLK1qxtzFmud8Wpa0cQA8ubQWFsn7rQ5VDlIZUEu6SimiLAQMAWmpJ2RmrhO6UT9rnXzuInFqMdEECddV8YO7o1uanxDELTV22oMOXVuFawwfWbTVwU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720526055; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=jw7jEkCHrcZLyWCWBDwvgon0tb/macRlRtuKDB5qNaU=; b=fdt4yV+ZFwC4C1KQ+pymELjP2W6TuDOA37EU0HEtO1R9PVbY4ZpqezynRB3rsw4lYr9oQFekDv2DXq4P77jn3tAjYgE5A8EHqJ9cjJ6VwddC4wyKSmw4I+79HD7Lbye0Y//XEOZpcpW1JU2czGDKrJXAwCj4wpdKdSUs/0gmV2o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=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 1720526055224235.6431045246078; Tue, 9 Jul 2024 04:54:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sR9P1-0001f1-Mw; Tue, 09 Jul 2024 07:52:59 -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 1sR9P0-0001Wd-2D for qemu-devel@nongnu.org; Tue, 09 Jul 2024 07:52:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sR9Op-0006aD-Vj for qemu-devel@nongnu.org; Tue, 09 Jul 2024 07:52:57 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-207-dHHRDGMbPx-nMyBKWQxcnA-1; Tue, 09 Jul 2024 07:52:42 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 80DE41955F49; Tue, 9 Jul 2024 11:52:41 +0000 (UTC) Received: from corto.redhat.com (unknown [10.39.193.243]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0FDCC3000183; Tue, 9 Jul 2024 11:52:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720525966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jw7jEkCHrcZLyWCWBDwvgon0tb/macRlRtuKDB5qNaU=; b=LeP/ksYtkXE4FGAXAzJrCUhgCVNropUWEeGMa+fsYoe2ZiLyZwYEvUNhQHpIHyTXzIDxNV 96957jB6dye9BKBSNPxtNgiL1VbhgXjkW1NsxpV/dNkxA4tRMidjAxWBFNTTEVtHEvzYUM nhkNxpguqjnm3uk65q4Gks4ha5jxK5k= X-MC-Unique: dHHRDGMbPx-nMyBKWQxcnA-1 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 4/8] hw/net:ftgmac100: update TX and RX packet buffers address to 64 bits Date: Tue, 9 Jul 2024 13:52:24 +0200 Message-ID: <20240709115228.798904-5-clg@redhat.com> In-Reply-To: <20240709115228.798904-1-clg@redhat.com> References: <20240709115228.798904-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1720526057259116600 From: Jamin Lin 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 "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 and RX packet buffers address type to 64 bits for dram 64 bits address DMA support. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater --- hw/net/ftgmac100.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/hw/net/ftgmac100.c b/hw/net/ftgmac100.c index 68956aeb94ae..80f9cd56d53f 100644 --- a/hw/net/ftgmac100.c +++ b/hw/net/ftgmac100.c @@ -175,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 */ @@ -208,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 64 bits DMA */ uint32_t des3; } FTGMAC100Desc; =20 @@ -531,6 +535,7 @@ static void ftgmac100_do_tx(FTGMAC100State *s, uint64_t= tx_ring, int frame_size =3D 0; uint8_t *ptr =3D s->frame; uint64_t addr =3D tx_descriptor; + uint64_t buf_addr =3D 0; uint32_t flags =3D 0; =20 while (1) { @@ -569,7 +574,12 @@ static void ftgmac100_do_tx(FTGMAC100State *s, uint64_= 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 (s->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); @@ -1022,7 +1032,7 @@ static ssize_t ftgmac100_receive(NetClientState *nc, = const uint8_t *buf, uint32_t flags =3D 0; 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; @@ -1087,7 +1097,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 (s->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 --=20 2.45.2 From nobody Sun Nov 24 18:39:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1720526058; cv=none; d=zohomail.com; s=zohoarc; b=cAgvqcpqrDg9Qh2EH5yd8MYSeSid0thyEeMJCBfu4mRE9HfXgFEKMrpxrqNNSX/aRUzhKKXajLFikZo2voGg5ZQDDbxPrur/ckQrebY7DwOV85ONbA+TDOW/oD1KdhTqZGORg0s0iYzBWqrwxvhxtqBx6Gpd7LXb5jS3x41ujs0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720526058; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=svIcaXHK27RzfNtuAn/hisq37sbQwbX9TAHyCJG5++Q=; b=i+NX/FqHgubqVzRmmehyKrMM7ixSCJvR9ryU+Mby4pTUfcY86QipB6sKVaeW1866haVWaRZajcUSkZ3/IQtYWzOgkF6zppI0sOc9hkPtMKbSkYa9re+SJTtnOFBd7Yaii0nPJyWV5ckpa45Ftd2dxoMT+3vygOFgIIR6Qg7P+fg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=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 1720526058227715.5082520930466; Tue, 9 Jul 2024 04:54:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sR9Oz-0001QD-B6; Tue, 09 Jul 2024 07:52:57 -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 1sR9Oy-0001Fs-7j for qemu-devel@nongnu.org; Tue, 09 Jul 2024 07:52:56 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sR9Oq-0006aC-0M for qemu-devel@nongnu.org; Tue, 09 Jul 2024 07:52:55 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-586-T7q4c_hQNc-ToJiXzuFtUg-1; Tue, 09 Jul 2024 07:52:44 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CAE1F195608A; Tue, 9 Jul 2024 11:52:43 +0000 (UTC) Received: from corto.redhat.com (unknown [10.39.193.243]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BE21C3000184; Tue, 9 Jul 2024 11:52:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720525966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=svIcaXHK27RzfNtuAn/hisq37sbQwbX9TAHyCJG5++Q=; b=hHi3e/NzqaUia4KX7gNbyDRRL1+lTvqZBom75zjJxFvHb1L+AMG3TsiODQbrD2bYFmy2RU E+MNDvaYJG8qAU6Eh7k3OY9dJwhC3nIYkO9yEEoNDorUKfOEG5iiFYg/ebE7ehuB4fjXd2 /xWQ5uAAUtlqAuNd+KdDaeaWoKxOgg0= X-MC-Unique: T7q4c_hQNc-ToJiXzuFtUg-1 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 5/8] aspeed/soc: set dma64 property for AST2700 ftgmac100 Date: Tue, 9 Jul 2024 13:52:25 +0200 Message-ID: <20240709115228.798904-6-clg@redhat.com> In-Reply-To: <20240709115228.798904-1-clg@redhat.com> References: <20240709115228.798904-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.144, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1720526059243116600 From: Jamin Lin 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. Set dma64 property for ftgmac100 model to support 64bits dram address DMA. Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater --- hw/arm/aspeed_ast27x0.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/arm/aspeed_ast27x0.c b/hw/arm/aspeed_ast27x0.c index 18e6a8b10cae..a9fb0d4b8874 100644 --- a/hw/arm/aspeed_ast27x0.c +++ b/hw/arm/aspeed_ast27x0.c @@ -552,9 +552,12 @@ static void aspeed_soc_ast2700_realize(DeviceState *de= v, 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); + object_property_set_bool(OBJECT(&s->ftgmac100[i]), "dma64", true, + &error_abort); if (!sysbus_realize(SYS_BUS_DEVICE(&s->ftgmac100[i]), errp)) { return; } --=20 2.45.2 From nobody Sun Nov 24 18:39:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1720526094; cv=none; d=zohomail.com; s=zohoarc; b=QbluiqtaXydRMFjgJrSRKKvZb8YMrDE0Gy1mmZHLctoD8vlwgiZd6LPQ0rcNRbNcCWYIyDf4sy9+gLbXC6l6RQSs+ZN5d08tNVkLxx0DYcRbuwM415a6p5FqSLzeZegZF6LysoE0xStCAHcDbEdWE9pQCx4DY9XD0d3oweUbaTY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720526094; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=tdPFQXQSQZMNxFPBm94K3NbKgNhWOYAIwcO0ydpIx28=; b=nxEXN7o38Ex02+efh9XpMuwRTc1AHgxBxSLiF5XVqAphSmE8Ut5L2lhAhQsOO+/KKH/kRb1drSOuEiTeV943bKpCEwIDlwiGRCWxF8tH+D4+v0kp7BLqq1lgshvJ0p7pquCbnDBipB0XvhC7HX+FfxvK1iwQycxmtcI6uMLnto0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=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 1720526094533123.39666602936018; Tue, 9 Jul 2024 04:54:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sR9P5-0001nb-Fy; Tue, 09 Jul 2024 07:53:03 -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 1sR9P2-0001hs-DK for qemu-devel@nongnu.org; Tue, 09 Jul 2024 07:53:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sR9Ou-0006bu-In for qemu-devel@nongnu.org; Tue, 09 Jul 2024 07:53:00 -0400 Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-636-T8zMhkbAPKG9bA1BafX6AQ-1; Tue, 09 Jul 2024 07:52:46 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C2BA51955F42; Tue, 9 Jul 2024 11:52:45 +0000 (UTC) Received: from corto.redhat.com (unknown [10.39.193.243]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 13CA13000181; Tue, 9 Jul 2024 11:52:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720525969; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tdPFQXQSQZMNxFPBm94K3NbKgNhWOYAIwcO0ydpIx28=; b=eoXc0aF+sL+SHq8VL36Trr/PhKsWMbZx/d/BNzPsVDh3r5T5QFOM1/G0A6KpTjz+TyOBI+ i3MGWuCGrqNUzMx0KvCQN6T25s9eRGaA3sgVPSFj4Levwj9/1W9UwQSFrU5QhQ9MDHvi+0 gt3PtdiHUZTrE0q2LfWndAFuzMPPnN8= X-MC-Unique: T8zMhkbAPKG9bA1BafX6AQ-1 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , Troy Lee , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 6/8] hw/block: m25p80: support quad mode for w25q01jvq Date: Tue, 9 Jul 2024 13:52:26 +0200 Message-ID: <20240709115228.798904-7-clg@redhat.com> In-Reply-To: <20240709115228.798904-1-clg@redhat.com> References: <20240709115228.798904-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.144, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1720526095666116600 From: Jamin Lin 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 8dec134832a1..9e99107b42e2 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.45.2 From nobody Sun Nov 24 18:39:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1720526078; cv=none; d=zohomail.com; s=zohoarc; b=fytWAg0WPW262ZnX9gTCiu4rlBx9ACUIeCbiU2g6R+unTH3DAYhKrF17XxIeBL0g+9kWlf6E85k8iMKZ7JB6vlwEpLs+i/tgSZrVeGEKTVtNrCw4UyRYiNXqxn4d6IQa0izCSsPb7PMKdcVZ2AEOZB1BjRsXl7bZCZykvowAcwU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720526078; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=9rK2cfUk1Df6PbcsigVO26V2MP7uFzr/x6Nl6VcUlZ0=; b=XQjHnymxunP1sKRrtIlOncfxp/rTSfEmxqqAuiWJ/Ebk4haBcxHMcudrg+vlXNQdZ9lzUhgvElJ2cQUJZIIcTuVKx4viCXo0skZLgDN4e+/+4pmnTZsN53NWSvS8p8meK7yAeJg6+89/k3izeqSbYmwHTZQtQ5qdMkdKMTxmGmw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=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 1720526078278158.0656741512048; Tue, 9 Jul 2024 04:54:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sR9P2-0001i8-Lp; Tue, 09 Jul 2024 07:53: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 1sR9P0-0001bK-SY for qemu-devel@nongnu.org; Tue, 09 Jul 2024 07:52:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sR9Os-0006bx-Us for qemu-devel@nongnu.org; Tue, 09 Jul 2024 07:52:58 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-48-LvP9r7BVMtCHLAEA6uVpzw-1; Tue, 09 Jul 2024 07:52:48 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8D90A196CE1D; Tue, 9 Jul 2024 11:52:47 +0000 (UTC) Received: from corto.redhat.com (unknown [10.39.193.243]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 23D593000183; Tue, 9 Jul 2024 11:52:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720525970; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9rK2cfUk1Df6PbcsigVO26V2MP7uFzr/x6Nl6VcUlZ0=; b=hNzx53dT3E5WkrcJNPoZBRbNlMR4bA1biLFM3uL9tYuy5tWJO4MV8g2kcVlHW4/NGajZpu A2oNZatGsWx7uJ7qypNyd6gWSA4vxU0XSTmDsODWU+mJQdz50LsuC47x4p4In2PN5J2WOi pe29JXOP5uRedwnUOwWwyXtf9ECmBEg= X-MC-Unique: LvP9r7BVMtCHLAEA6uVpzw-1 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 7/8] machine_aspeed.py: update to test ASPEED OpenBMC SDK v09.02 for AST2700 Date: Tue, 9 Jul 2024 13:52:27 +0200 Message-ID: <20240709115228.798904-8-clg@redhat.com> In-Reply-To: <20240709115228.798904-1-clg@redhat.com> References: <20240709115228.798904-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.144, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1720526079336116600 From: Jamin Lin Update test case 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 OpenBMC SDK 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/ Signed-off-by: Jamin Lin Reviewed-by: C=C3=A9dric Le Goater --- tests/avocado/machine_aspeed.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/avocado/machine_aspeed.py b/tests/avocado/machine_aspeed= .py index 3a20644fb2ad..13fe128fc9f0 100644 --- a/tests/avocado/machine_aspeed.py +++ b/tests/avocado/machine_aspeed.py @@ -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) --=20 2.45.2 From nobody Sun Nov 24 18:39:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1720526038; cv=none; d=zohomail.com; s=zohoarc; b=CIBZrXsswN6yCmb/I2+dghV1hLK7Q2gvbEUyc5uir1/YAseKFQlpAWizwRYtxeCs1+p9eU2Pbfl0Hl6NP1c0/NhL3BOqqoj8X50Z6iPtF8ZYBZ+atWJz6lq2SLojKhz5L7iViOGEztM3NNlB/7SW0Qq1ysyTr8/YPjQLgx8KOBg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720526038; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=htareJq5mg5V+FkUb0aPkkmthCLoSl+rqVdv+LDxAbE=; b=RkVeGa+nGpp0jPOmWokve4eytiaNxR4qWm/aKDYi26KVIRKcLu5b+bfK7RiA8v8SL7pmDZ731tsn4WGyaSSJ+iI/at4bVNJQbaWiSJqfRMdhxlk15V9f1jbARbFqZVWctkYts51M/fgmox5/gRye+91PBrndU9aWeWlRJR2eljs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=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 1720526038411621.2613765892335; Tue, 9 Jul 2024 04:53:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sR9P6-00020T-VI; Tue, 09 Jul 2024 07:53: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 1sR9P3-0001oK-UP for qemu-devel@nongnu.org; Tue, 09 Jul 2024 07:53:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sR9Ox-0006ds-N1 for qemu-devel@nongnu.org; Tue, 09 Jul 2024 07:53:01 -0400 Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-618-p7zHYbKgO9WEjoRBxIJFuA-1; Tue, 09 Jul 2024 07:52:51 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8207A1955BC2; Tue, 9 Jul 2024 11:52:49 +0000 (UTC) Received: from corto.redhat.com (unknown [10.39.193.243]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C84903000184; Tue, 9 Jul 2024 11:52:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720525974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=htareJq5mg5V+FkUb0aPkkmthCLoSl+rqVdv+LDxAbE=; b=g/DXJtn5WXC4dOwdP+iqSW+ThBpE12wJpFKZjBs+UoCQQuvW45cXxCipjVBazdwDDyHg4+ Eluf1SWXQavNPIJF+6JRwmzvG2MzOEin0tvIu+VwT6iNETDHlJMuBf48QszCD/sFnB9rE8 AfR7zqiqE44QYYMfRMopQAidq85SuKM= X-MC-Unique: p7zHYbKgO9WEjoRBxIJFuA-1 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 8/8] machine_aspeed.py: update to test network for AST2700 Date: Tue, 9 Jul 2024 13:52:28 +0200 Message-ID: <20240709115228.798904-9-clg@redhat.com> In-Reply-To: <20240709115228.798904-1-clg@redhat.com> References: <20240709115228.798904-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.144, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1720526040128116600 From: Jamin Lin Update test case to test network connection via SSH. 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 Reviewed-by: C=C3=A9dric Le Goater --- tests/avocado/machine_aspeed.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/avocado/machine_aspeed.py b/tests/avocado/machine_aspeed= .py index 13fe128fc9f0..f66ad38d3503 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 @@ -436,4 +436,6 @@ def test_aarch64_ast2700_evb_sdk_v09_02(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 --=20 2.45.2