MTK 65XX系列通過USB OTG添加Ethernet RJ45有線網卡支援

來源:互聯網
上載者:User

標籤:mtk 65xx otg eth0 rj

最近客戶要求使用MTk 6572晶片通過USB OTG添加支援有線網卡,我查遍了鉤鉤了所有網站,都沒有相關論述,查看了MTK給的資料,包括FAQ,只說支援USB OTG鍵盤滑鼠和隨身碟。怎麼辦?只有我自己來。
但是,按照我對於USB裝置機構的理解,只要我們掛在了USB Ethernet的驅動,那麼在USB Ethernet插入的時候,應該可以自動匹配到其裝置驅動,所以只要我們掛在了USB Ethernet的驅動,那麼就應該可以正常工作。
首先,就是回顧如果是非MTK平台,我們如何添加Ethernet的支援,當然通過Make Menuconfig加入驅動了。MTK自己定義的方法,實在沒有時間去研究其如何配置的,就按照其自身的定義去配置。
./alps/mediatek/config/xxx_project/autoconfig/kconfig/project添加組態變數
當然,我們需要去下載最新的Ethernet驅動程式
網卡採用USB 2.0轉乙太網路控制晶片AX88772B, android 2.3 和4.0下的通用網卡驅動不支援這款晶片, 需要從網上下載最新的linux 下AX88772B驅動
驅動:http://www.asix.com.tw/cs/download.php?sub=driverdetail&PItemID=105
我們進入/drivers/net/usb下面
./alps/mediatek/config/xxx_project/autoconfig/kconfig/project添加如下變數

CONFIG_USB_MTK_OTG=y
CONFIG_USB_MTK_HDRC_HCD=y
CONFIG_USB_PEGASUS=y
CONFIG_USB_USBNET=y
CONFIG_USB_NET_AX8817X=y
CONFIG_USB_NET_CDCETHER=y
CONFIG_USB_NET_CDC_NCM=y
CONFIG_USB_NET_CDC_SUBSET=y
CONFIG_USB_BELKIN=y
CONFIG_USB_ARMLINUX=y
CONFIG_USB_NET_ZAURUS=y

然後執行./mk -t n k,會報如下錯誤
**** Building ****
scripts/kconfig/conf --silentoldconfig Kconfig
../mediatek/platform/mt6572/kernel/Kconfig/Drivers:263:warning: config symbol defined without type
warning: (VIDEO_VIVI && FB_VGA16 && FB_S3 && FB_VT8623 && FB_ARK && USB_SISUSBVGA_CON && MTK_FB_SUPPORT_ASSERTION_LAYER) selects FONT_8x16 which has unmet direct dependencies (HAS_IOMEM && VT && (FRAMEBUFFER_CONSOLE || SGI_NEWPORT_CONSOLE || STI_CONSOLE || USB_SISUSBVGA_CON))
*
* Restart config...
*
*
* USB Network Adapters
*
USB CATC NetMate-based Ethernet device support (EXPERIMENTAL) (USB_CATC) [N/m/y/?] n
USB KLSI KL5USB101-based ethernet device support (USB_KAWETH) [N/m/y/?] n
USB Pegasus/Pegasus-II based ethernet device support (USB_PEGASUS) [Y/n/m/?] y
USB RTL8150 based ethernet device support (EXPERIMENTAL) (USB_RTL8150) [N/m/y/?] n
Multi-purpose USB Networking Framework (USB_USBNET) [Y/n/m/?] y
  ASIX AX88xxx Based USB 2.0 Ethernet Adapters (USB_NET_AX8817X) [Y/n/m/?] y
  CDC Ethernet support (smart devices such as cable modems) (USB_NET_CDCETHER) [Y/?] y
  CDC EEM support (USB_NET_CDC_EEM) [N/m/y/?] (NEW) aborted!

Console input/output is redirected. Run ‘make oldconfig‘ to update configuration.

make[5]: *** [silentoldconfig] Error 1
make[4]: *** [silentoldconfig] Error 2
make[3]: *** No rule to make target `include/config/auto.conf‘, needed by `include/config/kernel.release‘.  Stop.
make[2]: *** [sub-make] Error 2
Checking memory usage DONE!
                    ==> [OK]    2014/11/06 22:28:09
-------------------------------------------------------------------------------------------------------------------------------------------
這個錯誤表面,配置的一致性和完整性要求,我們必須./alps/mediatek/config/xxx_project/autoconfig/kconfig/project添加CONFIG_USB_NET_CDC_EEM=y的定義。
添加之後重新編譯./mk -t n k,又報如下錯誤
scripts/kconfig/conf --silentoldconfig Kconfig
../mediatek/platform/mt6572/kernel/Kconfig/Drivers:263:warning: config symbol defined without type
warning: (VIDEO_VIVI && FB_VGA16 && FB_S3 && FB_VT8623 && FB_ARK && USB_SISUSBVGA_CON && MTK_FB_SUPPORT_ASSERTION_LAYER) selects FONT_8x16 which has unmet direct dependencies (HAS_IOMEM && VT && (FRAMEBUFFER_CONSOLE || SGI_NEWPORT_CONSOLE || STI_CONSOLE || USB_SISUSBVGA_CON))
*
* Restart config...
*
*
* USB Network Adapters
*
USB CATC NetMate-based Ethernet device support (EXPERIMENTAL) (USB_CATC) [N/m/y/?] n
USB KLSI KL5USB101-based ethernet device support (USB_KAWETH) [N/m/y/?] n
USB Pegasus/Pegasus-II based ethernet device support (USB_PEGASUS) [Y/n/m/?] y
USB RTL8150 based ethernet device support (EXPERIMENTAL) (USB_RTL8150) [N/m/y/?] n
Multi-purpose USB Networking Framework (USB_USBNET) [Y/n/m/?] y
  ASIX AX88xxx Based USB 2.0 Ethernet Adapters (USB_NET_AX8817X) [Y/n/m/?] y
  CDC Ethernet support (smart devices such as cable modems) (USB_NET_CDCETHER) [Y/?] y
  CDC EEM support (USB_NET_CDC_EEM) [Y/n/m/?] y
  CDC NCM support (USB_NET_CDC_NCM) [Y/n/m/?] y
  Davicom DM9601 based USB 1.1 10/100 ethernet devices (USB_NET_DM9601) [N/m/y/?] (NEW) aborted!

Console input/output is redirected. Run ‘make oldconfig‘ to update configuration.

make[5]: *** [silentoldconfig] Error 1
make[4]: *** [silentoldconfig] Error 2
make[3]: *** No rule to make target `include/config/auto.conf‘, needed by `include/config/kernel.release‘.  Stop.
make[2]: *** [sub-make] Error 2
Checking memory usage DONE!
這表明,我們又需要添加CONFIG_USB_NET_DM9601=y
一次一次的嘗試,最後,我們添加如下所有組態變數,編譯通過了。
CONFIG_USB_MTK_OTG=y
CONFIG_USB_MTK_HDRC_HCD=y
CONFIG_USB_PEGASUS=y
CONFIG_USB_USBNET=y
CONFIG_USB_NET_AX8817X=y
CONFIG_USB_NET_CDC_EEM=y
CONFIG_USB_NET_CDC_NCM=y
CONFIG_USB_NET_SMSC75XX=y
CONFIG_USB_NET_SMSC95XX=y
CONFIG_USB_NET_GL620A=y
CONFIG_USB_NET_NET1080=y
CONFIG_USB_NET_PLUSB=y
CONFIG_USB_NET_MCS7830=y
CONFIG_USB_NET_CDCETHER=y
CONFIG_USB_NET_CDC_NCM=y
CONFIG_USB_NET_DM9601=y
CONFIG_USB_NET_CDC_SUBSET=y
CONFIG_USB_BELKIN=y
CONFIG_USB_ARMLINUX=y
CONFIG_USB_NET_ZAURUS=y
CONFIG_USB_NET_RNDIS_HOST=y
CONFIG_USB_ALI_M5632=y
CONFIG_USB_AN2720=y
CONFIG_USB_EPSON2888=y
CONFIG_USB_KC2190=y
CONFIG_USB_NET_CX82310_ETH=y
CONFIG_USB_NET_KALMIA=y
CONFIG_USB_NET_QMI_WWAN=y
CONFIG_USB_NET_INT51X1=y
CONFIG_USB_SIERRA_NET=y
CONFIG_USB_VL600=y
--------------------------------------------------------------------------------
然後,把ROM燒到目標機器上。
然後使用USB調試線把網卡接上去,問題來了,由於我沒有串口裝置,同時USB OTG又被佔用了,無法使用adb調試,怎麼辦?
我下載一個超級終端apk,可以在裝置的介面中執行shell命令。
然後執行dmseg,看看插入OTG網卡的資訊,可以看到網卡被正常找到和匹配驅動。
然後,在終端上執行
netcfg eth0 dhcp
setprop net.dns1 8.8.8.8
執行之後,執行一下ifconfig查看,就可以看到eth0被正常配置,並且分配了IP地址了,到此,調試結束了,後面的工作就簡單了,就是修改Init.rc啟動相關服務就可以了。

MTK 65XX系列通過USB OTG添加Ethernet RJ45有線網卡支援

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.