Repository navigation
bananapim4: add the Banana Pi BPI-M4 (RTD1395) #11071
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
igorpecovnik
wants to merge
7
commits into
main
Choose a base branch
from
bananapim4-rtd1395
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+11,590
−19
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7d613f6
realtek-rtd129x: ship the audio firmware in packages/blobs
igorpecovnik a11eb6f
realtek-rtd129x: move U-Boot to v2026.10
igorpecovnik 2ea11f4
realtek-rtd129x: add RTD1395 and BPI-M4 kernel support
igorpecovnik cd6ef76
realtek-rtd129x: add the RTD1395 PCIe host driver
igorpecovnik 30710f7
realtek-rtd129x: add RTD1395 and BPI-M4 U-Boot support
igorpecovnik 0ea9e67
realtek-rtd129x: boot RTD1395 boards from eMMC
igorpecovnik 37324a7
bananapim4: add the Banana Pi BPI-M4 (RTD1395)
igorpecovnik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Realtek RTD1395 quad core 1GB/2GB RAM 8GB eMMC FE USB HDMI | ||
| BOARD_NAME="BananaPi M4" | ||
| BOARD_VENDOR="sinovoip" | ||
| BOARDFAMILY="realtek-rtd129x" | ||
| BOARD_MAINTAINER="igorpecovnik" | ||
| INTRODUCED="2019" | ||
| BOOTCONFIG="bananapi-m4_defconfig" | ||
| KERNEL_TARGET="current,edge" | ||
| KERNEL_TEST_TARGET="current" | ||
| BOOT_FDT_FILE="realtek/rtd1395-bpi-m4.dtb" | ||
| # The vendor loader in SPI flash reads U-Boot from SD or eMMC sector 80. | ||
| RTD129X_EMMC_BOOTAREA="no" | ||
| # The RTD1395 build of the audio firmware, which runs the HDMI output | ||
| RTD129X_AUDIO_FW_FILE="bluecore-rtd1395.audio" | ||
|
|
||
| # eth0: the RJ45, the SoC's MAC with its embedded 10/100 PHY. | ||
| # wlan0: the RTL8821CU module on USB port 2 (bus 1, port 2). | ||
| function post_family_tweaks__bananapim4_udev_network_interfaces() { | ||
| display_alert "$BOARD" "Renaming interfaces eth0 wlan0" "info" | ||
| mkdir -p "${SDCARD}"/etc/udev/rules.d/ | ||
| cat <<- EOF2 > "${SDCARD}/etc/udev/rules.d/70-persistent-net.rules" | ||
| SUBSYSTEM=="net", ACTION=="add", KERNELS=="98016000.ethernet", NAME:="eth0" | ||
| SUBSYSTEM=="net", ACTION=="add", KERNELS=="1-2:1.2", DRIVERS=="rtw88_8821cu", NAME:="wlan0" | ||
| EOF2 | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
98 changes: 98 additions & 0 deletions
98
...l/archive/realtek-rtd129x-6.18/0030-irqchip-rtd129x-add-the-RTD1395-interrupt-muxes.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| From f6467e42e330eeb25a6fc183791054d552a3e2b5 Mon Sep 17 00:00:00 2001 | ||
| From: Igor Pecovnik <igor@armbian.com> | ||
| Date: Wed, 21 Oct 2026 10:37:07 +0000 | ||
| Subject: [PATCH 30/37] irqchip: rtd129x: add the RTD1395 interrupt muxes | ||
|
|
||
| The RTD1395 has the same ISO and MISC muxes as the RTD1295. | ||
| Some status bits map to other sources. Add tables for them. | ||
|
|
||
| Assisted-by: Claude Opus 5.5 | ||
| Signed-off-by: Igor Pecovnik <igor@armbian.com> | ||
| --- | ||
| drivers/irqchip/irq-rtd129x.c | 63 +++++++++++++++++++++++++++++++++++ | ||
| 1 file changed, 63 insertions(+) | ||
|
|
||
| diff --git a/drivers/irqchip/irq-rtd129x.c b/drivers/irqchip/irq-rtd129x.c | ||
| index 40403cca2..a7398e15b 100644 | ||
| --- a/drivers/irqchip/irq-rtd129x.c | ||
| +++ b/drivers/irqchip/irq-rtd129x.c | ||
| @@ -295,6 +295,53 @@ static int __init rtd129x_irq_mux_init(struct device_node *np, | ||
| return ret; | ||
| } | ||
|
|
||
| +/* RTD1395: no MISC GPIO, RTC or I2C2-4; LSADC and GPHY HV moved to ISO */ | ||
| +static const struct rtd129x_irq_mux_info rtd1395_misc_irq_mux = { | ||
| + .name = "misc", | ||
| + .enable_bit = { | ||
| + [0 ... 31] = RTD129X_IRQ_NONE, | ||
| + [2] = RTD129X_IRQ_UNGATED, | ||
| + [3] = 3, /* UART1 */ | ||
| + [5] = 5, /* UART1 timeout */ | ||
| + [6] = RTD129X_IRQ_UNGATED, | ||
| + [7] = RTD129X_IRQ_UNGATED, | ||
| + [8] = 7, /* UART2 */ | ||
| + [13] = 6, /* UART2 timeout */ | ||
| + [14] = 14, /* I2C5 */ | ||
| + [24] = 24, /* smartcard 0 */ | ||
| + [27] = 27, /* GSPI */ | ||
| + [29] = 29, /* fan */ | ||
| + }, | ||
| +}; | ||
| + | ||
| +static const struct rtd129x_irq_mux_info rtd1395_iso_irq_mux = { | ||
| + .name = "iso", | ||
| + .enable_bit = { | ||
| + [0 ... 31] = RTD129X_IRQ_NONE, | ||
| + [1] = RTD129X_IRQ_UNGATED, | ||
| + [2] = 2, /* UART0 */ | ||
| + [5] = 5, /* IrDA */ | ||
| + [7] = RTD129X_IRQ_UNGATED, | ||
| + [8] = 8, /* I2C0 */ | ||
| + [9] = RTD129X_IRQ_UNGATED, | ||
| + [11] = 11, /* I2C1 */ | ||
| + [12] = 12, /* RTC half-second */ | ||
| + [13] = 13, /* RTC alarm */ | ||
| + [16] = 16, /* LSADC0 */ | ||
| + [17] = 17, /* LSADC1 */ | ||
| + [19] = 19, /* GPIO assert */ | ||
| + [20] = 20, /* GPIO deassert */ | ||
| + [21] = RTD129X_IRQ_UNGATED, | ||
| + [22] = RTD129X_IRQ_UNGATED, | ||
| + [23] = RTD129X_IRQ_UNGATED, | ||
| + [24] = RTD129X_IRQ_UNGATED, | ||
| + [28] = 28, /* GPHY HV */ | ||
| + [29] = 29, /* GPHY digital */ | ||
| + [30] = 30, /* GPHY analog */ | ||
| + [31] = 31, /* I2C1 request */ | ||
| + }, | ||
| +}; | ||
| + | ||
| static int __init rtd1295_misc_irq_mux_init(struct device_node *np, | ||
| struct device_node *parent) | ||
| { | ||
| @@ -307,6 +354,22 @@ static int __init rtd1295_iso_irq_mux_init(struct device_node *np, | ||
| return rtd129x_irq_mux_init(np, parent, &rtd1295_iso_irq_mux); | ||
| } | ||
|
|
||
| +static int __init rtd1395_misc_irq_mux_init(struct device_node *np, | ||
| + struct device_node *parent) | ||
| +{ | ||
| + return rtd129x_irq_mux_init(np, parent, &rtd1395_misc_irq_mux); | ||
| +} | ||
| + | ||
| +static int __init rtd1395_iso_irq_mux_init(struct device_node *np, | ||
| + struct device_node *parent) | ||
| +{ | ||
| + return rtd129x_irq_mux_init(np, parent, &rtd1395_iso_irq_mux); | ||
| +} | ||
| + | ||
| +IRQCHIP_DECLARE(rtd1395_misc_irq_mux, "realtek,rtd1395-misc-irq-mux", | ||
| + rtd1395_misc_irq_mux_init); | ||
| +IRQCHIP_DECLARE(rtd1395_iso_irq_mux, "realtek,rtd1395-iso-irq-mux", | ||
| + rtd1395_iso_irq_mux_init); | ||
| IRQCHIP_DECLARE(rtd1295_misc_irq_mux, "realtek,rtd1295-misc-irq-mux", | ||
| rtd1295_misc_irq_mux_init); | ||
| IRQCHIP_DECLARE(rtd1295_iso_irq_mux, "realtek,rtd1295-iso-irq-mux", | ||
| -- | ||
| 2.53.0 | ||
|
|
30 changes: 30 additions & 0 deletions
30
...nel/archive/realtek-rtd129x-6.18/0031-arm64-drain-the-SB2-bridge-on-the-RTD1395-too.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| From b828f4eba3f330f002c0ade04165ab16e80ca282 Mon Sep 17 00:00:00 2001 | ||
| From: Igor Pecovnik <igor@armbian.com> | ||
| Date: Wed, 21 Oct 2026 10:37:07 +0000 | ||
| Subject: [PATCH 31/37] arm64: drain the SB2 bridge on the RTD1395 too | ||
|
|
||
| The RTD1395 has the same SB2 bridge and sync register. | ||
|
|
||
| Assisted-by: Claude Opus 5.5 | ||
| Signed-off-by: Igor Pecovnik <igor@armbian.com> | ||
| --- | ||
| arch/arm64/kernel/rtd129x-sb2-sync.c | 3 ++- | ||
| 1 file changed, 2 insertions(+), 1 deletion(-) | ||
|
|
||
| diff --git a/arch/arm64/kernel/rtd129x-sb2-sync.c b/arch/arm64/kernel/rtd129x-sb2-sync.c | ||
| index 0c425787c..4a5ecbc7b 100644 | ||
| --- a/arch/arm64/kernel/rtd129x-sb2-sync.c | ||
| +++ b/arch/arm64/kernel/rtd129x-sb2-sync.c | ||
| @@ -58,7 +58,8 @@ static int __init rtd_sb2_sync_init(void) | ||
| { | ||
| if (!of_machine_is_compatible("realtek,rtd1293") && | ||
| !of_machine_is_compatible("realtek,rtd1295") && | ||
| - !of_machine_is_compatible("realtek,rtd1296")) | ||
| + !of_machine_is_compatible("realtek,rtd1296") && | ||
| + !of_machine_is_compatible("realtek,rtd1395")) | ||
| return 0; | ||
|
|
||
| sb2_sync_map = ioremap(RTD129X_SB2_SYNC, 4); | ||
| -- | ||
| 2.53.0 | ||
|
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.