From 5204a362b8c80049e5242d92994637b3bac94d14 Mon Sep 17 00:00:00 2001 From: Svyatoslav Ryhel Date: Sun, 6 Oct 2024 14:59:54 +0300 Subject: power: regulator: max9807: add regulator support Added a new regulator driver for the MAXIM MAX8907 PMIC, providing essential regulator functionalities and incorporated the necessary binding framework within the core PMIC driver. Tested-by: Ion Agorria Signed-off-by: Svyatoslav Ryhel --- include/power/max8907.h | 73 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 include/power/max8907.h (limited to 'include') diff --git a/include/power/max8907.h b/include/power/max8907.h new file mode 100644 index 00000000000..a19b25f44c0 --- /dev/null +++ b/include/power/max8907.h @@ -0,0 +1,73 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright(C) 2024 Svyatoslav Ryhel + */ + +#ifndef _MAX8907_H_ +#define _MAX8907_H_ + +#define MAX8907_LDO_NUM 20 +#define MAX8907_SD_NUM 3 + +/* Drivers name */ +#define MAX8907_LDO_DRIVER "max8907_ldo" +#define MAX8907_SD_DRIVER "max8907_sd" + +/* MAX8907 register map */ +#define MAX8907_REG_SDCTL1 0x04 +#define MAX8907_REG_SDCTL2 0x07 +#define MAX8907_REG_SDCTL3 0x0A + +#define MAX8907_REG_LDOCTL16 0x10 +#define MAX8907_REG_LDOCTL17 0x14 +#define MAX8907_REG_LDOCTL1 0x18 +#define MAX8907_REG_LDOCTL2 0x1C +#define MAX8907_REG_LDOCTL3 0x20 +#define MAX8907_REG_LDOCTL4 0x24 +#define MAX8907_REG_LDOCTL5 0x28 +#define MAX8907_REG_LDOCTL6 0x2C +#define MAX8907_REG_LDOCTL7 0x30 +#define MAX8907_REG_LDOCTL8 0x34 +#define MAX8907_REG_LDOCTL9 0x38 +#define MAX8907_REG_LDOCTL10 0x3C +#define MAX8907_REG_LDOCTL11 0x40 +#define MAX8907_REG_LDOCTL12 0x44 +#define MAX8907_REG_LDOCTL13 0x48 +#define MAX8907_REG_LDOCTL14 0x4C +#define MAX8907_REG_LDOCTL15 0x50 +#define MAX8907_REG_LDOCTL19 0x5C +#define MAX8907_REG_LDOCTL18 0x72 +#define MAX8907_REG_LDOCTL20 0x9C + +/* MAX8907 configuration values */ +#define MAX8907_CTL 0 +#define MAX8907_SEQCNT 1 +#define MAX8907_VOUT 2 + +/* mask bit fields */ +#define MAX8907_MASK_LDO_SEQ 0x1C +#define MAX8907_MASK_LDO_EN 0x01 + +/* Step-Down (SD) Regulator calculations */ +#define SD1_VOLT_MAX 2225000 +#define SD1_VOLT_MIN 650000 +#define SD1_VOLT_STEP 25000 + +#define SD2_VOLT_MAX 1425000 +#define SD2_VOLT_MIN 637500 +#define SD2_VOLT_STEP 12500 + +#define SD3_VOLT_MAX 3900000 +#define SD3_VOLT_MIN 750000 +#define SD3_VOLT_STEP 50000 + +/* Low-Dropout Linear (LDO) Regulator calculations */ +#define LDO_750_VOLT_MAX 3900000 +#define LDO_750_VOLT_MIN 750000 +#define LDO_750_VOLT_STEP 50000 + +#define LDO_650_VOLT_MAX 2225000 +#define LDO_650_VOLT_MIN 650000 +#define LDO_650_VOLT_STEP 25000 + +#endif /* _MAX8907_H_ */ -- cgit v1.2.3 From 5f3588a94d219818c1b3a2dac4d063f77f48a5ef Mon Sep 17 00:00:00 2001 From: Svyatoslav Ryhel Date: Sun, 6 Oct 2024 16:51:21 +0300 Subject: sysreset: implement MAX9807 sysreset functions MAX8907 PMIC has embedded poweroff function used by some device to initiane device power off. Implement it as optional sysreset driver guarded by kconfig option and system-power-controller device tree property. Tested-by: Ion Agorria Signed-off-by: Svyatoslav Ryhel --- include/power/max8907.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/power/max8907.h b/include/power/max8907.h index a19b25f44c0..a6e558e582c 100644 --- a/include/power/max8907.h +++ b/include/power/max8907.h @@ -12,6 +12,7 @@ /* Drivers name */ #define MAX8907_LDO_DRIVER "max8907_ldo" #define MAX8907_SD_DRIVER "max8907_sd" +#define MAX8907_RST_DRIVER "max8907_rst" /* MAX8907 register map */ #define MAX8907_REG_SDCTL1 0x04 @@ -39,6 +40,9 @@ #define MAX8907_REG_LDOCTL18 0x72 #define MAX8907_REG_LDOCTL20 0x9C +#define MAX8907_REG_RESET_CNFG 0x0F +#define MASK_POWER_OFF BIT(6) + /* MAX8907 configuration values */ #define MAX8907_CTL 0 #define MAX8907_SEQCNT 1 -- cgit v1.2.3 From 94b395cc2db0160a079b208d9cc49485f2b943b1 Mon Sep 17 00:00:00 2001 From: Svyatoslav Ryhel Date: Tue, 15 Apr 2025 11:54:55 +0300 Subject: ARM: tegra: add PRAM Kconfig option Wrap CFG_PRAM with Kconfig option. Signed-off-by: Svyatoslav Ryhel --- include/configs/tegra.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/configs/tegra.h b/include/configs/tegra.h index 77bc38930d2..5db3129fade 100644 --- a/include/configs/tegra.h +++ b/include/configs/tegra.h @@ -29,6 +29,10 @@ #include "tegra210-common.h" #endif +#ifdef CONFIG_TEGRA_PRAM + #define CFG_PRAM CONFIG_TEGRA_PRAM_SIZE +#endif + #include "tegra-common-post.h" #endif /* __CONFIG_H */ -- cgit v1.2.3 From 718740855325c3366ea95e420bf8b32f47b0aa9f Mon Sep 17 00:00:00 2001 From: Svyatoslav Ryhel Date: Tue, 15 Apr 2025 11:55:28 +0300 Subject: ARM: tegra: convert boards to use TEGRA_PRAM Switch boards that use CFG_PRAM to TEGRA_PRAM. Signed-off-by: Svyatoslav Ryhel --- include/configs/mocha.h | 19 ------------------- include/configs/tegratab.h | 19 ------------------- include/configs/transformer-t114.h | 19 ------------------- 3 files changed, 57 deletions(-) delete mode 100644 include/configs/mocha.h delete mode 100644 include/configs/tegratab.h delete mode 100644 include/configs/transformer-t114.h (limited to 'include') diff --git a/include/configs/mocha.h b/include/configs/mocha.h deleted file mode 100644 index 7255f31baec..00000000000 --- a/include/configs/mocha.h +++ /dev/null @@ -1,19 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * Copyright (c) 2010-2013, NVIDIA CORPORATION. All rights reserved. - * - * Copyright (c) 2024, Svyatoslav Ryhel - */ - -#ifndef __CONFIG_H -#define __CONFIG_H - -#include "tegra124-common.h" - -#ifdef CONFIG_TEGRA_SUPPORT_NON_SECURE - #define CFG_PRAM 0x38400 /* 225 MB */ -#endif - -#include "tegra-common-post.h" - -#endif /* __CONFIG_H */ diff --git a/include/configs/tegratab.h b/include/configs/tegratab.h deleted file mode 100644 index afab01ec09c..00000000000 --- a/include/configs/tegratab.h +++ /dev/null @@ -1,19 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * Copyright (c) 2010-2013, NVIDIA CORPORATION. All rights reserved. - * - * Copyright (c) 2023, Svyatoslav Ryhel - */ - -#ifndef __CONFIG_H -#define __CONFIG_H - -#include "tegra114-common.h" - -#ifdef CONFIG_TEGRA_SUPPORT_NON_SECURE - #define CFG_PRAM 0x21c00 /* 135 MB */ -#endif - -#include "tegra-common-post.h" - -#endif /* __CONFIG_H */ diff --git a/include/configs/transformer-t114.h b/include/configs/transformer-t114.h deleted file mode 100644 index 2fbf3417691..00000000000 --- a/include/configs/transformer-t114.h +++ /dev/null @@ -1,19 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * Copyright (c) 2010-2013, NVIDIA CORPORATION. All rights reserved. - * - * Copyright (c) 2023, Svyatoslav Ryhel - */ - -#ifndef __CONFIG_H -#define __CONFIG_H - -#include "tegra114-common.h" - -#ifdef CONFIG_TEGRA_SUPPORT_NON_SECURE - #define CFG_PRAM 0x20000 /* 128 MB */ -#endif - -#include "tegra-common-post.h" - -#endif /* __CONFIG_H */ -- cgit v1.2.3