source code(Please note that the branch is bpi-r2-on-lede-v1)
Configurion of LEDE
TARGET=MediaTek Ralink ARM
Boot Loaders=u-boot-bpi_r2 (This option is mandatory)
…
How to build
make -j1 V=s
Images
when above steps is done, we will below two images under /build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-mediatek_32/:
mtk-bpi-r2-EMMC.img
mtk-bpi-r2-SD.img
How to use SD image
A SD card is requried and then install mtk-bpi-r2-SD.img to SD card by running below command:
dd if=mtk-bpi-r2-SD.img of=/dev/sdb
where /dev/sdb is the SD card.
And then install the SD card to R2 board, power it on, the board will boot from SD card.
How to use EMMC image
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 on SD card
2. Program EMMC image to User Data Area of EMMC: dd if=mtk-bpi-r2-EMMC.img of=/dev/mmcblk0
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
6. Power off, remove SD card, and then power on R2 board.
The WAN and br-lan should be working fine, please follow below steps.
I think we can get internet via br-lan or wireless, and so on, this depends on you purpose…
Instruction
Please remove the configuration for lan and wan in /etc/config/network, and then add below lines in that file.
config interface 'lan'
option type 'bridge'
option ifname 'lan0 lan1 lan2 lan3'
option proto 'dhcp'
config interface 'wan'
option ifname 'wan'
option proto 'dhcp'
Hey @garywang,
I into bananpi r2 from last few hours.
I am linux developer and would like to contribute to make better OpenWRT/LEDE functional on this board.
Few points:
What are you current working on? What I can do here for banana pi r2?
And by “Program preloader to EMMC boot0 block:” do you mean to replace current bootloader?
do you see wan-port in “ip a”? in you dmesg there is no wan-port…have you connected a cable to it?
the obvious error is
“Error: Driver ‘gpio-keys’ is already registered, aborting…”
i don’t know why the driver is loaded multiple times, but gpio itself failes on the first load
[ 3.129754] mediatek-mt7623-pinctrl 1000b000.pinctrl: pin_config_group_set op failed for group 256
[ 3.138696] gpio-keys gpio_keys: Error applying setting, reverse things back
[ 3.145716] gpio-keys: probe of gpio_keys failed with error -22
maybe you can look in /etc/modules.d/ because of this:
[ 7.433808] kmodloader: loading kernel modules from /etc/modules.d/*
Thanks a lot Kishan.
I’m working on supporting wireless on R2 board. And the HDMI and MIPI interface is not supported if we use OpenWRT/LEDE, do you want to focus on them?
For "Program preloader to EMMC boot0 block“, we need to copy preloader from EMMC IMAGE file to EMMC boot0 block, by default, there is no available preloader in EMMC boot0 block.
Regarding wireless,
OpenWRT uses backport drivers, from github I saw that you deleted mt74 Makefile, at first I thought it was by mistake, but now when I look at kernel config file it looks like you are enabling drivers from kernel itself, correct me if I’m wrong.
From my opinion this hack will create mess in future.
I will also look for other things you mentioned but moreover I am interested in bringing up wireless as soon as possible. Let me know how are you proceeding for wireless.
@garywang as your master-branch isn’t your current “stable” version you should define the “bpi-r2-on-lede-v1”-branch as the default branch, so that one gets cloned…many users may not know that they must change branch before building it and so using the old version
like i changed the default branch in my 4.14 (master is from torvalds/linux and my work goes to main) you can do it, maybe then there are less users using the wrong version
is it right that mtk-bpi-r2-EMMC.img should be programmed to boot-partition? i ask because it have the same size as SD-card-image (67MB) so it seems to be the full OS and not only the preloader which is burned to boot0 when using other images (like debian, ubuntu). i see that you burn the image to both…boot0 and mmcblkx
attention: here is emmc/SD swapped instead of ubuntu/debian-images and my Kernel! with my kernel and debian/ubuntu-Images you must use mmcblk1 instead of mmcblk0
@garywang Hi Gary, i don’t know what i did wrong. I did git clone then git checkout bpi-r2-on-lede-v1
I am still not sure if i had the right and last version.
@frank-w Thanks for your response. I tried to detect wifi configuration, but wireless file stays empty.
Do you have any idea what went wrong if i build software? I do not find a new file in build_dir.
WAN: DHCP is not working! I do not get ipv4 address and internet access.
@garywang Here are some different logs and configs of my device. I have the newest software now at my device.
Can someone explain me how to get wifi working? I already followed the instruction of gary.
WAN Port is working. Thank you.