Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pine64-rock64: init #1280

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

pine64-rock64: init #1280

wants to merge 1 commit into from

Conversation

matdibu
Copy link
Contributor

@matdibu matdibu commented Dec 18, 2024

Description of changes

Added pine64-rock64

Things done
  • Tested the changes in your own NixOS Configuration
  • Tested the changes end-to-end by using your fork of nixos-hardware and
    importing it via <nixos-hardware> or Flake input

Comment on lines +4 to +6
"pcie_rockchip_host"
"phy_rockchip_pcie"
"sdhci_pci"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this not detected by nixos-generate-config?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mhm. but I guess our installer wouldn't boot, so the normal install workflow wouldn't boot.

Copy link
Contributor Author

@matdibu matdibu Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

boot.initrd.kernelModules = [
# PCIe/NVMe
"nvme"
"pcie_rockchip_host"
"phy_rockchip_pcie"
];

my local config (and, in turn, what was done in this PR) is inspired by how the RockPro64 is configured

Copy link
Contributor Author

@matdibu matdibu Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm currently using a half-functional build of u-boot/tow-boot, generated from this draft PR Tow-Boot/Tow-Boot#322, so I don't really know how the usual NixOS install process would go

Copy link
Member

@Mic92 Mic92 Dec 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can leave those modules in here if you also add a README how to bootstrap the rest of the configuration i.e. instructions to build a installer image.
Without this context it would have little value to have this module in nixos-hardware.

Copy link
Contributor Author

@matdibu matdibu Dec 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's just the generic aarch64 uefi installer iso

I guess it'd be more common to go the u-boot+sd-card image route, like it says on the wiki

which is unlike what I have -- tow-boot+normal EFI installer

I wouldn't really recommend people use a draft PR for their own stuff though

"phy_rockchip_pcie"
"sdhci_pci"
];
kernelModules = [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is any of this needed? I don't remember needing to specify this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember some of them not being detected automatically, but I can remove that boot.kernelModules list entirely if it's out-of-scope for nixos-hardware

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just copied it from my local config

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it won't show any graphics if you attach a monitor, or what does this fix? Usually the kernel will match pci/usb vendor ids with drivers and load them as needed.

Copy link
Member

@Mic92 Mic92 Dec 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with adding modules if they are actually not recognize by the hardware or if there is a good reason to add them to early boot

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, then I'll boot once without this list, and I'll compare which modules are loaded
might take a bit, I won't have access to the SBC for a few days

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using this after booting with all modules listed

$ ssh rock64.lan -- lsmod | cut -d' ' -f1 | sort -u > before.txt

and this after removing them

$ ssh rock64.lan -- lsmod | cut -d' ' -f1 | sort -u > after.txt

I can get a diff

$ diff before.txt after.txt

that shows that these are the modules that are not normally loaded, unless added there by force

panfrost
pcie_rockchip_host
phy_rockchip_pcie
rk3399_dmc
rockchip_dfi
rockchip_isp1
rockchip_rga
rockchip_saradc
sdhci_pci
v4l2_async
v4l2_fwnode
videobuf2_dma_sg
videobuf2_vmalloc

that being said, it still boots and I still get HDMI video out

Copy link
Contributor Author

@matdibu matdibu Jan 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

panfrost definitely shouldn't be there, lima is the correct driver for the rock64's rk3328 Mali-450 "Utgard" (and it's automatically loaded)
https://wiki.debian.org/PanfrostLima
https://docs.mesa3d.org/drivers/lima.html

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in conclusion: my machine boots without anything specified in boot.initrd.kernelModules and boot.kernelModules

flake.nix Show resolved Hide resolved
@matdibu
Copy link
Contributor Author

matdibu commented Jan 9, 2025

@Mic92 since it looks like the rock64 works without any of the changes here, I'm open to simply closing this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants