1) try to set uboot I mentioned firstly, then tell me the result
2) I don't know what schematic you use, this document is for imx7d, you need to refer to the i.mx8mq dts file, did you change the dts file according to your design? if you don't change HW, don't forget set reset pin in your dts, but refer to your log file, it seems you set correct in dts file
3) for imx8mq_evk.c, do you mean set in the uboot? you don't need to change this, for porting KSZ9131 on the imx7d, because the customized board uses GPIO1_IO03 as reset pin, I change the source code like below, maybe you can refer to it, I don't remove the source code, just use "//" as cancellation, this is 4.9.88 source code, you can compare with this
static int setup_fec(int fec_id)
{
struct iomuxc_gpr_base_regs *const iomuxc_gpr_regs
= (struct iomuxc_gpr_base_regs *) IOMUXC_GPR_BASE_ADDR;
int ret;
unsigned int gpio;
/*ret = gpio_lookup_name("gpio_spi@0_5", NULL, NULL, &gpio)
if (ret) {
printf("GPIO: 'gpio_spi@0_5' not found\n");
return -ENODEV;
}*///joan
imx_iomux_v3_setup_pad(MX7D_PAD_GPIO1_IO03__GPIO1_IO3 | MUX_PAD_CTRL(NO_PAD_CTRL));//Joan
//imx_iomux_v3_setup_multiple_pads(phy_reset_pads, ARRAY_SIZE(phy_reset_pads));//joan
//ret = gpio_request(gpio, "enet_phy_rst"); joan
ret = gpio_request(IMX_GPIO_NR(1, 3), "enet_phy_rst"); //joan
if (ret && ret != -EBUSY) {
//printf("gpio: requesting pin %u failed\n", gpio); joan
printf("gpio: requesting pin Io03 failed\n"); //joan
return ret;
}
/*gpio_direction_output(gpio, 0);
udelay(500);
gpio_direction_output(gpio, 1);*/ //joan
gpio_direction_output(IMX_GPIO_NR(1, 3), 0); //joan
mdelay(20);//joan
gpio_direction_output(IMX_GPIO_NR(1, 3), 1); //joan
udelay(100);//joan
if (0 == fec_id) {
/* Use 125M anatop REF_CLK1 for ENET1, clear gpr1[13], gpr1[17]*/
clrsetbits_le32(&iomuxc_gpr_regs->gpr[1],
(IOMUXC_GPR_GPR1_GPR_ENET1_TX_CLK_SEL_MASK |
IOMUXC_GPR_GPR1_GPR_ENET1_CLK_DIR_MASK), 0);
} else {
/* Use 125M anatop REF_CLK2 for ENET2, clear gpr1[14], gpr1[18]*/
clrsetbits_le32(&iomuxc_gpr_regs->gpr[1],
(IOMUXC_GPR_GPR1_GPR_ENET2_TX_CLK_SEL_MASK |
IOMUXC_GPR_GPR1_GPR_ENET2_CLK_DIR_MASK), 0);
if (mx7sabre_rev() >= BOARD_REV_B) {
/* On RevB, GPIO1_IO04 is used for ENET2 EN,
* so set its output to low to enable ENET2 signals
*/
gpio_request(IMX_GPIO_NR(1, 4), "fec2_en");
gpio_direction_output(IMX_GPIO_NR(1, 4), 0);
}
}
return set_clk_enet(ENET_125MHz);
}