On Thu, Feb 16, 2023 at 6:39 AM wrote:
>
> From: Sean Edmond
>
> Fix "setenv gatewayip6".
>
> Synchronize IPv6 local variables with environment variables
> in netboot_update_env()
>
> Signed-off-by: Sean Edmond
> ---
> cmd/net.c | 23 ++-
> include/env_flags.h | 2
uot;Atheros Ethernet PHYs support"
>
> +config SPL_PHY_ATHEROS
> + bool "Atheros Ethernet PHYs support (SPL)"
> +
> config PHY_BROADCOM
> bool "Broadcom Ethernet PHYs support"
>
> --
> 2.39.1.581.gbfd45094c4-goog
>
Reviewed-by: Ramon Fried
P_DPC:
> - err = mc_fixup_dpc_mac_addr(blob, i, eth_dev);
> + err = mc_fixup_dpc_mac_addr(blob, dpmac_id, eth_dev);
> break;
> default:
> break;
> }
>
> if (err)
> - printf("fsl-mc: ERROR fixing mac address for %s\n",
> - ethname);
> + printf("fsl-mc: ERROR fixing mac address for %s\n",
> eth_dev->name);
> ret |= err;
> }
>
> --
> 2.25.1
>
Reviewed-by: Ramon Fried
> + return phy_startup(phy);
> }
>
> static void ksz_port_disable(struct udevice *dev, int port, struct
> phy_device *phy)
> @@ -410,6 +409,7 @@ static void ksz_port_disable(struct udevice *dev, int
> port, struct phy_device *p
> }
>
> static const struct dsa_ops ksz_dsa_ops = {
> + .port_probe = ksz_port_probe,
> .port_enable = ksz_port_enable,
> .port_disable = ksz_port_disable,
> };
> --
> 2.25.1
>
Reviewed-by: Ramon Fried
er:%s\n", __func__, dev->name, master->name);
> dev_set_parent_priv(dev, priv);
>
> ret = i2c_set_chip_offset_len(dev, 2);
> --
> 2.25.1
>
Reviewed-by: Ramon Fried
;
> }
>
> - dsa_set_tagging(dev, 0, 0);
> -
> return 0;
> };
>
> --
> 2.25.1
>
Reviewed-by: Ramon Fried
uot;Atheros Ethernet PHYs support"
>
> +config SPL_PHY_ATHEROS
> + bool "Atheros Ethernet PHYs support (SPL)"
> +
> config PHY_BROADCOM
> bool "Broadcom Ethernet PHYs support"
>
> --
> 2.39.1.519.gcb327c4b5f-goog
>
Reviewed-by: Ramon Fried
uot;Atheros Ethernet PHYs support"
>
> +config SPL_PHY_ATHEROS
> + bool "Atheros Ethernet PHYs support (SPL)"
> +
> config PHY_BROADCOM
> bool "Broadcom Ethernet PHYs support"
>
> --
> 2.39.1.519.gcb327c4b5f-goog
>
Reviewed-by: Ramon Fried
"emac", &eqos->reset_ctl);
> + if (ret) {
> + pr_err("reset_get_by_name(rst) failed: %d", ret);
> + return ret;
> + }
> +
> + if (dev_read_bool(dev, "snps,reset-active-low"))
> + reset_flags |= GPIOD_ACTIVE_LOW;
> +
> + ret = gpio_request_by_name(dev, "snps,reset-gpio", 0,
> + &eqos->phy_reset_gpio, reset_flags);
> + if (ret == 0) {
> + ret = dev_read_u32_array(dev, "snps,reset-delays-us",
> +eqos->reset_delays, 3);
> + } else if (ret == -ENOENT) {
> + ret = 0;
> + }
> +
> + eqos->eqos_qcom_rgmii_regs = (void *)dev_read_addr_name(dev, "rgmii");
> + if ((fdt_addr_t)eqos->eqos_qcom_rgmii_regs == FDT_ADDR_T_NONE) {
> + pr_err("Invalid RGMII address\n");
> + return -EINVAL;
> + }
> +
> + ret = clk_get_by_name(dev, "rgmii", &eqos->clk_tx);
> + if (ret) {
> + pr_err("clk_get_by_name(tx) failed: %d", ret);
> + return -EINVAL;
> + }
> +
> + debug("%s: OK\n", __func__);
> + return 0;
> +}
> +
> +static int eqos_remove_resources_qcom(struct udevice *dev)
> +{
> + struct eqos_priv *eqos = dev_get_priv(dev);
> +
> + debug("%s(dev=%p):\n", __func__, dev);
> +
> + clk_free(&eqos->clk_tx);
> + dm_gpio_free(dev, &eqos->phy_reset_gpio);
> + reset_free(&eqos->reset_ctl);
> +
> + debug("%s: OK\n", __func__);
> + return 0;
> +}
> +
> +static struct eqos_ops eqos_qcom_ops = {
> + .eqos_inval_desc = eqos_inval_desc_generic,
> + .eqos_flush_desc = eqos_flush_desc_generic,
> + .eqos_inval_buffer = eqos_inval_buffer_generic,
> + .eqos_flush_buffer = eqos_flush_buffer_generic,
> + .eqos_probe_resources = eqos_probe_resources_qcom,
> + .eqos_remove_resources = eqos_remove_resources_qcom,
> + .eqos_stop_resets = eqos_null_ops,
> + .eqos_start_resets = eqos_start_resets_qcom,
> + .eqos_stop_clks = eqos_stop_clks_qcom,
> + .eqos_start_clks = eqos_start_clks_qcom,
> + .eqos_calibrate_pads = eqos_null_ops,
> + .eqos_disable_calibration = eqos_null_ops,
> + .eqos_set_tx_clk_speed = eqos_set_tx_clk_speed_qcom,
> + .eqos_get_enetaddr = eqos_null_ops,
> +};
> +
> +struct eqos_config __maybe_unused eqos_qcom_config = {
> + .reg_access_always_ok = false,
> + .mdio_wait = 10,
> + .swr_wait = 50,
> + .config_mac = EQOS_MAC_RXQ_CTRL0_RXQ0EN_ENABLED_DCB,
> + .config_mac_mdio = EQOS_MAC_MDIO_ADDRESS_CR_250_300,
> + .axi_bus_width = EQOS_AXI_WIDTH_64,
> + .interface = dev_read_phy_mode,
> + .ops = &eqos_qcom_ops
> +};
> --
> 2.34.1
>
Reviewed-by: Ramon Fried
b/drivers/net/dwc_eth_qos.h
> @@ -276,6 +276,7 @@ struct eqos_priv {
> bool started;
> bool reg_access_ok;
> bool clk_ck_enabled;
> + unsigned int tx_fifo_sz, rx_fifo_sz;
> };
>
> void eqos_inval_desc_generic(void *desc);
> --
> 2.34.1
>
Reviewed-by: Ramon Fried
= eqos->config->ops->eqos_get_tick_clk_rate(dev);
> +
> + val = (rate / 100) - 1;
> + writel(val, &eqos->mac_regs->us_tic_counter);
> + }
>
> /*
> * if PHY was already connected and configured,
> --
> 2.34.1
>
Reviewed-by: Ramon Fried
On Wed, Feb 1, 2023 at 2:28 AM Andre Przywara wrote:
>
> On Sun, 22 Jan 2023 16:51:01 -0600
> Samuel Holland wrote:
>
> Hi Joe, Ramon,
>
> > D1 is a RISC-V SoC containing an EMAC compatible with the A64 EMAC. In a
> > very roundabout way, this series finishes adding support for the D1 EMAC:
> > p
Cc: Marcel Ziswiler
> Cc: Marek Vasut
> Cc: Michael Trimarchi
> Cc: Peng Fan
> Cc: Ramon Fried
> Cc: Sean Anderson
> Cc: Stefano Babic
> Cc: Tim Harvey
> Cc: Tommaso Merciai
> Cc: u-boot@lists.denx.de
> ---
> drivers/net/dwc_eth_qos.c | 3 ---
> 1 f
S_PLL2_50M>;
> assigned-clock-rates = <0>, <1>, <5000>;
>
> Signed-off-by: Marek Vasut
> ---
> Cc: "Ariel D'Alessandro"
> Cc: "NXP i.MX U-Boot Team"
> Cc: Andrey Zhizhikin
> Cc: Fabio Estevam
> Cc: Joe Hershberger
>
t; Cc: Marcel Ziswiler
> Cc: Marek Vasut
> Cc: Michael Trimarchi
> Cc: Peng Fan
> Cc: Ramon Fried
> Cc: Sean Anderson
> Cc: Stefano Babic
> Cc: Tim Harvey
> Cc: Tommaso Merciai
> Cc: u-boot@lists.denx.de
> ---
> drivers/net/dwc_eth_qos.c | 6 ++
>
ravb-r8a77965" },
> - { .compatible = "renesas,etheravb-r8a77970" },
> - { .compatible = "renesas,etheravb-r8a77990" },
> - { .compatible = "renesas,etheravb-r8a77995" },
> { .compatible = "renesas,etheravb-rcar-gen3" },
> { }
> };
> --
> 2.39.0
>
Reviewed-by: Ramon Fried
40_GMAC,
> > .syscon_offset = 0x164,
> > };
> >
> > static const struct emac_variant emac_variant_a64 = {
> > - .variant= A64_EMAC,
> > .syscon_offset = 0x30,
> > .support_rmii = true,
> > };
> >
> > static const struct emac_variant emac_variant_h6 = {
> > - .variant= H6_EMAC,
> > .syscon_offset = 0x30,
> > .support_rmii = true,
> > };
>
Reviewed-by: Ramon Fried
= 0x30,
> > };
> >
> > static const struct emac_variant emac_variant_h3 = {
> > .variant= H3_EMAC,
> > + .syscon_offset = 0x30,
> > .soc_has_internal_phy = true,
> > .support_rmii = true,
> > };
> >
> > static const struct emac_variant emac_variant_r40 = {
> > .variant= R40_GMAC,
> > + .syscon_offset = 0x164,
> > };
> >
> > static const struct emac_variant emac_variant_a64 = {
> > .variant= A64_EMAC,
> > + .syscon_offset = 0x30,
> > .support_rmii = true,
> > };
> >
> > static const struct emac_variant emac_variant_h6 = {
> > .variant= H6_EMAC,
> > + .syscon_offset = 0x30,
> > .support_rmii = true,
> > };
> >
>
Reviewed-by: Ramon Fried
06,6 +907,7 @@ static const struct emac_variant emac_variant_a83t = {
> >
> > static const struct emac_variant emac_variant_h3 = {
> > .variant= H3_EMAC,
> > + .soc_has_internal_phy = true,
> > .support_rmii = true,
> > };
> >
>
Reviewed-by: Ramon Fried
= H3_EMAC,
> > + .support_rmii = true,
> > };
> >
> > static const struct emac_variant emac_variant_r40 = {
> > @@ -918,10 +915,12 @@ static const struct emac_variant emac_variant_r40 = {
> >
> > static const struct emac_variant emac_variant_a64 = {
> > .variant= A64_EMAC,
> > + .support_rmii = true,
> > };
> >
> > static const struct emac_variant emac_variant_h6 = {
> > .variant= H6_EMAC,
> > + .support_rmii = true,
> > };
> >
> > static const struct udevice_id sun8i_emac_eth_ids[] = {
>
Reviewed-by: Ramon Fried
t)H3_EMAC
> > },
> > - {.compatible = "allwinner,sun50i-a64-emac",
> > - .data = (uintptr_t)A64_EMAC },
> > - {.compatible = "allwinner,sun8i-a83t-emac",
> > - .data = (uintptr_t)A83T_EMAC },
> > - {.compatible = "allwinner,sun8i-r40-gmac",
> > - .data = (uintptr_t)R40_GMAC },
> > - {.compatible = "allwinner,sun50i-h6-emac",
> > - .data = (uintptr_t)H6_EMAC },
> > + { .compatible = "allwinner,sun8i-a83t-emac",
> > + .data = (ulong)&emac_variant_a83t },
> > + { .compatible = "allwinner,sun8i-h3-emac",
> > + .data = (ulong)&emac_variant_h3 },
> > + { .compatible = "allwinner,sun8i-r40-gmac",
> > + .data = (ulong)&emac_variant_r40 },
> > + { .compatible = "allwinner,sun50i-a64-emac",
> > + .data = (ulong)&emac_variant_a64 },
> > + { .compatible = "allwinner,sun50i-h6-emac",
> > + .data = (ulong)&emac_variant_h6 },
> > { }
> > };
> >
>
Reviewed-by: Ramon Fried
"emac", &eqos->reset_ctl);
> + if (ret) {
> + pr_err("reset_get_by_name(rst) failed: %d", ret);
> + return ret;
> + }
> +
> + if (dev_read_bool(dev, "snps,reset-active-low"))
> + reset_flags |= GPIOD_ACTIVE_LOW;
> +
> + ret = gpio_request_by_name(dev, "snps,reset-gpio", 0,
> + &eqos->phy_reset_gpio, reset_flags);
> + if (ret == 0) {
> + ret = dev_read_u32_array(dev, "snps,reset-delays-us",
> +eqos->reset_delays, 3);
> + } else if (ret == -ENOENT) {
> + ret = 0;
> + }
> +
> + eqos->eqos_qcom_rgmii_regs = (void *)dev_read_addr_name(dev, "rgmii");
> + if ((fdt_addr_t)eqos->eqos_qcom_rgmii_regs == FDT_ADDR_T_NONE) {
> + pr_err("Invalid RGMII address\n");
> + return -EINVAL;
> + }
> +
> + ret = clk_get_by_name(dev, "rgmii", &eqos->clk_tx);
> + if (ret) {
> + pr_err("clk_get_by_name(tx) failed: %d", ret);
> + return -EINVAL;
> + }
> +
> + debug("%s: OK\n", __func__);
> + return 0;
> +}
> +
> +static int eqos_remove_resources_qcom(struct udevice *dev)
> +{
> + struct eqos_priv *eqos = dev_get_priv(dev);
> +
> + debug("%s(dev=%p):\n", __func__, dev);
> +
> + clk_free(&eqos->clk_tx);
> + dm_gpio_free(dev, &eqos->phy_reset_gpio);
> + reset_free(&eqos->reset_ctl);
> +
> + debug("%s: OK\n", __func__);
> + return 0;
> +}
> +
> +static struct eqos_ops eqos_qcom_ops = {
> + .eqos_inval_desc = eqos_inval_desc_generic,
> + .eqos_flush_desc = eqos_flush_desc_generic,
> + .eqos_inval_buffer = eqos_inval_buffer_generic,
> + .eqos_flush_buffer = eqos_flush_buffer_generic,
> + .eqos_probe_resources = eqos_probe_resources_qcom,
> + .eqos_remove_resources = eqos_remove_resources_qcom,
> + .eqos_stop_resets = eqos_null_ops,
> + .eqos_start_resets = eqos_start_resets_qcom,
> + .eqos_stop_clks = eqos_stop_clks_qcom,
> + .eqos_start_clks = eqos_start_clks_qcom,
> + .eqos_calibrate_pads = eqos_null_ops,
> + .eqos_disable_calibration = eqos_null_ops,
> + .eqos_set_tx_clk_speed = eqos_set_tx_clk_speed_qcom,
> + .eqos_get_enetaddr = eqos_null_ops,
> +};
> +
> +struct eqos_config __maybe_unused eqos_qcom_config = {
> + .reg_access_always_ok = false,
> + .mdio_wait = 10,
> + .swr_wait = 50,
> + .config_mac = EQOS_MAC_RXQ_CTRL0_RXQ0EN_ENABLED_DCB,
> + .config_mac_mdio = EQOS_MAC_MDIO_ADDRESS_CR_250_300,
> + .axi_bus_width = EQOS_AXI_WIDTH_64,
> + .interface = dev_read_phy_mode,
> + .ops = &eqos_qcom_ops
> +};
> --
> 2.34.1
>
Reviewed-by: Ramon Fried
b/drivers/net/dwc_eth_qos.h
> @@ -276,6 +276,7 @@ struct eqos_priv {
> bool started;
> bool reg_access_ok;
> bool clk_ck_enabled;
> + unsigned int tx_fifo_sz, rx_fifo_sz;
> };
>
> void eqos_inval_desc_generic(void *desc);
> --
> 2.34.1
>
Reviewed-by: Ramon Fried
= eqos->config->ops->eqos_get_tick_clk_rate(dev);
> +
> + val = (rate / 100) - 1;
> + writel(val, &eqos->mac_regs->us_tic_counter);
> + }
>
> /*
> * if PHY was already connected and configured,
> --
> 2.34.1
>
Reviewed-by: Ramon Fried
abio Estevam
> Cc: Joe Hershberger
> Cc: Lukasz Majewski
> Cc: Marcel Ziswiler
> Cc: Marek Vasut
> Cc: Michael Trimarchi
> Cc: Peng Fan
> Cc: Ramon Fried
> Cc: Sean Anderson
> Cc: Stefano Babic
> Cc: Tim Harvey
> Cc: Tommaso Merciai
> Cc: u-boot@lis
> Cc: Andrey Zhizhikin
> Cc: Fabio Estevam
> Cc: Joe Hershberger
> Cc: Lukasz Majewski
> Cc: Marcel Ziswiler
> Cc: Marek Vasut
> Cc: Michael Trimarchi
> Cc: Peng Fan
> Cc: Ramon Fried
> Cc: Sean Anderson
> Cc: Stefano Babic
> Cc: Tim Harvey
> Cc: T
On Thu, Jan 19, 2023 at 9:55 PM Sergei Antonov wrote:
>
> On Tue, 10 Jan 2023 at 20:13, Ramon Fried wrote:
>
> > Reviewed-by: Ramon Fried
>
> Hello, Ramon! I have just submitted a v2 of this patch. The only
> substantial difference there is a Kconfig addition. If you a
ftmac100_remove,
> .ops= &ftmac100_ops,
> .priv_auto = sizeof(struct ftmac100_data),
> .plat_auto = sizeof(struct eth_pdata),
> diff --git a/drivers/net/ftmac100.h b/drivers/net/ftmac100.h
> index 75a49f628a69..21d339f835bf 100644
> --- a/drivers/net/ftmac100.h
> +++ b/drivers/net/ftmac100.h
> @@ -92,6 +92,15 @@ struct ftmac100 {
> #define FTMAC100_MACCR_RX_MULTIPKT (1 << 16)
> #define FTMAC100_MACCR_RX_BROADPKT (1 << 17)
>
> +/*
> + * PHY control register
> + */
> +#define FTMAC100_PHYCR_MIIRDATA0x
> +#define FTMAC100_PHYCR_PHYAD(x)(((x) & 0x1f) << 16)
> +#define FTMAC100_PHYCR_REGAD(x)(((x) & 0x1f) << 21)
> +#define FTMAC100_PHYCR_MIIWR BIT(27)
> +#define FTMAC100_PHYCR_MIIRD BIT(26)
> +
> /*
> * Transmit descriptor, aligned to 16 bytes
> */
> --
> 2.34.1
>
Reviewed-by: Ramon Fried
On Thu, 12 Jan 2023, 12:58 Ioana Ciornei, wrote:
> On Tue, Jan 10, 2023 at 07:04:00PM +0200, Ramon Fried wrote:
> > On Thu, Jan 5, 2023 at 5:03 PM Ioana Ciornei
> wrote:
> > >
> > > The cur_ptr variable is set to the start of the log buffer but then
> it&
k_size;
> +
> + if ((uintptr_t)addr >= end)
> + printf("KASLR not found in range 0x%lx - 0x%lx", start, end);
> + else
> + env_set_addr("KASLR", addr);
> +
> return 0;
> }
> --
> 2.30.2
>
Reviewed-by: Ramon Fried
44
> --- a/drivers/net/ftmac100.h
> +++ b/drivers/net/ftmac100.h
> @@ -92,6 +92,15 @@ struct ftmac100 {
> #define FTMAC100_MACCR_RX_MULTIPKT (1 << 16)
> #define FTMAC100_MACCR_RX_BROADPKT (1 << 17)
>
> +/*
> + * PHY control register
> + */
> +#define FTMAC100_PHYCR_MIIRDATA0x
> +#define FTMAC100_PHYCR_PHYAD(x)(((x) & 0x1f) << 16)
> +#define FTMAC100_PHYCR_REGAD(x)(((x) & 0x1f) << 21)
> +#define FTMAC100_PHYCR_MIIWR BIT(27)
> +#define FTMAC100_PHYCR_MIIRD BIT(26)
> +
> /*
> * Transmit descriptor, aligned to 16 bytes
> */
> --
> 2.34.1
>
Reviewed-by: Ramon Fried
des = priv->txdes;
> ulong start;
>
> @@ -400,7 +400,7 @@ static int ftmac100_of_to_plat(struct udevice *dev)
> struct eth_pdata *pdata = dev_get_plat(dev);
> const char *mac;
> pdata->iobase = dev_read_addr(dev);
> - priv->iobase = pdata->iobase;
> + priv->ftmac100 = (struct ftmac100 *)pdata->iobase;
> mac = dtbmacaddr(0);
> if (mac)
> memcpy(pdata->enetaddr , mac , 6);
> --
> 2.34.1
>
Reviewed-by: Ramon Fried
ftmac100_ids[] = {
> };
>
> U_BOOT_DRIVER(ftmac100) = {
> - .name = "nds32_mac",
> + .name = "ftmac100",
> .id = UCLASS_ETH,
> .of_match = ftmac100_ids,
> .bind = ftmac100_bind,
> --
> 2.34.1
>
Reviewed-by: Ramon Fried
values for different switch models */
> #define PORT_SWITCH_ID_60200x0200
> #define PORT_SWITCH_ID_60700x0700
> --
> 2.25.1
>
Reviewed-by: Ramon Fried
(ushort)(tftp_cur_block + 1) -
> (short)(ntohs(*(__be16 *)pkt)) > 0)
> + break;
> /*
> * If one packet is dropped most likely
> * all other buffers in the window
> --
> 2.39.0
>
Reviewed-by: Ramon Fried
t; struct memac_mdio_controller *regs;
>
> priv->regs_base = dev_read_addr_ptr(dev);
> + if (!priv->regs_base)
> + return -ENODEV;
> +
> regs = (struct memac_mdio_controller *)(priv->regs_base);
>
> memac_setbits_32(®s->mdio_stat,
> --
> 2.25.1
>
Reviewed-by: Ramon Fried
int mc_fixup_dpl(u64 dpl_addr)
> {
> void *blob = (void *)dpl_addr;
> @@ -698,7 +697,6 @@ static int wait_for_mc(bool booting_mc, u32
> *final_reg_gsr)
> printf("SUCCESS\n");
> }
>
> -
> *final_reg_gsr = reg_gsr;
> return 0;
> }
> --
> 2.25.1
>
Reviewed-by: Ramon Fried
root_dprc_handle,
> - &cfg,
> - &child_dprc_id,
> - &mc_portal_offset);
> + root_dprc_handle, &cfg,
> + &child_dprc_id,
> +
fsl_dpni_obj), 1);
> + dflt_dpni = calloc(sizeof(struct fsl_dpni_obj), 1);
> if (!dflt_dpni) {
> printf("No memory: calloc() failed\n");
> err = -ENOMEM;
> --
> 2.25.1
>
Reviewed-by: Ramon Fried
On Thu, Jan 5, 2023 at 5:03 PM Ioana Ciornei wrote:
>
> Some of the global variables were being initialised either to NULL or 0.
> This is not needed, just remove the it.
>
> Signed-off-by: Ioana Ciornei
> ---
> drivers/net/fsl-mc/mc.c | 14 +++---
> 1 file changed, 7 insertions(+), 7 de
ifdef DEBUG
> - printf("Init: DPNI id=0x%d\n", dflt_dpni->dpni_id);
> + printf("Init: DPNI.%d\n", dflt_dpni->dpni_id);
> #endif
> err = dpni_close(dflt_mc_io, MC_CMD_NO_FLAGS, dflt_dpni->dpni_handle);
> if (err < 0) {
> @@ -1459,7 +1459,7 @@ static int dpni_exit(void)
> }
>
> #ifdef DEBUG
> - printf("Exit: DPNI id=0x%d\n", dflt_dpni->dpni_id);
> + printf("Exit: DPNI.%d\n", dflt_dpni->dpni_id);
> #endif
>
> if (dflt_dpni)
> --
> 2.25.1
>
Reviewed-by: Ramon Fried
was forgotten.
Let's see if it introduces problems in the CI. meanwhile I'll approve.
Reviewed-by: Ramon Fried
bytes_end) {
> print_k_bytes(cur_ptr, &bytes_end);
>
> - cur_ptr = buf;
> size -= bytes_end;
> }
>
> --
> 2.25.1
>
Reviewed-by: Ramon Fried
ad is false or to use the
> + * default filename)
> + * @autoload: true to load the file, false to just get the network IP
> + * @return 0 if OK, -EINVAL if the environment failed, -ENOENT if ant file
> was
> + * not found
> + */
> +int dhcp_run(ulong addr, const char *fname, bool autoload);
> +
> /**
> * An incoming packet handler.
> * @param pktpointer to the application packet
> --
> 2.39.0.314.g84b9a713c41-goog
>
Reviewed-by: Ramon Fried
net_prefix_length = simple_strtoul(mask + 1, NULL,
> > 10);
> > + len = mask - value;
> > + } else {
> > + len = strlen(value);
> > + }
> >
> > return string_to_ip6(value, len, &net_ip6);
> > }
> > --
> > 2.39.0
> I do agree with your changes.Thanks
>
> Reviewed-by: Viacheslav Mitrofanov
Reviewed-by: Ramon Fried
;> probed during start() and removed during stop(), which includes
> >>> freeing `uclass_priv_` to which `priv` is pointing. Writing to
> >>> `priv` after stop() may corrupt the `fd` member of `struct
> >>> malloc_chunk`, which represents the freed block, and could
_ENABLED(NET_DEVICES))
> + CONFIG_IS_ENABLED(NETDEVICES))
> efi_net_set_dhcp_ack(pkt, len);
>
> #if defined(CONFIG_SERVERIP_FROM_PROXYDHCP)
> --
> 2.37.2
>
Reviewed-by: Ramon Fried
On Tue, Nov 22, 2022 at 4:41 PM Jit Loon Lim wrote:
>
> From: Ley Foon Tan
>
> HSD #1509063521: Try to get phy node from "phy-handle" if can't find
> ethernet-phy subnode.
What is this HSD ? Intel internal ?
Please remove.
> Lastly only use Ethernet node if can't find phy node from ethernet-phy
eth_register (dev);
> -
> - return 1;
> -
> -free_dev:
> - free (dev);
> -out:
> - return 0;
> -}
> -#endif
> -
> -#ifdef CONFIG_DM_ETH
> static int ftmac100_start(struct udevice *dev)
> {
> struct eth_pdata *plat = dev_get_plat(dev);
> @@ -445,4 +359,3 @@ U_BOOT_DRIVER(ftmac100) = {
> .plat_auto = sizeof(struct eth_pdata),
> .flags = DM_FLAG_ALLOC_PRIV_DMA,
> };
> -#endif
> --
> 2.25.1
>
Reviewed-by: Ramon Fried
On Thu, Nov 17, 2022 at 11:29 PM Sean Anderson wrote:
>
> On 8/14/22 16:48, Ramon Fried wrote:
> > On Sat, Aug 13, 2022 at 9:15 AM Sean Anderson
> > wrote:
> >>
> >> On 4/22/22 1:30 PM, Sean Anderson wrote:
> >> > This adds support for l
n Liu (PaulLiu)
> > Cc: Christian Gmeiner
> > Cc: Joe Hershberger
> > Cc: Michal Simek
> > Cc: Ramon Fried
> > Cc: Simon Glass
> > ---
> > doc/usage/cmd/wget.rst | 61 ++
> > doc/usage/index.rst| 1 +
&g
t; Signed-off-by: Ying-Chun Liu (PaulLiu)
> > Cc: Christian Gmeiner
> > Cc: Joe Hershberger
> > Cc: Michal Simek
> > Cc: Ramon Fried
> > Cc: Simon Glass
> > ---
> > test/cmd/Makefile | 1 +
> > test/cmd/wget.c | 206 ++
ent standard is TCP with selective acknowledgment.
>
> Signed-off-by: Duncan Hare
> Signed-off-by: Duncan Hare
> Signed-off-by: Ying-Chun Liu (PaulLiu)
> Reviewed-by: Simon Glass
> Cc: Christian Gmeiner
> Cc: Joe Hershberger
> Cc: Michal Simek
> Cc: Ramon Fried
&g
t command that can download files
> >> from http server.
> >>
> >> The command syntax is
> >> wget ${loadaddr}
> >>
> >> Signed-off-by: Duncan Hare
> >> Signed-off-by: Ying-Chun Liu (PaulLiu)
> >> Reviewed-by: Simon Glass
&
O)
> if (!dev_read_phandle_with_args(dev, "sfp", NULL, 0, 0, &sfp_args) &&
> ofnode_is_enabled(sfp_args.node))
> @@ -1620,6 +1660,7 @@ static const struct eth_ops mvneta_ops = {
>
> static const struct udevice_id mvneta_ids[] = {
> { .compatible = "marvell,armada-370-neta" },
> + { .compatible = "marvell,armada-ac5-neta" },
> { .compatible = "marvell,armada-xp-neta" },
> { .compatible = "marvell,armada-3700-neta" },
> { }
> --
> 2.38.1
>
Reviewed-by: Ramon Fried
;
> /* stall the microcprocessor */
> phy_write(phydev, MDIO_MMD_VEND1, UP_CONTROL,
> @@ -288,7 +288,7 @@ static int aquantia_upload_firmware(struct phy_device
> *phydev)
>
> phy_write(phydev, MDIO_MMD_VEND1, UP_CONTROL, UP_RUN_STALL_OVERRIDE);
>
> - printf("%s firmare loading done.\n", phydev->dev->name);
> + printf("%s firmware loading done.\n", phydev->dev->name);
> done:
> free(addr);
> return ret;
> --
> 2.25.1
>
Reviewed-by: Ramon Fried
str, &endptr, 16);
> + long value = simple_strtol(str, &endptr, 16);
>
> return (*endptr != '\0') ? -1 : value;
> }
> --
> 2.35.1
>
Reviewed-by: Ramon Fried
aved_tftp_block_size_option = 0;
> + }
> +
> if (IS_ENABLED(CONFIG_NET_TFTP_VARS)) {
> char *ep; /* Environment pointer */
>
> @@ -747,6 +791,8 @@ void tftp_start(enum proto_t protocol)
> }
> }
>
> + sanitize_tftp_block_size_option(protocol);
> +
> debug("TFTP blocksize = %i, TFTP windowsize = %d timeout = %ld ms\n",
> tftp_block_size_option, tftp_window_size_option, timeout_ms);
>
> --
> 2.37.2
>
Reviewed-by: Ramon Fried
On Fri, Oct 14, 2022 at 8:44 PM Rasmus Villemoes
wrote:
>
> Nothing inside this block depends on NET_TFTP_VARS to be set to parse
> correctly. Switch to C if() in preparation for adding code before
> this (to avoid a declaration-after-statement warning).
What's the motivation here ? The #ifdef is
gt; /* Check the Checksum of the header */
> if (!ip_checksum_ok((uchar *)ip, IP_HDR_SIZE)) {
> --
> 2.37.2
>
Reviewed-by: Ramon Fried
-by: Marek Vasut
> ---
> Cc: Joe Hershberger
> Cc: Patrice Chotard
> Cc: Patrick Delaunay
> Cc: Ramon Fried
> Cc: Stephen Warren
> ---
> drivers/net/dwc_eth_qos.c | 67 +--
> drivers/net/dwc_eth_qos.h | 2 ++
> 2 files changed, 46 in
> Cc: Patrick Delaunay
> Cc: Ramon Fried
> Cc: Stephen Warren
> ---
> drivers/net/dwc_eth_qos.c | 33 ++---
> drivers/net/dwc_eth_qos.h | 3 ++-
> 2 files changed, 24 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/net/dwc_eth_qo
the espressobin v5 board the value is "marvell/armada-3720-espressobin.dtb"
> @@ -408,7 +434,7 @@ way in future u-boot versions. In particular the type>_boot
> variables (e.g. mmc_boot, usb_boot) are a strictly internal implementation
> detail and must not be used as a public interface.
>
> -.. _BootLoaderSpec:
> http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec/
> +.. _`Boot Loader Specification`:
> https://systemd.io/BOOT_LOADER_SPECIFICATION/
>
> .. sectionauthor:: (C) Copyright 2014 Red Hat Inc.
> .. sectionauthor:: Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights
> reserved.
> --
> 2.37.3
>
Reviewed-by: Ramon Fried
if (length != first_read)
> + if (length > first_read)
> xemaclite_alignedread(addr + first_read,
> etherrxbuff + first_read,
> length - first_read);
> --
> 2.31.1
>
Reviewed-by: Ramon Fried
*to8ptr++ = *from8ptr++;
>
> - *to32ptr++ = alignbuffer;
> + __raw_writel(alignbuffer, to32ptr++);
> }
>
> static int wait_for_bit(const char *func, u32 *reg, const u32 mask,
> --
> 2.31.1
>
Reviewed-by: Ramon Fried
On Fri, Sep 23, 2022 at 12:36 PM Michal Simek wrote:
>
> Hi,
>
> On 9/23/22 11:17, Samuel Obuch wrote:
> > Hi, I tested both versions to be sure, but the results are as can be
> > expected:
> >
> > 1. both __raw_readl/__raw_writel and readl/writel functions work ok on
> > riscv -
> > only the or
w_common->fclk),
> - false);
> + priv->mdio_manual_mode);
> if (!cpsw_common->bus)
> return -EFAULT;
>
> @@ -658,6 +675,10 @@ static int am65_cpsw_port_probe(struct udevice *dev)
> sprintf(portname, "%s%s", dev->parent->name, dev->name);
> device_set_name(dev, portname);
>
> + priv->mdio_manual_mode = false;
> + if (soc_device_match(k3_mdio_soc_data))
> + priv->mdio_manual_mode = true;
> +
> ret = am65_cpsw_ofdata_parse_phy(dev);
> if (ret)
> goto out;
> --
> 2.17.1
>
Reviewed-by: Ramon Fried
cpsw_mdio->bus->write = cpsw_mdio_write;
> + }
> +
> cpsw_mdio->bus->priv = cpsw_mdio;
> snprintf(cpsw_mdio->bus->name, sizeof(cpsw_mdio->bus->name), name);
>
> diff --git a/drivers/net/ti/cpsw_mdio.h b/drivers/net/ti/cpsw_mdio.h
> index dbf4a2dcac..9b98763656 100644
> --- a/drivers/net/ti/cpsw_mdio.h
> +++ b/drivers/net/ti/cpsw_mdio.h
> @@ -11,7 +11,7 @@
> struct cpsw_mdio;
>
> struct mii_dev *cpsw_mdio_init(const char *name, phys_addr_t mdio_base,
> - u32 bus_freq, int fck_freq);
> + u32 bus_freq, int fck_freq, bool manual_mode);
> void cpsw_mdio_free(struct mii_dev *bus);
> u32 cpsw_mdio_get_alive(struct mii_dev *bus);
>
> diff --git a/drivers/net/ti/keystone_net.c b/drivers/net/ti/keystone_net.c
> index fbec69f571..1bdbd599d7 100644
> --- a/drivers/net/ti/keystone_net.c
> +++ b/drivers/net/ti/keystone_net.c
> @@ -571,7 +571,8 @@ static int ks2_eth_probe(struct udevice *dev)
> mdio_bus = cpsw_mdio_init("ethernet-mdio",
> priv->mdio_base,
> EMAC_MDIO_CLOCK_FREQ,
> - EMAC_MDIO_BUS_FREQ);
> + EMAC_MDIO_BUS_FREQ,
> + false);
> if (!mdio_bus) {
> pr_err("MDIO alloc failed\n");
> return -ENOMEM;
> --
> 2.17.1
>
Reviewed-by: Ramon Fried
/* CONFIG_SPL_BUILD */
>
> -/* ENET Config */
> -/* ENET1 */
> -#if defined(CONFIG_CMD_NET)
> -#define CONFIG_FEC_MXC_PHYADDR 7
> -
> -#define PHY_ANEG_TIMEOUT 2
> -#endif /* CONFIG_CMD_NET */
> -
> #define MEM_LAYOUT_ENV_SETTINGS \
> "fdt_addr_r=0x5020\0" \
> "kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
> --
> 2.35.1
>
Reviewed-by: Ramon Fried
v_read_phandle_with_args(dev, "sfp", NULL, 0, 0, &sfp_args) &&
> ofnode_is_enabled(sfp_args.node))
> @@ -1620,6 +1660,7 @@ static const struct eth_ops mvneta_ops = {
>
> static const struct udevice_id mvneta_ids[] = {
> { .compatible = "marvell,armada-370-neta" },
> + { .compatible = "marvell,armada-ac5-neta" },
> { .compatible = "marvell,armada-xp-neta" },
> { .compatible = "marvell,armada-3700-neta" },
> { }
> --
> 2.37.3
>
Reviewed-by: Ramon Fried
> {
> + int ret;
> +
> + ret = of_set_phy_supported(phydev);
> + if (ret)
> + return ret;
> +
> /* Invoke an optional board-specific helper */
> return board_phy_config(phydev);
> }
> --
> 2.31.1
>
Reviewed-by: Ramon Fried
.of_match = liteeth_ids,
> + .of_to_plat = liteeth_of_to_plat,
> + .plat_auto = sizeof(struct eth_pdata),
> + .remove = liteeth_remove,
> + .ops = &liteeth_ops,
> + .priv_auto = sizeof(struct liteeth),
> +};
> diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
> index 52dc9e4f0f6d..95420bd4a140 100644
> --- a/drivers/net/Kconfig
> +++ b/drivers/net/Kconfig
> @@ -460,6 +460,11 @@ config LPC32XX_ETH
> depends on ARCH_LPC32XX
> default y
>
> +config LITEETH
> + bool "LiteX LiteEth Ethernet MAC"
> + help
> +Driver for the LiteEth Ethernet MAC from LiteX.
> +
> config MVGBE
> bool "Marvell Orion5x/Kirkwood network interface support"
> depends on ARCH_KIRKWOOD || ARCH_ORION5X
> diff --git a/drivers/net/Makefile b/drivers/net/Makefile
> index 054ec68470db..770107296c62 100644
> --- a/drivers/net/Makefile
> +++ b/drivers/net/Makefile
> @@ -47,6 +47,7 @@ obj-$(CONFIG_GMAC_ROCKCHIP) += gmac_rockchip.o
> obj-$(CONFIG_HIGMACV300_ETH) += higmacv300.o
> obj-$(CONFIG_KS8851_MLL) += ks8851_mll.o
> obj-$(CONFIG_KSZ9477) += ksz9477.o
> +obj-$(CONFIG_LITEETH) += liteeth.o
> obj-$(CONFIG_LPC32XX_ETH) += lpc32xx_eth.o
> obj-$(CONFIG_MACB) += macb.o
> obj-$(CONFIG_MCFFEC) += mcffec.o mcfmii.o
> --
> 2.35.1
>
Reviewed-by: Ramon Fried
E_MODE_NA)
> return -EINVAL;
> - }
>
> pdata->max_speed = 0;
> cell = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "max-speed",
> NULL);
> --
> 2.17.1
>
Reviewed-by: Ramon Fried
0x300
> #define PHY_POWER_SAVING_TX0x0
>
> +/* PDMA descriptors */
> +struct mtk_rx_dma {
> + unsigned int rxd1;
> + unsigned int rxd2;
> + unsigned int rxd3;
> + unsigned int rxd4;
> +} __packed __aligned(4);
> +
> +struct mtk_tx_dma {
> + unsigned int txd1;
> + unsigned int txd2;
> + unsigned int txd3;
> + unsigned int txd4;
> +} __packed __aligned(4);
> +
> +/* PDMA TXD fields */
> +#define PDMA_TXD2_DDONEBIT(31)
> +#define PDMA_TXD2_LS0 BIT(30)
> +#define PDMA_TXD2_SDL0_M GENMASK(29, 16)
> +#define PDMA_TXD2_SDL0_SET(_v) FIELD_PREP(PDMA_TXD2_SDL0_M, (_v))
> +
> +#define PDMA_TXD4_FPORT_M GENMASK(27, 25)
> +#define PDMA_TXD4_FPORT_SET(_v)FIELD_PREP(PDMA_TXD4_FPORT_M, (_v))
> +
> +/* PDMA RXD fields */
> +#define PDMA_RXD2_DDONEBIT(31)
> +#define PDMA_RXD2_LS0 BIT(30)
> +#define PDMA_RXD2_PLEN0_M GENMASK(29, 16)
> +#define PDMA_RXD2_PLEN0_GET(_v)FIELD_GET(PDMA_RXD2_PLEN0_M, (_v))
> +#define PDMA_RXD2_PLEN0_SET(_v)FIELD_PREP(PDMA_RXD2_PLEN0_M, (_v))
> +
> #endif /* _MTK_ETH_H_ */
> --
> 2.17.1
>
Reviewed-by: Ramon Fried
e MTK_TRGMII BIT(MTK_TRGMII_BIT)
> +#define MTK_TRGMII_MT7621_CLK BIT(MTK_TRGMII_MT7621_CLK_BIT)
> +
> +/* Supported path present on SoCs */
> +#define MTK_ETH_PATH_GMAC1_TRGMII BIT(MTK_ETH_PATH_GMAC1_TRGMII_BIT)
> +
> +#define MTK_GMAC1_TRGMII (MTK_ETH_PATH_GMAC1_TRGMII | MTK_TRGMII)
> +
> +#define MTK_HAS_CAPS(caps, _x) (((caps) & (_x)) == (_x))
> +
> +#define MT7621_CAPS (MTK_GMAC1_TRGMII | MTK_TRGMII_MT7621_CLK)
> +
> +#define MT7623_CAPS (MTK_GMAC1_TRGMII)
> +
> +/* Frame Engine Register Bases */
> #define PDMA_BASE 0x0800
> #define GDMA1_BASE 0x0500
> #define GDMA2_BASE 0x1500
> --
> 2.17.1
>
Reviewed-by: Ramon Fried
s"
> +#else
> +#define NET6_FLAGS
> +#endif
> +
> #ifndef CONFIG_ENV_OVERWRITE
> #define SERIAL_FLAGS "serial#:so,"
> #else
> @@ -76,6 +85,7 @@ enum env_flags_varaccess {
> #define ENV_FLAGS_LIST_STATIC \
> ETHADDR_FLAGS \
> NET_FLAGS \
> + NET6_FLAGS \
> SERIAL_FLAGS \
> CONFIG_ENV_FLAGS_LIST_STATIC
>
> --
> 2.25.1
>
Reviewed-by: Ramon Fried
X) += mdio-mux-uclass.o
> obj-$(CONFIG_NET) += eth_common.o
> obj-$(CONFIG_CMD_LINK_LOCAL) += link_local.o
> obj-$(CONFIG_NET) += net.o
> +obj-$(CONFIG_IPV6) += net6.o
> obj-$(CONFIG_CMD_NFS) += nfs.o
> obj-$(CONFIG_CMD_PING) += ping.o
> obj-$(CONFIG_CMD_PCAP) += pcap.o
> --
> 2.25.1
>
Reviewed-by: Ramon Fried
#define NET6_FLAGS
> +#endif
> +
> #ifndef CONFIG_ENV_OVERWRITE
> #define SERIAL_FLAGS "serial#:so,"
> #else
> @@ -76,6 +85,7 @@ enum env_flags_varaccess {
> #define ENV_FLAGS_LIST_STATIC \
> ETHADDR_FLAGS \
> NET_FLAGS \
> + NET6_FLAGS \
> SERIAL_FLAGS \
> CONFIG_ENV_FLAGS_LIST_STATIC
>
> --
> 2.25.1
>
Reviewed-by: Ramon Fried
+static inline int
> +net_ip6_handler(struct ethernet_hdr *et, struct ip6_hdr *ip6,
> + int len)
> +{
> + return -EINVAL;
> +}
> +
> +/**
> + * Copy IPv6 addr
> + *
> + * @param to destination IPv6 addr
> + * @param from source IPv6 addr
> + */
> +static inline void net_copy_ip6(void *to, const void *from)
> +{
> +}
> +
> +#endif /* __NET6_H__ */
> diff --git a/net/net6.c b/net/net6.c
> new file mode 100644
> index 00..7cd442e6e2
> --- /dev/null
> +++ b/net/net6.c
> @@ -0,0 +1,31 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright (C) 2013 Allied Telesis Labs NZ
> + * Chris Packham,
> + *
> + * Copyright (C) 2022 YADRO
> + * Viacheslav Mitrofanov
> + */
> +
> +/* Simple IPv6 network layer implementation */
> +
> +#include
> +#include
> +#include
> +#include
> +#include
> +
> +/* NULL IPv6 address */
> +struct in6_addr const net_null_addr_ip6 = ZERO_IPV6_ADDR;
> +/* Our gateway's IPv6 address */
> +struct in6_addr net_gateway6 = ZERO_IPV6_ADDR;
> +/* Our IPv6 addr (0 = unknown) */
> +struct in6_addr net_ip6 = ZERO_IPV6_ADDR;
> +/* Our link local IPv6 addr (0 = unknown) */
> +struct in6_addr net_link_local_ip6 = ZERO_IPV6_ADDR;
> +/* set server IPv6 addr (0 = unknown) */
> +struct in6_addr net_server_ip6 = ZERO_IPV6_ADDR;
> +/* The prefix length of our network */
> +u32 net_prefix_length;
> +
> +bool use_ip6;
> --
> 2.25.1
>
Reviewed-by: Ramon Fried
aiting */
> +}
> +
> +static void ping6_timeout(void)
> +{
> + eth_halt();
> + net_set_state(NETLOOP_FAIL);/* we did not get the reply */
> +}
> +
> +void ping6_start(void)
> +{
> + printf("Using %s device\n", eth_get_name());
> + net_set_timeout_handler(1UL, ping6_timeout);
> +
> + ping6_send();
> +}
> +
> +int ping6_receive(struct ethernet_hdr *et, struct ip6_hdr *ip6, int len)
> +{
> + struct icmp6hdr *icmp =
> + (struct icmp6hdr *)(((uchar *)ip6) + IP6_HDR_SIZE);
> + struct in6_addr src_ip;
> +
> + switch (icmp->icmp6_type) {
> + case IPV6_ICMP_ECHO_REPLY:
> + src_ip = ip6->saddr;
> + if (memcmp(&net_ping_ip6, &src_ip, sizeof(struct in6_addr)))
> + return -EINVAL;
> + net_set_state(NETLOOP_SUCCESS);
> + break;
> + case IPV6_ICMP_ECHO_REQUEST:
> + /* ignore for now */
> + debug("Got ICMPv6 ECHO REQUEST from %pI6c\n", &ip6->saddr);
> + return -EINVAL;
> + default:
> + debug("Unexpected ICMPv6 type 0x%x\n", icmp->icmp6_type);
> + return -EINVAL;
> + }
> +
> + return 0;
> +}
> --
> 2.25.1
>
Reviewed-by: Ramon Fried
e_ip6) {
> + printf("TFTP from server %pI6c; our IP address is %pI6c",
> + &tftp_remote_ip6, &net_ip6);
> +
> + if (tftp_block_size_option > TFTP_MTU_BLOCKSIZE6)
> + tftp_block_size_option = TFTP_MTU_BLOCKSIZE6;
> + } else {
> + printf("TFTP %s server %pI4; our IP address is %pI4",
> #ifdef CONFIG_CMD_TFTPPUT
> - protocol == TFTPPUT ? "to" : "from",
> + protocol == TFTPPUT ? "to" : "from",
> #else
> - "from",
> + "from",
> #endif
> - &tftp_remote_ip, &net_ip);
> + &tftp_remote_ip, &net_ip);
> + }
>
> /* Check if we need to send across this subnet */
> - if (net_gateway.s_addr && net_netmask.s_addr) {
> + if (IS_ENABLED(CONFIG_IPV6) && use_ip6) {
> + if (!ip6_addr_in_subnet(&net_ip6, &tftp_remote_ip6,
> + net_prefix_length))
> + printf("; sending through gateway %pI6c",
> + &net_gateway6);
> + } else if (net_gateway.s_addr && net_netmask.s_addr) {
> struct in_addr our_net;
> struct in_addr remote_net;
>
> --
> 2.25.1
>
Reviewed-by: Ramon Fried
gt; + struct icmp6hdr *icmp;
> + struct udp_hdr *udp;
> + u16 csum;
> + u16 csum_p;
> + u16 hlen;
> +
> + if (len < IP6_HDR_SIZE)
> + return -EINVAL;
> +
> + if (ip6->version != 6)
> + return -EINVAL;
> +
> + switch (ip6->nexthdr) {
> + case PROT_ICMPV6:
> + icmp = (struct icmp6hdr *)(((uchar *)ip6) + IP6_HDR_SIZE);
> + csum = icmp->icmp6_cksum;
> + hlen = ntohs(ip6->payload_len);
> + icmp->icmp6_cksum = 0;
> + /* checksum */
> + csum_p = csum_partial((u8 *)icmp, hlen, 0);
> + icmp->icmp6_cksum = csum_ipv6_magic(&ip6->saddr, &ip6->daddr,
> + hlen, PROT_ICMPV6,
> csum_p);
> +
> + if (icmp->icmp6_cksum != csum)
> + return -EINVAL;
> +
> + switch (icmp->icmp6_type) {
> + case IPV6_NDISC_NEIGHBOUR_SOLICITATION:
> + case IPV6_NDISC_NEIGHBOUR_ADVERTISEMENT:
> + ndisc_receive(et, ip6, len);
> + break;
> + default:
> + break;
> + }
> + break;
> + case IPPROTO_UDP:
> + udp = (struct udp_hdr *)(((uchar *)ip6) + IP6_HDR_SIZE);
> + csum = udp->udp_xsum;
> + hlen = ntohs(ip6->payload_len);
> + udp->udp_xsum = 0;
> + /* checksum */
> + csum_p = csum_partial((u8 *)udp, hlen, 0);
> + udp->udp_xsum = csum_ipv6_magic(&ip6->saddr, &ip6->daddr,
> + hlen, IPPROTO_UDP, csum_p);
> +
> + if (csum != udp->udp_xsum)
> + return -EINVAL;
> +
> + /* IP header OK. Pass the packet to the current handler. */
> + net_get_udp_handler()((uchar *)ip6 + IP6_HDR_SIZE +
> + UDP_HDR_SIZE,
> + ntohs(udp->udp_dst),
> + zero_ip,
> + ntohs(udp->udp_src),
> + ntohs(udp->udp_len) - 8);
> + break;
> + default:
> + return -EINVAL;
> + }
> +
> + return 0;
> +}
> --
> 2.25.1
>
Reviewed-by: Ramon Fried
The ethernet
> * receive routine will process it.
> @@ -1187,6 +1203,11 @@ void net_process_received_packet(uchar *in_packet, int
> len)
> case PROT_RARP:
> rarp_receive(ip, len);
> break;
> +#endif
> +#if IS_ENABLED(CONFI
/* Fallthrough */
> case 'I':
> - /* %pI6 currently unused */
> - if (0 && fmt[1] == '6')
> + if (IS_ENABLED(CONFIG_IPV6) && fmt[1] == '6')
> return ip6_addr_string(buf, end, ptr, field_width,
>precision, flags);
> if (fmt[1] == '4')
> --
> 2.25.1
>
Reviewed-by: Ramon Fried
turn string_to_ip6(value, strlen(value), &net_gateway6);
> +}
> +
> +U_BOOT_ENV_CALLBACK(gatewayip6, on_gatewayip6);
> +
> +static int on_serverip6(const char *name, const char *value, enum env_op op,
> + int flags)
> +{
> + if (flags & H_PROGRAMMATIC)
> + return 0;
> +
> + return string_to_ip6(value, strlen(value), &net_server_ip6);
> +}
> +
> +U_BOOT_ENV_CALLBACK(serverip6, on_serverip6);
> --
> 2.25.1
>
Reviewed-by: Ramon Fried
&ndisc->target);
> + }
> + break;
> +
> + case IPV6_NDISC_NEIGHBOUR_ADVERTISEMENT:
> + /* are we waiting for a reply ? */
> + if (ip6_is_unspecified_addr(&net_nd_sol_packet_ip6))
> + break;
> +
> + if ((memcmp(&ndisc->target, &net_nd_rep_packet_ip6,
> + sizeof(struct in6_addr)) == 0) &&
> + ndisc_has_option(ip6, ND_OPT_TARGET_LL_ADDR)) {
> + ndisc_extract_enetaddr(ndisc, neigh_eth_addr);
> +
> + /* save address for later use */
> + if (!net_nd_packet_mac)
> + memcpy(net_nd_packet_mac, neigh_eth_addr, 7);
> +
> + /* modify header, and transmit it */
> + memcpy(((struct ethernet_hdr
> *)net_nd_tx_packet)->et_dest,
> + neigh_eth_addr, 6);
> +
> + net_send_packet(net_nd_tx_packet,
> + net_nd_tx_packet_size);
> +
> + /* no ND request pending now */
> + net_nd_sol_packet_ip6 = net_null_addr_ip6;
> + net_nd_tx_packet_size = 0;
> + net_nd_packet_mac = NULL;
> + }
> + break;
> + default:
> + debug("Unexpected ICMPv6 type 0x%x\n", icmp->icmp6_type);
> + return -1;
> + }
> +
> + return 0;
> +}
> --
> 2.25.1
>
Reviewed-by: Ramon Fried
; + if (i == 6 && isdigit((int)*s)) {
> + struct in_addr v4 = string_to_ip(s);
> +
> + if (memcmp(&zero_ip, &v4,
> + sizeof(struct in_addr)) != 0) {
> + /* Ending with :IPv4-address */
> + addr->s6_addr32[3] = v4.s_addr;
> + break;
> + }
> + }
> +
> + val = simple_strtoul(s, &end, 16);
> + if (end != e && *end != '\0' && *end != ':')
> + goto out_err;
> + addr->s6_addr16[i] = htons(val);
> + s = end;
> + }
> + return 0;
> +
> +out_err:
> + return -1;
> +}
> +#endif
> +
> void string_to_enetaddr(const char *addr, uint8_t *enetaddr)
> {
> char *end;
> --
> 2.25.1
>
Reviewed-by: Ramon Fried
On Fri, Sep 2, 2022 at 9:35 AM Siarhei Yasinski
wrote:
>
> If ethernet connected to SFP, like this:
>
> &enetc_port0 {
> phy-connection-type = "sgmii";
> sfp = <&sfp0>;
> managed = "in-band-status";
> status = "okay";
> };
>
> Then enetc_config_phy returns -ENODEV a
{
> > struct enetc_priv *priv = dev_get_priv(dev);
> > + int res;
> >
> > if (ofnode_valid(dev_ofnode(dev)) &&
> > !ofnode_is_available(dev_ofnode(dev))) {
> > enetc_dbg(dev, "interface disabled\n");
> > @@ -350,7 +353,10 @@ static int enetc_probe(struct udevice *dev)
> >
> > enetc_start_pcs(dev);
> >
> > - return enetc_config_phy(dev);
> > + res = enetc_config_phy(dev);
> > + if(res)
> > + enetc_remove(dev);
> > + return res;
> > }
> >
> > /*
Reviewed-by: Ramon Fried
On Mon, Aug 22, 2022 at 9:36 AM Vyacheslav Mitrofanov V
wrote:
>
> On Fri, 2022-08-19 at 21:01 +0300, Ramon Fried wrote:
> >
> > On Fri, Aug 19, 2022 at 2:30 PM Vyacheslav Mitrofanov V
> > wrote:
> > > On Fri, 2022-08-19 at 14:00 +0300, Ramon Fried wrote:
> &g
On Fri, Aug 19, 2022 at 2:30 PM Vyacheslav Mitrofanov V
wrote:
>
> On Fri, 2022-08-19 at 14:00 +0300, Ramon Fried wrote:
> > On Fri, Aug 19, 2022 at 11:10 AM Viacheslav Mitrofanov
> > wrote:
> > > The command tftpboot uses IPv4 by default, to use IPv6 instead add
&g
On Fri, Aug 19, 2022 at 11:10 AM Viacheslav Mitrofanov
wrote:
>
> The command tftpboot uses IPv4 by default, to use IPv6 instead add -ipv6
> as the last argument. All other tftpboot features and parameters are left
> the same.
>
In my opinion, we should be able to detect if a user has provided or
On Fri, Aug 19, 2022 at 11:10 AM Viacheslav Mitrofanov
wrote:
>
> That is quite a big patch that includes such things as Neighbour
> Discovery Protocol, string parsers, converters and basic IPv6
> implementation. It consists of all necessary parts to add upper layer
> protocols.
>
> Due to code de
On Sat, Aug 13, 2022 at 9:15 AM Sean Anderson wrote:
>
> On 4/22/22 1:30 PM, Sean Anderson wrote:
> > This adds support for loading Fman firmware from a filesystem using the
> > firmware loader subsystem. It was originally part of [1], but has been
> > split off because it is conceptually separate
; @@ -52,4 +52,16 @@ struct device_plat {
> int request_firmware_into_buf(struct udevice *dev,
> const char *name,
> void *buf, size_t size, u32 offset);
> +
> +/**
> + * get_fs_loader() - Get the chosen filesystem loader
> + * @dev: Where to store the device
> + *
> + * This gets a filesystem loader device based on the value of
> + * /chosen/firmware-loader. If no such property exists, it returns a
> + * firmware loader which is configured by environmental variables.
> + *
> + * Return: 0 on success, negative value on error
> + */
> +int get_fs_loader(struct udevice **dev);
> #endif
> --
> 2.35.1.1320.gc452695387.dirty
>
Reviewed-by: Ramon Fried
H;
> diff --git a/drivers/qe/Kconfig b/drivers/qe/Kconfig
> index c44a81f69a..89a75c175b 100644
> --- a/drivers/qe/Kconfig
> +++ b/drivers/qe/Kconfig
> @@ -27,6 +27,10 @@ choice
> depends on FMAN_ENET || QE
> default SYS_QE_FMAN_FW_IN_ROM
>
> +config SYS_QE_FMAN_FW_IN_FS
> + depends on FS_LOADER && FMAN_ENET
> + bool "Filesystem"
> +
> config SYS_QE_FMAN_FW_IN_NOR
> bool "NOR flash"
>
> --
> 2.35.1.1320.gc452695387.dirty
>
Reviewed-by: Ramon Fried
> struct ccsr_fman *reg;
>
> reg = (void *)CONFIG_SYS_FSL_FM1_ADDR;
> - if (fm_init_common(0, reg))
> + if (fm_init_common(0, reg, NULL))
> return 0;
>
> for (i = 0; i < ARRAY_SIZE(fm_info); i++) {
> @@ -103,7 +103,7 @@ int fm_standard_init(struct bd_info *bis)
>
> #if (CONFIG_SYS_NUM_FMAN == 2)
> reg = (void *)CONFIG_SYS_FSL_FM2_ADDR;
> - if (fm_init_common(1, reg))
> + if (fm_init_common(1, reg, NULL))
> return 0;
>
> for (i = 0; i < ARRAY_SIZE(fm_info); i++) {
> --
> 2.35.1.1320.gc452695387.dirty
>
Reviewed-by: Ramon Fried
if (protocol != NETCONS && protocol != NCSI)
> eth_halt();
> else
> eth_halt_state_only();
> @@ -1321,6 +1337,11 @@ void net_process_received_packet(uchar *in_packet, int
> len)
> case PROT_WOL:
> wol_receive(ip, len);
> break;
> +#endif
> +#ifdef CONFIG_PHY_NCSI
> + case PROT_NCSI:
> + ncsi_receive(et, ip, len);
> + break;
> #endif
> }
> }
> @@ -1381,6 +1402,9 @@ common:
>
> #ifdef CONFIG_CMD_RARP
> case RARP:
> +#endif
> +#ifdef CONFIG_PHY_NCSI
> + case NCSI:
> #endif
> case BOOTP:
> case CDP:
> --
> 2.35.1
>
Reviewed-by: Ramon Fried
On Mon, Aug 8, 2022 at 9:18 AM Joel Stanley wrote:
>
> On Sat, 6 Aug 2022 at 23:54, Ramon Fried wrote:
> >
> > On Mon, Jul 4, 2022 at 11:20 AM Cédric Le Goater wrote:
> > >
> > > On 7/4/22 09:58, Joel Stanley wrote:
> > > > From: Samuel Mendoza-
On Thu, Jul 14, 2022 at 10:33 AM Sumit Garg wrote:
>
> Currently for all Qcom SoCs/boards there are separate compatibles for
> GPIO and pinctrl. But this is inconsistent with official (upstream) Linux
> bindings which requires only a single compatible "qcom,-pinctrl"
> and there is no such compati
101 - 200 of 1028 matches
Mail list logo