Jump to content

mirkobe_89

Members
  • Posts

    3
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. 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. You need a machine (virtual or not) with Ubuntu, as said here https://armbian-documentation.readthedocs.io/en/latest/Developer-Guide_Build-Preparation/ 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) 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. 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. 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. Now, you should be able to see eMMC: if you run the command lsblk, you should see mmcblk2 in the device list. 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! 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
  2. Hi, I've been finally able to boot armbian from emmc on banana pi p2 zero, and I'm going to share how I solved my issues. Basically, somehow it seems that the bootloader was actually the culprit of my issue. I compiled a new bootloader from armbian sources (following these instructions https://docs.armbian.com/Developer-Guide_Build-Preparation/), after applying 2 patches. I'm sharing the full procedure, I think it would be the clearest explanation possible. git clone --depth 1 https://github.com/armbian/build; cd build; copy files banana_dts.patch and banana_defconfig.patch (attached below) inside both the userpatches folder and the userpatches/u-boot (perhaps only this last folder is usefull, I don't know) ./compile.sh BOARD=bananapim2zero Done! NOTE: This last command will build a full boot+kernel image. Since I was interested on the bootloader only, I extracted the first 4M from that image with dd command, and saved it into a u-boot-with-spl.bin file. Perhaps it would have been faster and easier to build directly the bootloader only through the command (which I did not try): ./compile.sh BOARD=bananapim2zero 'compile_uboot' Here are the 2 patch files: banana_dts.patch: diff --git a/arch/arm/dts/sun8i-h2-plus-bananapi-m2-zero.dts b/arch/arm/dts/sun8i-h2-plus-bananapi-m2-zero.dts index d277d043..be57ce08 100644 --- a/arch/arm/dts/sun8i-h2-plus-bananapi-m2-zero.dts +++ b/arch/arm/dts/sun8i-h2-plus-bananapi-m2-zero.dts @@ -107,6 +107,25 @@ }; }; +&mmc2 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc2_8bit_pins>; + vmmc-supply = <&reg_vcc3v3>; + vqmmc-supply = <&reg_vcc3v3>; + bus-width = <8>; + non-removable; + status = "okay"; +}; + + +&mmc2_8bit_pins { + pins = "PC5\0PC6\0PC8\0PC9\0PC10\0PC11\0PC12\0PC13\0PC14\0PC15\0PC16"; + function = "mmc2"; + drive-strength = < 0x1e >; + bias-pull-up; + phandle = < 0x54 >; +}; + &ohci0 { status = "okay"; }; banana_defconfig.patch: diff --git a/configs/bananapi_m2_zero_defconfig b/configs/bananapi_m2_zero_defconfig index 09d0517c..e47e7808 100644 --- a/configs/bananapi_m2_zero_defconfig +++ b/configs/bananapi_m2_zero_defconfig @@ -6,3 +6,6 @@ CONFIG_DRAM_CLK=408 CONFIG_MMC0_CD_PIN="" CONFIG_DEFAULT_DEVICE_TREE="sun8i-h2-plus-bananapi-m2-zero" # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set +CONFIG_VIDEO_DE2=n +CONFIG_MMC_SUNXI_SLOT_EXTRA=2 +CONFIG_SUN8I_EMAC=y BR
  3. Hi all, thanks in advance for taking the time to read this topic. I'm working with the Banana Pi P2-zero board, on which I successfully installed the armbian buster image (on SD card) from here: https://www.armbian.com/bananapi-m2-zero/ Note that the image is for M2-zero, not P2 zero... which by the way has pretty much the same hardware, and things work fine on SD card. But then I needed to install the whole system on the on board eMMC. Such eMMC was not visible at first, so I edited the /boot/dtb/sun8i-h2-plus-bananapi-m2-zero.dts file to include mmc2 (mmc@1c11000) and compiled it as dtb. After this, I was able to see the eMMC as /dev/mmcblk2. Then I used the armbian utility "nand-sata-install" to install boot and kernel on eMMC. After this, /dev/mmcblk2 has the same partition table as my sd card (/dev/mmcblk0), and in general the eMMC gets flashed properly. FIRST ISSUE: I removed the SD card, and the system doesn't boot from eMMC. I also tried to update the bootloader through armbian-config utility, I tried the apt update/upgrade, but still could not get the eMMC booting properly. I went deeper, and learned that this bootloader (which seems to be an SPL+Uboot image) includes its own dtb file in its image. Such dtb does not include the eMMC (same problem as the kernel's dtb). Unfortunately, there is no way to recover the sources of the bootloader to change just the dtb file (or at least, I don't know any way, if anyone does, please tell me ). That's why I decided to compile my own bootloader from scratch, from here https://linux-sunxi.org/U-Boot So I was able to generate my u-boot-sunxi-with-spl.bin file, flashed it on eMMC with: dd if=u-boot-sunxi-with-spl.bin of=/dev/mmcblk2 bs=1024 seek=8 and finally the bootloader is able to fully run from eMMC!... But here comes the second issue (i.e. the title of this topic): SECOND ISSUE: the bootloader starts loading the kernel, but then suddenly hangs! Here's the last part of the console output: [ 12.460907] platform regulatory.0: Falling back to sysfs fallback for: regulaory.db [ 12.506653] Bluetooth: Core ver 2.22 [ 12.510682] NET: Registered protocol family 31 [ 12.515250] Bluetooth: HCI device and connection manager initialized [ 12.521753] Bluetooth: HCI socket layer initialized [ 12.526780] Bluetooth: L2CAP socket layer initialized [ 12.532004] Bluetooth: SCO socket layer initialized [ 12.598366] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio fr chip BCM43430/1 [ 12.690139] cfg80211: failed to load regulatory.db [ 12.719537] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43430sdio.sinovoip,bpi-m2-zero.txt failed with error -2 [ 12.731402] brcmfmac mmc1:0001:1: Falling back to sysfs fallback for: brcm/brmfmac43430-sdio.sinovoip,bpi-m2-zero.txt [ 12.776242] Bluetooth: HCI UART driver ver 2.3 [ 12.780781] Bluetooth: HCI UART protocol H4 registered [ 12.785964] Bluetooth: HCI UART protocol BCSP registered [ 12.791536] Bluetooth: HCI UART protocol LL registered [ 12.796728] Bluetooth: HCI UART protocol ATH3K registered [ 12.802293] Bluetooth: HCI UART protocol Three-wire (H5) registered [ 12.808981] Bluetooth: HCI UART protocol Broadcom registered [ 12.907387] Internal error: Oops - undefined instruction: 0 [#1] SMP THUMB2 This happens both from SD card and eMMC, which would lead me think that the problem is in my bootloader... But then I tried to used another bootloader downloaded here https://pkgs.org/download/u-boot-bananapi-p2-zero and the result is the same. I'm lost, has anyone any clue about why the kernel loading is hanging this way? If yes, which could be the solution/workaround? Last thing: is there a better/alternative way to make my armbian image capable of booting from eMMC? Any suggestion is very much appreciated Thanks in advance! BR
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines