From 90db6485496b4da1ee9fa37cd3899a4c4230b581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Barna=C5=9B?= Date: Fri, 1 Oct 2021 17:32:20 +0200 Subject: zephyr: add auto enabling HAS_TASK_* Kconfigs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit removes the prompt for HAS_TASK_* Kconfigs. They are enabled automatically when corresponding feature is enabled. BRANCH=main BUG=b:198777314 TEST=Verify that all tasks are created correctly. USB PD tasks should match amount or usb-c ports count. Change-Id: Ia69f9762cb8953df99d12b772f607d26df1fe379 Signed-off-by: Michał Barnaś Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3197726 Reviewed-by: Keith Short Commit-Queue: Keith Short --- zephyr/Kconfig.battery | 2 +- zephyr/Kconfig.tasks | 109 +++++++++++---------- zephyr/boards/riscv/asurada/asurada_defconfig | 1 - zephyr/projects/asurada/hayato/prj.conf | 4 - zephyr/projects/herobrine/herobrine_npcx9/prj.conf | 3 - zephyr/projects/kohaku/prj.conf | 1 - zephyr/projects/trogdor/lazor/prj.conf | 5 +- zephyr/projects/trogdor/trogdor/prj.conf | 3 - zephyr/projects/volteer/volteer/prj.conf | 8 -- zephyr/test/drivers/prj.conf | 4 - 10 files changed, 61 insertions(+), 79 deletions(-) diff --git a/zephyr/Kconfig.battery b/zephyr/Kconfig.battery index 44341d184d..02cc19a3f3 100644 --- a/zephyr/Kconfig.battery +++ b/zephyr/Kconfig.battery @@ -380,7 +380,7 @@ config PLATFORM_EC_CHARGE_RAMP_HW depends on !PLATFORM_EC_CHARGER_CHGRAMP_BROKEN help Disables software control of ramping up charging. This is used when - the hardware has a a mechanism for ramping input current and + the hardware has a mechanism for ramping input current and backing-off as needed. config PLATFORM_EC_CHARGE_RAMP_SW diff --git a/zephyr/Kconfig.tasks b/zephyr/Kconfig.tasks index 35dfc1c2f1..1c4e50fa84 100644 --- a/zephyr/Kconfig.tasks +++ b/zephyr/Kconfig.tasks @@ -7,7 +7,7 @@ menu "Tasks" config HAS_TASK_CHARGER - bool "Charger task" + bool depends on PLATFORM_EC_BATTERY help This turns on the charger task. This deals with monitoring the @@ -28,7 +28,7 @@ config TASK_CHARGER_STACK_SIZE endif # HAS_TASK_CHARGER config HAS_TASK_CHG_RAMP - bool "Charger-ramp task" + bool depends on PLATFORM_EC_BATTERY help This turns on the charger ramp task. This attempts to ramp up the @@ -49,7 +49,7 @@ config TASK_CHG_RAMP_STACK_SIZE endif # HAS_TASK_CHG_RAMP config HAS_TASK_CHIPSET - bool "Chipset task" + bool depends on PLATFORM_EC_POWERSEQ help This turns on the chipset task which handles powering the chipset @@ -89,7 +89,7 @@ config TASK_HOOKS_STACK_SIZE endif # HAS_TASK_HOOKS config HAS_TASK_HOSTCMD - bool "Host-command task" + bool depends on PLATFORM_EC_HOSTCMD help This turns on the hostcmd task which handles communication with the @@ -108,7 +108,7 @@ config TASK_HOSTCMD_STACK_SIZE endif # HAS_TASK_HOSTCMD config HAS_TASK_KEYPROTO - bool "Keyboard-protocol task (x86)" + bool depends on PLATFORM_EC_KEYBOARD_PROTOCOL_8042 help This turns on the keyproto task which handles conversion of keyboard @@ -127,7 +127,7 @@ config TASK_KEYPROTO_STACK_SIZE endif # HAS_TASK_KEYPROTO config HAS_TASK_KEYSCAN - bool "Keyboard-scanning task" + bool depends on PLATFORM_EC_KEYBOARD help This turns on the keyscan task which handles scanning the keyboard @@ -146,7 +146,7 @@ config TASK_KEYSCAN_STACK_SIZE endif # HAS_TASK_KEYSCAN config HAS_TASK_MOTIONSENSE - bool "Enable motionsense task" + bool help This turns on the motion sense task which collects sensor data from the sensors and reports them to AP. Using the data, it also produces other @@ -163,7 +163,7 @@ config TASK_MOTIONSENSE_STACK_SIZE endif # HAS_TASK_MOTIONSENSE config HAS_TASK_POWERBTN - bool "Power-button task (x86)" + bool depends on PLATFORM_EC_POWER_BUTTON help This turns on the powerbtn task which handles monitoring the power @@ -183,93 +183,85 @@ config TASK_POWERBTN_STACK_SIZE endif # HAS_TASK_POWERBTN +if PLATFORM_EC_USB_PD_PORT_MAX_COUNT > 0 + +config TASK_PD_STACK_SIZE + int "PD task stack size" + default 1024 # EC uses VENTI_TASK_STACK_SIZE which is 896 + help + The stack size of the PD_Cx tasks. + +config TASK_PD_INT_STACK_SIZE + int "PD interrupts task stack size" + default 1280 + help + The stack size of the PD_Cn_INT tasks. + +endif # PLATFORM_EC_USB_PD_PORT_MAX_COUNT > 0 + config HAS_TASK_PD_C0 - bool "USB Power Delivery task" + bool depends on PLATFORM_EC_USB_POWER_DELIVERY - default y + default y if PLATFORM_EC_USB_PD_PORT_MAX_COUNT > 0 help This turns on the PD_C0 task which handles the rather complex USB Power Delivery protocol for port 0. There is one of these tasks for each USB-C port on the device, but they are enabled separately depending on how many ports are present. -if HAS_TASK_PD_C0 - -config TASK_PD_STACK_SIZE - int "Stack size" - default 1024 # EC uses VENTI_TASK_STACK_SIZE which is 896 - help - The stack size of the PD_Cx tasks. - -endif # HAS_TASK_PD_C0 - config HAS_TASK_PD_C1 - bool "USB Power Delivery task" + bool depends on PLATFORM_EC_USB_POWER_DELIVERY + default y if PLATFORM_EC_USB_PD_PORT_MAX_COUNT > 1 help This turns on the PD_C1 task for devices with >=2 ports. config HAS_TASK_PD_C2 - bool "USB Power Delivery task" + bool depends on PLATFORM_EC_USB_POWER_DELIVERY + default y if PLATFORM_EC_USB_PD_PORT_MAX_COUNT > 2 help This turns on the PD_C2 task for devices with >=3 ports. config HAS_TASK_PD_C3 - bool "USB Power Delivery task" + bool depends on PLATFORM_EC_USB_POWER_DELIVERY + default y if PLATFORM_EC_USB_PD_PORT_MAX_COUNT > 3 help This turns on the PD_C3 task for devices with 4 ports. config HAS_TASK_PD_INT_C0 - bool "USB Power Delivery task" + bool depends on PLATFORM_EC_USB_POWER_DELIVERY - default y + default y if PLATFORM_EC_USB_PD_PORT_MAX_COUNT > 0 help This turns on the PD_INT_C0 task which handles servicing of Power Delivery (PD) message interrupts for port 0. There is one of these tasks for each USB-C port on the device, but they are enabled separately depending on how many ports are present. -if HAS_TASK_PD_INT_C0 - -config TASK_PD_INT_STACK_SIZE - int "Stack size" - default 1280 - help - The stack size of the PD_Cn_INT tasks. - -endif # HAS_TASK_PD_INT_C0 - config HAS_TASK_PD_INT_C1 - bool "USB Power Delivery task" + bool depends on PLATFORM_EC_USB_POWER_DELIVERY + default y if PLATFORM_EC_USB_PD_PORT_MAX_COUNT > 1 help This turns on the PD_INT_C1 task for devices with >=2 ports. config HAS_TASK_PD_INT_C2 - bool "USB Power Delivery task" + bool depends on PLATFORM_EC_USB_POWER_DELIVERY + default y if PLATFORM_EC_USB_PD_PORT_MAX_COUNT > 2 help This turns on the PD_INT_C2 task for devices with >=3 ports. config HAS_TASK_PD_INT_C3 - bool "USB Power Delivery task" + bool depends on PLATFORM_EC_USB_POWER_DELIVERY + default y if PLATFORM_EC_USB_PD_PORT_MAX_COUNT > 3 help This turns on the PD_INT_C3 task for devices with 4 ports. -config HAS_TASK_USB_CHG_P0 - bool "USB Charger (port 0)" - depends on PLATFORM_EC_USB_CHARGER - help - This turns on the USB charger task for port 0. This handles - negotiating power from an attached charger, trying to get the maximum - available power consistent with the needs of the device. - - There is one of these tasks for each USB-C port on the device. - -if HAS_TASK_USB_CHG_P0 +if PLATFORM_EC_USB_PD_PORT_MAX_COUNT > 0 config TASK_USB_CHG_STACK_SIZE int "(all ports) task stack size" @@ -282,8 +274,21 @@ config TASK_USB_CHG_STACK_SIZE endif # HAS_TASK_USB_CHG_P0 +config HAS_TASK_USB_CHG_P0 + bool + depends on PLATFORM_EC_USB_CHARGER + default y if PLATFORM_EC_USB_PD_PORT_MAX_COUNT > 0 + help + This turns on the USB charger task for port 0. This handles + negotiating power from an attached charger, trying to get the maximum + available power consistent with the needs of the device. + + There is one of these tasks for each USB-C port on the device. + config HAS_TASK_USB_CHG_P1 - bool "USB Charger (port 1)" + bool + depends on PLATFORM_EC_USB_CHARGER + default y if PLATFORM_EC_USB_PD_PORT_MAX_COUNT > 1 help This turns on the USB charger task for port 1. This handles negotiating power from an attached charger, trying to get the maximum @@ -292,7 +297,9 @@ config HAS_TASK_USB_CHG_P1 There is one of these tasks for each USB-C port on the device. config HAS_TASK_USB_CHG_P2 - bool "USB Charger (port 2)" + bool + depends on PLATFORM_EC_USB_CHARGER + default y if PLATFORM_EC_USB_PD_PORT_MAX_COUNT > 2 help This turns on the USB charger task for port 2. This handles negotiating power from an attached charger, trying to get the maximum diff --git a/zephyr/boards/riscv/asurada/asurada_defconfig b/zephyr/boards/riscv/asurada/asurada_defconfig index be85cd0f07..dbcc83ad75 100644 --- a/zephyr/boards/riscv/asurada/asurada_defconfig +++ b/zephyr/boards/riscv/asurada/asurada_defconfig @@ -12,7 +12,6 @@ CONFIG_BOARD_ASURADA=y # SoC configuration CONFIG_AP=y CONFIG_AP_ARM_MTK_MT8192=y -CONFIG_HAS_TASK_CHIPSET=y # Console CONFIG_CONSOLE=y diff --git a/zephyr/projects/asurada/hayato/prj.conf b/zephyr/projects/asurada/hayato/prj.conf index f8099d5236..7e5e5dc998 100644 --- a/zephyr/projects/asurada/hayato/prj.conf +++ b/zephyr/projects/asurada/hayato/prj.conf @@ -12,7 +12,6 @@ CONFIG_PLATFORM_EC_SYSTEM_UNLOCKED=y CONFIG_PLATFORM_EC_CONSOLE_USES_PRINTK=y # Battery -CONFIG_HAS_TASK_USB_CHG_P1=y CONFIG_PLATFORM_EC_BATTERY=y CONFIG_PLATFORM_EC_BATTERY_CUT_OFF=y CONFIG_PLATFORM_EC_BATTERY_FUEL_GAUGE=y @@ -77,9 +76,6 @@ CONFIG_PLATFORM_EC_ACCELGYRO_BMI_COMM_I2C=y CONFIG_PLATFORM_EC_USB_A_PORT_COUNT=1 # USB-C -CONFIG_HAS_TASK_PD_C1=y -CONFIG_HAS_TASK_PD_INT_C1=n -CONFIG_HAS_TASK_PD_INT_C0=n CONFIG_PLATFORM_EC_BC12_DETECT_PI3USB9201=y CONFIG_PLATFORM_EC_BC12_DETECT_MT6360=y CONFIG_PLATFORM_EC_BC12_SINGLE_DRIVER=n diff --git a/zephyr/projects/herobrine/herobrine_npcx9/prj.conf b/zephyr/projects/herobrine/herobrine_npcx9/prj.conf index 594d162a8f..4a6ea376fc 100644 --- a/zephyr/projects/herobrine/herobrine_npcx9/prj.conf +++ b/zephyr/projects/herobrine/herobrine_npcx9/prj.conf @@ -78,7 +78,6 @@ CONFIG_ADC=y CONFIG_ADC_SHELL=n # Battery -CONFIG_HAS_TASK_USB_CHG_P1=y CONFIG_PLATFORM_EC_BATTERY=y CONFIG_PLATFORM_EC_BATTERY_SMART=y CONFIG_PLATFORM_EC_I2C_VIRTUAL_BATTERY=y @@ -122,8 +121,6 @@ CONFIG_PLATFORM_EC_USB_PD_TCPM_PS8805=y CONFIG_PLATFORM_EC_USB_PD_TCPC_RUNTIME_CONFIG=n CONFIG_PLATFORM_EC_USB_PD_LOGGING=y CONFIG_PLATFORM_EC_USB_PORT_POWER_DUMB=y -CONFIG_HAS_TASK_PD_C1=y -CONFIG_HAS_TASK_PD_INT_C1=y # USB ID # This is allocated specifically for Herobrine diff --git a/zephyr/projects/kohaku/prj.conf b/zephyr/projects/kohaku/prj.conf index 48d512fc39..06e296c4ce 100644 --- a/zephyr/projects/kohaku/prj.conf +++ b/zephyr/projects/kohaku/prj.conf @@ -19,7 +19,6 @@ CONFIG_PLATFORM_EC_POWERSEQ_S0IX=y # Power button CONFIG_PLATFORM_EC_POWER_BUTTON=y -CONFIG_HAS_TASK_POWERBTN=y # External power CONFIG_PLATFORM_EC_EXTPOWER_GPIO=y diff --git a/zephyr/projects/trogdor/lazor/prj.conf b/zephyr/projects/trogdor/lazor/prj.conf index e16994e327..53a9d70432 100644 --- a/zephyr/projects/trogdor/lazor/prj.conf +++ b/zephyr/projects/trogdor/lazor/prj.conf @@ -65,7 +65,6 @@ CONFIG_ADC=y CONFIG_ADC_SHELL=n # Battery -CONFIG_HAS_TASK_USB_CHG_P1=y CONFIG_PLATFORM_EC_BATTERY=y CONFIG_PLATFORM_EC_BATTERY_SMART=y CONFIG_PLATFORM_EC_I2C_VIRTUAL_BATTERY=y @@ -111,8 +110,6 @@ CONFIG_PLATFORM_EC_USB_PD_TCPM_PS8805=y CONFIG_PLATFORM_EC_USB_PD_TCPC_RUNTIME_CONFIG=n CONFIG_PLATFORM_EC_USB_PD_LOGGING=y CONFIG_PLATFORM_EC_USB_PORT_POWER_DUMB=y -CONFIG_HAS_TASK_PD_C1=y -CONFIG_HAS_TASK_PD_INT_C1=y # USB ID # This is allocated specifically for Trogdor @@ -153,6 +150,8 @@ CONFIG_PLATFORM_EC_ACCELGYRO_BMI_COMM_I2C=y # Console history CONFIG_SHELL_HISTORY=y CONFIG_SHELL_CMDS=y +CONFIG_SHELL_HELP=y +CONFIG_SHELL_MINIMAL=n # Taskinfo CONFIG_THREAD_MONITOR=y diff --git a/zephyr/projects/trogdor/trogdor/prj.conf b/zephyr/projects/trogdor/trogdor/prj.conf index 59d87f54a1..5c1342e573 100644 --- a/zephyr/projects/trogdor/trogdor/prj.conf +++ b/zephyr/projects/trogdor/trogdor/prj.conf @@ -62,7 +62,6 @@ CONFIG_ADC=y CONFIG_ADC_SHELL=n # Battery -CONFIG_HAS_TASK_USB_CHG_P1=y CONFIG_PLATFORM_EC_BATTERY=y CONFIG_PLATFORM_EC_BATTERY_SMART=y CONFIG_PLATFORM_EC_I2C_VIRTUAL_BATTERY=y @@ -106,8 +105,6 @@ CONFIG_PLATFORM_EC_USB_PD_TCPM_PS8805=y CONFIG_PLATFORM_EC_USB_PD_TCPC_RUNTIME_CONFIG=n CONFIG_PLATFORM_EC_USB_PD_LOGGING=y CONFIG_PLATFORM_EC_USB_PORT_POWER_DUMB=y -CONFIG_HAS_TASK_PD_C1=y -CONFIG_HAS_TASK_PD_INT_C1=y # USB ID # This is allocated specifically for Trogdor diff --git a/zephyr/projects/volteer/volteer/prj.conf b/zephyr/projects/volteer/volteer/prj.conf index 80bdc2ad44..a034e65606 100644 --- a/zephyr/projects/volteer/volteer/prj.conf +++ b/zephyr/projects/volteer/volteer/prj.conf @@ -93,10 +93,6 @@ CONFIG_PLATFORM_EC_ALS_TCS3400=y CONFIG_PLATFORM_EC_TEMP_SENSOR=y CONFIG_PLATFORM_EC_THERMISTOR=y -# Miscellaneous tasks -CONFIG_HAS_TASK_KEYPROTO=y -CONFIG_HAS_TASK_POWERBTN=y - # Miscellaneous configs CONFIG_PLATFORM_EC_BOARD_RESET_AFTER_POWER_ON=y CONFIG_PLATFORM_EC_HIBERNATE_PSL=y @@ -106,7 +102,6 @@ CONFIG_PLATFORM_EC_MKBP_EVENT=y CONFIG_PLATFORM_EC_MKBP_USE_GPIO=y # USB-C and charging -CONFIG_HAS_TASK_CHARGER=y CONFIG_PLATFORM_EC_CHARGER_ISL9241=y CONFIG_PLATFORM_EC_CHARGER_MIN_BAT_PCT_FOR_POWER_ON=3 CONFIG_PLATFORM_EC_CHARGER_MIN_BAT_PCT_FOR_POWER_ON_WITH_AC=1 @@ -114,7 +109,6 @@ CONFIG_PLATFORM_EC_CHARGER_MIN_POWER_MW_FOR_POWER_ON_WITH_BATT=15000 CONFIG_PLATFORM_EC_CHARGER_MIN_POWER_MW_FOR_POWER_ON=15001 CONFIG_PLATFORM_EC_CHARGER_SENSE_RESISTOR=10 CONFIG_PLATFORM_EC_CHARGER_SENSE_RESISTOR_AC=10 -CONFIG_HAS_TASK_USB_CHG_P1=y CONFIG_PLATFORM_EC_BC12_DETECT_PI3USB9201=y CONFIG_PLATFORM_EC_USB_PID=0x503e CONFIG_PLATFORM_EC_USBC_PPC_SN5S330=y @@ -136,8 +130,6 @@ CONFIG_PLATFORM_EC_USB_PD_TCPM_PS8815=y CONFIG_PLATFORM_EC_USB_PD_TCPM_RT1715=y CONFIG_PLATFORM_EC_USB_PD_TCPM_TUSB422=y CONFIG_PLATFORM_EC_USB_PD_TCPM_MUX=y -CONFIG_HAS_TASK_PD_C1=y -CONFIG_HAS_TASK_PD_INT_C1=y CONFIG_PLATFORM_EC_USBC_PPC_DEDICATED_INT=y CONFIG_PLATFORM_EC_USB_A_PORT_COUNT=1 CONFIG_PLATFORM_EC_CONSOLE_CMD_PPC_DUMP=n diff --git a/zephyr/test/drivers/prj.conf b/zephyr/test/drivers/prj.conf index ccbef7aa7c..c75ace4736 100644 --- a/zephyr/test/drivers/prj.conf +++ b/zephyr/test/drivers/prj.conf @@ -33,10 +33,6 @@ CONFIG_EMUL_BB_RETIMER=y CONFIG_PLATFORM_EC_POWERSEQ=y -CONFIG_HAS_TASK_USB_CHG_P0=y -CONFIG_HAS_TASK_USB_CHG_P1=y -CONFIG_HAS_TASK_PD_C1=y - CONFIG_PLATFORM_EC_BATTERY_PRESENT_GPIO=y CONFIG_PLATFORM_EC_EXTPOWER_GPIO=y -- cgit v1.2.1