Skip to contentSkip to conversation

octeontx cleanup and fixes

PATCH New Tim Harvey 4 participants 31 messages Mar 26, 2021 – Apr 29, 2021

Subsystems (2)
lore
Share & tools
lore

Tim Harvey

author
#0 lore raw

cover octeontx cleanup and fixes

This series provides the following for octeontx:
- cleanup to the octeontx common header file by moving CONFIG_SUPPORT_RAW_INITRD to defconfig files,
- adds generic distro config support
- add missing SBSA watchdog to config
- fix an issue found with QML connected to a QSGMII PHY
- fix an issue with mii probe failing to find mdio busses
- fix a crash when scanning for sata devices

These were tested on a Gateworks Newport GW6404 with the CN8030 SoC.

Suneel Garapati (1):
drivers: ata: ahci: update max id if it is more than available ports

Tim Harvey (5):
arm: octeontx: move CONFIG_SUPPORT_RAW_INITRD to configs
arm: octeontx: support generic distro config
arm: octeontx: enable WDT_SBSA
drivers: net: octeontx: fix QSGMII
net: octeontx: smi: fix mii probe

 configs/octeontx_81xx_defconfig   |  2 ++
 configs/octeontx_83xx_defconfig   |  1 +
 drivers/ata/ahci.c                |  3 +++
 drivers/net/octeontx/bgx.c        | 20 +++++++-------------
 drivers/net/octeontx/smi.c        |  2 ++
 include/configs/octeontx_common.h | 31 +++++++++++++++++++++++++------
 6 files changed, 40 insertions(+), 19 deletions(-)
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH 1/6 arm: octeontx: move CONFIG_SUPPORT_RAW_INITRD to configs

Move CONFIG_SUPPORT_RAW_INITRD out of the octeontx_common header and into the defconfig files.

---
 configs/octeontx_81xx_defconfig   | 1 +
 configs/octeontx_83xx_defconfig   | 1 +
 include/configs/octeontx_common.h | 2 --
 3 files changed, 2 insertions(+), 2 deletions(-)
configs/octeontx_81xx_defconfig +1 -0
index f0585a7488..9881c1089b 100644
@@ -17,6 +17,7 @@ CONFIG_DEBUG_UART=y
 CONFIG_AHCI=y
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
+CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOOTDELAY=5
 CONFIG_USE_BOOTARGS=y
configs/octeontx_83xx_defconfig +1 -0
index 86b4bc5190..1fc7f0cb83 100644
@@ -15,6 +15,7 @@ CONFIG_DEBUG_UART=y
 CONFIG_AHCI=y
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
+CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOOTDELAY=5
 CONFIG_USE_BOOTARGS=y
include/configs/octeontx_common.h +0 -2
index 810b2bdbd5..55d329f55e 100644
@@ -8,8 +8,6 @@
 #ifndef __OCTEONTX_COMMON_H__
 #define __OCTEONTX_COMMON_H__
 
-#define CONFIG_SUPPORT_RAW_INITRD
-
 /** Maximum size of image supported for bootm (and bootable FIT images) */
 #define CONFIG_SYS_BOOTM_LEN		(256 << 20)
 
Signature · 1 line
2.17.1
#2 lore raw

PATCH 1/6 arm: octeontx: move CONFIG_SUPPORT_RAW_INITRD to configs

Quoted 4 lines · Tim Harvey

Move CONFIG_SUPPORT_RAW_INITRD out of the octeontx_common header and into the defconfig files.

Thanks,
Stefan

Quoted 36 lines
---
  configs/octeontx_81xx_defconfig   | 1 +
  configs/octeontx_83xx_defconfig   | 1 +
  include/configs/octeontx_common.h | 2 --
  3 files changed, 2 insertions(+), 2 deletions(-)
configs/octeontx_81xx_defconfig +1 -0
index f0585a7488..9881c1089b 100644
@@ -17,6 +17,7 @@ CONFIG_DEBUG_UART=y
  CONFIG_AHCI=y
  CONFIG_FIT=y
  CONFIG_FIT_SIGNATURE=y
+CONFIG_SUPPORT_RAW_INITRD=y
  CONFIG_OF_BOARD_SETUP=y
  CONFIG_BOOTDELAY=5
  CONFIG_USE_BOOTARGS=y
configs/octeontx_83xx_defconfig +1 -0
index 86b4bc5190..1fc7f0cb83 100644
@@ -15,6 +15,7 @@ CONFIG_DEBUG_UART=y
  CONFIG_AHCI=y
  CONFIG_FIT=y
  CONFIG_FIT_SIGNATURE=y
+CONFIG_SUPPORT_RAW_INITRD=y
  CONFIG_OF_BOARD_SETUP=y
  CONFIG_BOOTDELAY=5
  CONFIG_USE_BOOTARGS=y
include/configs/octeontx_common.h +0 -0
index 810b2bdbd5..55d329f55e 100644

include/configs/octeontx_common.h line 13

Quoted 8 lines
include/configs/octeontx_common.h +0 -2
@@ -8,8 +8,6 @@
  #ifndef __OCTEONTX_COMMON_H__
  #define __OCTEONTX_COMMON_H__
 
-#define CONFIG_SUPPORT_RAW_INITRD
-
  /** Maximum size of image supported for bootm (and bootable FIT images) */
  #define CONFIG_SYS_BOOTM_LEN		(256 << 20)
 

Viele Gr??e,
Stefan

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
#3 lore raw

PATCH 1/6 arm: octeontx: move CONFIG_SUPPORT_RAW_INITRD to configs

In reply to Tim Harvey
Quoted 5 lines · Tim Harvey

Move CONFIG_SUPPORT_RAW_INITRD out of the octeontx_common header and into the defconfig files.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210420/5d73b19b/attachment.sig>
author
#4 lore raw

PATCH 2/6 arm: octeontx: support generic distro config

In reply to Tim Harvey

Support Generic Distro Default config

---
 include/configs/octeontx_common.h | 31 ++++++++++++++++++++++++++-----
 1 file changed, 26 insertions(+), 5 deletions(-)
include/configs/octeontx_common.h +26 -5
index 55d329f55e..434e54442f 100644
@@ -8,6 +8,32 @@
 #ifndef __OCTEONTX_COMMON_H__
 #define __OCTEONTX_COMMON_H__
 
+#ifdef CONFIG_DISTRO_DEFAULTS
+#define BOOT_TARGET_DEVICES(func) \
+	func(MMC, mmc, 0) \
+	func(MMC, mmc, 1) \
+	func(USB, usb, 0) \
+	func(SCSI, scsi, 0)
+
+#include <config_distro_bootcmd.h>
+/* Extra environment variables */
+#define CONFIG_EXTRA_ENV_SETTINGS	\
+	"autoload=0\0"			\
+	"loadaddr=0x20080000\0"		\
+	"kernel_addr_r=0x02000000\0"	\
+	"ramdisk_addr_r=0x03000000\0"	\
+	"scriptaddr=0x04000000\0"	\
+	BOOTENV
+
+#else
+
+/** Extra environment settings */
+#define CONFIG_EXTRA_ENV_SETTINGS	\
+	"loadaddr=20080000\0"		\
+	"autoload=0\0"
+
+#endif /* ifdef CONFIG_DISTRO_DEFAULTS*/
+
 /** Maximum size of image supported for bootm (and bootable FIT images) */
 #define CONFIG_SYS_BOOTM_LEN		(256 << 20)
 
@@ -50,11 +76,6 @@
 # define CONFIG_SF_DEFAULT_CS	0
 #endif
 
-/** Extra environment settings */
-#define CONFIG_EXTRA_ENV_SETTINGS	\
-					"loadaddr=20080000\0"	\
-					"autoload=0\0"
-
 /** Environment defines */
 #if defined(CONFIG_ENV_IS_IN_MMC)
 #define CONFIG_SYS_MMC_ENV_DEV		0
Signature · 1 line
2.17.1
#5 lore raw

PATCH 2/6 arm: octeontx: support generic distro config

Quoted 3 lines · Tim Harvey

Support Generic Distro Default config

Thanks,
Stefan

Quoted 44 lines
---
  include/configs/octeontx_common.h | 31 ++++++++++++++++++++++++++-----
  1 file changed, 26 insertions(+), 5 deletions(-)
include/configs/octeontx_common.h +26 -0
index 55d329f55e..434e54442f 100644
@@ -8,6 +8,32 @@
  #ifndef __OCTEONTX_COMMON_H__
  #define __OCTEONTX_COMMON_H__
 
+#ifdef CONFIG_DISTRO_DEFAULTS
+#define BOOT_TARGET_DEVICES(func) \
+	func(MMC, mmc, 0) \
+	func(MMC, mmc, 1) \
+	func(USB, usb, 0) \
+	func(SCSI, scsi, 0)
+
+#include <config_distro_bootcmd.h>
+/* Extra environment variables */
+#define CONFIG_EXTRA_ENV_SETTINGS	\
+	"autoload=0\0"			\
+	"loadaddr=0x20080000\0"		\
+	"kernel_addr_r=0x02000000\0"	\
+	"ramdisk_addr_r=0x03000000\0"	\
+	"scriptaddr=0x04000000\0"	\
+	BOOTENV
+
+#else
+
+/** Extra environment settings */
+#define CONFIG_EXTRA_ENV_SETTINGS	\
+	"loadaddr=20080000\0"		\
+	"autoload=0\0"
+
+#endif /* ifdef CONFIG_DISTRO_DEFAULTS*/
+
  /** Maximum size of image supported for bootm (and bootable FIT images) */
  #define CONFIG_SYS_BOOTM_LEN		(256 << 20)
 
@@ -50,11 +76,6 @@
  # define CONFIG_SF_DEFAULT_CS	0

include/configs/octeontx_common.h line 81

Quoted 10 lines
include/configs/octeontx_common.h +0 -5
  #endif
 
-/** Extra environment settings */
-#define CONFIG_EXTRA_ENV_SETTINGS	\
-					"loadaddr=20080000\0"	\
-					"autoload=0\0"
-
  /** Environment defines */
  #if defined(CONFIG_ENV_IS_IN_MMC)
  #define CONFIG_SYS_MMC_ENV_DEV		0

Viele Gr??e,
Stefan

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
#6 lore raw

PATCH 2/6 arm: octeontx: support generic distro config

In reply to Tim Harvey
Quoted 4 lines · Tim Harvey

Support Generic Distro Default config

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210420/13a9536d/attachment.sig>
author
#7 lore raw

PATCH 3/6 arm: octeontx: enable WDT_SBSA

In reply to Tim Harvey

The OcteonTX uses ARM's SBSA Watchdog device

---
 configs/octeontx_81xx_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/octeontx_81xx_defconfig +1 -0
index 9881c1089b..bcf03db406 100644
@@ -132,4 +132,5 @@ CONFIG_USB_ETHER_ASIX=y
 CONFIG_USB_ETHER_ASIX88179=y
 CONFIG_USB_ETHER_RTL8152=y
 CONFIG_WDT=y
+CONFIG_WDT_SBSA=y
 CONFIG_ERRNO_STR=y
Signature · 1 line
2.17.1
#8 lore raw

PATCH 3/6 arm: octeontx: enable WDT_SBSA

Quoted 3 lines · Tim Harvey

The OcteonTX uses ARM's SBSA Watchdog device

Thanks,
Stefan

Quoted 10 lines
---
  configs/octeontx_81xx_defconfig | 1 +
  1 file changed, 1 insertion(+)
configs/octeontx_81xx_defconfig +0 -0
index 9881c1089b..bcf03db406 100644

configs/octeontx_81xx_defconfig CONFIG_USB_ETHER_ASIX=y · line 136

Quoted 5 lines
configs/octeontx_81xx_defconfig +1 -0
@@ -132,4 +132,5 @@ CONFIG_USB_ETHER_ASIX=y
  CONFIG_USB_ETHER_ASIX88179=y
  CONFIG_USB_ETHER_RTL8152=y
  CONFIG_WDT=y
+CONFIG_WDT_SBSA=y
  CONFIG_ERRNO_STR=y

Viele Gr??e,
Stefan

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
#9 lore raw

PATCH 3/6 arm: octeontx: enable WDT_SBSA

In reply to Tim Harvey
Quoted 4 lines · Tim Harvey

The OcteonTX uses ARM's SBSA Watchdog device

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210420/10df01fc/attachment.sig>
author
#10 lore raw

PATCH 4/6 drivers: net: octeontx: fix QSGMII

In reply to Tim Harvey

Revert a change that occured between the Marvell SDK-10.1.1.0 and SDK-10.3.1.1 which broke QSMII phy support.

---
 drivers/net/octeontx/bgx.c | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)
drivers/net/octeontx/bgx.c +7 -13
index 2ea54be84d..a5c0c9fe2b 100644
@@ -36,7 +36,6 @@ struct lmac {
 	int			dmac;
 	u8			mac[6];
 	bool			link_up;
-	bool			init_pend;
 	int			lmacid; /* ID within BGX */
 	int			phy_addr; /* ID on board */
 	struct udevice		*dev;
@@ -849,6 +848,7 @@ static int bgx_lmac_enable(struct bgx *bgx, int8_t lmacid)
 	u64 cfg;
 
 	lmac = &bgx->lmac[lmacid];
+	lmac->bgx = bgx;
 
 	debug("%s: lmac: %p, lmacid = %d\n", __func__, lmac, lmacid);
 
@@ -895,16 +895,6 @@ int bgx_poll_for_link(int node, int bgx_idx, int lmacid)
 	debug("%s: %d, lmac: %d/%d/%d %p\n",
 	      __FILE__, __LINE__,
 	      node, bgx_idx, lmacid, lmac);
-	if (lmac->init_pend) {
-		ret = bgx_lmac_enable(lmac->bgx, lmacid);
-		if (ret < 0) {
-			printf("BGX%d LMAC%d lmac_enable failed\n", bgx_idx,
-			       lmacid);
-			return ret;
-		}
-		lmac->init_pend = 0;
-		mdelay(100);
-	}
 	if (lmac->qlm_mode == QLM_MODE_SGMII ||
 	    lmac->qlm_mode == QLM_MODE_RGMII ||
 	    lmac->qlm_mode == QLM_MODE_QSGMII) {
@@ -1461,6 +1451,7 @@ int octeontx_bgx_remove(struct udevice *dev)
 
 int octeontx_bgx_probe(struct udevice *dev)
 {
+	int err;
 	struct bgx *bgx = dev_get_priv(dev);
 	u8 lmac = 0;
 	int qlm[4] = {-1, -1, -1, -1};
@@ -1540,8 +1531,11 @@ skip_qlm_config:
 		struct lmac *tlmac = &bgx->lmac[lmac];
 
 		tlmac->dev = dev;
-		tlmac->init_pend = 1;
-		tlmac->bgx = bgx;
+		err = bgx_lmac_enable(bgx, lmac);
+		if (err) {
+			printf("BGX%d failed to enable lmac%d\n",
+			       bgx->bgx_id, lmac);
+		}
 	}
 
 	return 0;
Signature · 1 line
2.17.1
#11 lore raw

PATCH 4/6 drivers: net: octeontx: fix QSGMII

Quoted 4 lines · Tim Harvey

Revert a change that occured between the Marvell SDK-10.1.1.0 and SDK-10.3.1.1 which broke QSMII phy support.

Thanks.

Suneel, do you have a comment on this? Is this revert the "best way" to handle this?

Thanks,
Stefan

Quoted 54 lines
---
  drivers/net/octeontx/bgx.c | 20 +++++++-------------
  1 file changed, 7 insertions(+), 13 deletions(-)
drivers/net/octeontx/bgx.c +2 -11
index 2ea54be84d..a5c0c9fe2b 100644
@@ -36,7 +36,6 @@ struct lmac {
  	int			dmac;
  	u8			mac[6];
  	bool			link_up;
-	bool			init_pend;
  	int			lmacid; /* ID within BGX */
  	int			phy_addr; /* ID on board */
  	struct udevice		*dev;
@@ -849,6 +848,7 @@ static int bgx_lmac_enable(struct bgx *bgx, int8_t lmacid)
  	u64 cfg;
 
  	lmac = &bgx->lmac[lmacid];
+	lmac->bgx = bgx;
 
  	debug("%s: lmac: %p, lmacid = %d\n", __func__, lmac, lmacid);
 
@@ -895,16 +895,6 @@ int bgx_poll_for_link(int node, int bgx_idx, int lmacid)
  	debug("%s: %d, lmac: %d/%d/%d %p\n",
  	      __FILE__, __LINE__,
  	      node, bgx_idx, lmacid, lmac);
-	if (lmac->init_pend) {
-		ret = bgx_lmac_enable(lmac->bgx, lmacid);
-		if (ret < 0) {
-			printf("BGX%d LMAC%d lmac_enable failed\n", bgx_idx,
-			       lmacid);
-			return ret;
-		}
-		lmac->init_pend = 0;
-		mdelay(100);
-	}
  	if (lmac->qlm_mode == QLM_MODE_SGMII ||
  	    lmac->qlm_mode == QLM_MODE_RGMII ||
  	    lmac->qlm_mode == QLM_MODE_QSGMII) {
@@ -1461,6 +1451,7 @@ int octeontx_bgx_remove(struct udevice *dev)
 
  int octeontx_bgx_probe(struct udevice *dev)
  {
+	int err;
  	struct bgx *bgx = dev_get_priv(dev);
  	u8 lmac = 0;
  	int qlm[4] = {-1, -1, -1, -1};
@@ -1540,8 +1531,11 @@ skip_qlm_config:
  		struct lmac *tlmac = &bgx->lmac[lmac];
 
  		tlmac->dev = dev;

drivers/net/octeontx/bgx.c skip_qlm_config: · line 1541

Quoted 10 lines
drivers/net/octeontx/bgx.c +5 -2
-		tlmac->init_pend = 1;
-		tlmac->bgx = bgx;
+		err = bgx_lmac_enable(bgx, lmac);
+		if (err) {
+			printf("BGX%d failed to enable lmac%d\n",
+			       bgx->bgx_id, lmac);
+		}
  	}
 
  	return 0;

Viele Gr??e,
Stefan

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
#12 lore raw

PATCH 4/6 drivers: net: octeontx: fix QSGMII

This looks like a workaround than the root cause fix.
As this patch just moves the bringup of link from probe stage to on-demand.

Quoted 88 lines · Stefan Roese
Quoted 4 lines · Tim Harvey

Revert a change that occured between the Marvell SDK-10.1.1.0 and SDK-10.3.1.1 which broke QSMII phy support.

Thanks.

Suneel, do you have a comment on this? Is this revert the "best way" to handle this?

Thanks,
Stefan

Quoted 54 lines
---
  drivers/net/octeontx/bgx.c | 20 +++++++-------------
  1 file changed, 7 insertions(+), 13 deletions(-)
drivers/net/octeontx/bgx.c +2 -11
index 2ea54be84d..a5c0c9fe2b 100644
@@ -36,7 +36,6 @@ struct lmac {
      int                     dmac;
      u8                      mac[6];
      bool                    link_up;
-     bool                    init_pend;
      int                     lmacid; /* ID within BGX */
      int                     phy_addr; /* ID on board */
      struct udevice          *dev;
@@ -849,6 +848,7 @@ static int bgx_lmac_enable(struct bgx *bgx, int8_t lmacid)
      u64 cfg;
 
      lmac = &bgx->lmac[lmacid];
+     lmac->bgx = bgx;
 
      debug("%s: lmac: %p, lmacid = %d\n", __func__, lmac, lmacid);
 
@@ -895,16 +895,6 @@ int bgx_poll_for_link(int node, int bgx_idx, int lmacid)
      debug("%s: %d, lmac: %d/%d/%d %p\n",
            __FILE__, __LINE__,
            node, bgx_idx, lmacid, lmac);
-     if (lmac->init_pend) {
-             ret = bgx_lmac_enable(lmac->bgx, lmacid);
-             if (ret < 0) {
-                     printf("BGX%d LMAC%d lmac_enable failed\n", bgx_idx,
-                            lmacid);
-                     return ret;
-             }
-             lmac->init_pend = 0;
-             mdelay(100);
-     }
      if (lmac->qlm_mode == QLM_MODE_SGMII ||
          lmac->qlm_mode == QLM_MODE_RGMII ||
          lmac->qlm_mode == QLM_MODE_QSGMII) {
@@ -1461,6 +1451,7 @@ int octeontx_bgx_remove(struct udevice *dev)
 
  int octeontx_bgx_probe(struct udevice *dev)
  {
+     int err;
      struct bgx *bgx = dev_get_priv(dev);
      u8 lmac = 0;
      int qlm[4] = {-1, -1, -1, -1};
@@ -1540,8 +1531,11 @@ skip_qlm_config:
              struct lmac *tlmac = &bgx->lmac[lmac];
 
              tlmac->dev = dev;

drivers/net/octeontx/bgx.c skip_qlm_config: · line 1541

Quoted 10 lines
drivers/net/octeontx/bgx.c +5 -2
-             tlmac->init_pend = 1;
-             tlmac->bgx = bgx;
+             err = bgx_lmac_enable(bgx, lmac);
+             if (err) {
+                     printf("BGX%d failed to enable lmac%d\n",
+                            bgx->bgx_id, lmac);
+             }
      }
 
      return 0;

Viele Gr??e,
Stefan

--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de

author
#13 lore raw

PATCH 4/6 drivers: net: octeontx: fix QSGMII

Quoted 85 lines · Suneel Garapati

This looks like a workaround than the root cause fix.
As this patch just moves the bringup of link from probe stage to on-demand.

Quoted 80 lines · Stefan Roese
Quoted 4 lines · Tim Harvey

Revert a change that occured between the Marvell SDK-10.1.1.0 and SDK-10.3.1.1 which broke QSMII phy support.

Thanks.

Suneel, do you have a comment on this? Is this revert the "best way" to handle this?

Thanks,
Stefan

Quoted 64 lines
---
  drivers/net/octeontx/bgx.c | 20 +++++++-------------
  1 file changed, 7 insertions(+), 13 deletions(-)
drivers/net/octeontx/bgx.c +7 -13
index 2ea54be84d..a5c0c9fe2b 100644
@@ -36,7 +36,6 @@ struct lmac {
      int                     dmac;
      u8                      mac[6];
      bool                    link_up;
-     bool                    init_pend;
      int                     lmacid; /* ID within BGX */
      int                     phy_addr; /* ID on board */
      struct udevice          *dev;
@@ -849,6 +848,7 @@ static int bgx_lmac_enable(struct bgx *bgx, int8_t lmacid)
      u64 cfg;
 
      lmac = &bgx->lmac[lmacid];
+     lmac->bgx = bgx;
 
      debug("%s: lmac: %p, lmacid = %d\n", __func__, lmac, lmacid);
 
@@ -895,16 +895,6 @@ int bgx_poll_for_link(int node, int bgx_idx, int lmacid)
      debug("%s: %d, lmac: %d/%d/%d %p\n",
            __FILE__, __LINE__,
            node, bgx_idx, lmacid, lmac);
-     if (lmac->init_pend) {
-             ret = bgx_lmac_enable(lmac->bgx, lmacid);
-             if (ret < 0) {
-                     printf("BGX%d LMAC%d lmac_enable failed\n", bgx_idx,
-                            lmacid);
-                     return ret;
-             }
-             lmac->init_pend = 0;
-             mdelay(100);
-     }
      if (lmac->qlm_mode == QLM_MODE_SGMII ||
          lmac->qlm_mode == QLM_MODE_RGMII ||
          lmac->qlm_mode == QLM_MODE_QSGMII) {
@@ -1461,6 +1451,7 @@ int octeontx_bgx_remove(struct udevice *dev)
 
  int octeontx_bgx_probe(struct udevice *dev)
  {
+     int err;
      struct bgx *bgx = dev_get_priv(dev);
      u8 lmac = 0;
      int qlm[4] = {-1, -1, -1, -1};
@@ -1540,8 +1531,11 @@ skip_qlm_config:
              struct lmac *tlmac = &bgx->lmac[lmac];
 
              tlmac->dev = dev;
-             tlmac->init_pend = 1;
-             tlmac->bgx = bgx;
+             err = bgx_lmac_enable(bgx, lmac);
+             if (err) {
+                     printf("BGX%d failed to enable lmac%d\n",
+                            bgx->bgx_id, lmac);
+             }
      }
 
      return 0;

Suneel,

I agree, it is a workaround and I don't quite understand the reason.

Can you look into the code history of the SDK BDK and see what the reason was for introducing this 'pending' state that defers the bgx_lmac_enable call that breaks QSGMII? That specific change was made between SDK-10.1.1.0 and SDK-10.3.1.1.

What boards and PHY's have you tested octeontx BGX with?

I have the following boards to test with that we designed and support:
- GW630x: supports both RGMII and SGMII GbE PHY's
- GW640x: supports both RGMII and QSGMII GbE PHy's

The only issue I have that is worked around by the above is QSGMII.

Best regards,

Tim

#14 lore raw

PATCH 4/6 drivers: net: octeontx: fix QSGMII

+ Chandra

Quoted 108 lines · Tim Harvey
Quoted 85 lines · Suneel Garapati

This looks like a workaround than the root cause fix.
As this patch just moves the bringup of link from probe stage to on-demand.

Quoted 80 lines · Stefan Roese
Quoted 4 lines · Tim Harvey

Revert a change that occured between the Marvell SDK-10.1.1.0 and SDK-10.3.1.1 which broke QSMII phy support.

Thanks.

Suneel, do you have a comment on this? Is this revert the "best way" to handle this?

Thanks,
Stefan

Quoted 64 lines
---
  drivers/net/octeontx/bgx.c | 20 +++++++-------------
  1 file changed, 7 insertions(+), 13 deletions(-)
drivers/net/octeontx/bgx.c +7 -13
index 2ea54be84d..a5c0c9fe2b 100644
@@ -36,7 +36,6 @@ struct lmac {
      int                     dmac;
      u8                      mac[6];
      bool                    link_up;
-     bool                    init_pend;
      int                     lmacid; /* ID within BGX */
      int                     phy_addr; /* ID on board */
      struct udevice          *dev;
@@ -849,6 +848,7 @@ static int bgx_lmac_enable(struct bgx *bgx, int8_t lmacid)
      u64 cfg;
 
      lmac = &bgx->lmac[lmacid];
+     lmac->bgx = bgx;
 
      debug("%s: lmac: %p, lmacid = %d\n", __func__, lmac, lmacid);
 
@@ -895,16 +895,6 @@ int bgx_poll_for_link(int node, int bgx_idx, int lmacid)
      debug("%s: %d, lmac: %d/%d/%d %p\n",
            __FILE__, __LINE__,
            node, bgx_idx, lmacid, lmac);
-     if (lmac->init_pend) {
-             ret = bgx_lmac_enable(lmac->bgx, lmacid);
-             if (ret < 0) {
-                     printf("BGX%d LMAC%d lmac_enable failed\n", bgx_idx,
-                            lmacid);
-                     return ret;
-             }
-             lmac->init_pend = 0;
-             mdelay(100);
-     }
      if (lmac->qlm_mode == QLM_MODE_SGMII ||
          lmac->qlm_mode == QLM_MODE_RGMII ||
          lmac->qlm_mode == QLM_MODE_QSGMII) {
@@ -1461,6 +1451,7 @@ int octeontx_bgx_remove(struct udevice *dev)
 
  int octeontx_bgx_probe(struct udevice *dev)
  {
+     int err;
      struct bgx *bgx = dev_get_priv(dev);
      u8 lmac = 0;
      int qlm[4] = {-1, -1, -1, -1};
@@ -1540,8 +1531,11 @@ skip_qlm_config:
              struct lmac *tlmac = &bgx->lmac[lmac];
 
              tlmac->dev = dev;
-             tlmac->init_pend = 1;
-             tlmac->bgx = bgx;
+             err = bgx_lmac_enable(bgx, lmac);
+             if (err) {
+                     printf("BGX%d failed to enable lmac%d\n",
+                            bgx->bgx_id, lmac);
+             }
      }
 
      return 0;

Suneel,

I agree, it is a workaround and I don't quite understand the reason.

Can you look into the code history of the SDK BDK and see what the reason was for introducing this 'pending' state that defers the bgx_lmac_enable call that breaks QSGMII? That specific change was made between SDK-10.1.1.0 and SDK-10.3.1.1.

What boards and PHY's have you tested octeontx BGX with?

I have the following boards to test with that we designed and support:
- GW630x: supports both RGMII and SGMII GbE PHY's
- GW640x: supports both RGMII and QSGMII GbE PHy's

The only issue I have that is worked around by the above is QSGMII.

Best regards,

Tim

author
#15 lore raw

PATCH 4/6 drivers: net: octeontx: fix QSGMII

Quoted 109 lines · Suneel Garapati

+ Chandra

Quoted 105 lines · Tim Harvey
Quoted 85 lines · Suneel Garapati

This looks like a workaround than the root cause fix.
As this patch just moves the bringup of link from probe stage to on-demand.

Quoted 80 lines · Stefan Roese
Quoted 4 lines · Tim Harvey

Revert a change that occured between the Marvell SDK-10.1.1.0 and SDK-10.3.1.1 which broke QSMII phy support.

Thanks.

Suneel, do you have a comment on this? Is this revert the "best way" to handle this?

Thanks,
Stefan

Quoted 64 lines
---
  drivers/net/octeontx/bgx.c | 20 +++++++-------------
  1 file changed, 7 insertions(+), 13 deletions(-)
drivers/net/octeontx/bgx.c +7 -13
index 2ea54be84d..a5c0c9fe2b 100644
@@ -36,7 +36,6 @@ struct lmac {
      int                     dmac;
      u8                      mac[6];
      bool                    link_up;
-     bool                    init_pend;
      int                     lmacid; /* ID within BGX */
      int                     phy_addr; /* ID on board */
      struct udevice          *dev;
@@ -849,6 +848,7 @@ static int bgx_lmac_enable(struct bgx *bgx, int8_t lmacid)
      u64 cfg;
 
      lmac = &bgx->lmac[lmacid];
+     lmac->bgx = bgx;
 
      debug("%s: lmac: %p, lmacid = %d\n", __func__, lmac, lmacid);
 
@@ -895,16 +895,6 @@ int bgx_poll_for_link(int node, int bgx_idx, int lmacid)
      debug("%s: %d, lmac: %d/%d/%d %p\n",
            __FILE__, __LINE__,
            node, bgx_idx, lmacid, lmac);
-     if (lmac->init_pend) {
-             ret = bgx_lmac_enable(lmac->bgx, lmacid);
-             if (ret < 0) {
-                     printf("BGX%d LMAC%d lmac_enable failed\n", bgx_idx,
-                            lmacid);
-                     return ret;
-             }
-             lmac->init_pend = 0;
-             mdelay(100);
-     }
      if (lmac->qlm_mode == QLM_MODE_SGMII ||
          lmac->qlm_mode == QLM_MODE_RGMII ||
          lmac->qlm_mode == QLM_MODE_QSGMII) {
@@ -1461,6 +1451,7 @@ int octeontx_bgx_remove(struct udevice *dev)
 
  int octeontx_bgx_probe(struct udevice *dev)
  {
+     int err;
      struct bgx *bgx = dev_get_priv(dev);
      u8 lmac = 0;
      int qlm[4] = {-1, -1, -1, -1};
@@ -1540,8 +1531,11 @@ skip_qlm_config:
              struct lmac *tlmac = &bgx->lmac[lmac];
 
              tlmac->dev = dev;
-             tlmac->init_pend = 1;
-             tlmac->bgx = bgx;
+             err = bgx_lmac_enable(bgx, lmac);
+             if (err) {
+                     printf("BGX%d failed to enable lmac%d\n",
+                            bgx->bgx_id, lmac);
+             }
      }
 
      return 0;

Suneel,

I agree, it is a workaround and I don't quite understand the reason.

Can you look into the code history of the SDK BDK and see what the reason was for introducing this 'pending' state that defers the bgx_lmac_enable call that breaks QSGMII? That specific change was made between SDK-10.1.1.0 and SDK-10.3.1.1.

What boards and PHY's have you tested octeontx BGX with?

I have the following boards to test with that we designed and support:
- GW630x: supports both RGMII and SGMII GbE PHY's
- GW640x: supports both RGMII and QSGMII GbE PHy's

The only issue I have that is worked around by the above is QSGMII.

Sunell / Chandrakala,

Any comments here about what PHY's you have tested octeontx BGX with and what the reasoning was for the code change here between Marvell SDK-10.1.1.0 and SDK-10.3.1.1?

Tim

#16 lore raw

PATCH 4/6 drivers: net: octeontx: fix QSGMII

In reply to Tim Harvey
Quoted 4 lines · Tim Harvey

Revert a change that occured between the Marvell SDK-10.1.1.0 and SDK-10.3.1.1 which broke QSMII phy support.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210420/40025a25/attachment.sig>
author
#17 lore raw

PATCH 5/6 drivers: ata: ahci: update max id if it is more than available ports

In reply to Tim Harvey

From: Suneel Garapati <[email protected]>

After check for maximum between max id and available ports, also check if available port count is less than max id and update.

In the case of the CN8030 OcteonTX SoC max_id needs to be reduced to the number of ports found otherwise the following occurs on a scan:

GW6404-B> scsi scan
scanning bus for devices...
Target spinup took 0 ms.
AHCI 0001.0300 32 slots 1 ports 6 Gbps 0x1 impl SATA mode
flags: 64bit ncq ilck stag pm led clo only pmp fbss pio slum part ccc apst
Device 0: (0:0) Vendor: ATA Prod.: SanDisk SD8SFAT0 Rev: Z233
Type: Hard Disk
Capacity: 61057.3 MB = 59.6 GB (125045424 x 512)
"Synchronous Abort" handler, esr 0x96000006
elr: 000000000052f824 lr : 000000000052fa10 (reloc)
elr: 000000007fee9824 lr : 000000007fee9a10
x0 : 0000000000000001 x1 : 0000000000000001
x2 : 000000007bea3528 x3 : 000000007bea3580
x4 : 0000000000000200 x5 : 0000000000000000
x6 : 0000000000000002 x7 : 000000007bea3540
x8 : 00000000fffffff8 x9 : 0000000000000008
x10: 00000000000186a0 x11: 000000000000000d
x12: 0000000000000006 x13: 000000000001869f
x14: 0000000000000007 x15: 00000000ffffffff
x16: 000000007ff439a5 x17: 000000007ff5730c
x18: 000000007bea9de0 x19: 000000007ff7a580
x20: 000000007bec79f8 x21: 0000000000000000
x22: 000000007bea3580 x23: 0000000000000000
x24: 0000000000000000 x25: 000000007bec7a00
x26: 00000000ffffffc0 x27: 000000007bec79d0
x28: 000000007beb51c0 x29: 000000007bea3480

Code: 91246800 940130c2 12800000 1400004f (b9402ae0)

Resetting CPU ...

---
 drivers/ata/ahci.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/ata/ahci.c +3 -0
index 2ef21ec508..98b288254b 100644
@@ -1190,6 +1190,9 @@ int ahci_probe_scsi(struct udevice *ahci_dev, ulong base)
 	 */
 	uc_plat->max_id = max_t(unsigned long, uc_priv->n_ports,
 				uc_plat->max_id);
+	/* If port count is less than max_id, update max_id */
+	if (uc_priv->n_ports < uc_plat->max_id)
+		uc_plat->max_id = uc_priv->n_ports;
 
 	return 0;
 }
Signature · 1 line
2.17.1
#18 lore raw

PATCH 5/6 drivers: ata: ahci: update max id if it is more than available ports

Quoted 36 lines · Tim Harvey

From: Suneel Garapati <[email protected]>

After check for maximum between max id and available ports, also check if available port count is less than max id and update.

In the case of the CN8030 OcteonTX SoC max_id needs to be reduced to the number of ports found otherwise the following occurs on a scan:

GW6404-B> scsi scan
scanning bus for devices...
Target spinup took 0 ms.
AHCI 0001.0300 32 slots 1 ports 6 Gbps 0x1 impl SATA mode
flags: 64bit ncq ilck stag pm led clo only pmp fbss pio slum part ccc apst
Device 0: (0:0) Vendor: ATA Prod.: SanDisk SD8SFAT0 Rev: Z233
Type: Hard Disk
Capacity: 61057.3 MB = 59.6 GB (125045424 x 512)
"Synchronous Abort" handler, esr 0x96000006
elr: 000000000052f824 lr : 000000000052fa10 (reloc)
elr: 000000007fee9824 lr : 000000007fee9a10
x0 : 0000000000000001 x1 : 0000000000000001
x2 : 000000007bea3528 x3 : 000000007bea3580
x4 : 0000000000000200 x5 : 0000000000000000
x6 : 0000000000000002 x7 : 000000007bea3540
x8 : 00000000fffffff8 x9 : 0000000000000008
x10: 00000000000186a0 x11: 000000000000000d
x12: 0000000000000006 x13: 000000000001869f
x14: 0000000000000007 x15: 00000000ffffffff
x16: 000000007ff439a5 x17: 000000007ff5730c
x18: 000000007bea9de0 x19: 000000007ff7a580
x20: 000000007bec79f8 x21: 0000000000000000
x22: 000000007bea3580 x23: 0000000000000000
x24: 0000000000000000 x25: 000000007bec7a00
x26: 00000000ffffffc0 x27: 000000007bec79d0
x28: 000000007beb51c0 x29: 000000007bea3480

Quoted 4 lines
Code: 91246800 940130c2 12800000 1400004f (b9402ae0)

Resetting CPU ...

Thanks,
Stefan

Quoted 10 lines
---
  drivers/ata/ahci.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/ata/ahci.c +0 -0
index 2ef21ec508..98b288254b 100644

drivers/ata/ahci.c int ahci_probe_scsi(struct udevice *ahci_dev, ulong base) · line 1198

Quoted 9 lines
drivers/ata/ahci.c +3 -0
@@ -1190,6 +1190,9 @@ int ahci_probe_scsi(struct udevice *ahci_dev, ulong base)
  	 */
  	uc_plat->max_id = max_t(unsigned long, uc_priv->n_ports,
  				uc_plat->max_id);
+	/* If port count is less than max_id, update max_id */
+	if (uc_priv->n_ports < uc_plat->max_id)
+		uc_plat->max_id = uc_priv->n_ports;
 
  	return 0;
  }

Viele Gr??e,
Stefan

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
#19 lore raw

PATCH 5/6 drivers: ata: ahci: update max id if it is more than available ports

In reply to Tim Harvey
Quoted 36 lines · Tim Harvey

From: Suneel Garapati <[email protected]>

After check for maximum between max id and available ports, also check if available port count is less than max id and update.

In the case of the CN8030 OcteonTX SoC max_id needs to be reduced to the number of ports found otherwise the following occurs on a scan:

GW6404-B> scsi scan
scanning bus for devices...
Target spinup took 0 ms.
AHCI 0001.0300 32 slots 1 ports 6 Gbps 0x1 impl SATA mode
flags: 64bit ncq ilck stag pm led clo only pmp fbss pio slum part ccc apst
Device 0: (0:0) Vendor: ATA Prod.: SanDisk SD8SFAT0 Rev: Z233
Type: Hard Disk
Capacity: 61057.3 MB = 59.6 GB (125045424 x 512)
"Synchronous Abort" handler, esr 0x96000006
elr: 000000000052f824 lr : 000000000052fa10 (reloc)
elr: 000000007fee9824 lr : 000000007fee9a10
x0 : 0000000000000001 x1 : 0000000000000001
x2 : 000000007bea3528 x3 : 000000007bea3580
x4 : 0000000000000200 x5 : 0000000000000000
x6 : 0000000000000002 x7 : 000000007bea3540
x8 : 00000000fffffff8 x9 : 0000000000000008
x10: 00000000000186a0 x11: 000000000000000d
x12: 0000000000000006 x13: 000000000001869f
x14: 0000000000000007 x15: 00000000ffffffff
x16: 000000007ff439a5 x17: 000000007ff5730c
x18: 000000007bea9de0 x19: 000000007ff7a580
x20: 000000007bec79f8 x21: 0000000000000000
x22: 000000007bea3580 x23: 0000000000000000
x24: 0000000000000000 x25: 000000007bec7a00
x26: 00000000ffffffc0 x27: 000000007bec79d0
x28: 000000007beb51c0 x29: 000000007bea3480

Quoted 5 lines
Code: 91246800 940130c2 12800000 1400004f (b9402ae0)

Resetting CPU ...

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210420/a43d3b11/attachment.sig>
author
#20 lore raw

PATCH 6/6 net: octeontx: smi: fix mii probe

In reply to Tim Harvey

The fdt node offset is apparently not set properly when probed causing no MDIO busses to be found. Fix this by obtaining the offset.

---
 drivers/net/octeontx/smi.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/octeontx/smi.c +2 -0
index 91dcd05e4b..27f4423c6a 100644
@@ -325,6 +325,8 @@ int octeontx_smi_probe(struct udevice *dev)
 		return -1;
 	}
 
+	node = fdt_node_offset_by_compatible(gd->fdt_blob, -1,
+					     "cavium,thunder-8890-mdio-nexus");
 	fdt_for_each_subnode(subnode, gd->fdt_blob, node) {
 		ret = fdt_node_check_compatible(gd->fdt_blob, subnode,
 						"cavium,thunder-8890-mdio");
Signature · 1 line
2.17.1
#21 lore raw

PATCH 6/6 net: octeontx: smi: fix mii probe

Quoted 5 lines · Tim Harvey

The fdt node offset is apparently not set properly when probed causing no MDIO busses to be found. Fix this by obtaining the offset.

Thanks,
Stefan

Quoted 10 lines
---
  drivers/net/octeontx/smi.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/net/octeontx/smi.c +0 -0
index 91dcd05e4b..27f4423c6a 100644

drivers/net/octeontx/smi.c int octeontx_smi_probe(struct udevice *dev) · line 332

Quoted 8 lines
drivers/net/octeontx/smi.c +2 -0
@@ -325,6 +325,8 @@ int octeontx_smi_probe(struct udevice *dev)
  		return -1;
  	}
 
+	node = fdt_node_offset_by_compatible(gd->fdt_blob, -1,
+					     "cavium,thunder-8890-mdio-nexus");
  	fdt_for_each_subnode(subnode, gd->fdt_blob, node) {
  		ret = fdt_node_check_compatible(gd->fdt_blob, subnode,
  						"cavium,thunder-8890-mdio");

Viele Gr??e,
Stefan

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
author
#22 lore raw

PATCH 6/6 net: octeontx: smi: fix mii probe

Quoted 25 lines · Stefan Roese
Quoted 5 lines · Tim Harvey

The fdt node offset is apparently not set properly when probed causing no MDIO busses to be found. Fix this by obtaining the offset.

Thanks,
Stefan

Quoted 12 lines
---
  drivers/net/octeontx/smi.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/net/octeontx/smi.c +0 -0
index 91dcd05e4b..27f4423c6a 100644
@@ -325,6 +325,8 @@ int octeontx_smi_probe(struct udevice *dev)
              return -1;
      }
 
Quoted 6 lines

drivers/net/octeontx/smi.c int octeontx_smi_probe(struct udevice *dev) · line 332

Quoted 6 lines
drivers/net/octeontx/smi.c +2 -0
+     node = fdt_node_offset_by_compatible(gd->fdt_blob, -1,
+                                          "cavium,thunder-8890-mdio-nexus");
      fdt_for_each_subnode(subnode, gd->fdt_blob, node) {
              ret = fdt_node_check_compatible(gd->fdt_blob, subnode,
                                              "cavium,thunder-8890-mdio");

Honestly this is the wrong fix for this issue and I'm hoping someone could educate me. I'm a bit confused at why there are several ways to work with dt (int offsets vs ofnodes which are unions of int offsets and node pointers???).

The above patch was not needed previously so something changed in the ofnode field of struct udevice between v2019.10 and v2021.01.

Simon, could you explain what the proper way to work with dev->ofnode in probe functions is to loop over subnodes?

Best regards,

Tim

#23 lore raw

PATCH 6/6 net: octeontx: smi: fix mii probe

Probably switch to Live tree API is needed like below.

        ofnode_for_each_subnode(subnode, dev_ofnode(dev)) {
                ret = ofnode_device_is_compatible(subnode,
                                                  "cavium,thunder-8890-mdio");

Regards,
Suneel

Quoted 48 lines · Tim Harvey
Quoted 25 lines · Stefan Roese
Quoted 5 lines · Tim Harvey

The fdt node offset is apparently not set properly when probed causing no MDIO busses to be found. Fix this by obtaining the offset.

Thanks,
Stefan

Quoted 12 lines
---
  drivers/net/octeontx/smi.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/net/octeontx/smi.c +0 -0
index 91dcd05e4b..27f4423c6a 100644
@@ -325,6 +325,8 @@ int octeontx_smi_probe(struct udevice *dev)
              return -1;
      }
 
Quoted 6 lines

drivers/net/octeontx/smi.c int octeontx_smi_probe(struct udevice *dev) · line 332

Quoted 6 lines
drivers/net/octeontx/smi.c +2 -0
+     node = fdt_node_offset_by_compatible(gd->fdt_blob, -1,
+                                          "cavium,thunder-8890-mdio-nexus");
      fdt_for_each_subnode(subnode, gd->fdt_blob, node) {
              ret = fdt_node_check_compatible(gd->fdt_blob, subnode,
                                              "cavium,thunder-8890-mdio");

Honestly this is the wrong fix for this issue and I'm hoping someone could educate me. I'm a bit confused at why there are several ways to work with dt (int offsets vs ofnodes which are unions of int offsets and node pointers???).

The above patch was not needed previously so something changed in the ofnode field of struct udevice between v2019.10 and v2021.01.

Simon, could you explain what the proper way to work with dev->ofnode in probe functions is to loop over subnodes?

Best regards,

Tim

#24 lore raw

PATCH 6/6 net: octeontx: smi: fix mii probe

In reply to Tim Harvey

Hi Tim,

Quoted 38 lines · Tim Harvey
Quoted 25 lines · Stefan Roese
Quoted 5 lines · Tim Harvey

The fdt node offset is apparently not set properly when probed causing no MDIO busses to be found. Fix this by obtaining the offset.

Thanks,
Stefan

Quoted 12 lines
---
   drivers/net/octeontx/smi.c | 2 ++
   1 file changed, 2 insertions(+)
drivers/net/octeontx/smi.c +0 -0
index 91dcd05e4b..27f4423c6a 100644
@@ -325,6 +325,8 @@ int octeontx_smi_probe(struct udevice *dev)
               return -1;
       }
 
Quoted 6 lines

drivers/net/octeontx/smi.c int octeontx_smi_probe(struct udevice *dev) · line 332

Quoted 6 lines
drivers/net/octeontx/smi.c +2 -0
+     node = fdt_node_offset_by_compatible(gd->fdt_blob, -1,
+                                          "cavium,thunder-8890-mdio-nexus");
       fdt_for_each_subnode(subnode, gd->fdt_blob, node) {
               ret = fdt_node_check_compatible(gd->fdt_blob, subnode,
                                               "cavium,thunder-8890-mdio");

Honestly this is the wrong fix for this issue and I'm hoping someone could educate me. I'm a bit confused at why there are several ways to work with dt (int offsets vs ofnodes which are unions of int offsets and node pointers???).

Quoted 5 lines

The above patch was not needed previously so something changed in the ofnode field of struct udevice between v2019.10 and v2021.01.

Simon, could you explain what the proper way to work with dev->ofnode in probe functions is to loop over subnodes?

This version is in mainline now. Tim, could you please re-visit this and perhaps switch to using live tree API, as suggested by Suneel:

	ofnode_for_each_subnode(subnode, dev_ofnode(dev)) {
		ret = ofnode_device_is_compatible(subnode,
			"cavium,thunder-8890-mdio");

Thanks,
Stefan

author
#25 lore raw

PATCH 6/6 net: octeontx: smi: fix mii probe

Quoted 48 lines · Stefan Roese

Hi Tim,

Quoted 38 lines · Tim Harvey
Quoted 25 lines · Stefan Roese
Quoted 5 lines · Tim Harvey

The fdt node offset is apparently not set properly when probed causing no MDIO busses to be found. Fix this by obtaining the offset.

Thanks,
Stefan

Quoted 12 lines
---
   drivers/net/octeontx/smi.c | 2 ++
   1 file changed, 2 insertions(+)
drivers/net/octeontx/smi.c +0 -0
index 91dcd05e4b..27f4423c6a 100644
@@ -325,6 +325,8 @@ int octeontx_smi_probe(struct udevice *dev)
               return -1;
       }
 
Quoted 6 lines

drivers/net/octeontx/smi.c int octeontx_smi_probe(struct udevice *dev) · line 332

Quoted 6 lines
drivers/net/octeontx/smi.c +2 -0
+     node = fdt_node_offset_by_compatible(gd->fdt_blob, -1,
+                                          "cavium,thunder-8890-mdio-nexus");
       fdt_for_each_subnode(subnode, gd->fdt_blob, node) {
               ret = fdt_node_check_compatible(gd->fdt_blob, subnode,
                                               "cavium,thunder-8890-mdio");

Honestly this is the wrong fix for this issue and I'm hoping someone could educate me. I'm a bit confused at why there are several ways to work with dt (int offsets vs ofnodes which are unions of int offsets and node pointers???).

Quoted 5 lines

The above patch was not needed previously so something changed in the ofnode field of struct udevice between v2019.10 and v2021.01.

Simon, could you explain what the proper way to work with dev->ofnode in probe functions is to loop over subnodes?

Quoted 7 lines

This version is in mainline now. Tim, could you please re-visit this and perhaps switch to using live tree API, as suggested by Suneel:

        ofnode_for_each_subnode(subnode, dev_ofnode(dev)) {
                ret = ofnode_device_is_compatible(subnode,
                        "cavium,thunder-8890-mdio");

Stefan,

Yes, I can submit this but I would really like to understand the original issue. Do you or Simon perhaps know why the fdt node offset in dev passed to probe is wrong? It's not null but it does not appear to point to a device-tree (or perhaps I was using the wrong functions on it not fully understanding the current state of this live tree API).

Best regards,

Tim

#26 lore raw

PATCH 6/6 net: octeontx: smi: fix mii probe

Hi Tim,

Quoted 57 lines · Tim Harvey
Quoted 48 lines · Stefan Roese

Hi Tim,

Quoted 38 lines · Tim Harvey
Quoted 25 lines · Stefan Roese
Quoted 5 lines · Tim Harvey

The fdt node offset is apparently not set properly when probed causing no MDIO busses to be found. Fix this by obtaining the offset.

Thanks,
Stefan

Quoted 12 lines
---
    drivers/net/octeontx/smi.c | 2 ++
    1 file changed, 2 insertions(+)
drivers/net/octeontx/smi.c +0 -0
index 91dcd05e4b..27f4423c6a 100644
@@ -325,6 +325,8 @@ int octeontx_smi_probe(struct udevice *dev)
                return -1;
        }
 
Quoted 6 lines

drivers/net/octeontx/smi.c int octeontx_smi_probe(struct udevice *dev) · line 332

Quoted 6 lines
drivers/net/octeontx/smi.c +2 -0
+     node = fdt_node_offset_by_compatible(gd->fdt_blob, -1,
+                                          "cavium,thunder-8890-mdio-nexus");
        fdt_for_each_subnode(subnode, gd->fdt_blob, node) {
                ret = fdt_node_check_compatible(gd->fdt_blob, subnode,
                                                "cavium,thunder-8890-mdio");

Honestly this is the wrong fix for this issue and I'm hoping someone could educate me. I'm a bit confused at why there are several ways to work with dt (int offsets vs ofnodes which are unions of int offsets and node pointers???).

Quoted 5 lines

The above patch was not needed previously so something changed in the ofnode field of struct udevice between v2019.10 and v2021.01.

Simon, could you explain what the proper way to work with dev->ofnode in probe functions is to loop over subnodes?

Quoted 7 lines

This version is in mainline now. Tim, could you please re-visit this and perhaps switch to using live tree API, as suggested by Suneel:

         ofnode_for_each_subnode(subnode, dev_ofnode(dev)) {
                 ret = ofnode_device_is_compatible(subnode,
                         "cavium,thunder-8890-mdio");
Quoted 8 lines

Stefan,

Yes, I can submit this but I would really like to understand the original issue. Do you or Simon perhaps know why the fdt node offset in dev passed to probe is wrong? It's not null but it does not appear to point to a device-tree (or perhaps I was using the wrong functions on it not fully understanding the current state of this live tree API).

I don't have an OcteonTX board installed right now, so it's not easy to really verify this. AFAIU, fdt_for_each_subnode() etc is deprecated and the use of e.g. this API seems "more modern":

	ofnode subnode;

	dev_for_each_subnode(subnode, dev) {
		...

Does this work for you?

Thanks,
Stefan

author
#27 lore raw

PATCH 6/6 net: octeontx: smi: fix mii probe

Quoted 74 lines · Stefan Roese

Hi Tim,

Quoted 57 lines · Tim Harvey
Quoted 48 lines · Stefan Roese

Hi Tim,

Quoted 38 lines · Tim Harvey
Quoted 25 lines · Stefan Roese
Quoted 5 lines · Tim Harvey

The fdt node offset is apparently not set properly when probed causing no MDIO busses to be found. Fix this by obtaining the offset.

Thanks,
Stefan

Quoted 12 lines
---
    drivers/net/octeontx/smi.c | 2 ++
    1 file changed, 2 insertions(+)
drivers/net/octeontx/smi.c +0 -0
index 91dcd05e4b..27f4423c6a 100644
@@ -325,6 +325,8 @@ int octeontx_smi_probe(struct udevice *dev)
                return -1;
        }
 
Quoted 6 lines

drivers/net/octeontx/smi.c int octeontx_smi_probe(struct udevice *dev) · line 332

Quoted 6 lines
drivers/net/octeontx/smi.c +2 -0
+     node = fdt_node_offset_by_compatible(gd->fdt_blob, -1,
+                                          "cavium,thunder-8890-mdio-nexus");
        fdt_for_each_subnode(subnode, gd->fdt_blob, node) {
                ret = fdt_node_check_compatible(gd->fdt_blob, subnode,
                                                "cavium,thunder-8890-mdio");

Honestly this is the wrong fix for this issue and I'm hoping someone could educate me. I'm a bit confused at why there are several ways to work with dt (int offsets vs ofnodes which are unions of int offsets and node pointers???).

Quoted 5 lines

The above patch was not needed previously so something changed in the ofnode field of struct udevice between v2019.10 and v2021.01.

Simon, could you explain what the proper way to work with dev->ofnode in probe functions is to loop over subnodes?

Quoted 7 lines

This version is in mainline now. Tim, could you please re-visit this and perhaps switch to using live tree API, as suggested by Suneel:

         ofnode_for_each_subnode(subnode, dev_ofnode(dev)) {
                 ret = ofnode_device_is_compatible(subnode,
                         "cavium,thunder-8890-mdio");
Quoted 8 lines

Stefan,

Yes, I can submit this but I would really like to understand the original issue. Do you or Simon perhaps know why the fdt node offset in dev passed to probe is wrong? It's not null but it does not appear to point to a device-tree (or perhaps I was using the wrong functions on it not fully understanding the current state of this live tree API).

I don't have an OcteonTX board installed right now, so it's not easy to really verify this. AFAIU, fdt_for_each_subnode() etc is deprecated and the use of e.g. this API seems "more modern":

Quoted 7 lines
        ofnode subnode;

        dev_for_each_subnode(subnode, dev) {
                ...

Does this work for you?

Stefan,

Yes thanks - I didn't read your original suggestion closely enough. I have a patch I will submit.

Thanks,

Tim

#28 lore raw

PATCH 6/6 net: octeontx: smi: fix mii probe

In reply to Tim Harvey
Quoted 6 lines · Tim Harvey

The fdt node offset is apparently not set properly when probed causing no MDIO busses to be found. Fix this by obtaining the offset.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210420/95fc3a29/attachment.sig>
#29 lore raw

cover octeontx cleanup and fixes

In reply to Tim Harvey

Hi Tim,

Quoted 11 lines · Tim Harvey

This series provides the following for octeontx:
- cleanup to the octeontx common header file by moving CONFIG_SUPPORT_RAW_INITRD to defconfig files,
- adds generic distro config support
- add missing SBSA watchdog to config
- fix an issue found with QML connected to a QSGMII PHY
- fix an issue with mii probe failing to find mdio busses
- fix a crash when scanning for sata devices

These were tested on a Gateworks Newport GW6404 with the CN8030 SoC.

Many thanks for working on this. Do you plan to send your GW6404 support to the list for upstreaming as well?

Thanks,
Stefan

author
#30 lore raw

cover octeontx cleanup and fixes

Quoted 13 lines · Stefan Roese

Hi Tim,

Quoted 9 lines · Tim Harvey

This series provides the following for octeontx:
- cleanup to the octeontx common header file by moving CONFIG_SUPPORT_RAW_INITRD to defconfig files,
- adds generic distro config support
- add missing SBSA watchdog to config
- fix an issue found with QML connected to a QSGMII PHY
- fix an issue with mii probe failing to find mdio busses
- fix a crash when scanning for sata devices

Quoted 6 lines
Quoted 2 lines

These were tested on a Gateworks Newport GW6404 with the CN8030 SoC.

Many thanks for working on this. Do you plan to send your GW6404 support to the list for upstreaming as well?

Stefan / Aaron / Suneel,

Many thanks to you all for keeping up on the octeontx/tx2 support - I was happy to notice it finally all got merged.

On top of this series the GW6404 works just fine with nothing other than it's own defconfig. The items I change from the octentx_81xx_defconfig are:
- env location and redundancy (board specific so this makes sense)
- enabling of generic distro config (which honestly I think every development board from vendors should be using)
- CONFIG_SYS_TEXT_BASE: octeontx_81xx_defconfig uses 0x2800000 which makes my board crash. I use 0x500000 which is fine

I can't seem to find the physical memory map for the CN8030 to explain the crash with the different text addr... it's likely that the 0x2800000 is suitable for the CN81xx but not the CN80xx due to the difference in memory map. I know the CN80xx has half the L2 cache as the CN81xx so perhaps this is the reason.

What board are you testing U-Boot octentx with? Do you test with CN803x at all? The Marvell v10 SDK doesn't support the CN80xx because the BDK boot stub became so bloated it didn't fit into its L2 cache (which is half the size of the CN81xx).

Is there any support coming from Marvell to support U-Boot SPL as a replacement for the horribly slow and bulky BDK for OcteonTX?

What is used as an SPL for the OcteonTX2? We are working on a CN91xx board design and I'm waiting for the Marvell SDK v11 drop before I dig too deeply into what U-Boot support is there. I know the CN91xx reference board I had access to booted to U-Boot extremely fast so the BDK must not be used.

I do also have some proposed changes to board/Marvell/octeontx/board-fdt.c ft_board_setup to allow booting with a loaded DTB that I'll probably submit sometime soon.

Best regards,

Tim