public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ooi, Tzy Way" <tzy.way.ooi@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"ard.biesheuvel@linaro.org" <ard.biesheuvel@linaro.org>
Cc: "Kinney, Michael D" <michael.d.kinney@intel.com>,
	"Loh, Tien Hock" <tien.hock.loh@intel.com>,
	"leif.lindholm@linaro.org" <leif.lindholm@linaro.org>
Subject: Re: [edk2-devel] [PATCH v4 edk2-platforms 1/1] Silicon/DesignWare/Driver: DwEmacSnpDxe: Add DesignWare EMAC driver
Date: Wed, 26 Jun 2019 09:35:49 +0000	[thread overview]
Message-ID: <5F1105621EDF844291AF8B109E27C06D34D21B38@PGSMSX109.gar.corp.intel.com> (raw)
In-Reply-To: <CAKv+Gu_rvuso6rhmDZiU1nzm1n=KreOiObM7DOoyfA4DP-FT0g@mail.gmail.com>

Hi Bieshuevel,

You mentioned that "Are these discrete components? If so, I wonder we should use some kind of abstraction for the PHY operation". In our system, the MAC is only connected to this PHY, hence wonder if is it ok to still maintain as it is for now?

Also, may I know if you could explain more on what is abstraction for the PHY?  

Thank you

Best regards,
Tzy Way

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Ard Biesheuvel
Sent: Wednesday, June 19, 2019 6:12 PM
To: Ooi, Tzy Way <tzy.way.ooi@intel.com>
Cc: edk2-devel-groups-io <devel@edk2.groups.io>; Kinney, Michael D <michael.d.kinney@intel.com>; Loh, Tien Hock <tien.hock.loh@intel.com>; leif.lindholm@linaro.org
Subject: Re: [edk2-devel] [PATCH v4 edk2-platforms 1/1] Silicon/DesignWare/Driver: DwEmacSnpDxe: Add DesignWare EMAC driver

On Wed, 19 Jun 2019 at 12:09, Ooi, Tzy Way <tzy.way.ooi@intel.com> wrote:
>
> Hi Bieshuevel,
>
> In the DmaMap function, there is one line where my code look like this:
>
> "Status = DmaMap (MapOperationBusMasterCommonBuffer, Snp->MacDriver.TxdescRing[0], &BufferSize, &Snp->MacDriver.TxdescRingMap[0], &Snp->MappingTxdesc);"
>
> You asked me why the [0] and how many descriptor I am mapping. In my code, there is total 10 descriptors. The way I did in current code was I use DmaAllocateBuffer to allocate a memory size which is big enough for 10 descriptors. After that, I just map the first descriptor and I access the rest of the descriptor by using the first descriptor address plus the size for each descriptor to get the next descriptor address. Wonder if this method is ok? Or do I need to use DmaAllocateBuffer and DmaMap for 10 times for total 10 descriptors?
>

No, this is not ok. You have to allocate and map the size of the memory that you will use. As long as you don't use more than a page, it will not matter in practice, but it is wrong nonetheless




  reply	other threads:[~2019-06-26  9:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-08  9:52 [PATCH v4 edk2-platforms 1/1] Silicon/DesignWare/Driver: DwEmacSnpDxe: Add DesignWare EMAC driver tzy.way.ooi
2019-05-22  2:37 ` tzy.way.ooi
2019-05-22  7:21   ` [edk2-devel] " Ard Biesheuvel
2019-05-31  9:14     ` Ooi, Tzy Way
2019-05-31  9:19       ` Ard Biesheuvel
2019-06-19 10:09         ` Ooi, Tzy Way
2019-06-19 10:12           ` Ard Biesheuvel
2019-06-26  9:35             ` Ooi, Tzy Way [this message]
2019-06-26 10:00               ` Ard Biesheuvel

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-list 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=5F1105621EDF844291AF8B109E27C06D34D21B38@PGSMSX109.gar.corp.intel.com \
    --to=devel@edk2.groups.io \
    /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