pass-hal: tm1: Convert script format to json to improve readability 59/261959/3 accepted/tizen/unified/20210809.061423 submit/tizen/20210809.032652
authorChanwoo Choi <cw00.choi@samsung.com>
Thu, 29 Jul 2021 13:10:30 +0000 (22:10 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Mon, 2 Aug 2021 07:31:13 +0000 (16:31 +0900)
The legacy .conf file format is not better on side of readability.
So that change the configuration file format to json style to improve
readability.

And remove unneeded pass-resource1.conf.

Change-Id: I3a2ae83bb5f2b5d9b8a9566aff24e4e2def2e16c
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
CMakeLists.txt
packaging/pass-hal-tm1.spec
scripts/pass-resource0.conf [deleted file]
scripts/pass-resource0.json [new file with mode: 0644]
scripts/pass-resource1.conf [deleted file]
scripts/pass.conf [deleted file]
scripts/pass.json [new file with mode: 0644]

index 55ac0148cb70a96364fd4d762fabf033fd99429e..e8dc32ea2fd8eb77b9c8ff7ff3da44e94e5f0b07 100644 (file)
@@ -28,9 +28,8 @@ ADD_LIBRARY(${LIBRARY_NAME} SHARED ${SRCS})
 TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${pkgs_LDFLAGS} -ldl)
 
 SET(CONF_FILES
-       ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pass.conf
-       ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pass-resource0.conf
-       ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pass-resource1.conf)
+       ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pass.json
+       ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pass-resource0.json)
 INSTALL(FILES ${CONF_FILES} DESTINATION /hal/etc/pass)
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/pass-hal.conf DESTINATION /hal/lib/tmpfiles.d)
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE DESTINATION ${HAL_LICENSEDIR}/${PROJECT_NAME})
index 8e0a5a7e06dba472c417afc5210f6b8f3a34d0fa..48b08109261ca92a487dd8a46dde5eefe20e8994 100644 (file)
@@ -57,6 +57,5 @@ fi
 %{_hal_licensedir}/%{name}/LICENSE
 %{_hal_libdir}/*.so
 /hal/lib/tmpfiles.d/pass-hal.conf
-%config %{_hal_sysconfdir}/pass/pass.conf
-%config %{_hal_sysconfdir}/pass/pass-resource0.conf
-%config %{_hal_sysconfdir}/pass/pass-resource1.conf
+%config %{_hal_sysconfdir}/pass/pass.json
+%config %{_hal_sysconfdir}/pass/pass-resource0.json
diff --git a/scripts/pass-resource0.conf b/scripts/pass-resource0.conf
deleted file mode 100644 (file)
index 1826157..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-[Pass]
-pass_support=1
-pass_gov_type=1
-
-pass_num_scenario_levels=4
-pass_init_scenario_level=0
-
-####################################################
-### Scenario Level for PMQoS and Thermal Monitor ###
-####################################################
-[ScenarioLevel0]
-limit_min_freq=768000
-limit_max_freq=1300000
-limit_min_cpu=0
-limit_max_cpu=4
-
-[ScenarioLevel1]
-limit_min_freq=1300000
-limit_max_freq=1300000
-limit_min_cpu=3
-limit_max_cpu=4
-
-[ScenarioLevel2]
-limit_min_freq=768000
-limit_max_freq=768000
-limit_min_cpu=0
-limit_max_cpu=2
-
-[ScenarioLevel3]
-limit_min_freq=768000
-limit_max_freq=768000
-limit_min_cpu=0
-limit_max_cpu=1
-
-#########################
-### Scenario of PMQoS ###
-#########################
-[PassScenario]
-pass_scenario_support=yes
-pass_num_scenarios=3
-
-[Scenario0]
-name=AppLaunch
-support=yes
-scenario_level=1
-
-[Scenario1]
-name=UltraPowerSaving
-support=yes
-scenario_level=3
-
-[Scenario2]
-name=Doze
-support=yes
-scenario_level=3
-
-###################################
-### Scenario of Thermal Monitor ###
-###################################
-
-# Following action name are defiend on Tizen platform.
-# The 'temperature' of thermal.scenario must be defined in descending order.
-# If you change the following name, doesn't guarantee the compatibility.
-# - Release, Warning, LimitAction, Shutdown
-
-[thermal]
-thermal_support=yes
-thermal_number_of_scenario=4
-thermal_timer_interval_ms=10000
-
-[thermal.scenario0]
-support=yes
-name=Release
-temperature=70
-timer_interval_ms=10000
-scenario_level=0
-
-[thermal.scenario1]
-support=yes
-name=Warning
-temperature=73
-timer_interval_ms=5000
-
-[thermal.scenario2]
-support=yes
-name=LimitAction
-temperature=75
-timer_interval_ms=3000
-scenario_level=3
-
-[thermal.scenario3]
-support=yes
-name=Shutdown
-temperature=85
-timer_interval_ms=1000
diff --git a/scripts/pass-resource0.json b/scripts/pass-resource0.json
new file mode 100644 (file)
index 0000000..b03f111
--- /dev/null
@@ -0,0 +1,83 @@
+{
+       "support"                       : true,
+       "init_level"                    : 0,
+       "level_list"                    :
+       [
+               {
+                       "level"                         : 0,
+                       "dvfs,minimum_frequency_khz"    : 768000,
+                       "dvfs,maximum_frequency_khz"    : 1300000,
+                       "hotplug,number_of_minimum_cpu" : 0,
+                       "hotplug,number_of_maximum_cpu" : 4
+               }, {
+                       "level"                         : 1,
+                       "dvfs,minimum_frequency_khz"    : 1300000,
+                       "dvfs,maximum_frequency_khz"    : 1300000,
+                       "hotplug,number_of_minimum_cpu" : 3,
+                       "hotplug,number_of_maximum_cpu" : 4
+               }, {
+                       "level"                         : 2,
+                       "dvfs,minimum_frequency_khz"    : 768000,
+                       "dvfs,maximum_frequency_khz"    : 768000,
+                       "hotplug,number_of_minimum_cpu" : 0,
+                       "hotplug,number_of_maximum_cpu" : 2
+               }, {
+                       "level"                         : 3,
+                       "dvfs,minimum_frequency_khz"    : 768000,
+                       "dvfs,maximum_frequency_khz"    : 768000,
+                       "hotplug,number_of_minimum_cpu" : 0,
+                       "hotplug,number_of_maximum_cpu" : 1
+               }, {
+                       "level"                         : 4,
+                       "dvfs,minimum_frequency_khz"    : 1300000,
+                       "dvfs,maximum_frequency_khz"    : 1300000,
+                       "hotplug,number_of_minimum_cpu" : 4,
+                       "hotplug,number_of_maximum_cpu" : 4
+               }
+       ],
+
+       "pmqos_support"                 : true,
+       "pmqos_scenario_list":
+       [
+               {
+                       "name"          : "AppLaunch",
+                       "target_level"  : 1
+               }, {
+                       "name"          : "UltraPowerSaving",
+                       "target_level"  : 3
+               }, {
+                       "name"          : "Doze",
+                       "target_level"  : 3
+               }, {
+                       "name"          : "Performance",
+                       "target_level"  : 4
+               }
+       ],
+
+       "thermal_support"               : true,
+       "thermal_timer_interval_ms"     : 10000,
+       "thermal_scenario_list":
+       [
+               {
+                       "name"                  : "Release",
+                       "temperature"           : 70,
+                       "timer_interval_ms"     : 10000,
+                       "target_level"          : 0
+               }, {
+                       "name"                  : "Warning",
+                       "temperature"           : 73,
+                       "timer_interval_ms"     : 5000
+               }, {
+                       "name"                  : "LimitAction",
+                       "temperature"           : 75,
+                       "timer_interval_ms"     : 3000,
+                       "target_level"          : 3
+               }, {
+                       "name"                  : "Shutdown",
+                       "temperature"           : 85,
+                       "timer_interval_ms"     : 1000
+               }
+       ],
+
+       "cpuhp_support"                 : false
+}
diff --git a/scripts/pass-resource1.conf b/scripts/pass-resource1.conf
deleted file mode 100644 (file)
index 9f0c779..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-[Pass]
-pass_support=1
-pass_gov_type=1
-
-pass_num_levels=1
-pass_init_level=0
-pass_min_level=0
-pass_max_level=0
-
-[Level0]
-#empty
-
-############################
-### Add list of scenario ###
-############################
-[PassScenario]
-pass_scenario_support=yes
-pass_num_scenarios=2
-
-[Scenario0]
-name=AppLaunch
-support=yes
-
-[Scenario1]
-name=UltraPowerSaving
-support=yes
diff --git a/scripts/pass.conf b/scripts/pass.conf
deleted file mode 100644 (file)
index 1e46fe3..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-# Default pass.conf
-# - If you want to use PASS(Power Aware System Service), you have to create
-# new 'pass-[target type].conf' configuration file.
-[PassResource]
-pass_compatible=KIRANZ3
-pass_path_compatible=/sys/devices/system/cpu/cpufreq/pmqos/device_name
-pass_num_resources=2
-
-[PassResource0]
-pass_res_type=cpu
-pass_res_name=cpu0
-pass_res_thermal_name=ap_therm
-pass_path_conf_file=/hal/etc/pass/pass-resource0.conf
-pass_first_cpu=0
-pass_num_cpus=4
-
-[PassResource1]
-pass_res_type=nonstandard
-pass_res_name=trm
-pass_path_conf_file=/hal/etc/pass/pass-resource1.conf
diff --git a/scripts/pass.json b/scripts/pass.json
new file mode 100644 (file)
index 0000000..6d18069
--- /dev/null
@@ -0,0 +1,16 @@
+{
+       "board_name"            : "KIRANZ3",
+       "board_name_path"       : "/sys/devices/system/cpu/cpufreq/pmqos/device_name",
+       "device_list"           :
+       [
+               {
+                       "device_type"           : "cpu",
+                       "device_name"           : "cpu0",
+                       "device_config_path"    : "/hal/etc/pass/pass-resource0.json",
+                       "thermal_device_name"   : "ap_therm",
+                       "cpu,number_of_cpus"    : 4,
+                       "cpu,first_cpu"         : 0,
+                       "cpu,cpu_load_path"     : null
+               }
+       ]
+}