hi35xx / hi35xx-buildroot

buildroot for hisilicon hi35xx series
Other
145 stars 96 forks source link

Hi3518e and ethernet not working ? #4

Open briaeros opened 7 years ago

briaeros commented 7 years ago

Hi,

I've got an 53H13PE board, with a Hi3518e and an aptina and I'm trying to use your buildroot on it.

However, the driver hieth seems to be a little upset with it, since it give me an interface (eth0) wich emits and receives absolutely no packet. I can assign it an ip address, but whatever I do, no packet are sended nor received (check by tcpdump on the board, or on my network). The on-board firmware works well on this aspect.

I've used the linux 3.0 version, since with the 3.4 I don't have any serial console (and no network). I've tried to modify the RMIIMODE{U,D} and the PHYID_{U,D} in the linux config, to no avail.

Have you got this problem , and/or do you have an idea where to look at to investigate ?

Do you know any "cheap" board that is compatible with this buildroot (it could be easier to just switch the board :))

Cordially

Ps : on the on-board firmware, I've got theses informations, but I don't know what to do with

From boot :

<6>PHY: himii:01 - Link is Up - 100/Full
<6>Sofia uses obsolete (PF_INET,SOCK_PACKET

from some other conf file

DRIVER=hieth
MODALIAS=platform:hiet
himii:01

from the directory /sys/devices/platform/hieth.0/net/eth0

$cat iflink 
2
$cat link_mode 
0
$cat type
1
$cat operstate 
up
$cat features 
0x4000
$cat flags 
0x1003
csolg commented 7 years ago

You need to change "rmii" to "mii" in package/himpp/himpp-hi3518v100/load3518.sh.

https://github.com/csolg/hi35xx-buildroot/commit/c1940db88650b59c6fa122099887aa4bba20e6dc

briaeros commented 7 years ago

Thanks for the answer and the hint.

However, no luck there. I've change the load3518.sh, then as id didn't work, adding the CONFIG_HIETH_MII_RMII_MODE_U=0 CONFIG_HIETH_MII_RMII_MODE_D=0 to the linux-3.0 config (I've test with 1 also). But nothing seems to work.

The led is barely orange when buildroot is "on" (as if there are not enough power). On Uboot , it's brightly orange at start, then stay only green. And on the original firmware the two leds are brightly on.

I've dump the spi firmware and "binwalk" him, but I've no idea how find the "config" of the kernel (I don't think that's possible :( ).

csolg commented 7 years ago

@briaeros Can you see the chip name?

briaeros commented 7 years ago

The phy chip is IP101GR (http://www.bdtic.com/DataSheet/ICplus/IP101G_DS_R01_20121224.pdf ), and the Hi chip is HI3518ERBCV10D. Someone else did make a good pdf of the module in question http://ve6sbs.sbszoo.com/projects/ipcam/53H13PE-S/53H13PE-S_Mods.pdf (I've check the reference of the chips and I've got the same). The pcb on mine module is too dark to know how the '4' pin (MII/RMII) of the IP101GR is connected.

Thanks for your help :)

csolg commented 7 years ago

Did you rebuild the kernel (with command make linux-rebuild)?

briaeros commented 7 years ago

I use make clean && make -j 8 to compile "from scratch" each time. To be sure, I've (re-)cloned the git repo, add the two modification (the two lines on the linux-3.0 config and the modification on the loadhi3518.sh) . Then , after a make hi3518v100_defconfig; I've modified the config only on two way

Unfortunately , this doesn't change a thing :(

I've verified with an uname -a that I've got the last compiled kernel. "Linux hi35xx 3.0.8 #2 Mon Jan 2 23:20:10 UTC 2017 armv5tejl GNU/Linux"

I've copied the boot.txt if it could help. boot.txt

If you've got any idea to test, I'm more than interested :)

csolg commented 7 years ago

Do you have access to uboot? I need output of command printenv. Also output of command ifconfig (from linux console).

briaeros commented 7 years ago

Hi,

I've attached multiples files. I've found that the origin firmware is in rmii (the boot launch ./load3518 -i ar0130 , and the "load3518" command is copied in load-firmware-origin.txt).

The uboot printenv is in uboot.txt, and I've run ifconfig on both firmware (buildroot and firmware origin, which works). I've add the kmsg of the origin firmware.

However, even if it's in rmii, it doesn't explain why it wouldn't work :'(

ifconfig-buildroot.txt ifconfig-firmware-origin.txt kmsg-firmware-origin.txt load-firmware-origin.txt uboot.txt

csolg commented 7 years ago

Did you set BR2_TARGET_UBOOT_BOARDNAME to hi3518e?

briaeros commented 7 years ago

Hi,

I didn't, but I've done a new compile using this parameters to hi3518e (and modifying BR2_TARGET_UBOOT_HI35XX_IMAGE_CH_FILE to board/hisilicon/hi3518/boot/reg_info_hi3518e.bin).

Unfortunately , I tried to use the uboot generate with the command tftp 0x81000000 u-boot.bin then go 0x81000000 , but the network didn't work in the new uboot.

No more lucks with just the kernel and the original u-boot.

I think that my board is cursed :d If you've know a name of a cheap board that works well, I'm eager to know it :)

csolg commented 7 years ago

Hi, I have the same board. But I can access to the network from uboot and linux. Did you fix the problem? I bought a programmator for mx25l6406e. If you have a problem with the board loading.

briaeros commented 7 years ago

Thank you for your patience.

I've tried to modify the default configuration of uboot, to get it directly working from ram (without the uboot-env partition). But even when I put all the information that are in uboot-env.txt, I can't make it work. So I'm not really confident to put it on flash ;) I've test with mii and rmii.

I tried to boot the new kernel from this uboot (loading it before), but without success. It didn't even take into account the uboot variable "sensor_type" and always try to launch the ov sensor. I pass the ${hieth} to kernel command line. Modifying mdioifu and mdioifd to 1 doesn't modified the apathy of the kernel.

I've got some stm32 laying somewhere, perhaps I could convert one to make a spi progammer, but I'm not too found to desolder the chips (and I'm sure to be good enough to

How did you make your firmware image ? Juste copy each binary to the right address on the flash, or do you make a complete image before pushing it to the flash ?

(on the new uboot, I've got this environnment bootargs=mem=32M console=ttyAMA0,115200 bootcmd=run autoboot bootdelay=5 baudrate=115200 ethaddr=00:00:23:34:45:66 ipaddr=192.168.1.13 serverip=192.168.1.19 preboot= netmask=255.255.255.0 bootfile="uImage" loadaddr=0x81000000 meminfo=mem=32M console=ttyAMA0,115200n8 mtdparts=hi_sfc:256k(uboot)ro,128k(uboot-env),128k(mfd),1536k(kernel),4m(rootfs),-(user) commonargs=setenv bootargs ${meminfo} console=${console} mtdparts=${mtdparts} flashboot=echo Booting from SPI Flash...; run commonargs; sf probe 0 && sf read ${loadaddr} 0x80000 0x180000 && bootm serialboot=echo Booting from y-modem...; run commonargs; loady && bootm autoboot=if run flashboot; then; else run serialboot; fi sensor_type=ar0130 mdio_intf=mii phyaddru=1 phyaddrd=2 netdev=eth0 nfsopts=hard,tcp,vers=3 hieth=hieth.mdioifu=0 hieth.mdioifd=0 hieth.phyaddru=1 hieth.phyaddrd=2 mtdparts=hi_sfc:512k(uboot)ro,256k(uboot-env),256k(mfd),2m(kernel),5m(rootfs),-(user) commonargs=setenv bootargs ${meminfo} panic=10 console=${console} mtdparts=${mtdparts} ${hieth} bootargsorig=mem=39M console=ttyAMA0,115200n8 root=/dev/mtdblock1 rootfstype=cramfs mtdparts=hi_sfc:256K(boot),3520K(romfs),2560K(user),1280K(web),256K(cus),320K(mt) orig=setenv setargs setenv bootargs ${bootargsorig};run setargs;fload;bootm 0x82000000 myboot=setenv bootargs ${commonargs} && tftp 0x82000000 cam/uImage && bootm 0x82000000 HWID=8043420004748432 NID=0x0012 muxctl0= muxval0= gpio0= gpioval0= stdin=serial stdout=serial stderr=serial verify=n ver=U-Boot 2010.06-dirty (Jan 12 2017 - 00:05:51) )

49handyman commented 7 years ago

has anyone figured this out. I have same problem on a hi3518e juan board. have linux, uboot, running pretty goo finally after trashing 2 boards and now unsoldering spi chip 8 times. now im pretty good at it... LOL

49handyman commented 7 years ago

my board has full network connectivity in uboot, but no in Linux. let me know if anything is wrong with it!

here is is the current fw_print:

fw_printenv

bootcmd=run autoboot baudrate=115200 ethaddr=00:00:23:34:45:66 preboot= loadaddr=0x81000000 serialboot=echo Booting from y-modem...; run commonargs; loady && bootm meminfo=mem=40m console=ttyAMA0,115200 flashroot=/dev/mtdblock4 bootfile=hi3518/uImage sensor_type=ar0130 init=/init hieth=hieth.mdioifu=0 hieth.mdioifd=0 hieth.phyaddru=1 hieth.phyaddrd=2 flashoverlay=/dev/mtdblock5 flashoverlayfstype=jffs2 commonargs=setenv bootargs ${meminfo} console=${console} mtdparts=${mtdparts} ${hieth} init=${init} addip=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off nfsargs=run commonargs; setenv bootargs ${bootargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} nfsboot=echo Booting from NFS...; run nfsargs; run addip; tftp ${loadaddr} ${bootfile} && bootm ${loadaddr} flashargs=run commonargs; setenv bootargs ${bootargs} root=${flashroot} overlay=${overlay} rootfstype=${flashrootfstype} overlay=${flashoverlay} overlayfstype=${flashoverlayfstype} filesize=3B5000 fileaddr=81000000 netmask=255.255.255.0 ipaddr=192.168.1.10 serverip=192.168.1.107 mtdparts=hi_sfc:256k(uboot)ro,128k(uboot-env),128k(mfd),2m(kernel),5m(rootfs),-(user) ramdisk=4096 bootdelay=3 bootargs=mem=40m console=ttyAMA0,115200 mtdparts=hi_sfc:256k(uboot)ro,128k(uboot-env),128k(mfd),2m(kernel),5m(rootfs),-(user) ramdisk=4096 hieth.mdioifu=0 hieth.mdioifd=0 hieth.phyaddru=1 hieth.phyaddrd=2 init=/init root=/dev/mtdblock4 overlay= rootfstype=squashfs overlay=/dev/mtdblock5 overlayfstype=jffs2 autoboot=if run flashboot; then; else run nfsboot; fi stdin=serial stdout=serial stderr=serial verify=n ver=U-Boot 2010.06 (Jul 02 2017 - 03:46:51) flashboot=echo Booting from SPI Flash...; run flashargs; sf probe 0 && sf read ${loadaddr} 0x80000 0x200000 && bootm phyaddru=1 phyaddrd=2 netdev=eth0 nfsopts=hard,tcp,vers=3 NID=0x0012 HWID=8043420004748432 mdio_intf=mii flashrootfstype=squashfs,jffs2 rootpath=/srv/tftp/hi3518/

49handyman commented 7 years ago

looks like I have a problem loading some modules. Ill repair and report if it fixes problem. I can ping only the interface ip on eth0. nothing else works.

hi3518_base: module license 'Proprietary' taints kernel. Disabling lock debugging due to kernel taint Hisilicon UMAP device driver interface: v3.00 pa:82800000, va:c31c0000 load sys.ko ...OK! load viu.ko ...OK! ISP Mod init! load vpss.ko ....OK! load venc.ko ...OK! load group.ko ...OK! load chnl.ko ...OK! load h264e.ko ...OK! load jpege.ko ...OK! load rc.ko ...OK! load region.ko ....OK! load vda.ko ....OK! hi_i2c: version magic '3.0.8dsw.BR3 mod_unload ARMv5 ' should be '3.0.8 mod_unload ARMv5 ' insmod: can't insert 'extdrv/hi_i2c.ko': invalid module format pwm: version magic '3.0.8dsw.BR3 mod_unload ARMv5 ' should be '3.0.8 mod_unload ARMv5 ' insmod: can't insert 'extdrv/pwm.ko': invalid module format ssp_ad9020: version magic '3.0.8dsw.BR3 mod_unload ARMv5 ' should be '3.0.8 mod_unload ARMv5 ' insmod: can't insert 'extdrv/ssp_ad9020.ko': invalid module format acodec inited! insert audio ==== Your input Sensor type is ar0130 ==== OK Starting system message bus: done Starting network: ADDRCONF(NETDEV_UP): eth0: link is not ready OK Starting live-streamer: OK

Welcome to hi35xx-buildroot hi3518e login: PHY: himii:01 - Link is Up - 100/Full ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

49handyman commented 7 years ago

.config - Linux/arm 3.0.8 Kernel Configuration ──────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌─────────────────────────── hieth(switch fabric) family network device support ────────────────────────────┐ │ Arrow keys navigate the menu. selects submenus --->. Highlighted letters are hotkeys. │
│ Pressing includes, excludes, modularizes features. Press to exit, <?> for Help, │
│ </> for Search. Legend: [] built-in [ ] excluded module < > module capable │
│ │
│ ┌───────────────────────────────────────────────────────────────────────────────────────────────────────┐ │
│ │ --- hieth(switch fabric) family network device support │ │
│ │ (0x726d6d73) hieth tag │ │
│ │ (0x10090000) hieth IO address │ │
│ │ (0x00010000) hieth IO size │ │
│ │ (12) hieth irq number │ │
│ │ [ ] eee support │ │
│ │ (10) hieth monitor timer │ │
│ │ (12) hieth hardware queue send fifo depth │ │
│ │ (2) hieth mdio frequency factor │ │
│ │ (0) hieth mii/rmii mode for up port (mii:0/rmii:1) │ │
│ │ (0) hieth mii/rmii mode for down port (mii:0/rmii:1) │ │
│ │ (1) hieth phyid for up port │ │
│ │ (2) hieth phyid for down port │ │
│ │ [ ] enable hieth down port │ │
│ │ (1024) hieth max rx pool size │ │
│ │ (18) hieth trace(debug) level │ │
│ │ [
] hieth reset helper │ │
│ │ (0x20140000) hieth reset helper on which gpio group │ │
│ │ (5) hieth reset helper on gpio bit │ │
│ │ (0) hieth reset helper on gpio value │ │
│ │ │ │
│ └───────────────────────────────────────────────────────────────────────────────────────────────────────┘ │
├───────────────────────────────────────────────────────────────────────────────────────────────────────────┤