Changing the PHY on AGX board

I am trying to replace the PHY on AGX devkit with ksz9896/9897.The ksz9897 i have connected over RGMII interface on port 6 and SPI bus.

I have followed Replace PHY on microchip switch KSZ9896 and added the driver. The driver probe is completed and I am able to read and write to the ethernet phy using spi.

But I am facing this error:

[    8.624764] eth0: eqos_init_phy: Could not attach to PHY
[    8.624952] net eth0: eqos_open: Cannot attach to PHY (error: -19)

and there is no eth0 detected while issuing the ifconfig command

What is it causing this issue?
While going through the driver I found it is coming from the drv.c->mdio.c in eqos directory. But I am not using mdio here, instead I am using spi.Then why is the driver throwing this error?

Ashik P.

Sorry, no experience on this.

The last post on this thread is also using the SPI bus. But some drivers/tools are required from vendor side.