public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Mike M <mike.maslenkin@gmail.com>
To: edk2-devel@lists.01.org
Cc: Ruiyu Ni <ruiyu.ni@intel.com>,
	Jian J Wang <jian.j.wang@intel.com>,  Hao Wu <hao.a.wu@intel.com>
Subject: Re: Question about UfsPassThruDxe driver
Date: Mon, 24 Dec 2018 05:03:59 +0300	[thread overview]
Message-ID: <CAL77WPC8m8MeXFeT3AHGzFm5Z9g8Uw09bqGnin=1VnvPC_kQ-Q@mail.gmail.com> (raw)
In-Reply-To: <CAL77WPABU==kcbSxbhf7x_a_Gyjd7H8j0obgM1Rj5F1ix+ds4A@mail.gmail.com>

Sorry for the noise. Once I sent this question I understood this code.
I overlooked UTP_TRD and UTP_TR_PRD declarations where lower 32-bit of a
physical address declared as a bitfield...
There are no shifts when HCI programmed via MMIO.


On Sat, Dec 22, 2018 at 1:43 AM Mike M <mike.maslenkin@gmail.com> wrote:

> Dear MdeModulePkg maintainers, I'm a bit baffled about a way
> physical addresses passed to UFS HCI at UfsPassThruDxe driver.
> For example, UFS HCI V.2.1 declares Data Base Address in PRDT structure as
> two 32 bit words,
> where bits 0 and 1 of a physical address are reserved.
> As well UTP Command Descriptor Base Address (UCDBA) shall be aligned to
> 128-byte address,
> i.e. bits [06:00] are reserved.
> In common such reserved bits are being cleared by AND operation
> with appropriate mask, while in UfsPassThruDxe right shift operator is
> used as below:
>     Prdt[PrdtIndex].DbAddr  = (UINT32)RShiftU64 ((UINT64)(UINTN)Remaining,
> 2);
>     Prdt[PrdtIndex].DbAddrU = (UINT32)RShiftU64 ((UINT64)(UINTN)Remaining,
> 32);
> and
>   Trd->UcdBa  = (UINT32)RShiftU64 ((UINT64)CmdDescPhyAddr, 7);
>   Trd->UcdBaU = (UINT32)RShiftU64 ((UINT64)CmdDescPhyAddr, 32);
>
> How does UFS HCI deal with such values?  This doesn't look correct.
> Would you like I prepare a patch replacing RShiftU64 operator with bitwise
> AND operator
> for lower 32-bit of a physical address value?
>


  reply	other threads:[~2018-12-24  2:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-21 22:43 Question about UfsPassThruDxe driver Mike M
2018-12-24  2:03 ` Mike M [this message]
2018-12-24  3:54   ` Wu, Hao A

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='CAL77WPC8m8MeXFeT3AHGzFm5Z9g8Uw09bqGnin=1VnvPC_kQ-Q@mail.gmail.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