Enable Ethernet for Android Auto with mek_8q

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Enable Ethernet for Android Auto with mek_8q

Enable Ethernet for Android Auto with mek_8q

Default Ethernet feature is removed for Android Auto (both Android_Pie9.0 and Android10)
Below are the patched to bring Ethernet feature back to Android Auto. Please try to apply the according patches if you want to enable Ethernet.


For Android_Pie9.0_Auto(example with car2 build):

--- a/arch/arm64/configs/android_car2_defconfig

+++b/arch/arm64/configs/android_car2_defconfig

@@ -245,7 +245,7 @@ CONFIG_DM_VERITY_FEC=y

CONFIG_NETDEVICES=y

CONFIG_MACVTAP=m

CONFIG_TUN=y

-# CONFIG_ETHERNET is not set

+CONFIG_ETHERNET=y

CONFIG_MDIO_BUS_MUX_MMIOREG=m

CONFIG_AT803X_PHY=m

CONFIG_MARVELL_PHY=m

@@ -517,7 +517,7 @@ CONFIG_SQUASHFS=y

CONFIG_SQUASHFS_DECOMP_MULTI=y

CONFIG_SQUASHFS_XATTR=y

CONFIG_SQUASHFS_LZ4=y

-# CONFIG_NETWORK_FILESYSTEMS is not set

+CONFIG_NETWORK_FILESYSTEMS=y

 

--- a/imx8q/mek_8q/mek_8q.mk

+++ b/imx8q/mek_8q/mek_8q.mk

@@ -46,6 +46,7 @@ PRODUCT_COPY_FILES += \

     $(IMX_DEVICE_PATH)/fstab.freescale.car:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.freescale \

     $(IMX_DEVICE_PATH)/early.init_car.cfg:$(TARGET_COPY_OUT_VENDOR)/etc/early.init.cfg \

     $(IMX_DEVICE_PATH)/required_hardware_auto.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/required_hardware.xml \

+    frameworks/native/data/etc/android.hardware.ethernet.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.ethernet.xml \

     device/fsl/imx8q/init.recovery.freescale.car.rc:root/init.recovery.freescale.rc

 

For Android10_Auto,(example with car build):

--- a/arch/arm64/configs/android_car_defconfig

+++ b/arch/arm64/configs/android_car_defconfig

@@ -23,6 +23,8 @@ CONFIG_SCHED_AUTOGROUP=y

CONFIG_SCHED_TUNE=y

CONFIG_RELAY=y

CONFIG_BLK_DEV_INITRD=y

+CONFIG_FEC=y

+CONFIG_AT803X_PHY=y

# CONFIG_RD_BZIP2 is not set

# CONFIG_RD_LZMA is not set

# CONFIG_RD_XZ is not set

@@ -246,7 +248,6 @@ CONFIG_DM_VERITY=y

CONFIG_DM_VERITY_FEC=y

CONFIG_NETDEVICES=y

CONFIG_TUN=y

-# CONFIG_ETHERNET is not set

 

--- a/imx8q/mek_8q/mek_8q.mk

+++ b/imx8q/mek_8q/mek_8q.mk

@@ -46,6 +46,7 @@ PRODUCT_COPY_FILES += \

     $(IMX_DEVICE_PATH)/fstab.freescale.car:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.freescale \

     $(IMX_DEVICE_PATH)/early.init_car.cfg:$(TARGET_COPY_OUT_VENDOR)/etc/early.init.cfg \

     $(IMX_DEVICE_PATH)/required_hardware_auto.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/required_hardware.xml \

+    frameworks/native/data/etc/android.hardware.ethernet.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.ethernet.xml \

     device/fsl/imx8q/init.recovery.freescale.car.rc:root/init.recovery.freescale.rc

 

Note: Please also check for below file, if fec1 is disabled, please also apply below diff.

--- a/arch/arm64/boot/dts/freescale/imx8qm-mek-car2.dts
+++ b/arch/arm64/boot/dts/freescale/imx8qm-mek-car2.dts
@@ -147,10 +147,6 @@
status = "disabled";
};

-&fec1 {
- status = "disabled";
-};
-
&fec2 {
status = "disabled";
};

添付
コメント

Hello Andy,

I applied the patch above, now I have the kernel printing eth messages and ifconfig shows eth0.

However, when I assign a static ip on a direct connection with a host, ping does not work, I get host unreachable.

If I connect to a router with DHCP server, it doesn't acquire an IP.

Are there other Android packages that needed to be installed to enable networking?   

Thanks!

mek_8q:/ # dmesg | grep eth
[ 0.000000] psci: probing for conduit method from DT.
[ 1.062988] fec 5b040000.ethernet: 5b040000.ethernet supply phy not found, us ing dummy regulator
[ 1.088689] fec 5b040000.ethernet eth0: registered PHC device 0
[ 5.671765] using random self ethernet address
[ 5.676348] using random host ethernet address
[ 12.257932] Generic PHY 5b040000.ethernet-1:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=5b040000.ethernet-1:00, irq=POLL)
[ 12.270536] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 12.302364] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 12.465029] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 14.300010] fec 5b040000.ethernet eth0: Link is Up - 100Mbps/Full - flow cont rol rx/tx
[ 14.308841] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

I am also facing the same issue. Any findings?

Customer went a different route, I never received feedback on this.

Please reply here if you find anything. 

Disabling ethernet by default in demo images make no sense. Without internet connection Android in most cases is useless.

Tested locally with android10_5.4.y mainline, the patches above will get ethernet working.
For static IP, there is a CL need to apply in frameworks/opt/net/ethernet.git

the patch is attached as  611749f.diff

I tried the build with Android 10.0.0_2.2.0 but had a weird error during the build:

my commands to build (after clean download of source, deleted android_build folder prior...)

  • cd ${MY_ANDROID}
  • source build/envsetup.sh
  • lunch mek_8q_car2-userdebug (i don't want M4 in this case... maybe that is the problem)
  • ./imx-make.sh -j16 (note i have 16 cores in my build machine)

from the community appnote, i also updated the following files per instructions in post (and no other files touched):

 

file:  mek_8q.mk

location: ./android_build/device/fsl/imx8q/mek_8q/mek_8q.mk

 

file:  imx_v8_android_car2_defconfig

location: ~/android_build/vendor/nxp-opensource/kernel_imx/arch/arm64/configs

 

I did not touch/modify any other file anywhere in the build.   should i have used the mek_8q_car2.mk file instead of mek_8q.mk from the community post?

 

The out folder is being generated but the errors are below.   Do I ignore or have I done something incorrect?

 

 

[ 99% 630/634] including vendor/nxp/imx_android_mm/CactusPlayer/Android.mk ...

[ 99% 631/634] including vendor/nxp/imx_android_mm/codec2/store/registry/Android.mk ...

[ 99% 632/634] including vendor/nxp/linux-firmware-imx/firmware/Android.mk ...

[ 99% 633/634] finishing build rules ...

platform_testing/build/tasks/tests/instrumentation_test_list.mk: warning: continuous_instrumentation_tests: Unknown installed file for module 'NexusLauncherOutOfProcTests'

platform_testing/build/tasks/tests/instrumentation_test_list.mk: warning: continuous_instrumentation_tests: Unknown installed file for module 'NexusLauncherDebug'

platform_testing/build/tasks/tests/instrumentation_test_list.mk: warning: continuous_instrumentation_tests: Unknown installed file for module 'NexusLauncherTests'

platform_testing/build/tasks/tests/platform_test_list.mk: warning: platform_tests: Unknown installed file for module 'LauncherRotationStressTest'

platform_testing/build/tasks/tests/platform_test_list.mk: warning: platform_tests: Unknown installed file for module 'PlatformScenarioTests'

[100% 634/634] writing build rules ...

FAILED:

device/fsl/imx8q/mek_8q/mek_8q.mk:512: error: writing to readonly directory: "device/fsl/imx8q/init.recovery.freescale.car.rc"

09:50:03 ckati failed with: exit status 1

 

#### failed to build some targets (08:26 (mm:ss)) ####

 

Andy, where are you applying the CL argument to ethernet.git?  what is the CL exactly you need to enter?  i've applied the patches, android 10 is up, but ifconfig (via adb shell) shows a dummy0 link (though that does look fully functional).  but i cannot access the network so i'm assuming android needs a static IP?   also under Kitchen Sink--> connectivity in android 10, i cannot find that the ethernet is enabled... previously on android10, if ethernet was working i'd see an IP address in that screen.

further investigation... i have my MEK attached to a network with full DHCP.  But i don't get an IP address (e.g. no eth0).   What i do get is a dummy0 connection (not sure if this is actually eth0...).  Second, under Kitchen Sink-->connectivity, i'd usually see the network there (via ethernet).

under adb shell:

kyle@kyle-System-Product-Name:~/android_build/out/target/product/mek_8q$ adb shell
mek_8q:/ $ su
mek_8q:/ # ifconfig
dummy0 Link encap:Ethernet HWaddr ba:e1:9e:2e:20:90
inet6 addr: fe80::b8e1:9eff:fe2e:2090/64 Scope: Link
UP BROADCAST RUNNING NOARP MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 TX bytes:700

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope: Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 TX bytes:0

mek_8q:/ #

mek_8q:/ # ping 192.168.1.1
connect: Network is unreachable
2|mek_8q:/ #

Hi fox,

Firstly, if you correctly apply the patch to kernel defconfig and device/fsl.git, you should be able to see eth0 interface with "ifconfig -a"  , not dummy0

And the CL 611749f.diff I attached is  to apply on frameworks/opt/net/ethernet.git , it's for static IP assign issue. 

評価なし
バージョン履歴
最終更新日:
‎02-12-2020 07:28 AM
更新者: