Bpi-r64 quick start (boot from eMMC)

You have to do it in kernel

make kernel_menuconfig

then

Networking support > Bluetooth subsystem support > Bluetooth device drivers

select ‘M’ in MediaTek HCI UART driver

As far as I remember .ko module was generated but not included in rootfs lib/modules and you have to manually copy there.

Thank you.

Could you please be more verbose about building OpenWRT?

I set these options in make menuconfig > Target images

.config - OpenWrt Configuration
 > Target Images ──────────────────────────────────────────────────────────────
  ┌───────────────────────────── Target Images ─────────────────────────────┐
  │  Arrow keys navigate the menu.  <Enter> selects submenus ---> (or empty │  
  │  submenus ----).  Highlighted letters are hotkeys.  Pressing <Y>        │  
  │  includes, <N> excludes, <M> modularizes features.  Press <Esc><Esc> to │  
  │  exit, <?> for Help, </> for Search.  Legend: [*] built-in  [ ]         │  
  │ ┌─────────────────────────────────────────────────────────────────────┐ │  
  │ │    [*] ramdisk  --->                                                │ │  
  │ │        *** Root filesystem archives ***                             │ │  
  │ │    [ ] cpio.gz                                                      │ │  
  │ │    [ ] tar.gz                                                       │ │  
  │ │        *** Root filesystem images ***                               │ │  
  │ │    [*] ext4  --->                                                   │ │  
  │ │    [ ] squashfs  ----                                               │ │  
  │ │    [*] GZip images                                                  │ │  
  │ │        *** Image Options ***                                        │ │  
  │ │    (1024) Root filesystem partition size (in MB)                    │ │  
  │ └─────────────────────────────────────────────────────────────────────┘ │  
  ├─────────────────────────────────────────────────────────────────────────┤  
  │        <Select>    < Exit >    < Help >    < Save >    < Load >         │  
  └─────────────────────────────────────────────────────────────────────────┘  

After building I got these files in bin dir:

parallels@ubuntu-18:~/bpi-r64/openwrt$ ls -l bin/targets/mediatek/mt7622/
total 7576
-rw-r--r-- 1 parallels parallels    3078 May 12 17:03 config.buildinfo
-rw-r--r-- 1 parallels parallels     263 May 12 17:03 feeds.buildinfo
-rwx------ 1 parallels parallels 7722316 May 12 17:32 openwrt-mediatek-mt7622-bpi_bananapi-r64-initramfs-kernel.bin
-rw-r--r-- 1 parallels parallels    3203 May 12 17:32 openwrt-mediatek-mt7622-bpi_bananapi-r64.manifest
drwxr-xr-x 2 parallels parallels   12288 May 12 17:32 packages
-rw-r--r-- 1 parallels parallels     493 May 12 17:32 sha256sums
-rw-r--r-- 1 parallels parallels      18 May 12 17:03 version.buildinfo

I flash openwrt-mediatek-mt7622-bpi_bananapi-r64-initramfs-kernel.bin with 2. System Load Linux Kernel then write to Flash via TFTP.

Then I get OpenWRT started but I stumble upon Failed to get patch semaphore error:

[   31.692568] mt7615e 0000:01:00.0: Message -4294967280 (seq 1) timeout
[   31.699017] mt7615e 0000:01:00.0: Failed to get patch semaphore

And df shows no filesystem:

root@OpenWrt:/# df -h
Filesystem                Size      Used Available Use% Mounted on
tmpfs                   497.7M     68.0K    497.7M   0% /tmp
tmpfs                   512.0K         0    512.0K   0% /dev

Could you please point out what I’m missing?

You need squashfs options. It will create openwrt-mediatek-mt7622-bpi_bananapi-r64-squashfs-sysupgrade.bin image witch you need flash.

Openwrt-mediatek-mt7622-bpi_bananapi-r64-initramfs-kernel.bin image use only for preview OpenWrt, not for working.

Hi. I have also built OpenWRT from the HEAD of master and kernel version 4.19.115. I get the same Failed to get patch semaphore message from mt7615e. In addition I am getting

sh: write error: No such file or directory

repeated three times. Here is the console output:

root@OpenWrt:/# lsmod |grep mt7615e
mac80211              536576  3 mt7615e,mt7615_common,mt76
mt76                   45056  2 mt7615e,mt7615_common
mt7615_common          73728  1 mt7615e
mt7615e                20480  0 
root@OpenWrt:/# rmmod mt7615e
root@OpenWrt:/# modprobe mt7615e
[  874.364277] mt7622-wmac 18000000.wmac: Invalid MAC address, using random address 82:fb:f3:ef:43:be
[  874.375060] ieee80211 phy1: Selected rate control algorithm 'minstrel_ht'
[  874.402564] mt7622-wmac 18000000.wmac: HW/SW Version: 0x8a108a10, Build Time: 20190801210006a
[  874.402564] 
[  874.425612] mt7622-wmac 18000000.wmac: N9 Firmware Version: 2.0, Build Time: 20200131180931
sh: write error: No such file or directory
sh: write error: No such file or directory
sh: write error: No such file or directory

I can’t understand why there is no path printed for indicating which file or directory was unwriteable

I tried thesquashfs image, but it just won’t boot. It stalls on these lines:

[    4.240629] 6 cmdlinepart partitions found on MTD device eMMC
[    4.246374] Creating 6 MTD partitions on "eMMC":
[    4.250989] 0x000000000000-0x0000000c0000 : "preloader"
[    4.256636] 0x0000000c0000-0x000000140000 : "uboot"
[    4.261859] 0x000000140000-0x0000001c0000 : "uboot-env"
[    4.267415] 0x0000001c0000-0x000000200000 : "Factory"
[    4.272795] 0x000000200000-0x000004200000 : "firmware"
[    4.279598] 2 fit-fw partitions found on MTD device firmware
[    4.285287] 0x000000200000-0x0000004e0000 : "kernel"
[    4.290650] 0x0000004e0000-0x000004200000 : "rootfs"
[    4.295944] mtd: device 6 (rootfs) set to be root filesystem
[    4.301610] 1 squashfs-split partitions found on MTD device rootfs
[    4.307788] 0x0000007f0000-0x000004200000 : "rootfs_data"
[    4.313527] 0x000004200000-0x000084200000 : "usrdata"
[    4.318922] block2mtd: mtd0: [eMMC] erase_size = 64KiB [65536]
[    4.324785] rtc_mt7622 10212800.rtc: setting system clock to 2000-01-01T00:02:02 UTC (946684922)
[    4.998988] mt753x gsw@0: Port 0 Link is Up - 1Gbps/Full

Yes, for now we have only one way. Сompile OpenWrt on kernel 4.19 how described in this post [BPI-R64] loading OpenWRT built files into the board

Again…it seems there are issues with linux-mmc driver for r64 emmc. It looks like this is caused by second initialization (first in uboot,second in linux) without reset between. Anybody disabled emmc in uboot and can access emmc-partitions in linux (sdboot)

How to disable emmc in uboot?

You can disable it (afair mmc0) in dts and recompile+reflash

Hi, I have another issue with reboot and emmc/sd preloader.

I followed instructions here : https://wiki.fw-web.de/doku.php?id=en:bpi-r64:storage but it seems that emmc preloader boots only when power is switched on and then bootrom tries to sd after successive linux reboots or board toggle resets.

This is really inconvenient and defeats the purpose of emmc boot if you still need sd…

Has anyone experienced this ? emmc_boot_reset.log (5,0 Ko)

If i u derstand you correctly i have same behaviour on r2 (not tested on r64). Sd/emmc check is only done on poweron and bootdevice stays same on reboot (boot from sd and remove it on reboot still tries to boot from it and not emmc)

you can forward this problem to uboot emmc owner [email protected] or other linux emmc dedicated owner (grep the commit message)

What are the downsides of 4.19 kernel?

My goal is to make WiFi work (both internal and PCIe MTK7615E board) + opkg packages. Will 4.19 allow me this?

PCIe MTK7615E board works for me.

Openwrt with kernel 4.19 afaik does not support mt7622 wifi. Mt7615 should be in,but mt7622 was developed later,so i guess you need to include it by yourself

It’s worse than that because bootdevice ils always sd on reboot/reset for R64.

Have you set bootswitch to proper device? Btw.you can modify your sdcard uboot to always boot from emmc :slight_smile: just set device/partition where kernel gets loaded and bootargs (cmdline for linux)

Yes, I use position 0 to boot from emmc, it works when power is switched on. But reboots and resets always uses SD. In practice this means that you cannot remove SD and must have - at least - headers, preloader and u-boot flashed to it.

1 Like

Ok,it behaves a bit different to r2 where it always boots device accessed on poweron (if emmc booted first,reboot also boots emmc,also if sd is inserted). This behaviour of r64 is odd…maybe @sinovoip can explain cause…i guess it can be sd-preloader which is also in emmc bootchain

@cafebabe @kalminlee @deema can you please test the Fix-Patch for emmc-issue i’ve linked here: Add latest U-boot support for BPI R2 & BPI R64 (not yet) ?