Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
x86 U-Boot Custodian Tree
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
U-Boot
Custodians
x86 U-Boot Custodian Tree
Commits
b775bf54
Commit
b775bf54
authored
Nov 02, 2019
by
Bin Meng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "dm: gpio: Allow control of GPIO uclass in SPL"
This reverts commit
48392098
.
parent
1c2b1ac2
Pipeline
#1194
failed with stages
in 133 minutes and 50 seconds
Changes
41
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
41 changed files
with
82 additions
and
110 deletions
+82
-110
arch/arm/include/asm/omap_gpio.h
arch/arm/include/asm/omap_gpio.h
+1
-1
arch/arm/mach-at91/include/mach/at91sam9260.h
arch/arm/mach-at91/include/mach/at91sam9260.h
+1
-1
arch/arm/mach-davinci/include/mach/gpio.h
arch/arm/mach-davinci/include/mach/gpio.h
+1
-1
arch/arm/mach-omap2/am33xx/board.c
arch/arm/mach-omap2/am33xx/board.c
+2
-2
arch/arm/mach-omap2/omap3/board.c
arch/arm/mach-omap2/omap3/board.c
+1
-1
arch/arm/mach-omap2/omap5/hwinit.c
arch/arm/mach-omap2/omap5/hwinit.c
+1
-1
board/freescale/imx8qm_mek/imx8qm_mek.c
board/freescale/imx8qm_mek/imx8qm_mek.c
+1
-1
board/freescale/imx8qxp_mek/imx8qxp_mek.c
board/freescale/imx8qxp_mek/imx8qxp_mek.c
+1
-1
board/gateworks/gw_ventana/Kconfig
board/gateworks/gw_ventana/Kconfig
+0
-3
board/toradex/apalis-imx8/apalis-imx8.c
board/toradex/apalis-imx8/apalis-imx8.c
+1
-1
drivers/gpio/Kconfig
drivers/gpio/Kconfig
+0
-22
drivers/gpio/Makefile
drivers/gpio/Makefile
+1
-3
drivers/gpio/at91_gpio.c
drivers/gpio/at91_gpio.c
+3
-3
drivers/gpio/atmel_pio4.c
drivers/gpio/atmel_pio4.c
+1
-1
drivers/gpio/da8xx_gpio.c
drivers/gpio/da8xx_gpio.c
+3
-4
drivers/gpio/da8xx_gpio.h
drivers/gpio/da8xx_gpio.h
+1
-1
drivers/gpio/mxc_gpio.c
drivers/gpio/mxc_gpio.c
+2
-2
drivers/gpio/mxs_gpio.c
drivers/gpio/mxs_gpio.c
+2
-2
drivers/gpio/omap_gpio.c
drivers/gpio/omap_gpio.c
+3
-3
drivers/gpio/sunxi_gpio.c
drivers/gpio/sunxi_gpio.c
+4
-4
drivers/i2c/i2c-uclass.c
drivers/i2c/i2c-uclass.c
+3
-3
drivers/i2c/muxes/pca954x.c
drivers/i2c/muxes/pca954x.c
+2
-2
drivers/mmc/fsl_esdhc_imx.c
drivers/mmc/fsl_esdhc_imx.c
+6
-7
drivers/mmc/omap_hsmmc.c
drivers/mmc/omap_hsmmc.c
+1
-1
drivers/net/designware.c
drivers/net/designware.c
+5
-5
drivers/net/designware.h
drivers/net/designware.h
+2
-2
drivers/net/fec_mxc.c
drivers/net/fec_mxc.c
+3
-3
drivers/net/fec_mxc.h
drivers/net/fec_mxc.h
+1
-1
drivers/net/mvneta.c
drivers/net/mvneta.c
+2
-2
drivers/net/mvpp2.c
drivers/net/mvpp2.c
+4
-4
drivers/net/sun8i_emac.c
drivers/net/sun8i_emac.c
+6
-6
drivers/pci/pci-aardvark.c
drivers/pci/pci-aardvark.c
+2
-2
drivers/pci/pcie_dw_mvebu.c
drivers/pci/pcie_dw_mvebu.c
+2
-2
drivers/spi/atmel_spi.c
drivers/spi/atmel_spi.c
+5
-5
drivers/spi/designware_spi.c
drivers/spi/designware_spi.c
+2
-2
drivers/tpm/tpm2_tis_spi.c
drivers/tpm/tpm2_tis_spi.c
+1
-1
include/config_uncmd_spl.h
include/config_uncmd_spl.h
+1
-0
include/configs/at91-sama5_common.h
include/configs/at91-sama5_common.h
+2
-3
include/configs/gw_ventana.h
include/configs/gw_ventana.h
+1
-0
include/configs/mx6ul_14x14_evk.h
include/configs/mx6ul_14x14_evk.h
+0
-1
scripts/Makefile.uncmd_spl
scripts/Makefile.uncmd_spl
+1
-0
No files found.
arch/arm/include/asm/omap_gpio.h
View file @
b775bf54
...
...
@@ -22,7 +22,7 @@
#include <asm/arch/cpu.h>
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
/* Information about a GPIO bank */
struct
omap_gpio_platdata
{
...
...
arch/arm/mach-at91/include/mach/at91sam9260.h
View file @
b775bf54
...
...
@@ -133,7 +133,7 @@
/*
* Other misc defines
*/
#if
!CONFIG_IS_ENABLED(DM_GPIO)
#if
ndef CONFIG_DM_GPIO
#define ATMEL_PIO_PORTS 3
/* these SoCs have 3 PIO */
#define ATMEL_BASE_PIO ATMEL_BASE_PIOA
#endif
...
...
arch/arm/mach-davinci/include/mach/gpio.h
View file @
b775bf54
...
...
@@ -18,7 +18,7 @@
#define davinci_gpio_bank67 ((struct davinci_gpio *)DAVINCI_GPIO_BANK67)
#define davinci_gpio_bank8 ((struct davinci_gpio *)DAVINCI_GPIO_BANK8)
#if
!CONFIG_IS_ENABLED(DM_GPIO)
#if
ndef CONFIG_DM_GPIO
#define gpio_status() gpio_info()
#endif
#define GPIO_NAME_SIZE 20
...
...
arch/arm/mach-omap2/am33xx/board.c
View file @
b775bf54
...
...
@@ -116,7 +116,7 @@ U_BOOT_DEVICES(am33xx_i2c) = {
};
#endif
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
static
const
struct
omap_gpio_platdata
am33xx_gpio
[]
=
{
{
0
,
AM33XX_GPIO0_BASE
},
{
1
,
AM33XX_GPIO1_BASE
},
...
...
@@ -141,7 +141,7 @@ U_BOOT_DEVICES(am33xx_gpios) = {
#endif
#endif
#if
!CONFIG_IS_ENABLED(DM_GPIO)
#if
ndef CONFIG_DM_GPIO
static
const
struct
gpio_bank
gpio_bank_am33xx
[]
=
{
{
(
void
*
)
AM33XX_GPIO0_BASE
},
{
(
void
*
)
AM33XX_GPIO1_BASE
},
...
...
arch/arm/mach-omap2/omap3/board.c
View file @
b775bf54
...
...
@@ -33,7 +33,7 @@ extern omap3_sysinfo sysinfo;
static
void
omap3_invalidate_l2_cache_secure
(
void
);
#endif
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
#if !CONFIG_IS_ENABLED(OF_CONTROL)
/* Manually initialize GPIO banks when OF_CONTROL doesn't */
static
const
struct
omap_gpio_platdata
omap34xx_gpio
[]
=
{
...
...
arch/arm/mach-omap2/omap5/hwinit.c
View file @
b775bf54
...
...
@@ -25,7 +25,7 @@
u32
*
const
omap_si_rev
=
(
u32
*
)
OMAP_SRAM_SCRATCH_OMAP_REV
;
#if
!CONFIG_IS_ENABLED(DM_GPIO)
#if
ndef CONFIG_DM_GPIO
static
struct
gpio_bank
gpio_bank_54xx
[
8
]
=
{
{
(
void
*
)
OMAP54XX_GPIO1_BASE
},
{
(
void
*
)
OMAP54XX_GPIO2_BASE
},
...
...
board/freescale/imx8qm_mek/imx8qm_mek.c
View file @
b775bf54
...
...
@@ -49,7 +49,7 @@ int board_early_init_f(void)
return
0
;
}
#if
CONFIG_IS_ENABLED(
DM_GPIO)
#if
IS_ENABLED(CONFIG_
DM_GPIO)
static
void
board_gpio_init
(
void
)
{
/* TODO */
...
...
board/freescale/imx8qxp_mek/imx8qxp_mek.c
View file @
b775bf54
...
...
@@ -53,7 +53,7 @@ int board_early_init_f(void)
return
0
;
}
#if
CONFIG_IS_ENABLED(
DM_GPIO)
#if
IS_ENABLED(CONFIG_
DM_GPIO)
static
void
board_gpio_init
(
void
)
{
struct
gpio_desc
desc
;
...
...
board/gateworks/gw_ventana/Kconfig
View file @
b775bf54
if TARGET_GW_VENTANA
config DM_GPIO
default y
config SYS_BOARD
default "gw_ventana"
...
...
board/toradex/apalis-imx8/apalis-imx8.c
View file @
b775bf54
...
...
@@ -50,7 +50,7 @@ int board_early_init_f(void)
return
0
;
}
#if
CONFIG_IS_ENABLED(
DM_GPIO)
#if
IS_ENABLED(CONFIG_
DM_GPIO)
static
void
board_gpio_init
(
void
)
{
/* TODO */
...
...
drivers/gpio/Kconfig
View file @
b775bf54
...
...
@@ -14,28 +14,6 @@ config DM_GPIO
particular GPIOs that they provide. The uclass interface
is defined in include/asm-generic/gpio.h.
config SPL_DM_GPIO
bool "Enable Driver Model for GPIO drivers in SPL"
depends on DM_GPIO && SPL_DM && SPL_GPIO_SUPPORT
default y
help
Enable driver model for GPIO access in SPL. The standard GPIO
interface (gpio_get_value(), etc.) is then implemented by
the GPIO uclass. Drivers provide methods to query the
particular GPIOs that they provide. The uclass interface
is defined in include/asm-generic/gpio.h.
config TPL_DM_GPIO
bool "Enable Driver Model for GPIO drivers in TPL"
depends on DM_GPIO && TPL_DM && TPL_GPIO_SUPPORT
default y
help
Enable driver model for GPIO access in TPL. The standard GPIO
interface (gpio_get_value(), etc.) is then implemented by
the GPIO uclass. Drivers provide methods to query the
particular GPIOs that they provide. The uclass interface
is defined in include/asm-generic/gpio.h.
config GPIO_HOG
bool "Enable GPIO hog support"
depends on DM_GPIO
...
...
drivers/gpio/Makefile
View file @
b775bf54
...
...
@@ -7,12 +7,10 @@ ifndef CONFIG_SPL_BUILD
obj-$(CONFIG_DWAPB_GPIO)
+=
dwapb_gpio.o
obj-$(CONFIG_AXP_GPIO)
+=
axp_gpio.o
endif
obj-$(CONFIG_
$(SPL_TPL_)DM_GPIO)
+=
gpio-uclass.o
obj-$(CONFIG_
DM_GPIO)
+=
gpio-uclass.o
obj-$(CONFIG_$(SPL_)DM_PCA953X)
+=
pca953x_gpio.o
ifdef
CONFIG_$(SPL_TPL_)GPIO
obj-$(CONFIG_DM_74X164)
+=
74x164_gpio.o
endif
obj-$(CONFIG_AT91_GPIO)
+=
at91_gpio.o
obj-$(CONFIG_ATMEL_PIO4)
+=
atmel_pio4.o
...
...
drivers/gpio/at91_gpio.c
View file @
b775bf54
...
...
@@ -210,7 +210,7 @@ int at91_pio3_set_d_periph(unsigned port, unsigned pin, int use_pullup)
return
0
;
}
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
static
bool
at91_get_port_output
(
struct
at91_port
*
at91_port
,
int
offset
)
{
u32
mask
,
val
;
...
...
@@ -457,7 +457,7 @@ int at91_get_pio_value(unsigned port, unsigned pin)
return
0
;
}
#if
!CONFIG_IS_ENABLED(DM_GPIO)
#if
ndef CONFIG_DM_GPIO
/* Common GPIO API */
int
gpio_request
(
unsigned
gpio
,
const
char
*
label
)
...
...
@@ -499,7 +499,7 @@ int gpio_set_value(unsigned gpio, int value)
}
#endif
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
struct
at91_port_priv
{
struct
at91_port
*
regs
;
...
...
drivers/gpio/atmel_pio4.c
View file @
b775bf54
...
...
@@ -168,7 +168,7 @@ int atmel_pio4_get_pio_input(u32 port, u32 pin)
return
(
readl
(
&
port_base
->
pdsr
)
&
mask
)
?
1
:
0
;
}
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
struct
atmel_pioctrl_data
{
u32
nbanks
;
...
...
drivers/gpio/da8xx_gpio.c
View file @
b775bf54
...
...
@@ -15,7 +15,7 @@
#include "da8xx_gpio.h"
#if
!CONFIG_IS_ENABLED(DM_GPIO)
#if
ndef CONFIG_DM_GPIO
#include <asm/arch/hardware.h>
#include <asm/arch/davinci_misc.h>
...
...
@@ -377,8 +377,7 @@ static int _gpio_direction_output(struct davinci_gpio *bank, unsigned int gpio,
_gpio_set_value
(
bank
,
gpio
,
value
);
return
0
;
}
#if !CONFIG_IS_ENABLED(DM_GPIO)
#ifndef CONFIG_DM_GPIO
void
gpio_info
(
void
)
{
...
...
@@ -429,7 +428,7 @@ int gpio_set_value(unsigned int gpio, int value)
return
_gpio_set_value
(
bank
,
gpio
,
value
);
}
#else
/* DM_GPIO */
#else
/*
CONFIG_
DM_GPIO */
static
struct
davinci_gpio
*
davinci_get_gpio_bank
(
struct
udevice
*
dev
,
unsigned
int
offset
)
{
...
...
drivers/gpio/da8xx_gpio.h
View file @
b775bf54
...
...
@@ -28,7 +28,7 @@ struct davinci_gpio_bank {
#define MAX_NUM_GPIOS 144
#define GPIO_BIT(gp) ((gp) & 0x1F)
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
/* Information about a GPIO bank */
struct
davinci_gpio_platdata
{
...
...
drivers/gpio/mxc_gpio.c
View file @
b775bf54
...
...
@@ -30,7 +30,7 @@ struct mxc_bank_info {
struct
gpio_regs
*
regs
;
};
#if
!CONFIG_IS_ENABLED(DM_GPIO)
#if
ndef CONFIG_DM_GPIO
#define GPIO_TO_PORT(n) ((n) / 32)
/* GPIO port description */
...
...
@@ -161,7 +161,7 @@ int gpio_direction_output(unsigned gpio, int value)
}
#endif
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
#include <fdtdec.h>
static
int
mxc_gpio_is_output
(
struct
gpio_regs
*
regs
,
int
offset
)
{
...
...
drivers/gpio/mxs_gpio.c
View file @
b775bf54
...
...
@@ -128,7 +128,7 @@ int name_to_gpio(const char *name)
return
(
bank
<<
MXS_PAD_BANK_SHIFT
)
|
(
pin
<<
MXS_PAD_PIN_SHIFT
);
}
#else
/* DM_GPIO */
#else
/*
CONFIG_
DM_GPIO */
#include <dm.h>
#include <asm/gpio.h>
#include <dt-structs.h>
...
...
@@ -312,4 +312,4 @@ U_BOOT_DRIVER(gpio_mxs) = {
.
ofdata_to_platdata
=
mxs_ofdata_to_platdata
,
#endif
};
#endif
/* DM_GPIO */
#endif
/*
CONFIG_
DM_GPIO */
drivers/gpio/omap_gpio.c
View file @
b775bf54
...
...
@@ -30,7 +30,7 @@ DECLARE_GLOBAL_DATA_PTR;
#define OMAP_GPIO_DIR_OUT 0
#define OMAP_GPIO_DIR_IN 1
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
#define GPIO_PER_BANK 32
...
...
@@ -121,7 +121,7 @@ static int _get_gpio_value(const struct gpio_bank *bank, int gpio)
return
(
__raw_readl
(
reg
)
&
(
1
<<
gpio
))
!=
0
;
}
#if
!CONFIG_IS_ENABLED(DM_GPIO)
#if
ndef CONFIG_DM_GPIO
static
inline
const
struct
gpio_bank
*
get_gpio_bank
(
int
gpio
)
{
...
...
@@ -377,4 +377,4 @@ U_BOOT_DRIVER(gpio_omap) = {
#endif
};
#endif
/*
!
DM_GPIO */
#endif
/*
CONFIG_
DM_GPIO */
drivers/gpio/sunxi_gpio.c
View file @
b775bf54
...
...
@@ -28,7 +28,7 @@ struct sunxi_gpio_platdata {
int
gpio_count
;
};
#if
!CONFIG_IS_ENABLED(DM_GPIO)
#if
ndef CONFIG_DM_GPIO
static
int
sunxi_gpio_output
(
u32
pin
,
u32
val
)
{
u32
dat
;
...
...
@@ -116,7 +116,7 @@ int sunxi_name_to_gpio(const char *name)
return
-
1
;
return
group
*
32
+
pin
;
}
#endif
/* DM_GPIO */
#endif
int
sunxi_name_to_gpio_bank
(
const
char
*
name
)
{
...
...
@@ -132,7 +132,7 @@ int sunxi_name_to_gpio_bank(const char *name)
return
-
1
;
}
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
/* TODO(sjg@chromium.org): Remove this function and use device tree */
int
sunxi_name_to_gpio
(
const
char
*
name
)
{
...
...
@@ -373,4 +373,4 @@ U_BOOT_DRIVER(gpio_sunxi) = {
.
bind
=
gpio_sunxi_bind
,
.
probe
=
gpio_sunxi_probe
,
};
#endif
/* DM_GPIO */
#endif
drivers/i2c/i2c-uclass.c
View file @
b775bf54
...
...
@@ -11,7 +11,7 @@
#include <dm/device-internal.h>
#include <dm/lists.h>
#include <dm/pinctrl.h>
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
#include <asm/gpio.h>
#endif
...
...
@@ -465,7 +465,7 @@ int i2c_get_chip_offset_len(struct udevice *dev)
return
chip
->
offset_len
;
}
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
static
void
i2c_gpio_set_pin
(
struct
gpio_desc
*
pin
,
int
bit
)
{
if
(
bit
)
...
...
@@ -561,7 +561,7 @@ static int i2c_deblock_gpio(struct udevice *bus)
{
return
-
ENOSYS
;
}
#endif
/
* DM_GPIO */
#endif /
/ CONFIG_DM_GPIO
int
i2c_deblock
(
struct
udevice
*
bus
)
{
...
...
drivers/i2c/muxes/pca954x.c
View file @
b775bf54
...
...
@@ -125,7 +125,7 @@ static int pca954x_ofdata_to_platdata(struct udevice *dev)
static
int
pca954x_probe
(
struct
udevice
*
dev
)
{
if
(
CONFIG_IS_ENABLED
(
DM_GPIO
))
{
if
(
IS_ENABLED
(
CONFIG_
DM_GPIO
))
{
struct
pca954x_priv
*
priv
=
dev_get_priv
(
dev
);
int
err
;
...
...
@@ -146,7 +146,7 @@ static int pca954x_probe(struct udevice *dev)
static
int
pca954x_remove
(
struct
udevice
*
dev
)
{
if
(
CONFIG_IS_ENABLED
(
DM_GPIO
))
{
if
(
IS_ENABLED
(
CONFIG_
DM_GPIO
))
{
struct
pca954x_priv
*
priv
=
dev_get_priv
(
dev
);
if
(
dm_gpio_is_valid
(
&
priv
->
gpio_mux_reset
))
...
...
drivers/mmc/fsl_esdhc_imx.c
View file @
b775bf54
...
...
@@ -149,7 +149,7 @@ struct fsl_esdhc_priv {
struct
udevice
*
vqmmc_dev
;
struct
udevice
*
vmmc_dev
;
#endif
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
struct
gpio_desc
cd_gpio
;
struct
gpio_desc
wp_gpio
;
#endif
...
...
@@ -302,9 +302,8 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc,
return
-
ETIMEDOUT
;
}
}
else
{
#if CONFIG_IS_ENABLED(DM_GPIO)
if
(
dm_gpio_is_valid
(
&
priv
->
wp_gpio
)
&&
dm_gpio_get_value
(
&
priv
->
wp_gpio
))
{
#ifdef CONFIG_DM_GPIO
if
(
dm_gpio_is_valid
(
&
priv
->
wp_gpio
)
&&
dm_gpio_get_value
(
&
priv
->
wp_gpio
))
{
printf
(
"
\n
The SD card is locked. Can not write to a locked card.
\n\n
"
);
return
-
ETIMEDOUT
;
}
...
...
@@ -1090,7 +1089,7 @@ static int esdhc_getcd_common(struct fsl_esdhc_priv *priv)
#if CONFIG_IS_ENABLED(DM_MMC)
if
(
priv
->
non_removable
)
return
1
;
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
if
(
dm_gpio_is_valid
(
&
priv
->
cd_gpio
))
return
dm_gpio_get_value
(
&
priv
->
cd_gpio
);
#endif
...
...
@@ -1452,7 +1451,7 @@ static int fsl_esdhc_probe(struct udevice *dev)
priv
->
non_removable
=
1
;
}
else
{
priv
->
non_removable
=
0
;
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
gpio_request_by_name
(
dev
,
"cd-gpios"
,
0
,
&
priv
->
cd_gpio
,
GPIOD_IS_IN
);
#endif
...
...
@@ -1462,7 +1461,7 @@ static int fsl_esdhc_probe(struct udevice *dev)
priv
->
wp_enable
=
1
;
}
else
{
priv
->
wp_enable
=
0
;
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
gpio_request_by_name
(
dev
,
"wp-gpios"
,
0
,
&
priv
->
wp_gpio
,
GPIOD_IS_IN
);
#endif
...
...
drivers/mmc/omap_hsmmc.c
View file @
b775bf54
...
...
@@ -183,7 +183,7 @@ static int omap_mmc_setup_gpio_in(int gpio, const char *label)
{
int
ret
;
#if
!CONFIG_IS_ENABLED(DM_GPIO)
#if
ndef CONFIG_DM_GPIO
if
(
!
gpio_is_valid
(
gpio
))
return
-
1
;
#endif
...
...
drivers/net/designware.c
View file @
b775bf54
...
...
@@ -81,7 +81,7 @@ static int dw_mdio_write(struct mii_dev *bus, int addr, int devad, int reg,
return
ret
;
}
#if defined(CONFIG_DM_ETH) &&
CONFIG_IS_ENABLED(
DM_GPIO)
#if defined(CONFIG_DM_ETH) &&
defined(CONFIG_
DM_GPIO)
static
int
dw_mdio_reset
(
struct
mii_dev
*
bus
)
{
struct
udevice
*
dev
=
bus
->
priv
;
...
...
@@ -127,7 +127,7 @@ static int dw_mdio_init(const char *name, void *priv)
bus
->
read
=
dw_mdio_read
;
bus
->
write
=
dw_mdio_write
;
snprintf
(
bus
->
name
,
sizeof
(
bus
->
name
),
"%s"
,
name
);
#if defined(CONFIG_DM_ETH) &&
CONFIG_IS_ENABLED(
DM_GPIO)
#if defined(CONFIG_DM_ETH) &&
defined(CONFIG_
DM_GPIO)
bus
->
reset
=
dw_mdio_reset
;
#endif
...
...
@@ -806,12 +806,12 @@ const struct eth_ops designware_eth_ops = {
int
designware_eth_ofdata_to_platdata
(
struct
udevice
*
dev
)
{
struct
dw_eth_pdata
*
dw_pdata
=
dev_get_platdata
(
dev
);
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
struct
dw_eth_dev
*
priv
=
dev_get_priv
(
dev
);
#endif
struct
eth_pdata
*
pdata
=
&
dw_pdata
->
eth_pdata
;
const
char
*
phy_mode
;
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
int
reset_flags
=
GPIOD_IS_OUT
;
#endif
int
ret
=
0
;
...
...
@@ -828,7 +828,7 @@ int designware_eth_ofdata_to_platdata(struct udevice *dev)
pdata
->
max_speed
=
dev_read_u32_default
(
dev
,
"max-speed"
,
0
);
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
if
(
dev_read_bool
(
dev
,
"snps,reset-active-low"
))
reset_flags
|=
GPIOD_ACTIVE_LOW
;
...
...
drivers/net/designware.h
View file @
b775bf54
...
...
@@ -7,7 +7,7 @@
#ifndef _DW_ETH_H
#define _DW_ETH_H
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
#include <asm-generic/gpio.h>
#endif
...
...
@@ -235,7 +235,7 @@ struct dw_eth_dev {
#ifndef CONFIG_DM_ETH
struct
eth_device
*
dev
;
#endif
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
struct
gpio_desc
reset_gpio
;
#endif
#ifdef CONFIG_CLK
...
...
drivers/net/fec_mxc.c
View file @
b775bf54
...
...
@@ -1300,7 +1300,7 @@ static int fec_phy_init(struct fec_priv *priv, struct udevice *dev)
return
0
;
}
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
/* FEC GPIO reset */
static
void
fec_gpio_reset
(
struct
fec_priv
*
priv
)
{
...
...
@@ -1352,7 +1352,7 @@ static int fecmxc_probe(struct udevice *dev)
}
#endif
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
fec_gpio_reset
(
priv
);
#endif
/* Reset chip. */
...
...
@@ -1458,7 +1458,7 @@ static int fecmxc_ofdata_to_platdata(struct udevice *dev)
device_get_supply_regulator
(
dev
,
"phy-supply"
,
&
priv
->
phy_supply
);
#endif
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
ret
=
gpio_request_by_name
(
dev
,
"phy-reset-gpios"
,
0
,
&
priv
->
phy_reset_gpio
,
GPIOD_IS_OUT
);
if
(
ret
<
0
)
...
...
drivers/net/fec_mxc.h
View file @
b775bf54
...
...
@@ -255,7 +255,7 @@ struct fec_priv {
#ifdef CONFIG_DM_REGULATOR
struct
udevice
*
phy_supply
;
#endif
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
struct
gpio_desc
phy_reset_gpio
;
uint32_t
reset_delay
;
uint32_t
reset_post_delay
;
...
...
drivers/net/mvneta.c
View file @
b775bf54
...
...
@@ -275,7 +275,7 @@ struct mvneta_port {
int
init
;
int
phyaddr
;
struct
phy_device
*
phydev
;
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
struct
gpio_desc
phy_reset_gpio
;
#endif
struct
mii_dev
*
bus
;
...
...
@@ -1753,7 +1753,7 @@ static int mvneta_probe(struct udevice *dev)
if
(
ret
)
return
ret
;
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
gpio_request_by_name
(
dev
,
"phy-reset-gpios"
,
0
,
&
pp
->
phy_reset_gpio
,
GPIOD_IS_OUT
);
...
...
drivers/net/mvpp2.c
View file @
b775bf54
...
...
@@ -976,7 +976,7 @@ struct mvpp2_port {
int
phy_node
;
int
phyaddr
;
struct
mii_dev
*
bus
;
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
struct
gpio_desc
phy_reset_gpio
;
struct
gpio_desc
phy_tx_disable_gpio
;
#endif
...
...
@@ -4753,7 +4753,7 @@ static int phy_info_parse(struct udevice *dev, struct mvpp2_port *port)
return
-
EINVAL
;
}
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
gpio_request_by_name
(
dev
,
"phy-reset-gpios"
,
0
,
&
port
->
phy_reset_gpio
,
GPIOD_IS_OUT
);
gpio_request_by_name
(
dev
,
"marvell,sfp-tx-disable-gpio"
,
0
,
...
...
@@ -4781,7 +4781,7 @@ static int phy_info_parse(struct udevice *dev, struct mvpp2_port *port)
return
0
;
}
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
/* Port GPIO initialization */
static
void
mvpp2_gpio_init
(
struct
mvpp2_port
*
port
)
{
...
...
@@ -4814,7 +4814,7 @@ static int mvpp2_port_probe(struct udevice *dev,
}
mvpp2_port_power_up
(
port
);
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
mvpp2_gpio_init
(
port
);
#endif
...
...
drivers/net/sun8i_emac.c
View file @
b775bf54
...
...
@@ -23,7 +23,7 @@
#include <net.h>
#include <reset.h>
#include <dt-bindings/pinctrl/sun4i-a10.h>
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
#include <asm-generic/gpio.h>
#endif
...
...
@@ -141,7 +141,7 @@ struct emac_eth_dev {
struct
clk
ephy_clk
;
struct
reset_ctl
tx_rst
;
struct
reset_ctl
ephy_rst
;
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
struct
gpio_desc
reset_gpio
;
#endif
};
...
...
@@ -695,7 +695,7 @@ err_tx_clk:
return
ret
;
}
#if
CONFIG_IS_ENABLED(
DM_GPIO)
#if
defined(CONFIG_
DM_GPIO)
static
int
sun8i_mdio_reset
(
struct
mii_dev
*
bus
)
{
struct
udevice
*
dev
=
bus
->
priv
;
...
...
@@ -742,7 +742,7 @@ static int sun8i_mdio_init(const char *name, struct udevice *priv)
bus
->
write
=
sun8i_mdio_write
;
snprintf
(
bus
->
name
,
sizeof
(
bus
->
name
),
name
);
bus
->
priv
=
(
void
*
)
priv
;
#if
CONFIG_IS_ENABLED(
DM_GPIO)
#if
defined(CONFIG_
DM_GPIO)
bus
->
reset
=
sun8i_mdio_reset
;
#endif
...
...
@@ -904,7 +904,7 @@ static int sun8i_emac_eth_ofdata_to_platdata(struct udevice *dev)
const
fdt32_t
*
reg
;
int
node
=
dev_of_offset
(
dev
);
int
offset
=
0
;
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
int
reset_flags
=
GPIOD_IS_OUT
;
#endif
int
ret
;
...
...
@@ -998,7 +998,7 @@ static int sun8i_emac_eth_ofdata_to_platdata(struct udevice *dev)
printf
(
"%s: Invalid RX delay value %d
\n
"
,
__func__
,
sun8i_pdata
->
rx_delay_ps
);
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
if
(
fdtdec_get_bool
(
gd
->
fdt_blob
,
dev_of_offset
(
dev
),
"snps,reset-active-low"
))
reset_flags
|=
GPIOD_ACTIVE_LOW
;
...
...
drivers/pci/pci-aardvark.c
View file @
b775bf54
...
...
@@ -610,7 +610,7 @@ static int pcie_advk_probe(struct udevice *dev)
{
struct
pcie_advk
*
pcie
=
dev_get_priv
(
dev
);
#if
CONFIG_IS_ENABLED(DM_GPIO)
#if
def CONFIG_DM_GPIO
struct
gpio_desc
reset_gpio
;
gpio_request_by_name
(
dev
,
"reset-gpio"
,
0
,
&
reset_gpio
,
...
...
@@ -636,7 +636,7 @@ static int pcie_advk_probe(struct udevice *dev)