1 1
Nick

Move to dev

Recommended Posts

Hello all,

I've been struggling to build Armbian for the Orange Pi Pc all day today, it worked fine yesterday then today nothing.

 

I've just been looking through the repo at github and it appears that all of the patches for building sun8i-h3.dtsi etc have been moved to linux-dev does this mean that from now on we need to build the dev kernel not the next kernel for H3 devices?

Share this post


Link to post
Share on other sites

Yes, use DEV for Oranges H3 now - you get kernel 4.5 + all recent patches and u-boot 2016.03 by default. I only built the kernel but haven't try to boot yet.

 

We should display commit text when updating ... to avoid wasting time in this? sry

Share this post


Link to post
Share on other sites

No problem, assuming dev works about as well as next did yesterday that should be fine for me. I've just spent the day being completely confused as to why things worked perfectly yesterday and now I get a screen full of errors  ;)

 

I'm downloading / building dev now so hopefully all will be well  :)

Share this post


Link to post
Share on other sites

Is USB broken for the H3 in dev for everyone or just for me?

I saw something in the sunxi chat logs about Montjoe's ethernet patches breaking USB, but I thought that was fixed?

root@orangepipc:~# dmesg | grep usb
[    3.183397] usbcore: registered new interface driver usbfs
[    3.183453] usbcore: registered new interface driver hub
[    3.183526] usbcore: registered new device driver usb
[    3.319078] ehci-platform 1c1b000.usb: EHCI Host Controller
[    3.319108] ehci-platform 1c1b000.usb: new USB bus registered, assigned bus number 1
[    3.321579] ehci-platform 1c1b000.usb: can't setup: -110
[    3.321596] ehci-platform 1c1b000.usb: USB bus 1 deregistered
[    3.321641] ehci-platform: probe of 1c1b000.usb failed with error -110
[    3.321755] ehci-platform 1c1c000.usb: EHCI Host Controller
[    3.321778] ehci-platform 1c1c000.usb: new USB bus registered, assigned bus number 1
[    3.324127] ehci-platform 1c1c000.usb: can't setup: -110
[    3.324138] ehci-platform 1c1c000.usb: USB bus 1 deregistered
[    3.324167] ehci-platform: probe of 1c1c000.usb failed with error -110
[    3.324264] ehci-platform 1c1d000.usb: EHCI Host Controller
[    3.324288] ehci-platform 1c1d000.usb: new USB bus registered, assigned bus number 1
[    3.326671] ehci-platform 1c1d000.usb: can't setup: -110
[    3.326685] ehci-platform 1c1d000.usb: USB bus 1 deregistered
[    3.326715] ehci-platform: probe of 1c1d000.usb failed with error -110
[    3.326992] ohci-platform 1c1b400.usb: Generic Platform OHCI controller
[    3.327017] ohci-platform 1c1b400.usb: new USB bus registered, assigned bus number 1
[    3.327145] ohci-platform 1c1b400.usb: irq 24, io mem 0x01c1b400
[    3.385212] ohci-platform 1c1b400.usb: init err (00000000 0000)
[    3.385222] ohci-platform 1c1b400.usb: can't start
[    3.385293] ohci-platform 1c1b400.usb: startup error -75
[    3.385305] ohci-platform 1c1b400.usb: USB bus 1 deregistered
[    3.385343] ohci-platform: probe of 1c1b400.usb failed with error -75
[    3.385461] ohci-platform 1c1c400.usb: Generic Platform OHCI controller
[    3.385485] ohci-platform 1c1c400.usb: new USB bus registered, assigned bus number 1
[    3.385597] ohci-platform 1c1c400.usb: irq 26, io mem 0x01c1c400
[    3.445210] ohci-platform 1c1c400.usb: init err (00000000 0000)
[    3.445219] ohci-platform 1c1c400.usb: can't start
[    3.445262] ohci-platform 1c1c400.usb: startup error -75
[    3.445273] ohci-platform 1c1c400.usb: USB bus 1 deregistered
[    3.445308] ohci-platform: probe of 1c1c400.usb failed with error -75
[    3.445417] ohci-platform 1c1d400.usb: Generic Platform OHCI controller
[    3.445441] ohci-platform 1c1d400.usb: new USB bus registered, assigned bus number 1
[    3.445535] ohci-platform 1c1d400.usb: irq 28, io mem 0x01c1d400
[    3.505209] ohci-platform 1c1d400.usb: init err (00000000 0000)
[    3.505218] ohci-platform 1c1d400.usb: can't start
[    3.505257] ohci-platform 1c1d400.usb: startup error -75
[    3.505268] ohci-platform 1c1d400.usb: USB bus 1 deregistered
[    3.505299] ohci-platform: probe of 1c1d400.usb failed with error -75
[    3.505459] usbcore: registered new interface driver usb-storage
[    3.545753] usbcore: registered new interface driver usbhid
[    3.545759] usbhid: USB HID core driver

The above was with a clean git clone of Armbian

./compile.sh BUILD_DESKTOP=no RELEASE=jessie BRANCH=dev PROGRESS_DISPLAY=plain PROGESS_LOG_TO_FILE=yes BOARD=orangepih3 PROGRESS_DISPLAY=plain COMPRESS_OUTPUTIMAGE=no DEST_LANG=en_GB.UTF-8 EXTENDED_DEBOOTSTRAP=yes APT_PROXY_ADDR=nas-1.local:3142 FORCE_CHECKOUT=yes PROGRESS_LOG_TO_FILE=yes

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

Thanks, Ill look at those patches later on.

I'm trying to get back to where I was the other week, before all of the H3 stuff was moved to dev. Everything was working nicely then :-P

 

That said, shouldn't complain as once the EMAC stuff is working properly it will be awesome :-)

Share this post


Link to post
Share on other sites

Me too, I'm still struggling to get a build from dev. I will continue investigation today ...

(I'm even getting trouble with the latest next 4.4.6, it is building, but not booting.)

Share this post


Link to post
Share on other sites

4.4.6 not booting is a missing opi pc dtb file (at least for me). When I looked into it I think the h3 dtsi file was missing from the linux source. I'm guessing Armbian was including it as a patch?

 

The dtsi file is in V4.5 of the kernel source (I found it in the git repo) so I figured I would use that to create a patch that created the file. Long story short it got me a little further but still no boot  :(

 

There is a commit in the Armbian repo from a couple of days ago that details the move of the patch files, I figured all I would have to do is reverse that commit locally, but I'm guessing something else has changed as well.

Share this post


Link to post
Share on other sites

I've finally got the latest dev 4.5.0+ to compile and boot with the USB patches.

Unfortunately for the EMAC, I'm seeing the following error in dmesg almost every 15 secs :

[   16.585685] sun8i-emac 1c30000.ethernet: sun8i_emac_xmit xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx len=342
[   16.594789] sun8i-emac 1c30000.ethernet: sun8i_emac_xmit found slot 3 at 0xf10b2030 (slot=4)
[   16.603304] sun8i-emac 1c30000.ethernet: sun8i_emac_dma_interrupt 40000125
[   16.610188] sun8i-emac 1c30000.ethernet: sun8i_emac_complete_xmit
[   16.616291] sun8i-emac 1c30000.ethernet: sun8i_emac_complete_xmit found slot to clean 3 at 0xf10b2030 0 f9000156 (len=342)
[   16.627340] sun8i-emac 1c30000.ethernet: TX DMA currddesc=7ec4e040
[   16.633524] sun8i-emac 1c30000.ethernet: Re-run TX DMA 40000002
[   16.639447] sun8i-emac 1c30000.ethernet: Unhandled interrupt TX_EARLY_INT
[   16.646243] sun8i-emac 1c30000.ethernet: sun8i_emac_rx_from_ddesc from 03 0xf10b0030 len=346 status=15a0320 st=5dc
[   16.656614] sun8i-emac 1c30000.ethernet: Init ddesc 03 at 0xf10b0030 buff=ee6bfe30 6dbe2c42 status=(80000000 5dc) len=1500

Also, unfortunately, my I2C/SPI patches don't seems to work too ... I will continue investigate on that since they were working fine under 4.5.0-rc6+ ...

At least, with the USB working, I've a USB-Wifi dongle working for the networking.

 

EDIT: for the I2C/SPI patches, I had forgot one of the patches on top level DTS. Now I2C is working, SPI device appears, but it is timing out ...

Share this post


Link to post
Share on other sites

Were those integrated into Armbian patching process or should I try to apply them manually ?

 

Manually. After I broke the whole thing on the 15th I didn't touched H3/mainline any more so the two with yesterday's date are missing (just asked montjoie to fix permissions of the 1st since this wasn't accessible until a few minutes ago)

Share this post


Link to post
Share on other sites

Ok ! While waiting for your answer, I started applying but only the newest. (btw, the second one and the last one seems to be the same patch).

Rebuilt it, no more errors in dmesg every 15 secs, but still an error :

[   10.245720] sun8i-emac 1c30000.ethernet eth0: eth0: PHY ID 00000044 at 0 IRQ poll (1c30000.ethernet:00)
[   10.255561] sun8i-emac 1c30000.ethernet eth0: Link is Up - Unsupported (update phy.c)/Half - flow control off
[   10.265570] sun8i-emac 1c30000.ethernet: MDC auto : 0
[   10.270635] sun8i-emac 1c30000.ethernet: sun8i_emac_set_mac_address
[   10.276934] sun8i-emac 1c30000.ethernet: sun8i_emac_set_macaddr slot 0 9a 9 52 94 51 69
[   10.285332] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   12.245781] sun8i-emac 1c30000.ethernet: sun8i_emac_adjust_link link=0 duplex=0 speed=a

Did it worked on your side ?

 

EDIT : Oh !!! BINGO !!! Doing "ifdown eth0; ifup eth0" manually, I got an IP from DHCP ! The EMAC is working ! Champagne, guys !!! :D

Share this post


Link to post
Share on other sites

EDIT : Oh !!! BINGO !!! Doing "ifdown eth0; ifup eth0" manually, I got an IP from DHCP ! The EMAC is working ! Champagne, guys !!! :D

 

:)

 

I'm satisfied if iperf shows more than 90 Mbits/sec ;)

 

Will try later. BTW: Did you had to add additional patches? Or care to provide the contents of your userpatches directory to be able to fix the whole thing in dev more quickly?

Share this post


Link to post
Share on other sites

Manually. After I broke the whole thing on the 15th I didn't touched H3/mainline any more so the two with yesterday's date are missing (just asked montjoie to fix permissions of the 1st since this wasn't accessible until a few minutes ago)

Ahh that would be why my attempts didn't work either. I assumed it was unavailable because it wasn't needed.

 

Great to hear that it's working :-)

Share this post


Link to post
Share on other sites

:)

 

I'm satisfied if iperf shows more than 90 Mbits/sec ;)

 

Will try later. BTW: Did you had to add additional patches? Or care to provide the contents of your userpatches directory to be able to fix the whole thing in dev more quickly?

 

For the patches, since most were already applied, I've applied manually the 0001-ethernet-add-sun8i-emac-driver.patch follow by 0005-ethernet-add-sun8i-emac-driver.patch, but both looks the same.

 

For iperf, you will be deceived ... I didn't provide any options except -c/-s, tested on both directions, first thru the R8188eu Wifi  :

root@orangepipc:~# iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 10.111.111.73 port 5001 connected with 10.111.111.11 port 43820
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-10.3 sec  39.8 MBytes  32.5 Mbits/sec
^Croot@orangepipc:~# iperf -c 10.111.111.11
connect failed: Connection refused
root@orangepipc:~# iperf -c 10.111.111.11
------------------------------------------------------------
Client connecting to 10.111.111.11, TCP port 5001
TCP window size: 43.8 KByte (default)
------------------------------------------------------------
[  3] local 10.111.111.73 port 56344 connected with 10.111.111.11 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  45.2 MBytes  37.8 Mbits/sec


and then thru eth0 :

root@orangepipc:~# iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 10.111.111.80 port 5001 connected with 10.111.111.11 port 53540
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-10.4 sec  11.6 MBytes  9.41 Mbits/sec
root@orangepipc:~# iperf -c 10.111.111.11
------------------------------------------------------------
Client connecting to 10.111.111.11, TCP port 5001
TCP window size: 43.8 KByte (default)
------------------------------------------------------------
[  3] local 10.111.111.73 port 56346 connected with 10.111.111.11 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.1 sec  28.5 MBytes  23.7 Mbits/sec

So, lets keep Champagne for another day, and open simple Sparkling wine instead ... :P

Share this post


Link to post
Share on other sites

Interesting... I have managed to compile Armbian with the on SoC emac running yay  :)

 

I can ssh to it from the outside world, I can ping it from the outside world apt-get update works fine, but I can't ping other devices from the OPi PC.

 

I'm guessing there are still some bugs around ICMP?

 

Edit: Just checked dmesg and found this: 

[  700.437256] sun8i-emac 1c30000.ethernet: ERROR: TX is full
[  700.437270] sun8i-emac 1c30000.ethernet: ERROR: TX is full
[  700.437283] sun8i-emac 1c30000.ethernet: ERROR: TX is full
[  700.437297] sun8i-emac 1c30000.ethernet: ERROR: TX is full
[  700.437311] sun8i-emac 1c30000.ethernet: ERROR: TX is full
[  700.437324] sun8i-emac 1c30000.ethernet: ERROR: TX is full
[  700.437338] sun8i-emac 1c30000.ethernet: ERROR: TX is full
[  700.437351] sun8i-emac 1c30000.ethernet: ERROR: TX is full
[  700.437372] sun8i-emac 1c30000.ethernet: ERROR: TX is full
[  700.437386] sun8i-emac 1c30000.ethernet: ERROR: TX is full
[  700.437400] sun8i-emac 1c30000.ethernet: ERROR: TX is full
[  700.437414] sun8i-emac 1c30000.ethernet: ERROR: TX is full
[  700.437428] sun8i-emac 1c30000.ethernet: ERROR: TX is full
[  700.437442] sun8i-emac 1c30000.ethernet: ERROR: TX is full
[  700.437474] sun8i-emac 1c30000.ethernet: ERROR: TX is full

Lots of them :-P

 

Also this: 

 sun8i-emac 1c30000.ethernet eth0: Link is Up - 10Mbps/Half - flow control off

May explain your poor iperf results

Share this post


Link to post
Share on other sites

A little more info

root@orangepipc:~# ethtool eth0
Settings for eth0:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
                                1000baseT/Half 1000baseT/Full 
        Supported pause frame use: No
        Supports auto-negotiation: No
        Advertised link modes:  10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
                                1000baseT/Half 1000baseT/Full 
        Advertised pause frame use: No
        Advertised auto-negotiation: No
        Link partner advertised link modes:  1000baseT/Full 
        Link partner advertised pause frame use: No
        Link partner advertised auto-negotiation: No
        Speed: 10Mb/s
        Duplex: Half
        Port: MII
        PHYAD: 0
        Transceiver: external
        Auto-negotiation: on
        Link detected: yes

Share this post


Link to post
Share on other sites

Unfortunately, I think the "Sparkling wine" should even been downgraded to "7-Up" :

 

Doing a SSH to the eth0 IP, I've then turned of the Wifi to keep only the eth0 routing !

Even the shell is reacting badly, typing is not showing the echo instantaneously sometimes, I need to keep typing blindly and hit enter to finally get the echo.

And even the DNS doesn't seems to work in my case, although it is still present in /etc/resolv.conf.

Doing the iperf tests again, it completely become frozen ... :(

Looking at the /dev/ttyS0 serial : flood of sun8i-emac 1c30000.ethernet: ERROR: TX is full ... :angry:

Share this post


Link to post
Share on other sites

It seems very unstable. Maybe a buffer overflow or something? I had the ethernet port lock up just now, the only way to fix it was a reboot. The board itself was fine (still had a serial console working) but no ethernet.

 

On a different note:

 

Did you also have to patch linux/reset-controller.h ? without it core.c wouldn't compile.

 

Here is the patch that I came up with:

--- /include/linux/reset-controller.h   2016-03-18 20:51:25.529580823 +0000
+++ /include/linux/reset-controller.h   2016-03-20 22:16:00.000000000 +0000
@@ -31,6 +31,7 @@
  * @ops: a pointer to device specific struct reset_control_ops
  * @owner: kernel module of the reset controller driver
  * @list: internal list of reset controller devices
+ * @reset_control_head: head of internal list of requested reset controls
  * @of_node: corresponding device tree node as phandle target
  * @of_reset_n_cells: number of cells in reset line specifiers
  * @of_xlate: translation function to translate from specifier as found in the
@@ -41,6 +42,7 @@
        struct reset_control_ops *ops;
        struct module *owner;
        struct list_head list;
+       struct list_head reset_control_head;
        struct device_node *of_node;
        int of_reset_n_cells;
        int (*of_xlate)(struct reset_controller_dev *rcdev,

Share this post


Link to post
Share on other sites

I have tar.bz2 files containing my user patches and updated armbian patches folders, however the forum wont let me up load them :-( It doesn't like the file type sadly. 

Can someone adjust my permissions or suggest an alternative format .zip maybe? that the forum likes.

 

The patches are for working USB and EMAC on the Orange Pi PC.

Share this post


Link to post
Share on other sites

martinayotte did you solve your spi timeout problem?

If not, you might want to change the max speed in the dtb file. There was / is a bug in the spi driver where it ignores the speed setting in the user application therefore it defaults to the max set in the dtb file.

Share this post


Link to post
Share on other sites

Yes, I had to patch reset-controller.h too, as shown in the patches.

 

For my SPI timeout issue, I didn't resolve it yet. From what I know, when working on SPI with 4.4.5, I've tried to change the max speed in DTS, and it had no effect on real speed seen with logic analyser.

So, I doubt it will fix the timeout issue on 4.5.0+, but I will give it a second try tomorrow.

Share this post


Link to post
Share on other sites

martinayotte I have Ethernet, USB and SPI working, see attached patches.

 

I've not communicated with an SPI slave yet, but the clock line is pulsing at 50kHz (set by the dts file) according to my scope. Thanks for the most part to your patches.

 

Hope this helps you. I'm off to figure out GPIO in DTS now woop  :P

 

Edit: There was no DTS GPIO problem, rather a user is an idiot problem. I was using old code that was trying to export GPIO pins that don't physically exist  ;)

eth-usb-spi-opi-pc-patches.zip

Share this post


Link to post
Share on other sites

@candratech,

Thanks for the patches, I didn't get change to try it out, too many things to do for daily job ...

Is your tests succeeded with better throughput for eth0 without the "ERROR: TX is full" flood ?

Share this post


Link to post
Share on other sites

Tell me about it, my clients keep getting in the way of playing with Armbian as well  :(

Sadly the Ethernet performance hasn't improved at all for the moment. It's worth checking here every so often http://irclog.whitequark.org/linux-sunxi/search?q=montjoie as Montjoie developed the driver.

 

IMO the H3 Ethernet driver isn't stable enough for every day use yet and If I'm honest it's not something that I would look at in the short term, as right now I can get away with using a USB to Ethernet converter. If it isn't fixed in the future then I may get around to looking at it, but I've not written an EMAC driver before so I'm certainly not the best person to be debugging such things.

Share this post


Link to post
Share on other sites

Running 4.6.0 on a Orange Pi PC and also getting lost of errors on ethernet. Rebooting is the only thing I can do.

Anyone knows if there is some progress in this? Otherwise a great board for low price!

Apr 13 07:05:26 localhost kernel: [289986.855310] sun8i-emac 1c30000.ethernet: desc50 15600 0 5ec4e032:
Apr 13 07:05:26 localhost kernel: [289986.861513] sun8i-emac 1c30000.ethernet: desc51 15600 0 5ec4e033:
Apr 13 07:05:26 localhost kernel: [289986.867716] sun8i-emac 1c30000.ethernet: desc52 15600 0 5ec4e034:
Apr 13 07:05:26 localhost kernel: [289986.873919] sun8i-emac 1c30000.ethernet: desc53 15600 0 5ec4e035:
Apr 13 07:05:26 localhost kernel: [289986.880121] sun8i-emac 1c30000.ethernet: desc54 15600 0 5ec4e036:
Apr 13 07:05:26 localhost kernel: [289986.886325] sun8i-emac 1c30000.ethernet: desc55 15600 0 5ec4e037:
Apr 13 07:05:26 localhost kernel: [289986.892529] sun8i-emac 1c30000.ethernet: desc56 15600 0 5ec4e038:
Apr 13 07:05:26 localhost kernel: [289986.898733] sun8i-emac 1c30000.ethernet: desc57 15600 0 5ec4e039:
Apr 13 07:05:26 localhost kernel: [289986.904936] sun8i-emac 1c30000.ethernet: desc58 15600 0 5ec4e03a:
Apr 13 07:05:26 localhost kernel: [289986.911139] sun8i-emac 1c30000.ethernet: desc59 15600 0 5ec4e03b:
Apr 13 07:05:26 localhost kernel: [289986.917342] sun8i-emac 1c30000.ethernet: desc60 15600 0 5ec4e03c:
Apr 13 07:05:26 localhost kernel: [289986.923544] sun8i-emac 1c30000.ethernet: desc61 15600 0 5ec4e03d:
Apr 13 07:05:26 localhost kernel: [289986.929747] sun8i-emac 1c30000.ethernet: desc62 15600 0 5ec4e03e:
Apr 13 07:05:26 localhost kernel: [289986.935950] sun8i-emac 1c30000.ethernet: desc63 15600 0 5ec4e03f:
Apr 13 07:05:26 localhost kernel: [289986.943003] sun8i-emac 1c30000.ethernet: BUG!: TX is full 26 25

Share this post


Link to post
Share on other sites

@martinayotte, is it possible to get your SPI/I2C patches?

 

Are there any patches yet for CPU/therm throttling for 4.5.0+?  Is it possible just to take these and merge them? 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
1 1