Re: u-boot & ZFS
On Wed, Aug 18, 2021 at 2:26 PM ChrisO wrote: > > On Wed, Aug 18, 2021 at 12:26:11PM +0200, Lukasz Majewski wrote: > > Hi ChrisO, > > > > > On Tue, Aug 17, 2021 at 08:35:14PM -0400, Tom Rini wrote: > > > > On Tue, Aug 17, 2021 at 06:03:10PM +0200, ChrisO wrote: > > > > > > > > > Hi > > > > > > > > > > I searched for u-boot ZFS references and all I found was several > > > > > years old, but I suppose u-boot can cope with ZFS. So, my > > > > > question is: is it possible to boot Linux from ZFS or at least > > > > > boot from let's say SD-card with ext4 FS and mount a ZFS volume > > > > > as root filesystem? I had a look at Armbian, installed all > > > > > needed, user-space and kernel modules. After booting from SD card > > > > > I can use ZFS on attached SATA SSD w/o any problem. I also see > > > > > ZFS libs and kernel modules in initrd, so it looks like the > > > > > necessary things are there. Don't know where to start. I would be > > > > > very thankful for any help. > > > > > > > > The general easy answer is to have /boot that is separate from the > > > > rootfs and using a filesystem more commonly supported. > > > > > > > > -- > > > > Tom > > > > > > Sounds like: go away kid, play with your old toys ;-) > > > I was doing it the traditional way for long time, now wanted to try > > > something new. Isn't it how we progress? I came to this list hoping > > > to get an answer to my question. I know, most of you on this list > > > have more important things to do. But giving me some advice could > > > possibly result in me giving something back. > > > > > > > Similar question I saw on OpenEmbedded/Yocto ML recenly. The answer > > there was that "ZFS or ZOL is _not_ [*] commonly used on embedded > > systems, so no support was needed" > > > > If find this topic interesting, then the community will try to help > > when you provide any patches for review. > > > > However, considering the above, it may be hard for any _exact_ > > guidelines. > > > > > > Note: > > [*] - Personally, I didn't saw any usage of ZFS on embedded systems. > > > > > Thanks, > > > Chris > > > > > > > > > > Best regards, > > > > Lukasz Majewski > > > > -- > > > > DENX Software Engineering GmbH, Managing Director: Wolfgang Denk > > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany > > Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lu...@denx.de > > Hallo Lukasz > > My system in question is not an embeded one. I just stated to play with an > Odroid-HC4 and Armbian. 4GB of RAM sounds way too little for zfs. > It has two SATA connectors, boots from a SD card. > All computer I use which have more than one disk connected are set-up with > software RAID and LVM on top of it. > ZFS has both build-in it's why I asked. > Currently I have on this HC4 two partitions on each disk, the smaller ones > are in RAID1 and host root FS, the bigger ones are in a mirrored Zpool. It > works OK, it would be nicer to have just one filesystem, though. > > Still not sure, it can or cannot be done? > > Thanks and regards, > Chris -- Regards, Dimitri.
Re: [PATCH] qemu-riscv64_smode: fix extlinux (define preboot)
On Mon, Jul 26, 2021 at 8:55 AM Leo Liang wrote: > > Hi Dimitri, > > On Sat, Jul 24, 2021 at 12:12:25AM +0800, Dimitri John Ledkov wrote: > > Commit 37304aaf60bf ("Convert CONFIG_USE_PREBOOT and CONFIG_PREBOOT to > > Kconfig") removed preboot commands in RISC-V targets and broke > > extlinux support as reported by Fu Wei . > > > > The patch finishes migration of CONFIG_USE_PREBOOT and CONFIG_REBOOT > > to Kconfig. > > Could you add a "Fixes" tag and a "Reported-by" tag as suggested by Bin? > done in v2 > > > > Signed-off-by: David Abdurachmanov > > Signed-off-by: Dimitri John Ledkov > > --- > > > > Original patch author is David Abdurachmanov > > > > Previously this was submitted in 2019 > > > > https://patchwork.ozlabs.org/project/uboot/patch/20190821190720.4286-1-david.abdurachma...@sifive.com/ > > > > Since then the sifive fu540 portion of this change was merged, but > > not the qemu one. > > > > Submitting the qemu portion again. Without this change, qemu smode > > cannot boot Ubuntu's riscv64 cloud images with extlinux.conf. > > > > > > configs/qemu-riscv64_smode_defconfig | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/configs/qemu-riscv64_smode_defconfig > > b/configs/qemu-riscv64_smode_defconfig > > index 564e41..cb674c6a75 100644 > > --- a/configs/qemu-riscv64_smode_defconfig > > +++ b/configs/qemu-riscv64_smode_defconfig > > @@ -14,3 +14,5 @@ CONFIG_CMD_NVEDIT_EFI=y > > CONFIG_OF_PRIOR_STAGE=y > > CONFIG_SYS_RELOC_GD_ENV_ADDR=y > > CONFIG_DM_MTD=y > > +CONFIG_USE_PREBOOT=y > > +CONFIG_PREBOOT="setenv fdt_addr ${fdtcontroladdr}; fdt addr > > ${fdtcontroladdr};" > > The config option should be inserted using "make savedefconfig". > > e.g. > $ make menuconfig > choose the config option desired > $ make savedefconfig > $ cp defconfig configs/qemu-riscv64_smode_defconfig > done in v3 > Thanks! > > Best regards, > Leo > > -- > > 2.30.2 > > -- Regards, Dimitri.
[PATCH v3] qemu-riscv64_smode: fix extlinux (define preboot)
Commit 37304aaf60bf ("Convert CONFIG_USE_PREBOOT and CONFIG_PREBOOT to Kconfig") removed preboot commands in RISC-V targets and broke extlinux support as reported by Fu Wei . The patch finishes migration of CONFIG_USE_PREBOOT and CONFIG_REBOOT to Kconfig. Fixes: 37304aaf60bf ("Convert CONFIG_USE_PREBOOT and CONFIG_PREBOOT to Kconfig") Reported-By: Fu Wei Signed-off-by: David Abdurachmanov Signed-off-by: Dimitri John Ledkov --- changes since my v1 patch: - Add reported-by & fixes tags changes since my v2 patch: - use savedefconfig to order defconfig correctly Original patch author is David Abdurachmanov Previously this was submitted in 2019 https://patchwork.ozlabs.org/project/uboot/patch/20190821190720.4286-1-david.abdurachma...@sifive.com/ Since then the sifive fu540 portion of this change was merged, but not the qemu one. Submitting the qemu portion again. Without this change, qemu smode cannot boot Ubuntu's riscv64 cloud images with extlinux.conf. configs/qemu-riscv64_smode_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/qemu-riscv64_smode_defconfig b/configs/qemu-riscv64_smode_defconfig index 564e41..4a6416e254 100644 --- a/configs/qemu-riscv64_smode_defconfig +++ b/configs/qemu-riscv64_smode_defconfig @@ -6,6 +6,8 @@ CONFIG_ARCH_RV64I=y CONFIG_RISCV_SMODE=y CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT=y +CONFIG_USE_PREBOOT=y +CONFIG_PREBOOT="setenv fdt_addr ${fdtcontroladdr}; fdt addr ${fdtcontroladdr};" CONFIG_DISPLAY_CPUINFO=y CONFIG_DISPLAY_BOARDINFO=y CONFIG_CMD_BOOTEFI_SELFTEST=y -- 2.30.2
[PATCH v2] qemu-riscv64_smode: fix extlinux (define preboot)
Commit 37304aaf60bf ("Convert CONFIG_USE_PREBOOT and CONFIG_PREBOOT to Kconfig") removed preboot commands in RISC-V targets and broke extlinux support as reported by Fu Wei . The patch finishes migration of CONFIG_USE_PREBOOT and CONFIG_REBOOT to Kconfig. Fixes: 37304aaf60bf ("Convert CONFIG_USE_PREBOOT and CONFIG_PREBOOT to Kconfig") Reported-By: Fu Wei Signed-off-by: David Abdurachmanov Signed-off-by: Dimitri John Ledkov --- Original patch author is David Abdurachmanov Previously this was submitted in 2019 https://patchwork.ozlabs.org/project/uboot/patch/20190821190720.4286-1-david.abdurachma...@sifive.com/ Since then the sifive fu540 portion of this change was merged, but not the qemu one. Submitting the qemu portion again. Without this change, qemu smode cannot boot Ubuntu's riscv64 cloud images with extlinux.conf. configs/qemu-riscv64_smode_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/qemu-riscv64_smode_defconfig b/configs/qemu-riscv64_smode_defconfig index 564e41..cb674c6a75 100644 --- a/configs/qemu-riscv64_smode_defconfig +++ b/configs/qemu-riscv64_smode_defconfig @@ -14,3 +14,5 @@ CONFIG_CMD_NVEDIT_EFI=y CONFIG_OF_PRIOR_STAGE=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_DM_MTD=y +CONFIG_USE_PREBOOT=y +CONFIG_PREBOOT="setenv fdt_addr ${fdtcontroladdr}; fdt addr ${fdtcontroladdr};" -- 2.30.2
[PATCH] qemu-riscv64_smode: fix extlinux (define preboot)
Commit 37304aaf60bf ("Convert CONFIG_USE_PREBOOT and CONFIG_PREBOOT to Kconfig") removed preboot commands in RISC-V targets and broke extlinux support as reported by Fu Wei . The patch finishes migration of CONFIG_USE_PREBOOT and CONFIG_REBOOT to Kconfig. Signed-off-by: David Abdurachmanov Signed-off-by: Dimitri John Ledkov --- Original patch author is David Abdurachmanov Previously this was submitted in 2019 https://patchwork.ozlabs.org/project/uboot/patch/20190821190720.4286-1-david.abdurachma...@sifive.com/ Since then the sifive fu540 portion of this change was merged, but not the qemu one. Submitting the qemu portion again. Without this change, qemu smode cannot boot Ubuntu's riscv64 cloud images with extlinux.conf. configs/qemu-riscv64_smode_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/qemu-riscv64_smode_defconfig b/configs/qemu-riscv64_smode_defconfig index 564e41..cb674c6a75 100644 --- a/configs/qemu-riscv64_smode_defconfig +++ b/configs/qemu-riscv64_smode_defconfig @@ -14,3 +14,5 @@ CONFIG_CMD_NVEDIT_EFI=y CONFIG_OF_PRIOR_STAGE=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_DM_MTD=y +CONFIG_USE_PREBOOT=y +CONFIG_PREBOOT="setenv fdt_addr ${fdtcontroladdr}; fdt addr ${fdtcontroladdr};" -- 2.30.2
[PATCH v2] riscv: sifive: Set default fdtfile names
Set default fdtfile names for unleashed and unmatched boards, as used in the upstream Linux kernel. This allows sysboot command to find and load appropriate dtb for the matching kernel from universal stock Ubuntu RISC-V rootfs images based on fdtdir setting in extlinux.conf. Signed-off-by: Dimitri John Ledkov Reviewed-by: Leo Yu-Chi Liang Reviewed-by: Bin Meng cc: Paul Walmsley cc: Palmer Dabbelt cc: Anup Patel cc: Atish Patra cc: Pragnesh Patel cc: Green Wan --- Changes since v1: In commit message, removed trailing '.' and added hyphen in RISC-V. Added two reviewed-bys. configs/sifive_unleashed_defconfig | 1 + configs/sifive_unmatched_defconfig | 1 + include/configs/sifive-unleashed.h | 1 + include/configs/sifive-unmatched.h | 1 + 4 files changed, 4 insertions(+) diff --git a/configs/sifive_unleashed_defconfig b/configs/sifive_unleashed_defconfig index 62416a7c1d..7ef0e4b241 100644 --- a/configs/sifive_unleashed_defconfig +++ b/configs/sifive_unleashed_defconfig @@ -14,6 +14,7 @@ CONFIG_RISCV_SMODE=y CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT=y CONFIG_SPL_LOAD_FIT_ADDRESS=0x8400 +CONFIG_DEFAULT_FDT_FILE="sifive/hifive-unleashed-a00.dtb" CONFIG_DISPLAY_CPUINFO=y CONFIG_DISPLAY_BOARDINFO=y CONFIG_MISC_INIT_R=y diff --git a/configs/sifive_unmatched_defconfig b/configs/sifive_unmatched_defconfig index 01ca2d8c23..66e9a23ee4 100644 --- a/configs/sifive_unmatched_defconfig +++ b/configs/sifive_unmatched_defconfig @@ -14,6 +14,7 @@ CONFIG_RISCV_SMODE=y CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT=y CONFIG_SPL_LOAD_FIT_ADDRESS=0x8400 +CONFIG_DEFAULT_FDT_FILE="sifive/hifive-unmatched-a00.dtb" CONFIG_DISPLAY_CPUINFO=y CONFIG_DISPLAY_BOARDINFO=y CONFIG_DISPLAY_BOARDINFO_LATE=y diff --git a/include/configs/sifive-unleashed.h b/include/configs/sifive-unleashed.h index 0d69d1c548..b6c29f8c60 100644 --- a/include/configs/sifive-unleashed.h +++ b/include/configs/sifive-unleashed.h @@ -75,6 +75,7 @@ "type_guid_gpt_loader2=" TYPE_GUID_LOADER2 "\0" \ "type_guid_gpt_system=" TYPE_GUID_SYSTEM "\0" \ "partitions=" PARTS_DEFAULT "\0" \ + "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ BOOTENV \ BOOTENV_SF diff --git a/include/configs/sifive-unmatched.h b/include/configs/sifive-unmatched.h index 4fad69bb19..80cfd41ceb 100644 --- a/include/configs/sifive-unmatched.h +++ b/include/configs/sifive-unmatched.h @@ -73,6 +73,7 @@ "type_guid_gpt_loader2=" TYPE_GUID_LOADER2 "\0" \ "type_guid_gpt_system=" TYPE_GUID_SYSTEM "\0" \ "partitions=" PARTS_DEFAULT "\0" \ + "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ BOOTENV #define CONFIG_PREBOOT \ -- 2.27.0
[PATCH] riscv: sifive: Set default fdtfile names.
Set default fdtfile names for unleashed and unmatched boards, as used in the upstream Linux kernel. This allows sysboot command to find and load appropriate dtb for the matching kernel from universal stock Ubuntu RISCV rootfs images based on fdtdir setting in extlinux.conf. Signed-off-by: Dimitri John Ledkov cc: Paul Walmsley cc: Palmer Dabbelt cc: Anup Patel cc: Atish Patra cc: Pragnesh Patel cc: Green Wan --- configs/sifive_unleashed_defconfig | 1 + configs/sifive_unmatched_defconfig | 1 + include/configs/sifive-unleashed.h | 1 + include/configs/sifive-unmatched.h | 1 + 4 files changed, 4 insertions(+) diff --git a/configs/sifive_unleashed_defconfig b/configs/sifive_unleashed_defconfig index 62416a7c1d..7ef0e4b241 100644 --- a/configs/sifive_unleashed_defconfig +++ b/configs/sifive_unleashed_defconfig @@ -14,6 +14,7 @@ CONFIG_RISCV_SMODE=y CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT=y CONFIG_SPL_LOAD_FIT_ADDRESS=0x8400 +CONFIG_DEFAULT_FDT_FILE="sifive/hifive-unleashed-a00.dtb" CONFIG_DISPLAY_CPUINFO=y CONFIG_DISPLAY_BOARDINFO=y CONFIG_MISC_INIT_R=y diff --git a/configs/sifive_unmatched_defconfig b/configs/sifive_unmatched_defconfig index 01ca2d8c23..66e9a23ee4 100644 --- a/configs/sifive_unmatched_defconfig +++ b/configs/sifive_unmatched_defconfig @@ -14,6 +14,7 @@ CONFIG_RISCV_SMODE=y CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT=y CONFIG_SPL_LOAD_FIT_ADDRESS=0x8400 +CONFIG_DEFAULT_FDT_FILE="sifive/hifive-unmatched-a00.dtb" CONFIG_DISPLAY_CPUINFO=y CONFIG_DISPLAY_BOARDINFO=y CONFIG_DISPLAY_BOARDINFO_LATE=y diff --git a/include/configs/sifive-unleashed.h b/include/configs/sifive-unleashed.h index 0d69d1c548..b6c29f8c60 100644 --- a/include/configs/sifive-unleashed.h +++ b/include/configs/sifive-unleashed.h @@ -75,6 +75,7 @@ "type_guid_gpt_loader2=" TYPE_GUID_LOADER2 "\0" \ "type_guid_gpt_system=" TYPE_GUID_SYSTEM "\0" \ "partitions=" PARTS_DEFAULT "\0" \ + "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ BOOTENV \ BOOTENV_SF diff --git a/include/configs/sifive-unmatched.h b/include/configs/sifive-unmatched.h index 4fad69bb19..80cfd41ceb 100644 --- a/include/configs/sifive-unmatched.h +++ b/include/configs/sifive-unmatched.h @@ -73,6 +73,7 @@ "type_guid_gpt_loader2=" TYPE_GUID_LOADER2 "\0" \ "type_guid_gpt_system=" TYPE_GUID_SYSTEM "\0" \ "partitions=" PARTS_DEFAULT "\0" \ + "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ BOOTENV #define CONFIG_PREBOOT \ -- 2.27.0
Re: [PATCH] cmd: pxe_utils: sysboot: fix crash if either board or soc are not set.
Hi, this patch is still not pulled into master. It still applies cleanly onto master. Can this patch please be pulled in? It fixes a crash of uboot. Without this patch upstream, people who build their own uboot cannot boot stock Ubuntu images. What can I do, for this patch to be applied? On Sat, May 8, 2021 at 7:23 AM Ramon Fried wrote: > > On Wed, Apr 21, 2021 at 5:32 PM Dimitri John Ledkov wrote: > > > > If the environment does not have "soc" or "board" set, and fdtdir > > option is specified in extlinux.conf, the bootloader will crash whilst > > dereferencing a null pointer. Add a guard against null soc or > > board. Fixes a crash of qemu-riscv64_smode configuration, which does > > not have CONFIG_SYS_SOC defined. > > > > Signed-off-by: Dimitri John Ledkov > > --- > > cmd/pxe_utils.c | 8 > > 1 file changed, 8 insertions(+) > > > > diff --git a/cmd/pxe_utils.c b/cmd/pxe_utils.c > > index 71c5af4c25..9a30629e26 100644 > > --- a/cmd/pxe_utils.c > > +++ b/cmd/pxe_utils.c > > @@ -587,6 +587,14 @@ static int label_boot(struct cmd_tbl *cmdtp, struct > > pxe_label *label) > > f2 = "-"; > > f3 = env_get("board"); > > f4 = ".dtb"; > > + if (!f1) { > > + f1 = ""; > > + f2 = ""; > > + } > > + if (!f3) { > > + f2 = ""; > > + f3 = ""; > > + } > > } > > > > len = strlen(label->fdtdir); > > -- > > 2.27.0 > > > Reviewed-by: Ramon Fried -- Regards, Dimitri.
Re: [PULL] u-boot-riscv/master
Hi, On Fri, May 7, 2021 at 2:42 AM Leo Liang wrote: > > On Fri, May 07, 2021 at 09:09:43AM +0800, Tom Rini wrote: > > On Fri, May 07, 2021 at 09:06:33AM +0800, Leo Liang wrote: > > > > > Hi Tom, > > > > > > CI result: > > > https://source.denx.de/u-boot/custodians/u-boot-riscv/-/pipelines/7400 > > > > > > The following changes since commit > > > 8ddaf943589756442bba21e5be645cd47526d82b: > > > > > > Merge tag 'dm-pull-29apr21' of > > > https://source.denx.de/u-boot/custodians/u-boot-dm (2021-04-29 21:03:38 > > > -0400) > > > > > > are available in the Git repository at: > > > > > > https://source.denx.de/u-boot/custodians/u-boot-riscv.git > > > > > > for you to fetch changes up to 91e4b7516d84cefab7324765b3c8d6a909185ce2: > > > > > > cmd/exception: support ebreak exception on RISC-V (2021-05-05 16:13:12 > > > +0800) > > > > > > > > > Dylan Jhong (1): > > > atcspi200: Add timeout mechanism in spi_xfer() > > > > > > Green Wan (2): > > > riscv: cpu: Add callback to init each core > > > riscv: cpu: fu740: clear feature disable CSR > > > > > > Heinrich Schuchardt (1): > > > cmd/exception: support ebreak exception on RISC-V > > > > > > arch/riscv/cpu/cpu.c| 11 +++ > > > arch/riscv/cpu/fu540/spl.c | 15 +++ > > > arch/riscv/cpu/start.S | 4 > > > cmd/riscv/exception.c | 10 ++ > > > doc/usage/exception.rst | 3 +++ > > > drivers/spi/atcspi200_spi.c | 10 -- > > > 6 files changed, 51 insertions(+), 2 deletions(-) > > > > Please note that currently > > https://patchwork.ozlabs.org/project/uboot/list/?series=&submitter=&state=&q=&archive=&delegate=20174 > > shows 55 patches. Most of them have been posted long enough that I > > would expect them to be applied if there's no further feedback. Can you > > please take a look? Thanks! > > > > No problem, sorry for the delay! > > Two quick questions. > > Some of the patches delegated to Andes do not own a RISC-V tag but rather clk > or driver etc. > Do you mind if we pull them through RISC-V tree? > > And for these patches, > do you prefer them pulled into this release or for-next branch? Although https://patchwork.ozlabs.org/project/uboot/patch/20210421114201.57994-1-x...@ubuntu.com/ is not strictly for riscv64 it does prevent me from using the same Ubuntu rootfs for riscv boards or qemu. I would appreciate it if it could be pulled in via qemu or riscv maintainers. -- Regards, Dimitri.
Re: [PATCH v7 8/8] drivers: net: macb: add fu740 support
On Wed, May 5, 2021 at 4:15 AM Green Wan wrote: > > Hi Dimitri, > > Thanks for looking into this. > > On Tue, May 4, 2021 at 5:33 PM Dimitri John Ledkov > wrote: > > > > Hi, > > > > On Thu, Apr 22, 2021 at 10:15 AM Green Wan wrote: > > > > > > From: David Abdurachmanov > > > > > > Add fu740 support to macb ethernet driver > > > > > > There is a PLL HW quirk in FU740. The VSC8541XMV-02 specification > > > requires 125 +/-0.0125 Mhz. But the most close value can be output > > > by PLL is 125.125 MHz and out of VSC8541XMV-02 spec. > > > > > > > In the Linux kernel driver for this > > drivers/net/ethernet/cadence/macb_main.c it is not marked as > > compatible with "sifive,fu740-c000-gem" and it does not have a similar > > fix (and appears to use 125.0 MHz). > > Should a similar fix be contributed to the Linux kernel? > > You're right. We also notice some refinement should be made here. > We're working on the way to solve it. > > > > > As otherwise at the moment, one cannot pass the dtb from u-boot to > > linux, as that leads to loss of network since the kernel doesn't know > > about "sifive,fu740-c000-gem". If linux kernel contribution is not > > forthcoming, would it be possible to have u-boot dtb to be compatible > > with _both_ "sifive,fu540-c000-gem" and "sifive,fu740-c000-gem" on > > unmatched boards, such that if one (mistakenly) uses u-boots dtb with > > vanilla linux kernel networking still works? And then adjust the test > > to check for "sifive,fu740-c000-gem" compatible string first. > > > > Not sure whether I get it correct. I think the best case is to have > Linux driver support both compatible string. That is my desired outcome too. Please just do that. > And I'm a bit reluctant > to handle incorrect DTB passed situations. It might end up with > propagating issues and harder to trace back the root cause. I'll check > with colleagues and see if we can resolve that concern. > Writing / handling / handing-over incorrect DTB is not nice. > Thanks, > > > > Signed-off-by: David Abdurachmanov > > > Signed-off-by: Green Wan > > > Reviewed-by: Ramon Fried > > > Reviewed-by: Bin Meng > > > --- > > > drivers/net/macb.c | 13 - > > > 1 file changed, 12 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/net/macb.c b/drivers/net/macb.c > > > index 57ea45e2dc..bf70525c54 100644 > > > --- a/drivers/net/macb.c > > > +++ b/drivers/net/macb.c > > > @@ -591,8 +591,17 @@ static int macb_sifive_clk_init(struct udevice *dev, > > > ulong rate) > > > * 0 = GMII mode. Use 125 MHz gemgxlclk from PRCI in TX logic > > > * and output clock on GMII output signal GTX_CLK > > > * 1 = MII mode. Use MII input signal TX_CLK in TX logic > > > +* > > > +* FU740 have a PLL HW quirk. The 125.125 Mhz is actually out of > > > +* VSC8541XMV-02 specification. The tolerance level is +/-100ppm. > > > +* Which means the range should be in between 125MHz +/-0.0125. > > > +* But the most close value can be output by PLL is 125.125 MHz. > > > */ > > > - writel(rate != 12500, gemgxl_regs); > > > + if (device_is_compatible(dev, "sifive,fu540-c000-gem")) > > > + writel(rate != 12500, gemgxl_regs); > > > + else if (device_is_compatible(dev, "sifive,fu740-c000-gem")) > > > + writel(rate != 125125000, gemgxl_regs); > > > + > > > return 0; > > > } > > > > > > @@ -1507,6 +1516,8 @@ static const struct udevice_id macb_eth_ids[] = { > > > { .compatible = "cdns,zynq-gem" }, > > > { .compatible = "sifive,fu540-c000-gem", > > > .data = (ulong)&sifive_config }, > > > + { .compatible = "sifive,fu740-c000-gem", > > > + .data = (ulong)&sifive_config }, > > > { .compatible = "microchip,mpfs-mss-gem", > > > .data = (ulong)µchip_config }, > > > { } > > > -- > > > 2.31.0 > > > > > > > > > -- > > Regards, > > > > Dimitri. -- Regards, Dimitri.
Re: [PATCH] cmd: pxe_utils: sysboot: fix crash if either board or soc are not set.
Hi qemu-board meaintainers, The below patch affects any boards that do not have either board or soc variables set. Of which non-x86 qemu boards are exactly that, preventing to netboot the same rootfs across multiple boards and qemu at the same time. Another alternative would be for all non-x86 qemu boards to also define config SYS_SOC default "qemu" However, I fear similar situation might still arise in the future where some boards lack either SYS_BOARD or SYS_SOC definitions. Thus even if non-qemu boards are fixed up, the below should still be applied? Do you want me to send a separate patch to add SYS_SOC to all qemu boards? On Wed, Apr 21, 2021 at 3:32 PM Dimitri John Ledkov wrote: > > If the environment does not have "soc" or "board" set, and fdtdir > option is specified in extlinux.conf, the bootloader will crash whilst > dereferencing a null pointer. Add a guard against null soc or > board. Fixes a crash of qemu-riscv64_smode configuration, which does > not have CONFIG_SYS_SOC defined. > > Signed-off-by: Dimitri John Ledkov > --- > cmd/pxe_utils.c | 8 > 1 file changed, 8 insertions(+) > > diff --git a/cmd/pxe_utils.c b/cmd/pxe_utils.c > index 71c5af4c25..9a30629e26 100644 > --- a/cmd/pxe_utils.c > +++ b/cmd/pxe_utils.c > @@ -587,6 +587,14 @@ static int label_boot(struct cmd_tbl *cmdtp, struct > pxe_label *label) > f2 = "-"; > f3 = env_get("board"); > f4 = ".dtb"; > + if (!f1) { > + f1 = ""; > + f2 = ""; > + } > + if (!f3) { > + f2 = ""; > + f3 = ""; > + } > } > > len = strlen(label->fdtdir); > -- > 2.27.0 > -- Regards, Dimitri.
Re: [PATCH v7 2/8] drivers: clk: add fu740 support
(resending to the list after subscribing) Hi, On Thu, Apr 22, 2021 at 10:15 AM Green Wan wrote: > > Add fu740 support. One abstract layer is added for supporting > multiple chips such as fu540 and fu740. > > Signed-off-by: Green Wan > --- > drivers/clk/sifive/Kconfig | 8 +- > drivers/clk/sifive/Makefile | 4 +- > drivers/clk/sifive/fu540-prci.c | 769 +-- > drivers/clk/sifive/fu540-prci.h | 22 + > drivers/clk/sifive/fu740-prci.c | 158 +++ > drivers/clk/sifive/fu740-prci.h | 22 + > drivers/clk/sifive/sifive-prci.c | 733 + > drivers/clk/sifive/sifive-prci.h | 323 + > 8 files changed, 1286 insertions(+), 753 deletions(-) > create mode 100644 drivers/clk/sifive/fu540-prci.h > create mode 100644 drivers/clk/sifive/fu740-prci.c > create mode 100644 drivers/clk/sifive/fu740-prci.h > create mode 100644 drivers/clk/sifive/sifive-prci.c > create mode 100644 drivers/clk/sifive/sifive-prci.h > > diff --git a/drivers/clk/sifive/Kconfig b/drivers/clk/sifive/Kconfig > index c4d0a1f9b1..20fc004b59 100644 > --- a/drivers/clk/sifive/Kconfig > +++ b/drivers/clk/sifive/Kconfig > @@ -6,11 +6,11 @@ config CLK_SIFIVE > help > SoC drivers for SiFive Linux-capable SoCs. > > -config CLK_SIFIVE_FU540_PRCI > - bool "PRCI driver for SiFive FU540 SoCs" > +config CLK_SIFIVE_PRCI > + bool "PRCI driver for SiFive SoCs" > depends on CLK_SIFIVE Since the above is done in this patch, I would expect to remove all references to the CLK_SIFIVE_FU540_PRCI config option at the same time. Specifically: $ git grep CLK_SIFIVE_FU540_PRCI arch/riscv/cpu/fu540/Kconfig: imply CLK_SIFIVE_FU540_PRCI drivers/reset/Kconfig: depends on DM_RESET && CLK_SIFIVE_FU540_PRCI && TARGET_SIFIVE_UNLEASHED If above references were fixed, it remove the need to manually add "CONFIG_CLK_SIFIVE_PRCI=y" to unleashed config in the "board: sifive: add HiFive Unmatched board support" patch. Leaving left over references to the removed config options is confusing, and makes the patch not self contained. > select CLK_ANALOGBITS_WRPLL_CLN28HPC > help > Supports the Power Reset Clock interface (PRCI) IP block found in > - FU540 SoCs. If this kernel is meant to run on a SiFive FU540 SoC, > - enable this driver. > + FU540/FU740 SoCs. If this kernel is meant to run on a SiFive FU540/ > + FU740 SoCs, enable this driver. > diff --git a/drivers/clk/sifive/Makefile b/drivers/clk/sifive/Makefile > index b224279afb..51348b1ddc 100644 > --- a/drivers/clk/sifive/Makefile > +++ b/drivers/clk/sifive/Makefile > @@ -1,3 +1,5 @@ > # SPDX-License-Identifier: GPL-2.0+ > > -obj-$(CONFIG_CLK_SIFIVE_FU540_PRCI)+= fu540-prci.o > +obj-y += sifive-prci.o > + > +obj-$(CONFIG_CLK_SIFIVE_PRCI) += fu540-prci.o fu740-prci.o > diff --git a/drivers/clk/sifive/fu540-prci.c b/drivers/clk/sifive/fu540-prci.c > index b3882d0b77..ceb2c6fab0 100644 > --- a/drivers/clk/sifive/fu540-prci.c > +++ b/drivers/clk/sifive/fu540-prci.c > @@ -5,6 +5,8 @@ > * Copyright (C) 2018 SiFive, Inc. > * Wesley Terpstra > * Paul Walmsley > + * Zong Li > + * Pragnesh Patel > * > * This program is free software; you can redistribute it and/or modify > * it under the terms of the GNU General Public License version 2 as > @@ -15,632 +17,48 @@ > * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > * GNU General Public License for more details. > * > - * The FU540 PRCI implements clock and reset control for the SiFive > - * FU540-C000 chip. This driver assumes that it has sole control > - * over all PRCI resources. > - * > - * This driver is based on the PRCI driver written by Wesley Terpstra. > - * > - * Refer, commit 999529edf517ed75b56659d456d221b2ee56bb60 of: > - * https://github.com/riscv/riscv-linux > - * > * References: > * - SiFive FU540-C000 manual v1p0, Chapter 7 "Clocking and Reset" > */ > > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > #include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > - > -/* > - * EXPECTED_CLK_PARENT_COUNT: how many parent clocks this driver expects: > - * hfclk and rtcclk > - */ > -#define EXPECTED_CLK_PARENT_COUNT 2 > - > -/* > - * Register offsets and bitmasks > - */ > - > -/* COREPLLCFG0 */ > -#define PRCI_COREPLLCFG0_OFFSET0x4 > -#define PRCI_COREPLLCFG0_DIVR_SHIFT0 > -#define PRCI_COREPLLCFG0_DIVR_MASK (0x3f << PRCI_COREPLLCFG0_DIVR_SHIFT) > -#define PRCI_COREPLLCFG0_DIVF_SHIFT6 > -#define PRCI_COREPLLCFG0_DIVF_MASK (0x1ff << PRCI_COREPLLCFG0_DIVF_SHIFT) > -#define PRCI_COREPLLCFG0_DIVQ_SHIFT15 > -#define PRCI_COREPLLCFG0_DIVQ_MASK (0x7 << PRCI_COREPLLCFG0_DIVQ_SHIFT) > -#define PRCI_COREPLLCFG0_RANGE_SHIFT 18 > -#define PRCI_COREPLLCFG0_RANGE_MASK(0x7 << PR
Re: [PATCH v7 1/8] riscv: cpu: fu740: Add support for cpu fu740
(resending to the list after subscribing) Hi, On Thu, Apr 22, 2021 at 10:14 AM Green Wan wrote: > > Add SiFive fu740 cpu to support RISC-V arch > > Signed-off-by: Green Wan > Reviewed-by: Bin Meng > --- > arch/riscv/Kconfig| 1 + > arch/riscv/cpu/fu740/Kconfig | 37 +++ > arch/riscv/cpu/fu740/Makefile | 12 + > arch/riscv/cpu/fu740/cache.c | 55 +++ > arch/riscv/cpu/fu740/cpu.c| 22 + > arch/riscv/cpu/fu740/dram.c | 38 > arch/riscv/cpu/fu740/spl.c| 23 ++ > arch/riscv/include/asm/arch-fu740/cache.h | 14 ++ > arch/riscv/include/asm/arch-fu740/clk.h | 14 ++ > arch/riscv/include/asm/arch-fu740/gpio.h | 38 > arch/riscv/include/asm/arch-fu740/reset.h | 13 ++ > arch/riscv/include/asm/arch-fu740/spl.h | 14 ++ > arch/riscv/lib/sifive_clint.c | 1 - > 13 files changed, 281 insertions(+), 1 deletion(-) > create mode 100644 arch/riscv/cpu/fu740/Kconfig > create mode 100644 arch/riscv/cpu/fu740/Makefile > create mode 100644 arch/riscv/cpu/fu740/cache.c > create mode 100644 arch/riscv/cpu/fu740/cpu.c > create mode 100644 arch/riscv/cpu/fu740/dram.c > create mode 100644 arch/riscv/cpu/fu740/spl.c > create mode 100644 arch/riscv/include/asm/arch-fu740/cache.h > create mode 100644 arch/riscv/include/asm/arch-fu740/clk.h > create mode 100644 arch/riscv/include/asm/arch-fu740/gpio.h > create mode 100644 arch/riscv/include/asm/arch-fu740/reset.h > create mode 100644 arch/riscv/include/asm/arch-fu740/spl.h > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > index 3f221dccdb..4177253e44 100644 > --- a/arch/riscv/Kconfig > +++ b/arch/riscv/Kconfig > @@ -61,6 +61,7 @@ source "board/sipeed/maix/Kconfig" > # platform-specific options below > source "arch/riscv/cpu/ax25/Kconfig" > source "arch/riscv/cpu/fu540/Kconfig" > +source "arch/riscv/cpu/fu740/Kconfig" > source "arch/riscv/cpu/generic/Kconfig" > > # architecture-specific options below > diff --git a/arch/riscv/cpu/fu740/Kconfig b/arch/riscv/cpu/fu740/Kconfig > new file mode 100644 > index 00..24788beab1 > --- /dev/null > +++ b/arch/riscv/cpu/fu740/Kconfig > @@ -0,0 +1,37 @@ > +# SPDX-License-Identifier: GPL-2.0+ > +# > +# Copyright (C) 2020-2021 SiFive, Inc > +# Pragnesh Patel > + > +config SIFIVE_FU740 > + bool > + select ARCH_EARLY_INIT_R > + select RAM > + select SPL_RAM if SPL > + imply CPU > + imply CPU_RISCV > + imply RISCV_TIMER if (RISCV_SMODE || SPL_RISCV_SMODE) > + imply SIFIVE_CLINT if (RISCV_MMODE || SPL_RISCV_MMODE) > + imply CMD_CPU > + imply SPL_CPU > + imply SPL_OPENSBI > + imply SPL_LOAD_FIT > + imply SMP > + imply CLK_SIFIVE > + imply CLK_SIFIVE_PRCI > + imply SIFIVE_SERIAL > + imply MACB > + imply MII > + imply SPI > + imply SPI_SIFIVE > + imply MMC > + imply MMC_SPI > + imply MMC_BROKEN_CD > + imply CMD_MMC > + imply DM_GPIO > + imply SIFIVE_GPIO > + imply CMD_GPIO > + imply MISC > + imply SIFIVE_OTP > + imply DM_PWM > + imply PWM_SIFIVE > diff --git a/arch/riscv/cpu/fu740/Makefile b/arch/riscv/cpu/fu740/Makefile > new file mode 100644 > index 00..5ef8ac18a7 > --- /dev/null > +++ b/arch/riscv/cpu/fu740/Makefile > @@ -0,0 +1,12 @@ > +# SPDX-License-Identifier: GPL-2.0+ > +# > +# Copyright (C) 2020-2021 SiFive, Inc > +# Pragnesh Patel > + > +ifeq ($(CONFIG_SPL_BUILD),y) > +obj-y += spl.o > +else > +obj-y += dram.o > +obj-y += cpu.o > +obj-y += cache.o > +endif > diff --git a/arch/riscv/cpu/fu740/cache.c b/arch/riscv/cpu/fu740/cache.c > new file mode 100644 > index 00..680955c9e3 > --- /dev/null > +++ b/arch/riscv/cpu/fu740/cache.c > @@ -0,0 +1,55 @@ > +// SPDX-License-Identifier: GPL-2.0+ > +/* > + * Copyright (C) 2020-2021 SiFive, Inc > + * > + * Authors: > + * Pragnesh Patel > + */ > + > +#include > +#include > +#include > +#include > + > +/* Register offsets */ > +#define L2_CACHE_CONFIG0x000 > +#define L2_CACHE_ENABLE0x008 > + > +#define MASK_NUM_WAYS GENMASK(15, 8) > +#define NUM_WAYS_SHIFT 8 > + > +DECLARE_GLOBAL_DATA_PTR; > + > +int cache_enable_ways(void) > +{ > + const void *blob = gd->fdt_blob; > + int node; > + fdt_addr_t base; > + u32 config; > + u32 ways; > + > + volatile u32 *enable; > + > + node = fdt_node_offset_by_compatible(blob, -1, > +"sifive,fu740-c000-ccache"); > + > + if (node < 0) > + return node; > + > + base = fdtdec_get_addr_size_auto_parent(blob, 0, node, "reg", 0, > + NULL, false); > + if (base == FDT_ADDR_T_NONE) > + return FDT_ADDR_T_NONE; > + > + config =
Re: [PATCH v7 8/8] drivers: net: macb: add fu740 support
(resending to list after subscribing) Hi, On Thu, Apr 22, 2021 at 10:15 AM Green Wan wrote: > > From: David Abdurachmanov > > Add fu740 support to macb ethernet driver > > There is a PLL HW quirk in FU740. The VSC8541XMV-02 specification > requires 125 +/-0.0125 Mhz. But the most close value can be output > by PLL is 125.125 MHz and out of VSC8541XMV-02 spec. > In the Linux kernel driver for this drivers/net/ethernet/cadence/macb_main.c it is not marked as compatible with "sifive,fu740-c000-gem" and it does not have a similar fix (and appears to use 125.0 MHz). Should a similar fix be contributed to the Linux kernel? As otherwise at the moment, one cannot pass the dtb from u-boot to linux, as that leads to loss of network since the kernel doesn't know about "sifive,fu740-c000-gem". If linux kernel contribution is not forthcoming, would it be possible to have u-boot dtb to be compatible with _both_ "sifive,fu540-c000-gem" and "sifive,fu740-c000-gem" on unmatched boards, such that if one (mistakenly) uses u-boots dtb with vanilla linux kernel networking still works? And then adjust the test to check for "sifive,fu740-c000-gem" compatible string first. > Signed-off-by: David Abdurachmanov > Signed-off-by: Green Wan > Reviewed-by: Ramon Fried > Reviewed-by: Bin Meng > --- > drivers/net/macb.c | 13 - > 1 file changed, 12 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/macb.c b/drivers/net/macb.c > index 57ea45e2dc..bf70525c54 100644 > --- a/drivers/net/macb.c > +++ b/drivers/net/macb.c > @@ -591,8 +591,17 @@ static int macb_sifive_clk_init(struct udevice *dev, > ulong rate) > * 0 = GMII mode. Use 125 MHz gemgxlclk from PRCI in TX logic > * and output clock on GMII output signal GTX_CLK > * 1 = MII mode. Use MII input signal TX_CLK in TX logic > +* > +* FU740 have a PLL HW quirk. The 125.125 Mhz is actually out of > +* VSC8541XMV-02 specification. The tolerance level is +/-100ppm. > +* Which means the range should be in between 125MHz +/-0.0125. > +* But the most close value can be output by PLL is 125.125 MHz. > */ > - writel(rate != 12500, gemgxl_regs); > + if (device_is_compatible(dev, "sifive,fu540-c000-gem")) > + writel(rate != 12500, gemgxl_regs); > + else if (device_is_compatible(dev, "sifive,fu740-c000-gem")) > + writel(rate != 125125000, gemgxl_regs); > + > return 0; > } > > @@ -1507,6 +1516,8 @@ static const struct udevice_id macb_eth_ids[] = { > { .compatible = "cdns,zynq-gem" }, > { .compatible = "sifive,fu540-c000-gem", > .data = (ulong)&sifive_config }, > + { .compatible = "sifive,fu740-c000-gem", > + .data = (ulong)&sifive_config }, > { .compatible = "microchip,mpfs-mss-gem", > .data = (ulong)µchip_config }, > { } > -- > 2.31.0 > -- Regards, Dimitri. -- Regards, Dimitri.
[PATCH] cmd: pxe_utils: sysboot: fix crash if either board or soc are not set.
If the environment does not have "soc" or "board" set, and fdtdir option is specified in extlinux.conf, the bootloader will crash whilst dereferencing a null pointer. Add a guard against null soc or board. Fixes a crash of qemu-riscv64_smode configuration, which does not have CONFIG_SYS_SOC defined. Signed-off-by: Dimitri John Ledkov --- cmd/pxe_utils.c | 8 1 file changed, 8 insertions(+) diff --git a/cmd/pxe_utils.c b/cmd/pxe_utils.c index 71c5af4c25..9a30629e26 100644 --- a/cmd/pxe_utils.c +++ b/cmd/pxe_utils.c @@ -587,6 +587,14 @@ static int label_boot(struct cmd_tbl *cmdtp, struct pxe_label *label) f2 = "-"; f3 = env_get("board"); f4 = ".dtb"; + if (!f1) { + f1 = ""; + f2 = ""; + } + if (!f3) { + f2 = ""; + f3 = ""; + } } len = strlen(label->fdtdir); -- 2.27.0