Skip to content
Snippets Groups Projects

WIP: ntc-chip: Add new device support

Closed Imported Administrator requested to merge device/ntc-chip into master
2 unresolved threads

I've ported PostmarketOS to the Next Thing Co (NTC) CHIP.

I'm using the downstream kernel from NTC right now, but this device should support mainline uboot and kernel.
Will experiment with mainline uboot and kernel in the next days.

Important:

TL:DR this device can't be flashed with pmbootstrap right now, I will put manual flashing instructions on the Wiki.

This device uses a raw NAND instead of an eMMC, so it needs its rootfs to be in UBIfs format.
UBIfs (like JFFS2) is different from regular filesystems because it takes care of flash memory management like wear leveling or bad block management.

Right now I haven't found a way to create the UBIfs image from pmbootstrap, so I will write instructions to do so manually in the wiki page.
Once the UBIfs image is created, it can be flashed using fastboot, which requires putting uboot in fastboot mode from the serial console.

Status:

At the moment it is possible to build a pmOS image using the commands explained in the wiki page.

However to boot this image we need to change u-boot configuration, and unfortunately the procedure explained below does not work on all the version of u-boot for CHIP around.

The next step is to package and compile u-boot to provide a uniform bootloader for pmOS.

  • Device boots
  • USB Ethernet works
  • Generate Device Tree blob from source
  • Package U-boot for CHIP
Edited by Administrator

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
    • Author Owner

      No, it doesn't support mainline kernel, because mainline kernel lacks MLC NAND support.

      By Icenowy Zheng on 2020-03-25T08:01:04

      Edited by Ghost User
    • Author Owner

      If I get it correctly it lacks the drivers of the specific MLC NAND mounted on the CHIP. I might give it a shot and try to write the drivers.

      Having mainline kernel, and graphic drivers would mean having modern mobile interfaces like Phosh on the PocketCHIP!

      By Federico Amedeo Izzo on 2020-03-25T08:01:04

    • Author Owner

      I think I got it wrong.
      According to this blogpost it's UBIfs that dropped MLC NAND support https://byteporter.com/problem-with-nand/

      However as of my knowledge, MLC NANDs can also be used in SLC mode (with halved capacity)
      Which is what was initially used on the CHIP (4GB space available instead of 8GB)

      Maybe there is a way of configure the NAND in SLC way and run mainline linux.

      By Federico Amedeo Izzo on 2020-03-25T08:21:35

      Edited by Administrator
    • Please register or sign in to reply
  • Administrator added 1 commit · Imported

    added 1 commit

    • 7deaec87 - ntc-chip: Change name from Chip to CHIP

    Compare with previous version

    By Federico Amedeo Izzo on 2020-03-25T07:57:59

  • Administrator changed the description · Imported

    changed the description

    By Federico Amedeo Izzo on 2020-03-25T07:58:38

  • Administrator added category::device + 1 deleted label · Imported

    added category::device + 1 deleted label

  • Administrator added 1 commit · Imported

    added 1 commit

    • 4a736759 - ntc-chip: Enable USB Ethernet

    Compare with previous version

    By Federico Amedeo Izzo on 2020-03-25T09:01:41

  • Administrator added 1 commit · Imported

    added 1 commit

    • a1638ba9 - ntc-chip: Fix deviceinfo checksum

    Compare with previous version

    By Federico Amedeo Izzo on 2020-03-25T09:19:17

  • Administrator marked as a Work In Progress · Imported

    marked as a Work In Progress

    By Federico Amedeo Izzo on 2020-03-25T09:38:13

  • Administrator changed the description · Imported

    changed the description

    By Federico Amedeo Izzo on 2020-03-25T09:38:13

  • Administrator added 1 commit · Imported

    added 1 commit

    • 95b66471 - ntc-chip: Add legacy uboot initramfs option

    Compare with previous version

    By Federico Amedeo Izzo on 2020-03-25T12:48:12

  • Administrator added 1 commit · Imported

    added 1 commit

    • 70736a10 - ntc-chip: Add post-install script to create symlinks of kernel and initramfs

    Compare with previous version

    By Federico Amedeo Izzo on 2020-03-25T13:36:02

  • Administrator marked the checklist item USB Ethernet works as completed · Imported

    marked the checklist item USB Ethernet works as completed

    By Federico Amedeo Izzo on 2020-03-29T07:27:33

  • Administrator changed the description · Imported

    changed the description

    By Federico Amedeo Izzo on 2020-03-29T07:29:59

    • Author Owner

      The patch looks mostly fine to me, but there is a device tree blob file. We don't put binary blobs into pmaports. Can you generate it from the kernel sources?

      If you don't have the source file, there is also a decompiler for device tree blobs.

      Right now I haven't found a way to create the UBIfs image from pmbootstrap, so I will write instructions to do so manually in the wiki page.

      It would be easy to add this to pmbootstrap here. (If you want to do so, please move the existing sparse code and the new code for ubifs into new functions, so it does not blow up the existing install_system_image function too much.)

      However to boot this image we need to change u-boot configuration, and unfortunately the procedure explained below does not work on all the version of u-boot for CHIP around.

      The next step is to package and compile u-boot to provide a uniform bootloader for pmOS.

      That's a good way forward. But if necessary, we also have a workaround: generate a dummy initramfs in the linux package that mounts the root filesystem and loads the real initramfs. This is done in linux-samsung-i9100 for example.

      This is a very interesting device, thanks for doing the port @symmetrist!

      By Oliver Smith on 2020-04-02T16:48:35

      Edited by Ghost User
    • Author Owner

      Thank you for the feedback @ollieparanoid!

      I will generate the device tree blob from source.

      Integrating UBIfs tools in pmbootstrap seems doable, I will give it a shot in a second time, and will follow your suggestions.

      By Federico Amedeo Izzo on 2020-04-02T16:48:35

    • Please register or sign in to reply
  • Administrator changed the description · Imported

    changed the description

    By Federico Amedeo Izzo on 2020-04-02T16:41:28

  • Author Owner

    I'm sorry but I'm no longer working on this port.

    The amount of work turned out to be bigger than I tought and currently I prefer to work on a phone (oneplus-bacon) because it is more rewarding.

    I will close this MR but I hope it serves as a reference for anyone who wants to pick this up and finish the port.

    By Federico Amedeo Izzo on 2020-04-11T08:52:45

  • Administrator closed · Imported

    closed

    By Federico Amedeo Izzo on 2020-04-11T08:52:46

Please register or sign in to reply
Loading