summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/spl/spl_sata.c8
-rw-r--r--configs/j7200_evm_a72_defconfig1
-rw-r--r--configs/verdin-am62_a53_defconfig1
-rw-r--r--configs/verdin-am62p_a53_defconfig1
-rw-r--r--drivers/gpio/Kconfig6
-rw-r--r--drivers/gpio/Makefile1
-rw-r--r--drivers/gpio/ftgpio010.c110
-rw-r--r--drivers/net/ti/am65-cpsw-nuss.c35
-rw-r--r--drivers/timer/Kconfig2
-rw-r--r--dts/Kconfig1
-rw-r--r--include/linux/completion.h44
-rw-r--r--include/miiphy.h15
-rw-r--r--net/mdio-uclass.c18
13 files changed, 60 insertions, 183 deletions
diff --git a/common/spl/spl_sata.c b/common/spl/spl_sata.c
index 67fc620d9be..09f94e662fc 100644
--- a/common/spl/spl_sata.c
+++ b/common/spl/spl_sata.c
@@ -14,10 +14,12 @@
#include <errno.h>
#include <fat.h>
#include <image.h>
+#include <linux/compiler.h>
-static int spl_sata_load_image_raw(struct spl_image_info *spl_image,
- struct spl_boot_device *bootdev,
- struct blk_desc *stor_dev, unsigned long sector)
+static int __maybe_unused spl_sata_load_image_raw(struct spl_image_info *spl_image,
+ struct spl_boot_device *bootdev,
+ struct blk_desc *stor_dev,
+ unsigned long sector)
{
struct legacy_img_hdr *header;
unsigned long count;
diff --git a/configs/j7200_evm_a72_defconfig b/configs/j7200_evm_a72_defconfig
index c657b0166e0..51f0c4075c0 100644
--- a/configs/j7200_evm_a72_defconfig
+++ b/configs/j7200_evm_a72_defconfig
@@ -145,6 +145,7 @@ CONFIG_SPI_FLASH_MTD=y
CONFIG_MULTIPLEXER=y
CONFIG_SPL_MUX_MMIO=y
CONFIG_MUX_MMIO=y
+CONFIG_PHY_TI_DP83867=y
CONFIG_PHY_TI_DP83869=y
CONFIG_PHY_FIXED=y
CONFIG_TI_AM65_CPSW_NUSS=y
diff --git a/configs/verdin-am62_a53_defconfig b/configs/verdin-am62_a53_defconfig
index 2c0573cd54e..d97dec3a360 100644
--- a/configs/verdin-am62_a53_defconfig
+++ b/configs/verdin-am62_a53_defconfig
@@ -193,6 +193,7 @@ CONFIG_SPL_USB_GADGET=y
CONFIG_USB_GADGET_MANUFACTURER="Toradex"
CONFIG_USB_GADGET_VENDOR_NUM=0x1b67
CONFIG_USB_GADGET_PRODUCT_NUM=0x4000
+CONFIG_USB_GADGET_OS_DESCRIPTORS=y
CONFIG_SPL_DFU=y
CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
CONFIG_HEXDUMP=y
diff --git a/configs/verdin-am62p_a53_defconfig b/configs/verdin-am62p_a53_defconfig
index c46b883a9c6..6ea675fb83d 100644
--- a/configs/verdin-am62p_a53_defconfig
+++ b/configs/verdin-am62p_a53_defconfig
@@ -192,6 +192,7 @@ CONFIG_SPL_USB_GADGET=y
CONFIG_USB_GADGET_MANUFACTURER="Toradex"
CONFIG_USB_GADGET_VENDOR_NUM=0x1b67
CONFIG_USB_GADGET_PRODUCT_NUM=0x4000
+CONFIG_USB_GADGET_OS_DESCRIPTORS=y
CONFIG_SPL_DFU=y
CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
CONFIG_HEXDUMP=y
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index 58e464106a3..db077e472a8 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -695,12 +695,6 @@ config SLG7XL45106_I2C_GPO
8-bit gpo expander, all gpo lines are controlled by writing
value into data register.
-config FTGPIO010
- bool "Faraday Technology FTGPIO010 driver"
- depends on DM_GPIO
- help
- Support for GPIOs on Faraday Technology's FTGPIO010 controller.
-
config ADP5585_GPIO
bool "ADP5585 GPIO driver"
depends on DM_GPIO && DM_I2C
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index 83e10c79b91..73c94329e36 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -77,7 +77,6 @@ obj-$(CONFIG_SL28CPLD_GPIO) += sl28cpld-gpio.o
obj-$(CONFIG_ADP5588_GPIO) += adp5588_gpio.o
obj-$(CONFIG_ZYNQMP_GPIO_MODEPIN) += zynqmp_gpio_modepin.o
obj-$(CONFIG_SLG7XL45106_I2C_GPO) += gpio_slg7xl45106.o
-obj-$(CONFIG_FTGPIO010) += ftgpio010.o
obj-$(CONFIG_$(PHASE_)ADP5585_GPIO) += adp5585_gpio.o
obj-$(CONFIG_RZG2L_GPIO) += rzg2l-gpio.o
obj-$(CONFIG_MPFS_GPIO) += mpfs_gpio.o
diff --git a/drivers/gpio/ftgpio010.c b/drivers/gpio/ftgpio010.c
deleted file mode 100644
index 4cb550a540c..00000000000
--- a/drivers/gpio/ftgpio010.c
+++ /dev/null
@@ -1,110 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Faraday Technology's FTGPIO010 controller.
- */
-
-#include <dm.h>
-#include <asm/io.h>
-#include <asm/gpio.h>
-
-struct ftgpio010_regs {
- u32 out;
- u32 in;
- u32 direction; // 1 - output
- u32 reserved;
- u32 set;
- u32 clear;
-};
-
-struct ftgpio010_plat {
- struct ftgpio010_regs __iomem *regs;
-};
-
-static int ftgpio010_direction_input(struct udevice *dev, unsigned int pin)
-{
- struct ftgpio010_plat *plat = dev_get_plat(dev);
- struct ftgpio010_regs *const regs = plat->regs;
-
- clrbits_le32(&regs->direction, 1 << pin);
- return 0;
-}
-
-static int ftgpio010_direction_output(struct udevice *dev, unsigned int pin,
- int val)
-{
- struct ftgpio010_plat *plat = dev_get_plat(dev);
- struct ftgpio010_regs *const regs = plat->regs;
-
- /* change the data first, then the direction. to avoid glitch */
- out_le32(val ? &regs->set : &regs->clear, 1 << pin);
- setbits_le32(&regs->direction, 1 << pin);
-
- return 0;
-}
-
-static int ftgpio010_get_value(struct udevice *dev, unsigned int pin)
-{
- struct ftgpio010_plat *plat = dev_get_plat(dev);
- struct ftgpio010_regs *const regs = plat->regs;
-
- return in_le32(&regs->in) >> pin & 1;
-}
-
-static int ftgpio010_set_value(struct udevice *dev, unsigned int pin, int val)
-{
- struct ftgpio010_plat *plat = dev_get_plat(dev);
- struct ftgpio010_regs *const regs = plat->regs;
-
- out_le32(val ? &regs->set : &regs->clear, 1 << pin);
- return 0;
-}
-
-static int ftgpio010_get_function(struct udevice *dev, unsigned int pin)
-{
- struct ftgpio010_plat *plat = dev_get_plat(dev);
- struct ftgpio010_regs *const regs = plat->regs;
-
- if (in_le32(&regs->direction) >> pin & 1)
- return GPIOF_OUTPUT;
- return GPIOF_INPUT;
-}
-
-static int ftgpio010_probe(struct udevice *dev)
-{
- struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);
-
- uc_priv->gpio_count = ofnode_read_u32_default(dev_ofnode(dev),
- "nr-gpios", 32);
- return 0;
-}
-
-static int ftgpio010_of_to_plat(struct udevice *dev)
-{
- struct ftgpio010_plat *plat = dev_get_plat(dev);
-
- plat->regs = dev_read_addr_ptr(dev);
- return 0;
-}
-
-static const struct dm_gpio_ops ftgpio010_ops = {
- .direction_input = ftgpio010_direction_input,
- .direction_output = ftgpio010_direction_output,
- .get_value = ftgpio010_get_value,
- .set_value = ftgpio010_set_value,
- .get_function = ftgpio010_get_function,
-};
-
-static const struct udevice_id ftgpio010_ids[] = {
- { .compatible = "faraday,ftgpio010" },
- { }
-};
-
-U_BOOT_DRIVER(ftgpio010) = {
- .name = "ftgpio010",
- .id = UCLASS_GPIO,
- .of_match = ftgpio010_ids,
- .ops = &ftgpio010_ops,
- .of_to_plat = ftgpio010_of_to_plat,
- .plat_auto = sizeof(struct ftgpio010_plat),
- .probe = ftgpio010_probe,
-};
diff --git a/drivers/net/ti/am65-cpsw-nuss.c b/drivers/net/ti/am65-cpsw-nuss.c
index 2aa7e5e3a30..7a88f76fd09 100644
--- a/drivers/net/ti/am65-cpsw-nuss.c
+++ b/drivers/net/ti/am65-cpsw-nuss.c
@@ -234,14 +234,11 @@ out:
#define AM65_GMII_SEL_MODE_RGMII 2
#define AM65_GMII_SEL_MODE_SGMII 3
-#define AM65_GMII_SEL_RGMII_IDMODE BIT(4)
-
static int am65_cpsw_gmii_sel_k3(struct am65_cpsw_priv *priv,
phy_interface_t phy_mode)
{
struct udevice *dev = priv->dev;
u32 offset, reg, phandle;
- bool rgmii_id = false;
fdt_addr_t gmii_sel;
u32 mode = 0;
ofnode node;
@@ -278,12 +275,6 @@ static int am65_cpsw_gmii_sel_k3(struct am65_cpsw_priv *priv,
mode = AM65_GMII_SEL_MODE_RGMII;
break;
- case PHY_INTERFACE_MODE_RGMII_ID:
- case PHY_INTERFACE_MODE_RGMII_TXID:
- mode = AM65_GMII_SEL_MODE_RGMII;
- rgmii_id = true;
- break;
-
case PHY_INTERFACE_MODE_SGMII:
mode = AM65_GMII_SEL_MODE_SGMII;
break;
@@ -298,9 +289,6 @@ static int am65_cpsw_gmii_sel_k3(struct am65_cpsw_priv *priv,
break;
};
- if (rgmii_id)
- mode |= AM65_GMII_SEL_RGMII_IDMODE;
-
reg = mode;
dev_dbg(dev, "gmii_sel PHY mode: %u, new gmii_sel: %08x\n",
phy_mode, reg);
@@ -630,7 +618,7 @@ static int am65_cpsw_phy_init(struct udevice *dev)
u32 supported = PHY_GBIT_FEATURES;
int ret = 0;
- phydev = dm_eth_phy_connect(dev);
+ phydev = dm_eth_phy_connect_interface(dev, pdata->phy_interface);
if (!phydev) {
dev_err(dev, "phy_connect() failed\n");
return -ENODEV;
@@ -657,9 +645,28 @@ static int am65_cpsw_ofdata_parse_phy(struct udevice *dev)
dev_read_u32(dev, "reg", &priv->port_id);
pdata->phy_interface = dev_read_phy_mode(dev);
- if (pdata->phy_interface == PHY_INTERFACE_MODE_NA) {
+
+ /* CPSW controllers supported by this driver have a fixed internal TX
+ * delay in RGMII mode. Fix up PHY mode to account for this and warn
+ * about Device Trees that claim to have a TX delay on the PCB.
+ */
+ switch (pdata->phy_interface) {
+ case PHY_INTERFACE_MODE_RGMII_ID:
+ pdata->phy_interface = PHY_INTERFACE_MODE_RGMII_RXID;
+ break;
+ case PHY_INTERFACE_MODE_RGMII_TXID:
+ pdata->phy_interface = PHY_INTERFACE_MODE_RGMII;
+ break;
+ case PHY_INTERFACE_MODE_RGMII:
+ case PHY_INTERFACE_MODE_RGMII_RXID:
+ dev_warn(dev,
+ "RGMII mode without internal TX delay unsupported; please fix your Device Tree\n");
+ break;
+ case PHY_INTERFACE_MODE_NA:
dev_err(dev, "Invalid PHY mode, port %u\n", priv->port_id);
return -EINVAL;
+ default:
+ break;
}
dev_read_u32(dev, "max-speed", (u32 *)&pdata->max_speed);
diff --git a/drivers/timer/Kconfig b/drivers/timer/Kconfig
index 5cac1dcf2be..f9511503b02 100644
--- a/drivers/timer/Kconfig
+++ b/drivers/timer/Kconfig
@@ -312,7 +312,7 @@ config MTK_TIMER
config MCHP_PIT64B_TIMER
bool "Microchip 64-bit periodic interval timer support"
- depends on TIMER
+ depends on TIMER && ARCH_AT91
help
Select this to enable support for Microchip 64-bit periodic
interval timer.
diff --git a/dts/Kconfig b/dts/Kconfig
index c8bc5232f9b..4e2622d48d0 100644
--- a/dts/Kconfig
+++ b/dts/Kconfig
@@ -215,6 +215,7 @@ config OF_OMIT_DTB
config DEFAULT_DEVICE_TREE
string "Default Device Tree for DT control"
depends on OF_CONTROL
+ default "sandbox" if SANDBOX
help
This option specifies the default Device Tree used for DT control.
It can be overridden from the command line:
diff --git a/include/linux/completion.h b/include/linux/completion.h
index 9835826d285..d99ac450e8c 100644
--- a/include/linux/completion.h
+++ b/include/linux/completion.h
@@ -129,42 +129,14 @@ extern void complete_all(struct completion *);
#define wait_for_completion(x) do {} while (0)
#define wait_for_completion_io(x) do {} while (0)
-inline int wait_for_completion_interruptible(struct completion *x)
-{
- return 1;
-}
-inline int wait_for_completion_killable(struct completion *x)
-{
- return 1;
-}
-inline unsigned long wait_for_completion_timeout(struct completion *x,
- unsigned long timeout)
-{
- return 1;
-}
-inline unsigned long wait_for_completion_io_timeout(struct completion *x,
- unsigned long timeout)
-{
- return 1;
-}
-inline long wait_for_completion_interruptible_timeout(struct completion *x,
- unsigned long timeout)
-{
- return 1;
-}
-inline long wait_for_completion_killable_timeout(struct completion *x,
- unsigned long timeout)
-{
- return 1;
-}
-inline bool try_wait_for_completion(struct completion *x)
-{
- return 1;
-}
-inline bool completion_done(struct completion *x)
-{
- return 1;
-}
+#define wait_for_completion_interruptible(x) 1
+#define wait_for_completion_killable(x) 1
+#define wait_for_completion_timeout(x, timeout) 1
+#define wait_for_completion_io_timeout(x, timeout) 1
+#define wait_for_completion_interruptible_timeout(x, timeout) 1
+#define wait_for_completion_killable_timeout(x, timeout) 1
+#define try_wait_for_completion(x) 1
+#define completion_done(x) 1
#define complete(x) do {} while (0)
#define complete_all(x) do {} while (0)
diff --git a/include/miiphy.h b/include/miiphy.h
index 00d0b9b6a43..96afe5f4030 100644
--- a/include/miiphy.h
+++ b/include/miiphy.h
@@ -193,6 +193,21 @@ struct phy_device *dm_mdio_phy_connect(struct udevice *mdiodev, int phyaddr,
phy_interface_t interface);
/**
+ * dm_eth_phy_connect_interface - Connect an Eth device to a PHY based on device
+ * tree with custom PHY interface
+ *
+ * Picks up the DT phy-handle and from ethernet device node and connects the
+ * ethernet device to the linked PHY, while allowing the caller to specify
+ * the phy-mode to use.
+ *
+ * @ethdev: ethernet device
+ * @interface: MAC-PHY protocol
+ *
+ * Return: pointer to phy_device, or 0 on error
+ */
+struct phy_device *dm_eth_phy_connect_interface(struct udevice *ethdev,
+ phy_interface_t interface);
+/**
* dm_eth_phy_connect - Connect an Eth device to a PHY based on device tree
*
* Picks up the DT phy-handle and phy-mode from ethernet device node and
diff --git a/net/mdio-uclass.c b/net/mdio-uclass.c
index 4f052ae432c..64af689d2df 100644
--- a/net/mdio-uclass.c
+++ b/net/mdio-uclass.c
@@ -242,8 +242,8 @@ struct phy_device *dm_mdio_phy_connect(struct udevice *mdiodev, int phyaddr,
return phy_connect(pdata->mii_bus, phyaddr, ethdev, interface);
}
-static struct phy_device *dm_eth_connect_phy_handle(struct udevice *ethdev,
- phy_interface_t interface)
+struct phy_device *dm_eth_phy_connect_interface(struct udevice *ethdev,
+ phy_interface_t interface)
{
u32 phy_addr;
struct udevice *mdiodev;
@@ -282,8 +282,10 @@ static struct phy_device *dm_eth_connect_phy_handle(struct udevice *ethdev,
phy = dm_mdio_phy_connect(mdiodev, phy_addr, ethdev, interface);
out:
- if (phy)
+ if (phy) {
phy->node = phynode;
+ phy->interface = interface;
+ }
return phy;
}
@@ -292,7 +294,6 @@ out:
struct phy_device *dm_eth_phy_connect(struct udevice *ethdev)
{
phy_interface_t interface;
- struct phy_device *phy;
if (!dev_has_ofnode(ethdev)) {
debug("%s: supplied eth dev has no DT node!\n", ethdev->name);
@@ -303,14 +304,7 @@ struct phy_device *dm_eth_phy_connect(struct udevice *ethdev)
if (interface == PHY_INTERFACE_MODE_NA)
dev_dbg(ethdev, "can't find interface mode, default to NA\n");
- phy = dm_eth_connect_phy_handle(ethdev, interface);
-
- if (!phy)
- return NULL;
-
- phy->interface = interface;
-
- return phy;
+ return dm_eth_phy_connect_interface(ethdev, interface);
}
UCLASS_DRIVER(mdio) = {