* Re: [PATCH] ARM: ux500: Provide SMSC911x fixed-regulator when not booting DT
2012-08-24 12:00 [PATCH] ARM: ux500: Provide SMSC911x fixed-regulator when not booting DT Lee Jones
@ 2012-08-24 12:47 ` Lee Jones
2012-09-03 12:15 ` Linus Walleij
2012-09-03 13:33 ` Lee Jones
2 siblings, 0 replies; 8+ messages in thread
From: Lee Jones @ 2012-08-24 12:47 UTC (permalink / raw)
To: linux-arm-kernel, linux-kernel
Cc: STEricsson_nomadik_linux, linus.walleij, arnd
Sorry, this patch appears to contain whitespace errors which I missed.
Please wait for v2.
On Fri, Aug 24, 2012 at 01:00:12PM +0100, Lee Jones wrote:
> The SMSC911x Ethernet chip requires a fixed-regulator in order to
> function correctly. We have previously provided a means to obtain
> this during a Device Tree boot, however nothing has been put into
> place when booting with a non-DT kernel. This patch aims to change
> that.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
> arch/arm/mach-ux500/board-mop500-regulators.c | 17 +++++++++++++++++
> arch/arm/mach-ux500/board-mop500-regulators.h | 1 +
> arch/arm/mach-ux500/board-mop500.c | 21 +++++++++++++++++++++
> arch/arm/mach-ux500/board-mop500.h | 2 +-
> 4 files changed, 40 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-ux500/board-mop500-regulators.c b/arch/arm/mach-ux500/board-mop500-regulators.c
> index 52426a4..11ddda7 100644
> --- a/arch/arm/mach-ux500/board-mop500-regulators.c
> +++ b/arch/arm/mach-ux500/board-mop500-regulators.c
> @@ -13,6 +13,23 @@
> #include <linux/regulator/ab8500.h>
> #include "board-mop500-regulators.h"
>
> +#ifdef CONFIG_REGULATOR_FIXED_VOLTAGE
> +static struct regulator_consumer_supply gpio_en_3v3_consumers[] = {
> + REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
> +};
> +
> +struct regulator_init_data gpio_en_3v3_regulator = {
> + .constraints = {
> + .name = "EN-3V3",
> + .min_uV = 3300000,
> + .max_uV = 3300000,
> + .valid_ops_mask = REGULATOR_CHANGE_STATUS,
> + },
> + .num_consumer_supplies = ARRAY_SIZE(gpio_en_3v3_consumers),
> + .consumer_supplies = gpio_en_3v3_consumers,
> +};
> +#endif
> +
> /*
> * TPS61052 regulator
> */
> diff --git a/arch/arm/mach-ux500/board-mop500-regulators.h b/arch/arm/mach-ux500/board-mop500-regulators.h
> index 9499215..78a0642 100644
> --- a/arch/arm/mach-ux500/board-mop500-regulators.h
> +++ b/arch/arm/mach-ux500/board-mop500-regulators.h
> @@ -18,5 +18,6 @@ extern struct ab8500_regulator_reg_init
> ab8500_regulator_reg_init[AB8500_NUM_REGULATOR_REGISTERS];
> extern struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS];
> extern struct regulator_init_data tps61052_regulator;
> +extern struct regulator_init_data gpio_en_3v3_regulator;
>
> #endif
> diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
> index de10f8f..0e904c8 100644
> --- a/arch/arm/mach-ux500/board-mop500.c
> +++ b/arch/arm/mach-ux500/board-mop500.c
> @@ -23,6 +23,7 @@
> #include <linux/spi/spi.h>
> #include <linux/mfd/abx500/ab8500.h>
> #include <linux/regulator/ab8500.h>
> +#include <linux/regulator/fixed.h>
> #include <linux/mfd/tc3589x.h>
> #include <linux/mfd/tps6105x.h>
> #include <linux/mfd/abx500/ab8500-gpio.h>
> @@ -75,6 +76,25 @@ static struct platform_device snowball_led_dev = {
> },
> };
>
> +#ifdef CONFIG_REGULATOR_FIXED_VOLTAGE
> +static struct fixed_voltage_config snowball_gpio_en_3v3_data = {
> + .supply_name = "EN-3V3",
> + .gpio = SNOWBALL_EN_3V3_ETH_GPIO,
> + .microvolts = 3300000,
> + .enable_high = 1,
> + .init_data = &gpio_en_3v3_regulator,
> + .startup_delay = 5000, /* 1200us */
> +};
> +
> +static struct platform_device snowball_gpio_en_3v3_regulator_dev = {
> + .name = "reg-fixed-voltage",
> + .id = 1,
> + .dev = {
> + .platform_data = &snowball_gpio_en_3v3_data,
> + },
> +};
> +#endif
> +
> static struct ab8500_gpio_platform_data ab8500_gpio_pdata = {
> .gpio_base = MOP500_AB8500_PIN_GPIO(1),
> .irq_base = MOP500_AB8500_VIR_GPIO_IRQ_BASE,
> @@ -585,6 +605,7 @@ static struct platform_device *snowball_platform_devs[] __initdata = {
> &snowball_led_dev,
> &snowball_key_dev,
> &snowball_sbnet_dev,
> + &snowball_gpio_en_3v3_regulator_dev,
> };
>
> static void __init mop500_init_machine(void)
> diff --git a/arch/arm/mach-ux500/board-mop500.h b/arch/arm/mach-ux500/board-mop500.h
> index a0f920d..4ace165 100644
> --- a/arch/arm/mach-ux500/board-mop500.h
> +++ b/arch/arm/mach-ux500/board-mop500.h
> @@ -13,6 +13,7 @@
> #include <linux/amba/mmci.h>
>
> /* Snowball specific GPIO assignments, this board has no GPIO expander */
> +#define SNOWBALL_EN_3V3_ETH_GPIO 26
> #define SNOWBALL_ACCEL_INT1_GPIO 163
> #define SNOWBALL_ACCEL_INT2_GPIO 164
> #define SNOWBALL_MAGNET_DRDY_GPIO 165
> @@ -76,7 +77,6 @@
> #define SNOWBALL_PM_GPIO4_GPIO MOP500_AB8500_PIN_GPIO(4) /* SYSCLKREQ6/GPIO4 */
> #define SNOWBALL_EN_3V6_GPIO MOP500_AB8500_PIN_GPIO(16) /* PWMOUT3/GPIO16 */
> #define SNOWBALL_PME_ETH_GPIO MOP500_AB8500_PIN_GPIO(24) /* SYSCLKREQ7/GPIO24 */
> -#define SNOWBALL_EN_3V3_ETH_GPIO MOP500_AB8500_PIN_GPIO(26) /* GPIO26 */
>
> struct device;
> struct i2c_board_info;
> --
> 1.7.9.5
>
--
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] ARM: ux500: Provide SMSC911x fixed-regulator when not booting DT
2012-08-24 12:00 [PATCH] ARM: ux500: Provide SMSC911x fixed-regulator when not booting DT Lee Jones
2012-08-24 12:47 ` Lee Jones
@ 2012-09-03 12:15 ` Linus Walleij
2012-09-03 13:33 ` Lee Jones
2 siblings, 0 replies; 8+ messages in thread
From: Linus Walleij @ 2012-09-03 12:15 UTC (permalink / raw)
To: Lee Jones
Cc: linux-arm-kernel, linux-kernel, STEricsson_nomadik_linux,
linus.walleij, arnd
On Fri, Aug 24, 2012 at 2:00 PM, Lee Jones <lee.jones@linaro.org> wrote:
> The SMSC911x Ethernet chip requires a fixed-regulator in order to
> function correctly.
Thanks for fixing this.
> +#ifdef CONFIG_REGULATOR_FIXED_VOLTAGE
No, just select REGULATOR_FIXED_VOLTAGE in apropriate
Kconfig entry, that's simpler. (Suspect under MACH_MOP500.)
(...)
> diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
> index de10f8f..0e904c8 100644
> --- a/arch/arm/mach-ux500/board-mop500.c
> +++ b/arch/arm/mach-ux500/board-mop500.c
> @@ -23,6 +23,7 @@
> #include <linux/spi/spi.h>
> #include <linux/mfd/abx500/ab8500.h>
> #include <linux/regulator/ab8500.h>
> +#include <linux/regulator/fixed.h>
> #include <linux/mfd/tc3589x.h>
> #include <linux/mfd/tps6105x.h>
> #include <linux/mfd/abx500/ab8500-gpio.h>
> @@ -75,6 +76,25 @@ static struct platform_device snowball_led_dev = {
> },
> };
>
> +#ifdef CONFIG_REGULATOR_FIXED_VOLTAGE
Here too, get rid of the #ifdef.
> +static struct fixed_voltage_config snowball_gpio_en_3v3_data = {
> + .supply_name = "EN-3V3",
> + .gpio = SNOWBALL_EN_3V3_ETH_GPIO,
> + .microvolts = 3300000,
> + .enable_high = 1,
> + .init_data = &gpio_en_3v3_regulator,
> + .startup_delay = 5000, /* 1200us */
> +};
> +
> +static struct platform_device snowball_gpio_en_3v3_regulator_dev = {
> + .name = "reg-fixed-voltage",
> + .id = 1,
> + .dev = {
> + .platform_data = &snowball_gpio_en_3v3_data,
> + },
> +};
> +#endif
(...)
> static struct ab8500_gpio_platform_data ab8500_gpio_pdata = {
> .gpio_base = MOP500_AB8500_PIN_GPIO(1),
> .irq_base = MOP500_AB8500_VIR_GPIO_IRQ_BASE,
> @@ -585,6 +605,7 @@ static struct platform_device *snowball_platform_devs[] __initdata = {
> &snowball_led_dev,
> &snowball_key_dev,
> &snowball_sbnet_dev,
> + &snowball_gpio_en_3v3_regulator_dev,
Since as you're not #ifdef:in around this entry it will not compile anyway
without fixed regulators.
(...)
> /* Snowball specific GPIO assignments, this board has no GPIO expander */
> +#define SNOWBALL_EN_3V3_ETH_GPIO 26
> #define SNOWBALL_ACCEL_INT1_GPIO 163
> #define SNOWBALL_ACCEL_INT2_GPIO 164
> #define SNOWBALL_MAGNET_DRDY_GPIO 165
> @@ -76,7 +77,6 @@
> #define SNOWBALL_PM_GPIO4_GPIO MOP500_AB8500_PIN_GPIO(4) /* SYSCLKREQ6/GPIO4 */
> #define SNOWBALL_EN_3V6_GPIO MOP500_AB8500_PIN_GPIO(16) /* PWMOUT3/GPIO16 */
> #define SNOWBALL_PME_ETH_GPIO MOP500_AB8500_PIN_GPIO(24) /* SYSCLKREQ7/GPIO24 */
> -#define SNOWBALL_EN_3V3_ETH_GPIO MOP500_AB8500_PIN_GPIO(26) /* GPIO26 */
As noted by Philippe, please drop this hunk off the patch for now.
The AB8500 GPIO is the right one... Probably you're lucky that U-boot
draws the pin high and activates this voltage.
BTW: disablingt the AB8500 pin 26 and thus noting that ethernet screws
up may be a good test for the AB8500 GPIO driver.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] ARM: ux500: Provide SMSC911x fixed-regulator when not booting DT
2012-08-24 12:00 [PATCH] ARM: ux500: Provide SMSC911x fixed-regulator when not booting DT Lee Jones
2012-08-24 12:47 ` Lee Jones
2012-09-03 12:15 ` Linus Walleij
@ 2012-09-03 13:33 ` Lee Jones
2012-09-04 8:53 ` Linus Walleij
2 siblings, 1 reply; 8+ messages in thread
From: Lee Jones @ 2012-09-03 13:33 UTC (permalink / raw)
To: linux-arm-kernel, linux-kernel
Cc: STEricsson_nomadik_linux, linus.walleij, arnd
Author: Lee Jones <lee.jones@linaro.org>
Date: Fri Aug 24 12:40:58 2012 +0100
ARM: ux500: Provide SMSC911x fixed-regulator when not booting DT
The SMSC911x Ethernet chip requires a fixed-regulator in order to
function correctly. We have previously provided a means to obtain
this during a Device Tree boot, however nothing has been put into
place when booting with a non-DT kernel. This patch aims to change
that.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
diff --git a/arch/arm/mach-ux500/board-mop500-regulators.c b/arch/arm/mach-ux500/board-mop500-regulators.c
index 52426a4..2a1e388 100644
--- a/arch/arm/mach-ux500/board-mop500-regulators.c
+++ b/arch/arm/mach-ux500/board-mop500-regulators.c
@@ -13,6 +13,21 @@
#include <linux/regulator/ab8500.h>
#include "board-mop500-regulators.h"
+static struct regulator_consumer_supply gpio_en_3v3_consumers[] = {
+ REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
+};
+
+struct regulator_init_data gpio_en_3v3_regulator = {
+ .constraints = {
+ .name = "EN-3V3",
+ .min_uV = 3300000,
+ .max_uV = 3300000,
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(gpio_en_3v3_consumers),
+ .consumer_supplies = gpio_en_3v3_consumers,
+};
+
/*
* TPS61052 regulator
*/
diff --git a/arch/arm/mach-ux500/board-mop500-regulators.h b/arch/arm/mach-ux500/board-mop500-regulators.h
index 9499215..78a0642 100644
--- a/arch/arm/mach-ux500/board-mop500-regulators.h
+++ b/arch/arm/mach-ux500/board-mop500-regulators.h
@@ -18,5 +18,6 @@ extern struct ab8500_regulator_reg_init
ab8500_regulator_reg_init[AB8500_NUM_REGULATOR_REGISTERS];
extern struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS];
extern struct regulator_init_data tps61052_regulator;
+extern struct regulator_init_data gpio_en_3v3_regulator;
#endif
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index b2be36f..9dfad19 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -23,6 +23,7 @@
#include <linux/spi/spi.h>
#include <linux/mfd/abx500/ab8500.h>
#include <linux/regulator/ab8500.h>
+#include <linux/regulator/fixed.h>
#include <linux/mfd/tc3589x.h>
#include <linux/mfd/tps6105x.h>
#include <linux/mfd/abx500/ab8500-gpio.h>
@@ -75,6 +76,23 @@ static struct platform_device snowball_led_dev = {
},
};
+static struct fixed_voltage_config snowball_gpio_en_3v3_data = {
+ .supply_name = "EN-3V3",
+ .gpio = SNOWBALL_EN_3V3_ETH_GPIO,
+ .microvolts = 3300000,
+ .enable_high = 1,
+ .init_data = &gpio_en_3v3_regulator,
+ .startup_delay = 5000, /* 1200us */
+};
+
+static struct platform_device snowball_gpio_en_3v3_regulator_dev = {
+ .name = "reg-fixed-voltage",
+ .id = 1,
+ .dev = {
+ .platform_data = &snowball_gpio_en_3v3_data,
+ },
+};
+
static struct ab8500_gpio_platform_data ab8500_gpio_pdata = {
.gpio_base = MOP500_AB8500_PIN_GPIO(1),
.irq_base = MOP500_AB8500_VIR_GPIO_IRQ_BASE,
@@ -585,6 +603,7 @@ static struct platform_device *snowball_platform_devs[] __initdata = {
&snowball_led_dev,
&snowball_key_dev,
&snowball_sbnet_dev,
+ &snowball_gpio_en_3v3_regulator_dev,
};
static void __init mop500_init_machine(void)
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] ARM: ux500: Provide SMSC911x fixed-regulator when not booting DT
2012-09-03 13:33 ` Lee Jones
@ 2012-09-04 8:53 ` Linus Walleij
2012-09-04 9:08 ` Lee Jones
0 siblings, 1 reply; 8+ messages in thread
From: Linus Walleij @ 2012-09-04 8:53 UTC (permalink / raw)
To: Lee Jones
Cc: linux-arm-kernel, linux-kernel, STEricsson_nomadik_linux,
linus.walleij, arnd
On Mon, Sep 3, 2012 at 3:33 PM, Lee Jones <lee.jones@linaro.org> wrote:
> Author: Lee Jones <lee.jones@linaro.org>
> Date: Fri Aug 24 12:40:58 2012 +0100
>
> ARM: ux500: Provide SMSC911x fixed-regulator when not booting DT
>
> The SMSC911x Ethernet chip requires a fixed-regulator in order to
> function correctly. We have previously provided a means to obtain
> this during a Device Tree boot, however nothing has been put into
> place when booting with a non-DT kernel. This patch aims to change
> that.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
You forgot to add select REGULATOR_FIXED_VOLTAGE to
the MOP500 Kconfig entry, but I added it when applying.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] ARM: ux500: Provide SMSC911x fixed-regulator when not booting DT
2012-09-04 8:53 ` Linus Walleij
@ 2012-09-04 9:08 ` Lee Jones
2012-09-04 9:29 ` Linus Walleij
0 siblings, 1 reply; 8+ messages in thread
From: Lee Jones @ 2012-09-04 9:08 UTC (permalink / raw)
To: Linus Walleij
Cc: linux-arm-kernel, linux-kernel, STEricsson_nomadik_linux,
linus.walleij, arnd
On Tue, Sep 04, 2012 at 10:53:32AM +0200, Linus Walleij wrote:
> On Mon, Sep 3, 2012 at 3:33 PM, Lee Jones <lee.jones@linaro.org> wrote:
>
> > Author: Lee Jones <lee.jones@linaro.org>
> > Date: Fri Aug 24 12:40:58 2012 +0100
> >
> > ARM: ux500: Provide SMSC911x fixed-regulator when not booting DT
> >
> > The SMSC911x Ethernet chip requires a fixed-regulator in order to
> > function correctly. We have previously provided a means to obtain
> > this during a Device Tree boot, however nothing has been put into
> > place when booting with a non-DT kernel. This patch aims to change
> > that.
> >
> > Signed-off-by: Lee Jones <lee.jones@linaro.org>
>
> You forgot to add select REGULATOR_FIXED_VOLTAGE to
> the MOP500 Kconfig entry, but I added it when applying.
I didn't forget. I intentionally left it out because it's
unconditionally set in the defconfig.
--
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] ARM: ux500: Provide SMSC911x fixed-regulator when not booting DT
2012-09-04 9:08 ` Lee Jones
@ 2012-09-04 9:29 ` Linus Walleij
2012-09-04 9:36 ` Lee Jones
0 siblings, 1 reply; 8+ messages in thread
From: Linus Walleij @ 2012-09-04 9:29 UTC (permalink / raw)
To: Lee Jones
Cc: linux-arm-kernel, linux-kernel, STEricsson_nomadik_linux,
linus.walleij, arnd
On Tue, Sep 4, 2012 at 11:08 AM, Lee Jones <lee.jones@linaro.org> wrote:
> On Tue, Sep 04, 2012 at 10:53:32AM +0200, Linus Walleij wrote:
>
>> You forgot to add select REGULATOR_FIXED_VOLTAGE to
>> the MOP500 Kconfig entry, but I added it when applying.
>
> I didn't forget. I intentionally left it out because it's
> unconditionally set in the defconfig.
Since disabling that from the config breaks compile this means
that you just broke Arnds randconfig builds :-P
If something *must* be configured for the thing to compile,
so it with select.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] ARM: ux500: Provide SMSC911x fixed-regulator when not booting DT
2012-09-04 9:29 ` Linus Walleij
@ 2012-09-04 9:36 ` Lee Jones
0 siblings, 0 replies; 8+ messages in thread
From: Lee Jones @ 2012-09-04 9:36 UTC (permalink / raw)
To: Linus Walleij
Cc: linux-arm-kernel, linux-kernel, STEricsson_nomadik_linux,
linus.walleij, arnd
On Tue, Sep 04, 2012 at 11:29:02AM +0200, Linus Walleij wrote:
> On Tue, Sep 4, 2012 at 11:08 AM, Lee Jones <lee.jones@linaro.org> wrote:
> > On Tue, Sep 04, 2012 at 10:53:32AM +0200, Linus Walleij wrote:
> >
> >> You forgot to add select REGULATOR_FIXED_VOLTAGE to
> >> the MOP500 Kconfig entry, but I added it when applying.
> >
> > I didn't forget. I intentionally left it out because it's
> > unconditionally set in the defconfig.
>
> Since disabling that from the config breaks compile this means
> that you just broke Arnds randconfig builds :-P
>
> If something *must* be configured for the thing to compile,
> so it with select.
Ah, I see.
Noted, thanks.
--
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 8+ messages in thread