
Hi Shengyu,
On Fri, May 10, 2024 at 8:39 AM Shengyu Qu wiagn233@outlook.com wrote:
Sorry, seems this is a false warning as fdt_fixup_ethernet() would do this.
Best regards
If you need to set a network mac address in U-Boot for an extra network port (i.e. PCIe attached) this may be:
env set eth2addr aa:bb:cc:dd:ee:ff env save
In this example ethaddr is gmac0 from JH7110 CPU via the RPi CM4 connector, and eth1addr is gmac1 from JH7110 CPU but is not accessible on the RPi CM4 connector so disabled by the fdt fixup. The second network port on DFRobot mini router is a realtek rtl8168 on the PCIe bus, so it does not have any mac address. This is how I set its mac address from U-Boot.
I'm not sure if this needs to be said in the documentation. It is extra information that may be helpful but we are not documenting here all the possible carrier boards that can be attached.
-E
在 2024/5/10 23:01, Shengyu Qu 写道:
Btw I didn't have a code path to pass the MAC address to kernel. So does it actually exist?
Best regards, Shengyu
在 2024/5/10 13:52, Heinrich Schuchardt 写道:
We already support the VisionFive 2 and the Milk-V Mars board by patching the VisionFive 2 device tree. With this patch the same is done for the Milk-V Mars CM.
Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com Tested-by: E. Shattow lucent@gmail.com Reviewed-by: E. Shattow lucent@gmail.com
v4: no change v3: no change v2: rename spl_fdt_fixup_marc() to spl_fdt_fixup_mars_cm() rename device-trees for Mars CM and Mars CM Lite change model and compatible properties
board/starfive/visionfive2/spl.c | 28 ++++++++++++++++++- .../visionfive2/starfive_visionfive2.c | 11 +++++++- 2 files changed, 37 insertions(+), 2 deletions(-)
diff --git a/board/starfive/visionfive2/spl.c b/board/starfive/visionfive2/spl.c index ca61b5be227..b555189556a 100644 --- a/board/starfive/visionfive2/spl.c +++ b/board/starfive/visionfive2/spl.c @@ -129,6 +129,30 @@ void spl_fdt_fixup_mars(void *fdt) } } +void spl_fdt_fixup_mars_cm(void *fdt) +{
- const char *compat;
- const char *model;
- spl_fdt_fixup_mars(fdt);
- if (!get_mmc_size_from_eeprom()) {
int offset;
model = "Milk-V Mars CM Lite";
compat = "milkv,mars-cm-lite\0starfive,jh7110";
offset = fdt_path_offset(fdt,
"/soc/pinctrl/mmc0-pins/mmc0-pins-rest");
/* GPIOMUX(22, GPOUT_SYS_SDIO0_RST, GPOEN_ENABLE, GPI_NONE) */
fdt_setprop_u32(fdt, offset, "pinmux", 0xff130016);
- } else {
model = "Milk-V Mars CM";
compat = "milkv,mars-cm\0starfive,jh7110";
- }
- fdt_setprop(fdt, fdt_path_offset(fdt, "/"), "compatible", compat,
sizeof(compat));
- fdt_setprop_string(fdt, fdt_path_offset(fdt, "/"), "model", model);
+}
- void spl_fdt_fixup_version_a(void *fdt) { static const char compat[] =
"starfive,visionfive-2-v1.2a\0starfive,jh7110"; @@ -236,7 +260,9 @@ void spl_perform_fixups(struct spl_image_info *spl_image) pr_err("Can't read EEPROM\n"); return; }
- if (!strncmp(product_id, "MARS", 4)) {
- if (!strncmp(product_id, "MARC", 4)) {
spl_fdt_fixup_mars_cm(spl_image->fdt_addr);
- } else if (!strncmp(product_id, "MARS", 4)) { spl_fdt_fixup_mars(spl_image->fdt_addr); } else if (!strncmp(product_id, "VF7110", 6)) { version = get_pcb_revision_from_eeprom();
diff --git a/board/starfive/visionfive2/starfive_visionfive2.c b/board/starfive/visionfive2/starfive_visionfive2.c index a86bca533b2..6be53489626 100644 --- a/board/starfive/visionfive2/starfive_visionfive2.c +++ b/board/starfive/visionfive2/starfive_visionfive2.c @@ -19,6 +19,10 @@ DECLARE_GLOBAL_DATA_PTR; #define JH7110_L2_PREFETCHER_HART_OFFSET 0x2000 #define FDTFILE_MILK_V_MARS \ "starfive/jh7110-milkv-mars.dtb" +#define FDTFILE_MILK_V_MARS_CM \
- "starfive/jh7110-milkv-mars-cm.dtb"
+#define FDTFILE_MILK_V_MARS_CM_LITE \
- "starfive/jh7110-milkv-mars-cm-lite.dtb" #define FDTFILE_VISIONFIVE2_1_2A \ "starfive/jh7110-starfive-visionfive-2-v1.2a.dtb" #define FDTFILE_VISIONFIVE2_1_3B \
@@ -61,7 +65,12 @@ static void set_fdtfile(void) log_err("Can't read EEPROM\n"); return; }
- if (!strncmp(product_id, "MARS", 4)) {
- if (!strncmp(product_id, "MARC", 4)) {
if (get_mmc_size_from_eeprom())
fdtfile = FDTFILE_MILK_V_MARS_CM;
else
fdtfile = FDTFILE_MILK_V_MARS_CM_LITE;
- } else if (!strncmp(product_id, "MARS", 4)) { fdtfile = FDTFILE_MILK_V_MARS; } else if (!strncmp(product_id, "VF7110", 6)) { version = get_pcb_revision_from_eeprom();