Monthly Archives: February 2021

NUC7PJYH: Closing out Gentoo on the Intel NUC

Well, the NUC is done and everything to working. It is definitely not a speed demon, Geekbench scores prove it with a 158 Single-Core Score and 570 Multi-Core Score.

NUC: Gnome Screen
NUC: Gnome Overview with settings window, dash to dock, and workspaces to dock.

I did try Wayland, and it worked well except for my extensions, so I settled on X11.

I have placed the system configuration on Gitlab including: kernel config, hardware info, files installed, and all that good stuff that should make installation easier. The entire Gentoo install is about 14 Gig and that includes Libreoffice and Firefox binary packages.

Model: Apricorn SATAWire (scsi)
Disk /dev/sdb: 250GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name    Flags
 1      1049kB  3146kB  2097kB  ext2            spacer  bios_grub
 2      3146kB  108MB   105MB   fat32           boot    boot, esp
 3      108MB   9772MB  9664MB  linux-swap(v1)  swap    swap
 4      9772MB  250GB   240GB   ext4            rootfs

Filesystem      Size  Used Avail Use% Mounted on
/dev/root       456G   14G  442G   3% /
devtmpfs        3.5G     0  3.5G   0% /dev
tmpfs           3.5G     0  3.5G   0% /dev/shm
tmpfs           1.4G  1.5M  1.4G   1% /run
tmpfs           3.5G   72K  3.5G   1% /tmp
/dev/sda2       247M   16M  231M   7% /boot
tmpfs           712M   64K  712M   1% /run/user/997
tmpfs           712M   92K  712M   1% /run/user/1000

Everything is working for me: Ethernet, Wireless, Bluetooth, Video, Sound, USB, and SDCard Reader.

00:00.0 Host bridge: Intel Corporation Gemini Lake Host Bridge (rev 03)
	DeviceName: Onboard - Other
	Subsystem: Intel Corporation Gemini Lake Host Bridge
	Flags: bus master, fast devsel, latency 0

00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 605 (rev 03) (prog-if 00 [VGA controller])
	DeviceName: Onboard - Video
	Subsystem: Intel Corporation UHD Graphics 605
	Flags: bus master, fast devsel, latency 0, IRQ 135
	Memory at a0000000 (64-bit, non-prefetchable) [size=16M]
	Memory at 90000000 (64-bit, prefetchable) [size=256M]
	I/O ports at f000 [size=64]
	Expansion ROM at 000c0000 [virtual] [disabled] [size=128K]
	Capabilities: [40] Vendor Specific Information: Len=0c <?>
	Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00
	Capabilities: [ac] MSI: Enable+ Count=1/1 Maskable- 64bit-
	Capabilities: [d0] Power Management version 2
	Capabilities: [100] Process Address Space ID (PASID)
	Capabilities: [200] Address Translation Service (ATS)
	Capabilities: [300] Page Request Interface (PRI)
	Kernel driver in use: i915
	Kernel modules: i915

00:0c.0 Network controller: Intel Corporation AC 1550i Wireless (rev 03)
	DeviceName: Onboard - Ethernet
	Subsystem: Intel Corporation AC 1550i Wireless
	Flags: bus master, fast devsel, latency 0, IRQ 44
	Memory at a1314000 (64-bit, non-prefetchable) [size=16K]
	Capabilities: [c8] Power Management version 3
	Capabilities: [d0] MSI: Enable- Count=1/1 Maskable- 64bit+
	Capabilities: [40] Express Root Complex Integrated Endpoint, MSI 00
	Capabilities: [80] MSI-X: Enable+ Count=16 Masked-
	Capabilities: [100] Null
	Capabilities: [14c] Latency Tolerance Reporting
	Capabilities: [164] Vendor Specific Information: ID=0010 Rev=0 Len=014 <?>
	Kernel driver in use: iwlwifi
	Kernel modules: iwlwifi

00:0e.0 Audio device: Intel Corporation Celeron/Pentium Silver Processor High Definition Audio (rev 03) (prog-if 80)
	DeviceName: Onboard - Sound
	Subsystem: Intel Corporation Celeron/Pentium Silver Processor High Definition Audio
	Flags: bus master, fast devsel, latency 0, IRQ 136
	Memory at a1310000 (64-bit, non-prefetchable) [size=16K]
	Memory at a1000000 (64-bit, non-prefetchable) [size=1M]
	Capabilities: [50] Power Management version 3
	Capabilities: [80] Vendor Specific Information: Len=14 <?>
	Capabilities: [60] MSI: Enable+ Count=1/1 Maskable- 64bit+
	Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00
	Kernel driver in use: snd_hda_intel
	Kernel modules: snd_hda_intel

00:0f.0 Communication controller: Intel Corporation Celeron/Pentium Silver Processor Trusted Execution Engine Interface (rev 03)
	DeviceName: Onboard - Other
	Subsystem: Intel Corporation Celeron/Pentium Silver Processor Trusted Execution Engine Interface
	Flags: bus master, fast devsel, latency 0, IRQ 125
	Memory at a131f000 (64-bit, non-prefetchable) [size=4K]
	Capabilities: [50] Power Management version 3
	Capabilities: [8c] MSI: Enable+ Count=1/1 Maskable- 64bit+
	Capabilities: [a4] Vendor Specific Information: Len=14 <?>
	Kernel driver in use: mei_me
	Kernel modules: mei_me

00:12.0 SATA controller: Intel Corporation Celeron/Pentium Silver Processor SATA Controller (rev 03) (prog-if 01 [AHCI 1.0])
	DeviceName: Onboard - SATA
	Subsystem: Intel Corporation Celeron/Pentium Silver Processor SATA Controller
	Flags: bus master, 66MHz, medium devsel, latency 0, IRQ 124
	Memory at a1318000 (32-bit, non-prefetchable) [size=8K]
	Memory at a131e000 (32-bit, non-prefetchable) [size=256]
	I/O ports at f090 [size=8]
	I/O ports at f080 [size=4]
	I/O ports at f060 [size=32]
	Memory at a131d000 (32-bit, non-prefetchable) [size=2K]
	Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit-
	Capabilities: [70] Power Management version 3
	Capabilities: [a8] SATA HBA v1.0
	Kernel driver in use: ahci

00:13.0 PCI bridge: Intel Corporation Gemini Lake PCI Express Root Port (rev f3) (prog-if 00 [Normal decode])
	Flags: bus master, fast devsel, latency 0, IRQ 122
	Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
	I/O behind bridge: [disabled]
	Memory behind bridge: a1200000-a12fffff [size=1M]
	Prefetchable memory behind bridge: [disabled]
	Capabilities: [40] Express Root Port (Slot+), MSI 00
	Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit-
	Capabilities: [90] Subsystem: Intel Corporation Gemini Lake PCI Express Root Port
	Capabilities: [a0] Power Management version 3
	Capabilities: [100] Null
	Capabilities: [140] Access Control Services
	Capabilities: [150] Null
	Capabilities: [200] L1 PM Substates
	Kernel driver in use: pcieport

00:13.2 PCI bridge: Intel Corporation Gemini Lake PCI Express Root Port (rev f3) (prog-if 00 [Normal decode])
	Flags: bus master, fast devsel, latency 0, IRQ 123
	Bus: primary=00, secondary=02, subordinate=02, sec-latency=0
	I/O behind bridge: 0000e000-0000efff [size=4K]
	Memory behind bridge: a1100000-a11fffff [size=1M]
	Prefetchable memory behind bridge: [disabled]
	Capabilities: [40] Express Root Port (Slot+), MSI 00
	Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit-
	Capabilities: [90] Subsystem: Intel Corporation Gemini Lake PCI Express Root Port
	Capabilities: [a0] Power Management version 3
	Capabilities: [100] Null
	Capabilities: [140] Access Control Services
	Capabilities: [150] Null
	Capabilities: [200] L1 PM Substates
	Kernel driver in use: pcieport

00:15.0 USB controller: Intel Corporation Celeron/Pentium Silver Processor USB 3.0 xHCI Controller (rev 03) (prog-if 30 [XHCI])
	DeviceName: Onboard - Other
	Subsystem: Intel Corporation Celeron/Pentium Silver Processor USB 3.0 xHCI Controller
	Flags: bus master, medium devsel, latency 0, IRQ 126
	Memory at a1300000 (64-bit, non-prefetchable) [size=64K]
	Capabilities: [70] Power Management version 2
	Capabilities: [80] MSI: Enable+ Count=1/8 Maskable- 64bit+
	Capabilities: [90] Vendor Specific Information: Len=14 <?>
	Kernel driver in use: xhci_hcd
	Kernel modules: xhci_pci

00:1c.0 SD Host controller: Intel Corporation Celeron/Pentium Silver Processor SDA Standard Compliant SD Host Controller (rev 03) (prog-if 01)
	DeviceName: Onboard - Other
	Subsystem: Intel Corporation Celeron/Pentium Silver Processor SDA Standard Compliant SD Host Controller
	Flags: bus master, fast devsel, latency 0, IRQ 39
	Memory at a131c000 (64-bit, non-prefetchable) [size=4K]
	Memory at a131b000 (64-bit, non-prefetchable) [size=4K]
	Capabilities: [80] Power Management version 3
	Capabilities: [90] Vendor Specific Information: Len=14 <?>
	Kernel driver in use: sdhci-pci
	Kernel modules: sdhci_pci

00:1f.0 ISA bridge: Intel Corporation Celeron/Pentium Silver Processor LPC Controller (rev 03)
	DeviceName: Onboard - Other
	Subsystem: Intel Corporation Celeron/Pentium Silver Processor LPC Controller
	Flags: bus master, medium devsel, latency 0

00:1f.1 SMBus: Intel Corporation Celeron/Pentium Silver Processor Gaussian Mixture Model (rev 03)
	DeviceName: Onboard - Other
	Subsystem: Intel Corporation Celeron/Pentium Silver Processor Gaussian Mixture Model
	Flags: medium devsel, IRQ 20
	Memory at a131a000 (64-bit, non-prefetchable) [size=256]
	I/O ports at f040 [size=32]
	Kernel driver in use: i801_smbus
	Kernel modules: i2c_i801

01:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5229 PCI Express Card Reader (rev 01)
	Subsystem: Intel Corporation RTS5229 PCI Express Card Reader
	Flags: bus master, fast devsel, latency 0, IRQ 127
	Memory at a1200000 (32-bit, non-prefetchable) [size=4K]
	Capabilities: [40] Power Management version 3
	Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
	Capabilities: [70] Express Endpoint, MSI 00
	Capabilities: [100] Advanced Error Reporting
	Capabilities: [140] Device Serial Number 00-00-00-01-00-4c-e0-00
	Kernel driver in use: rtsx_pci
	Kernel modules: rtsx_pci

02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
	DeviceName: Onboard - RTK Ethernet
	Subsystem: Intel Corporation RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
	Flags: bus master, fast devsel, latency 0, IRQ 20
	I/O ports at e000 [size=256]
	Memory at a1104000 (64-bit, non-prefetchable) [size=4K]
	Memory at a1100000 (64-bit, non-prefetchable) [size=16K]
	Capabilities: [40] Power Management version 3
	Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
	Capabilities: [70] Express Endpoint, MSI 01
	Capabilities: [b0] MSI-X: Enable+ Count=4 Masked-
	Capabilities: [100] Advanced Error Reporting
	Capabilities: [140] Virtual Channel
	Capabilities: [160] Device Serial Number 01-00-00-00-68-4c-e0-00
	Capabilities: [170] Latency Tolerance Reporting
	Capabilities: [178] L1 PM Substates
	Kernel driver in use: r8169
	Kernel modules: r8169

NUC7PJYH: Gentoo UEFI Configure

This is no fun exercise. I did this over a year ago with my Asrock system, but of course did not record the exact steps, so I had to learn all over again.

The best start is to use the Gentoo Handbook example. I used a combination of fdisk and parted for the drive layout. As a note, I swapped to an EVO850 500G SSD that I had laying around. The following is how my SSD is layed out with a fdisk first, followed by a parted list:

fdisk -l:
Disk /dev/sda: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Samsung SSD 850 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: B8C5EDC2-AAB2-5142-B4FC-23FA7FCD69E4

Device        Start       End   Sectors   Size Type
/dev/sda1      2048      6143      4096     2M BIOS boot
/dev/sda2      6144    518143    512000   250M EFI System
/dev/sda3    518144  21489663  20971520    10G Linux swap
/dev/sda4  21489664 976773134 955283471 455.5G Linux filesystem

parted -l:
Model: ATA Samsung SSD 850 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name    Flags
 1      1049kB  3146kB  2097kB  ext2            grub    bios_grub
 2      3146kB  265MB   262MB   fat32           boot    boot, esp
 3      265MB   11.0GB  10.7GB  linux-swap(v1)  swap    swap
 4      11.0GB  500GB   489GB   xfs             rootfs

The sda2 partition is the normal boot partition for the kernel, followed by swap, and then sda4 as the root partition. So, what about sda1? Well it is there to provide space for grub to the best of my knowledge, but it is not used. Why use xfs for the rootfs? Because I have never used it before … I will probably downsize to a 250G SSD and switch to ext4 later because I have heard the 5.10 kernels have improvements/changes.

Next, install grub following the handbook. Note, you should be using the handbook as a guide, so at this point the drive is mounted, stage3 is installed, etc … I mount sda4 and sda2 using my script from the previous post and chroot into the image. Finally, execute:

grub-install --target=x86_64-efi --efi-directory=/boot

Typical issues with Gentoo are panics on the first start. Sometimes it is the grub configuration. For the above, I have the following in /etc/default/grub:

GRUB_CMDLINE_LINUX="root=/dev/sda4"

Other times, it could be that you are not using an initial ram disk (I do not) which case the filesystem needs to be compiled into the kernel and not as a modules.

skiftOS

So on OS News I see skiftOS: a hobby operating system and the description reads:

skiftOS is a hobby operating system built for learning and for fun targeting the x86 platform. It features a kernel named hjert, a graphical user interface with a compositing window manager, and familiar UNIX utilities.

I had to give it a try using VBox. I wasn’t sure which image to use and just downloaded bootdisk-limine-x86_32.img and ended up converting it to a VDI before I found the instructions. There is quite a lot of documentation if you scroll to the bottom of the Github page. This is the initial startup screen:

This is a shot of the task manager, it had locked up at this point:

The about screen:

Anyway, it locked up a few times, but it is a neat OS, and maybe I’ll look at it some more later.

NUC7PJYH: Intel UHD Graphics 605 A problem video problem on the way to happiness

The NUC J5005 uses built in Intel UHD Graphics 605 and I have it connected to a ViewSonic VG3448 34 Inch Ultra-Wide 21:9 WQHD. In the kernel config, it is configured as an i915. Short story, the first sign of problems is when the framebuffer is initialized which is followed by the first error:

fbcon: i915drmfb (fb0) is primary device
kernel: i915 0000:00:02.0: [drm] *ERROR* Invalid VCO
kernel: Console: switching to colour frame buffer device 430x90
kernel: i915 0000:00:02.0: [drm] *ERROR* Invalid VCO

There are follow on errors and X will not start. I fought this issue for a couple days then took it to work and try with a plain monitor (small Dell or something). Surprise! It worked perfect, so now I know it is a mismatch with my monitor. WTF?

So, I started with the 5.10.9 kernel and found the “Invalid VCO” is coming from intel_dpll_mgr.c.

static bool bxt_ddi_set_dpll_hw_state(struct intel_crtc_state *crtc_state, const struct bxt_clk_div *clk_div)
{
	struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev);
	struct intel_dpll_hw_state *dpll_hw_state = &crtc_state->dpll_hw_state;
	int clock = crtc_state->port_clock;
	int vco = clk_div->vco;
	u32 prop_coef, int_coef, gain_ctl, targ_cnt;
	u32 lanestagger;

	memset(dpll_hw_state, 0, sizeof(*dpll_hw_state));

	if (vco >= 6200000 && vco <= 6700000) {
		prop_coef = 4;
		int_coef = 9;
		gain_ctl = 3;
		targ_cnt = 8;
	} else if ((vco > 5400000 && vco < 6200000) ||
			(vco >= 4800000 && vco < 5400000)) {
		prop_coef = 5;
		int_coef = 11;
		gain_ctl = 3;
		targ_cnt = 9;
	} else if (vco == 5400000) {
		prop_coef = 3;
		int_coef = 8;
		gain_ctl = 1;
		targ_cnt = 9;
	} else {
		drm_err(&i915->drm, "Invalid VCO\n");
		return false;
	}
...

More poking around pointed to the i915 driver not being able to handle the data by monitor reported, so time to file an issue with the i915 driver group. Thanks to Ville Syrjälä who came back with a patch yesterday:

From 83e72257aca3386decb2b9d631c82e62732afd30 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@linux.intel.com>
Date: Tue, 2 Feb 2021 01:16:53 +0200
Subject: [PATCH] drm/i915: Reject 446-480MHz HDMI clock on GLK
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The BXT/GLK DPLL can't generate certain frequencies. We already
reject the 233-240MHz range on both. But on GLK the DPLL max
frequency was bumped from 300MHz to 594MHz, so now we get to
also worry about the 446-480MHz range (double the original
problem range). Reject any frequency within the higher
problematic range as well.

Cc: stable@vger.kernel.org
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/3000
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_hdmi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
index 66e1ac3887c6..b593a71e6517 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
@@ -2218,7 +2218,11 @@ hdmi_port_clock_valid(struct intel_hdmi *hdmi,
 					  has_hdmi_sink))
 		return MODE_CLOCK_HIGH;
 
-	/* BXT DPLL can't generate 223-240 MHz */
+	/* GLK DPLL can't generate 446-480 MHz */
+	if (IS_GEMINILAKE(dev_priv) && clock > 446666 && clock < 480000)
+		return MODE_CLOCK_RANGE;
+
+	/* BXT/GLK DPLL can't generate 223-240 MHz */
 	if (IS_GEN9_LP(dev_priv) && clock > 223333 && clock < 240000)
 		return MODE_CLOCK_RANGE;
 
-- 
2.26.2

I inserted the patch into the 5.10.12 kernel code and was back in business. The down side is I’ll have to remember to keep patching until it makes it into the kernel sources proper.