summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2024-03-04 10:13:01 -0500
committerTom Rini <[email protected]>2024-03-04 10:25:47 -0500
commitbd465ada0e1172910f64feac6035f2344449c381 (patch)
treee749428436685ab25dcfe109309adee6f45cdf39 /drivers
parentbdbbf1d7b55434973402c390a822490ce6e14994 (diff)
parent68c4d3098b9cf59a20c470df385eb5422fe32bbe (diff)
Merge branch '2024-03-02-assorted-updates' into next
- Assorted MediaTek, ASPEED, xenguest, s5p4418 and qemu-arm fixes - Assorted test fixes/updates/additions. - A few bootstd/related fixes. - Remove common.h from some files - Drop reiserfs - A few other assorted fixes throughout the tree.
Diffstat (limited to 'drivers')
-rw-r--r--drivers/core/fdtaddr.c2
-rw-r--r--drivers/net/macb.c184
-rw-r--r--drivers/net/mtk_eth.c57
-rw-r--r--drivers/net/mtk_eth.h9
-rw-r--r--drivers/pci/pcie_ecam_generic.c11
-rw-r--r--drivers/pinctrl/aspeed/pinctrl_ast2600.c30
-rw-r--r--drivers/pinctrl/pinctrl-uclass.c18
-rw-r--r--drivers/rng/arm_rndr.c3
-rw-r--r--drivers/rng/iproc_rng200.c3
-rw-r--r--drivers/rng/meson-rng.c1
-rw-r--r--drivers/rng/msm_rng.c5
-rw-r--r--drivers/rng/npcm_rng.c1
-rw-r--r--drivers/rng/optee_rng.c2
-rw-r--r--drivers/rng/rng-uclass.c1
-rw-r--r--drivers/rng/rockchip_rng.c6
-rw-r--r--drivers/rng/sandbox_rng.c3
-rw-r--r--drivers/rng/smccc_trng.c1
-rw-r--r--drivers/rng/stm32_rng.c4
18 files changed, 232 insertions, 109 deletions
diff --git a/drivers/core/fdtaddr.c b/drivers/core/fdtaddr.c
index 8e774d49ce6..5f27d251148 100644
--- a/drivers/core/fdtaddr.c
+++ b/drivers/core/fdtaddr.c
@@ -23,7 +23,7 @@ fdt_addr_t devfdt_get_addr_index(const struct udevice *dev, int index)
{
#if CONFIG_IS_ENABLED(OF_REAL)
int offset = dev_of_offset(dev);
- int parent = dev_of_offset(dev->parent);
+ int parent = fdt_parent_offset(gd->fdt_blob, offset);
fdt_addr_t addr;
if (CONFIG_IS_ENABLED(OF_TRANSLATE)) {
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index bfc48dac079..bca014c3cbb 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -128,6 +128,8 @@ struct macb_device {
unsigned long dummy_desc_dma;
const struct device *dev;
+ unsigned int duplex;
+ unsigned int speed;
unsigned short phy_addr;
struct mii_dev *bus;
#ifdef CONFIG_PHYLIB
@@ -178,6 +180,12 @@ static int gem_is_gigabit_capable(struct macb_device *macb)
return macb_is_gem(macb) && !cpu_is_sama5d2() && !cpu_is_sama5d4();
}
+/* Is the port a fixed link */
+static int macb_port_is_fixed_link(struct macb_device *macb)
+{
+ return macb->phy_addr > PHY_MAX_ADDR;
+}
+
static void macb_mdio_write(struct macb_device *macb, u8 phy_adr, u8 reg,
u16 value)
{
@@ -666,97 +674,109 @@ static int macb_phy_init(struct udevice *dev, const char *name)
int i;
arch_get_mdio_control(name);
- /* Auto-detect phy_addr */
- ret = macb_phy_find(macb, name);
- if (ret)
- return ret;
+ /* If port is not fixed -> setup PHY */
+ if (!macb_port_is_fixed_link(macb)) {
+ /* Auto-detect phy_addr */
+ ret = macb_phy_find(macb, name);
+ if (ret)
+ return ret;
- /* Check if the PHY is up to snuff... */
- phy_id = macb_mdio_read(macb, macb->phy_addr, MII_PHYSID1);
- if (phy_id == 0xffff) {
- printf("%s: No PHY present\n", name);
- return -ENODEV;
- }
+ /* Check if the PHY is up to snuff... */
+ phy_id = macb_mdio_read(macb, macb->phy_addr, MII_PHYSID1);
+ if (phy_id == 0xffff) {
+ printf("%s: No PHY present\n", name);
+ return -ENODEV;
+ }
#ifdef CONFIG_PHYLIB
- macb->phydev = phy_connect(macb->bus, macb->phy_addr, dev,
- macb->phy_interface);
- if (!macb->phydev) {
- printf("phy_connect failed\n");
- return -ENODEV;
- }
+ macb->phydev = phy_connect(macb->bus, macb->phy_addr, dev,
+ macb->phy_interface);
+ if (!macb->phydev) {
+ printf("phy_connect failed\n");
+ return -ENODEV;
+ }
- phy_config(macb->phydev);
+ phy_config(macb->phydev);
#endif
- status = macb_mdio_read(macb, macb->phy_addr, MII_BMSR);
- if (!(status & BMSR_LSTATUS)) {
- /* Try to re-negotiate if we don't have link already. */
- macb_phy_reset(macb, name);
+ status = macb_mdio_read(macb, macb->phy_addr, MII_BMSR);
+ if (!(status & BMSR_LSTATUS)) {
+ /* Try to re-negotiate if we don't have link already. */
+ macb_phy_reset(macb, name);
- for (i = 0; i < MACB_AUTONEG_TIMEOUT / 100; i++) {
- status = macb_mdio_read(macb, macb->phy_addr, MII_BMSR);
- if (status & BMSR_LSTATUS) {
- /*
- * Delay a bit after the link is established,
- * so that the next xfer does not fail
- */
- mdelay(10);
- break;
+ for (i = 0; i < MACB_AUTONEG_TIMEOUT / 100; i++) {
+ status = macb_mdio_read(macb, macb->phy_addr, MII_BMSR);
+ if (status & BMSR_LSTATUS) {
+ /*
+ * Delay a bit after the link is established,
+ * so that the next xfer does not fail
+ */
+ mdelay(10);
+ break;
+ }
+ udelay(100);
}
- udelay(100);
}
- }
- if (!(status & BMSR_LSTATUS)) {
- printf("%s: link down (status: 0x%04x)\n",
- name, status);
- return -ENETDOWN;
- }
+ if (!(status & BMSR_LSTATUS)) {
+ printf("%s: link down (status: 0x%04x)\n",
+ name, status);
+ return -ENETDOWN;
+ }
- /* First check for GMAC and that it is GiB capable */
- if (gem_is_gigabit_capable(macb)) {
- lpa = macb_mdio_read(macb, macb->phy_addr, MII_STAT1000);
+ /* First check for GMAC and that it is GiB capable */
+ if (gem_is_gigabit_capable(macb)) {
+ lpa = macb_mdio_read(macb, macb->phy_addr, MII_STAT1000);
- if (lpa & (LPA_1000FULL | LPA_1000HALF | LPA_1000XFULL |
- LPA_1000XHALF)) {
- duplex = ((lpa & (LPA_1000FULL | LPA_1000XFULL)) ?
- 1 : 0);
+ if (lpa & (LPA_1000FULL | LPA_1000HALF | LPA_1000XFULL |
+ LPA_1000XHALF)) {
+ duplex = ((lpa & (LPA_1000FULL | LPA_1000XFULL)) ?
+ 1 : 0);
- printf("%s: link up, 1000Mbps %s-duplex (lpa: 0x%04x)\n",
- name,
- duplex ? "full" : "half",
- lpa);
+ printf("%s: link up, 1000Mbps %s-duplex (lpa: 0x%04x)\n",
+ name,
+ duplex ? "full" : "half",
+ lpa);
- ncfgr = macb_readl(macb, NCFGR);
- ncfgr &= ~(MACB_BIT(SPD) | MACB_BIT(FD));
- ncfgr |= GEM_BIT(GBE);
+ ncfgr = macb_readl(macb, NCFGR);
+ ncfgr &= ~(MACB_BIT(SPD) | MACB_BIT(FD));
+ ncfgr |= GEM_BIT(GBE);
- if (duplex)
- ncfgr |= MACB_BIT(FD);
+ if (duplex)
+ ncfgr |= MACB_BIT(FD);
- macb_writel(macb, NCFGR, ncfgr);
+ macb_writel(macb, NCFGR, ncfgr);
- ret = macb_linkspd_cb(dev, _1000BASET);
- if (ret)
- return ret;
+ ret = macb_linkspd_cb(dev, _1000BASET);
+ if (ret)
+ return ret;
- return 0;
+ return 0;
+ }
}
- }
- /* fall back for EMAC checking */
- adv = macb_mdio_read(macb, macb->phy_addr, MII_ADVERTISE);
- lpa = macb_mdio_read(macb, macb->phy_addr, MII_LPA);
- media = mii_nway_result(lpa & adv);
- speed = (media & (ADVERTISE_100FULL | ADVERTISE_100HALF)
- ? 1 : 0);
- duplex = (media & ADVERTISE_FULL) ? 1 : 0;
- printf("%s: link up, %sMbps %s-duplex (lpa: 0x%04x)\n",
- name,
- speed ? "100" : "10",
- duplex ? "full" : "half",
- lpa);
+ /* fall back for EMAC checking */
+ adv = macb_mdio_read(macb, macb->phy_addr, MII_ADVERTISE);
+ lpa = macb_mdio_read(macb, macb->phy_addr, MII_LPA);
+ media = mii_nway_result(lpa & adv);
+ speed = (media & (ADVERTISE_100FULL | ADVERTISE_100HALF)
+ ? 1 : 0);
+ duplex = (media & ADVERTISE_FULL) ? 1 : 0;
+ printf("%s: link up, %sMbps %s-duplex (lpa: 0x%04x)\n",
+ name,
+ speed ? "100" : "10",
+ duplex ? "full" : "half",
+ lpa);
+ } else {
+ /* if macb port is a fixed link */
+ /* TODO : manage gigabit capable processors */
+ speed = macb->speed;
+ duplex = macb->duplex;
+ printf("%s: link up, %sMbps %s-duplex\n",
+ name,
+ speed ? "100" : "10",
+ duplex ? "full" : "half");
+ }
ncfgr = macb_readl(macb, NCFGR);
ncfgr &= ~(MACB_BIT(SPD) | MACB_BIT(FD) | GEM_BIT(GBE));
@@ -1276,6 +1296,28 @@ int __weak macb_late_eth_of_to_plat(struct udevice *dev)
static int macb_eth_of_to_plat(struct udevice *dev)
{
struct eth_pdata *pdata = dev_get_plat(dev);
+ struct macb_device *macb = dev_get_priv(dev);
+ void *blob = (void *)gd->fdt_blob;
+ int node = dev_of_offset(dev);
+ int fl_node, speed_fdt;
+
+ /* fetch 'fixed-link' property */
+ fl_node = fdt_subnode_offset(blob, node, "fixed-link");
+ if (fl_node >= 0) {
+ /* set phy_addr to invalid value for fixed link */
+ macb->phy_addr = PHY_MAX_ADDR + 1;
+ macb->duplex = fdtdec_get_bool(blob, fl_node, "full-duplex");
+ speed_fdt = fdtdec_get_int(blob, fl_node, "speed", 0);
+ if (speed_fdt == 100) {
+ macb->speed = 1;
+ } else if (speed_fdt == 10) {
+ macb->speed = 0;
+ } else {
+ printf("%s: The given speed %d of ethernet in the DT is not supported\n",
+ __func__, speed_fdt);
+ return -EINVAL;
+ }
+ }
pdata->iobase = (uintptr_t)dev_remap_addr(dev);
if (!pdata->iobase)
diff --git a/drivers/net/mtk_eth.c b/drivers/net/mtk_eth.c
index 3cfce058451..75e7bcf83b7 100644
--- a/drivers/net/mtk_eth.c
+++ b/drivers/net/mtk_eth.c
@@ -137,6 +137,7 @@ struct mtk_eth_priv {
int force_mode;
int speed;
int duplex;
+ int mdc;
bool pn_swap;
struct phy_device *phydev;
@@ -1245,7 +1246,8 @@ static int mtk_phy_start(struct mtk_eth_priv *priv)
}
if (!priv->force_mode) {
- if (priv->phy_interface == PHY_INTERFACE_MODE_USXGMII)
+ if (priv->phy_interface == PHY_INTERFACE_MODE_USXGMII ||
+ priv->phy_interface == PHY_INTERFACE_MODE_XGMII)
mtk_xphy_link_adjust(priv);
else
mtk_phy_link_adjust(priv);
@@ -1515,7 +1517,7 @@ static void mtk_mac_init(struct mtk_eth_priv *priv)
static void mtk_xmac_init(struct mtk_eth_priv *priv)
{
- u32 sts;
+ u32 force_link = 0;
switch (priv->phy_interface) {
case PHY_INTERFACE_MODE_USXGMII:
@@ -1530,15 +1532,19 @@ static void mtk_xmac_init(struct mtk_eth_priv *priv)
SYSCFG0_GE_MODE_M << SYSCFG0_GE_MODE_S(priv->gmac_id),
0);
- if (priv->gmac_id == 1) {
+ if (priv->phy_interface == PHY_INTERFACE_MODE_USXGMII &&
+ priv->gmac_id == 1) {
mtk_infra_rmw(priv, TOPMISC_NETSYS_PCS_MUX,
NETSYS_PCS_MUX_MASK, MUX_G2_USXGMII_SEL);
- } else if (priv->gmac_id == 2) {
- sts = mtk_gmac_read(priv, XGMAC_STS(priv->gmac_id));
- sts |= XGMAC_FORCE_LINK;
- mtk_gmac_write(priv, XGMAC_STS(priv->gmac_id), sts);
}
+ if (priv->phy_interface == PHY_INTERFACE_MODE_XGMII ||
+ priv->gmac_id == 2)
+ force_link = XGMAC_FORCE_LINK(priv->gmac_id);
+
+ mtk_gmac_rmw(priv, XGMAC_STS(priv->gmac_id),
+ XGMAC_FORCE_LINK(priv->gmac_id), force_link);
+
/* Force GMAC link down */
mtk_gmac_write(priv, GMAC_PORT_MCR(priv->gmac_id), FORCE_MODE);
}
@@ -1607,6 +1613,26 @@ static void mtk_eth_fifo_init(struct mtk_eth_priv *priv)
mtk_pdma_write(priv, PDMA_RST_IDX_REG, RST_DTX_IDX0 | RST_DRX_IDX0);
}
+static void mtk_eth_mdc_init(struct mtk_eth_priv *priv)
+{
+ u32 divider;
+
+ if (priv->mdc == 0)
+ return;
+
+ divider = min_t(u32, DIV_ROUND_UP(MDC_MAX_FREQ, priv->mdc), MDC_MAX_DIVIDER);
+
+ /* Configure MDC turbo mode */
+ if (MTK_HAS_CAPS(priv->soc->caps, MTK_NETSYS_V3))
+ mtk_gmac_rmw(priv, GMAC_MAC_MISC_REG, 0, MISC_MDC_TURBO);
+ else
+ mtk_gmac_rmw(priv, GMAC_PPSC_REG, 0, MISC_MDC_TURBO);
+
+ /* Configure MDC divider */
+ mtk_gmac_rmw(priv, GMAC_PPSC_REG, PHY_MDC_CFG,
+ FIELD_PREP(PHY_MDC_CFG, divider));
+}
+
static int mtk_eth_start(struct udevice *dev)
{
struct mtk_eth_priv *priv = dev_get_priv(dev);
@@ -1803,8 +1829,12 @@ static int mtk_eth_probe(struct udevice *dev)
noncached_alloc(priv->soc->rxd_size * NUM_RX_DESC,
ARCH_DMA_MINALIGN);
+ /* Set MDC divider */
+ mtk_eth_mdc_init(priv);
+
/* Set MAC mode */
- if (priv->phy_interface == PHY_INTERFACE_MODE_USXGMII)
+ if (priv->phy_interface == PHY_INTERFACE_MODE_USXGMII ||
+ priv->phy_interface == PHY_INTERFACE_MODE_XGMII)
mtk_xmac_init(priv);
else
mtk_mac_init(priv);
@@ -1881,6 +1911,17 @@ static int mtk_eth_of_to_plat(struct udevice *dev)
priv->gmac_id = dev_read_u32_default(dev, "mediatek,gmac-id", 0);
+ priv->mdc = 0;
+ subnode = ofnode_find_subnode(dev_ofnode(dev), "mdio");
+ if (ofnode_valid(subnode)) {
+ priv->mdc = ofnode_read_u32_default(subnode, "clock-frequency", 2500000);
+ if (priv->mdc > MDC_MAX_FREQ ||
+ priv->mdc < MDC_MAX_FREQ / MDC_MAX_DIVIDER) {
+ printf("error: MDIO clock frequency out of range\n");
+ return -EINVAL;
+ }
+ }
+
/* Interface mode is required */
pdata->phy_interface = dev_read_phy_mode(dev);
priv->phy_interface = pdata->phy_interface;
diff --git a/drivers/net/mtk_eth.h b/drivers/net/mtk_eth.h
index 491cac56a81..fd31c782c7f 100644
--- a/drivers/net/mtk_eth.h
+++ b/drivers/net/mtk_eth.h
@@ -180,6 +180,12 @@ enum mkt_eth_capabilities {
/* GMAC Registers */
+#define GMAC_PPSC_REG 0x0000
+#define PHY_MDC_CFG GENMASK(29, 24)
+#define MDC_TURBO BIT(20)
+#define MDC_MAX_FREQ 25000000
+#define MDC_MAX_DIVIDER 63
+
#define GMAC_PIAC_REG 0x0004
#define PHY_ACS_ST BIT(31)
#define MDIO_REG_ADDR_S 25
@@ -197,6 +203,7 @@ enum mkt_eth_capabilities {
#define P1_XGMAC_FORCE_LINK BIT(15)
#define GMAC_MAC_MISC_REG 0x0010
+#define MISC_MDC_TURBO BIT(4)
#define GMAC_GSW_CFG_REG 0x0080
#define GSWTX_IPG_M 0xF0000
@@ -261,7 +268,7 @@ enum mkt_eth_capabilities {
/* XGMAC Status Registers */
#define XGMAC_STS(x) (((x) == 2) ? 0x001C : 0x000C)
-#define XGMAC_FORCE_LINK BIT(15)
+#define XGMAC_FORCE_LINK(x) (((x) == 1) ? BIT(31) : BIT(15))
/* XGMAC Registers */
#define XGMAC_PORT_MCR(x) (0x2000 + (((x) - 1) * 0x1000))
diff --git a/drivers/pci/pcie_ecam_generic.c b/drivers/pci/pcie_ecam_generic.c
index 2e089b0e033..f5bc6e3d92d 100644
--- a/drivers/pci/pcie_ecam_generic.c
+++ b/drivers/pci/pcie_ecam_generic.c
@@ -10,7 +10,7 @@
#include <common.h>
#include <dm.h>
#include <pci.h>
-#include <asm/global_data.h>
+#include <linux/ioport.h>
#include <linux/printk.h>
#include <asm/io.h>
@@ -133,18 +133,17 @@ static int pci_generic_ecam_write_config(struct udevice *bus, pci_dev_t bdf,
static int pci_generic_ecam_of_to_plat(struct udevice *dev)
{
struct generic_ecam_pcie *pcie = dev_get_priv(dev);
- struct fdt_resource reg_res;
- DECLARE_GLOBAL_DATA_PTR;
+ ofnode node = dev_ofnode(dev);
+ struct resource reg_res;
int err;
- err = fdt_get_resource(gd->fdt_blob, dev_of_offset(dev), "reg",
- 0, &reg_res);
+ err = ofnode_read_resource(node, 0, &reg_res);
if (err < 0) {
pr_err("\"reg\" resource not found\n");
return err;
}
- pcie->size = fdt_resource_size(&reg_res);
+ pcie->size = resource_size(&reg_res);
pcie->cfg_base = map_physmem(reg_res.start, pcie->size, MAP_NOCACHE);
return 0;
diff --git a/drivers/pinctrl/aspeed/pinctrl_ast2600.c b/drivers/pinctrl/aspeed/pinctrl_ast2600.c
index 97e8b4ec9b4..8a4f9705ca9 100644
--- a/drivers/pinctrl/aspeed/pinctrl_ast2600.c
+++ b/drivers/pinctrl/aspeed/pinctrl_ast2600.c
@@ -267,6 +267,14 @@ static struct aspeed_sig_desc fmcquad_link[] = {
{ 0x438, GENMASK(5, 4), 0 },
};
+static struct aspeed_sig_desc siopbi_link[] = {
+ { 0x418, BIT(6), 0 },
+};
+
+static struct aspeed_sig_desc siopbo_link[] = {
+ { 0x418, BIT(5), 0 },
+};
+
static struct aspeed_sig_desc spi1_link[] = {
{ 0x438, GENMASK(13, 11), 0 },
};
@@ -303,6 +311,22 @@ static struct aspeed_sig_desc spi2quad_link[] = {
{ 0x434, GENMASK(31, 30), 0 },
};
+static struct aspeed_sig_desc thru0_link[] = {
+ { 0x4bc, GENMASK(25, 24), 0 },
+};
+
+static struct aspeed_sig_desc thru1_link[] = {
+ { 0x4bc, GENMASK(27, 26), 0 },
+};
+
+static struct aspeed_sig_desc thru2_link[] = {
+ { 0x4bc, GENMASK(29, 28), 0 },
+};
+
+static struct aspeed_sig_desc thru3_link[] = {
+ { 0x4bc, GENMASK(31, 30), 0 },
+};
+
static struct aspeed_sig_desc fsi1[] = {
{ 0xd48, GENMASK(21, 20), 0 },
};
@@ -458,6 +482,8 @@ static const struct aspeed_group_config ast2600_groups[] = {
{ "EMMC", ARRAY_SIZE(emmc_link), emmc_link },
{ "EMMCG8", ARRAY_SIZE(emmcg8_link), emmcg8_link },
{ "FMCQUAD", ARRAY_SIZE(fmcquad_link), fmcquad_link },
+ { "SIOPBI", ARRAY_SIZE(siopbi_link), siopbi_link },
+ { "SIOPBO", ARRAY_SIZE(siopbo_link), siopbo_link },
{ "SPI1", ARRAY_SIZE(spi1_link), spi1_link },
{ "SPI1ABR", ARRAY_SIZE(spi1abr_link), spi1abr_link },
{ "SPI1CS1", ARRAY_SIZE(spi1cs1_link), spi1cs1_link },
@@ -467,6 +493,10 @@ static const struct aspeed_group_config ast2600_groups[] = {
{ "SPI2CS1", ARRAY_SIZE(spi2cs1_link), spi2cs1_link },
{ "SPI2CS2", ARRAY_SIZE(spi2cs2_link), spi2cs2_link },
{ "SPI2QUAD", ARRAY_SIZE(spi2quad_link), spi2quad_link },
+ { "THRU0", ARRAY_SIZE(thru0_link), thru0_link },
+ { "THRU1", ARRAY_SIZE(thru1_link), thru1_link },
+ { "THRU2", ARRAY_SIZE(thru2_link), thru2_link },
+ { "THRU3", ARRAY_SIZE(thru3_link), thru3_link },
{ "I2C1", ARRAY_SIZE(i2c1_link), i2c1_link },
{ "I2C2", ARRAY_SIZE(i2c2_link), i2c2_link },
{ "I2C3", ARRAY_SIZE(i2c3_link), i2c3_link },
diff --git a/drivers/pinctrl/pinctrl-uclass.c b/drivers/pinctrl/pinctrl-uclass.c
index 73dd7b1038b..fe2ba5021a7 100644
--- a/drivers/pinctrl/pinctrl-uclass.c
+++ b/drivers/pinctrl/pinctrl-uclass.c
@@ -100,6 +100,22 @@ static int pinctrl_select_state_full(struct udevice *dev, const char *statename)
return 0;
}
+static bool ofnode_pre_reloc_recursive(ofnode parent)
+{
+ ofnode child;
+
+ if (ofnode_pre_reloc(parent))
+ return true;
+
+ if (CONFIG_IS_ENABLED(PINCONF_RECURSIVE)) {
+ ofnode_for_each_subnode(child, parent)
+ if (ofnode_pre_reloc_recursive(child))
+ return true;
+ }
+
+ return false;
+}
+
/**
* pinconfig_post_bind() - post binding for PINCONFIG uclass
* Recursively bind its children as pinconfig devices.
@@ -119,7 +135,7 @@ static int pinconfig_post_bind(struct udevice *dev)
dev_for_each_subnode(node, dev) {
if (pre_reloc_only &&
- !ofnode_pre_reloc(node))
+ !ofnode_pre_reloc_recursive(node))
continue;
/*
* If this node has "compatible" property, this is not
diff --git a/drivers/rng/arm_rndr.c b/drivers/rng/arm_rndr.c
index 4512330e68d..bf54aec4f1f 100644
--- a/drivers/rng/arm_rndr.c
+++ b/drivers/rng/arm_rndr.c
@@ -9,11 +9,10 @@
#define LOG_CATEGORY UCLASS_RNG
-#include <common.h>
#include <dm.h>
-#include <linux/kernel.h>
#include <rng.h>
#include <asm/system.h>
+#include <linux/kernel.h>
#define DRIVER_NAME "arm-rndr"
diff --git a/drivers/rng/iproc_rng200.c b/drivers/rng/iproc_rng200.c
index 85ac15bf9ca..4c49aa9e444 100644
--- a/drivers/rng/iproc_rng200.c
+++ b/drivers/rng/iproc_rng200.c
@@ -5,11 +5,10 @@
* Driver for Raspberry Pi hardware random number generator
*/
-#include <common.h>
#include <dm.h>
-#include <linux/delay.h>
#include <rng.h>
#include <asm/io.h>
+#include <linux/delay.h>
#define usleep_range(a, b) udelay((b))
diff --git a/drivers/rng/meson-rng.c b/drivers/rng/meson-rng.c
index fd2988e91b5..49037d11656 100644
--- a/drivers/rng/meson-rng.c
+++ b/drivers/rng/meson-rng.c
@@ -5,7 +5,6 @@
* Driver for Amlogic hardware random number generator
*/
-#include <common.h>
#include <clk.h>
#include <dm.h>
#include <rng.h>
diff --git a/drivers/rng/msm_rng.c b/drivers/rng/msm_rng.c
index 29e7354ece5..658c153d3ed 100644
--- a/drivers/rng/msm_rng.c
+++ b/drivers/rng/msm_rng.c
@@ -9,12 +9,11 @@
* Based on Linux driver
*/
-#include <asm/io.h>
#include <clk.h>
-#include <common.h>
#include <dm.h>
-#include <linux/bitops.h>
#include <rng.h>
+#include <asm/io.h>
+#include <linux/bitops.h>
/* Device specific register offsets */
#define PRNG_DATA_OUT 0x0000
diff --git a/drivers/rng/npcm_rng.c b/drivers/rng/npcm_rng.c
index 70c1c032b6d..3922acad5bb 100644
--- a/drivers/rng/npcm_rng.c
+++ b/drivers/rng/npcm_rng.c
@@ -3,7 +3,6 @@
* Copyright (c) 2022 Nuvoton Technology Corp.
*/
-#include <common.h>
#include <dm.h>
#include <malloc.h>
#include <rng.h>
diff --git a/drivers/rng/optee_rng.c b/drivers/rng/optee_rng.c
index 410dfc053f1..f692681022a 100644
--- a/drivers/rng/optee_rng.c
+++ b/drivers/rng/optee_rng.c
@@ -4,8 +4,6 @@
*/
#define LOG_CATEGORY UCLASS_RNG
-#include <common.h>
-
#include <rng.h>
#include <tee.h>
#include <dm/device.h>
diff --git a/drivers/rng/rng-uclass.c b/drivers/rng/rng-uclass.c
index 53108e1b319..06ddfa14ac8 100644
--- a/drivers/rng/rng-uclass.c
+++ b/drivers/rng/rng-uclass.c
@@ -5,7 +5,6 @@
#define LOG_CATEGORY UCLASS_RNG
-#include <common.h>
#include <dm.h>
#include <rng.h>
diff --git a/drivers/rng/rockchip_rng.c b/drivers/rng/rockchip_rng.c
index 705b424cf3d..ce5cbee30ab 100644
--- a/drivers/rng/rockchip_rng.c
+++ b/drivers/rng/rockchip_rng.c
@@ -2,14 +2,14 @@
/*
* Copyright (c) 2020 Fuzhou Rockchip Electronics Co., Ltd
*/
+
+#include <dm.h>
+#include <rng.h>
#include <asm/arch-rockchip/hardware.h>
#include <asm/io.h>
-#include <common.h>
-#include <dm.h>
#include <linux/bitops.h>
#include <linux/iopoll.h>
#include <linux/string.h>
-#include <rng.h>
#define RK_HW_RNG_MAX 32
diff --git a/drivers/rng/sandbox_rng.c b/drivers/rng/sandbox_rng.c
index cc5e1f6e25b..071a3228e8a 100644
--- a/drivers/rng/sandbox_rng.c
+++ b/drivers/rng/sandbox_rng.c
@@ -3,11 +3,10 @@
* Copyright (c) 2019, Linaro Limited
*/
-#include <common.h>
#include <dm.h>
#include <rand.h>
#include <rng.h>
-
+#include <time.h>
#include <linux/string.h>
static int sandbox_rng_read(struct udevice *dev, void *data, size_t len)
diff --git a/drivers/rng/smccc_trng.c b/drivers/rng/smccc_trng.c
index 3a4bb339415..5bb7ebe8a49 100644
--- a/drivers/rng/smccc_trng.c
+++ b/drivers/rng/smccc_trng.c
@@ -5,7 +5,6 @@
#define LOG_CATEGORY UCLASS_RNG
-#include <common.h>
#include <dm.h>
#include <linker_lists.h>
#include <log.h>
diff --git a/drivers/rng/stm32_rng.c b/drivers/rng/stm32_rng.c
index c397b4d95cd..61d5ed61582 100644
--- a/drivers/rng/stm32_rng.c
+++ b/drivers/rng/stm32_rng.c
@@ -5,16 +5,14 @@
#define LOG_CATEGORY UCLASS_RNG
-#include <common.h>
#include <clk.h>
#include <dm.h>
#include <log.h>
#include <reset.h>
#include <rng.h>
+#include <asm/io.h>
#include <linux/bitops.h>
#include <linux/delay.h>
-
-#include <asm/io.h>
#include <linux/iopoll.h>
#include <linux/kernel.h>