Hi, I've managed to buy a few Orange PI PC boards for very nice price, to be used as controllers for simple measurement and control system. I have created the Linux image using the newest Buildroot 2016.11 The board booted correctly, but I have found a very strange thing. Even though U-Boot supported Ethernet (also DHCP and TFTP), the Linux kernel didn't see the Ethernet interface. I've checked the DTS files, and I have found that there is a small difference in the sun8i-h3-orangepi-pc.dts file between U-Boot and Linux: 168,178d167 < < &emac { < phy = <&phy1>; < phy-mode = "mii"; < allwinner,use-internal-phy; < allwinner,leds-active-low; < status = "okay"; < phy1: ethernet-phy@1 { < reg = <1>; < }; < }; It looks, like the Linux version of the DTS does not contain the definition of the Ethernet PHY. Is it done on purpose (due to e.g. incorrect operation of the related Ethernet driver), or the U-Boot uses simply a newer version of DTS? The latter seems to be justified by the fact, that the kernel version has the modification data of 2016.09.19, while the U-Boot version: 2016.09.07. TIA & Regards, Wojtek
Buildroot for Orange pi PC: U-Boot supports Ethernet, while Linux does not
Started by ●December 9, 2016
Reply by ●December 9, 20162016-12-09
On Fri, 09 Dec 2016 00:49:47 -0800, wzab01 wrote:> Hi, > > I've managed to buy a few Orange PI PC boards for very nice price, to be > used as controllers for simple measurement and control system. > I have created the Linux image using the newest Buildroot 2016.11 > > The board booted correctly, but I have found a very strange thing. > Even though U-Boot supported Ethernet (also DHCP and TFTP), the Linux > kernel didn't see the Ethernet interface. > > I've checked the DTS files, and I have found that there is a small > difference in the sun8i-h3-orangepi-pc.dts file between U-Boot and > Linux: > > 168,178d167 < > < &emac { > < phy = <&phy1>; > < phy-mode = "mii"; > < allwinner,use-internal-phy; > < allwinner,leds-active-low; > < status = "okay"; > < phy1: ethernet-phy@1 { > < reg = <1>; > < }; > < }; > > It looks, like the Linux version of the DTS does not contain the > definition of the Ethernet PHY. Is it done on purpose (due to e.g. > incorrect operation of the related Ethernet driver), or the U-Boot uses > simply a newer version of DTS? > The latter seems to be justified by the fact, that the kernel version > has the modification data of 2016.09.19, while the U-Boot version: > 2016.09.07. > > TIA & Regards, > WojtekSomeone may well come on and show me wrong, but I think the answer for this group (unfortunately) is that this is a _general_ embedded systems group, and getting an answer about some _specific_ setup is very sporadic. You _may_ luck out, but you're almost certainly going to have a better chance on an Orange pi forum or mailing list. Did the Orange pi come with Linux loaded? Did Ethernet work? Can you get the source for that specific build (you should, if it's in compliance with the GPL)? If so, are you building from that source? If not -- maybe you should. -- www.wescottdesign.com
Reply by ●December 9, 20162016-12-09
wzab01@gmail.com wrote:> It looks, like the Linux version of the DTS does not contain the > definition of the Ethernet PHY. Is it done on purpose (due to e.g. > incorrect operation of the related Ethernet driver), or the U-Boot uses > simply a newer version of DTS?I'm not up to date with the state of Allwinner upstreaming, but mention that Allwinner had their own device-tree-but-incompatible called Fex: http://linux-sunxi.org/Fex_Guide I think that has now been abandoned in favour of device tree, however Fex originally required support foir getting Fex properties to be baked into drivers. It may be there are still some remnants lying around - eg a driver using a legacy Fex structure and thus not DT. Are you using an Allwinner-specific kernel repo, or upstream Linux sources? As far as I know the upstream folks wanted nothing to do with Fex, so upstream is Fex-clean but not Allwinner-specific trees. Theo
Reply by ●December 9, 20162016-12-09
I have finally managed to get Ethernet on OrangePiPC working with Linux created in Buildroot 2016.11 However, it appeared to be a little more complicated, than I hoped sending my first post. First of all I had to patch not only sun8i-h3-orangepi-pc.dts, but also sun8i-h3.dtsi, as described in http://lists.infradead.org/pipermail/linux-arm-kernel/2016-July/444558.html Additionally I had to add the kernel driver, available from: https://github.com/montjoie/linux/blob/sun8i-emac-wip/drivers/net/ethernet/allwinner/sun8i-emac.c I have encapsulated it in a BR package and added reference to it at the end of the package/Config.in The modifications are not polished sufficiently to submit them to Buildroot, so at the moment I have posted them as a shar archive to alt.sources: https://groups.google.com/forum/#!topic/alt.sources/tbxQuMqtCXU With best regards, Wojtek
Reply by ●December 10, 20162016-12-10
It appeared, that the mainline 4.7.3 kernel does not correctly support the USB in Orange Pi PC. Therefore I had to use the newer kernel: 4.8.13. That required to change the patches. The new modifications are available at: https://groups.google.com/d/msg/alt.sources/tbxQuMqtCXU/yRB6CNbPDAAJ With best regards, Wojtek
Reply by ●December 10, 20162016-12-10
On Fri, 09 Dec 2016 00:49:47 -0800, wzab01 wrote:> Hi, > > I've managed to buy a few Orange PI PC boards for very nice price, to be > used as controllers for simple measurement and control system. > I have created the Linux image using the newest Buildroot 2016.11 > > The board booted correctly, but I have found a very strange thing.> ...Take a look at Armbian and DietPI distros; they both support the OrangePi-PC, among many other boards. Plenty of useful information in their forums. http://www.armbian.com/ http://dietpi.com/
Reply by ●December 16, 20162016-12-16
Finally I have reconfigured Buildroot 2016.11 to use kernel 4.9. Now it is possible to get minimal Linux system for Orange Pi PC, suited to the particular embedded system with Ethernet, USB, GPIO and I2C working. Necessary patches are described in https://groups.google.com/d/msg/alt.sources/hBHmYvfxFHw/dcCiF4B_DgAJ and in https://groups.google.com/d/msg/alt.sources/hBHmYvfxFHw/Oszk0ZWoDgAJ With best regards, Wojtek