public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Pedro Falcato" <pedro.falcato@gmail.com>
To: edk2-devel-groups-io <devel@edk2.groups.io>, xzavierpower@gmail.com
Subject: Re: [edk2-devel] Physical Address of buffer
Date: Mon, 13 Jun 2022 22:51:23 +0100	[thread overview]
Message-ID: <CAKbZUD2A3jAjN7gE0NX1M5k++x0G9RQh2mGiTm1RWFVwcsHTgg@mail.gmail.com> (raw)
In-Reply-To: <CAEsd5RvGo94t83UP8kO+-PQQGrmvEwFKjzEYf2k5n5FCvPLyVA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1487 bytes --]

Hi,

Does this work for you?
https://edk2-docs.gitbook.io/edk-ii-uefi-driver-writer-s-guide/18_pci_driver_design_guidelines/readme.5

On Mon, Jun 13, 2022 at 8:39 PM M.T. <xzavierpower@gmail.com> wrote:

> Hello
>
> I'm trying to port some code which interacts with memory mapped hardware
> registers.
> The original code was developed in 2015-18 on edk2, and does not want to
> compile anymore.
>
> The way it works is there are three 32 bit registers.
> The first is a status/command register which I read to determine if the
> hardware is ready.
> The next two are used to pass a 64-bit memory address (hi + lo).
> Once the param registers are set, I update the command/status register and
> the hardware executes the command returning the results at the address
> provided by the two param registers.
>
> In the original code, the address of the buffer is used to fill in the two
> param registers, and as far as I can tell this worked back then.
> When I try to do the same, the address in my pointer is only 32 bits long,
> a virtual address, not a physical address.
>
> Is there a way I can convert this 32 bit virtual address to a 64-bit
> physical address in a uefi shell app, or would I need a driver to do this?
> I did something similar in linux for memory mapped IO, I am guessing I
> just haven't found the right function for this yet.
>
> I would greatly appreciate it if someone could point me in the right
> direction.
>
> Thank you
> xp
>
>
>
> 
>
>

-- 
Pedro Falcato

[-- Attachment #2: Type: text/html, Size: 2258 bytes --]

      reply	other threads:[~2022-06-13 21:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-13 19:39 Physical Address of buffer M.T.
2022-06-13 21:51 ` Pedro Falcato [this message]

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=CAKbZUD2A3jAjN7gE0NX1M5k++x0G9RQh2mGiTm1RWFVwcsHTgg@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