Working versions of u-boot/kernel/rootfs for creating a bootable sd card for Creator CI20?

17 views
Skip to first unread message

William Cohen

unread,
Feb 25, 2021, 8:38:47 PM2/25/21
to mips-creat...@googlegroups.com
Hi,

I would like to run a more recent distribution of linux on the creator CI20.  I was able to get the newer Gentoo image from https://www.setphaserstostun.org/pages/mips-creator-ci20-gentoo-resources/ installed into the MTD NAND memory.  I would prefer to have everything on an SD card to make it easier to switch to different versions and have more storage space available than what is provided by the builtin MTD NAND.  I looked around and none of the older sd card boot image for debian seem to be available.  The best I could do was find some scripts and instructions about creating a bootable SD Card at:

https://elinux.org/CI20_Dev_Zone#Making_a_bootable_SD_card_from_sources

https://download.goldelico.com/letux-debian-rootfs/README

To avoid frustration of getting a non-working u-boot/kernel does anyone have pointers to specific versions of u-boot/kernel/rootfs and/or command line arguments known to create a working bootable SD card with a more recent distribution of linux?

Thanks,

-Will Cohen

Zhou Yanjie

unread,
Feb 27, 2021, 1:32:25 AM2/27/21
to William Cohen, mips-creat...@googlegroups.com, H. Nikolaus Schaller, Paul Boddie
Hello William,
U-Boot in the elinux.org (2013.10-rc3) is OK, and the mainline kernel
can run properly on CI20, but only supports single-core. The letux
kernel maintained by Nikolaus and Paul can provide dual-core support. As
for rootfs, I have tested debian9 and debian10, and both can run properly.


@Nikolaus, @Paul,

Have you tested the mainline U-Boot? I tested both 2019.01 and 2020.07
and both can't boot. I don't know if it is because my CI20 is r1 version.


Thanks and best regards!


> Thanks,
>
> -Will Cohen
>

H. Nikolaus Schaller

unread,
Feb 27, 2021, 6:04:17 AM2/27/21
to William Cohen, mips-creat...@googlegroups.com, Paul Boddie, Zhou Yanjie, Riccardo Mottola
Hi William,

> Am 27.02.2021 um 07:32 schrieb Zhou Yanjie <zhouy...@wanyeetech.com>:
>
> Hello William,
>
> On 2021/2/26 上午9:38, William Cohen wrote:
>> Hi,
>>
>> I would like to run a more recent distribution of linux on the creator CI20. I was able to get the newer Gentoo image from https://www.setphaserstostun.org/pages/mips-creator-ci20-gentoo-resources/ installed into the MTD NAND memory. I would prefer to have everything on an SD card to make it easier to switch to different versions and have more storage space available than what is provided by the builtin MTD NAND. I looked around and none of the older sd card boot image for debian seem to be available. The best I could do was find some scripts and instructions about creating a bootable SD Card at:
>>
>> https://elinux.org/CI20_Dev_Zone#Making_a_bootable_SD_card_from_sources
>>
>> https://download.goldelico.com/letux-debian-rootfs/README
>>
>> To avoid frustration of getting a non-working u-boot/kernel does anyone have pointers to specific versions of u-boot/kernel/rootfs and/or command line arguments known to create a working bootable SD card with a more recent distribution of linux?
>
>
> U-Boot in the elinux.org (2013.10-rc3) is OK, and the mainline kernel can run properly on CI20, but only supports single-core. The letux kernel maintained by Nikolaus and Paul can provide dual-core support. As for rootfs, I have tested debian9 and debian10, and both can run properly.

Our makesd tool [1] can bake a working SD card (any size - even 200GB should work) including (old) U-Boot, latest kernel (incl. device tree and modules) and a rootfs. You can choose between Jessie, Squeeze, Buster and Bullseye.

Typical commands:

DEV=/dev/sdb makesd -v latest ci20 -r http://download.goldelico.com/letux-debian-rootfs/stable-mipsel-minimal.tbz
DEV=/dev/sdb makesd -v latest ci20 -r http://download.goldelico.com/letux-debian-rootfs/20201123-bullseye-11.sid-mipsel-minimal.tbz

(BTW: these rootfs images were debootstrapped on the CI20).

The Letux tree includes HDMI support and other improvements we have not yet pushed upstream (lack of time to wrestle with upstream maintainers about details).

A big missing part is NAND where we do not know how to implement. It was explicitly removed by the maintainer some years ago because he found that it can not work and can not be fixed (although it seemed to work in practice with the older Vendor kernels).

>
>
> @Nikolaus, @Paul,
>
> Have you tested the mainline U-Boot?

Would be another building site and available time is scarce... For me, U-Boot is a "never touch a running system" component :) Like hardware. Even if it is 8 years old.

> I tested both 2019.01 and 2020.07 and both can't boot. I don't know if it is because my CI20 is r1 version.
>
>
> Thanks and best regards!

BR,
Nikolaus

[1]: https://projects.goldelico.com/p/gta04-makesd/

William Cohen

unread,
Mar 1, 2021, 7:47:40 PM3/1/21
to H. Nikolaus Schaller, mips-creat...@googlegroups.com, Paul Boddie, Zhou Yanjie, Riccardo Mottola
On 2/27/21 6:04 AM, H. Nikolaus Schaller wrote:
> Hi William,
>
>> Am 27.02.2021 um 07:32 schrieb Zhou Yanjie <zhouy...@wanyeetech.com>:
>>
>> Hello William,
>>
>> On 2021/2/26 上午9:38, William Cohen wrote:
>>> Hi,
>>>
>>> I would like to run a more recent distribution of linux on the creator CI20. I was able to get the newer Gentoo image from https://www.setphaserstostun.org/pages/mips-creator-ci20-gentoo-resources/ installed into the MTD NAND memory. I would prefer to have everything on an SD card to make it easier to switch to different versions and have more storage space available than what is provided by the builtin MTD NAND. I looked around and none of the older sd card boot image for debian seem to be available. The best I could do was find some scripts and instructions about creating a bootable SD Card at:
>>>
>>> https://elinux.org/CI20_Dev_Zone#Making_a_bootable_SD_card_from_sources
>>>
>>> https://download.goldelico.com/letux-debian-rootfs/README
>>>
>>> To avoid frustration of getting a non-working u-boot/kernel does anyone have pointers to specific versions of u-boot/kernel/rootfs and/or command line arguments known to create a working bootable SD card with a more recent distribution of linux?
>>
>> U-Boot in the elinux.org (2013.10-rc3) is OK, and the mainline kernel can run properly on CI20, but only supports single-core. The letux kernel maintained by Nikolaus and Paul can provide dual-core support. As for rootfs, I have tested debian9 and debian10, and both can run properly.
> Our makesd tool [1] can bake a working SD card (any size - even 200GB should work) including (old) U-Boot, latest kernel (incl. device tree and modules) and a rootfs. You can choose between Jessie, Squeeze, Buster and Bullseye.
>
> Typical commands:
>
> DEV=/dev/sdb makesd -v latest ci20 -r http://download.goldelico.com/letux-debian-rootfs/stable-mipsel-minimal.tbz
> DEV=/dev/sdb makesd -v latest ci20 -r http://download.goldelico.com/letux-debian-rootfs/20201123-bullseye-11.sid-mipsel-minimal.tbz
>
> (BTW: these rootfs images were debootstrapped on the CI20).
>
> The Letux tree includes HDMI support and other improvements we have not yet pushed upstream (lack of time to wrestle with upstream maintainers about details).
>
> A big missing part is NAND where we do not know how to implement. It was explicitly removed by the maintainer some years ago because he found that it can not work and can not be fixed (although it seemed to work in practice with the older Vendor kernels).

Hi,

Thanks for the examples and suggestions.  I was able to use the makesd command (with some tweaks afterwards) to run with the letux debian bullseye minimal tarball and the 5.10.16 ci20 kernel.

I hooked up a serial port to see what messages were being printed on boot up and diagnose some of the issues I encountered. Here are the things that I had issues with when creating the sdcard with the script:

-uImage was placed in / rather than /boot and had to manually move it.

-5.10.16 modules did not seem to be installed in /lib/modules, so manually downloaded the tarball and unpacked it in the target root filesystem

-commented out unsupported file systems in /etc/fstab such as ubi0

-it would be nice if script check that arguments were things that could be downloaded before overwriting the sd card.  I made some typos in the names and the error were rather buried in the output of the makesd script.

Thanks again,


-Will Cohen

James McMechan

unread,
Mar 3, 2021, 12:12:16 PM3/3/21
to William Cohen, mips-creat...@googlegroups.com
On 3/1/21, William Cohen <wco...@nc.rr.com> wrote:
> On 2/27/21 6:04 AM, H. Nikolaus Schaller wrote:
>> Hi William,
>>
>>> Am 27.02.2021 um 07:32 schrieb Zhou Yanjie <zhouy...@wanyeetech.com>:
>>>
>>> Hello William,
>>>
>>> On 2021/2/26 上午9:38, William Cohen wrote:
>>>> Hi,
>>>>
>>>> I would like to run a more recent distribution of linux on the creator
>>>> CI20.  I was able to get the newer Gentoo image from
>>>> https://www.setphaserstostun.org/pages/mips-creator-ci20-gentoo-resources/

I run the plain gentoo MIPS stage3 it does not have the customizations but seems to work fine, also gentoo gets awkward if you are using too old a version and try to update.


>>>> installed into the MTD NAND memory.  I would prefer to have everything
>>>> on an SD card to make it easier to switch to different versions and have
>>>> more storage space available than what is provided by the builtin MTD
>>>> NAND.  I looked around and none of the older sd card boot image for
>>>> debian seem to be available.  The best I could do was find some scripts
>>>> and instructions about creating a bootable SD Card at:
>>>> https://elinux.org/CI20_Dev_Zone#Making_a_bootable_SD_card_from_sources

Most of the instructions seem to be for updating the onboard MTD.
I just partitioned the SD card and copied in the uboot areas, leaving the 270KiB (2M alignment  for erase block) for uboot and data, I also changed my command line:
bootargs=console=ttyS0,115200 console=ttyS4,115200 console=tty0 mem=256M@0x0 mem=768M@0x30000000 rootwait quiet rw root=/dev/mmcblk0p1

I put both serial consoles in since the original kernel and modern kernels seem to number the serial ports differently, and also included tty0 the one on the HDMI virtual terminal

I would suggest either 2MiB or 4MiB alignment of partitions since I think those are the currently common erase block sizes I currently use about 1G on a 2G SD card for my system.

You will also want to update /etc/fw_printenv.conf to include for example
/dev/mmcblk0            0x83800         0x8000             
Which is the uboot env block on my sd card

my current bootcmd is:
bootcmd=run ethargs; ext4load mmc 0:1 0x88000000 /boot/kernel-4.15.4;bootm 0x88000000
Reenabling the UBI interface is just a one line patch, but I seldom bother, I run off of the SD card, I don't often compile or have swap on the SD card though, I wore out an SD card back in the day. I have used NFS (so-so) USB-HDD (some problems with big compiles) and NBD (which worked for me).
I think it is currently at linux-5.11.2/drivers/mtd/ubi/build.c:872
I just add a false to the test like
-          if (mtd->type == MTD_MLCNANDFLASH &&
+         if (0 && mtd->type == MTD_MLCNANDFLASH &&

I have thought about sending in an update to Kconfig with their explanation of why it does not work with MLC flash when I am extra grumpy.

i.e. UBIFS only works with SLC flash, this is a type of obsolete enterprise flash seldom seen on modern equipment. UBIFS does not want to work with modern flash chips.

From what I can tell it would require a kernel (or I suppose userspace) thread to run a background verification pass to insure twined pages or other erase blocks have not been hit, much like rowhammer but with ECC correction so a passive read should allow for recovery unless too many errors have accumulated. But I never ran into that in practice.
Reply all
Reply to author
Forward
0 new messages