Jump to content

Can't see eMMC on BPI-P2


Palaretri

Recommended Posts

Hi all,

I'm working with a BPI-P2 board.

I installed the last Armbian version for BPI-M2 as the two boards are basically the same except the RJ45 connector and the eMMC.

 

I installed it on an SD card, and everythig worked perfectly.

 

Now I need to put the OS on the eMMC and then completely remove the SD card, but I'm struggling.

 

The default Armbian for BPI-M2 is not intended to support eMMC, so I'm not surprised that with this version the eMMC dosn't show up.

 

So I tried to modify the dtb and enable the eMMC nodes, and then reboot.

Here the changes I made:

 

mmc@1c10000 {
            reg = < 0x1c10000 0x1000 >;
            pinctrl-names = "default";
            pinctrl-0 = < 0x0d >;
            resets = < 0x03 0x08 >;
            reset-names = "ahb";
            interrupts = < 0x00 0x3d 0x04 >;
            status = "okay";
            #address-cells = < 0x01 >;
            #size-cells = < 0x00 >;
            compatible = "allwinner,sun7i-a20-mmc";
            clocks = < 0x03 0x17 0x03 0x4a 0x03 0x4c 0x03 0x4b >;
            clock-names = "ahb\0mmc\0output\0sample";
            vmmc-supply = < 0x0b >;
            vqmmc-supply = < 0x0b >;
            mmc-pwrseq = < 0x0e >;
            bus-width = < 0x04 >;
            non-removable;
            phandle = < 0x44 >;

 

            mmc2-8bit-pins {
                pins = "PC5\0PC6\0PC8\0PC9\0PC10\0PC11\0PC12\0PC13\0PC14\0PC15\0PC16";
                function = "mmc2";
                drive-strength = < 0x1e >;
                bias-pull-up;
                allwinner,drive = < 0x03 >;
                phandle = < 0x54 >;
            };
 

 

Sadly this wasn't enought, and I still can't see the eMMC.

 

I read a lot of threads, but I've not been able to find a solution.

I guess that I have some problems with the uBoot or with the drivers not present in the kernel.

 

I'm quite new to Linux, and I've never recompiled a kernel or a uBoot.

 

Please, can someone help me?

 

Thank you!

Link to comment
Share on other sites

Hi Palaretri,

 

I've been through the same troubles, and finally figured out how to properly boot armbian from eMMC on Banana Pi P2-zero board.

 

THE PROBLEM

You will need of course to properly add the emmc inside the .dtb file, but you'll also need to compile the kernel in a way that it can properly parse emmc information.

That's the reason why won't be able to see eMMC on your device: even if you put the right info into the .dtb file, your kernel (as it is now) won't even bother to seek for such information inside the .dtb file.

So yes, you will need to recompile the kernel (or get somehow a working image, which could be difficult... it was for me).

 

In addition, even if you recompile properly the kernel and fix your dtb, you will of course be able to see eMMC once logged in, but if you try to install the system into eMMC with nand-sata-install, or by using the dd command, the system won't boot from eMMC. This is because the bootloader needs the dtb information as well... but there is a complication: the bootloader image holds dtb information within itself. In other words, the only way to update the dtb inside the  bootloader image, is to recompile such image, with the proper .dts file fixed in its sources.

So you wiil need to recompile the bootloader as well.

 

 

THE SOLUTION

As I said, the solution is to recompile both the bootloader and the kernel, which you can fortunately do in once shot.

  1. You need a machine (virtual or not) with Ubuntu, as said here https://armbian-documentation.readthedocs.io/en/latest/Developer-Guide_Build-Preparation/
  2. Log into the Ubuntu and download the sources from armbian repository, and run at leas once the script ./compile.sh
    git clone --depth 1 https://github.com/armbian/build
    ./compile.sh

    A sort of GUI will pop up, and you will have to choose some options (including you board name, which you will select as bananapim2zero). Make your choises, and then wait for the script to finish (it may take up to 2-3 hours, depending on your hardware)

  3. Once finished, you will have to copy the patches I've attached.
    • banana_defconfig.patch and banana_dts.patch must be copied into userpatches, userpatches/u-boot and userpatches/u-boot/u-boot-sunxi folders (actually, only one of theese 3 folders is needed to be filled, but I don't know which, so I filled all of them, it still will work);
    • orangepi.patch must be copied into userpatches, userpatches/kernel and userpatches/kernel.
  4. Now run the last compilation command:
    ./compile.sh BOARD=bananapim2zero
    wait another 2-3 hours, and finally gather the generated image from output/images/ folder, than flash it into your SD card.
  5. Now, if you insert your SD and power on the device, you should not be able to see your eMMC, because the .dtb file is not updated with the eMMC info. Now it's time to apply the fix you proposed on your own. To be pragmatic, I attached the compiled .dtb file which contains the eMMC properly described, and which I used in my working build, the file sun8i-h2-plus-bananapi-m2-zero.dtb. Copy it inside /boot/dtb, then reboot your system.
  6. Now, you should be able to see eMMC: if you run the command lsblk, you should see mmcblk2 in the device list.
  7. Now you can install your armbian on the eMMC, which can be done by using the utility "nand-sata-install", or by using the command:
    dd if=/dev/mmcblk0 of=/dev/mmcblk2 BS=1M status=progress

    I personally used the nand-sata-install utility, didn't test if the dd command works properly, but it should!

  8. YOU'RE DONE: remove your SD card and reboot the device, it will now properly boot from eMMC!

I hope this helps,

BR

 

banana_defconfig.patch banana_dts.patch orangepi.patch sun8i-h2-plus-bananapi-m2-zero.dtb

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines