[BPI-R64] PCIe issues

Spoke too soon. Even with 3000 msec sleep, sometimes miniPCIe card is not detected. Sometimes it’s detected. Any other clues I can try ?

Yes, msleep not fix all the problem, sometimes work, sometimes not.

Same issue with @jasmin patch also. Sometimes it’s detected and sometimes it’s not

Hi

I have a version release from bananapi 4.19.81. In this kernel the Coral PCIe is detected and memory is allocated (using slot CN25)

However when I am loading the apex module there is a 32 bit GCB register at the following location

/* Determine if GCB is in reset state. */ static bool is_gcb_in_reset(struct gasket_dev *gasket_dev) { u32 val = gasket_dev_read_32(gasket_dev, APEX_BAR_INDEX, APEX_BAR2_REG_SCU_3);

/* Masks rg_rst_gcb bit of SCU_CTRL_2 */ return (val & SCU3_CUR_RST_GCB_BIT_MASK); }

#define APEX_BAR_INDEX 2 APEX_BAR2_REG_SCU_BASE = 0x1A300 #define APEX_BAR2_REG_SCU_3 (APEX_BAR2_REG_SCU_BASE + 0x18) #define SCU3_CUR_RST_GCB_BIT_MASK 0x10

Can you help me what this register bits indicate. the bit 5 is responsible for resetting the pci port.

For Comparison I have a PCIe Coral inserted in Laptop (ubuntu 16.04 kernel 4.4) Following is the 32 bit value from Laptop 0xe0050804 whereas following is the 32 bit value from R64 0xe0050014

/* Reset the hardware, then quit reset. Called on device open. */ static int apex_reset(struct gasket_dev *gasket_dev) { int ret;

if (bypass_top_level) return 0;

if (!is_gcb_in_reset(gasket_dev)) { /* We are not in reset - toggle the reset bit so as to force * re-init of custom block */ dev_dbg(gasket_dev->dev, “%s: toggle reset\n”, func );

  ret = apex_enter_reset(gasket_dev);

if (ret) return ret;






} ret = apex_quit_reset(gasket_dev);



return ret; }

From this I think it is necessary to reset the PCI driver (apex)when accessed first time. This happens in laptop but not in R64. Can anyone pleasehelp me understand this bitwise structure of the gasket(apex) driver and its impact?

can anybody tell me actual state? should i apply splitting-Patch to 5.7-tree or does it work better without it?

got response from mtk with patches for 4.19 reported as working i applied to this tree:

also google-coral driver is merged to it, have not added my changes like build.sh or config

can anbody with google-coral-card please test this tree with his card? if it works i can try to port it to 5.4/5.7

@sirip @bourne_hlm @jasmin

I have try many ways to support WLE900VX (QCA9880)on R64, but not success. It seems the R64 reset signal sequence not compatible with QCA9880.

Your splitting-patch can fix the driver crash problem, but can’t fix the pcie probe problem. I think it’s better to use the “pci=nomsi” kernel cmdline.

Is that patch can fix the pcie device probe problem?

This patch is for googgle coral where it is not probes correctly due missing class.

I had made some options for my ath10k card…

https://wiki.fw-web.de/doku.php?id=en:bpi-r64:wifi

Maybe it helps you…

Hi,

I am compiling the source https://github.com/frank-w/BPI-R2-4.14/tree/4.19-mt7622pcie I am getting the following error.

The pcie label is present in the mentioned file. How do I work out this?

Error: arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts:89.1-6 Label or path pcie not found
FATAL ERROR: Syntax error parsing input tree
scripts/Makefile.lib:294: recipe for target 'arch/arm64/boot/dts/mediatek/mt7622-rfb1.dtb' failed
make[3]: *** [arch/arm64/boot/dts/mediatek/mt7622-rfb1.dtb] Error 1
scripts/Makefile.build:544: recipe for target 'arch/arm64/boot/dts/mediatek' failed
make[2]: *** [arch/arm64/boot/dts/mediatek] Error 2
arch/arm64/Makefile:137: recipe for target 'dtbs' failed
make[1]: *** [dtbs] Error 2

it has to be named pcie0 and pcie1…

mt7622-rfb1.dts references a node pcie, which does not exist in upper dtsi (mt7622.dtsi) where the node is splitted into pcie0 and pcie1…so reference needs to be changed in rfb too

why not using the main-tree? the pcie-tree was only for testing…and newer trees (also 5.4-main) have the pcie-splitting applied too

i am trying to test the mediatek patch for google coral and where the google coral driver is merge. please provide link to the branch which I have to use?

i had merged latest pcie-fixes into this tree

https://github.com/frank-w/BPI-R2-4.14/commits/5.7-main

I am now trying to compile the 5.7-main branch

when I execute ./build.sh importconfig I was asked to install gcc-arm-linux-gnueabihf.

After installing this package whrn I re-run /build.sh importconfig I get some bison related error as follows

import a defconfig file
Import fwu config
  YACC    scripts/kconfig/parser.tab.[ch]
bison: /home/wendy/feig/cvend/output/build/armv5_toolchain_build/host/share/bison/m4sugar/m4sugar.m4: cannot open: No such file or directory
scripts/Makefile.host:17: recipe for target 'scripts/kconfig/parser.tab.h' failed
make[1]: *** [scripts/kconfig/parser.tab.h] Error 1
Makefile:588: recipe for target 'mt7623n_evb_fwu_defconfig' failed
make: *** [mt7623n_evb_fwu_defconfig] Error 2

Google search reveals the new toolchain has some bison relocation failure. Did you also get this? How was it resolved?

No have not seen this…i’m using ubuntu 20.4…which os di you use for building?

I am using Ubuntu 18

You need to change board in build.conf to bpi-r64 (fwu defconfig is for r2).

And i wonder about path armv5_toolchain_build

Maybe you should do a make clean/mrproper

I am using bpi-r64 in build.conf.

done a make clean. Still I am getting the same error.

./build.sh importconfig

should not print fwu defconfig for r64…basicly you can simply remove the # in this line:

I have updated the build.conf as follows

uploaduser=$USER
uploadserver=192.168.0.10
uploaddir=/var/lib/tftp

#builddir=../build
#ramdisksize=3G

#board=bpi-r2
board=bpi-r64
#r64 uses 2 ethernet-chips (setting choose which dtb is used)
#boardversion=1.0
#mainline uboot for r64 needs 64bit uImage
#uimagearch=arm64

I get the same bison related error

import a defconfig file
    Import r64 config
      HOSTCC  scripts/basic/fixdep
      HOSTCC  scripts/kconfig/conf.o
      HOSTCC  scripts/kconfig/confdata.o
      HOSTCC  scripts/kconfig/expr.o
      LEX     scripts/kconfig/lexer.lex.c
      YACC    scripts/kconfig/parser.tab.[ch]
    bison: /home/wendy/feig/cvend/output/build/armv5_toolchain_build/host/share/bison/m4sugar/m4sugar.m4: cannot open: No such file or directory
    scripts/Makefile.host:17: recipe for target 'scripts/kconfig/parser.tab.h' failed
    make[1]: *** [scripts/kconfig/parser.tab.h] Error 1
    Makefile:588: recipe for target 'mt7622_bpi-r64_defconfig' failed
    make: *** [mt7622_bpi-r64_defconfig] Error 2
frank@frank-G5:/media/data_nvme/git/kernel/r2test/BPI-R2-4.14 (5.7-main) [1M0U]
$ ./build.sh importconfig
import a defconfig file
Import r64 config
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/confdata.o
  HOSTCC  scripts/kconfig/expr.o
  LEX     scripts/kconfig/lexer.lex.c
  YACC    scripts/kconfig/parser.tab.[ch]
  HOSTCC  scripts/kconfig/lexer.lex.o
  HOSTCC  scripts/kconfig/parser.tab.o
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTCC  scripts/kconfig/util.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#
frank@frank-G5:/media/data_nvme/git/kernel/r2test/BPI-R2-4.14 (5.7-main) [1M0U]
$ LANG=C bison --version
bison (GNU Bison) 3.0.4
Written by Robert Corbett and Richard Stallman.

Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
frank@frank-G5:/media/data_nvme/git/kernel/r2test/BPI-R2-4.14 (5.7-main) [1M0U]
$ cat /etc/issue
Ubuntu 18.04.4 LTS \n \l

frank@frank-G5:/media/data_nvme/git/kernel/r2test/BPI-R2-4.14 (5.7-main) [1M0U]
$ 

i can import without problems in ubuntu 18.4, have you changed buildchain? still wondering about the path /home/wendy/feig/cvend/output/build/armv5_toolchain_build/host/share