Bpi-r64 quick start (boot from eMMC)

For patch semaphore problem try softdep described here: [BPI-R64] mt7622 mac80211 WiFi driver

Thanks, but Im using OpenWRT and there is no rfkill here. Also it is a 7622 driver build into 7615. Regular OpenWRT squashfs was not working so I mount ext4 rootfs. First I thought that it is a problem with filesystem but modules themselves are loaded. Is Firmware loading need some specials like partition name or others unusual bits rather than just regular path to firmware files? I do have them in /lib/firmware/ and also /lib/firmware/mediatek just in case.

but you use mt7615/22 as module, right? imho rootfs is probed for some paths like /lib/firmware for a file in folder mediatek

Yes Im using mt7615e.ko. Like I mention there is /lib/firmware/mediatek folder and can be accessed. I try to unload and load mt7615e but that did not help. I guess I need to trace module that race with mt7615e like you mention with rfkill.

@frank-w I read your wiki about R2 storage and emmc and also halh of this forum and I remember that I sow somewhere that you mention about writing fstab on Openwrt mounts should looks like:

mount
rootfs on / type rootfs (rw)
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,noatime)
sysfs on /sys type sysfs (rw,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)

but I do have:

 mount
/dev/root on / type ext4 (rw,noatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
cgroup on /sys/fs/cgroup type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset,cpu,cpuacct,blkio,memory,devices,freezer,net_cls,pids)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)



so clearly first line with rootfs is missing.

Got that working finally. The issue with mt7615e module was that bluetooth module block firmware loading.It was build into kernel and loaded before rootfs so no chance to get firmware file. Making bluetooth as a module instead build into kernel solved the problem So now I do have fully working OpenWRT from eMMC.

By the way. Problems with mt7622 WiFi TX power stuck at 6 dbm are because of missing wifi EEPROM. If it is provided TX power work correct.

1 Like

How do you build image for emmc? which uboot,which kernel…

we experienced issues acessing emmc on bpi-r64 where uboot and kernel have emmc enabled…

Kerenel (5.4.38), device tree and ext4 rootfs are build with OpenWRT, ext4 are not default image so need to be turned on in menuconfig. Standard squashFs was not working.

u-boot is yours

U-Boot 2014.04-rc1-00040-gc49719fe04-dirty (Oct 17 2019 - 17:51:44)

u-boot-mtk_r64_emmc_mt7531_gcc8.3.bin

Can you write step by step, how you build OpenWrt on 5.4.38 kernel?

Yes, but I need to get that all together

How did you manage to modularize Bluetooth?

I can’t disable Kernel modules > Other modules > kmod-bluetooth. It’s always checked with -*-.

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