Mounting a microsd on hi-link board hlk7628n

Hello friends.

We are having problems mounting a microsd on hi-link board hlk7628n.

We are looking for a larger way of storage for this module, we believe that microsd would be the best solution. However, we are having trouble mounting the drivers in the kernel, we have tested all types of drivers, but we were not successful.

We use hi-link's own development kit to test the board's functionalities.

We've been looking for a solution for a long time, but we haven't found it yet.

Ps. USB mode works perfectly.

Some information and images that can help to understand the problem.

Model = hlk7628n

Firmware = OpenWrt 19.07.7 r11306-c4a6851c72

kernel log->

[    0.000000] Linux version 4.14.221 (builder@buildhost) (gcc version 7.5.0 (OpenWrt GCC 7.5.0 r11306-c4a6851c72)) #0 Mon Feb 15 15:22:37 2021
[    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 MT7628AN ver:1 eco:2
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019655 (MIPS 24KEc)
[    0.000000] MIPS: machine is HILINK HLK-7628N
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 08000000 @ 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-0x0000000007ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] On node 0 totalpages: 32768
[    0.000000] free_area_init_node: node 0, pgdat 80481aa0, node_mem_map 81000040
[    0.000000]   Normal zone: 256 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 32768 pages, LIFO batch:7
[    0.000000] random: get_random_bytes called from 0x80485740 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: 32512
[    0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Writing ErrCtl register=0005de38
[    0.000000] Readback ErrCtl register=0005de38
[    0.000000] Memory: 123792K/131072K available (3930K kernel code, 185K rwdata, 504K rodata, 1196K init, 208K bss, 7280K 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.000010] sched_clock: 32 bits at 290MHz, resolution 3ns, wraps every 7405115902ns
[    0.015390] Calibrating delay loop... 385.84 BogoMIPS (lpj=1929216)
[    0.087616] pid_max: default: 32768 minimum: 301
[    0.096973] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.109938] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.129425] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.148802] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.160901] pinctrl core: initialized pinctrl subsystem
[    0.173751] NET: Registered protocol family 16
[    0.204156] mt7621_gpio 10000600.gpio: registering 32 gpios
[    0.215385] mt7621_gpio 10000600.gpio: registering 32 gpios
[    0.226523] mt7621_gpio 10000600.gpio: registering 32 gpios
[    0.242570] clocksource: Switched to clocksource MIPS
[    0.253674] NET: Registered protocol family 2
[    0.263213] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.276923] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.289441] TCP: Hash tables configured (established 1024 bind 1024)
[    0.302133] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.313602] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.326225] NET: Registered protocol family 1
[    0.334769] PCI: CLS 0 bytes, default 32
[    0.338142] Crashlog allocated RAM at address 0x3f00000
[    0.350024] workingset: timestamp_bits=30 max_order=15 bucket_order=0
[    0.368725] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.380172] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.410138] io scheduler noop registered
[    0.417813] io scheduler deadline registered (default)
[    0.428838] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.444214] console [ttyS0] disabled
[    0.451182] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 28, base_baud = 2500000) is a 16550A
[    0.469118] console [ttyS0] enabled
[    0.482810] bootconsole [early0] disabled
[    0.499290] 10000d00.uart1: ttyS1 at MMIO 0x10000d00 (irq = 29, base_baud = 2500000) is a 16550A
[    0.518208] spi-mt7621 10000b00.spi: sys_freq: 193333333
[    0.545383] m25p80 spi0.0: w25q256 (32768 Kbytes)
[    0.554771] 4 fixed-partitions partitions found on MTD device spi0.0
[    0.567368] Creating 4 MTD partitions on "spi0.0":
[    0.576878] 0x000000000000-0x000000030000 : "u-boot"
[    0.587660] 0x000000030000-0x000000040000 : "u-boot-env"
[    0.599082] 0x000000040000-0x000000050000 : "factory"
[    0.610068] 0x000000050000-0x000002000000 : "firmware"
[    0.624044] 2 uimage-fw partitions found on MTD device firmware
[    0.635822] Creating 2 MTD partitions on "firmware":
[    0.645690] 0x000000000000-0x00000017f52a : "kernel"
[    0.656440] 0x00000017f52a-0x000001fb0000 : "rootfs"
[    0.667135] mtd: device 5 (rootfs) set to be root filesystem
[    0.679915] 1 squashfs-split partitions found on MTD device rootfs
[    0.692228] 0x0000003d0000-0x000001fb0000 : "rootfs_data"
[    0.704576] libphy: Fixed MDIO Bus: probed
[    0.723931] rt3050-esw 10110000.esw: link changed 0x00
[    0.734994] mtk_soc_eth 10100000.ethernet: generated random MAC address de:3f:16:27:e8:42
[    0.751959] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    0.770181] NET: Registered protocol family 10
[    0.783413] Segment Routing with IPv6
[    0.790772] NET: Registered protocol family 17
[    0.799680] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    0.825369] 8021q: 802.1Q VLAN Support v1.8
[    0.843975] VFS: Mounted root (squashfs filesystem) readonly on device 31:5.
[    0.864618] Freeing unused kernel memory: 1196K
[    0.873618] This architecture does not have kernel memory protection.
[    2.033373] init: Console is alive
[    2.040357] init: - watchdog -
[    2.466611] random: fast init done
[    3.133984] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    3.225027] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    3.249919] init: - preinit -
[    4.606821] rt3050-esw 10110000.esw: link changed 0x00
[    7.636164] rt3050-esw 10110000.esw: link changed 0x01
[    8.220046] jffs2: notice: (365) jffs2_build_xattr_subsystem: complete building xattr subsystem, 18 of xdatum (3 unchecked, 15 orphan) and 96 of xref (44 dead, 11 orphan) found.
[    8.274590] mount_root: loading kmods from internal overlay
[    9.125758] kmodloader: loading kernel modules from /tmp/overlay/upper/etc/modules-boot.d/*
[    9.353261] random: procd: uninitialized urandom read (4 bytes read)
[    9.450029] usbcore: registered new interface driver usbfs
[    9.461071] usbcore: registered new interface driver hub
[    9.471776] usbcore: registered new device driver usb
[   10.072531] SCSI subsystem initialized
[   10.148560] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[   10.164443] ohci-platform: OHCI generic platform driver
[   10.185188] phy phy-10120000.usbphy.0: remote usb device wakeup disabled
[   10.198484] phy phy-10120000.usbphy.0: UTMI 16bit 30MHz
[   10.208865] ohci-platform 101c1000.ohci: Generic Platform OHCI controller
[   10.222365] ohci-platform 101c1000.ohci: new USB bus registered, assigned bus number 1
[   10.238285] ohci-platform 101c1000.ohci: irq 26, io mem 0x101c1000
[   10.318122] hub 1-0:1.0: USB hub found
[   10.328285] hub 1-0:1.0: 1 port detected
[   10.366434] uhci_hcd: USB Universal Host Controller Interface driver
[   10.498215] sdhci: Secure Digital Host Controller Interface driver
[   10.510616] sdhci: Copyright(c) Pierre Ossman
[   10.520523] sdhci-pltfm: SDHCI platform and OF driver helper
[   10.565824] usbcore: registered new interface driver usb-storage
[   10.601463] kmodloader: done loading kernel modules from /tmp/overlay/upper/etc/modules-boot.d/*
[   11.010663] block: attempting to load /tmp/jffs_cfg/upper/etc/config/fstab
[   11.030225] block: extroot: not configured
[   11.039616] mount_root: switching to jffs2 overlay
[   11.073738] overlayfs: upper fs does not support tmpfile.
[   11.090886] urandom-seed: Seeding with /etc/urandom.seed
[   11.260366] procd: - early -
[   11.266357] procd: - watchdog -
[   11.941131] procd: - watchdog -
[   11.947751] procd: - ubus -
[   12.115588] random: ubusd: uninitialized urandom read (4 bytes read)
[   12.131218] random: ubusd: uninitialized urandom read (4 bytes read)
[   12.144494] random: ubusd: uninitialized urandom read (4 bytes read)
[   12.158165] procd: - init -
[   13.210900] kmodloader: loading kernel modules from /etc/modules.d/*
[   13.410056] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   13.453051] Loading modules backported from Linux version v4.19.161-0-gdaefdc9eb24b
[   13.468268] Backport generated by backports.git v4.19.161-1-0-g4bb568fe
[   13.517630] ip_tables: (C) 2000-2006 Netfilter Core Team
[   13.562698] nf_conntrack version 0.5.0 (2048 buckets, 8192 max)
[   13.730288] xt_time: kernel timezone is -0000
[   13.776372] urngd: v1.0.2 started.
[   13.885687] mt76_wmac 10300000.wmac: ASIC revision: 76280001
[   14.065020] random: crng init done
[   14.071762] random: 6 urandom warning(s) missed due to ratelimiting
[   14.944820] mt76_wmac 10300000.wmac: Firmware Version: 20151201
[   14.956624] mt76_wmac 10300000.wmac: Build Time: 20151201183641
[   15.022606] mt76_wmac 10300000.wmac: firmware init done
[   15.201885] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   15.238354] PPP generic driver version 2.4.2
[   15.273672] NET: Registered protocol family 24
[   15.374700] kmodloader: done loading kernel modules from /etc/modules.d/*
[   21.816297] rt3050-esw 10110000.esw: link changed 0x00
[   24.850367] rt3050-esw 10110000.esw: link changed 0x01
[   26.158365] device eth0 entered promiscuous mode
[   26.188198] br-lan: port 1(eth0.1) entered blocking state
[   26.198972] br-lan: port 1(eth0.1) entered disabled state
[   26.210064] device eth0.1 entered promiscuous mode
[   26.333321] br-lan: port 1(eth0.1) entered blocking state
[   26.344060] br-lan: port 1(eth0.1) entered forwarding state
[   26.355337] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   27.265934] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   30.143476] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   30.169669] br-lan: port 2(wlan0) entered blocking state
[   30.180272] br-lan: port 2(wlan0) entered disabled state
[   30.191206] device wlan0 entered promiscuous mode
[   31.451388] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   31.464296] br-lan: port 2(wlan0) entered blocking state
[   31.474872] br-lan: port 2(wlan0) entered forwarding state
[  282.526282] usb 1-1: new full-speed USB device number 2 using ohci-platform
[  282.815647] usb-storage 1-1:1.0: USB Mass Storage device detected
[  282.846668] scsi host0: usb-storage 1-1:1.0
[  283.892999] scsi 0:0:0:0: Direct-Access     SanDisk  Ultra USB 3.0    1.00 PQ: 0 ANSI: 6
[  283.920923] sd 0:0:0:0: [sda] 60063744 512-byte logical blocks: (30.8 GB/28.6 GiB)
[  283.944905] sd 0:0:0:0: [sda] Write Protect is off
[  283.954482] sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
[  283.962923] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[  284.044086]  sda: sda1 sda2
[  284.087102] sd 0:0:0:0: [sda] Attached SCSI removable disk
[  287.920301] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: 
[  290.422364] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: 
[ 1522.667623] rt3050-esw 10110000.esw: link changed 0x00
[ 1524.311454] rt3050-esw 10110000.esw: link changed 0x01

Can anyone help?

Have you installed the file system support modules/packages?

As far as I know if.
Installed all necessary.

We do not know much the Hilink SDK so the help we can give you is based on the code in OpenWrt open source. For example that board is not supported in OpenWrt 19.07 but is supported in OpenWrt 21.xx release. For hardware support it should not change much, it is probably the same code for both.

This board has no slot for microSD card, and the device tree file that defines what hardware features are active does not define a microSD slot. Installing packages does not help.

This is the device tree file https://github.com/openwrt/openwrt/blob/openwrt-21.02/target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts
and you see it is including (calling in the contents of) the generic SoC device tree file here https://github.com/openwrt/openwrt/blob/openwrt-21.02/target/linux/ramips/dts/mt7628an.dtsi

which has a paragraph about sdhc controller and sdxci pins but it is set "disabled"


	sdhci: sdhci@10130000 {
		compatible = "ralink,mt7620-sdhci";
		reg = <0x10130000 0x4000>;

		interrupt-parent = <&intc>;
		interrupts = <14>;

		pinctrl-names = "default";
		pinctrl-0 = <&sdxc_pins>;

		status = "disabled";
	};

You need to find what pins are defined for SDHC interface in your hardware manual, and then copy the paragraph in the device tree file with

status = "okay";

instead of the status disabled line to configure openwrt system to use the SDHC slot, then compile a firmware with this change.

1 Like

this part of your boot log shows how the SDHCI driver is installed and OK.

It is probably what I said above, there is no SD card slot defined in the device tree file.

1 Like

I even imagined it might be this problem, but I didn't want to believe it. hahah.
Thanks for the help friend.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.