I am tying to move driver form C:\ti\nsp_1_10_02_09\packages\ti\drv\omapl138 to my custom BOARD。
AND I do it like this
https://e2e.ti.com/support/embedded/tirtos/f/355/p/393466/1405236#1405236
I have complete 20 steps but it seems does not work 。
The problem is the driver endless loop at
/* Give soft reset to EMAC */
EMAC_REGS->SOFTRESET = 0x00000001;
while (EMAC_REGS->SOFTRESET != 0); /* Wait until reset has occured */
and sometimes it endless loop at
/*Give soft reset to Wrapper*/
ectlRegs->SOFTRESET = 0x01;
while (ectlRegs->SOFTRESET != 0); /* Wait until reset has occured */
In the ethdriver.c the HwPktOpen() call the EMAC_open(),
the EMAC_open() is write in the csl_emac.c。
there is my work environment.
CCS6.0.0
SYS/BIOS
C6747 custom borad;
The changes about the driver look like very few;
The clk for the mdio do not need change
I change the macsel =MII to macsel =RMII
/**< Curent selection of MAC */
static Uint32 macsel = RMII;
AND I add pinmux in pinmuxConfig in eamcHook .c
CSL_FINST(sysRegs->PINMUX11,SYSCFG_PINMUX11_PINMUX11_7_4, MDIO_D);
CSL_FINST(sysRegs->PINMUX11,SYSCFG_PINMUX11_PINMUX11_3_0, MDIO_CLK);
CSL_FINST(sysRegs->PINMUX9,SYSCFG_PINMUX9_PINMUX9_23_20, RMII_MHZ_50_CLK);
CSL_FINST(sysRegs->PINMUX10,SYSCFG_PINMUX10_PINMUX10_27_24, RMII_RXD1);
CSL_FINST(sysRegs->PINMUX10,SYSCFG_PINMUX10_PINMUX10_23_20, RMII_RXD0);
CSL_FINST(sysRegs->PINMUX10,SYSCFG_PINMUX10_PINMUX10_19_16, RMII_CRS_DV);
CSL_FINST(sysRegs->PINMUX10,SYSCFG_PINMUX10_PINMUX10_15_12, RMII_TXEN);
CSL_FINST(sysRegs->PINMUX10,SYSCFG_PINMUX10_PINMUX10_11_8, RMII_TXD1);
CSL_FINST(sysRegs->PINMUX10,SYSCFG_PINMUX10_PINMUX10_7_4, RMII_TXD0);
Just all
If I comment these code
/*Give soft reset to Wrapper*/
// ectlRegs->SOFTRESET = 0x01;
// while (ectlRegs->SOFTRESET != 0); /* Wait until reset has occured */
// /* Give soft reset to EMAC */
// EMAC_REGS->SOFTRESET = 0x00000001;
// while (EMAC_REGS->SOFTRESET != 0); /* Wait until reset has occured */
It display these lines in Console
00000.000 MAC Address = ba-bb-bc-bd-be-bf
00000.000 EMAC should be up and running
00000.000 EMAC has been started successfully
00000.000 Registeration of the EMAC Successful
Network Added: If-1:192.168.1.2
printf NO PHY CONNECTED
printf NO PHY CONNECTED
...
I know if I change the progect using the bsl ,and change the platform to OMAP-137, it works correctly .but the bsl cannot work in custom board.
https://e2e.ti.com/support/embedded/tirtos/f/355/t/517415
nimu_eth.c,ethdriver.c,csl_mdio.c,csl_emac.c,the filess ,I should copy it from the C:\CCStudio_v3.3\ndk_2_0_0\packages\ti\ndk\src\hal\evm6747\eth_c6747 or C:\ti\nsp_1_10_02_09\packages\ti\drv\omapl138 to my progect?
the files from C:\CCStudio_v3.3\ndk_2_0_0\packages\ti\ndk\src\hal\evm6747\eth_c6747 is outdated,I am working on CCS6.0
Thanks for your replay.Maybe Steven can help me again.