Skip to content

Commit

Permalink
Modify to my hardware
Browse files Browse the repository at this point in the history
  • Loading branch information
Sid127 committed Jan 23, 2024
1 parent 968eb81 commit 622cc00
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/ReBarDxe.yml
@@ -1,4 +1,4 @@
name: ReBarDxe EDK2
name: NvStrapsReBar EDK2

on:
push:
Expand All @@ -10,7 +10,7 @@ env:
TARGET_ARCH: X64

jobs:
rebardxe-windows:
NvStrapsReBar-windows:
runs-on: windows-2019

env:
Expand Down Expand Up @@ -48,25 +48,25 @@ jobs:
ref: 'edk2-stable202208'
submodules: 'recursive'

- name: Download RebarUEFI
- name: Download NvStrapsReBar
uses: actions/checkout@v3
with:
path: '.\ReBarUEFI\'
path: '.\NvStrapsReBar\'

- name: Setup EDK2
run: .\edksetup.bat Rebuild

- name: Build RebarDxe
run: .\ReBarUEFI\.github\workflows\buildffs.bat
- name: Build NvStrapsReBar
run: .\NvStrapsReBar\.github\workflows\buildffs.bat

- name: Upload ReBarDxe artifact
- name: Upload NvStrapsReBar artifact
uses: actions/upload-artifact@master
with:
name: ReBarDxe (built on Windows)
path: ${{github.workspace}}/Build/ReBarUEFI/RELEASE_VS2019/X64/ReBarDxe.ffs
name: NvStrapsReBar (built on Windows)
path: ${{github.workspace}}/Build/NvStrapsReBar/RELEASE_VS2019/X64/NvStrapsReBar.ffs


rebardxe-linux:
NvStrapsReBar-linux:
runs-on: ubuntu-22.04

env:
Expand All @@ -84,10 +84,10 @@ jobs:
submodules: 'recursive'
path: '.'

- name: Download RebarUEFI
- name: Download NvStrapsReBar
uses: actions/checkout@v3
with:
path: './ReBarUEFI/'
path: './NvStrapsReBar/'

- name: Install dependencies
run: sudo apt install build-essential uuid-dev iasl git nasm python-is-python3
Expand All @@ -98,11 +98,11 @@ jobs:
- name: Setup EDK2
run: bash -c "source edksetup.sh"

- name: Build RebarDxe
run: ./ReBarUEFI/.github/workflows/buildffs.sh
- name: Build NvStrapsReBar
run: ./NvStrapsReBar/.github/workflows/buildffs.sh

- name: Upload ReBarDxe artifact
- name: Upload NvStrapsReBar artifact
uses: actions/upload-artifact@master
with:
name: ReBarDxe (built on Linux)
path: ${{github.workspace}}/Build/ReBarUEFI/RELEASE_GCC5/X64/ReBarDxe.ffs
name: NvStrapsReBar (built on Linux)
path: ${{github.workspace}}/Build/NvStrapsReBar/RELEASE_GCC5/X64/NvStrapsReBar.ffs
20 changes: 10 additions & 10 deletions ReBarDxe/include/LocalPciGPU.h
Expand Up @@ -9,33 +9,33 @@
// for your GPU and for the associated PCI-to-PCI bridge

#define TARGET_GPU_PCI_VENDOR_ID 0x10DEu
#define TARGET_GPU_PCI_DEVICE_ID 0x1E07u
#define TARGET_GPU_PCI_DEVICE_ID 0x2191u

#define TARGET_GPU_PCI_BUS 0x41u
#define TARGET_GPU_PCI_BUS 0x01u
#define TARGET_GPU_PCI_DEVICE 0x00u
#define TARGET_GPU_PCI_FUNCTION 0x00u

// PCIe config register offset 0x10
#define TARGET_GPU_BAR0_ADDRESS UINT32_C(0x9200'0000) // Should fall within memory range mapped by the bridge
#define TARGET_GPU_BAR0_ADDRESS UINT32_C(0xB300'0000) // Should fall within memory range mapped by the bridge

// Secondary bus of the bridge must match the GPU bus
// Check the output form CPU-Z .txt report

#define TARGET_BRIDGE_PCI_VENDOR_ID 0x1022u
#define TARGET_BRIDGE_PCI_DEVICE_ID 0x1453u
#define TARGET_BRIDGE_PCI_VENDOR_ID 0x8086u
#define TARGET_BRIDGE_PCI_DEVICE_ID 0x1901u

#define TARGET_BRIDGE_PCI_BUS 0x40u
#define TARGET_BRIDGE_PCI_DEVICE 0x03u
#define TARGET_BRIDGE_PCI_FUNCTION 0x01u
#define TARGET_BRIDGE_PCI_BUS 0x00u
#define TARGET_BRIDGE_PCI_DEVICE 0x01u
#define TARGET_BRIDGE_PCI_FUNCTION 0x00u

// Memory range and I/O port range (base + limit) mapped to bridge
// from CPU-Z .txt report of the bridge and GPU

// PCIe config register offset 0x20
#define TARGET_BRIDGE_MEM_BASE_LIMIT UINT32_C(0x9300'9200) // Should cover the GPU BAR0
#define TARGET_BRIDGE_MEM_BASE_LIMIT UINT32_C(0xB400'A000) // Should cover the GPU BAR0

// PCIe config register offset 0x1C
#define TARGET_BRIDGE_IO_BASE_LIMIT 0x8181u
#define TARGET_BRIDGE_IO_BASE_LIMIT 0x4040u

static_assert((TARGET_GPU_BAR0_ADDRESS & UINT32_C(0x0000'0001)) == 0u, "Unexpected GPU BAR0 in the I/O port range");
static_assert((TARGET_GPU_BAR0_ADDRESS & UINT32_C(0x0000'0006)) == 0u, "Unexpected GPU BAR0 in the 64-bit memory address space");
Expand Down

0 comments on commit 622cc00

Please sign in to comment.