Git Product home page Git Product logo

Comments (11)

strlcat avatar strlcat commented on July 26, 2024 8

Hi,
If anyone still experience this type of bug even with updated softwares, this is what I was adviced to do when fixed mine:

  1. Decompile your source dtb:
    cd /tmp; dtc -I dtb -O dts /sys/firmware/fdt -o vf2.dts # on system booted up, or place path to your dtb in place of /sys/firmware/fdt. Ignore any warnings it produces. If dtc tool is not installed, try installing it: apt install device-tree-compiler or how dtc is named in your distro. Alternatively, dtc from Linux kernel tree also can be used (you have to run make menuconfig first to produce executable).
  2. Edit vf2.dts: Find section which starts with memory@4. Your line of interest is reg = <0x00 0x40000000 0x01 0x00>; or reg = <0x00 0x40000000 0x1 0x00>;. You shall replace it with reg = <0x00 0x40000000 0x02 0x00>;. Notice 0x02 and not 0x01.
  3. Compile file back: dtc -I dts -O dtb -o /boot/dtbs/starfive/vf2.dtb vf2.dts. Again, if no errors and only warnings, you're good to go.
  4. Boot with modified vf2.dtb: in U-Boot prompt you might want to setenv fdtfile starfive/vf2.dtb followed by saveenv. YMMV.

It worked fine for me this way.

from visionfive2.

jrtc27 avatar jrtc27 commented on July 26, 2024 1

The problem is visionfive2_mem_set is only run for bootcmd_distro (which AFAICT nothing actually runs, since boot_targets its "mmc0 dhcp") via set_fdt_distro. Neither bootcmd_mmc0 nor bootcmd_dhcp call it.

The whole set of U-Boot scripts seems like a mess. Hopefully upstreaming cleans this up to be sane (and adds both USB and PCIe support...).

from visionfive2.

dtometzki avatar dtometzki commented on July 26, 2024

Hello @electrorys

you are correct the default U-boot env. has an issue with the correct RAM size.

from visionfive2.

antoinecarme avatar antoinecarme commented on July 26, 2024

@electrorys @dtometzki

Is there a quick fix for this until the next debian image release ?

from visionfive2.

dtometzki avatar dtometzki commented on July 26, 2024

Hello,

with an update of u-boot and opensbi and the new Debian Image 69 the issue is solved.

from visionfive2.

antoinecarme avatar antoinecarme commented on July 26, 2024

@dtometzki

Thanks for your answer.

With u-boot and opensbi updated (flashcp x 2) and the minimal Debian Image 69, I only see 4GB.

Is there a u-boot parameter I can set manually ?

from visionfive2.

dtometzki avatar dtometzki commented on July 26, 2024

Hello,

do you used the both files from here to flash https://github.com/starfive-tech/VisionFive2/releases/tag/VF2_v2.5.0 ?

from visionfive2.

antoinecarme avatar antoinecarme commented on July 26, 2024

Yes.

from visionfive2.

antoinecarme avatar antoinecarme commented on July 26, 2024

@electrorys

Excellent. It works!!! Decompiling and recompiling the dtb file was enough. I now see 8GB instead of 4GB.

Thank you so much.

from visionfive2.

MichaIng avatar MichaIng commented on July 26, 2024

You need a 3rd FAT boot partition with uEnv.txt to change the

boot_targets=distro mmc0 dhcp

to have bootcmd_distro called for this to work. It's a problem that

  1. visionfive2_mem_set isn't called regardless of which boot target is used
  2. the uEnv.txt is loaded only from a 3rd FAT partition, which doesn't allow a normal partitioning (single Linux partition)

fw_printenv and fw_setenv can be used to check and change the U-Boot environment on SPI flash, but the /dev/mtd* device and location of the environment needs to be known and set up in /etc/fw_env.config.

from visionfive2.

sndwvs avatar sndwvs commented on July 26, 2024

Hi, If anyone still experience this type of bug even with updated softwares, this is what I was adviced to do when fixed mine:

1. Decompile your source dtb:
   `cd /tmp; dtc -I dtb -O dts /sys/firmware/fdt -o vf2.dts` # on system booted up, or place path to your dtb in place of `/sys/firmware/fdt`. Ignore any warnings it produces. If `dtc` tool is not installed, try installing it: `apt install device-tree-compiler` or how dtc is named in your distro. Alternatively, `dtc` from Linux kernel tree also can be used (you have to run `make menuconfig` first to produce executable).

2. Edit vf2.dts: Find section which starts with `memory@4`. Your line of interest is `reg = <0x00 0x40000000 0x01 0x00>;` or `reg = <0x00 0x40000000 0x1 0x00>;`. You shall replace it with `reg = <0x00 0x40000000 0x02 0x00>;`. Notice `0x02` and not `0x01`.

3. Compile file back: `dtc -I dts -O dtb -o /boot/dtbs/starfive/vf2.dtb vf2.dts`. Again, if no errors and only warnings, you're good to go.

4. Boot with modified `vf2.dtb`: in U-Boot prompt you might want to `setenv fdtfile starfive/vf2.dtb` followed by `saveenv`. YMMV.

It worked fine for me this way.

Having tried different images for a board with 8GB of memory, with a native bootloader, 4GB is always available, so I made an overlay file to configure the 8GB memory

from visionfive2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.