qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Nabih Estefan <nabihestefan@google.com>
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, kfting@nuvoton.com,
	 wuhaotsh@google.com, jasowang@redhat.com,
	avi.fishman@nuvoton.com,  kwliu@nuvoton.com,
	tomer.maimon@nuvoton.com, Hila.Miranda-Kuzi@nuvoton.com
Subject: Re: [PATCH v8 08/11] hw/net: General GMAC Implementation
Date: Mon, 18 Dec 2023 14:38:27 +0000	[thread overview]
Message-ID: <CAFEAcA9e8Pe38ei=L16w-JrQDLmH9wHoKDjktJLFNMoFCpHZCg@mail.gmail.com> (raw)
In-Reply-To: <20231214211527.1946302-9-nabihestefan@google.com>

On Thu, 14 Dec 2023 at 21:15, Nabih Estefan <nabihestefan@google.com> wrote:
>
> From: Nabih Estefan Diaz <nabihestefan@google.com>
>
> - General GMAC Register handling
> - GMAC IRQ Handling
> - Added traces in some methods for debugging
> - Lots of declarations for accessing information on GMAC Descriptors (npcm_gmac.h file)
>
> NOTE: With code on this state, the GMAC can boot-up properly and will show up in the ifconfig command on the BMC

This commit message does not match the contents of the patch.

> Signed-off-by: Nabih Estefan <nabihestefan@google.com>
> Reviewed-by: Tyrone Ting <kfting@nuvoton.com>
> ---
>  hw/net/npcm_gmac.c         |  26 -----
>  include/hw/net/npcm_gmac.h | 198 ++++++++++++++++++++++++++++++++++---
>  2 files changed, 184 insertions(+), 40 deletions(-)
>
> diff --git a/hw/net/npcm_gmac.c b/hw/net/npcm_gmac.c
> index be3f076200..09f048383b 100644
> --- a/hw/net/npcm_gmac.c
> +++ b/hw/net/npcm_gmac.c
> @@ -305,22 +305,6 @@ static void npcm_gmac_write(void *opaque, hwaddr offset,
>          break;
>
>      case A_NPCM_GMAC_MAC_CONFIG:
> -        prev = gmac->regs[offset / sizeof(uint32_t)];
> -        gmac->regs[offset / sizeof(uint32_t)] = v;
> -
> -        /* If transmit is being enabled for first time, update desc addr */
> -        if (~(prev & NPCM_GMAC_MAC_CONFIG_TX_EN) &
> -             (v & NPCM_GMAC_MAC_CONFIG_TX_EN)) {
> -            gmac->regs[R_NPCM_DMA_HOST_TX_DESC] =
> -                gmac->regs[R_NPCM_DMA_TX_BASE_ADDR];
> -        }
> -
> -        /* If receive is being enabled for first time, update desc addr */
> -        if (~(prev & NPCM_GMAC_MAC_CONFIG_RX_EN) &
> -             (v & NPCM_GMAC_MAC_CONFIG_RX_EN)) {
> -            gmac->regs[R_NPCM_DMA_HOST_RX_DESC] =
> -                gmac->regs[R_NPCM_DMA_RX_BASE_ADDR];
> -        }
>          break;
>
>      case A_NPCM_GMAC_MII_ADDR:
> @@ -371,16 +355,6 @@ static void npcm_gmac_write(void *opaque, hwaddr offset,
>                            "%s: Write of read-only bits of reg: offset: 0x%04"
>                             HWADDR_PRIx ", value: 0x%04" PRIx64 "\n",
>                             DEVICE(gmac)->canonical_path, offset, v);
> -        } else {
> -            /* for W1c bits, implement W1C */
> -            gmac->regs[offset / sizeof(uint32_t)] &=
> -                ~NPCM_DMA_STATUS_W1C_MASK(v);
> -            if (v & NPCM_DMA_STATUS_NIS_BITS) {
> -                gmac->regs[offset / sizeof(uint32_t)] &= ~NPCM_DMA_STATUS_NIS;
> -            }
> -            if (v & NPCM_DMA_STATUS_AIS_BITS) {
> -                gmac->regs[offset / sizeof(uint32_t)] &= ~NPCM_DMA_STATUS_AIS;
> -            }
>          }
>          break;

Why has this code been deleted in this patch ?

>
> diff --git a/include/hw/net/npcm_gmac.h b/include/hw/net/npcm_gmac.h
> index e5729e83ea..c97eb6fe6e 100644
> --- a/include/hw/net/npcm_gmac.h
> +++ b/include/hw/net/npcm_gmac.h
> @@ -34,13 +34,15 @@ struct NPCMGMACRxDesc {
>  };
>
>  /* NPCMGMACRxDesc.flags values */
> -/* RDES2 and RDES3 are buffer address pointers */
> -/* Owner: 0 = software, 1 = gmac */
> -#define RX_DESC_RDES0_OWNER_MASK BIT(31)
> +/* RDES2 and RDES3 are buffer addresses */
> +/* Owner: 0 = software, 1 = dma */
> +#define RX_DESC_RDES0_OWN BIT(31)
>  /* Destination Address Filter Fail */
> -#define RX_DESC_RDES0_DEST_ADDR_FILT_FAIL_MASK BIT(30)
> -/* Frame length*/
> -#define RX_DESC_RDES0_FRAME_LEN_MASK(word) extract32(word, 16, 29)
> +#define RX_DESC_RDES0_DEST_ADDR_FILT_FAIL BIT(30)
> +/* Frame length */
> +#define RX_DESC_RDES0_FRAME_LEN_MASK(word) extract32(word, 16, 14)
> +/* Frame length Shift*/
> +#define RX_DESC_RDES0_FRAME_LEN_SHIFT 16
>  /* Error Summary */
>  #define RX_DESC_RDES0_ERR_SUMM_MASK BIT(15)
>  /* Descriptor Error */
> @@ -83,9 +85,9 @@ struct NPCMGMACRxDesc {
>  /* Receive Buffer 2 Size */
>  #define RX_DESC_RDES1_BFFR2_SZ_SHIFT 11
>  #define RX_DESC_RDES1_BFFR2_SZ_MASK(word) extract32(word, \
> -    RX_DESC_RDES1_BFFR2_SZ_SHIFT, 10 + RX_DESC_RDES1_BFFR2_SZ_SHIFT)
> +    RX_DESC_RDES1_BFFR2_SZ_SHIFT, 11)
>  /* Receive Buffer 1 Size */
> -#define RX_DESC_RDES1_BFFR1_SZ_MASK(word) extract32(word, 0, 10)
> +#define RX_DESC_RDES1_BFFR1_SZ_MASK(word) extract32(word, 0, 11)

More churn here. Please go through your whole patchset reading
each patch and making sure that you don't have anything where
an earlier patch adds in some code and then a later patch
changes the way it's written unnecessarily.

thanks
-- PMM


  reply	other threads:[~2023-12-18 14:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-14 21:15 [PATCH v8 00/11] Implementation of NPI Mailbox and GMAC Networking Module Nabih Estefan
2023-12-14 21:15 ` [PATCH v8 01/11] hw/misc: Add Nuvoton's PCI Mailbox Module Nabih Estefan
2023-12-14 21:15 ` [PATCH v8 02/11] hw/arm: Add PCI mailbox module to Nuvoton SoC Nabih Estefan
2023-12-14 21:15 ` [PATCH v8 03/11] hw/misc: Add qtest for NPCM7xx PCI Mailbox Nabih Estefan
2023-12-14 21:15 ` [PATCH v8 04/11] hw/net: Add NPCMXXX GMAC device Nabih Estefan
2023-12-14 21:15 ` [PATCH v8 05/11] hw/arm: Add GMAC devices to NPCM7XX SoC Nabih Estefan
2023-12-14 21:15 ` [PATCH v8 06/11] tests/qtest: Creating qtest for GMAC Module Nabih Estefan
2023-12-18 14:28   ` Peter Maydell
2023-12-14 21:15 ` [PATCH v8 07/11] include/hw/net: Implemented Classes and Masks for GMAC Descriptors Nabih Estefan
2023-12-18 14:36   ` Peter Maydell
2023-12-14 21:15 ` [PATCH v8 08/11] hw/net: General GMAC Implementation Nabih Estefan
2023-12-18 14:38   ` Peter Maydell [this message]
2023-12-14 21:15 ` [PATCH v8 09/11] hw/net: GMAC Rx Implementation Nabih Estefan
2023-12-14 21:15 ` [PATCH v8 10/11] hw/net: GMAC Tx Implementation Nabih Estefan
2023-12-14 21:15 ` [PATCH v8 11/11] tests/qtest: Adding PCS Module test to GMAC Qtest Nabih Estefan
2023-12-18 14:43   ` Peter Maydell

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to='CAFEAcA9e8Pe38ei=L16w-JrQDLmH9wHoKDjktJLFNMoFCpHZCg@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=Hila.Miranda-Kuzi@nuvoton.com \
    --cc=avi.fishman@nuvoton.com \
    --cc=jasowang@redhat.com \
    --cc=kfting@nuvoton.com \
    --cc=kwliu@nuvoton.com \
    --cc=nabihestefan@google.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=tomer.maimon@nuvoton.com \
    --cc=wuhaotsh@google.com \
    /path/to/YOUR_REPLY

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

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).