From 99deccfe53e1d48e55129e3b35cc2e4980c8d646 Mon Sep 17 00:00:00 2001 From: Ioannis Karachalios Date: Tue, 28 May 2024 12:32:15 +0300 Subject: [PATCH] boards: renesas: da1469x_dk_pro: Update default settings This commit should deal with optimizing device's operation in terms of power consumption. In this context: 1. Power and rail managers are enabled so that the device can enter the sleep state and power rails be set to the min. required levels. 2. Peripheral blocks should be enabled only when there is need to do so. 3. Define the internal RCX oscillator as default low power clock. RC32K should not be used as it drifts significantly due to temperature and voltage variations. Thus, affecting the whole system stability regardless of its calibration. 4. PLL should be enabled only when requested and on board level LP clock should be switched to XTAL32K to avoid overhead due to RCX calibration. Signed-off-by: Ioannis Karachalios --- .../renesas/da1469x_dk_pro/Kconfig.defconfig | 18 ++++++++++++++++-- .../renesas/da1469x_dk_pro/da1469x_dk_pro.dts | 15 ++++++++------- .../da1469x_dk_pro/da1469x_dk_pro_defconfig | 3 --- .../dts/da1469x_dk_pro_lcdc.overlay | 1 + .../dts/da1469x_dk_pro_mipi_dbi.overlay | 5 +++++ dts/arm/renesas/smartbond/da1469x.dtsi | 5 +++-- 6 files changed, 33 insertions(+), 14 deletions(-) diff --git a/boards/renesas/da1469x_dk_pro/Kconfig.defconfig b/boards/renesas/da1469x_dk_pro/Kconfig.defconfig index c20c21658d0..d491f8c1ebd 100644 --- a/boards/renesas/da1469x_dk_pro/Kconfig.defconfig +++ b/boards/renesas/da1469x_dk_pro/Kconfig.defconfig @@ -5,6 +5,20 @@ if BOARD_DA1469X_DK_PRO +# Enable sleep and voltage rails manager so that +# the device consumes the lowest possible current +config PM + default y + +config PM_DEVICE + default y + +config REGULATOR + default y + +config I2C_CALLBACK + default y if I2C_SMARTBOND + if LVGL config LV_Z_BITS_PER_PIXEL @@ -34,7 +48,7 @@ config LV_Z_POINTER_INPUT_MSGQ_COUNT endif # INPUT -#if PM || PM_DEVICE || PM_DEVICE_RUNTIME +if PM || PM_DEVICE || PM_DEVICE_RUNTIME # Increase stack size to avoid raising usage-fault # exceptions due to stack overflow. @@ -46,7 +60,7 @@ config IDLE_STACK_SIZE config SERIAL_INIT_PRIORITY default KERNEL_INIT_PRIORITY_DEFAULT -#endif # PM || PM_DEVICE +endif # PM || PM_DEVICE if BT diff --git a/boards/renesas/da1469x_dk_pro/da1469x_dk_pro.dts b/boards/renesas/da1469x_dk_pro/da1469x_dk_pro.dts index 3b09fe4e061..f84a97b2020 100644 --- a/boards/renesas/da1469x_dk_pro/da1469x_dk_pro.dts +++ b/boards/renesas/da1469x_dk_pro/da1469x_dk_pro.dts @@ -139,6 +139,14 @@ zephyr_udc0: &usbd { status = "okay"; }; +/* + * On board level we switch to XTAL32K and + * so RCX can be disabled. + */ +&rcx { + status = "disabled"; +}; + &lp_clk { clock-src = <&xtal32k>; }; @@ -147,32 +155,25 @@ zephyr_udc0: &usbd { clock-src = <&xtal32m>; }; -&pll { - status = "okay"; -}; &i2c { - status = "okay"; pinctrl-0 = <&i2c_default>; pinctrl-1 = <&i2c_sleep>; pinctrl-names = "default", "sleep"; }; &i2c2 { - status = "okay"; pinctrl-0 = <&i2c2_default>; pinctrl-1 = <&i2c2_sleep>; pinctrl-names = "default", "sleep"; }; &spi { - status = "okay"; pinctrl-0 = <&spi_controller>; pinctrl-1 = <&spi_sleep>; pinctrl-names = "default", "sleep"; }; &spi2 { - status = "okay"; pinctrl-0 = <&spi2_controller>; pinctrl-1 = <&spi2_sleep>; pinctrl-names = "default", "sleep"; diff --git a/boards/renesas/da1469x_dk_pro/da1469x_dk_pro_defconfig b/boards/renesas/da1469x_dk_pro/da1469x_dk_pro_defconfig index e31b6eb8457..9ce790fe46b 100644 --- a/boards/renesas/da1469x_dk_pro/da1469x_dk_pro_defconfig +++ b/boards/renesas/da1469x_dk_pro/da1469x_dk_pro_defconfig @@ -9,6 +9,3 @@ CONFIG_UART_CONSOLE=y CONFIG_SERIAL=y CONFIG_BUILD_OUTPUT_HEX=n - -CONFIG_I2C=y -CONFIG_I2C_CALLBACK=y diff --git a/boards/renesas/da1469x_dk_pro/dts/da1469x_dk_pro_lcdc.overlay b/boards/renesas/da1469x_dk_pro/dts/da1469x_dk_pro_lcdc.overlay index 4b522837df9..053e96efd10 100644 --- a/boards/renesas/da1469x_dk_pro/dts/da1469x_dk_pro_lcdc.overlay +++ b/boards/renesas/da1469x_dk_pro/dts/da1469x_dk_pro_lcdc.overlay @@ -43,6 +43,7 @@ &i2c2 { clock-frequency = <400000>; + status = "okay"; display_touch: ft6206@38 { compatible = "focaltech,ft5336"; diff --git a/boards/renesas/da1469x_dk_pro/dts/da1469x_dk_pro_mipi_dbi.overlay b/boards/renesas/da1469x_dk_pro/dts/da1469x_dk_pro_mipi_dbi.overlay index 81dbc363d62..2ed161097da 100644 --- a/boards/renesas/da1469x_dk_pro/dts/da1469x_dk_pro_mipi_dbi.overlay +++ b/boards/renesas/da1469x_dk_pro/dts/da1469x_dk_pro_mipi_dbi.overlay @@ -23,6 +23,7 @@ &i2c2 { clock-frequency = <400000>; + status = "okay"; display_touch: ft6206@38 { compatible = "focaltech,ft5336"; @@ -32,6 +33,10 @@ }; }; +&spi2 { + status = "okay"; +}; + &lcdc { compatible = "renesas,smartbond-mipi-dbi"; status = "okay"; diff --git a/dts/arm/renesas/smartbond/da1469x.dtsi b/dts/arm/renesas/smartbond/da1469x.dtsi index fe589f52fb1..1da9cc6cae0 100644 --- a/dts/arm/renesas/smartbond/da1469x.dtsi +++ b/dts/arm/renesas/smartbond/da1469x.dtsi @@ -60,7 +60,7 @@ compatible = "renesas,smartbond-lp-osc"; clock-frequency = ; #clock-cells = <0>; - status = "disabled"; + status = "okay"; }; rc32m: rc32m { compatible = "fixed-clock"; @@ -95,7 +95,7 @@ }; lp_clk: lp_clk { compatible = "renesas,smartbond-lp-clk"; - clock-src = <&rc32k>; + clock-src = <&rcx>; status = "okay"; }; @@ -156,6 +156,7 @@ device_type = "memory"; reg = <0x32000000 DT_SIZE_K(32768)>; zephyr,memory-region = "PSRAM"; + status = "disabled"; }; qspif: memory@16000000 {