sm7250-common: init: Tuning UFS clkgate and ah8 during boot time

Disabling UFS clkgate and ah8 during boot time helps in reducing
IO delays, which helps in reducing the total boot time. This change
will disable UFS clkgate and ah8 during early-init and then enable
it back after boot completion.

Change-Id: I6a10cd57a30fe3bdc4fba72a0d84cdfa3b1fd513

Signed-off-by: Omkar Chandorkar <gotenksIN@aosip.dev>
Signed-off-by: aswin7469 <aswinas@pixysos.com>
This commit is contained in:
Ziqi Chen
2022-03-16 13:32:31 +09:00
committed by Sandeep P S
parent 67c70612ba
commit 3caf4a5a8b

View File

@@ -61,6 +61,10 @@ on early-init
#Disable UFS clock scaling
write /sys/bus/platform/devices/1d84000.ufshc/clkscale_enable 0
# Disable UFS auto_hibern8
write /sys/bus/platform/devices/1d84000.ufshc/auto_hibern8 0
# Disable UFS clock gating
write /sys/bus/platform/devices/1d84000.ufshc/clkgate_enable 0
chown root system /dev/kmsg
chmod 0620 /dev/kmsg
@@ -496,6 +500,10 @@ on property:sys.boot_completed=1
write /dev/kmsg "Boot completed "
#Enable UFS clock scaling back
write /sys/bus/platform/devices/1d84000.ufshc/clkscale_enable 1
#Enable UFS auto_hibern8 back
write /sys/bus/platform/devices/1d84000.ufshc/auto_hibern8 5000
#Enable UFS clock gating back
write /sys/bus/platform/devices/1d84000.ufshc/clkgate_enable 1
#Reset read ahead for dm-0 and dm-1 to 512kb
write /sys/block/dm-0/queue/read_ahead_kb 512
write /sys/block/dm-1/queue/read_ahead_kb 512