嵌入式系统移植 - Kernel : 添加客制化内核配置项

嵌入式系统移植 - Kernel : 添加客制化内核配置项

说明

嵌入式驱动通常遵从模块化设计理念, 内核配置项可以定义全局变量, 驱动开关等, 从而提高驱动灵活性, 一些项目定制需求, 为了不修改源码里面自带的内核配置文件. 所以我们添加属于自己项目的内核配置文件就变得尤为重要了.

效果图

在这里插入图片描述

修改源码

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index dc3edbf..79b7ee7 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -2444,3 +2444,5 @@ source "crypto/Kconfig"
 source "lib/Kconfig"
 
 source "arch/arm/kvm/Kconfig"
+
+source "sunchip/Kconfig"
diff --git a/sunchip/Kconfig b/sunchip/Kconfig
new file mode 100755
index 0000000..2e55e3c
--- /dev/null
+++ b/sunchip/Kconfig
@@ -0,0 +1,18 @@
+menu "Sunchip setup"
+
+choice
+    bool "Sunchip Soc Arch Type"
+    default SUNCHIP_ARCH_ROCKCHIP_RK3128
+    config SUNCHIP_ARCH_ROCKCHIP_RK3128
+        tristate  "Soc is RK3128"
+    
+    config SUNCHIP_ARCH_ROCKCHIP_RK3126C
+        tristate  "Soc is RK3126"
+endchoice
+
+config SUNCHIP_PACKAGE_IMAGE
+	bool "Sunchip Kernel Uncompressed Method"
+	default y
+	help
+
+endmenu
发布了53 篇原创文章 · 获赞 19 · 访问量 8万+

猜你喜欢

转载自blog.csdn.net/qq_33443989/article/details/102984473