diff --git a/.github/workflows/workflows.yaml b/.github/workflows/workflows.yaml new file mode 100644 index 00000000000..bb7703187f0 --- /dev/null +++ b/.github/workflows/workflows.yaml @@ -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 diff --git a/README.md b/README.md index 5a8e091af31..b656a8a6cec 100644 --- a/README.md +++ b/README.md @@ -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 - ``` @@ -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. diff --git a/acpi.conf b/acpi.conf new file mode 100644 index 00000000000..b20741064de --- /dev/null +++ b/acpi.conf @@ -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 diff --git a/uroot_initramfs.conf b/uroot_initramfs.conf new file mode 100644 index 00000000000..21d98423e65 --- /dev/null +++ b/uroot_initramfs.conf @@ -0,0 +1 @@ +CONFIG_INITRAMFS_SOURCE="../u-root/initramfs.cpio"