aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mediatek/patches-5.10
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2021-02-27 14:17:09 +0000
committerDaniel Golle <daniel@makrotopia.org>2021-02-28 04:15:44 +0000
commitdfa0a38d1f4d5bbac768569e3769ae4438a57e73 (patch)
tree04d8c630c07e74bc94db6f429a861dda1a9806ec /target/linux/mediatek/patches-5.10
parentb102e281a4de8f177adcabbff07072a3c926c367 (diff)
downloadupstream-dfa0a38d1f4d5bbac768569e3769ae4438a57e73.tar.gz
upstream-dfa0a38d1f4d5bbac768569e3769ae4438a57e73.tar.bz2
upstream-dfa0a38d1f4d5bbac768569e3769ae4438a57e73.zip
mediatek: rework support for BananaPi BPi-R64
**What's new** * Bring support for the Bananapi BPi-R64 to the level desirable for a nice hackable routerboard. * Use ARM Trusted Firmware A from source. (goodbye binary preloader) * Use Das U-Boot from source. (see previous commit) * Assemble SD-card image using OpenWrt image-commands. (no gen_sd_cruz_foo.sh added, this is not Raspbian) * Updated kernel options to support root filesystem. * Updated DTS to match OpenWrt LAN ports, known LEDs, buttons, ... * Detect root device, handle sysupgrade, config restore, ... * Wire up (known) LEDs and buttons in OpenWrt-fashion. * Build one set of images from SD-card and eMMC. * Hopefully provide a good example of how things can be done right from scratch. **Installation and images** * Have an empty SD-card at hand * Write stuff to the card, as root (card device is /dev/mmcblkX) - write header, gpt, bl2, atf, u-boot and recovery kernel: `cat *bpi-r64-boot-sdcard.img *bpi-r64-initramfs-recovery.fit > /dev/mmcblkX` - rescan partitions: `blockdev --rereadpt /dev/mmcblkX` - write main system to production partition: `cat *bpi-r64-squashfs-sysupgrade.fit > /dev/mmcblkXp5` * Installation to eMMC works using SD-card bootloader via TFTP When running OpenWrt of SD-card, issue this to trigger installation to eMMC: `fw_setenv bootcmd run emmc_init` Be prepared to serve the content of bin/targets/mediatek/mt7622 on TFTP server address 192.168.1.254. **What's missing** * The red LED is always on, probably a hardware bug. * AHCI (probably needs DTS changes) * Ship SD-card image ready with every needed for eMMC install. * The eMMC has a second, currently unused boot partition. This would be ideal to store the WiFi EEPROM and Ethernet MAC address(es). @sinovoip ideas? Thanks to Thomas Hühn @thuehn for providing the hardware! Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'target/linux/mediatek/patches-5.10')
-rw-r--r--target/linux/mediatek/patches-5.10/112-dts-fix-bpi64-lan-names.patch29
-rw-r--r--target/linux/mediatek/patches-5.10/112-dts-fix-bpi64-leds-and-buttons.patch56
-rw-r--r--target/linux/mediatek/patches-5.10/602-arm64-dts-mediatek-Split-PCIe-node-for-MT2712-MT7622.patch2
3 files changed, 86 insertions, 1 deletions
diff --git a/target/linux/mediatek/patches-5.10/112-dts-fix-bpi64-lan-names.patch b/target/linux/mediatek/patches-5.10/112-dts-fix-bpi64-lan-names.patch
new file mode 100644
index 0000000000..55c84812d0
--- /dev/null
+++ b/target/linux/mediatek/patches-5.10/112-dts-fix-bpi64-lan-names.patch
@@ -0,0 +1,29 @@
+--- a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
++++ b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
+@@ -160,22 +160,22 @@
+
+ port@1 {
+ reg = <1>;
+- label = "lan0";
++ label = "lan1";
+ };
+
+ port@2 {
+ reg = <2>;
+- label = "lan1";
++ label = "lan2";
+ };
+
+ port@3 {
+ reg = <3>;
+- label = "lan2";
++ label = "lan3";
+ };
+
+ port@4 {
+ reg = <4>;
+- label = "lan3";
++ label = "lan4";
+ };
+
+ port@6 {
diff --git a/target/linux/mediatek/patches-5.10/112-dts-fix-bpi64-leds-and-buttons.patch b/target/linux/mediatek/patches-5.10/112-dts-fix-bpi64-leds-and-buttons.patch
new file mode 100644
index 0000000000..8b6d3d4934
--- /dev/null
+++ b/target/linux/mediatek/patches-5.10/112-dts-fix-bpi64-leds-and-buttons.patch
@@ -0,0 +1,56 @@
+--- a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
++++ b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
+@@ -18,6 +18,10 @@
+
+ aliases {
+ serial0 = &uart0;
++ led-boot = &led_system_green;
++ led-failsafe = &led_system_blue;
++ led-running = &led_system_green;
++ led-upgrade = &led_system_blue;
+ };
+
+ chosen {
+@@ -41,8 +45,8 @@
+ compatible = "gpio-keys";
+
+ factory {
+- label = "factory";
+- linux,code = <BTN_0>;
++ label = "reset";
++ linux,code = <KEY_RESTART>;
+ gpios = <&pio 0 GPIO_ACTIVE_HIGH>;
+ };
+
+@@ -56,17 +60,25 @@
+ leds {
+ compatible = "gpio-leds";
+
+- green {
+- label = "bpi-r64:pio:green";
+- gpios = <&pio 89 GPIO_ACTIVE_HIGH>;
++ led_system_blue: blue {
++ label = "bpi-r64:pio:blue";
++ gpios = <&pio 85 GPIO_ACTIVE_LOW>;
+ default-state = "off";
+ };
+
+- red {
+- label = "bpi-r64:pio:red";
+- gpios = <&pio 88 GPIO_ACTIVE_HIGH>;
++ led_system_green: green {
++ label = "bpi-r64:pio:green";
++ gpios = <&pio 89 GPIO_ACTIVE_HIGH>;
+ default-state = "off";
+ };
++
++/*
++ * red {
++ * label = "bpi-r64:pio:red";
++ * gpios = <&pio 88 GPIO_ACTIVE_HIGH>;
++ * default-state = "off";
++ * };
++ */
+ };
+
+ memory {
diff --git a/target/linux/mediatek/patches-5.10/602-arm64-dts-mediatek-Split-PCIe-node-for-MT2712-MT7622.patch b/target/linux/mediatek/patches-5.10/602-arm64-dts-mediatek-Split-PCIe-node-for-MT2712-MT7622.patch
index fa4a6ce2db..a680cf0149 100644
--- a/target/linux/mediatek/patches-5.10/602-arm64-dts-mediatek-Split-PCIe-node-for-MT2712-MT7622.patch
+++ b/target/linux/mediatek/patches-5.10/602-arm64-dts-mediatek-Split-PCIe-node-for-MT2712-MT7622.patch
@@ -253,7 +253,7 @@ Signed-off-by: chuanjia.liu <Chuanjia.Liu@mediatek.com>
#interrupt-cells = <1>;
--- a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
+++ b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
-@@ -257,18 +257,16 @@
+@@ -269,18 +269,16 @@
};
};