Hello!
I'm trying to bring up the DP83825I ethernet phy with u-boot-at91 on a custom board based on at91 sam9x75eb mpu, I have configure the device tree like this:
==>in the sam9x7.dtsi file I have assined the clocks
gmac: ethernet@f802c000 {
compatible = "microchip,sam9x7-gem";
reg = <0xf802c000 0x1000>;
interrupts = <24 IRQ_TYPE_LEVEL_HIGH 3 /* Queue 0 */
60 IRQ_TYPE_LEVEL_HIGH 3 /* Queue 1 */
61 IRQ_TYPE_LEVEL_HIGH 3 /* Queue 2 */
62 IRQ_TYPE_LEVEL_HIGH 3 /* Queue 3 */
63 IRQ_TYPE_LEVEL_HIGH 3 /* Queue 4 */
64 IRQ_TYPE_LEVEL_HIGH 3>; /* Queue 5 */
clocks = <&pmc PMC_TYPE_PERIPHERAL 24>, <&pmc PMC_TYPE_PERIPHERAL 24>, <&pmc PMC_TYPE_GCK 24>;
clock-names = "hclk", "pclk", "tx_clk";
assigned-clocks = <&pmc PMC_TYPE_GCK 24>;
assigned-clock-rates = <50000000>;
status = "disabled";
};
==> in the at91-sam9x75eb.dts file, I have changed the config like this
&gmac {
phy-mode = "rmii";
#address-cells = <1>;
#size-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_macb0_rmii>;
magic-packet;
status = "okay";
phy-reset-gpios = <&pioC 14 GPIO_ACTIVE_LOW>;
phy-reset-duration = <2>;
pinctrl-assert-gpios = <&pioC 18 GPIO_ACTIVE_LOW>;
phy-handle = <ðphy0>;
mdio {
#address-cells = <1>;
#size-cells = <0>;
ethphy0: ethernet-phy@0 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <0>;
};
};
};
pinctrl_macb0_rmii: gmac {
atmel,pins =
<AT91_PIOB 0 AT91_PERIPH_C AT91_PINCTRL_NONE /* ETH_RXER */
AT91_PIOC 14 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP /* ETH_RESET */
AT91_PIOC 18 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP /* ETH_PWRDN */
AT91_PIOB 3 AT91_PERIPH_A AT91_PINCTRL_NONE /* ETH_CRSDV */
AT91_PIOB 6 AT91_PERIPH_A AT91_PINCTRL_NONE /* ETH_CLK*/
AT91_PIOB 7 AT91_PERIPH_A AT91_PINCTRL_NONE /* ETH_TXEN */
AT91_PIOB 9 AT91_PERIPH_A AT91_PINCTRL_NONE /* ETH_MDIO */
AT91_PIOB 10 AT91_PERIPH_A AT91_PINCTRL_NONE /* ETH_MDC */
AT91_PIOB 11 AT91_PERIPH_A AT91_PINCTRL_NONE /* ETH_RXD0 */
AT91_PIOB 12 AT91_PERIPH_A AT91_PINCTRL_NONE /* ETH_RXD1 */
AT91_PIOB 13 AT91_PERIPH_A AT91_PINCTRL_NONE /* ETH_TXD0 */
AT91_PIOB 14 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* ETH_TXD1 */
};
==> I have added in the uboot defconfig file this configs:
ethernet@f802c000: Autonegotiation timed out (status=0x7849)
ethernet@f802c000: link down (status: 0x7849)
ping failed; host 192.168.1.112 is not alive
0. (7849) -- PHY control register --
(8000:0000) 0.15 = 0 reset
(4000:4000) 0.14 = 1 loopback
(2040:2040) 0. 6,13 = b11 speed selection = 10 Mbps
(1000:1000) 0.12 = 1 A/N enable
(0800:0800) 0.11 = 1 power-down
(0400:0000) 0.10 = 0 isolate
(0200:0000) 0. 9 = 0 restart A/N
(0100:0000) 0. 8 = 0 duplex = half
(0080:0000) 0. 7 = 0 collision test enable
(003f:0009) 0. 5- 0 = 9 (reserved)