BPI-R2 OpenWrt(LEDE) Souce code : 2018-04-11

Source code

The source code is at: https://github.com/garywangcn/bpi-r2_lede/tree/bpi-r2-on-lede-v1

Please clone the code to local and checkout the code from branch bpi-r2-on-lede-v1.


Run “make menuconfig” to configure this project, and run command “make -j1 V=s” to build it. A configuration file of this project is attached for you reference(.config (122.4 KB) )


You will get three images:

  • build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-mediatek_32/mtk-bpi-r2-SD.img: This is for SD image, please program it to SD card by executing command “dd if=mtk-bpi-r2-SD.img of=/dev/mmcblkx”

  • build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-mediatek_32/mtk-bpi-r2-EMMC.img: This is for EMMC image, please follow below steps to program it EMMC: We need another system which is running on SD card to program EMMC image to EMMC, please follow below steps to do:

    1. Copy EMMC image to a running system which is from SD card
    2. Program EMMC image to User Data Area of EMMC: dd if=mtk-bpi-r2-EMMC.img of=/dev/mmcblk0 (assume /dev/mmcblk0 is for EMMC)
    3. Unlock EMMC boot0 block: echo 0 > /sys/block/mmcblk0boot0/force_ro
    4. Program preloader to EMMC boot0 block: dd if=mtk-bpi-r2-EMMC.img of=/dev/mmcblk0boot0 bs=1M count=1
    5. Change the Partition configurion of EMMC is 48h: reboot the system which is running SD, and enter the U-boot command line, run command emmc pconf 48 (for this steps, we can change partition configuration in userspace by using mmc-utils, see more information in BPI-R2 OpenWrt(LEDE) Souce code : 2018-04-11)
    6. Power off, remove SD card, and then power on R2 board.
  • bin/targets/mediatek/32/lede-mediatek-32-bananapi,bpi-r2-sysupgrade.tar:

    This is for runtime upgrade, copy it to R2 board which is running OpenWrt system(no matter where(SD or EMMC) it boots from), and then run command “sysupgrade lede-mediatek-32-bananapi,bpi-r2-sysupgrade.tar” to update both kernel and rootfs.

    Please note that sysupgrade can be executed when jffs2 file system is initialized completely, the log “jffs2_build_xattr_subsystem: complete building xattr subsystem” means the initialization of jffs2 file system is done.

Image link

Supported Features

  1. Support WIFI module(package package/utils/wmt) (New)
  2. Two pre-program image and one upgrade package are generated (New)
  3. Add uboot package to this project(package/boot/uboot-mtk-bpi-r2) (New)
  4. Two Ethernet interfaces and switch works
  5. Both PCIe0 and PCIe1 works
  6. sysupgrade tool is supported (New)
  7. Both SATA interfaces works


  1. Both HDMI and MIPI interface do NOT work
  2. PCIe2 (which is shared with USB3.0) does NOT work

Hi Garywang: where is the release note? which feature be updated?

Thank you~!


Will update it later.

Hello! The good news is that the work on the project continues. I would like to clarify:

  1. Are you contacting the openwrt team? Is it planned to add support for BPI-R2 to the stable branch of the openwrt project?
  2. Does work the applications from the standard openwrt repository (installed by opkg)?

Thanks for your questions, Tohin.

  1. So far we don’t have plan to support R2 on other branch. We will try to support more features in current branch.
  2. There is a problem that a package from standard openwrt repository can’t be installed, we will find out the root cause, and fix it if it’s possbile.

Thanks Gary

Will you push the code up-to github? I need to add some package by myself. :kissing_heart:

The source code on github is latest, so you can add some packages based it. May I know what packages will you add? Can you share them with us?

You can uncomment openwrt source feeds in feeds.conf.default file. And compile the required packages. If they compile successfully, they will work. I, for example, compile a package of vtun, absent in LEDE.

Well, when i see this. I think the switch is work in Openwrt with 802.1q VLAN support. So I ask you for latest code.

I don’t have any special packages to add. Just some useful for me, like mentohust for ruijie 802.1x verification. And some web packages like php. Also some network tools like mtr and nmap.

VLAN isn’t supported yet, a few patch is required, we will support it later.


I have built the image yesterday. I had to change a few things (libuci-lua old version). But a after a while the build was successful and the new image works. Somethings still need more work: WLAN, VLAN, HWNAT Especially the loading of the wlan-module is not very comfortable, it should be loaded automatically at boot of the bpi-r2. Another thing is vlan, every cheap wlan-router can do that …

But for now this is the first image usable!

THANKS A LOT for all the work, I know it is not easy to implent something new!


John Crispin seems have added the support for bpi r2 to nbd staging tree


I think as long as the new kernel supports it, openwert or lede should also support it easily

These are the patches that are not working correctly…currently i have response from john,lede-team or sean about the damaged packets

Please fill in the normal file hosting. From Baidu or torn or archive the bad and is not unpacked.

Hi Garywang

updated downloaded from https://downloads.openwrt.org/snapshots/targets/mediatek/32/openwrt-mediatek-32-bananapi,bpi-r2-sysupgrade.tar. Does not start the kernel panic, is it not compatible with your build?

Did you choose Boot Loader?

you could execute make menuconfig

Choose : Boot Loader —> u-boot-bpi_r2

then you could build successfully.

I don’t think it’s compatibile

We found a tool mmc-utils that is for configuring MMC storage devices from userspace, so we can change the Boot Partition setting in userspance.

How to build it

  1. install by running below commands ./scripts/feeds update -a ./scripts/feeds install -a

  2. Select in menuconfig make menuconfig -> Utililes -> mmc-utils

  3. Rebuild Openwrt project

How to use it

1 .mmc extcsd read /dev/mmcblk0 | grep PARTITION_CONFIG Boot configuration bytes [PARTITION_CONFIG: 0x00]

  1. mmc bootpart enable 1 1 /dev/mmcblk0

  2. mmc extcsd read /dev/mmcblk1 | grep PARTITION_CONFIG Boot configuration bytes [PARTITION_CONFIG: 0x48]

After finishing above steps, the board can boot from eMMC, so we don’t need enter u-boot shell to change PARTITION_CONFIG.


Software environment

  • System: Linux LEDE 4.9.44 #0 SMP PREEMPT Fri Apr 13 13:46:33 2018 armv7l GNU/Linux
  • Firmware: All intel firmwares are installed
  • Kernel module: All dependencies are installed

I insert Intel Dual Band Wireless-AC 7260 NIC into BPI-R2. Use lspci can see the network card but use ifconfig -a can’t find it. I check the system log(/var/log/messages). It reminds the missing “iwlwifi-7260-17.ucode” file. I find and copy this file to /lib/firmware and reload modules.

insmod iwlwifi.ko
insmod iwlegacy.ko

Terminal output

failed to insert iwlegacy.ko

System log(/var/log/messages)

Apr 19 11:19:59 LEDE kernel: [ 200.968773] iwlegacy: Unknown symbol __ieee80211_get_radio_led_name (err 0)

insmod iwlmvm.ko

Terminal output

failed to insert iwlmvm.ko

System log output(/var/log/messages)

Apr 19 11:21:42 LEDE kernel: [  303.969064] iwlmvm: Unknown symbol ieee80211_wake_queue (err 0)
Apr 19 11:21:42 LEDE kernel: [  303.999996] iwlmvm: Unknown symbol ieee80211_sta_set_buffered (err 0)
Apr 19 11:21:42 LEDE kernel: [  304.019293] iwlmvm: Unknown symbol ieee80211_stop_tx_ba_cb_irqsafe (err 0)
Apr 19 11:21:42 LEDE kernel: [  304.057047] iwlmvm: Unknown symbol ieee80211_sta_block_awake (err 0)
Apr 19 11:21:42 LEDE kernel: [  304.070646] iwlmvm: Unknown symbol ieee80211_sta_pspoll (err 0)
Apr 19 11:21:42 LEDE kernel: [  304.120227] iwlmvm: Unknown symbol ieee80211_stop_queue (err 0)
Apr 19 11:21:43 LEDE kernel: [  304.158954] iwlmvm: Unknown symbol ieee80211_sched_scan_results (err 0)
Apr 19 11:21:43 LEDE kernel: [  304.179765] iwlmvm: Unknown symbol rate_control_send_low (err 0)
Apr 19 11:21:43 LEDE kernel: [  304.198025] iwlmvm: Unknown symbol ieee80211_resume_disconnect (err 0)
Apr 19 11:21:43 LEDE kernel: [  304.211234] iwlmvm: Unknown symbol ieee80211_tdls_oper_request (err 0)
Apr 19 11:21:43 LEDE kernel: [  304.256943] iwlmvm: Unknown symbol ieee80211_rx_napi (err 0)

There is still no way to load this wireless network card. Help me!!!