* [PATCH 0/6] SBx81LIFKW/SBx81LIFXCAT disable KIRKWOOD_GPIO
@ 2022-08-04 9:06 Chris Packham
2022-08-04 9:06 ` [PATCH 1/6] ARM: kirkwood: SBx81LIFKW: remove direct access of GPIO registers Chris Packham
` (6 more replies)
0 siblings, 7 replies; 14+ messages in thread
From: Chris Packham @ 2022-08-04 9:06 UTC (permalink / raw)
To: u-boot; +Cc: Chris Packham, Chris Packham, Stefan Roese, Tom Rini
This series makes changes to use the DM gpio APIs so that KIRKWOOD_GPIO
can be disabled on these boards.
Chris Packham (6):
ARM: kirkwood: SBx81LIFKW: remove direct access of GPIO registers
ARM: kirkwood: SBx81LIFKW: update for DM_GPIO
ARM: kirkwood: SBx81LIFKW: enable CMD_GPIO
ARM: kirkwood: SBx81LIFKW: disable KIRKWOOD_GPIO
ARM: kirkwood: SBx81LIFKW: enable CONFIG_NET_RANDOM_ETHADDR
ARM: kirkwood: SBx81LIFXCAT: disable KIRKWOOD_GPIO
arch/arm/dts/kirkwood-atl-sbx81lifkw.dts | 14 ++++
board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c | 71 ++++++++-------------
configs/SBx81LIFKW_defconfig | 5 +-
configs/SBx81LIFXCAT_defconfig | 1 -
4 files changed, 45 insertions(+), 46 deletions(-)
--
2.37.1
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 1/6] ARM: kirkwood: SBx81LIFKW: remove direct access of GPIO registers
2022-08-04 9:06 [PATCH 0/6] SBx81LIFKW/SBx81LIFXCAT disable KIRKWOOD_GPIO Chris Packham
@ 2022-08-04 9:06 ` Chris Packham
2022-08-05 10:47 ` Stefan Roese
2022-08-04 9:06 ` [PATCH 2/6] ARM: kirkwood: SBx81LIFKW: update for DM_GPIO Chris Packham
` (5 subsequent siblings)
6 siblings, 1 reply; 14+ messages in thread
From: Chris Packham @ 2022-08-04 9:06 UTC (permalink / raw)
To: u-boot; +Cc: Chris Packham, Chris Packham, Stefan Roese, Tom Rini
Replace code that accessed the GPIO registers directly with code that
makes use of the LED_GPIO driver.
Signed-off-by: Chris Packham <judge.packham@gmail.com>
---
arch/arm/dts/kirkwood-atl-sbx81lifkw.dts | 14 ++++++
board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c | 50 +++++----------------
configs/SBx81LIFKW_defconfig | 2 +
3 files changed, 27 insertions(+), 39 deletions(-)
diff --git a/arch/arm/dts/kirkwood-atl-sbx81lifkw.dts b/arch/arm/dts/kirkwood-atl-sbx81lifkw.dts
index 4ae74f4316e5..3837c8f77fe2 100644
--- a/arch/arm/dts/kirkwood-atl-sbx81lifkw.dts
+++ b/arch/arm/dts/kirkwood-atl-sbx81lifkw.dts
@@ -70,6 +70,20 @@
};
};
};
+
+ gpio-leds {
+ compatible = "gpio-leds";
+
+ ledn {
+ label = "status:ledn";
+ gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>;
+ };
+
+ ledp {
+ label = "status:ledp";
+ gpios = <&gpio0 18 GPIO_ACTIVE_HIGH>;
+ };
+ };
};
&spi0 {
diff --git a/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c b/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c
index d8b9fdfe356f..feb8b6b83f00 100644
--- a/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c
+++ b/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c
@@ -13,7 +13,7 @@
#include <linux/io.h>
#include <miiphy.h>
#include <netdev.h>
-#include <status_led.h>
+#include <led.h>
#include <asm/arch/cpu.h>
#include <asm/arch/soc.h>
#include <asm/arch/mpp.h>
@@ -41,41 +41,6 @@
DECLARE_GLOBAL_DATA_PTR;
-struct led {
- u32 reg;
- u32 value;
- u32 mask;
-};
-
-struct led amber_solid = {
- MVEBU_GPIO0_BASE,
- BIT(10),
- BIT(18) | BIT(10)
-};
-
-struct led green_solid = {
- MVEBU_GPIO0_BASE,
- BIT(18) | BIT(10),
- BIT(18) | BIT(10)
-};
-
-struct led amber_flash = {
- MVEBU_GPIO0_BASE,
- 0,
- BIT(18) | BIT(10)
-};
-
-struct led green_flash = {
- MVEBU_GPIO0_BASE,
- BIT(18),
- BIT(18) | BIT(10)
-};
-
-static void status_led_set(struct led *led)
-{
- clrsetbits_le32(led->reg, led->mask, led->value);
-}
-
int board_early_init_f(void)
{
/*
@@ -165,8 +130,6 @@ int board_init(void)
/* address of boot parameters */
gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100;
- status_led_set(&amber_solid);
-
return 0;
}
@@ -196,7 +159,16 @@ int mv88e61xx_hw_reset(struct phy_device *phydev)
#ifdef CONFIG_MISC_INIT_R
int misc_init_r(void)
{
- status_led_set(&green_flash);
+ struct udevice *dev;
+ int ret;
+
+ ret = led_get_by_label("status:ledp", &dev);
+ if (!ret)
+ led_set_state(dev, LEDST_ON);
+
+ ret = led_get_by_label("status:ledn", &dev);
+ if (!ret)
+ led_set_state(dev, LEDST_OFF);
return 0;
}
diff --git a/configs/SBx81LIFKW_defconfig b/configs/SBx81LIFKW_defconfig
index f186f247eb63..90800e2dd3ee 100644
--- a/configs/SBx81LIFKW_defconfig
+++ b/configs/SBx81LIFKW_defconfig
@@ -46,6 +46,8 @@ CONFIG_DM_I2C=y
CONFIG_SYS_I2C_MVTWSI=y
CONFIG_I2C_MUX=y
CONFIG_I2C_MUX_PCA954x=y
+CONFIG_LED=y
+CONFIG_LED_GPIO=y
# CONFIG_MMC is not set
CONFIG_MTD=y
CONFIG_DM_SPI_FLASH=y
--
2.37.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 2/6] ARM: kirkwood: SBx81LIFKW: update for DM_GPIO
2022-08-04 9:06 [PATCH 0/6] SBx81LIFKW/SBx81LIFXCAT disable KIRKWOOD_GPIO Chris Packham
2022-08-04 9:06 ` [PATCH 1/6] ARM: kirkwood: SBx81LIFKW: remove direct access of GPIO registers Chris Packham
@ 2022-08-04 9:06 ` Chris Packham
2022-08-05 10:47 ` Stefan Roese
2022-08-04 9:06 ` [PATCH 3/6] ARM: kirkwood: SBx81LIFKW: enable CMD_GPIO Chris Packham
` (4 subsequent siblings)
6 siblings, 1 reply; 14+ messages in thread
From: Chris Packham @ 2022-08-04 9:06 UTC (permalink / raw)
To: u-boot; +Cc: Chris Packham, Chris Packham, Stefan Roese, Tom Rini
Update mv88e61xx_hw_reset() to use the DM_GPIO API to toggle the reset
line for the linkstreet switch.
Signed-off-by: Chris Packham <judge.packham@gmail.com>
---
board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c b/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c
index feb8b6b83f00..e0a7f3fa89f0 100644
--- a/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c
+++ b/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c
@@ -17,7 +17,8 @@
#include <asm/arch/cpu.h>
#include <asm/arch/soc.h>
#include <asm/arch/mpp.h>
-#include <asm/arch/gpio.h>
+#include <asm-generic/gpio.h>
+#include <dm.h>
/* Note: GPIO differences between specific boards
*
@@ -37,8 +38,6 @@
#define SBX81LIFKW_OE_VAL_LOW (BIT(31) | BIT(30) | BIT(28) | BIT(27))
#define SBX81LIFKW_OE_VAL_HIGH (BIT(0) | BIT(1))
-#define MV88E6097_RESET 27
-
DECLARE_GLOBAL_DATA_PTR;
int board_early_init_f(void)
@@ -143,11 +142,23 @@ void reset_phy(void)
#ifdef CONFIG_MV88E61XX_SWITCH
int mv88e61xx_hw_reset(struct phy_device *phydev)
{
+ struct gpio_desc desc;
+ int ret;
+
+ ret = dm_gpio_lookup_name("mvebu0_27", &desc);
+ if (ret)
+ return ret;
+
+ ret = dm_gpio_request(&desc, "linkstreet_rst");
+ if (ret)
+ return ret;
+
/* Ensure the 88e6097 gets at least 10ms Reset
*/
- kw_gpio_set_value(MV88E6097_RESET, 0);
+ dm_gpio_set_dir_flags(&desc, GPIOD_IS_OUT);
+ dm_gpio_set_value(&desc, 0);
mdelay(20);
- kw_gpio_set_value(MV88E6097_RESET, 1);
+ dm_gpio_set_value(&desc, 1);
mdelay(20);
phydev->advertising = ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full;
--
2.37.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 3/6] ARM: kirkwood: SBx81LIFKW: enable CMD_GPIO
2022-08-04 9:06 [PATCH 0/6] SBx81LIFKW/SBx81LIFXCAT disable KIRKWOOD_GPIO Chris Packham
2022-08-04 9:06 ` [PATCH 1/6] ARM: kirkwood: SBx81LIFKW: remove direct access of GPIO registers Chris Packham
2022-08-04 9:06 ` [PATCH 2/6] ARM: kirkwood: SBx81LIFKW: update for DM_GPIO Chris Packham
@ 2022-08-04 9:06 ` Chris Packham
2022-08-05 10:48 ` Stefan Roese
2022-08-04 9:06 ` [PATCH 4/6] ARM: kirkwood: SBx81LIFKW: disable KIRKWOOD_GPIO Chris Packham
` (3 subsequent siblings)
6 siblings, 1 reply; 14+ messages in thread
From: Chris Packham @ 2022-08-04 9:06 UTC (permalink / raw)
To: u-boot; +Cc: Chris Packham, Chris Packham, Stefan Roese, Tom Rini
For debugging it is convenient to query/access GPIOs from the command
line.
Signed-off-by: Chris Packham <judge.packham@gmail.com>
---
configs/SBx81LIFKW_defconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/configs/SBx81LIFKW_defconfig b/configs/SBx81LIFKW_defconfig
index 90800e2dd3ee..ad7e2e976d2a 100644
--- a/configs/SBx81LIFKW_defconfig
+++ b/configs/SBx81LIFKW_defconfig
@@ -26,6 +26,7 @@ CONFIG_SYS_CBSIZE=256
CONFIG_SYS_PBSIZE=276
CONFIG_CMD_DM=y
# CONFIG_CMD_FLASH is not set
+CONFIG_CMD_GPIO=y
CONFIG_CMD_I2C=y
CONFIG_CMD_DHCP=y
CONFIG_BOOTP_NTPSERVER=y
--
2.37.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 4/6] ARM: kirkwood: SBx81LIFKW: disable KIRKWOOD_GPIO
2022-08-04 9:06 [PATCH 0/6] SBx81LIFKW/SBx81LIFXCAT disable KIRKWOOD_GPIO Chris Packham
` (2 preceding siblings ...)
2022-08-04 9:06 ` [PATCH 3/6] ARM: kirkwood: SBx81LIFKW: enable CMD_GPIO Chris Packham
@ 2022-08-04 9:06 ` Chris Packham
2022-08-05 10:48 ` Stefan Roese
2022-08-04 9:06 ` [PATCH 5/6] ARM: kirkwood: SBx81LIFKW: enable CONFIG_NET_RANDOM_ETHADDR Chris Packham
` (2 subsequent siblings)
6 siblings, 1 reply; 14+ messages in thread
From: Chris Packham @ 2022-08-04 9:06 UTC (permalink / raw)
To: u-boot; +Cc: Chris Packham, Chris Packham, Stefan Roese, Tom Rini
DM_GPIO was already enabled so the MVEBU_GPIO was already available.
Having updated the board code to use the DM_GPIO APIs the KIRKWOOD_GPIO
driver became unnecessary. Disable it for SBx81LIFKW.
Signed-off-by: Chris Packham <judge.packham@gmail.com>
---
configs/SBx81LIFKW_defconfig | 1 -
1 file changed, 1 deletion(-)
diff --git a/configs/SBx81LIFKW_defconfig b/configs/SBx81LIFKW_defconfig
index ad7e2e976d2a..ec940bd30891 100644
--- a/configs/SBx81LIFKW_defconfig
+++ b/configs/SBx81LIFKW_defconfig
@@ -41,7 +41,6 @@ CONFIG_ENV_SPI_MAX_HZ=20000000
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_NETCONSOLE=y
CONFIG_DM=y
-CONFIG_KIRKWOOD_GPIO=y
CONFIG_DM_PCA953X=y
CONFIG_DM_I2C=y
CONFIG_SYS_I2C_MVTWSI=y
--
2.37.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 5/6] ARM: kirkwood: SBx81LIFKW: enable CONFIG_NET_RANDOM_ETHADDR
2022-08-04 9:06 [PATCH 0/6] SBx81LIFKW/SBx81LIFXCAT disable KIRKWOOD_GPIO Chris Packham
` (3 preceding siblings ...)
2022-08-04 9:06 ` [PATCH 4/6] ARM: kirkwood: SBx81LIFKW: disable KIRKWOOD_GPIO Chris Packham
@ 2022-08-04 9:06 ` Chris Packham
2022-08-05 10:48 ` Stefan Roese
2022-08-04 9:06 ` [PATCH 6/6] ARM: kirkwood: SBx81LIFXCAT: disable KIRKWOOD_GPIO Chris Packham
2022-08-09 11:35 ` [PATCH 0/6] SBx81LIFKW/SBx81LIFXCAT " Stefan Roese
6 siblings, 1 reply; 14+ messages in thread
From: Chris Packham @ 2022-08-04 9:06 UTC (permalink / raw)
To: u-boot; +Cc: Chris Packham, Chris Packham, Stefan Roese, Tom Rini
When booting a fresh board having a random Ethernet address enables
using the network device to program the board.
Signed-off-by: Chris Packham <judge.packham@gmail.com>
---
configs/SBx81LIFKW_defconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/configs/SBx81LIFKW_defconfig b/configs/SBx81LIFKW_defconfig
index ec940bd30891..a9f984239af9 100644
--- a/configs/SBx81LIFKW_defconfig
+++ b/configs/SBx81LIFKW_defconfig
@@ -39,6 +39,7 @@ CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_SPI_FLASH=y
CONFIG_ENV_SPI_MAX_HZ=20000000
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_NETCONSOLE=y
CONFIG_DM=y
CONFIG_DM_PCA953X=y
--
2.37.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 6/6] ARM: kirkwood: SBx81LIFXCAT: disable KIRKWOOD_GPIO
2022-08-04 9:06 [PATCH 0/6] SBx81LIFKW/SBx81LIFXCAT disable KIRKWOOD_GPIO Chris Packham
` (4 preceding siblings ...)
2022-08-04 9:06 ` [PATCH 5/6] ARM: kirkwood: SBx81LIFKW: enable CONFIG_NET_RANDOM_ETHADDR Chris Packham
@ 2022-08-04 9:06 ` Chris Packham
2022-08-05 10:49 ` Stefan Roese
2022-08-09 11:35 ` [PATCH 0/6] SBx81LIFKW/SBx81LIFXCAT " Stefan Roese
6 siblings, 1 reply; 14+ messages in thread
From: Chris Packham @ 2022-08-04 9:06 UTC (permalink / raw)
To: u-boot; +Cc: Chris Packham, Chris Packham, Stefan Roese, Tom Rini
DM_GPIO was already enabled so the MVEBU_GPIO was already available.
Disable KIRKWOOD_GPIO as it was unnecessary.
Signed-off-by: Chris Packham <judge.packham@gmail.com>
---
configs/SBx81LIFXCAT_defconfig | 1 -
1 file changed, 1 deletion(-)
diff --git a/configs/SBx81LIFXCAT_defconfig b/configs/SBx81LIFXCAT_defconfig
index 9d579091a82f..cb80b7876f38 100644
--- a/configs/SBx81LIFXCAT_defconfig
+++ b/configs/SBx81LIFXCAT_defconfig
@@ -42,7 +42,6 @@ CONFIG_ENV_SPI_MAX_HZ=20000000
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_NETCONSOLE=y
CONFIG_DM=y
-CONFIG_KIRKWOOD_GPIO=y
CONFIG_DM_PCA953X=y
CONFIG_DM_I2C=y
CONFIG_SYS_I2C_MVTWSI=y
--
2.37.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH 1/6] ARM: kirkwood: SBx81LIFKW: remove direct access of GPIO registers
2022-08-04 9:06 ` [PATCH 1/6] ARM: kirkwood: SBx81LIFKW: remove direct access of GPIO registers Chris Packham
@ 2022-08-05 10:47 ` Stefan Roese
0 siblings, 0 replies; 14+ messages in thread
From: Stefan Roese @ 2022-08-05 10:47 UTC (permalink / raw)
To: Chris Packham, u-boot; +Cc: Chris Packham, Tom Rini
On 04.08.22 11:06, Chris Packham wrote:
> Replace code that accessed the GPIO registers directly with code that
> makes use of the LED_GPIO driver.
>
> Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Thanks,
Stefan
> ---
>
> arch/arm/dts/kirkwood-atl-sbx81lifkw.dts | 14 ++++++
> board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c | 50 +++++----------------
> configs/SBx81LIFKW_defconfig | 2 +
> 3 files changed, 27 insertions(+), 39 deletions(-)
>
> diff --git a/arch/arm/dts/kirkwood-atl-sbx81lifkw.dts b/arch/arm/dts/kirkwood-atl-sbx81lifkw.dts
> index 4ae74f4316e5..3837c8f77fe2 100644
> --- a/arch/arm/dts/kirkwood-atl-sbx81lifkw.dts
> +++ b/arch/arm/dts/kirkwood-atl-sbx81lifkw.dts
> @@ -70,6 +70,20 @@
> };
> };
> };
> +
> + gpio-leds {
> + compatible = "gpio-leds";
> +
> + ledn {
> + label = "status:ledn";
> + gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>;
> + };
> +
> + ledp {
> + label = "status:ledp";
> + gpios = <&gpio0 18 GPIO_ACTIVE_HIGH>;
> + };
> + };
> };
>
> &spi0 {
> diff --git a/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c b/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c
> index d8b9fdfe356f..feb8b6b83f00 100644
> --- a/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c
> +++ b/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c
> @@ -13,7 +13,7 @@
> #include <linux/io.h>
> #include <miiphy.h>
> #include <netdev.h>
> -#include <status_led.h>
> +#include <led.h>
> #include <asm/arch/cpu.h>
> #include <asm/arch/soc.h>
> #include <asm/arch/mpp.h>
> @@ -41,41 +41,6 @@
>
> DECLARE_GLOBAL_DATA_PTR;
>
> -struct led {
> - u32 reg;
> - u32 value;
> - u32 mask;
> -};
> -
> -struct led amber_solid = {
> - MVEBU_GPIO0_BASE,
> - BIT(10),
> - BIT(18) | BIT(10)
> -};
> -
> -struct led green_solid = {
> - MVEBU_GPIO0_BASE,
> - BIT(18) | BIT(10),
> - BIT(18) | BIT(10)
> -};
> -
> -struct led amber_flash = {
> - MVEBU_GPIO0_BASE,
> - 0,
> - BIT(18) | BIT(10)
> -};
> -
> -struct led green_flash = {
> - MVEBU_GPIO0_BASE,
> - BIT(18),
> - BIT(18) | BIT(10)
> -};
> -
> -static void status_led_set(struct led *led)
> -{
> - clrsetbits_le32(led->reg, led->mask, led->value);
> -}
> -
> int board_early_init_f(void)
> {
> /*
> @@ -165,8 +130,6 @@ int board_init(void)
> /* address of boot parameters */
> gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100;
>
> - status_led_set(&amber_solid);
> -
> return 0;
> }
>
> @@ -196,7 +159,16 @@ int mv88e61xx_hw_reset(struct phy_device *phydev)
> #ifdef CONFIG_MISC_INIT_R
> int misc_init_r(void)
> {
> - status_led_set(&green_flash);
> + struct udevice *dev;
> + int ret;
> +
> + ret = led_get_by_label("status:ledp", &dev);
> + if (!ret)
> + led_set_state(dev, LEDST_ON);
> +
> + ret = led_get_by_label("status:ledn", &dev);
> + if (!ret)
> + led_set_state(dev, LEDST_OFF);
>
> return 0;
> }
> diff --git a/configs/SBx81LIFKW_defconfig b/configs/SBx81LIFKW_defconfig
> index f186f247eb63..90800e2dd3ee 100644
> --- a/configs/SBx81LIFKW_defconfig
> +++ b/configs/SBx81LIFKW_defconfig
> @@ -46,6 +46,8 @@ CONFIG_DM_I2C=y
> CONFIG_SYS_I2C_MVTWSI=y
> CONFIG_I2C_MUX=y
> CONFIG_I2C_MUX_PCA954x=y
> +CONFIG_LED=y
> +CONFIG_LED_GPIO=y
> # CONFIG_MMC is not set
> CONFIG_MTD=y
> CONFIG_DM_SPI_FLASH=y
Viele Grüße,
Stefan Roese
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/6] ARM: kirkwood: SBx81LIFKW: update for DM_GPIO
2022-08-04 9:06 ` [PATCH 2/6] ARM: kirkwood: SBx81LIFKW: update for DM_GPIO Chris Packham
@ 2022-08-05 10:47 ` Stefan Roese
0 siblings, 0 replies; 14+ messages in thread
From: Stefan Roese @ 2022-08-05 10:47 UTC (permalink / raw)
To: Chris Packham, u-boot; +Cc: Chris Packham, Tom Rini
On 04.08.22 11:06, Chris Packham wrote:
> Update mv88e61xx_hw_reset() to use the DM_GPIO API to toggle the reset
> line for the linkstreet switch.
>
> Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Thanks,
Stefan
> ---
>
> board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c | 21 ++++++++++++++++-----
> 1 file changed, 16 insertions(+), 5 deletions(-)
>
> diff --git a/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c b/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c
> index feb8b6b83f00..e0a7f3fa89f0 100644
> --- a/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c
> +++ b/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c
> @@ -17,7 +17,8 @@
> #include <asm/arch/cpu.h>
> #include <asm/arch/soc.h>
> #include <asm/arch/mpp.h>
> -#include <asm/arch/gpio.h>
> +#include <asm-generic/gpio.h>
> +#include <dm.h>
>
> /* Note: GPIO differences between specific boards
> *
> @@ -37,8 +38,6 @@
> #define SBX81LIFKW_OE_VAL_LOW (BIT(31) | BIT(30) | BIT(28) | BIT(27))
> #define SBX81LIFKW_OE_VAL_HIGH (BIT(0) | BIT(1))
>
> -#define MV88E6097_RESET 27
> -
> DECLARE_GLOBAL_DATA_PTR;
>
> int board_early_init_f(void)
> @@ -143,11 +142,23 @@ void reset_phy(void)
> #ifdef CONFIG_MV88E61XX_SWITCH
> int mv88e61xx_hw_reset(struct phy_device *phydev)
> {
> + struct gpio_desc desc;
> + int ret;
> +
> + ret = dm_gpio_lookup_name("mvebu0_27", &desc);
> + if (ret)
> + return ret;
> +
> + ret = dm_gpio_request(&desc, "linkstreet_rst");
> + if (ret)
> + return ret;
> +
> /* Ensure the 88e6097 gets at least 10ms Reset
> */
> - kw_gpio_set_value(MV88E6097_RESET, 0);
> + dm_gpio_set_dir_flags(&desc, GPIOD_IS_OUT);
> + dm_gpio_set_value(&desc, 0);
> mdelay(20);
> - kw_gpio_set_value(MV88E6097_RESET, 1);
> + dm_gpio_set_value(&desc, 1);
> mdelay(20);
>
> phydev->advertising = ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full;
Viele Grüße,
Stefan Roese
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 3/6] ARM: kirkwood: SBx81LIFKW: enable CMD_GPIO
2022-08-04 9:06 ` [PATCH 3/6] ARM: kirkwood: SBx81LIFKW: enable CMD_GPIO Chris Packham
@ 2022-08-05 10:48 ` Stefan Roese
0 siblings, 0 replies; 14+ messages in thread
From: Stefan Roese @ 2022-08-05 10:48 UTC (permalink / raw)
To: Chris Packham, u-boot; +Cc: Chris Packham, Tom Rini
On 04.08.22 11:06, Chris Packham wrote:
> For debugging it is convenient to query/access GPIOs from the command
> line.
>
> Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Thanks,
Stefan
> ---
>
> configs/SBx81LIFKW_defconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/configs/SBx81LIFKW_defconfig b/configs/SBx81LIFKW_defconfig
> index 90800e2dd3ee..ad7e2e976d2a 100644
> --- a/configs/SBx81LIFKW_defconfig
> +++ b/configs/SBx81LIFKW_defconfig
> @@ -26,6 +26,7 @@ CONFIG_SYS_CBSIZE=256
> CONFIG_SYS_PBSIZE=276
> CONFIG_CMD_DM=y
> # CONFIG_CMD_FLASH is not set
> +CONFIG_CMD_GPIO=y
> CONFIG_CMD_I2C=y
> CONFIG_CMD_DHCP=y
> CONFIG_BOOTP_NTPSERVER=y
Viele Grüße,
Stefan Roese
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 4/6] ARM: kirkwood: SBx81LIFKW: disable KIRKWOOD_GPIO
2022-08-04 9:06 ` [PATCH 4/6] ARM: kirkwood: SBx81LIFKW: disable KIRKWOOD_GPIO Chris Packham
@ 2022-08-05 10:48 ` Stefan Roese
0 siblings, 0 replies; 14+ messages in thread
From: Stefan Roese @ 2022-08-05 10:48 UTC (permalink / raw)
To: Chris Packham, u-boot; +Cc: Chris Packham, Tom Rini
On 04.08.22 11:06, Chris Packham wrote:
> DM_GPIO was already enabled so the MVEBU_GPIO was already available.
> Having updated the board code to use the DM_GPIO APIs the KIRKWOOD_GPIO
> driver became unnecessary. Disable it for SBx81LIFKW.
>
> Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Thanks,
Stefan
> ---
>
> configs/SBx81LIFKW_defconfig | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/configs/SBx81LIFKW_defconfig b/configs/SBx81LIFKW_defconfig
> index ad7e2e976d2a..ec940bd30891 100644
> --- a/configs/SBx81LIFKW_defconfig
> +++ b/configs/SBx81LIFKW_defconfig
> @@ -41,7 +41,6 @@ CONFIG_ENV_SPI_MAX_HZ=20000000
> CONFIG_SYS_RELOC_GD_ENV_ADDR=y
> CONFIG_NETCONSOLE=y
> CONFIG_DM=y
> -CONFIG_KIRKWOOD_GPIO=y
> CONFIG_DM_PCA953X=y
> CONFIG_DM_I2C=y
> CONFIG_SYS_I2C_MVTWSI=y
Viele Grüße,
Stefan Roese
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 5/6] ARM: kirkwood: SBx81LIFKW: enable CONFIG_NET_RANDOM_ETHADDR
2022-08-04 9:06 ` [PATCH 5/6] ARM: kirkwood: SBx81LIFKW: enable CONFIG_NET_RANDOM_ETHADDR Chris Packham
@ 2022-08-05 10:48 ` Stefan Roese
0 siblings, 0 replies; 14+ messages in thread
From: Stefan Roese @ 2022-08-05 10:48 UTC (permalink / raw)
To: Chris Packham, u-boot; +Cc: Chris Packham, Tom Rini
On 04.08.22 11:06, Chris Packham wrote:
> When booting a fresh board having a random Ethernet address enables
> using the network device to program the board.
>
> Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Thanks,
Stefan
> ---
>
> configs/SBx81LIFKW_defconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/configs/SBx81LIFKW_defconfig b/configs/SBx81LIFKW_defconfig
> index ec940bd30891..a9f984239af9 100644
> --- a/configs/SBx81LIFKW_defconfig
> +++ b/configs/SBx81LIFKW_defconfig
> @@ -39,6 +39,7 @@ CONFIG_ENV_OVERWRITE=y
> CONFIG_ENV_IS_IN_SPI_FLASH=y
> CONFIG_ENV_SPI_MAX_HZ=20000000
> CONFIG_SYS_RELOC_GD_ENV_ADDR=y
> +CONFIG_NET_RANDOM_ETHADDR=y
> CONFIG_NETCONSOLE=y
> CONFIG_DM=y
> CONFIG_DM_PCA953X=y
Viele Grüße,
Stefan Roese
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 6/6] ARM: kirkwood: SBx81LIFXCAT: disable KIRKWOOD_GPIO
2022-08-04 9:06 ` [PATCH 6/6] ARM: kirkwood: SBx81LIFXCAT: disable KIRKWOOD_GPIO Chris Packham
@ 2022-08-05 10:49 ` Stefan Roese
0 siblings, 0 replies; 14+ messages in thread
From: Stefan Roese @ 2022-08-05 10:49 UTC (permalink / raw)
To: Chris Packham, u-boot; +Cc: Chris Packham, Tom Rini
On 04.08.22 11:06, Chris Packham wrote:
> DM_GPIO was already enabled so the MVEBU_GPIO was already available.
> Disable KIRKWOOD_GPIO as it was unnecessary.
>
> Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Thanks,
Stefan
> ---
>
> configs/SBx81LIFXCAT_defconfig | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/configs/SBx81LIFXCAT_defconfig b/configs/SBx81LIFXCAT_defconfig
> index 9d579091a82f..cb80b7876f38 100644
> --- a/configs/SBx81LIFXCAT_defconfig
> +++ b/configs/SBx81LIFXCAT_defconfig
> @@ -42,7 +42,6 @@ CONFIG_ENV_SPI_MAX_HZ=20000000
> CONFIG_SYS_RELOC_GD_ENV_ADDR=y
> CONFIG_NETCONSOLE=y
> CONFIG_DM=y
> -CONFIG_KIRKWOOD_GPIO=y
> CONFIG_DM_PCA953X=y
> CONFIG_DM_I2C=y
> CONFIG_SYS_I2C_MVTWSI=y
Viele Grüße,
Stefan Roese
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 0/6] SBx81LIFKW/SBx81LIFXCAT disable KIRKWOOD_GPIO
2022-08-04 9:06 [PATCH 0/6] SBx81LIFKW/SBx81LIFXCAT disable KIRKWOOD_GPIO Chris Packham
` (5 preceding siblings ...)
2022-08-04 9:06 ` [PATCH 6/6] ARM: kirkwood: SBx81LIFXCAT: disable KIRKWOOD_GPIO Chris Packham
@ 2022-08-09 11:35 ` Stefan Roese
6 siblings, 0 replies; 14+ messages in thread
From: Stefan Roese @ 2022-08-09 11:35 UTC (permalink / raw)
To: Chris Packham, u-boot; +Cc: Chris Packham, Tom Rini
On 04.08.22 11:06, Chris Packham wrote:
> This series makes changes to use the DM gpio APIs so that KIRKWOOD_GPIO
> can be disabled on these boards.
>
> Chris Packham (6):
> ARM: kirkwood: SBx81LIFKW: remove direct access of GPIO registers
> ARM: kirkwood: SBx81LIFKW: update for DM_GPIO
> ARM: kirkwood: SBx81LIFKW: enable CMD_GPIO
> ARM: kirkwood: SBx81LIFKW: disable KIRKWOOD_GPIO
> ARM: kirkwood: SBx81LIFKW: enable CONFIG_NET_RANDOM_ETHADDR
> ARM: kirkwood: SBx81LIFXCAT: disable KIRKWOOD_GPIO
>
> arch/arm/dts/kirkwood-atl-sbx81lifkw.dts | 14 ++++
> board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c | 71 ++++++++-------------
> configs/SBx81LIFKW_defconfig | 5 +-
> configs/SBx81LIFXCAT_defconfig | 1 -
> 4 files changed, 45 insertions(+), 46 deletions(-)
>
Applied to u-boot-marvell/master
Thanks,
Stefan
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2022-08-09 11:35 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-04 9:06 [PATCH 0/6] SBx81LIFKW/SBx81LIFXCAT disable KIRKWOOD_GPIO Chris Packham
2022-08-04 9:06 ` [PATCH 1/6] ARM: kirkwood: SBx81LIFKW: remove direct access of GPIO registers Chris Packham
2022-08-05 10:47 ` Stefan Roese
2022-08-04 9:06 ` [PATCH 2/6] ARM: kirkwood: SBx81LIFKW: update for DM_GPIO Chris Packham
2022-08-05 10:47 ` Stefan Roese
2022-08-04 9:06 ` [PATCH 3/6] ARM: kirkwood: SBx81LIFKW: enable CMD_GPIO Chris Packham
2022-08-05 10:48 ` Stefan Roese
2022-08-04 9:06 ` [PATCH 4/6] ARM: kirkwood: SBx81LIFKW: disable KIRKWOOD_GPIO Chris Packham
2022-08-05 10:48 ` Stefan Roese
2022-08-04 9:06 ` [PATCH 5/6] ARM: kirkwood: SBx81LIFKW: enable CONFIG_NET_RANDOM_ETHADDR Chris Packham
2022-08-05 10:48 ` Stefan Roese
2022-08-04 9:06 ` [PATCH 6/6] ARM: kirkwood: SBx81LIFXCAT: disable KIRKWOOD_GPIO Chris Packham
2022-08-05 10:49 ` Stefan Roese
2022-08-09 11:35 ` [PATCH 0/6] SBx81LIFKW/SBx81LIFXCAT " Stefan Roese
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.