Bpi-r64 quick start (boot from eMMC)

@frank-w you are probably right here.

Another two tests.

The same u-boot, preloader, ATF, kernel 5.4, rootFs (ext4) the only difference is with bootargs.

First

board=bpi-r64 console=ttyS0,115200n1 earlyprintk root=/dev/mmcblk0p2 rootfstype=ext4 rootwait service=linux debug=7 initcall_debug=0 androidboot.hardware=mt7622 swiotlb=512

second:

board=bpi-r64 console=ttyS0,115200n1 earlyprintk root=/dev/mmcblk0p2 rootfstype=ext4 rootwait block2mtd.block2mtd=/dev/mmcblk0,65536,eMMC,5 mtdparts=eMMC:512k(preloader)ro,256k(ATF),512k(Bootloader),512k(config),256k(factory) service=linux debug=7 initcall_debug=0 androidboot.hardware=mt7622 swiotlb=512

First one booting, second stops on:

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,2)

So The issue is definitely on kernel site.

Full logs attachedBoot_54_with MTD_failed.txt (26.3 KB) Boot_54_without MTD_ok.txt (31.1 KB)

Hi, could https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/mmc/mmc-pwrseq-emmc.txt be applied to emmc dt node ? I would like to test but I have no clue about the right GPIO reset pin.

Also can this be used ?https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/mmc/mmc-controller.yaml#L159 ?

According schematic it is NCEB pin (V15) but looks like it is not used in bpiR64 dts

If you have no mtd partitions (like me) don’t use the cmdline-arguments.

I can boot without problems,but mounting emmc gives errors

I did that to check if I will be able to dd MT7622_EEPROM.bin into mtd3. I do have a problem with wifi

mt7622-wmac 18000000.wmac: Failed to get patch semaphore

I know now that it is problem with FW loading issue rather than calibration.

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