Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Allwinner H3 Orangepi PC, nic not working.



On Sun, 6 Aug 2017, trebol wrote:

Hello Jared.

First of all, thank you so much for your work.

The board is working as the others, but the h3 emac is not defined in the dts files, and when I try to use the ones from u-boot-2017.05, I get

sunxiemac0 at fdt1: EMAC
sunxiemac0: soft reset timed out

Hi trebol --

The U-Boot DTS files use a different (old) encoding for pinctrl pins. In U-Boot arch/arm/dts/sun8i-h3.dtsi I see:

	emac_rgmii_pins: emac0@0 {
		allwinner,pins = "PD0", "PD1", "PD2", "PD3",
				"PD4", "PD5", "PD7",
				"PD8", "PD9", "PD10",
				"PD12", "PD13", "PD15",
				"PD16", "PD17";
		allwinner,function = "emac";
		allwinner,drive = <SUN4I_PINCTRL_40_MA>;
		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
	};

NetBSD expects these to be in the format defined by the Linux 4.14 binding spec for these nodes, so it should be:

        emac_pins_rgmii_a: emac_rgmii@0 {
                pins = "PD0", "PD1", "PD2", "PD3", "PD4", "PD5",
                       "PD7", "PD8", "PD9", "PD10", "PD12", "PD13",
                       "PD15", "PD16", "PD17";
                function = "emac";
                drive-strength = <40>;
        };

Easiest way to get this working is to create a file in the NetBSD tree sys/arch/arm/dts/sun8i-h3-orangepi-pc.dts that looks something like this:

-- snip --

#include "../../../external/gpl2/dts/dist/arch/arm/boot/dts/sun8i-h3-orangepi-pc.dts"
#include "sun8i-h3.dtsi"

&emac {
	phy = <&phy1>;
	phy-mode = "mii";
	allwinner,use-internal-phy;
	allwinner,leds-active-low;
	status = "okay";
	phy1: ethernet-phy@1 {
		reg = <1>;
	};
};

-- snip --

Then rebuild your kernel; the resulting sun8i-h3-orangepi-pc.dtb in your kernel obj directory should now have this node enabled.

Cheers,
Jared


Home | Main Index | Thread Index | Old Index