Skip to content

Commit c2c3846

Browse files
kylehendrydevNoltari
authored andcommitted
bmips: b53: enable bcm63268 internal PHYs
On the smartrg sr505n the bootloader only sets registers to enable the PHYs if it's interrupted. When Linux boots this results in a -EINVAL error when trying to read from the EPHYs and the GPHY doesn't work. This patch disables low power mode in the GPHY/EPHYs and properly resets the EPHYs. Signed-off-by: Kyle Hendry <[email protected]> Link: openwrt/openwrt#17648 Signed-off-by: Álvaro Fernández Rojas <[email protected]>
1 parent d11b77d commit c2c3846

File tree

5 files changed

+141
-2
lines changed

5 files changed

+141
-2
lines changed

target/linux/bmips/dts/bcm6318.dtsi

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,12 @@
260260
pins = "gpio40";
261261
};
262262
};
263+
264+
ephy_rst: reset-controller@3c {
265+
compatible = "brcm,bcm6345-reset";
266+
reg = <0x3c 0x4>;
267+
#reset-cells = <1>;
268+
};
263269
};
264270

265271
uart0: serial@10000100 {
@@ -399,6 +405,8 @@
399405
reg = <0x10080000 0x8000>;
400406
big-endian;
401407

408+
brcm,gpio-ctrl = <&gpio_cntl>;
409+
402410
ports {
403411
#address-cells = <1>;
404412
#size-cells = <0>;
@@ -431,21 +439,41 @@
431439
phy1: ethernet-phy@1 {
432440
compatible = "ethernet-phy-ieee802.3-c22";
433441
reg = <1>;
442+
443+
resets = <&ephy_rst 0>;
444+
reset-names = "phy";
445+
reset-assert-us = <2000>;
446+
reset-deassert-us = <2000>;
434447
};
435448

436449
phy2: ethernet-phy@2 {
437450
compatible = "ethernet-phy-ieee802.3-c22";
438451
reg = <2>;
452+
453+
resets = <&ephy_rst 1>;
454+
reset-names = "phy";
455+
reset-assert-us = <2000>;
456+
reset-deassert-us = <2000>;
439457
};
440458

441459
phy3: ethernet-phy@3 {
442460
compatible = "ethernet-phy-ieee802.3-c22";
443461
reg = <3>;
462+
463+
resets = <&ephy_rst 2>;
464+
reset-names = "phy";
465+
reset-assert-us = <2000>;
466+
reset-deassert-us = <2000>;
444467
};
445468

446469
phy4: ethernet-phy@4 {
447470
compatible = "ethernet-phy-ieee802.3-c22";
448471
reg = <4>;
472+
473+
resets = <&ephy_rst 3>;
474+
reset-names = "phy";
475+
reset-assert-us = <2000>;
476+
reset-deassert-us = <2000>;
449477
};
450478
};
451479

target/linux/bmips/dts/bcm63268.dtsi

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,12 @@
288288
pins = "dsl_gpio9";
289289
};
290290
};
291+
292+
ephy_rst: reset-controller@3c {
293+
compatible = "brcm,bcm6345-reset";
294+
reg = <0x3c 0x4>;
295+
#reset-cells = <1>;
296+
};
291297
};
292298

293299
uart0: serial@10000180 {
@@ -481,8 +487,7 @@
481487
<&timer_clk BCM63268_TCLK_GPHY1>;
482488

483489
resets = <&periph_rst BCM63268_RST_ENETSW>,
484-
<&periph_rst BCM63268_RST_EPHY>,
485-
<&periph_rst BCM63268_RST_GPHY>;
490+
<&periph_rst BCM63268_RST_EPHY>;
486491

487492
power-domains = <&periph_pwr BCM63268_POWER_DOMAIN_ROBOSW>;
488493

@@ -532,6 +537,8 @@
532537
reg = <0x10700000 0x8000>;
533538
big-endian;
534539

540+
brcm,gpio-ctrl = <&gpio_cntl>;
541+
535542
ports {
536543
#address-cells = <1>;
537544
#size-cells = <0>;
@@ -564,21 +571,41 @@
564571
phy1: ethernet-phy@1 {
565572
compatible = "ethernet-phy-ieee802.3-c22";
566573
reg = <1>;
574+
575+
resets = <&ephy_rst 0>;
576+
reset-names = "phy";
577+
reset-assert-us = <2000>;
578+
reset-deassert-us = <2000>;
567579
};
568580

569581
phy2: ethernet-phy@2 {
570582
compatible = "ethernet-phy-ieee802.3-c22";
571583
reg = <2>;
584+
585+
resets = <&ephy_rst 1>;
586+
reset-names = "phy";
587+
reset-assert-us = <2000>;
588+
reset-deassert-us = <2000>;
572589
};
573590

574591
phy3: ethernet-phy@3 {
575592
compatible = "ethernet-phy-ieee802.3-c22";
576593
reg = <3>;
594+
595+
resets = <&ephy_rst 2>;
596+
reset-names = "phy";
597+
reset-assert-us = <2000>;
598+
reset-deassert-us = <2000>;
577599
};
578600

579601
phy4: ethernet-phy@4 {
580602
compatible = "ethernet-phy-ieee802.3-c22";
581603
reg = <4>;
604+
605+
resets = <&periph_rst BCM63268_RST_GPHY>;
606+
reset-names = "phy";
607+
reset-assert-us = <2000>;
608+
reset-deassert-us = <2000>;
582609
};
583610
};
584611

target/linux/bmips/dts/bcm6328.dtsi

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,12 @@
248248
pins = "usb_port1";
249249
};
250250
};
251+
252+
ephy_rst: reset-controller@3c {
253+
compatible = "brcm,bcm6345-reset";
254+
reg = <0x3c 0x4>;
255+
#reset-cells = <1>;
256+
};
251257
};
252258

253259
uart0: serial@10000100 {
@@ -417,6 +423,8 @@
417423
reg = <0x10e00000 0x8000>;
418424
big-endian;
419425

426+
brcm,gpio-ctrl = <&gpio_cntl>;
427+
420428
ports {
421429
#address-cells = <1>;
422430
#size-cells = <0>;
@@ -449,21 +457,41 @@
449457
phy1: ethernet-phy@1 {
450458
compatible = "ethernet-phy-ieee802.3-c22";
451459
reg = <1>;
460+
461+
resets = <&ephy_rst 0>;
462+
reset-names = "phy";
463+
reset-assert-us = <2000>;
464+
reset-deassert-us = <2000>;
452465
};
453466

454467
phy2: ethernet-phy@2 {
455468
compatible = "ethernet-phy-ieee802.3-c22";
456469
reg = <2>;
470+
471+
resets = <&ephy_rst 1>;
472+
reset-names = "phy";
473+
reset-assert-us = <2000>;
474+
reset-deassert-us = <2000>;
457475
};
458476

459477
phy3: ethernet-phy@3 {
460478
compatible = "ethernet-phy-ieee802.3-c22";
461479
reg = <3>;
480+
481+
resets = <&ephy_rst 2>;
482+
reset-names = "phy";
483+
reset-assert-us = <2000>;
484+
reset-deassert-us = <2000>;
462485
};
463486

464487
phy4: ethernet-phy@4 {
465488
compatible = "ethernet-phy-ieee802.3-c22";
466489
reg = <4>;
490+
491+
resets = <&ephy_rst 3>;
492+
reset-names = "phy";
493+
reset-assert-us = <2000>;
494+
reset-deassert-us = <2000>;
467495
};
468496
};
469497

target/linux/bmips/dts/bcm6362.dtsi

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,12 @@
323323
pins = "nand_grp";
324324
};
325325
};
326+
327+
ephy_rst: reset-controller@3c {
328+
compatible = "brcm,bcm6345-reset";
329+
reg = <0x3c 0x4>;
330+
#reset-cells = <1>;
331+
};
326332
};
327333

328334
uart0: serial@10000100 {
@@ -526,6 +532,8 @@
526532
reg = <0x10e00000 0x8000>;
527533
big-endian;
528534

535+
brcm,gpio-ctrl = <&gpio_cntl>;
536+
529537
ports {
530538
#address-cells = <1>;
531539
#size-cells = <0>;
@@ -558,21 +566,41 @@
558566
phy1: ethernet-phy@1 {
559567
compatible = "ethernet-phy-ieee802.3-c22";
560568
reg = <1>;
569+
570+
resets = <&ephy_rst 0>;
571+
reset-names = "phy";
572+
reset-assert-us = <2000>;
573+
reset-deassert-us = <2000>;
561574
};
562575

563576
phy2: ethernet-phy@2 {
564577
compatible = "ethernet-phy-ieee802.3-c22";
565578
reg = <2>;
579+
580+
resets = <&ephy_rst 1>;
581+
reset-names = "phy";
582+
reset-assert-us = <2000>;
583+
reset-deassert-us = <2000>;
566584
};
567585

568586
phy3: ethernet-phy@3 {
569587
compatible = "ethernet-phy-ieee802.3-c22";
570588
reg = <3>;
589+
590+
resets = <&ephy_rst 2>;
591+
reset-names = "phy";
592+
reset-assert-us = <2000>;
593+
reset-deassert-us = <2000>;
571594
};
572595

573596
phy4: ethernet-phy@4 {
574597
compatible = "ethernet-phy-ieee802.3-c22";
575598
reg = <4>;
599+
600+
resets = <&ephy_rst 3>;
601+
reset-names = "phy";
602+
reset-assert-us = <2000>;
603+
reset-deassert-us = <2000>;
576604
};
577605
};
578606

target/linux/bmips/dts/bcm6368.dtsi

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,12 @@
337337
pins = "uart1_grp";
338338
};
339339
};
340+
341+
ephy_rst: reset-controller@3c {
342+
compatible = "brcm,bcm6345-reset";
343+
reg = <0x3c 0x4>;
344+
#reset-cells = <1>;
345+
};
340346
};
341347

342348
leds: led-controller@100000d0 {
@@ -528,6 +534,8 @@
528534
reg = <0x10f00000 0x8000>;
529535
big-endian;
530536

537+
brcm,gpio-ctrl = <&gpio_cntl>;
538+
531539
ports {
532540
#address-cells = <1>;
533541
#size-cells = <0>;
@@ -560,21 +568,41 @@
560568
phy1: ethernet-phy@1 {
561569
compatible = "ethernet-phy-ieee802.3-c22";
562570
reg = <1>;
571+
572+
resets = <&ephy_rst 6>;
573+
reset-names = "phy";
574+
reset-assert-us = <2000>;
575+
reset-deassert-us = <2000>;
563576
};
564577

565578
phy2: ethernet-phy@2 {
566579
compatible = "ethernet-phy-ieee802.3-c22";
567580
reg = <2>;
581+
582+
resets = <&ephy_rst 7>;
583+
reset-names = "phy";
584+
reset-assert-us = <2000>;
585+
reset-deassert-us = <2000>;
568586
};
569587

570588
phy3: ethernet-phy@3 {
571589
compatible = "ethernet-phy-ieee802.3-c22";
572590
reg = <3>;
591+
592+
resets = <&ephy_rst 8>;
593+
reset-names = "phy";
594+
reset-assert-us = <2000>;
595+
reset-deassert-us = <2000>;
573596
};
574597

575598
phy4: ethernet-phy@4 {
576599
compatible = "ethernet-phy-ieee802.3-c22";
577600
reg = <4>;
601+
602+
resets = <&ephy_rst 9>;
603+
reset-names = "phy";
604+
reset-assert-us = <2000>;
605+
reset-deassert-us = <2000>;
578606
};
579607
};
580608

0 commit comments

Comments
 (0)