OpenIPC / firmware

Alternative IP Camera firmware from an open community
https://openipc.org
MIT License
1.16k stars 226 forks source link

HI3518EV300 RTL8188 Network does not work #48

Open 001Tycoon opened 2 years ago

001Tycoon commented 2 years ago

Hello

Model Escam PVR008 Board S834-A0-B Sensor JX-F23 CPU Hi3518ERNCV300 Network Realtk 8188ETV (M8188FU3)

https://github.com/OpenIPC/openipc-2.1/issues/40 commit 09d1720331967b5a8db28c73f69af603a4083b1c

I have problems getting the network up and running

root@hi3518ev300-openipc:~# dmesg
Booting Linux on physical CPU 0x0
Linux version 4.9.37 (ingo@acer-p256-m) (gcc version 7.5.0 (Buildroot -g09d1720) ) #1 Thu Aug 26 10:37:32 CEST 2021
CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c53c7d
CPU: div instructions available: patching division code
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt:Machine model: Hisilicon HI3518EV300 DEMO Board
cmz zone is not set!
Memory policy: Data cache writeback
On node 0 totalpages: 8192
free_area_init_node: node 0, pgdat c053cbb0, node_mem_map c1fbb000
  Normal zone: 64 pages used for memmap
  Normal zone: 0 pages reserved
  Normal zone: 8192 pages, LIFO batch:0
CPU: All CPU(s) started in SVC mode.
pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
pcpu-alloc: [0] 0
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
Kernel command line: mem=32M console=ttyAMA0,115200 panic=5 root=/dev/mtdblock3 rootfstype=squashfs init=/init mtdparts=hi_sfc:256k(boot),64k(env),2048k(kernel),5120k(rootfs),-(rootfs_data) mmz_allocator=hisi
PID hash table entries: 128 (order: -3, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 26776K/32768K available (4084K kernel code, 148K rwdata, 912K rodata, 176K init, 243K bss, 5992K reserved, 0K cma-reserved)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0xc2800000 - 0xff800000   ( 976 MB)
    lowmem  : 0xc0000000 - 0xc2000000   (  32 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .text : 0xc0008000 - 0xc0405538   (4086 kB)
      .init : 0xc04ec000 - 0xc0518000   ( 176 kB)
      .data : 0xc0518000 - 0xc053d360   ( 149 kB)
       .bss : 0xc053f000 - 0xc057bcc8   ( 244 kB)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:16 nr_irqs:16 16
Gic dist init...
arm_arch_timer: Architected cp15 timer(s) running at 50.00MHz (phys).
clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0xb8812736b, max_idle_ns: 440795202655 ns
sched_clock: 56 bits at 50MHz, resolution 20ns, wraps every 4398046511100ns
Switching to timer-based delay loop, resolution 20ns
clocksource: arm,sp804: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 637086815595 ns
Console: colour dummy device 80x30
Calibrating delay loop (skipped), value calculated using timer frequency.. 100.00 BogoMIPS (lpj=500000)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x40008200 - 0x40008258
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 256 (order: -1, 3072 bytes)
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
Serial: AMBA PL011 UART driver
12040000.uart: ttyAMA0 at MMIO 0x12040000 (irq = 20, base_baud = 0) is a PL011 rev2
console [ttyAMA0] enabled
ssp-pl022 12070000.spi: ARM PL022 driver, device ID: 0x00800022
ssp-pl022 12070000.spi: mapped registers from 0x12070000 to c2867000
ssp-pl022 12071000.spi: ARM PL022 driver, device ID: 0x00800022
ssp-pl022 12071000.spi: mapped registers from 0x12071000 to c286b000
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
clocksource: Switched to clocksource arch_sys_counter
NET: Registered protocol family 2
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
workingset: timestamp_bits=30 max_order=13 bucket_order=0
squashfs: version 4.0 (2009/01/31) Phillip Lougher
NFS: Registering the id_resolver key type
Key type id_resolver registered
Key type id_legacy registered
jffs2: version 2.2 (NAND) (ZLIB) (RTIME) (c) 2001-2006 Red Hat, Inc.
yaffs: yaffs Installing.
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
io scheduler noop registered
io scheduler deadline registered (default)
io scheduler cfq registered
pl061_gpio 120b0000.gpio_chip: PL061 GPIO chip @0x120b0000 registered
pl061_gpio 120b1000.gpio_chip: PL061 GPIO chip @0x120b1000 registered
pl061_gpio 120b2000.gpio_chip: PL061 GPIO chip @0x120b2000 registered
pl061_gpio 120b4000.gpio_chip: PL061 GPIO chip @0x120b4000 registered
pl061_gpio 120b5000.gpio_chip: PL061 GPIO chip @0x120b5000 registered
pl061_gpio 120b6000.gpio_chip: PL061 GPIO chip @0x120b6000 registered
pl061_gpio 120b7000.gpio_chip: PL061 GPIO chip @0x120b7000 registered
pl061_gpio 120b8000.gpio_chip: PL061 GPIO chip @0x120b8000 registered
brd: module loaded
hisi-sfc hisi_spi_nor.0: SPI Nor ID Table Version 1.2
hisi-sfc hisi_spi_nor.0: The ID: 0x20 isn't in the BP table, Current device can't not protect
@spi_nor_scan(), no "m25p,fast-read".
@spi_nor_scan(), modes->rd_modes:0xd.
hisi-sfc hisi_spi_nor.0: (Fast) Read:  opcode=BBh, protocol=122, mode=0, wait=8
hisi-sfc hisi_spi_nor.0: nor->read_opcode[3: Read; 0B: Fast Read; 3B: Dual; BB: Dual IO; 6B: Quad; EB: Quad IO]: 0xbb.
hisi-sfc hisi_spi_nor.0: xm25qh128a (Chipsize 16 Mbytes, Blocksize 64KiB)
5 cmdlinepart partitions found on MTD device hi_sfc
5 cmdlinepart partitions found on MTD device hi_sfc
Creating 5 MTD partitions on "hi_sfc":
0x000000000000-0x000000040000 : "boot"
0x000000040000-0x000000050000 : "env"
0x000000050000-0x000000250000 : "kernel"
0x000000250000-0x000000750000 : "rootfs"
0x000000750000-0x000001000000 : "rootfs_data"
SPI Nand ID Table Version 2.7
Cannot found a valid SPI Nand Device
hisi_spi_nand_probe(175): Error: driver probe, result: -19
No OTP data, festa PHY use default ATE parameters!
festa PHY wait autotrim done timeout!
libphy: hisi_femac_mii_bus: probed
libphy: Fixed MDIO Bus: probed
hisi-femac 10040000.ethernet: connect to PHY failed!
hibvt_rtc 120e0000.rtc: rtc core: registered 120e0000.rtc as rtc0
hibvt_rtc 120e0000.rtc: RTC driver for hibvt enabled
i2c /dev entries driver
hibvt-i2c 12060000.i2c: hibvt-i2c0@100000hz registered
hibvt-i2c 12061000.i2c: hibvt-i2c1@100000hz registered
hibvt-i2c 12062000.i2c: hibvt-i2c2@100000hz registered
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
mmc0: SDHCI controller on 10010000.sdhci [10010000.sdhci] using ADMA in legacy mode
mmc1: SDHCI controller on 10020000.sdhci [10020000.sdhci] using ADMA in legacy mode
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
Initializing XFRM netlink socket
NET: Registered protocol family 17
NET: Registered protocol family 15
Key type dns_resolver registered
hibvt_rtc 120e0000.rtc: setting system clock to 1970-01-01 00:00:00 UTC (0)
VFS: Mounted root (squashfs filesystem) readonly on device 31:3.
devtmpfs: mounted
Freeing unused kernel memory: 176K (c04ec000 - c0518000)
This architecture does not have kernel memory protection.
random: dd: uninitialized urandom read (512 bytes read)
random: crng init done
sys_config: loading out-of-tree module taints kernel.
FUNC:parse_sensor_clock line:126  SNS: is [JX-F23]!
FUNC:parse_sensor_bus_type line:85  SNS is [JX-F23]  !
==== online_flag=0, cmos_yuv_flag=0, sensor=JX-F23, chip=hiunknown, board=demo====
==== g_quick_start_flag=0 ====
sysconfig init success!
Module himedia: init ok
Hisilicon Media Memory Zone Manager
hi_osal 1.0 init success!
hi3516ev200_base: module license 'Proprietary' taints kernel.
Disabling lock debugging due to kernel taint
load sys.ko for Hi3516EV200...OK!
load region.ko for Hi3516EV200...OK!
load vgs.ko for Hi3516EV200...OK!
load vi.ko for Hi3516EV200...OK !
ISP Mod init!
load vpss.ko for Hi3516EV200...OK!
load chnl.ko for Hi3516EV200...OK!
load vedu.ko for Hi3516EV200...OK!
load rc.ko for Hi3516EV200...OK!
load venc.ko for Hi3516EV200...OK!
load h264e.ko for Hi3516EV200...OK!
load h265e.ko for Hi3516EV200...OK!
load jpege.ko for Hi3516EV200...OK!
load ive.ko for Hi3516EV200...OK!
Load sensor_spi.ko for Hi3516EV200...OK !
load mipi_rx driver successful!
register dev
Hisilicon Watchdog Timer: 0.01 initialized. default_margin=60 sec (nodeamon= 0)
hiwtdg init ok. ver=Oct 18 2019, 18:21:00.
hibvt-i2c 12060000.i2c: wait idle timeout, RIS: 0x10, SR: 0xa0000
hibvt-i2c 12060000.i2c: wait idle timeout, RIS: 0x10, SR: 0xa0000
hibvt-i2c 12060000.i2c: wait idle timeout, RIS: 0x10, SR: 0xa0000
hibvt-i2c 12060000.i2c: wait idle timeout, RIS: 0x10, SR: 0xa0000
hibvt-i2c 12060000.i2c: wait idle timeout, RIS: 0x10, SR: 0xa0000
Watchdog is disabled!

modprobe r8188eu
r8188eu: module is from the staging directory, the quality is unknown, you have been warned.
usbcore: registered new interface driver r8188eu

what information is needed?

IMG_20210824_192546 IMG_20210824_193206

ZigFisher commented 2 years ago

Your USB interface works in the mode of a USB gadget, not a USB host. Please expect a patch and release in the coming days.

ZigFisher commented 2 years ago

Please upload the current build to your board.

001Tycoon commented 2 years ago

I uploaded the current build. 10.10.2021 1.30 p.m. uImage.hi3518ev300 rootfs.squashfs.hi3518ev300 How do I configure the USB gadget network driver? Thanks for the help

ljalves commented 2 years ago

Hi there, I have an ipcam with similar hardware and have the same issue.

I had to remove the spi flash and use a programmer to burn latest uboot+uImage+rootfs from https://github.com/OpenIPC/firmware/releases/tag/latest (all files for hi3518ev300)

But no wifi... so it's useless :(

How can I proceed?

Edit:

root@openipc-hi3518ev300:~# lsusb                                               
Bus 001 Device 001: ID 1d6b:0002                                                
Bus 001 Device 002: ID 0bda:f179                                                
Bus 002 Device 001: ID 1d6b:0003  

(0bda:f179 is the rtl8188fu not rtl8188eu)

ljalves commented 2 years ago

Found the issue... the driver included doesn't support this chip (0bda:f179). Fortunately I found a repo for it: https://github.com/ulli-kroll/rtl8188fu.git

Compiled it and it just works!

BTW, amazing work with openipc!

Edit: @001Tycoon, If you want to try it, copy the module included below over the exiting r8188eu (and also add the firmware).

quick_hack.zip

001Tycoon commented 2 years ago

@ljalves Thanks very much. @ZigFisher i think we can close this issue.

ZigFisher commented 2 years ago

We need to move the developments to the upstream

ljalves commented 2 years ago

offtopic: is there a place where I can publish all the info about this ipcam? Also, I assume there are no motor drivers so I'm now working on getting the motors to run (reverse engineering the original motor driver).

ZigFisher commented 2 years ago

Motors drivers found here https://github.com/OpenIPC/motors

You can post information about your camera model on our Wiki. Write to me PM in Telegram (find as @FlyRouter) if there is such an opportunity and we will discuss the details..