mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
693ed82bddcccd1308d8875338a5091d07d28383
This patch minimize config for IPC products picked from
branch develop-4.19 and then do minimize work on branch develop-5.10.
System Features Disabled:
- CONFIG_TEE
- CONFIG_OPTEE
- CONFIG_ARM_PSCI
- CONFIG_IO_URING
- CONFIG_LOG_BUF_SHIFT=16
+ CONFIG_LOG_BUF_SHIFT=14
- CONFIG_CPU_ISOLATION
- CONFIG_LOG_CPU_MAX_BUF_SHIFT=0
- CONFIG_ARM_ERRATA_643719
- CONFIG_SMP
- CONFIG_SCHED_MC
Module Disabled:
- CONFIG_MFD_RK808
- CONFIG_ROCKCHIP_IODOMAIN (hw auto on rv1106)
- CONFIG_IOMMU_SUPPORT
- CONFIG_ROCKCHIP_SIP
- CONFIG_ROCKCHIP_SUSPEND_MODE
- CONFIG_VIDEO_ROCKCHIP_ISPP
- CONFIG_ROCKCHIP_PM_DOMAINS
Module Features Disabled:
- CONFIG_MEDIA_CEC_SUPPORT
- CONFIG_MEDIA_ANALOG_TV_SUPPORT
- CONFIG_MEDIA_DIGITAL_TV_SUPPORT
- CONFIG_MEDIA_RADIO_SUPPORT
- CONFIG_MEDIA_SDR_SUPPORT
- CONFIG_MEDIA_TEST_SUPPORT
- CONFIG_ROCKCHIP_MPP_RKVDEC
- CONFIG_ROCKCHIP_MPP_VDPU2
- CONFIG_ROCKCHIP_MPP_IEP2
- CONFIG_NVMEM_SYSFS
- CONFIG_DEBUG_MISC
- CONFIG_ROCKCHIP_CLK_COMPENSATION
- CONFIG_CLK_RV1108
- CONFIG_CLK_RV1126
- CONFIG_CLK_RK3036
- CONFIG_CLK_RK312X
- CONFIG_CLK_RK3188
- CONFIG_CLK_RK322X
- CONFIG_CLK_RK3288
Changelog:
v11: Disable SMP for single A7
- CONFIG_CPU_ISOLATION
- CONFIG_LOG_CPU_MAX_BUF_SHIFT=0
- CONFIG_ARM_ERRATA_643719
- CONFIG_SMP
- CONFIG_SCHED_MC
v10: Disable rockchip power domain
- CONFIG_ROCKCHIP_PM_DOMAINS
v9: Decrease log buf from 64KB to 16KB
- CONFIG_LOG_BUF_SHIFT=16
+ CONFIG_LOG_BUF_SHIFT=14
$ ./scripts/bloat-o-meter kernel/printk/printk.o.old kernel/printk/printk.o
add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-202752 (-202752)
Function old new delta
_printk_rb_static_descs 24576 6144 -18432
__log_buf 65536 16384 -49152
_printk_rb_static_infos 180224 45056 -135168
Total: Before=297532, After=94780, chg -68.14%
The follow commit make DATA/BSS 200+ KB larger, Currently, just
decrease CONFIG_LOG_BUF_SHIFT to minimize.
896fbe20b4 ("printk: use the lockless ringbuffer")
v8: Disable io uring
- CONFIG_IO_URING
v7: Disable clk for other SoC
Disable clk compensation
v6: Enable CONFIG_CPU_RV1106
- CONFIG_CPU_RV1126=y
+ CONFIG_CPU_RV1106=y
v5: Disable SIP with no ATF/TEE
- CONFIG_ROCKCHIP_SIP=y
- CONFIG_ROCKCHIP_SUSPEND_MODE=y
- CONFIG_TEE=y
- CONFIG_OPTEE=y
- CONFIG_ARM_PSCI=y
This also fix panic on FPGA which has no TEE/ATF.
Fixes: b9c1178cad ("drm/rockchip: gem: dynamic get ddr map info for reorder page")
[<b0013a48>] (unwind_backtrace) from [<b0010648>] (show_stack+0x10/0x14)
[<b0010648>] (show_stack) from [<b04653b8>] (dump_stack_lvl+0x90/0xa8)
[<b04653b8>] (dump_stack_lvl) from [<b0376750>] (__invoke_sip_fn_smc+0x20/0x84)
[<b0376750>] (__invoke_sip_fn_smc) from [<b0376dc4>] (sip_smc_request_share_mem+0x24/0x50)
[<b0376dc4>] (sip_smc_request_share_mem) from [<b0376e18>] (sip_smc_get_dram_map+0x28/0x90)
[<b0376e18>] (sip_smc_get_dram_map) from [<b0268b38>] (rockchip_gem_get_ddr_info+0x8/0x28)
[<b0268b38>] (rockchip_gem_get_ddr_info) from [<b0619378>] (rockchip_drm_init+0x50/0x78)
[<b0619378>] (rockchip_drm_init) from [<b0009910>] (do_one_initcall+0x70/0x160)
[<b0009910>] (do_one_initcall) from [<b0602fb0>] (kernel_init_freeable+0x1bc/0x208)
[<b0602fb0>] (kernel_init_freeable) from [<b04684c4>] (kernel_init+0x8/0xf8)
[<b04684c4>] (kernel_init) from [<b00083b8>] (ret_from_fork+0x14/0x3c)
Exception stack(0xb084ffb0 to 0xb084fff8)
ffa0: 00000000 00000000 00000000 00000000
ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
ffe0: 00000000 00000000 00000000 00000000 00000013 00000000
Bad mode in data abort handler detected
Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.10.66 #18
Hardware name: Generic DT based system
PC is at vector_swi+0x4/0x44
LR is at __invoke_sip_fn_smc+0x6c/0x84
v4: Disable iommu support.
- CONFIG_IOMMU_SUPPORT
v3: Switch to KERNEL_XZ for minimize image size.
+ CONFIG_KERNEL_XZ
- CONFIG_KERNEL_LZ4
v2: Disable pmic, iodomain, and some decoders.
v1: Cherry-pick and init config by savedefconfig on develop-5.10:
make ARCH=arm savedefconfig
cp defconfig arch/arm/configs/rv1106_mini_defconfig
As a reference for the original work for the tiny memory products
on branch develop-4.19:
| https://10.10.10.29/c/rk/kernel/+/132901/19
|
| Test based on commit branch: develop-4.19
| b84613bfeb ("ASoC: rockchip: Kconfig: Remove unused PREALLOC_BUFFER_SIZE")
|
| Compiled with rv1126_defconfig;
|
| $ ls -l
| 12881196 arch/arm/boot/Image
| 5950856 arch/arm/boot/zImage (lz4)
| 3643824 arch/arm/boot/zImage (xz)
|
| $ size vmlinux
| text data bss dec hex filename
| 8235528 1998740 256784 10491052 a014ac vmlinux
|
| Compiled with rv1106_mini_defconfig:
|
| $ ls -l
| 5808184 arch/arm/boot/Image
| 3359464 arch/arm/boot/zImage (lz4)
| 2078880 arch/arm/boot/zImage (xz)
|
| Note: xz is smaller but boot slowly.
|
| $ size vmlinux
| text data bss dec hex filename
| 4628287 1169884 141472 5939643 5aa1bb vmlinux
|
| a. + CONFIG_SMP Disabled (for single core):
|
| $ ls -l
| 5733720 arch/arm/boot/Image
| 2007456 arch/arm/boot/zImage (xz)
|
| $ size vmlinux
| text data bss dec hex filename
| 4583931 1136960 135356 5856247 595bf7 vmlinux
|
| b. + CONFIG_THUMB2_KERNEL
|
| $ ls -l
| 4365656 arch/arm/boot/Image ~24% smaller
| 2157208 arch/arm/boot/zImage (xz) bigger than arm inst ?
|
| $ size vmlinux
| text data bss dec hex filename
| 3219691 1136952 135356 4491999 448adf vmlinux
|
| -------------------------------------------------------------------------
|
| Compared to rv1126_defconfig:
|
| SubSystem Disabled:
|
| - CONFIG_BT
| - CONFIG_WIRELESS
| - CONFIG_SCSI
| - CONFIG_INPUT
| - CONFIG_USB
| - CONFIG_NEW_LEDS
| - CONFIG_MAILBOX
|
| Module Disabled:
|
| - CONFIG_RK_FLASH when eMMC
| - CONFIG_ARM_ROCKCHIP_DMC_DEVFREQ
| - CONFIG_ARM_ROCKCHIP_DMC_DEBUG
| - CONFIG_SND_HRTIMER
| - CONFIG_SND_ALOOP
| - CONFIG_SND_PROC_FS
| - CONFIG_SND_DRIVERS
| - CONFIG_SND_SOC_ROCKCHIP_I2S
| - CONFIG_SND_SOC_ROCKCHIP_PDM
| - CONFIG_SND_SOC_DUMMY_CODEC
| - CONFIG_OVERLAY_FS
| - CONFIG_UBIFS_FS when eMMC
| - CONFIG_MTD_UBI
| - CONFIG_SQUASHFS
| - CONFIG_PSTORE
| - CONFIG_VFAT_FS
| - CONFIG_NTFS_FS
| - CONFIG_VIDEO_IMX347
| - CONFIG_VIDEO_IMX378
| - CONFIG_VIDEO_OV4689
| - CONFIG_VIDEO_GC4C33
| - CONFIG_DRM_ROCKCHIP
| - CONFIG_BACKLIGHT_LCD_SUPPORT
| - CONFIG_PHY_ROCKCHIP_INNO_MIPI_DPHY
|
| Module Features Disabled:
|
| - CONFIG_RK_CONSOLE_THREAD
| - CONFIG_NET_KEY
| - CONFIG_SYN_COOKIES
| - CONFIG_PACKET (DHCP related)
| - CONFIG_LBDAF (ext4 2TB+)
| - CONFIG_BLK_DEV_BSG
| - CONFIG_FILE_LOCKING
| - CONFIG_INOTIFY_USER
| - CONFIG_NLS_CODEPAGE_437
| - CONFIG_NLS_ISO8859_1
| - CONFIG_I2C_MUX
| - CONFIG_PTP_1588_CLOCK
| - CONFIG_ARM_CRYPTO
| - CONFIG_CRYPTO_SHA1_ARM
| - CONFIG_CRYPTO_SHA256_ARM
| - CONFIG_CRYPTO_SHA512_ARM
| - CONFIG_STMMAC_ETHTOOL
| - CONFIG_STMMAC_FULL
| - CONFIG_DWMAC_ROCKCHIP_TOOL
| - CONFIG_ETHTOOL
| - CONFIG_FILTER
| - CONFIG_STMMAC_PTP
|
| System Features Disabled:
|
| - CONFIG_HIGHMEM
| - CONFIG_VDSO
| - CONFIG_ZRAM
| - CONFIG_SWAP
| - CONFIG_BLK_DEV_INITRD
| - CONFIG_INITRD_ASYNC
| - CONFIG_KERNEL_MODE_NEON
| - CONFIG_ZSMALLOC
|
| Debug / Profiling Disabled:
|
| - CONFIG_DEBUG_FS
| - CONFIG_IRQ_TIME_ACCOUNTING
| - CONFIG_PERF_EVENTS
| - CONFIG_BUG
| - CONFIG_ELF_CORE
| - CONFIG_SLUB_SYSFS
| - CONFIG_PROFILING
| - CONFIG_PM_DEBUG
| - CONFIG_PM_ADVANCED_DEBUG
| - CONFIG_DEBUG_INFO
| - CONFIG_MAGIC_SYSRQ
| - CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0
| - CONFIG_PANIC_ON_OOPS
| - CONFIG_DEBUG_USER
|
| Buffer Size Decrease:
|
| - CONFIG_SERIAL_8250_NR_UARTS=2
| - CONFIG_SERIAL_8250_RUNTIME_UARTS=2
| - CONFIG_LOG_BUF_SHIFT=16
| - CONFIG_CMA_SIZE_MBYTES=0 Note: cma dts node should be disabled.
|
| Section Align Disabled for minimize Image:
|
| - CONFIG_DEBUG_ALIGN_RODATA
| - CONFIG_STRICT_KERNEL_RWX
| - CONFIG_STRICT_MODULE_RWX
|
| Details see: arch/arm/kernel/vmlinux.lds.S
|
| Compile Optimized for Image:
|
| - CONFIG_STACKPROTECTOR_STRONG
| + CONFIG_CC_OPTIMIZE_FOR_SIZE=y
|
| -------------------------------------------------------------------------
| Changelog:
|
| v20: bring back INITRD for FPGA TEST.
|
| v19: drop CONFIG_SND_SOC_ROCKCHIP_PREALLOC_BUFFER_SIZE=32
|
| Instead, pass module option 'prealloc_buffer_size_kbytes' to specify it.
| any details refer to: Documentation/sound/alsa-configuration.rst
|
| e.g. 32 kbytes prealloc buffer size:
|
| "snd_soc_core.prealloc_buffer_size_kbytes=32"
|
| v18: drop CONFIG_LBDAF by do mke2fs with '-O ^huge_file' option.
|
| v17: bring back features for IPC-emmc FFT(Full Functional Test) passed
|
| + CONFIG_PACKET (dhcp related)
| For support DHCP default.
|
| + CONFIG_DRM_ROCKCHIP
| + CONFIG_ROCKCHIP_VOP
| Currently, drm buffer alloc is still used by user.
| Note: uboot display should be disabled, otherwise, panic on rockchip drm probe.
|
| + CONFIG_LBDAF
| Actually, here should say NO, because it is required to support 2TB+
| devices which we don't need it, but which was enabled default by mke2fs.ext4.
| So, we bring it back temporarily until users do mke2fs.ext4 without
| huge file feature supported.
|
| static code size cost: ~200KB
|
| before:
| $ size vmlinux
| text data bss dec hex filename
| 4469469 1143032 138528 5751029 57c0f5 vmlinux
|
| after:
| $ size vmlinux
| text data bss dec hex filename
| 4628287 1169884 141472 5939643 5aa1bb vmlinux
Change-Id: I5846831e3a43edd45587459866a339db5c42a137
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
…
…
…
…
…
…
…
…
…
…
…
…
…
How do I submit patches to Android Common Kernels
-
BEST: Make all of your changes to upstream Linux. If appropriate, backport to the stable releases. These patches will be merged automatically in the corresponding common kernels. If the patch is already in upstream Linux, post a backport of the patch that conforms to the patch requirements below.
- Do not send patches upstream that contain only symbol exports. To be considered for upstream Linux,
additions of
EXPORT_SYMBOL_GPL()require an in-tree modular driver that uses the symbol -- so include the new driver or changes to an existing driver in the same patchset as the export. - When sending patches upstream, the commit message must contain a clear case for why the patch is needed and beneficial to the community. Enabling out-of-tree drivers or functionality is not not a persuasive case.
- Do not send patches upstream that contain only symbol exports. To be considered for upstream Linux,
additions of
-
LESS GOOD: Develop your patches out-of-tree (from an upstream Linux point-of-view). Unless these are fixing an Android-specific bug, these are very unlikely to be accepted unless they have been coordinated with kernel-team@android.com. If you want to proceed, post a patch that conforms to the patch requirements below.
Common Kernel patch requirements
- All patches must conform to the Linux kernel coding standards and pass
script/checkpatch.pl - Patches shall not break gki_defconfig or allmodconfig builds for arm, arm64, x86, x86_64 architectures (see https://source.android.com/setup/build/building-kernels)
- If the patch is not merged from an upstream branch, the subject must be tagged with the type of patch:
UPSTREAM:,BACKPORT:,FROMGIT:,FROMLIST:, orANDROID:. - All patches must have a
Change-Id:tag (see https://gerrit-review.googlesource.com/Documentation/user-changeid.html) - If an Android bug has been assigned, there must be a
Bug:tag. - All patches must have a
Signed-off-by:tag by the author and the submitter
Additional requirements are listed below based on patch type
Requirements for backports from mainline Linux: UPSTREAM:, BACKPORT:
- If the patch is a cherry-pick from Linux mainline with no changes at all
- tag the patch subject with
UPSTREAM:. - add upstream commit information with a
(cherry picked from commit ...)line - Example:
- if the upstream commit message is
- tag the patch subject with
important patch from upstream
This is the detailed description of the important patch
Signed-off-by: Fred Jones <fred.jones@foo.org>
- then Joe Smith would upload the patch for the common kernel as
UPSTREAM: important patch from upstream
This is the detailed description of the important patch
Signed-off-by: Fred Jones <fred.jones@foo.org>
Bug: 135791357
Change-Id: I4caaaa566ea080fa148c5e768bb1a0b6f7201c01
(cherry picked from commit c31e73121f4c1ec41143423ac6ce3ce6dafdcec1)
Signed-off-by: Joe Smith <joe.smith@foo.org>
- If the patch requires any changes from the upstream version, tag the patch with
BACKPORT:instead ofUPSTREAM:.- use the same tags as
UPSTREAM: - add comments about the changes under the
(cherry picked from commit ...)line - Example:
- use the same tags as
BACKPORT: important patch from upstream
This is the detailed description of the important patch
Signed-off-by: Fred Jones <fred.jones@foo.org>
Bug: 135791357
Change-Id: I4caaaa566ea080fa148c5e768bb1a0b6f7201c01
(cherry picked from commit c31e73121f4c1ec41143423ac6ce3ce6dafdcec1)
[joe: Resolved minor conflict in drivers/foo/bar.c ]
Signed-off-by: Joe Smith <joe.smith@foo.org>
Requirements for other backports: FROMGIT:, FROMLIST:,
- If the patch has been merged into an upstream maintainer tree, but has not yet
been merged into Linux mainline
- tag the patch subject with
FROMGIT: - add info on where the patch came from as
(cherry picked from commit <sha1> <repo> <branch>). This must be a stable maintainer branch (not rebased, so don't uselinux-nextfor example). - if changes were required, use
BACKPORT: FROMGIT: - Example:
- if the commit message in the maintainer tree is
- tag the patch subject with
important patch from upstream
This is the detailed description of the important patch
Signed-off-by: Fred Jones <fred.jones@foo.org>
- then Joe Smith would upload the patch for the common kernel as
FROMGIT: important patch from upstream
This is the detailed description of the important patch
Signed-off-by: Fred Jones <fred.jones@foo.org>
Bug: 135791357
(cherry picked from commit 878a2fd9de10b03d11d2f622250285c7e63deace
https://git.kernel.org/pub/scm/linux/kernel/git/foo/bar.git test-branch)
Change-Id: I4caaaa566ea080fa148c5e768bb1a0b6f7201c01
Signed-off-by: Joe Smith <joe.smith@foo.org>
- If the patch has been submitted to LKML, but not accepted into any maintainer tree
- tag the patch subject with
FROMLIST: - add a
Link:tag with a link to the submittal on lore.kernel.org - add a
Bug:tag with the Android bug (required for patches not accepted into a maintainer tree) - if changes were required, use
BACKPORT: FROMLIST: - Example:
- tag the patch subject with
FROMLIST: important patch from upstream
This is the detailed description of the important patch
Signed-off-by: Fred Jones <fred.jones@foo.org>
Bug: 135791357
Link: https://lore.kernel.org/lkml/20190619171517.GA17557@someone.com/
Change-Id: I4caaaa566ea080fa148c5e768bb1a0b6f7201c01
Signed-off-by: Joe Smith <joe.smith@foo.org>
Requirements for Android-specific patches: ANDROID:
- If the patch is fixing a bug to Android-specific code
- tag the patch subject with
ANDROID: - add a
Fixes:tag that cites the patch with the bug - Example:
- tag the patch subject with
ANDROID: fix android-specific bug in foobar.c
This is the detailed description of the important fix
Fixes: 1234abcd2468 ("foobar: add cool feature")
Change-Id: I4caaaa566ea080fa148c5e768bb1a0b6f7201c01
Signed-off-by: Joe Smith <joe.smith@foo.org>
- If the patch is a new feature
- tag the patch subject with
ANDROID: - add a
Bug:tag with the Android bug (required for android-specific features)
- tag the patch subject with
Description
Languages
C
97.7%
Assembly
1.6%
Makefile
0.3%
Perl
0.1%