Skip to content

Commit 8d9e51c

Browse files
committed
Activate all 3 mmc controllers, to ensure mmcblk2 is used
1 parent dd5d488 commit 8d9e51c

5 files changed

Lines changed: 74 additions & 14 deletions

File tree

.github/workflows/docker-image.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
permissions:
1616
contents: read
1717
packages: write
18+
outputs:
19+
linux-image: ${{ steps.meta.outputs.tags }}
1820
steps:
1921
- name: Set up Docker Buildx
2022
uses: docker/setup-buildx-action@v3
@@ -35,7 +37,7 @@ jobs:
3537
- name: Build
3638
uses: docker/build-push-action@v5
3739
with:
38-
push: ${{ github.event_name != 'pull_request' && github.ref_name == 'main' }}
40+
push: ${{ github.event_name != 'pull_request' }}
3941
tags: ${{ steps.meta.outputs.tags }}
4042
target: linux-build
4143
cache-from: type=gha
@@ -89,5 +91,6 @@ jobs:
8991
cache-to: type=gha,mode=max
9092
build-args: |
9193
fw_version=${{ matrix.os.version }}
94+
linux_image=${{ needs.build-linux.outputs.linux-image }}
9295
9396

Dockerfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ ARG linux_release=5.8.18
66

77
# By default use a cached linux kernel. To build locally pass:
88
# --build-arg linux_image=linux-build
9-
ARG linux_image=ghcr.io/timower/rm-docker-linux:linux-image
9+
ARG linux_image=ghcr.io/timower/rm-docker-linux:main
1010

1111
# Step 1: Build Linux for the emulator
12-
FROM $toltec_image as linux-builder
12+
FROM $toltec_image AS linux-builder
1313

1414
RUN apt-get update && \
1515
apt-get install -y bison bc lzop libssl-dev flex
@@ -22,9 +22,8 @@ RUN curl -o linux.tar.xz https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-$lin
2222
WORKDIR /opt/linux/linux-$linux_release
2323

2424
# Add a device tree with machine name set to 'reMarkable 2.0'
25-
RUN cp arch/arm/boot/dts/imx7d-sbc-imx7.dts arch/arm/boot/dts/imx7d-rm.dts && \
26-
sed -i 's/CompuLab SBC-iMX7/reMarkable 2.0/' arch/arm/boot/dts/imx7d-rm.dts && \
27-
sed -i 's/imx7d-sbc-imx7.dtb/imx7d-sbc-imx7.dtb imx7d-rm.dtb/' arch/arm/boot/dts/Makefile
25+
ADD ./imx7d-rm.dts arch/arm/boot/dts/
26+
RUN sed -i 's/imx7d-sbc-imx7.dtb/imx7d-sbc-imx7.dtb imx7d-rm.dtb/' arch/arm/boot/dts/Makefile
2827

2928
# Default imx7 config, enable uinput and disable all modules
3029
RUN make O=imx7 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- imx_v6_v7_defconfig && \
@@ -87,7 +86,7 @@ COPY --from=rootfs /opt/rootfs.qcow2 /opt/root
8786
ADD bin /opt/bin
8887
ENV PATH=/opt/bin:$PATH
8988

90-
FROM qemu-debug as qemu-base
89+
FROM qemu-debug AS qemu-base
9190

9291
# First boot, disable xochitl and reboot service, and save state
9392
RUN run_vm -serial null -daemonize && \

bin/run_vm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ qemu-system-arm \
1818
-kernel /opt/zImage \
1919
-dtb /opt/imx7d-rm.dtb \
2020
-drive if=sd,file=/opt/root/rootfs.qcow2,format=qcow2,index=2 \
21-
-append "console=ttymxc0 rootfstype=ext4 root=/dev/mmcblk1p2 rw rootwait init=/sbin/init" \
21+
-append "console=ttymxc0 rootfstype=ext4 root=/dev/mmcblk2p2 rw rootwait init=/sbin/init" \
2222
-nic user,hostfwd=tcp::22-:22,hostfwd=tcp::8888-:8888 \
2323
-monitor tcp::5555,server=on,wait=off \
2424
-parallel null -display none \

imx7d-rm.dts

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*
2+
* Edited imx7d device tree to enable all three usdhc controllers.
3+
*
4+
* Support for CompuLab SBC-iMX7 Single Board Computer
5+
*
6+
* Copyright (C) 2015 CompuLab Ltd. - http://www.compulab.co.il/
7+
* Author: Ilya Ledvich <ilya@compulab.co.il>
8+
*
9+
* This file is dual-licensed: you can use it either under the terms
10+
* of the GPL or the X11 license, at your option. Note that this dual
11+
* licensing only applies to this file, and not this project as a
12+
* whole.
13+
*/
14+
15+
#include "imx7d-cl-som-imx7.dts"
16+
17+
/ {
18+
model = "reMarkable 2.0";
19+
compatible = "compulab,sbc-imx7", "compulab,cl-som-imx7", "fsl,imx7d";
20+
};
21+
22+
&usdhc1 {
23+
pinctrl-names = "default";
24+
pinctrl-0 = <&pinctrl_usdhc1>;
25+
cd-gpios = <&gpio5 0 GPIO_ACTIVE_LOW>;
26+
wp-gpios = <&gpio5 1 GPIO_ACTIVE_HIGH>;
27+
wakeup-source;
28+
status = "okay";
29+
};
30+
31+
&usdhc2 {
32+
pinctrl-names = "default";
33+
pinctrl-0 = <&pinctrl_usdhc2>;
34+
status = "okay";
35+
};
36+
37+
&iomuxc {
38+
pinctrl_usdhc1: usdhc1grp {
39+
fsl,pins = <
40+
MX7D_PAD_SD1_CMD__SD1_CMD 0x59
41+
MX7D_PAD_SD1_CLK__SD1_CLK 0x19
42+
MX7D_PAD_SD1_DATA0__SD1_DATA0 0x59
43+
MX7D_PAD_SD1_DATA1__SD1_DATA1 0x59
44+
MX7D_PAD_SD1_DATA2__SD1_DATA2 0x59
45+
MX7D_PAD_SD1_DATA3__SD1_DATA3 0x59
46+
MX7D_PAD_SD1_CD_B__GPIO5_IO0 0x59 /* CD */
47+
MX7D_PAD_SD1_WP__GPIO5_IO1 0x59 /* WP */
48+
>;
49+
};
50+
51+
pinctrl_usdhc2: usdhc2grp {
52+
fsl,pins = <
53+
MX7D_PAD_SD2_CMD__SD2_CMD 0x59
54+
MX7D_PAD_SD2_CLK__SD2_CLK 0x19
55+
MX7D_PAD_SD2_DATA0__SD2_DATA0 0x59
56+
MX7D_PAD_SD2_DATA1__SD2_DATA1 0x59
57+
MX7D_PAD_SD2_DATA2__SD2_DATA2 0x59
58+
MX7D_PAD_SD2_DATA3__SD2_DATA3 0x59
59+
>;
60+
};
61+
62+
};

make_rootfs.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ should_skip_dhcpcd() {
1515
if [ -z "$FW_VERSION" ]; then
1616
return 1 # Don't skip if no version provided
1717
fi
18-
18+
1919
version_parts=$(get_version_parts "$FW_VERSION")
2020
major=$(echo "$version_parts" | cut -d '.' -f 1)
2121
minor=$(echo "$version_parts" | cut -d '.' -f 2)
22-
22+
2323
if [ "$major" -gt 3 ] || ([ "$major" -eq 3 ] && [ "$minor" -ge 12 ]); then
2424
return 0 # Skip dhcpcd modification
2525
else
@@ -45,10 +45,6 @@ mkfs ext4 /dev/sda4
4545
4646
mount /dev/sda2 /
4747
48-
download /etc/fstab /tmp/fstab
49-
! sed -i 's/mmcblk2/mmcblk1/' /tmp/fstab
50-
upload /tmp/fstab /etc/fstab
51-
5248
mount /dev/sda4 /home
5349
cp-a /etc/skel /home/root
5450

0 commit comments

Comments
 (0)