Android9.0 HIsi

Android 8.0Mstar

Android 4.4 Hisi

模块有方N720

首先根据模块方添加linux驱动 一般不会出现很大的问题    

这个模块是USB 串口的更改option.c(路径一般为 kernel/drivers/usb/serial/option.c)具体以供应商手册为准。

后面的添加也是照搬

最主要一步 添加驱动hisi 有可能会打不开make kernel_menuconfig

直接把这个加到你对应板子的Deconfig就可以了

CONFIG_USB_SERIAL=y
# CONFIG_USB_SERIAL_CONSOLE is not set
# CONFIG_USB_SERIAL_GENERIC is not set
# CONFIG_USB_SERIAL_SIMPLE is not set
# CONFIG_USB_SERIAL_AIRCABLE is not set
# CONFIG_USB_SERIAL_ARK3116 is not set
# CONFIG_USB_SERIAL_BELKIN is not set
# CONFIG_USB_SERIAL_CH341 is not set
# CONFIG_USB_SERIAL_WHITEHEAT is not set
# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
# CONFIG_USB_SERIAL_CP210X is not set
# CONFIG_USB_SERIAL_CYPRESS_M8 is not set
# CONFIG_USB_SERIAL_EMPEG is not set
# CONFIG_USB_SERIAL_FTDI_SIO is not set
# CONFIG_USB_SERIAL_VISOR is not set
# CONFIG_USB_SERIAL_IPAQ is not set
# CONFIG_USB_SERIAL_IR is not set
# CONFIG_USB_SERIAL_EDGEPORT is not set
# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
# CONFIG_USB_SERIAL_F81232 is not set
# CONFIG_USB_SERIAL_GARMIN is not set
# CONFIG_USB_SERIAL_IPW is not set
# CONFIG_USB_SERIAL_IUU is not set
# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
# CONFIG_USB_SERIAL_KEYSPAN is not set
# CONFIG_USB_SERIAL_KLSI is not set
# CONFIG_USB_SERIAL_KOBIL_SCT is not set
# CONFIG_USB_SERIAL_MCT_U232 is not set
# CONFIG_USB_SERIAL_METRO is not set
# CONFIG_USB_SERIAL_MOS7720 is not set
# CONFIG_USB_SERIAL_MOS7840 is not set
# CONFIG_USB_SERIAL_MXUPORT is not set
# CONFIG_USB_SERIAL_NAVMAN is not set
# CONFIG_USB_SERIAL_PL2303 is not set
# CONFIG_USB_SERIAL_OTI6858 is not set
# CONFIG_USB_SERIAL_QCAUX is not set
# CONFIG_USB_SERIAL_QUALCOMM is not set
# CONFIG_USB_SERIAL_SPCP8X5 is not set
# CONFIG_USB_SERIAL_SAFE is not set
# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set
# CONFIG_USB_SERIAL_SYMBOL is not set
# CONFIG_USB_SERIAL_TI is not set
# CONFIG_USB_SERIAL_CYBERJACK is not set
# CONFIG_USB_SERIAL_XIRCOM is not set
CONFIG_USB_SERIAL_WWAN=y
CONFIG_USB_SERIAL_OPTION=y
# CONFIG_USB_SERIAL_OMNINET is not set
# CONFIG_USB_SERIAL_OPTICON is not set
# CONFIG_USB_SERIAL_XSENS_MT is not set
# CONFIG_USB_SERIAL_WISHBONE is not set
# CONFIG_USB_SERIAL_SSU100 is not set
# CONFIG_USB_SERIAL_QT2 is not set
# CONFIG_USB_SERIAL_DEBUG is not set


添加完这个就可以把kernel放到你的板子里了


 可以看到usb设备节点

kernel就完全没问题了

要注意 kernel是不是打开了PPP一般来说用PPP比较多  也比较容易调试 

接下来就是系统了  7.0以下直接在init.rc里面添加 然后更改下权限就可以了

Android 8.0以上 

直接修改hardware/ril/rild/rild.rc

接下来也是 8.0以上添加服务

 

            <name>android.hardware.radio.deprecated</name>
                  <transport>hwbinder</transport>
                 <version>1.0</version>
                  <interface>
                                  <name>IOemHook</name>
                                  <instance>slot1</instance>
                  </interface>
       </hal>
       <hal format="hidl">
                  <name>android.hardware.radio</name>
                  <transport>hwbinder</transport>
                  <version>1.1</version>
                  <interface>
                                  <name>IRadio</name>
                                 <instance>slot1</instance>
                  </interface>
                  <interface>
                                  <name>ISap</name>
                                  <instance>slot1</instance>
                  </interface>

 (大部分代码出自git log 为了方便粘贴只去掉+号 请自行缩进)

最重要一步 关掉SELinux 当然有的厂家选择不关掉

两种方法 

1. bootargs 更改 

2.适用于Android9.0

--- a/core/init/selinux.cpp
+++ b/core/init/selinux.cpp
@@ -89,6 +89,7 @@ EnforcingStatus StatusFromCmdline() {
 }

 bool IsEnforcing() {
+       return false;
     if (ALLOW_PERMISSIVE_SELINUX) {
         return StatusFromCmdline() == SELINUX_ENFORCING;
     }

 当然不关也没问题~~自己写权限文件  由于我们可以关掉 我就没去看

整个文档部分结束

这个地方加完可能大部分芯片可以

但是有的厂商!!!!!!!!!!!!!!!!

所有都关掉

基于9.0所有都关掉最全攻略

trySetupData for APN type default, reason: dataEnabled. Data disallowed, reasons: DATA_DISABLED 这个错误基本上就是没加ro.com.android.prov_mobiledata=true

	ro.telephony.default_network=10 \//默认网络选择可避免只有2g
	persist.sys.pref.net.type=10 \
	ro.com.android.dataroaming=true \//这个是数据漫游可加可不加
	ro.com.android.prov_mobiledata=true \//这个是必须加的 不加打不开网络的
	ro.radio.noril=false \ //这个必须改为false否则系统会认为你没有数据网络
	vendor.rild.libpath=/vendor/lib/libreference-rilecyoufang.so//这个是给rild加载库的参数详情见rild.c

附录:
安卓网络首选项修改如下参数:
	路径(因平台而异):
	frameworks/base/telephony/java/com/android/internal/telephony/RILConstants.java 
	
	安卓默认参数设置:
	int PREFERRED_NETWORK_MODE = TelephonyManager.getDefaultPreferredNetworkType(0, NETWORK_MODE_WCDMA_PREF); 

	修改为: 
	int PREFERRED_NETWORK_MODE = TelephonyManager.getDefaultPreferredNetworkType(0, NETWORK_MODE_LTE_GSM_WCDMA);

REQUEST_SET_PREFERRED_NETWORK_TYPE

/* NETWORK_MODE_* See ril.h RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE */
int NETWORK_MODE_WCDMA_PREF     = 0; /* GSM/WCDMA (WCDMA preferred) */
int NETWORK_MODE_GSM_ONLY       = 1; /* GSM only */
int NETWORK_MODE_WCDMA_ONLY     = 2; /* WCDMA only */
int NETWORK_MODE_GSM_UMTS       = 3; /* GSM/WCDMA (auto mode, according to PRL)
                                        AVAILABLE Application Settings menu*/
int NETWORK_MODE_CDMA           = 4; /* CDMA and EvDo (auto mode, according to PRL)
                                        AVAILABLE Application Settings menu*/
int NETWORK_MODE_CDMA_NO_EVDO   = 5; /* CDMA only */
int NETWORK_MODE_EVDO_NO_CDMA   = 6; /* EvDo only */
int NETWORK_MODE_GLOBAL         = 7; /* GSM/WCDMA, CDMA, and EvDo (auto mode, according to PRL)
                                        AVAILABLE Application Settings menu*/
int NETWORK_MODE_LTE_CDMA_EVDO  = 8; /* LTE, CDMA and EvDo */
int NETWORK_MODE_LTE_GSM_WCDMA  = 9; /* LTE, GSM/WCDMA */
int NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA = 10; /* LTE, CDMA, EvDo, GSM/WCDMA */
int NETWORK_MODE_LTE_ONLY       = 11; /* LTE Only mode. */
int NETWORK_MODE_LTE_WCDMA      = 12; /* LTE/WCDMA */
int NETWORK_MODE_TD_SCDMA_ONLY            = 13; /* TD-SCDMA only */
int NETWORK_MODE_TD_SCDMA_WCDMA           = 14; /* TD-SCDMA and WCDMA */
int NETWORK_MODE_TD_SCDMA_LTE             = 15; /* TD-SCDMA and LTE */
int NETWORK_MODE_TD_SCDMA_GSM             = 16; /* TD-SCDMA and GSM */
int NETWORK_MODE_TD_SCDMA_GSM_LTE         = 17; /* TD-SCDMA,GSM and LTE */
int NETWORK_MODE_TD_SCDMA_GSM_WCDMA       = 18; /* TD-SCDMA, GSM/WCDMA */
int NETWORK_MODE_TD_SCDMA_WCDMA_LTE       = 19; /* TD-SCDMA, WCDMA and LTE */
int NETWORK_MODE_TD_SCDMA_GSM_WCDMA_LTE   = 20; /* TD-SCDMA, GSM/WCDMA and LTE */
int NETWORK_MODE_TD_SCDMA_CDMA_EVDO_GSM_WCDMA  = 21; /*TD-SCDMA,EvDo,CDMA,GSM/WCDMA*/
int NETWORK_MODE_TD_SCDMA_LTE_CDMA_EVDO_GSM_WCDMA = 22; /* TD-SCDMA/LTE/GSM/WCDMA, CDMA, and
                                                           EvDo */

下面是所需要编译的包不要问为什么 加就对了

PRODUCT_PACKAGES += \
    TelephonyProvider \
    TeleService \
    rild 

 下面是文件放的位置

PRODUCT_COPY_FILES += \
	device/hisilicon/bigfish/build/prebuilts/youfang/libreference-ril.so:vendor/lib/libreference-rilecyoufang.so \
	device/hisilicon/bigfish/build/prebuilts/youfang/chat:system/bin/chat \
	device/hisilicon/bigfish/build/prebuilts/youfang/ip-down:system/etc/ppp/ip-down \
	device/hisilicon/bigfish/build/prebuilts/youfang/ip-up:system/etc/ppp/ip-up \
	device/hisilicon/bigfish/build/prebuilts/youfang/apns-conf.xml:system/etc/apns-conf.xml \

上面基本上除了apn其它的模块商都会给 要注意自己的cpu架构  怎么看呢

我这个是32位的  当然一般64兼容32

还有一个地方要设置hisilicon/Hi3751V350/overlay/frameworks/base/core/res/res/values/config.xml(这个config一般厂商都会有overlay如果没有 就在frameworks相同的路径里面)

这个地方是设置网络优先级 如果没有mobile就会有问题




        <string-array translatable="false" name="networkAttributes">
         <item>"ethernet,9,9,1,-1,true"</item>
         <item>"wifi,1,1,1,-1,true"</item>
               <item>"mobile,0,0,0,-1,true"</item>
        <item>"mobile_mms,2,0,2,60000,true"</item>
        <item>"mobile_supl,3,0,2,60000,true"</item>
        <item>"mobile_dun,4,0,2,60000,true"</item>
        <item>"mobile_hipri,5,0,3,60000,true"</item>
        <item>"mobile_fota,10,0,2,60000,true"</item>
        <item>"mobile_ims,11,0,2,60000,true"</item>
        <item>"mobile_cbs,12,0,2,60000,true"</item>
              <item>"mobile_ia,14,0,2,-1,true"</item>
               <item>"mobile_emergency,15,0,2,-1,true"</item>
         <item>"wifi_p2p,13,1,0,-1,true"</item>
     </string-array>
    <string-array translatable="false" name="radioAttributes">
        <item>"1,1"</item>
        <item>"0,1"</item>
        <item>"15,15"</item>
        <item>"9,9"</item>
        <item>"1,15"</item>
    </string-array>
   

全部检查OK之后 应该就可以上网了ppp0就是模块的网卡

还有很多人出现PPP退出  查看/dev/ppp设备节点有没有  有的话强制chmod 777试一下 应该是可以上网 然后写到init.rc就可以了

 参考https://blog.csdn.net/u012932409/article/details/100044278

https://blog.csdn.net/qq_32017483/article/details/100131180

 

Logo

更多推荐