From 5c7f10fda362db16a7bf3e571b4ae1e88fac2466 Mon Sep 17 00:00:00 2001 From: Oliver Schinagl Date: Fri, 26 Jul 2013 12:56:58 +0200 Subject: sun6i: Add basic axp221 driver The A31 uses the AXP221 pmic for various voltages. Signed-off-by: Oliver Schinagl Signed-off-by: Hans de Goede Acked-by: Ian Campbell -- Changes in v2: -Rebase Changes in v3: -Add support for all dldo and aldo-s -Add Kconfig option to select building AXP221 and to select voltage of dldo and aldo-s Changes in v4: -Add axp221_setbits helper function -Use symbolic names for enabled bits in CTRL1 - CTRL3 registers --- include/axp221.h | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 include/axp221.h (limited to 'include') diff --git a/include/axp221.h b/include/axp221.h new file mode 100644 index 0000000..e3b4409 --- /dev/null +++ b/include/axp221.h @@ -0,0 +1,50 @@ +/* + * (C) Copyright 2013 Oliver Schinagl + * + * X-Powers AXP221 Power Management IC driver + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#define AXP221_CHIP_ADDR 0x68 +#define AXP221_CTRL_ADDR 0x3e +#define AXP221_INIT_DATA 0x3e + +#define AXP221_CHIP_ID 0x03 +#define AXP221_OUTPUT_CTRL1 0x10 +#define AXP221_OUTPUT_CTRL1_ALDO1_EN (1 << 6) +#define AXP221_OUTPUT_CTRL1_ALDO2_EN (1 << 7) +#define AXP221_OUTPUT_CTRL2 0x12 +#define AXP221_OUTPUT_CTRL2_DLDO1_EN (1 << 3) +#define AXP221_OUTPUT_CTRL2_DLDO2_EN (1 << 4) +#define AXP221_OUTPUT_CTRL2_DLDO3_EN (1 << 5) +#define AXP221_OUTPUT_CTRL2_DLDO4_EN (1 << 6) +#define AXP221_OUTPUT_CTRL2_DCDC1_EN (1 << 7) +#define AXP221_OUTPUT_CTRL3 0x13 +#define AXP221_OUTPUT_CTRL3_ALDO3_EN (1 << 7) +#define AXP221_DLDO1_CTRL 0x15 +#define AXP221_DLDO2_CTRL 0x16 +#define AXP221_DLDO3_CTRL 0x17 +#define AXP221_DLDO4_CTRL 0x18 +#define AXP221_DCDC1_CTRL 0x21 +#define AXP221_DCDC2_CTRL 0x22 +#define AXP221_DCDC3_CTRL 0x23 +#define AXP221_DCDC4_CTRL 0x24 +#define AXP221_DCDC5_CTRL 0x25 +#define AXP221_ALDO1_CTRL 0x28 +#define AXP221_ALDO2_CTRL 0x28 +#define AXP221_ALDO3_CTRL 0x2a + +int axp221_set_dcdc1(unsigned int mvolt); +int axp221_set_dcdc2(unsigned int mvolt); +int axp221_set_dcdc3(unsigned int mvolt); +int axp221_set_dcdc4(unsigned int mvolt); +int axp221_set_dcdc5(unsigned int mvolt); +int axp221_set_dldo1(unsigned int mvolt); +int axp221_set_dldo2(unsigned int mvolt); +int axp221_set_dldo3(unsigned int mvolt); +int axp221_set_dldo4(unsigned int mvolt); +int axp221_set_aldo1(unsigned int mvolt); +int axp221_set_aldo2(unsigned int mvolt); +int axp221_set_aldo3(unsigned int mvolt); +int axp221_init(void); -- cgit v1.1 From 62c87ef2e988558edbf983c9344ceb9370dbbf02 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Sat, 25 Oct 2014 20:16:33 +0200 Subject: sun6i: Add clock functions needed for SPL / DRAM init Add clock_init_safe and clockset_pll5 functions, as these are needed for SPL support resp. DRAM init (which is needed for SPL too). Also add some extra clock register constant defines. Signed-off-by: Hans de Goede Acked-by: Ian Campbell --- include/configs/sun6i.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/configs/sun6i.h b/include/configs/sun6i.h index b714474..9558771 100644 --- a/include/configs/sun6i.h +++ b/include/configs/sun6i.h @@ -14,6 +14,7 @@ /* * A31 specific configuration */ +#define CONFIG_CLK_FULL_SPEED 1008000000 #define CONFIG_SYS_PROMPT "sun6i# " -- cgit v1.1 From 115200ceb0faad679bcc7d7dba4b63ff065606c5 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Fri, 7 Nov 2014 16:09:00 +0100 Subject: sunxi: ehci: Add proper Kconfig options to select the usb Vbus gpio-s Add proper Kconfig options to select the usb Vbus gpio-s, besides moving to Kconfig being the right thing to do, an added advantage of this is that it allows for boards without Vbus gpio-s. Signed-off-by: Hans de Goede Acked-by: Ian Campbell --- include/configs/sun4i.h | 7 ------- include/configs/sun7i.h | 7 ------- 2 files changed, 14 deletions(-) (limited to 'include') diff --git a/include/configs/sun4i.h b/include/configs/sun4i.h index e0ec52d..7b85740 100644 --- a/include/configs/sun4i.h +++ b/include/configs/sun4i.h @@ -18,14 +18,7 @@ #ifdef CONFIG_USB_EHCI #define CONFIG_USB_EHCI_SUNXI - #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 -#ifndef CONFIG_SUNXI_USB_VBUS0_GPIO -#define CONFIG_SUNXI_USB_VBUS0_GPIO SUNXI_GPH(6) -#endif -#ifndef CONFIG_SUNXI_USB_VBUS1_GPIO -#define CONFIG_SUNXI_USB_VBUS1_GPIO SUNXI_GPH(3) -#endif #endif /* diff --git a/include/configs/sun7i.h b/include/configs/sun7i.h index 0193826..ea40790 100644 --- a/include/configs/sun7i.h +++ b/include/configs/sun7i.h @@ -19,14 +19,7 @@ #ifdef CONFIG_USB_EHCI #define CONFIG_USB_EHCI_SUNXI - #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 -#ifndef CONFIG_SUNXI_USB_VBUS0_GPIO -#define CONFIG_SUNXI_USB_VBUS0_GPIO SUNXI_GPH(6) -#endif -#ifndef CONFIG_SUNXI_USB_VBUS1_GPIO -#define CONFIG_SUNXI_USB_VBUS1_GPIO SUNXI_GPH(3) -#endif #endif #define CONFIG_ARMV7_VIRT 1 -- cgit v1.1 From 76946dfe69359496aa0fd144d102068334974916 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Fri, 7 Nov 2014 14:51:12 +0100 Subject: sun6i: ehci: Add sun6i ehci support Add support for the 2 ehci controllers found on the sun6i (A31) soc. Signed-off-by: Hans de Goede Acked-by: Ian Campbell Acked-by: Marek Vasut --- include/configs/sun6i.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/configs/sun6i.h b/include/configs/sun6i.h index 9558771..1b73852 100644 --- a/include/configs/sun6i.h +++ b/include/configs/sun6i.h @@ -18,6 +18,11 @@ #define CONFIG_SYS_PROMPT "sun6i# " +#ifdef CONFIG_USB_EHCI +#define CONFIG_USB_EHCI_SUNXI +#define CONFIG_USB_MAX_CONTROLLER_COUNT 2 +#endif + /* * Include common sunxi configuration where most the settings are */ -- cgit v1.1