485 Commits

Author SHA1 Message Date
Mario Bălănică
824e6c1216 Switch devicetree-rebasing to kernel.googlesource.com mirror
CI builds have been failing lately with:
Error: fatal: unable to access
'https://git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebasing.git/':
Failed to connect to git.kernel.org port 443 after
134198 ms: Couldn't connect to server

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-12-07 19:59:02 +02:00
Mario Bălănică
cb0d358be3 build: Improve patchset application
Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-12-07 18:36:27 +02:00
Mario Bălănică
49dbee8d7c OhciDxe: Fix excessive stalls and debug prints
Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-12-07 14:10:53 +02:00
Mario Bălănică
dd1aa689f3 OhciDxe: Port to EFI_USB2_HC_PROTOCOL
EFI_USB_HC_PROTOCOL support has been removed in recent EDK2.

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-12-07 12:39:39 +02:00
Mario Bălănică
a4cc8fe021 Convert to new FdtLib wrapper API
There are a few missing wrappers for which I've submitted a patch
upstream. The patch is pending, so include it under edk2-patches for
now.

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-12-07 11:58:55 +02:00
Mario Bălănică
630ebc9181 Misc fixes after EDK2 update
Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-12-07 11:13:45 +02:00
Mario Bălănică
4dc1930d05 Update to latest EDK2
edk2-stable202511

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-12-07 10:49:03 +02:00
Mario Bălănică
35d9b8f25d build: Support submodule patchsets
Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-12-07 10:48:59 +02:00
Mario Bălănică
b89f436f73 Improve PCIe resource assignment
- The PCIe MMIO regions on this SoC are absurdly small. Some demanding
devices (like NVIDIA GPUs) need more than 16 MB of 32-bit
non-prefetchable memory. To address this, carve out 256 MB at the top of
MMIO64 for ECAM (128 MB), followed by MEM32 (128 MB, with 32-bit
translation). MEM64 takes up the remaining space (768 MB), starting at
the bottom of MMIO64 (to preserve the alignment). This should be enough
to cover most use cases and allows for even a larger 512 MB prefetchable
BAR.

- Since all RCs share the same SMMU and ITS blocks, segments need
distinct bus numbers so that Requester IDs don't overlap. With 128 MB of
ECAM and 5 segments, this gives a spacing of 25 buses. Ideally, we
would've encoded the segment number instead, but that doesn't seem
possible here.

- Sync ACPI and FDT with the updated resources.

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-12-01 13:36:21 +02:00
Mario Bălănică
dd994400c5 AcpiPlatform: Unify auto ECAM compatibility modes
Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-12-01 12:35:01 +02:00
Mario Bălănică
904ae9ca19 Add AArch64 AMD GOP drivers
The x64 driver in the GPU's Option ROM does not work properly on
non-coherent hardware through the emulator (framebuffer gets corrupted).

We also need to install EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL on the
native driver's handle in order to override the Option ROM version.

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-12-01 12:35:00 +02:00
Mario Bălănică
101b780f8c Add X86EmulatorDxe for PCI Option ROMs
Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-12-01 12:34:37 +02:00
Chen Jiali
d4627ada03 Platforms: Radxa: use the latest Radxa logo
Signed-off-by: Chen Jiali <chenjiali@radxa.com>
2025-05-21 03:59:40 +00:00
Mario Bălănică
6a682c0ef3 Update README.md
Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
v1.1
2025-04-10 01:00:04 +03:00
Mario Bălănică
a56080d366 FdtPlatform: Expand search for overrides
- Scan all supported file systems (FAT, ext4) on the selected boot
device, rather than just the one containing the OS loader.

- Also look for base DTB overrides in `\dtb` and `\dtb\rockchip`. Fedora
images conveniently have a symlink to the current kernel DTBs in the
latter path, on the second ext4 boot partition.

- Add config options to allow specifying custom relative paths for the
base DTB override and overlays.

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-04-10 00:40:40 +03:00
Mario Bălănică
231065660e Add Ext4 file system support
Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-04-10 00:40:36 +03:00
Mario Bălănică
8c87d8b51e Add edk2-platforms submodule
Needed for Ext4Pkg.

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-04-10 00:40:17 +03:00
Mario Bălănică
3f923c2190 Note lack of display output on kernels older than 6.15
Latest device tree changes have broken the partial HDMI0 support on
kernels < 6.15 for boards exposing the HDMI1 port.

The "Force UEFI GOP Display" option must be used instead with those
older kernels.

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-04-07 16:50:40 +03:00
Mario Bălănică
f1b54865ae Platforms: DTS: Follow upstream changes
PowerStation6:
- Enable HDMI0 audio output
- Enable SPDIF optical output
- Add GPU power domain regulator dependency

Other:
- Enable HDMI0/1 audio output

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-04-07 16:50:40 +03:00
Mario Bălănică
2089c5302e Update devicetree-rebasing to v6.15-rc1-dts
Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-04-07 16:50:39 +03:00
Su Yang
b0e44c9643 README: Update Radxa SPI flashing guide link (#198) 2025-04-06 18:47:56 +03:00
Mario Bălănică
b774d8d80d Pcie30PhyLib: Assorted fixes
- Clean up dead code.

- Perform init only once. This fixes an issue in bifurcation mode where
PCIe 3x2 init would reset the PHY, forcing the previously configured
PCIe 3x4 link to restart at the lowest speed.

- Set PHP_GRF_PCIESEL_CON to fix routing of PCIe3x1 controllers to the
PCIe 3 PHY instead of the Combo PHY.

- Wait for sram_init_done (does not seem necessary since
sram_bypass=0x1, but just follow suit with the BSP code).

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-04-03 15:47:29 +03:00
Mario Bălănică
73d6d6a1c9 PowerStation6: DTS: Add WLAN rfkill
Fixes Wi-Fi with the latest kernel driver.

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-04-02 00:43:47 +03:00
Mario Bălănică
8840c15571 PowerStation6: Fix HDMI HPD pin mux
Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-04-02 00:43:45 +03:00
Mario Bălănică
da4a973802 FdtPlatform: Reference PCIe 3V3 supply in SATA PHY mode
For M.2 slots supporting both PCIe and SATA, we must reference the 3V3
supply in SATA mode as well, to prevent the kernel from turning it off.

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-04-02 00:43:17 +03:00
Mario Bălănică
90e992f47f FdtPlatform: Apply firmware fix-ups to DTB overrides
Note that this only applies to the firmware DTB override mechanism. It
won't work with Grub's `devicetree` command.

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-04-02 00:02:27 +03:00
Mario Bălănică
a834bb274c RK806: Configure shutdown pin
PWRCTRL1 on RK806 is connected to GPIO0_A2, which gets set high by PSCI
SYSTEM_OFF.

This fixes shutdown from UEFI/ACPI.

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
v1.0.1
2025-03-21 13:25:17 +02:00
Mario Bălănică
253adece42 Update README.md
Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
v1.0
2025-03-18 11:30:58 +02:00
Mario Bălănică
0c89a9ed32 DwcEqosSnpDxe: Return proper status when link is down
Return EFI_NO_MEDIA instead of EFI_NOT_READY to avoid the long delays at
boot.

From DxeNetLib:
> If Aip protocol is supported by low layer drivers, three kinds of
> media states can be detected: EFI_SUCCESS, EFI_NOT_READY and
> EFI_NO_MEDIA, represents connected state, connecting state and no
> media state respectively. When function detects the current state is
> EFI_NOT_READY, it will loop to wait for next time's check until state
> turns to be EFI_SUCCESS or EFI_NO_MEDIA.

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-03-18 03:53:09 +02:00
Mario Bălănică
118c9c3765 Khadas/Edge2: Enable VCC_5V0_PWREN_H early
Required for HDMI DDC.

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-03-17 05:20:40 +02:00
Mario Bălănică
1a8b095368 PlatformBootManagerLib: Remove stale FvFile(s) before registering boot keys
Firmware updates can invalidate existing FvFile entries. Attempting to
clean them up after registering the boot keys (e.g. ESC) often leads to
the keys not working until after a reboot - perhaps because the options
they reference no longer match?

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-03-17 03:53:32 +02:00
Mario Bălănică
519a6f744e Add network stack configuration options
This allows enabling/disabling various parts of the UEFI network stack:
- Entire stack
- IPv4 stack
- IPv6 stack
- PXE boot
- HTTP boot

All options are enabled by default.

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-03-17 01:55:17 +02:00
Mario Bălănică
b959fe9020 Add Boot Discovery Policy driver
This allows controlling the boot discovery policy (Minimal, Connect
Network, Connect All).

We now default to "Connect All" because it appears that BDS does not
properly connect all child handles on some controllers, resulting in
missing partitions and ultimately the boot option being skipped. This
seems to affect SATA and NVME at least, however USB is fine.

Fixes #101

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-03-16 06:00:52 +02:00
Mario Bălănică
0cd0068fd1 Pcf8563RealTimeClockLib: Kick off time from build epoch
Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-03-15 19:05:52 +02:00
Mario Bălănică
f94ee94486 Drop edk2-platforms submodule
edk2-platforms has removed pretty much all the dependencies we had on
it: Pcf8563RealTimeClockLib and the Hisilicon package. Also drop the
Ax88772c driver as it's not needed.

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-03-15 17:32:39 +02:00
Mario Bălănică
69271dcf48 Update to latest EDK2
edk2-stable202502

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-03-15 17:15:32 +02:00
Mario Bălănică
f8af61cbe1 Decrease auto boot timeout to 5 seconds
Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-03-15 02:17:00 +02:00
Mario Bălănică
54764b28ef Rk3588PciHostBridgeLib: Decrease link up timeout to 1 second
2 seconds seem rather excessive. Linux also waits 1 second.

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-03-15 02:12:41 +02:00
Mario Bălănică
021a476686 Remove I2cDemoTest from shell
Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-03-15 02:01:57 +02:00
Mario Bălănică
0e585c8a6e GOP: Add option for 90-degree rotation
Swap the reported horizontal and vertical resolutions and rotate block
transfer operations. Also set PixelFormat to PixelBltOnly as we
shouldn't claim to support a framebuffer given the fake resolution.

This approach is flawed in multiple ways: slow perf, no framebuffer in
OS (or garbled up). But it is way more convenient on the Fydetab - and
realistically it's going to be fine for Linux boot as it has a native
display driver.

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-03-15 01:53:06 +02:00
Mario Bălănică
e9209cbaa6 GOP: Optimize block transfer operations
- no need for cache maintenance as the framebuffer is already non-cached
- remove handling for different bits per pixel - we only support 32 bpp
- simplify EfiBltVideoToVideo overlap case handling

The console no longer lags at high resolutions.

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-03-14 19:23:56 +02:00
Mario Bălănică
bc21dd8f26 Vop2Dxe: Fix up horizontal resolution alignment
RK3588 requires HActive to be 4-pixel aligned.

This fixes modes such as 1366x768 (rounded up to 1368), which would
otherwise appear fuzzy.

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-03-14 17:52:25 +02:00
Mario Bălănică
46669d1439 GOP: Add EDID support
The preferred display mode is now automatically detected by parsing the
EDID in this order:
- detailed timings from base block and CEA-861 & VTB-EXT extensions
- SVDs / HDMI VICs from CEA-861 extensions
- standard timings from base block
- established timings from base block

Only supported on HDMI for now.

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-03-14 17:52:24 +02:00
Mario Bălănică
440e45ad39 GOP: Support connector detection
Display connectors are now probed in a configurable priority order, with
the first found display set as the primary output. All other connectors
remain disabled, though it's still possible to enable duplication in the
settings (all displays will be considered identical to the primary one).

If no display is found, by default, output will be forced with the
configured mode (Native - fallback to 640x480 / custom / predefined) on
all connectors. This is mainly done to allow using connectors that don't
have detection implemented yet (DP/eDP). It might also be useful to
recover from potential issues with EDID in the future - one can plug in
the display after boot and *hopefully* have it work at the fallback
resolution.
This option can also be disabled in the settings, which is recommended
when using the serial port, as some OSes don't redirect the text output
there if a GOP instance is always present.

For now, detection is supported only on HDMI and DSI (which is assumed
to be permanently connected).

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-03-14 17:52:23 +02:00
Mario Bălănică
ea8fa5b2cc DwHdmiQp: Support more display modes
DwHdmiQp:
- Follow BSP code and add retries to the I2C read/write ops, because I
have seen timeouts with one TV sink while writing SCDC registers.
- Set DVI mode correctly based on sink info (needs EDID).
- Add a configuration option to force DVI mode -- this can be useful to
trick some TVs into using PC mode: no overscan, full range RGB. We don't
currently support limited range for CEA modes, which leads to slightly
crushed black levels.
- Setup AVI & HDMI vendor infoframes.
- Set scrambling for HDMI 2.0 modes (up to 4K 60 Hz).

HdptxHdmiPhy:
- Use actual bitrate rather than a hardcoded value for 1080p60.
- Calculate PLL config to support arbitrary rates.
- Add more precise predefined PLL configs for some modes.

Vop2:
- Switch DCLK to the HDMI PHY PLL as it provides better accuracy and
enables more modes.

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-03-14 17:52:23 +02:00
Mario Bălănică
60b5a4c252 GOP: Support multiple display modes
Add a configuration menu which allows changing the preferred display
mode:
- Native: uses predefined timings from panel (for DSI) or EDID (to-do)
- Custom: user can enter arbitrary timings (pixel clock, front porch,
sync width, back porch, sync polarity)
- Common predefined modes from 640x480p60 to 4096x2160p60

In case the custom display settings are invalid/unsupported, pressing
LCtrl+LShift+F6 at any time will cause a reboot with default settings.

The HDMI output will currently not work because it's still hardcoded to
1080p60 and we're now falling back to a safe 480p due to lack of EDID.

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-03-14 17:52:22 +02:00
Mario Bălănică
5697f4400a Allow platforms to specify all supported display connectors
Particularly for HDMI and eDP as the other drivers could already bind to
multiple outputs.

The eDP driver is still disabled by default because it requires
EdpEnableBacklight() to be implemented in RockchipPlatformLib, but it
does appear to load fine and has been tested to work some time ago.

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-03-14 17:52:21 +02:00
amazingfate
48d52ef954 Revert "OrangePi5Plus: DTS: Enable front USB-A 3.0 and USB-C ports"
This reverts commit c52b05713a.
2025-03-01 00:52:19 +02:00
amazingfate
5eb1d5b68a update mainline devicetree to tag v6.14-rc4-dts 2025-03-01 00:52:19 +02:00
Mario Bălănică
3564ae3fe5 Revert "ROCK5ITX: DTS: Enable HDMI0 output"
This reverts commit 06408b6bf6.

Turns out that HDMI0 is routed to the EDP connector and a DP->HDMI
converter is used instead for the 2nd 4K port.

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2025-01-29 20:29:32 +02:00