diff --git a/boards/m5stack/m5stickc_plus/Kconfig.defconfig b/boards/m5stack/m5stickc_plus/Kconfig.defconfig index 638a054bec1..aea1b614a01 100644 --- a/boards/m5stack/m5stickc_plus/Kconfig.defconfig +++ b/boards/m5stack/m5stickc_plus/Kconfig.defconfig @@ -16,6 +16,21 @@ choice BT_HCI_BUS_TYPE default BT_ESP32 if BT endchoice +config GPIO_HOGS_INIT_PRIORITY + default 70 + +config MFD_INIT_PRIORITY + default 70 + +config REGULATOR_AXP192_INIT_PRIORITY + default 71 + +config GPIO_AXP192_INIT_PRIORITY + default 72 + +config REGULATOR_FIXED_INIT_PRIORITY + default 75 + endif # BOARD_M5STICKC_PLUS_ESP32_PROCPU if BOARD_M5STICKC_PLUS_ESP32_APPCPU diff --git a/boards/m5stack/m5stickc_plus/m5stickc_plus-pinctrl.dtsi b/boards/m5stack/m5stickc_plus/m5stickc_plus-pinctrl.dtsi index d711fc9880b..c6a5089e6ad 100644 --- a/boards/m5stack/m5stickc_plus/m5stickc_plus-pinctrl.dtsi +++ b/boards/m5stack/m5stickc_plus/m5stickc_plus-pinctrl.dtsi @@ -54,18 +54,14 @@ pinmux = ; }; - i2c0_sda_gpio21: i2c0_sda_gpio21 { - pinmux = ; - bias-pull-up; - drive-open-drain; - output-high; - }; - i2c0_scl_gpio22: i2c0_scl_gpio22 { - pinmux = ; - bias-pull-up; - drive-open-drain; - output-high; + i2c0_default: i2c0_default { + group1 { + pinmux = , + ; + bias-pull-up; + drive-open-drain; + output-high; + }; }; - }; diff --git a/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu.dts b/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu.dts index 2f0f6975bba..1bd8be75f28 100644 --- a/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu.dts +++ b/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu.dts @@ -8,6 +8,7 @@ #include #include "m5stickc_plus-pinctrl.dtsi" #include +#include / { model = "M5StickC Plus PROCPU"; @@ -20,6 +21,8 @@ uart-0 = &uart0; i2c-0 = &i2c0; watchdog0 = &wdt0; + accel0 = &mpu6886; + rtc = &bm8563; }; chosen { @@ -28,6 +31,7 @@ zephyr,shell-uart = &uart0; zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; + zephyr,rtc = &bm8563; }; leds { @@ -81,11 +85,62 @@ /* IMU MPU-6886, RTC BM8563, PMU AXP192 */ &i2c0 { status = "okay"; - clock-frequency = ; + clock-frequency = ; sda-gpios = <&gpio0 21 GPIO_OPEN_DRAIN>; scl-gpios = <&gpio0 22 GPIO_OPEN_DRAIN>; - pinctrl-0 = <&i2c0_sda_gpio21 &i2c0_scl_gpio22>; + pinctrl-0 = <&i2c0_default>; + scl-timeout-us = <0>; pinctrl-names = "default"; + + axp192_pmic: axp192@34 { + compatible = "x-powers,axp192"; + reg = <0x34>; + status = "okay"; + + axp192_regulator: axp192_regulator { + compatible = "x-powers,axp192-regulator"; + status = "okay"; + + vdd_mcu: DCDC1 { + regulator-init-microvolt = <3350000>; + regulator-min-microvolt = <3200000>; + regulator-max-microvolt = <3400000>; + regulator-initial-mode = ; + regulator-boot-on; + regulator-always-on; + }; + + lcd_bl: LDO2 { + regulator-init-microvolt = <2800000>; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3000000>; + regulator-boot-on; + }; + + lcd_logic: LDO3 { + regulator-init-microvolt = <3000000>; + }; + }; + axp192_gpio: axp192_gpio { + compatible = "x-powers,axp192-gpio"; + gpio-controller; + #gpio-cells = <2>; + ngpios = <6>; + status = "okay"; + }; + }; + + mpu6886: mpu6886@68 { + status = "okay"; + compatible = "invensense,mpu6050"; + reg = <0x68>; + }; + + bm8563: bm8563@51 { + compatible = "nxp,pcf8563"; + reg = <0x51>; + status = "okay"; + }; }; &spi2 { diff --git a/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu.yaml b/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu.yaml index 24499601d4a..a0ee4c10974 100644 --- a/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu.yaml +++ b/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu.yaml @@ -12,6 +12,7 @@ supported: - uart - pinmux - nvs + - regulator testing: ignore_tags: - net diff --git a/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu_defconfig b/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu_defconfig index ee9920cda68..6b210f481bc 100644 --- a/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu_defconfig +++ b/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu_defconfig @@ -6,5 +6,7 @@ CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y +CONFIG_REGULATOR=y + CONFIG_GPIO=y CONFIG_I2C=y