software/libnet: add #ifdef on eth_init

This commit is contained in:
Florent Kermarrec 2019-04-10 16:16:47 +02:00
parent e475cfbb7d
commit f8dcdb70d2
2 changed files with 3 additions and 1 deletions

View File

@ -431,7 +431,7 @@ int main(int i, char **c)
printf("\n"); printf("\n");
printf("--========= \e[1mPeripherals init\e[0m ===========--\n"); printf("--========= \e[1mPeripherals init\e[0m ===========--\n");
#ifdef CSR_ETHMAC_BASE #ifdef CSR_ETHPHY_CRG_RESET_ADDR
eth_init(); eth_init();
#endif #endif
#ifdef CSR_SDRAM_BASE #ifdef CSR_SDRAM_BASE

View File

@ -461,6 +461,7 @@ static void busy_wait(unsigned int ds)
while(timer0_value_read()) timer0_update_value_write(1); while(timer0_value_read()) timer0_update_value_write(1);
} }
#ifdef CSR_ETHPHY_CRG_RESET_ADDR
void eth_init(void) void eth_init(void)
{ {
ethphy_crg_reset_write(0); ethphy_crg_reset_write(0);
@ -471,6 +472,7 @@ void eth_init(void)
ethphy_crg_reset_write(0); ethphy_crg_reset_write(0);
busy_wait(2); busy_wait(2);
} }
#endif
#ifdef CSR_ETHPHY_MODE_DETECTION_MODE_ADDR #ifdef CSR_ETHPHY_MODE_DETECTION_MODE_ADDR
void eth_mode(void) void eth_mode(void)