From: "Filip Kubicz via groups.io" <filip.kubicz=toolsforhumanity.com@groups.io>
To: devel@edk2.groups.io
Subject: [edk2-devel] Read SD card in edk2 using Realtek card reader
Date: Wed, 21 May 2025 18:35:48 +0200 [thread overview]
Message-ID: <CACGeMfOtYQunCdh5PtCVry9sgd6EROSGEkmAacWJWHOexBmH5Q@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 3223 bytes --]
Hi! I’m creating a edk2 driver to be able to read the SD card contents in
UEFI stage, and eventually boot from this device. SD card contains Linux
kernel, dtb and rootfs.
In the design we have a Realtek RTS5264 SD card reader, which is attached
to the Orin NX using PCIe. Since Orin doesn't have internal flash, the SD
card is needed as a boot media, that's why edk2 driver is needed.
I was able to add a Rts5264 DXE driver to edk2-nvidia:
https://github.com/NVIDIA/edk2-nvidia
I’m able to build the driver, and run it when the PCIe device matching
Vendor ID and Product ID of this chip is enumerated in UEFI. Then it
performs register writes to the RTS5264 chip to enable power for SD card,
etc.
See example log:
```
add-symbol-file
/workspace/Build/Jetson/DEBUG_GCC5/AARCH64/Platform/NVIDIA/Jetson/Drivers/Rts5264/Rts5264/DEBUG/Rts5264Dxe.dll
0x46A9FF000
Loading driver at 0x0046A9FE000 EntryPoint=0x0046AA0756C Rts5264Dxe.efi
ListPciDevices: Segment: FF Bus: 0x00 Device: 0x00 Function:
0x00 Vendor ID: 0xFFFF Device ID:0x0000
ListPciDevices: Segment: 01 Bus: 0x00 Device: 0x00 Function:
0x00 Vendor ID: 0x10DE Device ID:0x229E
ListPciDevices: Segment: 01 Bus: 0x01 Device: 0x00 Function:
0x00 Vendor ID: 0x10EC Device ID:0x5264
ListPciDevices: Segment: 04 Bus: 0x00 Device: 0x00 Function:
0x00 Vendor ID: 0x10DE Device ID:0x229C
ListPciDevices: Segment: 04 Bus: 0x01 Device: 0x00 Function:
0x00 Vendor ID: 0x8086 Device ID:0x2723
ListPciDevices: Segment: 07 Bus: 0x00 Device: 0x00 Function:
0x00 Vendor ID: 0x10DE Device ID:0x229A
ListPciDevices: Segment: 08 Bus: 0x00 Device: 0x00 Function:
0x00 Vendor ID: 0x10DE Device ID:0x229C
ListPciDevices: Segment: 08 Bus: 0x01 Device: 0x00 Function:
0x00 Vendor ID: 0x10EC Device ID:0x8168
MnpSyncSendPacket: No network cable detected.
RTS5264_START: Querying protocols on incoming ControllerHandle 46792BE98
RTS5264_START: ControllerHandle 46792BE98 HAS DevicePath:
VenHw(1E5A432C-0466-4D31-B009-D4D9239271D3)/MemoryMapped(0xB,0x14100000,0x1411FFFF)/PciRoot(0x0)/Pci(0x0,0x0)/Pci(0x0,0x0)
RTS5264_START: ControllerHandle 46792BE98 HAS PciIo Protocol (queried by
HandleProtocol).
RTS5264_START: Raw BAR1 value: 0x40000000 (Type: MmYsNRts5264: IC Version:
0x1
RTS5264: Powering on card...
RTS5264: Setting initial clock...
```
However, I struggle with connecting this driver to the filesystem in edk2,
to be able to read/write, and eventually boot from the SD card.
Can you please outline the steps that should be taken, which protocols
should I implement to be able to read the SD card via this driver?
I'm new to edk2 so every piece of good advice will be useful.
Thank you!
Filip
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121366): https://edk2.groups.io/g/devel/message/121366
Mute This Topic: https://groups.io/mt/113232867/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
[-- Attachment #2: Type: text/html, Size: 3865 bytes --]
reply other threads:[~2025-05-21 17:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=CACGeMfOtYQunCdh5PtCVry9sgd6EROSGEkmAacWJWHOexBmH5Q@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