From nobody Tue Feb 10 15:46:11 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.54 as permitted sender) client-ip=209.85.128.54; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f54.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.54 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1625321998; cv=none; d=zohomail.com; s=zohoarc; b=WvHjUXu971dBQcDNw7hKzXDVbZju3jrl4yJiIR6LnqUTbrOUcTMWWulFpd29ZNjlxJIqta00EzWeKOwhFYlNXXxQav1MgCm/DTAA7yQPRt4VyUGzpXxqAK4oA4vSNnpJ0FiCkZ0wF5jg7g0M4ZWtVwH5hJrYjgRrgVFUI9P5R38= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625321998; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xzjbO+5jo6pD19SRnGaYYtwqZATAxg4quF6D0X5U33M=; b=n6C/mFbmlWBiZYigx2YCe6wlU85ZncoZqyx7D98asM0HUQSDJEcBIyhEfy5TCfT+GDavZuY4BxO5NFabpXJps0ckuCsdpArCYAXrPinu+p08BAsA1DWwCxFa3wEkJ/QZL//9LRZIujAX1MPbTHu92ZWjyFMw8pHfkl2pcvq/lO4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.54 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mx.zohomail.com with SMTPS id 1625321998582752.319257916912; Sat, 3 Jul 2021 07:19:58 -0700 (PDT) Received: by mail-wm1-f54.google.com with SMTP id g8-20020a1c9d080000b02901f13dd1672aso7124837wme.0 for ; Sat, 03 Jul 2021 07:19:58 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (184.red-95-127-187.staticip.rima-tde.net. [95.127.187.184]) by smtp.gmail.com with ESMTPSA id b11sm6834846wrf.43.2021.07.03.07.19.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Jul 2021 07:19:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xzjbO+5jo6pD19SRnGaYYtwqZATAxg4quF6D0X5U33M=; b=ZywkxyBShV2Xh2f2XAB0qHxYfsyCR+4cYbbO4KPLOBhZNUi5N8IUvHmXXpLLLpGYDG x7mFmR8mBLBYpFBr6Tx+K7xb5lqcjpAkn89I3ge2zcY877LN4gBJpmJO73xycGDmlgKn ONVLlbpuRcFmYqLXgl8ZwU78sBufGkCKENjZipjabfMyb2m7U90PNLJM71/tIrMlwiFN 2Fu8VS0H0Haq1cyl109SCnImPB184vyNQhiB+HV9XNF440E8yAGc4IAEtsXcCVovfOb3 6f/XaidcTGIZCG1HwXvHVgcLYXvFCYt8MWPl+HQbu4TbU/IyShljbiyX6D8rX2NLMOms mAig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=xzjbO+5jo6pD19SRnGaYYtwqZATAxg4quF6D0X5U33M=; b=Wzur8HEswlte0ImgwP9wf49zs9PvuNH4BJWDuhmJpqw5YDOXvHuWzDmte0Ck0WA4NS w5R357w8qvmCcM7eeybpzfhAzueHY+J7eSHq6dkyNtfYqXTZIR6DLbnG1Jcp8yvdcnAC wlVBOj6jskmsA3MeX98fDCKZu4pLAq0x7OZw81KnObP7AzdgUVXvrYsXJye7VQKAWa1l d0rwiM0KgJxsLuBhse9ALi8AD/xULoSFbpKXy7ArHY7CQRCJ3ffV4/o75RpfkZJXgdAt SfHxYCvhaafozjNoXb1ZmzZx9C2rUrmGtBgfcaOQ9yrrouNxt72/YTz/r8xgkXIRoQ1W UVhQ== X-Gm-Message-State: AOAM532Fvo5t81OybSCta3PLolHXt+6e8luLLg7vlIhwGWiBWUjFtlbs Roh7OpmK4TyNYTpN5j6YwEM= X-Google-Smtp-Source: ABdhPJy7PtXVjwTaet10N95+lFYVk4voZCHYcvSrbN/m08WflyH56XrQYXbTJJerB73XMdv+YWRDqQ== X-Received: by 2002:a1c:b403:: with SMTP id d3mr5012554wmf.79.1625321996887; Sat, 03 Jul 2021 07:19:56 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Jason Wang , Finn Thain , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 1/6] dp8393x: fix CAM descriptor entry index Date: Sat, 3 Jul 2021 16:19:42 +0200 Message-Id: <20210703141947.352295-2-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210703141947.352295-1-f4bug@amsat.org> References: <20210703141947.352295-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1625322000341100001 From: Mark Cave-Ayland Currently when a LOAD CAM command is executed the entries are loaded into t= he CAM from memory in order which is incorrect. According to the datasheet the first entry in the CAM descriptor is the entry index which means that each descriptor may update any single entry in the CAM rather than the Nth entry. Decode the CAM entry index and use it store the descriptor in the appropria= te slot in the CAM. This fixes the issue where the MacOS toolbox loads a single CAM descriptor into the final slot in order to perform a loopback test which must succeed before the Ethernet port is enabled. Signed-off-by: Mark Cave-Ayland Tested-by: Finn Thain Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20210625065401.30170-10-mark.cave-ayland@ilande.co.uk> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/dp8393x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c index 252c0a26641..11810c9b600 100644 --- a/hw/net/dp8393x.c +++ b/hw/net/dp8393x.c @@ -270,7 +270,7 @@ static void dp8393x_update_irq(dp8393xState *s) static void dp8393x_do_load_cam(dp8393xState *s) { int width, size; - uint16_t index =3D 0; + uint16_t index; =20 width =3D (s->regs[SONIC_DCR] & SONIC_DCR_DW) ? 2 : 1; size =3D sizeof(uint16_t) * 4 * width; @@ -279,6 +279,7 @@ static void dp8393x_do_load_cam(dp8393xState *s) /* Fill current entry */ address_space_read(&s->as, dp8393x_cdp(s), MEMTXATTRS_UNSPECIFIED, s->data, size); + index =3D dp8393x_get(s, width, 0) & 0xf; s->cam[index][0] =3D dp8393x_get(s, width, 1) & 0xff; s->cam[index][1] =3D dp8393x_get(s, width, 1) >> 8; s->cam[index][2] =3D dp8393x_get(s, width, 2) & 0xff; @@ -291,7 +292,6 @@ static void dp8393x_do_load_cam(dp8393xState *s) /* Move to next entry */ s->regs[SONIC_CDC]--; s->regs[SONIC_CDP] +=3D size; - index++; } =20 /* Read CAM enable */ --=20 2.31.1