public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "M.T." <xzavierpower@gmail.com>
To: devel@edk2.groups.io
Subject: Physical Address of buffer
Date: Mon, 13 Jun 2022 15:39:44 -0400	[thread overview]
Message-ID: <CAEsd5RvGo94t83UP8kO+-PQQGrmvEwFKjzEYf2k5n5FCvPLyVA@mail.gmail.com> (raw)

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

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

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

             reply	other threads:[~2022-06-13 19:39 UTC|newest]

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

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=CAEsd5RvGo94t83UP8kO+-PQQGrmvEwFKjzEYf2k5n5FCvPLyVA@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