0
点赞
收藏
分享

微信扫一扫

C++视觉开发 四.手势识别

橙子好吃吗 2024-07-24 阅读 7
linuxCuboot

在Board_r.c 使用initr_net,先初始化phy,然后初始化gmac,driver/net/gmacv300/gmac.c实现管脚复用和gmac设备注册

Board_r.c 
					#ifdef CONFIG_CMD_NET
							static int initr_net(void)
							{
								puts("Net:   ");
								eth_initialize();
							#if defined(CONFIG_RESET_PHY_R)
								debug("Reset Ethernet PHY\n");
								reset_phy();
							#endif
								return 0;
							}
					#endif

net/eth_legacy.c 
						int eth_initialize(void)
						{
							int num_devices = 0;

							eth_devices = NULL;
							eth_current = NULL;
							eth_common_init();
							/*
							* If board-specific initialization exists, call it.
							* If not, call a CPU-specific one
							*/
							if (board_eth_init != __def_eth_init) {
							if (board_eth_init(gd->bd) < 0)
								printf("Board Net Initialization Failed\n");
							} else if (cpu_eth_init != __def_eth_init) {
							if (cpu_eth_init(gd->bd) < 0)
								printf("CPU Net Initialization Failed\n");
							} else {
								printf("Net Initialization Skipped\n");
							}
						}
						
					    eth_common_init();   net/eth_legacy.c    // eth_common.c 
						void eth_common_init(void)
						{
									bootstage_mark(BOOTSTAGE_ID_NET_ETH_START);
								#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) || defined(CONFIG_PHYLIB)
									miiphy_init();     // phy初始化

									printf(" eth_common_init  \r\n");
									
						#endif
						}
						
						
						board_eth_init     //board/ 下面 
								
								int board_eth_init(bd_t *bis)
								{
									int rc = 0;

								#ifdef CONFIG_GMACV300_ETH
									rc = gmac_initialize(bis);
								#endif
									return rc;
								}
								// driver/net/gmacv300/gmac.c 									  
						gmac_pinctrl_config();  //管脚复用 
						ret = gmac_register_dev(GSF0_PORT0);   // gmac设备注册 
						

在这里插入图片描述

举报

相关推荐

0 条评论