赞
踩
针对64位的cpu可以使用32位的系统,从而减少系统的内存占用。
具体修改是在Boardconfig里面配置系统为32位,根据不同芯片配置方式会有差异,具体如下:
device/rockchip/rk356x/BoardConfig.mk"
TARGET_ARCH := arm64
TARGET_ARCH_VARIANT := armv8-a
TARGET_CPU_ABI := arm64-v8a
TARGET_CPU_ABI2 :=
TARGET_CPU_VARIANT := cortex-a55
TARGET_CPU_SMP := true
TARGET_2ND_ARCH := arm
TARGET_2ND_ARCH_VARIANT := armv8-2a
TARGET_2ND_CPU_ABI := armeabi-v7a
TARGET_2ND_CPU_ABI2 := armeabi
TARGET_2ND_CPU_VARIANT := cortex-a55
@sys2_206:~/1_Android11_sdk_29/device/rockchip/rk356x$ git diff
diff --git a/BoardConfig.mk b/BoardConfig.mk
index e2773c1..9d1d68a 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -4,18 +4,18 @@
CURRENT_SDK_VERSION := rk356x_ANDROID10.0_MID_V1.0
-TARGET_ARCH := arm64
-TARGET_ARCH_VARIANT := armv8-a
-TARGET_CPU_ABI := arm64-v8a
-TARGET_CPU_ABI2 :=
+TARGET_ARCH := arm
+TARGET_ARCH_VARIANT := armv8-2a
+TARGET_CPU_ABI := armeabi-v7a
+TARGET_CPU_ABI2 :=armeabi
TARGET_CPU_VARIANT := cortex-a55
TARGET_CPU_SMP := true
-TARGET_2ND_ARCH := arm
-TARGET_2ND_ARCH_VARIANT := armv8-2a
-TARGET_2ND_CPU_ABI := armeabi-v7a
-TARGET_2ND_CPU_ABI2 := armeabi
-TARGET_2ND_CPU_VARIANT := cortex-a55
+#TARGET_2ND_ARCH := arm
+#TARGET_2ND_ARCH_VARIANT := armv8-2a
+#TARGET_2ND_CPU_ABI := armeabi-v7a
+#TARGET_2ND_CPU_ABI2 := armeabi
+#TARGET_2ND_CPU_VARIANT := cortex-a55
Android Go对当前的Android系统进行简化,使其可以在更小内存的手机上运行,它能让低端手机保持一定的系统更新、同时又不会过度消耗低端硬件资源。
Android上面可以通过配置打开GO的配置,具体配置如下:
BUILD_WITH_GO_OPT := true
在产品的Boardconfig.mk加上这个配置即可。
在编译32位系统和加上GO的配置还无法满足需求的情况下,可以根据产品的定义和需求对系统进行裁剪,具体可以裁剪的部分包括如下:
RK的kernel是一个通用版本的kernel,为了兼容各个芯片会把每个芯片的配置和产品上面的需要的外设都配置编译,这样就会导致kernel的固件比较大,固件大就会影响系统开机速度。按这个思路我们可以针对每个具体的产品对kernel进行瘦身裁剪,下面以RK3566和RK3568芯片平台为例进行裁剪。
项目 | kernel裁剪前 | kernel裁剪后 |
---|---|---|
kernel.img固件大小 | 31M | 26M |
uboot启动耗时 | 1211.90 ms | 1139.649 ms |
kernel启动完到init | 4.990744s | 1.017721s |
android启动完成 | 25.541467s | 19.436804s |
启动时间可以根据如下log判断:
Adding bank: 0x00200000 - 0x08400000 (size: 0x08200000)
Adding bank: 0x09400000 - 0x80000000 (size: 0x76c00000)
Total: 1139.649 ms
[ 1.014414] Run /init as init process
[ 1.017721] init: init first stage started!
[ 19.436711] init: Service 'bootanim' (pid 170) exited with status 0 oneshot service took 16.457001 seconds in background
[ 19.436804] init: Sending signal 9 to service 'bootanim' (pid 170) process group...
裁剪主要是对rockchip_defconfig的配置内容进行裁剪,具体如下:
diff --git a/arch/arm64/configs/rockchip_defconfig b/arch/arm64/configs/rockchip_defconfig
old mode 100644
new mode 100755
index b0f9a348a881..6be9a9d1a48b
--- a/arch/arm64/configs/rockchip_defconfig
+++ b/arch/arm64/configs/rockchip_defconfig
@@ -10,9 +10,9 @@ CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
CONFIG_PSI=y
# 把内核的配置信息编译进内核中,以后可以通过scripts/extract-ikconfig脚本从内核镜像中提取这些信息, 可以去掉
-CONFIG_IKCONFIG=y
-CONFIG_IKCONFIG_PROC=y
-CONFIG_IKHEADERS=m
+# CONFIG_IKCONFIG is not set
+# CONFIG_IKCONFIG_PROC is not set
+# CONFIG_IKHEADERS is not set
CONFIG_LOG_BUF_SHIFT=19
CONFIG_CGROUPS=y
CONFIG_MEMCG=y
@@ -44,10 +44,10 @@ CONFIG_EMBEDDED=y
# CONFIG_COMPAT_BRK is not set
CONFIG_PROFILING=y
CONFIG_ARCH_ROCKCHIP=y
#PCIE的配置,可以根据产品需要进行配置,因为RK3566开发板上面没有PCIE,所以这里就删掉PCIE配置
-CONFIG_PCI=y
-CONFIG_PCIEPORTBUS=y
-CONFIG_PCIE_ROCKCHIP_HOST=y
-CONFIG_PCIE_DW_ROCKCHIP=y
+# CONFIG_PCI is not set
+# CONFIG_PCIEPORTBUS is not set
+# CONFIG_PCIE_ROCKCHIP_HOST is not set
+# CONFIG_PCIE_DW_ROCKCHIP is not set
# CONFIG_ARM64_ERRATUM_826319 is not set
# CONFIG_ARM64_ERRATUM_827319 is not set
# CONFIG_ARM64_ERRATUM_824069 is not set
@@ -357,7 +357,7 @@ CONFIG_STMMAC_ETH=y
# CONFIG_NET_VENDOR_VIA is not set
# CONFIG_NET_VENDOR_WIZNET is not set
CONFIG_ROCKCHIP_PHY=y
# RK630根据产品需要进行配置,RK3566开发板上面没有所以去掉
-CONFIG_RK630_PHY=y
+# CONFIG_RK630_PHY is not set
CONFIG_PPP=y
CONFIG_PPP_BSDCOMP=y
CONFIG_PPP_DEFLATE=y
@@ -375,27 +375,27 @@ CONFIG_SLIP_MODE_SLIP6=y
CONFIG_USB_CATC=y
CONFIG_USB_KAWETH=y
CONFIG_USB_PEGASUS=y
#USB转以太网模块,根据产品需要进行配置,RK3566开发板上面没有所以去掉
-CONFIG_USB_RTL8150=y
-CONFIG_USB_RTL8152=y
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_RTL8152 is not set
CONFIG_USB_USBNET=y
CONFIG_USB_NET_CDC_EEM=y
CONFIG_USB_NET_CDC_MBIM=y
#USB网卡,根据产品需要进行配置,RK3566开发板上面没有所以去掉
-CONFIG_USB_NET_DM9601=y
-CONFIG_USB_NET_SMSC75XX=y
-CONFIG_USB_NET_SMSC95XX=y
-CONFIG_USB_NET_GL620A=y
+# CONFIG_USB_NET_DM9601 is not set
+# CONFIG_USB_NET_SMSC75XX is not set
+# CONFIG_USB_NET_SMSC95XX is not set
+# CONFIG_USB_NET_GL620A is not set
CONFIG_USB_NET_PLUSB=y
-CONFIG_USB_NET_MCS7830=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_MCS7830 is not set
+# CONFIG_USB_NET_RNDIS_HOST=y
+# CONFIG_USB_ALI_M5632 is not set
+# CONFIG_USB_AN2720 is not set
+# CONFIG_USB_EPSON2888 is not set
+# CONFIG_USB_KC2190 is not set
+# CONFIG_USB_NET_CX82310_ETH is not set
CONFIG_USB_NET_KALMIA=y
CONFIG_USB_NET_QMI_WWAN=y
CONFIG_USB_HSO=y
-CONFIG_USB_NET_INT51X1=y
+# CONFIG_USB_NET_INT51X1 is not set
CONFIG_USB_IPHETH=y
CONFIG_USB_SIERRA_NET=y
# CONFIG_WLAN_VENDOR_ADMTEK is not set
@@ -417,80 +417,80 @@ CONFIG_USB_SIERRA_NET=y
CONFIG_WL_ROCKCHIP=y
CONFIG_WIFI_BUILD_MODULE=y
#WIFI模块,根据产品需要进行配置,RK3566开发板上面用的是AP6XXX,其他的几个配置去掉
CONFIG_AP6XXX=m
-CONFIG_RTL8723CS=m
-CONFIG_RTL8821CS=m
-CONFIG_RTL8822BS=m
-CONFIG_LTE=y
-CONFIG_LTE_RM310=y
+# CONFIG_RTL8723CS is not set
+# CONFIG_RTL8821CS is not set
+# CONFIG_RTL8822BS is not set
+# CONFIG_LTE is not set
+# CONFIG_LTE_RM310 is not set
CONFIG_INPUT_EVDEV=y
CONFIG_KEYBOARD_ADC=y
# CONFIG_KEYBOARD_ATKBD is not set
#通过GPIO来做按键,RK3566 EVB板子是通过ADC,所以这里去掉GPIO的配置项
-CONFIG_KEYBOARD_GPIO=y
+# CONFIG_KEYBOARD_GPIO is not set
# CONFIG_INPUT_MOUSE is not set
CONFIG_INPUT_JOYSTICK=y
CONFIG_JOYSTICK_XPAD=y
CONFIG_JOYSTICK_XPAD_FF=y
CONFIG_JOYSTICK_XPAD_LEDS=y
#USB触摸板,根据需要配置,RK3566开发板上面没有所以去掉
-CONFIG_INPUT_TABLET=y
-CONFIG_TABLET_USB_ACECAD=y
-CONFIG_TABLET_USB_AIPTEK=y
-CONFIG_TABLET_USB_GTCO=y
-CONFIG_TABLET_USB_HANWANG=y
-CONFIG_TABLET_USB_KBTAB=y
+#CONFIG_INPUT_TABLET is not set
+#CONFIG_TABLET_USB_ACECAD is not set
+#CONFIG_TABLET_USB_AIPTEK is not set
+#CONFIG_TABLET_USB_GTCO is not set
+#CONFIG_TABLET_USB_HANWANG is not set
+#CONFIG_TABLET_USB_KBTAB= is not set
CONFIG_INPUT_TOUCHSCREEN=y
#触摸屏,根据需要配置,RK3566开发板用的是GT9XX,其他的没用所以去掉,只留下需要的
-CONFIG_TOUCHSCREEN_GSLX6801=y
-CONFIG_TOUCHSCREEN_GSLX680_PAD=y
-CONFIG_TOUCHSCREEN_GSLX680_VR=y
-CONFIG_TOUCHSCREEN_GSL3673=y
-CONFIG_TOUCHSCREEN_GSL3673_800X1280=y
-CONFIG_TOUCHSCREEN_GSL3676=y
+#CONFIG_TOUCHSCREEN_GSLX6801 is not set
+#CONFIG_TOUCHSCREEN_GSLX680_PAD is not set
+#CONFIG_TOUCHSCREEN_GSLX680_VR is not set
+#CONFIG_TOUCHSCREEN_GSL3673 is not set
+#CONFIG_TOUCHSCREEN_GSL3673_800X1280 is not set
+#CONFIG_TOUCHSCREEN_GSL3676 is not set
CONFIG_TOUCHSCREEN_GT9XX=y
-CONFIG_TOUCHSCREEN_HYN_CST2XX=y
-CONFIG_TOUCHSCREEN_WACOM_W9013=y
+#CONFIG_TOUCHSCREEN_HYN_CST2XX is not set
+#CONFIG_TOUCHSCREEN_WACOM_W9013 is not set
CONFIG_TOUCHSCREEN_GT1X=y
-CONFIG_TOUCHSCREEN_FTS=y
-CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP5=y
-CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP5_DEVICETREE_SUPPORT=y
-CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP5_I2C=y
-CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP5_DEVICE_ACCESS=y
-CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP5_LOADER=y
-CONFIG_ROCKCHIP_REMOTECTL=y
-CONFIG_ROCKCHIP_REMOTECTL_PWM=y
# SENSOR相关的配置,根据需要配置,RK3566 EVB没有sensor所以都去掉
-CONFIG_SENSOR_DEVICE=y
-CONFIG_GSENSOR_DEVICE=y
-CONFIG_GS_MMA8452=y
-CONFIG_MPU6880_ACC=y
-CONFIG_MPU6500_ACC=y
-CONFIG_GS_KXTJ9=y
-CONFIG_GS_LIS3DH=y
-CONFIG_GS_MMA7660=y
-CONFIG_GS_MC3230=y
-CONFIG_GS_SC7660=y
-CONFIG_GS_SC7A20=y
-CONFIG_GS_SC7A30=y
-CONFIG_GS_MXC6655XA=y
-CONFIG_GS_LSM303D=y
-CONFIG_LSM330_ACC=y
-CONFIG_BMA2XX_ACC=y
-CONFIG_GS_DA223=y
-CONFIG_COMPASS_DEVICE=y
-CONFIG_COMPASS_AK8975=y
-CONFIG_COMPASS_AK8963=y
-CONFIG_GYROSCOPE_DEVICE=y
-CONFIG_GYRO_L3G4200D=y
-CONFIG_GYRO_L3G20D=y
-CONFIG_GYRO_EWTSA=y
-CONFIG_GYRO_MPU6500=y
-CONFIG_GYRO_MPU6880=y
-CONFIG_GYRO_LSM330=y
-CONFIG_LIGHT_DEVICE=y
-CONFIG_LS_CM3217=y
-CONFIG_LS_CM3218=y
-CONFIG_LS_STK3410=y
-CONFIG_PROXIMITY_DEVICE=y
-CONFIG_PS_STK3410=y
-CONFIG_HALL_DEVICE=y
-CONFIG_HS_MH248=y
+#CONFIG_TOUCHSCREEN_FTS is not set
+#CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP5 is not set
+#CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP5_DEVICETREE_SUPPORT is not set
+#CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP5_I2C is not set
+#CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP5_DEVICE_ACCESS is not set
+#CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP5_LOADER is not set
+#CONFIG_ROCKCHIP_REMOTECTL is not set
+#CONFIG_ROCKCHIP_REMOTECTL_PWM is not set
+#CONFIG_SENSOR_DEVICE is not set
+#CONFIG_GSENSOR_DEVICE is not set
+#CONFIG_GS_MMA8452 is not set
+#CONFIG_MPU6880_ACC is not set
+#CONFIG_MPU6500_ACC is not set
+#CONFIG_GS_KXTJ9 is not set
+#CONFIG_GS_LIS3DH is not set
+#CONFIG_GS_MMA7660 is not set
+#CONFIG_GS_MC3230 is not set
+#CONFIG_GS_SC7660 is not set
+#CONFIG_GS_SC7A20 is not set
+#CONFIG_GS_SC7A30 is not set
+#CONFIG_GS_MXC6655XA is not set
+#CONFIG_GS_LSM303D is not set
+#CONFIG_LSM330_ACC is not set
+#CONFIG_BMA2XX_ACC is not set
+#CONFIG_GS_DA223 is not set
+#CONFIG_COMPASS_DEVICE is not set
+#CONFIG_COMPASS_AK8975 is not set
+#CONFIG_COMPASS_AK8963 is not set
+#CONFIG_GYROSCOPE_DEVICE is not set
+#CONFIG_GYRO_L3G4200D is not set
+#CONFIG_GYRO_L3G20D is not set
+#CONFIG_GYRO_EWTSA is not set
+#CONFIG_GYRO_MPU6500 is not set
+#CONFIG_GYRO_MPU6880 is not set
+#CONFIG_GYRO_LSM330 is not set
+#CONFIG_LIGHT_DEVICE is not set
+#CONFIG_LS_CM3217 is not set
+#CONFIG_LS_CM3218 is not set
+#CONFIG_LS_STK3410 is not set
+#CONFIG_PROXIMITY_DEVICE is not set
+#CONFIG_PS_STK3410 is not set
+#CONFIG_HALL_DEVICE is not set
+#CONFIG_HS_MH248 is not set
CONFIG_INPUT_MISC=y
CONFIG_INPUT_UINPUT=y
CONFIG_INPUT_RK805_PWRKEY=y
@@ -511,9 +511,9 @@ CONFIG_HW_RANDOM_ROCKCHIP=y
CONFIG_I2C_CHARDEV=y
CONFIG_I2C_GPIO=y
CONFIG_I2C_RK3X=y
# SPI RK3566 EVB板没有使用,所以去掉
-CONFIG_SPI=y
-CONFIG_SPI_ROCKCHIP=y
-CONFIG_SPI_SPIDEV=y
+# CONFIG_SPI is not set
+# CONFIG_SPI_ROCKCHIP is not set
+# CONFIG_SPI_SPIDEV is not set
CONFIG_PINCTRL_RK805=y
CONFIG_GPIO_SYSFS=y
CONFIG_POWER_AVS=y
@@ -521,12 +521,12 @@ CONFIG_ROCKCHIP_IODOMAIN=y
CONFIG_POWER_RESET_GPIO=y
CONFIG_SYSCON_REBOOT_MODE=y
CONFIG_TEST_POWER=y
# 充电部分,因为RK3566没有带电池,所以去掉
-CONFIG_CHARGER_BQ25700=y
-CONFIG_BATTERY_CW2015=y
-CONFIG_BATTERY_RK817=y
-CONFIG_CHARGER_RK817=y
-CONFIG_BATTERY_RK818=y
-CONFIG_CHARGER_RK818=y
+#CONFIG_CHARGER_BQ25700 is not set
+#CONFIG_BATTERY_CW2015 is not set
+#CONFIG_BATTERY_RK817 is not set
+#CONFIG_CHARGER_RK817 is not set
+#CONFIG_BATTERY_RK818 is not set
+#CONFIG_CHARGER_RK818 is not set
CONFIG_THERMAL=y
CONFIG_THERMAL_WRITABLE_TRIPS=y
CONFIG_THERMAL_DEFAULT_GOV_POWER_ALLOCATOR=y
@@ -536,26 +536,26 @@ CONFIG_THERMAL_GOV_USER_SPACE=y
CONFIG_CPU_THERMAL=y
CONFIG_DEVFREQ_THERMAL=y
CONFIG_ROCKCHIP_THERMAL=y
# 根据实际芯片进行配置,这里只要配置RK3568
-CONFIG_RK3368_THERMAL=y
+#CONFIG_RK3368_THERMAL is not set
CONFIG_WATCHDOG=y
CONFIG_DW_WATCHDOG=y
-CONFIG_MFD_RK618=y
-CONFIG_MFD_RK628=y
-CONFIG_MFD_RK630_I2C=y
+#CONFIG_MFD_RK618 is not set
+#CONFIG_MFD_RK628 is not set
+#CONFIG_MFD_RK630_I2C is not set
CONFIG_MFD_RK808=y
# fusb根据实际需要配置,RK3566开发板上面没有所以去掉
-CONFIG_FUSB_30X=y
+#CONFIG_FUSB_30X is not set
CONFIG_REGULATOR=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
# REGULATOR配置,根据实际需要配置,RK3566开发板使用的是RK809,去掉其他不需要的
-CONFIG_REGULATOR_ACT8865=y
+#CONFIG_REGULATOR_ACT8865 is not set
CONFIG_REGULATOR_FAN53555=y
CONFIG_REGULATOR_GPIO=y
-CONFIG_REGULATOR_LP8752=y
-CONFIG_REGULATOR_MP8865=y
+#CONFIG_REGULATOR_LP8752 is not set
+#CONFIG_REGULATOR_MP8865 is not set
CONFIG_REGULATOR_PWM=y
CONFIG_REGULATOR_RK808=y
-CONFIG_REGULATOR_TPS65132=y
+#CONFIG_REGULATOR_TPS65132 is not set
CONFIG_REGULATOR_XZ3216=y
-CONFIG_REGULATOR_DIO5632=y
+#CONFIG_REGULATOR_DIO5632 is not set
CONFIG_MEDIA_SUPPORT=y
CONFIG_MEDIA_CAMERA_SUPPORT=y
CONFIG_MEDIA_CEC_SUPPORT=y
@@ -565,28 +565,28 @@ CONFIG_MEDIA_USB_SUPPORT=y
CONFIG_USB_VIDEO_CLASS=y
CONFIG_V4L_PLATFORM_DRIVERS=y
CONFIG_VIDEO_ROCKCHIP_CIF=y
# ISP1是rk3288 RK3326 RK3399上面使用,根据实际芯片进行配置
-CONFIG_VIDEO_ROCKCHIP_ISP1=y
+# CONFIG_VIDEO_ROCKCHIP_ISP1 is not set
CONFIG_VIDEO_ROCKCHIP_ISP=y
# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set
# camera的sensor型号,根据实际需要进行配置,删掉不需要的配置
-CONFIG_VIDEO_DW9714=y
-CONFIG_VIDEO_VM149C=y
-CONFIG_VIDEO_TC35874X=y
-CONFIG_VIDEO_RK628_CSI=y
-CONFIG_VIDEO_LT6911UXC=y
-CONFIG_VIDEO_LT8619C=y
-CONFIG_VIDEO_OV2680=y
-CONFIG_VIDEO_OV5648=y
+# CONFIG_VIDEO_DW9714=y
+# CONFIG_VIDEO_VM149C=y
+# CONFIG_VIDEO_TC35874X=y
+# CONFIG_VIDEO_RK628_CSI=y
+# CONFIG_VIDEO_LT6911UXC=y
+# CONFIG_VIDEO_LT8619C=y
+# CONFIG_VIDEO_OV2680=y
+# CONFIG_VIDEO_OV5648=y
CONFIG_VIDEO_OV5695=y
-CONFIG_VIDEO_OV8858=y
-CONFIG_VIDEO_OV13850=y
-CONFIG_VIDEO_GC0312=y
-CONFIG_VIDEO_GC032A=y
-CONFIG_VIDEO_GC2145=y
-CONFIG_VIDEO_GC2355=y
-CONFIG_VIDEO_GC2385=y
-CONFIG_VIDEO_GC4C33=y
-CONFIG_VIDEO_GC8034=y
-CONFIG_VIDEO_SGM3784=y
+# CONFIG_VIDEO_OV8858=y
+# CONFIG_VIDEO_OV13850=y
+# CONFIG_VIDEO_GC0312=y
+# CONFIG_VIDEO_GC032A=y
+# CONFIG_VIDEO_GC2145=y
+# CONFIG_VIDEO_GC2355=y
+# CONFIG_VIDEO_GC2385=y
+# CONFIG_VIDEO_GC4C33=y
+# CONFIG_VIDEO_GC8034=y
+# CONFIG_VIDEO_SGM3784=y
# CONFIG_VGA_ARB is not set
CONFIG_DRM=y
CONFIG_DRM_IGNORE_IOTCL_PERMIT=y
@@ -600,31 +600,31 @@ CONFIG_ROCKCHIP_INNO_HDMI=y
CONFIG_ROCKCHIP_LVDS=y
CONFIG_ROCKCHIP_DRM_TVE=y
CONFIG_ROCKCHIP_RGB=y
-CONFIG_DRM_ROCKCHIP_RK618=y
-CONFIG_DRM_ROCKCHIP_RK628=y
+#CONFIG_DRM_ROCKCHIP_RK618 is not set
+#CONFIG_DRM_ROCKCHIP_RK628 is not set
CONFIG_DRM_PANEL_SIMPLE=y
-CONFIG_DRM_RK630_TVE=y
-CONFIG_DRM_RK1000_TVE=y
-CONFIG_DRM_SII902X=y
+#CONFIG_DRM_RK630_TVE is not set
+#CONFIG_DRM_RK1000_TVE is not set
+#CONFIG_DRM_SII902X is not set
CONFIG_DRM_DW_HDMI_I2S_AUDIO=y
CONFIG_DRM_DW_HDMI_CEC=y
# MALI配置,RK356X使用的是BIFROST的驱动,所以删掉其他的配置,MALI_MIDGARD是RK3399上面使用
-CONFIG_MALI400=y
-CONFIG_MALI450=y
+# CONFIG_MALI400 is not set
+# CONFIG_MALI450 is not set
# CONFIG_MALI400_PROFILING is not set
CONFIG_MALI_SHARED_INTERRUPTS=y
CONFIG_MALI_DT=y
CONFIG_MALI_DEVFREQ=y
-CONFIG_MALI_MIDGARD=y
+# CONFIG_MALI_MIDGARD is not set
CONFIG_MALI_EXPERT=y
CONFIG_MALI_PLATFORM_THIRDPARTY=y
CONFIG_MALI_PLATFORM_THIRDPARTY_NAME="rk"
-CONFIG_MALI_DEBUG=y
+# CONFIG_MALI_DEBUG is not set
CONFIG_MALI_PWRSOFT_765=y
CONFIG_MALI_BIFROST=y
CONFIG_MALI_BIFROST_DEVFREQ=y
CONFIG_MALI_PLATFORM_NAME="rk"
CONFIG_MALI_BIFROST_EXPERT=y
-CONFIG_MALI_BIFROST_DEBUG=y
+# CONFIG_MALI_BIFROST_DEBUG is not set
CONFIG_BACKLIGHT_LCD_SUPPORT=y
# CONFIG_LCD_CLASS_DEVICE is not set
CONFIG_BACKLIGHT_CLASS_DEVICE=y
@@ -633,11 +633,11 @@ CONFIG_BACKLIGHT_PWM=y
CONFIG_ROCKCHIP_MULTI_RGA=y
CONFIG_IEP=y
CONFIG_ROCKCHIP_MPP_SERVICE=y
#RK356X上面没有VDPU1 RKVDEC VEPU1,所以删掉
-CONFIG_ROCKCHIP_MPP_RKVDEC=y
+# CONFIG_ROCKCHIP_MPP_RKVDEC is not set
CONFIG_ROCKCHIP_MPP_RKVDEC2=y
CONFIG_ROCKCHIP_MPP_RKVENC=y
-CONFIG_ROCKCHIP_MPP_VDPU1=y
-CONFIG_ROCKCHIP_MPP_VEPU1=y
+# CONFIG_ROCKCHIP_MPP_VDPU1 is not set
+# CONFIG_ROCKCHIP_MPP_VEPU1 is not set
CONFIG_ROCKCHIP_MPP_VDPU2=y
CONFIG_ROCKCHIP_MPP_VEPU2=y
CONFIG_ROCKCHIP_MPP_IEP2=y
@@ -657,21 +657,21 @@ CONFIG_SND_SOC_ROCKCHIP_I2S_TDM=y
CONFIG_SND_SOC_ROCKCHIP_PDM=y
CONFIG_SND_SOC_ROCKCHIP_SPDIF=y
CONFIG_SND_SOC_ROCKCHIP_MULTICODECS=y
# 声卡的配置,根据需要进行配置,删除多余的配置
-CONFIG_SND_SOC_ROCKCHIP_RT5651=y
+#CONFIG_SND_SOC_ROCKCHIP_RT5651 is not set
CONFIG_SND_SOC_ROCKCHIP_HDMI=y
CONFIG_SND_SOC_BT_SCO=y
-CONFIG_SND_SOC_CX2072X=y
+#CONFIG_SND_SOC_CX2072X is not set
CONFIG_SND_SOC_DUMMY_CODEC=y
-CONFIG_SND_SOC_ES7202=y
-CONFIG_SND_SOC_ES7210=y
-CONFIG_SND_SOC_ES7243E=y
-CONFIG_SND_SOC_ES8311=y
-CONFIG_SND_SOC_ES8316=y
-CONFIG_SND_SOC_ES8396=y
-CONFIG_SND_SOC_RK3328=y
+#CONFIG_SND_SOC_ES7202 is not set
+#CONFIG_SND_SOC_ES7210 is not set
+#CONFIG_SND_SOC_ES7243E is not set
+#CONFIG_SND_SOC_ES8311 is not set
+#CONFIG_SND_SOC_ES8316 is not set
+#CONFIG_SND_SOC_ES8396 is not set
+#CONFIG_SND_SOC_RK3328 is not set
CONFIG_SND_SOC_RK817=y
CONFIG_SND_SOC_RK_CODEC_DIGITAL=y
-CONFIG_SND_SOC_RT5640=y
+#CONFIG_SND_SOC_RT5640 is not set
CONFIG_SND_SOC_SPDIF=y
CONFIG_SND_SIMPLE_CARD=y
CONFIG_HIDRAW=y
@@ -826,13 +826,13 @@ CONFIG_COMMON_CLK_SCMI=y
# CONFIG_COMMON_CLK_XGENE is not set
CONFIG_COMMON_CLK_PWM=y
CONFIG_MAILBOX=y
# 芯片相关配置,根据实际芯片进行配置
-CONFIG_RK3368_MBOX=y
-CONFIG_RK3368_SCPI_PROTOCOL=y
+# CONFIG_RK3368_MBOX is not set
+# CONFIG_RK3368_SCPI_PROTOCOL is not set
CONFIG_ROCKCHIP_IOMMU=y
-CONFIG_CPU_PX30=y
-CONFIG_CPU_RK3328=y
-CONFIG_CPU_RK3368=y
-CONFIG_CPU_RK3399=y
+# CONFIG_CPU_PX30 is not set
+# CONFIG_CPU_RK3328 is not set
+# CONFIG_CPU_RK3368 is not set
+# CONFIG_CPU_RK3399 is not set
CONFIG_CPU_RK3568=y
CONFIG_ANDROID_VERSION=0x08000000
CONFIG_ROCKCHIP_PM_DOMAINS=y
@@ -874,7 +874,7 @@ CONFIG_ROCKCHIP_EFUSE=y
CONFIG_ROCKCHIP_OTP=y
CONFIG_TEE=y
CONFIG_OPTEE=y
# NAND FLASH配置,根据需要进行配置,RK3566 EVB是用eMMC,所以删掉nand配置
-CONFIG_RK_NAND=y
+# CONFIG_RK_NAND is not set
CONFIG_RK_HEADSET=y
CONFIG_ROCKCHIP_RKNPU=y
CONFIG_EXT4_FS=y
@@ -930,8 +930,8 @@ CONFIG_CRYPTO_ANSI_CPRNG=y
CONFIG_CRYPTO_DEV_ROCKCHIP=y
CONFIG_CRYPTO_DEV_ROCKCHIP_DEV=y
CONFIG_PRINTK_TIME=y
-CONFIG_DEBUG_INFO=y
-CONFIG_DEBUG_FS=y
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_FS is not set
CONFIG_MAGIC_SYSRQ=y
CONFIG_SOFTLOCKUP_DETECTOR=y
CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=10
@@ -939,5 +939,5 @@ CONFIG_PANIC_TIMEOUT=5
CONFIG_SCHEDSTATS=y
CONFIG_SCHED_STACK_END_CHECK=y
# CONFIG_DEBUG_PREEMPT is not set
-CONFIG_ENABLE_DEFAULT_TRACERS=y
-CONFIG_BUG_ON_DATA_CORRUPTION=y
+# CONFIG_ENABLE_DEFAULT_TRACERS is not set
+# CONFIG_BUG_ON_DATA_CORRUPTION=y is not set
UBOOT的启动时间包括uboot本身的代码运行时间加上加载boot.img(包含kernel和dtb)的时间,加载boot.img的时间上面已经介绍如何裁剪kernel,下面在介绍如何裁剪uboot使代码运行时间减少。
以RK356X平台为例进行裁剪:
裁剪前后uboot阶段耗时对比
项目 | uboot裁剪前 | uboot裁剪后 |
---|---|---|
uboot启动耗时 | 1139.649 ms | 1117.740 ms |
@rk-intel-1:~/1_Android11_78/u-boot$ git diff
diff --git a/configs/rk3568_defconfig b/configs/rk3568_defconfig
index d2742454eb..52a1352450 100644
--- a/configs/rk3568_defconfig
+++ b/configs/rk3568_defconfig
@@ -13,9 +13,9 @@ CONFIG_SPL_SERIAL_SUPPORT=y
CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
CONFIG_TARGET_EVB_RK3568=y
CONFIG_SPL_LIBDISK_SUPPORT=y
#SPI NAND 和 NOR,根据产品需要配置,RK3566 EVB板子是EMMC存储,所以不需要nand的配置
-CONFIG_SPL_NAND_SUPPORT=y
-CONFIG_SPL_SPI_FLASH_SUPPORT=y
-CONFIG_SPL_SPI_SUPPORT=y
+# CONFIG_SPL_NAND_SUPPORT=y
+# CONFIG_SPL_SPI_FLASH_SUPPORT=y
+# CONFIG_SPL_SPI_SUPPORT=y
CONFIG_DEFAULT_DEVICE_TREE="rk3568-evb"
CONFIG_DEBUG_UART=y
CONFIG_FIT=y
@@ -29,7 +29,7 @@ CONFIG_BOOTDELAY=0
CONFIG_SYS_CONSOLE_INFO_QUIET=y
# CONFIG_DISPLAY_CPUINFO is not set
CONFIG_ANDROID_BOOTLOADER=y
#AVB是Android Verified Boot,可以根据产品需要配置,如果无安全需求的可以关掉,需要配置Android上层的配置使用
-CONFIG_ANDROID_AVB=y
+# CONFIG_ANDROID_AVB=y
CONFIG_ANDROID_BOOT_IMAGE_HASH=y
CONFIG_SPL_BOARD_INIT=y
# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
@@ -40,8 +40,8 @@ CONFIG_SPL_SHA256_SUPPORT=y
CONFIG_SPL_CRYPTO_SUPPORT=y
CONFIG_SPL_HASH_SUPPORT=y
CONFIG_SPL_MMC_WRITE=y
# MTD命令集,可以不需要
-CONFIG_SPL_MTD_SUPPORT=y
-CONFIG_SPL_MTD_WRITE=y
+# CONFIG_SPL_MTD_SUPPORT=y
+# CONFIG_SPL_MTD_WRITE=y
CONFIG_SPL_ATF=y
CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y
CONFIG_SPL_AB=y
@@ -65,8 +65,8 @@ CONFIG_CMD_GPT=y
CONFIG_CMD_BOOT_ANDROID=y
CONFIG_CMD_BOOT_ROCKCHIP=y
CONFIG_CMD_MMC=y
-CONFIG_CMD_MTD=y
-CONFIG_CMD_NAND=y
+# CONFIG_CMD_MTD=y
+# CONFIG_CMD_NAND=y
CONFIG_CMD_USB=y
CONFIG_CMD_USB_MASS_STORAGE=y
# CONFIG_CMD_ITEST is not set
@@ -113,34 +113,34 @@ CONFIG_MMC_DW_ROCKCHIP=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_SDMA=y
CONFIG_MMC_SDHCI_ROCKCHIP=y
-CONFIG_MTD=y
-CONFIG_MTD_BLK=y
-CONFIG_MTD_DEVICE=y
-CONFIG_NAND=y
-CONFIG_NAND_ROCKCHIP_V9=y
-CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
-CONFIG_SYS_NAND_U_BOOT_OFFS=0x8000
-CONFIG_SYS_NAND_U_BOOT_OFFS_REDUND=0x10000
-CONFIG_MTD_SPI_NAND=y
-CONFIG_SPI_FLASH=y
-CONFIG_SF_DEFAULT_SPEED=20000000
-CONFIG_SPI_FLASH_EON=y
-CONFIG_SPI_FLASH_GIGADEVICE=y
-CONFIG_SPI_FLASH_MACRONIX=y
-CONFIG_SPI_FLASH_WINBOND=y
-CONFIG_SPI_FLASH_XMC=y
-CONFIG_SPI_FLASH_MTD=y
-CONFIG_DM_ETH=y
-CONFIG_DM_ETH_PHY=y
-CONFIG_DWC_ETH_QOS=y
-CONFIG_GMAC_ROCKCHIP=y
-CONFIG_PHY_ROCKCHIP_INNO_USB2=y
-CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
-CONFIG_PHY_ROCKCHIP_NANENG_EDP=y
+# CONFIG_MTD=y
+# CONFIG_MTD_BLK=y
+# CONFIG_MTD_DEVICE=y
+# CONFIG_NAND=y
+# CONFIG_NAND_ROCKCHIP_V9=y
+# CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
+# CONFIG_SYS_NAND_U_BOOT_OFFS=0x8000
+# CONFIG_SYS_NAND_U_BOOT_OFFS_REDUND=0x10000
+# CONFIG_MTD_SPI_NAND=y
+# CONFIG_SPI_FLASH=y
+# CONFIG_SF_DEFAULT_SPEED=20000000
+# CONFIG_SPI_FLASH_EON=y
+# CONFIG_SPI_FLASH_GIGADEVICE=y
+# CONFIG_SPI_FLASH_MACRONIX=y
+# CONFIG_SPI_FLASH_WINBOND=y
+# CONFIG_SPI_FLASH_XMC=y
+# CONFIG_SPI_FLASH_MTD=y
+# CONFIG_DM_ETH=y
+# CONFIG_DM_ETH_PHY=y
+# CONFIG_DWC_ETH_QOS=y
+# CONFIG_GMAC_ROCKCHIP=y
+# CONFIG_PHY_ROCKCHIP_INNO_USB2=y
+# CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
+# CONFIG_PHY_ROCKCHIP_NANENG_EDP=y
CONFIG_PINCTRL=y
CONFIG_SPL_PINCTRL=y
CONFIG_DM_FUEL_GAUGE=y
-CONFIG_POWER_FG_RK817=y
+# CONFIG_POWER_FG_RK817=y
CONFIG_IO_DOMAIN=y
CONFIG_ROCKCHIP_IO_DOMAIN=y
CONFIG_DM_PMIC=y
@@ -150,8 +150,8 @@ CONFIG_REGULATOR_PWM=y
CONFIG_DM_REGULATOR_FIXED=y
CONFIG_DM_REGULATOR_GPIO=y
CONFIG_REGULATOR_RK8XX=y
#充电部分,RK3566不带电池,所以不需要充电和电池相关配置
-CONFIG_DM_CHARGE_DISPLAY=y
-CONFIG_CHARGE_ANIMATION=y
+# CONFIG_DM_CHARGE_DISPLAY=y
+# CONFIG_CHARGE_ANIMATION=y
CONFIG_PWM_ROCKCHIP=y
CONFIG_RAM=y
CONFIG_SPL_RAM=y
@@ -210,11 +210,11 @@ CONFIG_LZMA=y
CONFIG_SPL_GZIP=y
CONFIG_ERRNO_STR=y
# CONFIG_EFI_LOADER is not set
-CONFIG_AVB_LIBAVB=y
-CONFIG_AVB_LIBAVB_AB=y
-CONFIG_AVB_LIBAVB_ATX=y
-CONFIG_AVB_LIBAVB_USER=y
-CONFIG_RK_AVB_LIBAVB_USER=y
+# CONFIG_AVB_LIBAVB=y
+# CONFIG_AVB_LIBAVB_AB=y
+# CONFIG_AVB_LIBAVB_ATX=y
+# CONFIG_AVB_LIBAVB_USER=y
+# CONFIG_RK_AVB_LIBAVB_USER=y
CONFIG_OPTEE_CLIENT=y
CONFIG_OPTEE_V2=y
CONFIG_OPTEE_ALWAYS_USE_SECURITY_PARTITION=y
(END)
build/make下面,可以在如下文件中对系统服务和资源进行裁剪,根据实际需要裁剪
target/product/base_system.mk
target/product/base_vendor.mk
target/product/full_base.mk
target/product/handheld_product.mk
target/product/handheld_system.mk
target/product/handheld_system_ext.mk
target/product/languages_default.mk
target/product/media_product.mk
target/product/media_system.mk
Android11的代码中可以在vendor/rockchip/common/apps/apps.mk中去掉不需要的apk,可以根据需求进行删减,这里面的apk都是可以删减的。
Android12对应的mk文件在device/rockchip/common/modules/rockchip_apps.mk中指定RK的app。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。