please choosego to mobile | Continue to access the PC version
View: 22179|Reply: 19

H3 GMAC

[Copy link]
Published in 2015-5-25 16:06:37 | Show all floors |Read mode
HI all,
I am trying to compile kernel from H3 Linux SDK  for Orange Pi Plus with .config file for Lubuntu http://www.orangepi.org/orangepi ... 20&fromuid=7773
But I can not get working ethernet.
Here is dmesg:
[root@orangepi-plus ~]# ifconfig eth0 up
[   36.401849] gmac0: probed
[   36.404855] gmac0 gmac0: eth0: eth0: PHY ID 00000000 at 0 IRQ poll (gmac0-0:00)
[   36.423174] gmac0 gmac0: eth0: Initialize hardware error

Looks like PHY is not detected. Correct PHY ID should be 001cc915.
Original kernel from Lubuntu distribution for Orange Pi Plus works OK, so hardware is working correctly.
Can anyone tell me what am I missing?

5

threads

354

posts

2614

credits

Moderator

Rank: 7Rank: 7Rank: 7

credits
2614
Published in 2015-5-26 01:13:13 | Show all floors
probably it will need a kernel patch.
Boards:
orangepi plus, olinuxino A20, cubieboard A10, mele A2000 .....
 Author| Published in 2015-5-26 13:47:01 | Show all floors
I would like to check pin configuration for gmac, but I don't see any sys_config.fex , script.bin, boot.scr or any other board configuration file. Is it hardcoded somewhere in kernel sources?

5

threads

354

posts

2614

credits

Moderator

Rank: 7Rank: 7Rank: 7

credits
2614
Published in 2015-5-26 21:04:31 | Show all floors
Has nothing to doo with pin configuration.
try it on the lubuntu distro, change only the kernel and leave the rest at it is.
Boards:
orangepi plus, olinuxino A20, cubieboard A10, mele A2000 .....
 Author| Published in 2015-5-26 21:38:33 | Show all floors
Edited by mihaly4 at 2015-5-27 00:53

That's what i initially did. I only changed kernel.

Also I dumped gmac configuration from /sys/class/script/dump and it seems valid. But i noticed that LEDs are not flashing when I plug the ethernet cable. Looks like phy is powered off, and I did not found any usage of gmac_phy_power_en pin in kernel source, however it is assigned in configuration:
gmac_phy_power_en gpio      (gpio: 0x66 / PD6, mul: 1, pull -1, drv -1, data 0)

I found a patch in BananaPi kernel, that makes use of gmac_phy_power_en. I will try to modify H3 gmac source in similar way.

5

threads

354

posts

2614

credits

Moderator

Rank: 7Rank: 7Rank: 7

credits
2614
Published in 2015-5-27 04:19:58 | Show all floors
mihaly4 replied at 2015-5-26 14:38
That's what i initially did. I only changed kernel.

Also I dumped gmac configuration from /sys/clas ...

Maybe you are right!

I have tried my self compiled kernel on another H3-device that use a internal PHY and ethernet works!!
so for user that have opi2 or opi2-mini ethernet should work with self compiled SDK-kernel
@mihaly4 GO ON!
If we wait for @steven or @allwinner releasing some usefull code or documentation we need to wait many, many, many, many, many, many, many, many, many, many, many, many,  many, many, many, many, many, many...................... Days!!!



Boards:
orangepi plus, olinuxino A20, cubieboard A10, mele A2000 .....
 Author| Published in 2015-5-27 14:17:39 | Show all floors
fritz replied at 2015-5-27 04:19
Maybe you are right!

I have tried my self compiled kernel on another H3-device that use a inter ...

Yay! I managed to get working ethernet! I was correct, Orange Pi Plus have PHY power circuit, controlled from gpio. I modified sunxi_geth.c file. Now it sets gmac_phy_power_en to 1.

5

threads

354

posts

2614

credits

Moderator

Rank: 7Rank: 7Rank: 7

credits
2614
Published in 2015-5-27 19:36:50 | Show all floors
Yeah!


Can you post a patch?
Boards:
orangepi plus, olinuxino A20, cubieboard A10, mele A2000 .....

2

threads

9

posts

82

credits

Registered member

Rank: 2

credits
82
Published in 2015-5-27 19:43:18 | Show all floors
Also can you see if your process is different from the one documented on the linux-sunxi site?  https://linux-sunxi.org/H3_Manual_build_howto
 Author| Published in 2015-5-27 20:38:08 | Show all floors

Here is quick and dirty patch

This thread contains more resources

You need to Log in to download or view,No account?    Register

x
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list