Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build-boot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
matrix:
defconfig:
- aarch64_qemu_boot
- bpi_m1_boot
- bpi_r3_sd_boot
- bpi_r3_emmc_boot
- bpi_r4_sd_boot
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
options:
- raspberrypi-rpi2
- raspberrypi-rpi64
- bananapi-bpi-m1
- bananapi-bpi-r3
- bananapi-bpi-r4
- bananapi-bpi-r64
Expand Down Expand Up @@ -69,6 +70,11 @@ jobs:
targets="sdcard"
bootloader_sdcard=rpi64-boot
;;
bananapi-bpi-m1)
arch=arm
targets="sdcard"
bootloader_sdcard=bpi-m1-boot
;;
bananapi-bpi-r3)
arch=aarch64
targets="sdcard emmc"
Expand Down
1 change: 1 addition & 0 deletions board/arm/Config.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
if BR2_arm

source "$BR2_EXTERNAL_INFIX_PATH/board/arm/bananapi-bpi-m1/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/board/arm/microchip-sama7g54-ek/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/board/arm/raspberrypi-rpi2/Config.in"

Expand Down
1 change: 1 addition & 0 deletions board/arm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ Arm 32-bit
Board Specific Documentation
----------------------------

- [Banana Pi BPI-M1 (32-bit)](bananapi-bpi-m1/)
- [Microchip SAMA7G54-EK (32-bit)](microchip-sama7g54-ek/)
- [Raspberry Pi 2 Model B (32-bit)](raspberrypi-rpi2/)
9 changes: 9 additions & 0 deletions board/arm/bananapi-bpi-m1/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
config BR2_PACKAGE_BANANAPI_BPI_M1
bool "Banana Pi BPI-M1"
depends on BR2_arm
select SDCARD_AUX
select BR2_PACKAGE_INPUT_EVENT_DAEMON
help
Support for the Banana Pi BPI-M1 single-board computer, the
first Banana Pi, with an Allwinner A20 dual-core Cortex-A7,
1 GiB DDR3, Gigabit Ethernet, SATA and an SD card slot.
13 changes: 13 additions & 0 deletions board/arm/bananapi-bpi-m1/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright (c) 2026 The KernelKit Authors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
114 changes: 114 additions & 0 deletions board/arm/bananapi-bpi-m1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
Banana Pi BPI-M1
================

The [BPI-M1][1] is the first Banana Pi board, powered by the Allwinner
A20 dual-core Cortex-A7 @ 1 GHz with 1 GB DDR3 RAM.

The board features:

- Gigabit Ethernet
- SD card slot (full size)
- SATA 2.0 port
- 2x USB 2.0 host, 1x micro USB OTG
- HDMI, composite video and audio out
- 26-pin GPIO header

> [!NOTE]
> The BPI-M1+ is a different board with its own device tree and is not
> covered by this BSP.

How to Build
------------

There are no pre-built images for ARM 32-bit, so build both Infix and
the bootloader from source.

1. Build the bootloader

make O=x-boot-bpi-m1 bpi_m1_boot_defconfig
make O=x-boot-bpi-m1

2. Build Infix

make O=x-arm arm_defconfig
make O=x-arm

3. Create the SD card image

./utils/mkimage.sh -b x-boot-bpi-m1 -r x-arm bananapi-bpi-m1

To test only the bootloader, e.g., to verify the console, create a
boot-only image after step 1:

./utils/mkimage.sh -B -b x-boot-bpi-m1 bananapi-bpi-m1

Flashing to SD Card
-------------------

[Flash the image][0] to an SD card (at least 2 GB):

```bash
sudo bmaptool copy x-boot-bpi-m1/images/infix-bpi-m1-sdcard.img /dev/sdX
```

> [!WARNING]
> Ensure `/dev/sdX` is the correct device for your SD card and not used
> by the host system! Use `lsblk` to verify.

Booting the Board
-----------------

1. Insert the flashed SD card
2. Connect an Ethernet cable
3. Power up the board, 5V DC via the micro USB port
4. Find the assigned IP and SSH in, default login: `admin` / `admin`

The board has no user button, so U-Boot always runs in developer mode.
Use `bootmenu` on the console for factory reset.

LEDs and Buttons
----------------

| **Stage** | **USR** (green) |
|----------------|-----------------|
| U-Boot | on |
| System loading | 1 Hz |
| System up | on |
| Locate | 1 Hz |
| Fail safe | 5 Hz |
| Panic | 5 Hz |

The Ethernet port LEDs show link and activity.

The power button powers on the board, and a short press when running
powers it off. The reset button is a hardware reset.

Unsupported Features
--------------------

The following hardware has no driver enabled in Infix:

- Analog audio and composite video out
- HDMI audio, not supported by mainline Linux on the A20
- IR receiver
- Micro USB OTG port
- Mali-400 GPU and video decoder

Console Port
------------

<img align="right" src="uart-pins.png" alt="UART pins" width=360 padding=10>

The debug console is UART0, TX and RX on header J11 and GND on the
neighboring header J12:

- Baud rate: 115200
- Data bits: 8
- Parity: None
- Stop bits: 1

> [!WARNING]
> Use only 3.3V serial adapters.

[0]: https://www.kernelkit.org/posts/flashing-sdcard/
[1]: https://docs.banana-pi.org/en/BPI-M1/BananaPi_BPI-M1
2 changes: 2 additions & 0 deletions board/arm/bananapi-bpi-m1/bananapi-bpi-m1.hash
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Locally calculated
sha256 d48246c717b505cc11df95171f2fd548b389e1a463f1af4c68d0b69fe0d1009b LICENSE
84 changes: 84 additions & 0 deletions board/arm/bananapi-bpi-m1/bananapi-bpi-m1.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Banana Pi BPI-M1 kernel configuration fixups
define BANANAPI_BPI_M1_LINUX_CONFIG_FIXUPS
# Allwinner A20 SoC
$(call KCONFIG_ENABLE_OPT,CONFIG_ARCH_SUNXI)
$(call KCONFIG_ENABLE_OPT,CONFIG_MACH_SUN7I)
$(call KCONFIG_ENABLE_OPT,CONFIG_SUNXI_SRAM)

# Serial console
$(call KCONFIG_ENABLE_OPT,CONFIG_SERIAL_8250)
$(call KCONFIG_ENABLE_OPT,CONFIG_SERIAL_8250_CONSOLE)
$(call KCONFIG_ENABLE_OPT,CONFIG_SERIAL_8250_DW)

# Network: GMAC with Realtek PHY
$(call KCONFIG_ENABLE_OPT,CONFIG_NET_VENDOR_STMICRO)
$(call KCONFIG_ENABLE_OPT,CONFIG_STMMAC_ETH)
$(call KCONFIG_ENABLE_OPT,CONFIG_STMMAC_PLATFORM)
$(call KCONFIG_ENABLE_OPT,CONFIG_DWMAC_SUNXI)
$(call KCONFIG_ENABLE_OPT,CONFIG_REALTEK_PHY)

# MMC/SD and SATA
$(call KCONFIG_ENABLE_OPT,CONFIG_MMC_SUNXI)
$(call KCONFIG_ENABLE_OPT,CONFIG_AHCI_SUNXI)

# AXP209 PMIC, supplies the CPU and USB VBUS regulators
$(call KCONFIG_ENABLE_OPT,CONFIG_I2C)
$(call KCONFIG_ENABLE_OPT,CONFIG_I2C_MV64XXX)
$(call KCONFIG_ENABLE_OPT,CONFIG_MFD_AXP20X_I2C)
$(call KCONFIG_ENABLE_OPT,CONFIG_REGULATOR_AXP20X)

# USB Host, the PHY depends on POWER_SUPPLY, with keyboard and mouse
$(call KCONFIG_ENABLE_OPT,CONFIG_POWER_SUPPLY)
$(call KCONFIG_ENABLE_OPT,CONFIG_PHY_SUN4I_USB)
$(call KCONFIG_SET_OPT,CONFIG_USB_EHCI_HCD,m)
$(call KCONFIG_SET_OPT,CONFIG_USB_EHCI_HCD_PLATFORM,m)
$(call KCONFIG_SET_OPT,CONFIG_USB_OHCI_HCD,m)
$(call KCONFIG_SET_OPT,CONFIG_USB_OHCI_HCD_PLATFORM,m)
$(call KCONFIG_ENABLE_OPT,CONFIG_USB_HID)
$(call KCONFIG_SET_OPT,CONFIG_HID_GENERIC,m)

# Power button on the AXP209, KEY_POWER for input-event-daemon
$(call KCONFIG_ENABLE_OPT,CONFIG_INPUT_MISC)
$(call KCONFIG_ENABLE_OPT,CONFIG_INPUT_AXP20X_PEK)

# SPI header
$(call KCONFIG_ENABLE_OPT,CONFIG_SPI_SUN4I)

# Temperature: SoC sensor in the touchscreen controller, used by
# the cpu-thermal zone to throttle, and AXP209 die temp over IIO
$(call KCONFIG_ENABLE_OPT,CONFIG_TOUCHSCREEN_SUN4I)
$(call KCONFIG_ENABLE_OPT,CONFIG_CPU_THERMAL)
$(call KCONFIG_ENABLE_OPT,CONFIG_IIO)
$(call KCONFIG_ENABLE_OPT,CONFIG_AXP20X_ADC)
$(call KCONFIG_ENABLE_OPT,CONFIG_SENSORS_IIO_HWMON)

# LEDs: green user LED on GPIO, RTL8211E PHY LEDs offloaded to
# the PHY with the netdev trigger
$(call KCONFIG_ENABLE_OPT,CONFIG_LEDS_GPIO)
$(call KCONFIG_ENABLE_OPT,CONFIG_LEDS_TRIGGER_NETDEV)

# HDMI output with framebuffer console, no HDMI audio in mainline
$(call KCONFIG_ENABLE_OPT,CONFIG_DRM)
$(call KCONFIG_SET_OPT,CONFIG_DRM_SUN4I,m)
$(call KCONFIG_SET_OPT,CONFIG_DRM_SUN4I_HDMI,m)
$(call KCONFIG_ENABLE_OPT,CONFIG_DRM_SUN4I_HDMI_CEC)
$(call KCONFIG_SET_OPT,CONFIG_DRM_SUN4I_BACKEND,m)
$(call KCONFIG_ENABLE_OPT,CONFIG_DRM_FBDEV_EMULATION)
$(call KCONFIG_ENABLE_OPT,CONFIG_FB)
$(call KCONFIG_ENABLE_OPT,CONFIG_FRAMEBUFFER_CONSOLE)

# Watchdog, RTC and SID (unique chip ID)
$(call KCONFIG_ENABLE_OPT,CONFIG_WATCHDOG)
$(call KCONFIG_ENABLE_OPT,CONFIG_SUNXI_WATCHDOG)
$(call KCONFIG_ENABLE_OPT,CONFIG_RTC_CLASS)
$(call KCONFIG_ENABLE_OPT,CONFIG_RTC_DRV_SUNXI)
$(call KCONFIG_ENABLE_OPT,CONFIG_NVMEM)
$(call KCONFIG_ENABLE_OPT,CONFIG_NVMEM_SUNXI_SID)

# Crypto hardware acceleration
$(call KCONFIG_ENABLE_OPT,CONFIG_CRYPTO_DEV_ALLWINNER)
$(call KCONFIG_ENABLE_OPT,CONFIG_CRYPTO_DEV_SUN4I_SS)
endef

$(eval $(ix-board))
$(eval $(generic-package))
1 change: 1 addition & 0 deletions board/arm/bananapi-bpi-m1/dts/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dtb-y += allwinner/sun7i-a20-bananapi.dtb
13 changes: 13 additions & 0 deletions board/arm/bananapi-bpi-m1/dts/allwinner/infix.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Common Infix OS defaults
*/

/ {
chosen {
infix {
/* Default admin user password: 'admin' */
factory-password-hash = "$5$mI/zpOAqZYKLC2WU$i7iPzZiIjOjrBF3NyftS9CCq8dfYwHwrmUK097Jca9A";
};
};
};
21 changes: 21 additions & 0 deletions board/arm/bananapi-bpi-m1/dts/allwinner/sun7i-a20-bananapi.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Infix OS device tree for Banana Pi BPI-M1
*/

#include <arm/allwinner/sun7i-a20-bananapi.dts>
#include "infix.dtsi"

/* Only used by arch/arm topology to compare cores, silences boot errors */
&cpu0 {
clock-frequency = <960000000>;
};

&cpu1 {
clock-frequency = <960000000>;
};

/* Keep the LED lit by U-Boot until iitod takes over */
&{/leds/led} {
default-state = "keep";
};
78 changes: 78 additions & 0 deletions board/arm/bananapi-bpi-m1/genimage.cfg.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Disk image for Banana Pi BPI-M1 (Allwinner A20)

image cfg.ext4 {
empty = true
temporary = true
size = 16M

ext4 {
label = "cfg"
use-mke2fs = true
features = "uninit_bg"
extraargs = "-m 0 -i 4096"
}
}

# The /var partition will be expanded automatically at first boot
# to use the full size of the SD-card or eMMC media.
image var.ext4 {
empty = true
temporary = true
size = 128M

ext4 {
label = "var"
use-mke2fs = true
features = "uninit_bg"
extraargs = "-m 0 -i 4096"
}
}

image #IX_ID##VERSION#-bpi-m1-#TARGET#.img {
hdimage {
partition-table-type = "gpt"
# The A20 boot ROM loads the SPL from 8 KiB, move the
# GPT partition entries out of its way
gpt-location = 1M
}

partition u-boot {
in-partition-table = "no"
image = "u-boot-sunxi-with-spl.bin"
offset = 8K
size = 1016K
}

partition aux {
partition-uuid = D4EF35A0-0652-45A1-B3DE-D63339C82035
image = "aux.ext4"
offset = 2M
}

partition primary {
partition-type-uuid = 0FC63DAF-8483-4772-8E79-3D69D8477DE4
bootable = true
size = 250M
image = "rootfs.squashfs"
}

partition secondary {
partition-type-uuid = 0FC63DAF-8483-4772-8E79-3D69D8477DE4
bootable = true
size = 250M
image = "rootfs.squashfs"
}

partition cfg {
partition-uuid = 7aa497f0-73b5-47e5-b2ab-8752d8a48105
image = "cfg.ext4"
}

partition var {
partition-uuid = 8046A06A-E45A-4A14-A6AD-6684704A393F
image = "var.ext4"
}
}

# Silence genimage warnings
config {}
Loading
Loading