Files
linuxkit/tools/mkimage-rpi3/Dockerfile
Sachi King ea66def1fb Update RPi3 firmware to fix startup on newer kit
With the current firmware being pulled for the RPi3, recent revisions of
the RPi hardware, such as the 3 B+ will fail to boot.

The issue is exhibited as when RPi 3 B+ receives power and attempts to
boot, the power LED will turn off and the ACT LED will flash 8 times.
According to elinux.org troubleshooting guide[0] this correlates to an
SDRAM initialisation error that can be fixed by updating the firmware.

After updating this firmware the power light stays on, and UBoot can be
seen booting.

[0] - https://elinux.org/R-Pi_Troubleshooting#Green_LED_blinks_in_a_specific_pattern

Signed-off-by: Sachi King <nakato@nakato.io>
2019-04-23 10:30:31 +10:00

57 lines
1.9 KiB
Docker

FROM linuxkit/alpine:86cd4f51b49fb9a078b50201d892a3c7973d48ec as build
RUN apk add \
bc \
dtc \
curl \
make \
gcc \
git \
musl-dev \
patch
# Create small rootfs
RUN mkdir -p /out/etc/apk && cp -r /etc/apk/* /out/etc/apk/
RUN apk add --no-cache --initdb -p /out \
alpine-baselayout \
busybox \
libarchive-tools \
musl \
tar
RUN rm -rf /out/etc/apk /out/lib/apk /out/var/cache
# u-boot compile. The patch is needed to handle larger kernels
ENV UBOOT_COMMIT=v2017.09
COPY u-boot.patch .
RUN git clone https://github.com/u-boot/u-boot.git && \
cd /u-boot && \
git checkout $UBOOT_COMMIT
WORKDIR /u-boot
RUN patch -p 1 < /u-boot.patch && \
make rpi_3_defconfig all && \
mkdir -p /out/boot && \
cp u-boot.bin /out/boot && \
mkdir -p /out/bin && \
cp tools/mkimage /out/bin
# fetch the Raspberry Pi 3 firmware (latest master)
ENV RPI_COMMIT=f8939644f7bd3065068787f1f92b3f3c79cf3de9
RUN mkdir -p /out/boot && \
cd /out/boot && \
curl -fsSLO https://github.com/raspberrypi/firmware/raw/$RPI_COMMIT/boot/LICENCE.broadcom && \
curl -fsSLO https://github.com/raspberrypi/firmware/raw/$RPI_COMMIT/boot/bootcode.bin && \
curl -fsSLO https://github.com/raspberrypi/firmware/raw/$RPI_COMMIT/boot/fixup_cd.dat && \
curl -fsSLO https://github.com/raspberrypi/firmware/raw/$RPI_COMMIT/boot/fixup.dat && \
curl -fsSLO https://github.com/raspberrypi/firmware/raw/$RPI_COMMIT/boot/fixup_x.dat && \
curl -fsSLO https://github.com/raspberrypi/firmware/raw/$RPI_COMMIT/boot/start_cd.elf && \
curl -fsSLO https://github.com/raspberrypi/firmware/raw/$RPI_COMMIT/boot/start.elf && \
curl -fsSLO https://github.com/raspberrypi/firmware/raw/$RPI_COMMIT/boot/start_x.elf
FROM scratch
ENTRYPOINT []
CMD []
WORKDIR /
COPY --from=build /out/ /
COPY config.txt boot.script /boot/
COPY make-rpi3 /
ENTRYPOINT [ "/make-rpi3" ]