Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
- Add Linux defconfig and update build instructions
  TEST: Added Github Workflow CI that uses the new instructions
- Add Github Workflows to build u-root and Linux
  TEST: Confirmed the build binary boots u-root on RPI4

Signed-off-by: Patrick Rudolph <[email protected]>
  • Loading branch information
PatrickRudolph committed Jul 2, 2024
1 parent 9382ba1 commit 5c15e9d
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 4 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/workflows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Firmware build action
on:
push:
branches: [main, master]
pull_request:
types: [opened, reopened, synchronize]
jobs:
uroot_build:
runs-on: ubuntu-latest
container:
image: ghcr.io/9elements/firmware-action/linux_6.1.45:f2d1f92
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
token: ${{ secrets.MY_REPO_PAT || github.token }}
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: stable

- name: Build u-root
shell: bash
working-directory: ./u-root
env:
GOARCH: arm64
run: |
go build .
./u-root -defaultsh gosh -o initramfs.cpio boot coreboot-app ./cmds/core/* ./cmds/boot/*
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: uroot-binary
path: |
./u-root/initramfs.cpio
linux_build:
runs-on: ubuntu-latest
container:
image: ghcr.io/9elements/firmware-action/linux_6.1.45:f2d1f92
needs: uroot_build
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
token: ${{ secrets.MY_REPO_PAT || github.token }}

- uses: actions/download-artifact@v3
with:
name: uroot-binary
path: ./u-root/

- name: Build kernel
shell: bash
working-directory: ./linux
env:
ARCH: arm64
CROSS_COMPILE: aarch64-linux-gnu-
run: |
make bcm2711_defconfig
./scripts/kconfig/merge_config.sh .config ../acpi.conf ../uroot_initramfs.conf
make Image -j$(nproc)
make dtbs -j$(nproc)
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: linux-binary
path: |
./linux/arch/arm64/boot/Image
./linux/arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b.dtb
./linux/.config
28 changes: 24 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ cd -

```
cd linux
echo "CONFIG_INITRAMFS_SOURCE=\"../u-root/initramfs.cpio\"" >> arch/arm64/configs/bcm2711_defconfig
echo "CONFIG_CMDLINE_FORCE=y" >> arch/arm64/configs/bcm2711_defconfig
ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make bcm2711_defconfig
ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make -j$(nproc)
export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-gnu-
make bcm2711_defconfig
./scripts/kconfig/merge_config.sh .config ../acpi.conf ../uroot_initramfs.conf
make Image -j$(nproc)
make dtbs -j$(nproc)
cd -
```

Expand Down Expand Up @@ -76,3 +78,21 @@ If you do changes inside of the u-boot repository you can commit them like usual
git subtree push --prefix u-boot [remote that points to u-boot-acpi repo] master
```
This will automatically push the changes to the u-boot-acpi repository as well as keep the change in this repository.

## Testing in QEMU:

Starting with QEMU 9.0 you can run the RPI 4 in qemu:

Update boot_cmd.txt:
```
fatload mmc 1:1 ${kernel_addr_r} Image
fatsize mmc 1:1 Image
#setenv bootargs "console=ttyS0,115200 console=tty1"
bootefi ${kernel_addr_r}:${filesize} -
```

To run u-boot and boot from MMC run:
```
qemu-system-aarch64 -machine raspi4b -kernel u-boot/u-boot.bin -cpu cortex-a72 -smp 4 -m 2G -drive file=raspbian.img,format=raw,index=0 -dtb linux/arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b.dtb -nographic
```
Note: Assumes you have *Image* copied into the raspbian.img image.
16 changes: 16 additions & 0 deletions acpi.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
CONFIG_ACPI=y
CONFIG_ACPI_DEBUGGER=y
CONFIG_ACPI_DEBUGGER_USER=y
CONFIG_ACPI_EC_DEBUGFS=y
CONFIG_ACPI_DOCK=y
CONFIG_ACPI_PCI_SLOT=y
CONFIG_ACPI_CONTAINER=y
CONFIG_ACPI_CUSTOM_METHOD=y
CONFIG_ACPI_BGRT=y
CONFIG_ACPI_APEI=y
CONFIG_ACPI_APEI_GHES=y
CONFIG_ACPI_APEI_EINJ=y
CONFIG_ACPI_APEI_ERST_DEBUG=y
CONFIG_ACPI_CONFIGFS=y
CONFIG_ARM64_ACPI_PARKING_PROTOCOL=y
CONFIG_CMDLINE_FORCE=y
1 change: 1 addition & 0 deletions uroot_initramfs.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_INITRAMFS_SOURCE="../u-root/initramfs.cpio"

0 comments on commit 5c15e9d

Please sign in to comment.