Merge branch '2023-09-22-assorted-bugfixes'

- A few driver fixes and MAINTAINER updates
This commit is contained in:
Tom Rini 2023-09-22 18:25:37 -04:00
commit 4cb31a9f35
6 changed files with 57 additions and 13 deletions

View file

@ -723,7 +723,10 @@ F: drivers/usb/musb-new/ux500.c
F: drivers/video/mcde_simple.c
ARM UNIPHIER
S: Orphan (Since 2020-09)
M: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
R: Dai Okamura <okamura.dai@socionext.com>
S: Maintained
F: arch/arm/dts/uniphier-*
F: arch/arm/mach-uniphier/
F: configs/uniphier_*_defconfig
N: uniphier

View file

@ -1,5 +1,4 @@
TechNexion PICO-IMX7D board
M: Vanessa Maegima <vanessa.maegima@nxp.com>
M: Otavio Salvador <otavio@ossystems.com.br>
S: Maintained
F: board/technexion/pico-imx7d/

View file

@ -85,6 +85,7 @@ CONFIG_SYS_I2C_OMAP24XX=y
CONFIG_DM_MAILBOX=y
CONFIG_K3_SEC_PROXY=y
CONFIG_MISC=y
CONFIG_SPL_MISC=y
CONFIG_K3_AVS0=y
# CONFIG_MMC is not set
CONFIG_PHY=y
@ -122,6 +123,7 @@ CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_DWC3=y
CONFIG_USB_DWC3=y
CONFIG_USB_DWC3_GENERIC=y
CONFIG_SPL_USB_DWC3_GENERIC=y
CONFIG_USB_STORAGE=y
CONFIG_SPL_USB_STORAGE=y
CONFIG_USB_GADGET=y

View file

@ -621,7 +621,7 @@ static int mtk_i2c_do_transfer(struct mtk_i2c_priv *priv,
i2c_writel(priv, REG_INTR_MASK, ~(restart_flag | I2C_HS_NACKERR |
I2C_ACKERR | I2C_TRANSAC_COMP));
if (!tmo && trans_error != 0) {
if (tmo || trans_error != 0) {
if (tmo) {
ret = -ETIMEDOUT;
if (!priv->filter_msg)

View file

@ -286,6 +286,8 @@ struct netsec_rx_pkt_info {
bool err_flag;
};
static int netsec_reset_hardware(struct netsec_priv *priv, bool load_ucode);
static void netsec_write_reg(struct netsec_priv *priv, u32 reg_addr, u32 val)
{
writel(val, priv->ioaddr + reg_addr);
@ -532,18 +534,11 @@ static int netsec_mac_update_to_phy_state(struct netsec_priv *priv)
return 0;
}
static int netsec_start_gmac(struct netsec_priv *priv)
static int netsec_reset_gmac(struct netsec_priv *priv)
{
u32 value = 0;
int ret;
if (priv->max_speed != SPEED_1000)
value = (NETSEC_GMAC_MCR_REG_CST |
NETSEC_GMAC_MCR_REG_HALF_DUPLEX_COMMON);
if (netsec_set_mac_reg(priv, GMAC_REG_MCR, value))
return -ETIMEDOUT;
if (netsec_set_mac_reg(priv, GMAC_REG_BMR,
NETSEC_GMAC_BMR_REG_RESET))
return -ETIMEDOUT;
@ -558,10 +553,47 @@ static int netsec_start_gmac(struct netsec_priv *priv)
if (value & NETSEC_GMAC_BMR_REG_SWR)
return -EAGAIN;
/**
* NETSEC GMAC sometimes shows the peculiar behaviour where
* MAC_REG_DESC_SOFT_RST never been cleared, resulting in the loss of
* sending packets.
*
* Workaround:
* Restart NETSEC and PHY, retry again.
*/
netsec_write_reg(priv, MAC_REG_DESC_SOFT_RST, 1);
if (netsec_wait_while_busy(priv, MAC_REG_DESC_SOFT_RST, 1))
udelay(1000);
if (netsec_read_reg(priv, MAC_REG_DESC_SOFT_RST)) {
phy_shutdown(priv->phydev);
netsec_reset_hardware(priv, false);
phy_startup(priv->phydev);
return -EAGAIN;
}
return 0;
}
static int netsec_start_gmac(struct netsec_priv *priv)
{
u32 value = 0;
u32 failure = 0;
int ret;
if (priv->max_speed != SPEED_1000)
value = (NETSEC_GMAC_MCR_REG_CST |
NETSEC_GMAC_MCR_REG_HALF_DUPLEX_COMMON);
if (netsec_set_mac_reg(priv, GMAC_REG_MCR, value))
return -ETIMEDOUT;
/* Reset GMAC */
while ((ret = netsec_reset_gmac(priv)) == -EAGAIN && ++failure < 3)
;
if (ret) {
pr_err("%s: failed to reset gmac(err=%d).\n", __func__, ret);
return ret;
}
netsec_write_reg(priv, MAC_REG_DESC_INIT, 1);
if (netsec_wait_while_busy(priv, MAC_REG_DESC_INIT, 1))
return -ETIMEDOUT;

View file

@ -35,7 +35,8 @@ struct pkt_qd {
* The actual packet bufers are in the kernel space, and are
* expected to be overwritten by the downloaded image.
*/
static struct pkt_qd pkt_q[PKTBUFSRX / 4];
#define PKTQ_SZ (PKTBUFSRX / 4)
static struct pkt_qd pkt_q[PKTQ_SZ];
static int pkt_q_idx;
static unsigned long content_length;
static unsigned int packets;
@ -202,6 +203,13 @@ static void wget_connected(uchar *pkt, unsigned int tcp_seq_num,
pkt_q[pkt_q_idx].tcp_seq_num = tcp_seq_num;
pkt_q[pkt_q_idx].len = len;
pkt_q_idx++;
if (pkt_q_idx >= PKTQ_SZ) {
printf("wget: Fatal error, queue overrun!\n");
net_set_state(NETLOOP_FAIL);
return;
}
} else {
debug_cond(DEBUG_WGET, "wget: Connected HTTP Header %p\n", pkt);
/* sizeof(http_eom) - 1 is the string length of (http_eom) */