UBIBoot on the RetroMini

Hello there,

For those who don’t know, I had written a bootloader called UBIBoot, quite a long time ago, for the Dingoo A320. As its name suggests, it supported booting from a UBI volume on the NAND. That is to say, it was able to boot a Linux kernel on the only Dingoo A320 with the internal NAND formatted as UBI: my own. I trashed the native OS and was running OpenDingux directly on the internal NAND.

The job of UBIBoot was to initialize the main PLL, the clocks, set the pins of the SoC in the right mode, initialize the SDRAM, initialize the NAND, initialize the SD card controller, and then finally, boot Linux from the first FAT partition of the SD card if there’s one inserted, or from the “kernel” UBI drive of the internal NAND.

All of that in about 5 kilobytes.

Before the GCW Zero came out, I got a prototype (with 256 MiB RAM), and ported UBIBoot to it. It then became the default and official bootloader for the GCW Zero when it was retailed months later.

There’s a fun story about it: the GCW Zero prototype didn’t have marks on the main board to show where the UART pads were, so I ported UBIBoot without having any output log: instead, I was blinking the LCD. My test passed? LCD turned on. It failed? The LCD remained off. Repeat for everything you need to test in your code. Next time it will be faster for me to learn Morse code and make the LCD blink Morse code to me 🙂

Anyway, I disgress. I ported UBIBoot to the RetroMini, and the code is in the master branch now, which means it’s officially supported. The code is available here.

Note that right now, it only supports booting from an external micro-SD card. I did not try to flash it on the NAND; I want to dump the NAND before starting to overwrite it with random stuff.

To compile:
CONFIG=rs90 make

For the stage1 variant, where UBIBoot will only initialize the hardware then return to the USB loader:
CONFIG=rs90 STAGE1_ONLY=y make

Note that right now, it’s only useful for people with a UART cable soldered and who want to boot their own Linux kernel (or other operating system).

Next step: boot Linux!

13 thoughts on “UBIBoot on the RetroMini

  1. chris

    Yes it is really interesting, and you can explain quite clearly. I will watch your progress ! Thank you very much for sharing !

    Reply
      1. retromini

        *Assuming you managed to get to the point of having something like OpenDingux fully running*, could you please share the your opinion of performance of this little machine?
        Would you say that it’s now perfectly usable for retro playing? (read: near full speed for platformers and the like)

        Reply
        1. pcercuei Post author

          I’m not quite there yet. As for performance, it’s good enough for running GBA and GameBoy. I’m not really interested into anything else TBH.

          Reply
          1. retromini

            I really hope you manage to get it in a state where you feel comfortable to release it to the public and write a new blog post about it!

            Kudos for your hacking abilities! =)

          2. VanZan

            Great to hear. I may purchase another as I’m sure the price will increase once your hack is released

  2. blackz1982

    Hello pcercuei.
    Maybe you will make at least the short instruction how to pass to ubiboot on dingoo a320?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *