Issues with VoCore 2 Lite

tlopes
 
Posts: 3
Joined: Tue Apr 13, 2021 12:26 pm

Issues with VoCore 2 Lite

Tue Apr 13, 2021 5:32 pm

Hi

I have some issues with the VoCore 2 Lite
1) I can't seem to get the SD card slot to work. I've enabled the kmod-sdhci and kmod-sdhci-mt7620 options under Kernel Modules -> Other modules, but I don't see any mmc devices when I run ls /dev.
2) When building the firmware for VoCore 2 Lite, I don't see i2c-0 when I run ls /dev, but I do when I build the firmware for VoCore 2 and install it on the lite
3) When reading data from the I2C bus with ioctl, I'm only getting around 6% of the speed I'm expecting to get (I should be able to read about 12000 1 byte registers per second if the bus is running at 400khz, but in practice I only get about 750). I've read I may need to make a device driver if I want to get full speed on Linux, but haven't been able to find any information on how to set up a development environment for drivers.

The options I've set in make menuconfig:
Target System: MediaTek Ralink MIPS
Subtarget: MT76x8 based boards
Target Profile: VoCore Vocore2-Lite
Base System -> wireless-tools
Kernel Modules -> I2C Support -> kmod-i2c-core, kmod-i2c-mt7628
Kernel Modules -> Other Modules -> kmod-sdhci, kmod-sdhci-mt7620
LuCI -> Collections -> luci

Vonger
 
Posts: 896
Joined: Sun Oct 19, 2014 6:00 am

Re: Issues with VoCore 2 Lite

Wed Apr 14, 2021 2:13 pm

Hi, please use our i2c patch for the i2c driver, download at github.com/vonger/vocore2
Also SD card need to patch, because default driver has bug can not allow cd polling mode, please download the patch from the same address.
DTS also need to modify, you can reference to VOCORE2.dts

tlopes
 
Posts: 3
Joined: Tue Apr 13, 2021 12:26 pm

Re: Issues with VoCore 2 Lite

Wed Apr 14, 2021 4:01 pm

Both patches were applied. I'm not 100% sure what exactly needs to be modified in the DTS file (or which one, for that matter):
Code: Select all
$ find . -name vocore2.dts
./build_dir/toolchain-mipsel_24kc_gcc-7.5.0_musl/linux-4.14.180/arch/mips/boot/dts/ralink/vocore2.dts
./build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/linux-4.14.180/arch/mips/boot/dts/ralink/vocore2.dts

so I updated both to this:
Code: Select all
/dts-v1/;

#include "mt7628a.dtsi"

/ {
   compatible = "vocore,vocore2", "ralink,mt7628a-soc";
   model = "VoCore2";

   memory@0 {
      device_type = "memory";
      reg = <0x0 0x8000000>;
   };

   chosen {
      bootargs = "console=ttyS2,115200";
      stdout-path = &uart2;
   };

   sdhci {
      status = "okay";
      mediatek,cd-poll;
   };
};


On the actual device, if I watch the terminal output in teraterm, I see boot messages suggesting it's loading drivers for I2C and SDHCI, and when I run lsmod I get:
Code: Select all
# lsmod
crc_ccitt               1035  1 ppp_async
ehci_hcd               34871  1 ehci_platform
ehci_platform           4656  0
gpio_button_hotplug     6896  0
i2c_core               22728  2 i2c_mt7621,i2c_dev
i2c_dev                 4640  0
i2c_mt7621              2480  0
ip_tables              10061  4 iptable_nat,iptable_mangle,iptable_filter
ip6_tables              9825 24 ip6table_mangle,ip6table_filter
ip6t_REJECT             1072  2
ip6table_filter          688  1
ip6table_mangle         1232  0
ipt_MASQUERADE           720  1
ipt_REJECT              1008  2
iptable_filter           688  1
iptable_mangle           944  0
iptable_nat              752  1
leds_gpio               2928  0
ledtrig_usbport         2784  0
mmc_block              23590  0
mmc_core               87445  3 mmc_block,sdhci,mtk_sd
mt7628                953872  1
mtk_sd                 20192  0
nf_conntrack           57893 12 nf_conntrack_ipv6,ipt_MASQUERADE,xt_state,xt_nat,xt_conntrack,xt_REDIRECT,nf_nat_masquerade_ipv4,nf_conntrack_ipv4,nf_nat_ipv4,nf_nat,nf_flow_table,nf_conntrack_rtcache
nf_conntrack_ipv4       4368 10
nf_conntrack_ipv6       4576  4
nf_conntrack_rtcache    2672  0
nf_defrag_ipv4          1046  1 nf_conntrack_ipv4
nf_defrag_ipv6          4798  1 nf_conntrack_ipv6
nf_flow_table          13759  2 xt_FLOWOFFLOAD,nf_flow_table_hw
nf_flow_table_hw        2160  1
nf_log_common           2703  2 nf_log_ipv4,nf_log_ipv6
nf_log_ipv4             3472  0
nf_log_ipv6             4176  0
nf_nat                  9451  4 xt_nat,nf_nat_redirect,nf_nat_masquerade_ipv4,nf_nat_ipv4
nf_nat_ipv4             3441  1 iptable_nat
nf_nat_masquerade_ipv4    1756  1 ipt_MASQUERADE
nf_nat_redirect         1531  1 xt_REDIRECT
nf_reject_ipv4          2147  1 ipt_REJECT
nf_reject_ipv6          2536  1 ip6t_REJECT
nls_base                5152  1 usbcore
ohci_hcd               22818  1 ohci_platform
ohci_platform           4176  0
ppp_async               6928  0
ppp_generic            22786  3 pppoe,ppp_async,pppox
pppoe                   9232  0
pppox                   1386  1 pppoe
sdhci                  29717  1 sdhci_pltfm
sdhci_pltfm             2578  0
slhc                    5307  1 ppp_generic
usb_common              2551  1 usbcore
usbcore               132419  5 ledtrig_usbport,ohci_platform,ohci_hcd,ehci_platform,ehci_hcd
x_tables               13999 23 ipt_REJECT,ipt_MASQUERADE,xt_time,xt_tcpudp,xt_state,xt_nat,xt_multiport,xt_mark,xt_mac,xt_limit,xt_conntrack,xt_comment,xt_TCPMSS,xt_REDIRECT,xt_LOG,xt_FLOWOFFLOAD,iptable_mangle,iptable_filter,ip_tables,ip6table_mangle,ip6table_filter,ip6_tables,ip6t_REJECT
xt_FLOWOFFLOAD          3072  0
xt_LOG                   816  0
xt_REDIRECT              752  0
xt_TCPMSS               2832  0
xt_comment               528107
xt_conntrack            2352 12
xt_limit                1232 20
xt_mac                   656  0
xt_mark                  720  0
xt_multiport            1328  0
xt_nat                  1584  0
xt_state                 752  0
xt_tcpudp               1840  8
xt_time                 1808  0

It looks like the I2C and SD card kernel modules are loaded, but when I run ls /dev, I don't see i2c-0 or any mmc related devices:
Code: Select all
# ls /dev
bus                 mtd3                network_throughput
console             mtd3ro              null
cpu_dma_latency     mtd4                port
full                mtd4ro              ppp
gpiochip0           mtd5                ptmx
gpiochip1           mtd5ro              pts
gpiochip2           mtd6                random
kmsg                mtd6ro              shm
log                 mtdblock0           tty
memory_bandwidth    mtdblock1           ttyS0
mtd0                mtdblock2           ttyS1
mtd0ro              mtdblock3           ttyS2
mtd1                mtdblock4           urandom
mtd1ro              mtdblock5           watchdog
mtd2                mtdblock6           watchdog0
mtd2ro              network_latency     zero

Vonger
 
Posts: 896
Joined: Sun Oct 19, 2014 6:00 am

Re: Issues with VoCore 2 Lite

Fri Apr 16, 2021 3:36 am

From the lsmod, the driver is loaded, please call "dmesg" on console, and paste the boot up log here. Maybe something wrong at loading the driver

tlopes
 
Posts: 3
Joined: Tue Apr 13, 2021 12:26 pm

Re: Issues with VoCore 2 Lite

Fri Apr 16, 2021 12:28 pm

Here's the output for dmesg:
Code: Select all
# dmesg
[    0.000000] Linux version 4.14.180 (user@user-Virtual-Machine) (gcc version 7.5.0 (OpenWrt GCC 7.5.0 r11063-85e04e9f46)) #0 Sat May 16 18:32:20 2020
[    0.000000] Board has DDR2
[    0.000000] Analog PMU set to hw control
[    0.000000] Digital PMU set to hw control
[    0.000000] SoC Type: MediaTek MT7688 ver:1 eco:2
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019655 (MIPS 24KEc)
[    0.000000] MIPS: machine is VoCore2-Lite
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] On node 0 totalpages: 16384
[    0.000000] free_area_init_node: node 0, pgdat 8049f360, node_mem_map 81000040
[    0.000000]   Normal zone: 128 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 16384 pages, LIFO batch:3
[    0.000000] random: get_random_bytes called from start_kernel+0x90/0x478 with crng_init=0
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS2,115200 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Writing ErrCtl register=00067fb5
[    0.000000] Readback ErrCtl register=00067fb5
[    0.000000] Memory: 58700K/65536K available (3704K kernel code, 168K rwdata, 864K rodata, 1208K init, 200K bss, 6836K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 256
[    0.000000] intc: using register map from devicetree
[    0.000000] CPU Clock: 580MHz
[    0.000000] timer_probe: no matching timers found
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6590553264 ns
[    0.000012] sched_clock: 32 bits at 290MHz, resolution 3ns, wraps every 7405115902ns
[    0.007541] Calibrating delay loop... 385.84 BogoMIPS (lpj=1929216)
[    0.073503] pid_max: default: 32768 minimum: 301
[    0.078186] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.084541] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.096935] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.106438] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.112373] pinctrl core: initialized pinctrl subsystem
[    0.118435] NET: Registered protocol family 16
[    0.149629] mt7621_gpio 10000600.gpio: registering 32 gpios
[    0.155222] mt7621_gpio 10000600.gpio: registering 32 gpios
[    0.160838] mt7621_gpio 10000600.gpio: registering 32 gpios
[    0.170801] clocksource: Switched to clocksource MIPS
[    0.176780] NET: Registered protocol family 2
[    0.181858] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.188553] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.194743] TCP: Hash tables configured (established 1024 bind 1024)
[    0.201009] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.206611] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.212947] NET: Registered protocol family 1
[    0.217122] PCI: CLS 0 bytes, default 32
[    0.220508] Crashlog allocated RAM at address 0x3f00000
[    0.227203] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.239242] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.244874] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.264630] io scheduler noop registered
[    0.268360] io scheduler deadline registered (default)
[    0.274233] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[    0.281634] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 28, base_baud = 2500000) is a 16550A
[    0.290986] 10000d00.uart1: ttyS1 at MMIO 0x10000d00 (irq = 29, base_baud = 2500000) is a 16550A
[    0.300013] 10000e00.uart2: ttyS2 at MMIO 0x10000e00 (irq = 30, base_baud = 2500000) is a 16550A
[    0.308549] console [ttyS2] enabled
[    0.315561] bootconsole [early0] disabled
[    0.324995] spi-mt7621 10000b00.spi: sys_freq: 193333333
[    0.337764] m25p80 spi0.0: gd25q64 (8192 Kbytes)
[    0.342567] 4 fixed-partitions partitions found on MTD device spi0.0
[    0.349008] Creating 4 MTD partitions on "spi0.0":
[    0.353903] 0x000000000000-0x000000030000 : "u-boot"
[    0.359869] 0x000000030000-0x000000040000 : "u-boot-env"
[    0.366172] 0x000000040000-0x000000050000 : "factory"
[    0.372232] 0x000000050000-0x000000800000 : "firmware"
[    0.381404] 2 uimage-fw partitions found on MTD device firmware
[    0.387419] Creating 2 MTD partitions on "firmware":
[    0.392512] 0x000000000000-0x000000184e37 : "kernel"
[    0.398484] 0x000000184e37-0x0000007b0000 : "rootfs"
[    0.404396] mtd: device 5 (rootfs) set to be root filesystem
[    0.411710] 1 squashfs-split partitions found on MTD device rootfs
[    0.418002] 0x0000003c0000-0x0000007b0000 : "rootfs_data"
[    0.425177] libphy: Fixed MDIO Bus: probed
[    0.439338] rt3050-esw 10110000.esw: link changed 0x00
[    0.447964] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    0.458141] NET: Registered protocol family 10
[    0.466624] Segment Routing with IPv6
[    0.470459] NET: Registered protocol family 17
[    0.475097] 8021q: 802.1Q VLAN Support v1.8
[    0.489754] VFS: Mounted root (squashfs filesystem) readonly on device 31:5.
[    0.503577] Freeing unused kernel memory: 1208K
[    0.508172] This architecture does not have kernel memory protection.
[    1.565050] init: Console is alive
[    1.568756] init: - watchdog -
[    2.190820] random: fast init done
[    2.946624] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    3.040443] usbcore: registered new interface driver usbfs
[    3.046188] usbcore: registered new interface driver hub
[    3.051747] usbcore: registered new device driver usb
[    3.062803] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    3.071254] ehci-platform: EHCI generic platform driver
[    3.086907] phy phy-10120000.usbphy.0: remote usb device wakeup disabled
[    3.093734] phy phy-10120000.usbphy.0: UTMI 16bit 30MHz
[    3.099050] ehci-platform 101c0000.ehci: EHCI Host Controller
[    3.104938] ehci-platform 101c0000.ehci: new USB bus registered, assigned bus number 1
[    3.113114] ehci-platform 101c0000.ehci: irq 26, io mem 0x101c0000
[    3.140827] ehci-platform 101c0000.ehci: USB 2.0 started, EHCI 1.00
[    3.148147] hub 1-0:1.0: USB hub found
[    3.152456] hub 1-0:1.0: 1 port detected
[    3.159680] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    3.167710] ohci-platform: OHCI generic platform driver
[    3.173381] ohci-platform 101c1000.ohci: Generic Platform OHCI controller
[    3.180338] ohci-platform 101c1000.ohci: new USB bus registered, assigned bus number 2
[    3.188498] ohci-platform 101c1000.ohci: irq 26, io mem 0x101c1000
[    3.265942] hub 2-0:1.0: USB hub found
[    3.270132] hub 2-0:1.0: 1 port detected
[    3.287321] mtk-sd: MediaTek MT6575 MSDC Driver
[    3.294948] sdhci: Secure Digital Host Controller Interface driver
[    3.301295] sdhci: Copyright(c) Pierre Ossman
[    3.306973] sdhci-pltfm: SDHCI platform and OF driver helper
[    3.316238] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    3.326475] init: - preinit -
[    4.384621] rt3050-esw 10110000.esw: link changed 0x00
[    4.437736] random: procd: uninitialized urandom read (4 bytes read)
[    7.805027] jffs2: notice: (385) jffs2_build_xattr_subsystem: complete building xattr subsystem, 6 of xdatum (0 unchecked, 3 orphan) and 6 of xref (3 dead, 0 orphan) found.
[    7.822770] mount_root: switching to jffs2 overlay
[    7.854991] overlayfs: upper fs does not support tmpfile.
[    7.867393] urandom-seed: Seeding with /etc/urandom.seed
[    8.046519] procd: - early -
[    8.049568] procd: - watchdog -
[    8.767286] procd: - watchdog -
[    8.770884] procd: - ubus -
[    8.919487] random: ubusd: uninitialized urandom read (4 bytes read)
[    9.004055] random: ubusd: uninitialized urandom read (4 bytes read)
[    9.011166] random: ubusd: uninitialized urandom read (4 bytes read)
[    9.018652] procd: - init -
[    9.679817] kmodloader: loading kernel modules from /etc/modules.d/*
[    9.716313] ip6_tables: (C) 2000-2006 Netfilter Core Team
[    9.752003] i2c /dev entries driver
[   10.209190] <-- RTMPAllocTxRxRingMemory, Status=0, ErrorValue=0x
[   10.216550] <-- RTMPAllocAdapterBlock, Status=0
[   10.252763] ip_tables: (C) 2000-2006 Netfilter Core Team
[   10.271328] urngd: v1.0.2 started.
[   10.290641] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
[   10.491897] xt_time: kernel timezone is -0000
[   10.518159] PPP generic driver version 2.4.2
[   10.532221] NET: Registered protocol family 24
[   10.553019] kmodloader: done loading kernel modules from /etc/modules.d/*
[   10.766050] random: crng init done
[   10.769520] random: 6 urandom warning(s) missed due to ratelimiting
[   20.185467] br-lan: port 1(eth0.1) entered blocking state
[   20.191194] br-lan: port 1(eth0.1) entered disabled state
[   20.197041] device eth0.1 entered promiscuous mode
[   20.201962] device eth0 entered promiscuous mode
[   20.242500] br-lan: port 1(eth0.1) entered blocking state
[   20.247992] br-lan: port 1(eth0.1) entered forwarding state
[   20.253922] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   20.948621] efuse_probe: efuse = 10000012
[   21.122001] tssi_1_target_pwr_g_band = 35
[   26.726222] <==== rt28xx_init, Status=0
[   26.730263] ttyS ttyS0: 1 input overrun(s)
[   26.751388] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   27.655212] br-lan: port 2(ra0) entered blocking state
[   27.660507] br-lan: port 2(ra0) entered disabled state
[   27.666154] device ra0 entered promiscuous mode
[   27.670939] br-lan: port 2(ra0) entered blocking state
[   27.676191] br-lan: port 2(ra0) entered forwarding state

Vonger
 
Posts: 896
Joined: Sun Oct 19, 2014 6:00 am

Re: Issues with VoCore 2 Lite

Sat Apr 17, 2021 3:51 pm

From dmesg, i2c created interface under /dev/, you should able to find it. weird.
You can try the firmware at vocore.io/v2.html, check if there is any device.

Return to VoCore2/Lite/Ultimate

Who is online

Users browsing this forum: No registered users and 36 guests