Coder Social home page Coder Social logo

Comments (8)

lalakii avatar lalakii commented on May 20, 2024 1

I think I may need to add a configuration menu to the mainline u-boot, but I don't know much about that, would anyone do that.

from dietpi.

lalakii avatar lalakii commented on May 20, 2024 1

This u-boot seems to have a lot of problems with "dram_init".

In the "mctl_calc_size" method body.

both values have the potential to occur.

        u8 width = config->bus_full_width ? 4 : 2;

        // Sometimes it's 2, sometimes it's 4

When the memory size is incorrectly recognized, the system may crash if the memory usage exceeds the actual amount available.

from dietpi.

lalakii avatar lalakii commented on May 20, 2024

I have the 1.5GiB board

I found out the difference by comparing the source code.

source code: u-boot/arch/arm/mach-sunxi/dram_sun50i_h616.c

static unsigned long mctl_calc_size(const struct dram_config *config)
{
        u8 width = config->bus_full_width ? 4 : 2;

        /* 8 banks */
        unsigned long size;
        size = (1ULL << (config->cols + config->rows + 3)) * width * config->ranks;
        //  -----   CONFIG_DRAM_SUN50I_H616_TRIM_SIZE=y   -----
        size = (size * 3) / 4;
        //  ------------------------ END -----------------------
        return size;
} 

image

from dietpi.

MichaIng avatar MichaIng commented on May 20, 2024

Ah nice, you just nees to add size = (size * 3) / 4; and this works for U-Boot and also the final Linux system booted?

This looks so easy and obvious, I wonder whether iuncuim did not find that.

Also not sure how to implement into mainline U-Boot. Since this is not done in the device tree, I also have no other idea than basically adding this very same flag. At least it can potentially serve other H616/H618 boards as well.

EDIT: Ah, I think he does the very same for H616 boards like Zero 2. I am currently in China where gist.github.com is blocked, but based on snippets, he edits the same function. The problem IIRC was that the physical RAM size could not be checked the same way on H618, hence he aimed to do it without flag but dynamically bases on hardware. I could imagine that U-Boot is not happy to accept such SoC specific flags in the main config, but not sure whether anyone asked.

EDIT2: Not the SoC is the difference, but LPDDR3 vs LPDDR4. However, this means we can use mainline U-Boot, only applying a one-line patch.

I will ask at Armbian whether they would accept an additional build target for this, otherwise we can do with a fork, hosting the build on our server, so the issue is solved for the 1.5G variant as well.

from dietpi.

lalakii avatar lalakii commented on May 20, 2024

Hello!

I've tried different kernels and found that they all have the wrong temperature information, which makes them unbootable

One problem has been identified so far:

[    2.143164] thermal thermal_zone0: gpu-thermal: critical temperature reached, shutting down
[    2.151581] reboot: HARDWARE PROTECTION shutdown (Temperature too high)
[    2.185438] reboot: Power down

My old kernel could boot fine because I removed the temperature module.

from dietpi.

lalakii avatar lalakii commented on May 20, 2024

However there doesn't seem to be anything else I can do about this problem. :(

from dietpi.

MichaIng avatar MichaIng commented on May 20, 2024

Next week I can generate a U-Boot build which matches the one we use for the 1/2/4 GB variants, just with this patch added. That one (using the Armbian build system), does have the right temperatures.

from dietpi.

MichaIng avatar MichaIng commented on May 20, 2024

Hmm, one would expect that config->bus_full_width is the correct condition for width to result in the correct memory size?

from dietpi.

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.