Linux Tegra architecture development
 help / color / mirror / Atom feed
* Reviving Nyan support
@ 2024-11-08  0:46 Michał Pecio
  2024-12-04 17:50 ` Thierry Reding
  0 siblings, 1 reply; 4+ messages in thread
From: Michał Pecio @ 2024-11-08  0:46 UTC (permalink / raw)
  To: linux-tegra

[-- Attachment #1: Type: text/plain, Size: 1550 bytes --]

Hi,

It came to my attention that Nvidia provides some degree of mainline
support for old Tegra SoCs, so I wanted to try it on my Acer CB5-311.

I checked out v6.11.5, applied tegra_defconfig and booted this kernel
with tegra124-nyan-big-fhd.dts from mainline, using CrOS bootloader.

The kernel came up and userspace got to the login prompt, but then some
issues appeared:

1. Most importantly, the EC keyboard doesn't work, I had to use USB to
log in and see what's going on. Turns out, tegra_spi_set_hw_cs_timing()
rejects timings expressed in units other than clock cycles, while slave
drivers like cros_ec apparently prefer to specify us/ns.

Searching around, I found I'm not the first one to run into this issue,
not only on Nyan, not only on T124. I got around it by disabling this
callback altogether, because SPI core apparently has a workaround. But 
maybe it's preferable to fix it properly?

2. I noticed that tegra_defconfig doesn't include LPAE. Tomorrow I will
see if full 4GB works. Maybe LPAE could be a default on 32 bits?

3. Some more warnings about bypassed regulators and missing touchpad
supply (but the touchpad is enabled and works, per evtest at least).

4. Doesn't come out of suspend. No idea what's wrong, how to debug it?

5. USB is power-cycled on boot, which is a bit annoying as I'm booting
from a USB connected disk. IIRC CrOS kernel 3.10 wasn't doing it. Any
suggestions where to look?

WiFi and XHCI are OK, Nouveau loads but not tested yet.
I'll attach dmesg from this machine (with broken SPI).

Thanks,
Michal

[-- Attachment #2: nyan-dmesg-6.11.5 --]
[-- Type: application/octet-stream, Size: 24113 bytes --]

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 6.11.5 (alarm@alarm) (gcc (GCC) 14.1.1 20240507, GNU ld (GNU Binutils) 2.38) #2 SMP PREEMPT Thu Nov  7 11:12:18 UTC 2024
[    0.000000] CPU: ARMv7 Processor [413fc0f3] revision 3 (ARMv7), cr=10c5387d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
[    0.000000] OF: fdt: Machine model: Acer Chromebook 13 CB5-311
[    0.000000] OF: fdt: Ignoring memory block 0x100000000 - 0x180000000
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] cma: Reserved 64 MiB at 0xf9c00000 on node -1
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000080000000-0x00000000afffffff]
[    0.000000]   HighMem  [mem 0x00000000b0000000-0x00000000fdfe9fff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080000000-0x00000000fdfe9fff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x00000000fdfe9fff]
[    0.000000] percpu: Embedded 17 pages/cpu s39884 r8192 d21556 u69632
[    0.000000] pcpu-alloc: s39884 r8192 d21556 u69632 alloc=17*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 
[    0.000000] Kernel command line: cros_secure console=tty1 loglevel=7 panic=0 root=/dev/sda1 rootwait ro lsm.module_locking=0 
[    0.000000] Unknown kernel command line parameters "cros_secure", will be passed to user space.
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes, linear)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 516074
[    0.000000] mem auto-init: stack:all(zero), heap alloc:off, heap free:off
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] trace event string verifier disabled
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu: 	RCU event tracing is enabled.
[    0.000000] 	Trampoline variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] RCU Tasks: Setting shift to 2 and lim to 1 rcu_task_cb_adjust=1 rcu_task_cpu_ids=4.
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] /interrupt-controller@60004000: 160 interrupts forwarded to /interrupt-controller@50041000
[    0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention.
[    0.000000] clocksource: tegra_suspend_timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275000 ns
[    0.000000] arch_timer: cp15 timer(s) running at 12.00MHz (virt).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x2c47f4ee7, max_idle_ns: 440795202497 ns
[    0.000000] sched_clock: 56 bits at 12MHz, resolution 83ns, wraps every 4398046511096ns
[    0.000007] Switching to timer-based delay loop, resolution 83ns
[    0.000119] Console: colour dummy device 80x30
[    0.000128] printk: legacy console [tty1] enabled
[    0.000315] Calibrating delay loop (skipped), value calculated using timer frequency.. 24.00 BogoMIPS (lpj=120000)
[    0.000330] CPU: Testing write buffer coherency: ok
[    0.000364] CPU0: Spectre v2: firmware did not set auxiliary control register IBE bit, system vulnerable
[    0.000375] CPU0: Spectre BHB: enabling loop workaround for all CPUs
[    0.000383] pid_max: default: 32768 minimum: 301
[    0.000465] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.000479] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.000854] /cpus/cpu@0 missing clock-frequency property
[    0.000879] /cpus/cpu@1 missing clock-frequency property
[    0.000896] /cpus/cpu@2 missing clock-frequency property
[    0.000914] /cpus/cpu@3 missing clock-frequency property
[    0.000924] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.001433] Setting up static identity map for 0x80100000 - 0x801000ac
[    0.001502] rcu: Hierarchical SRCU implementation.
[    0.001511] rcu: 	Max phase no-delay instances is 1000.
[    0.001625] Timer migration: 1 hierarchy levels; 8 children per group; 1 crossnode level
[    0.002036] Tegra Revision: A01 SKU: 131 CPU Process: 1 SoC Process: 1
[    0.002513] smp: Bringing up secondary CPUs ...
[    0.002858] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.002866] CPU1: Spectre v2: firmware did not set auxiliary control register IBE bit, system vulnerable
[    0.003274] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.003281] CPU2: Spectre v2: firmware did not set auxiliary control register IBE bit, system vulnerable
[    0.003648] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.003655] CPU3: Spectre v2: firmware did not set auxiliary control register IBE bit, system vulnerable
[    0.009976] smp: Brought up 1 node, 4 CPUs
[    0.009986] SMP: Total of 4 processors activated (96.00 BogoMIPS).
[    0.009995] CPU: All CPU(s) started in SVC mode.
[    0.010259] Memory: 1955420K/2064296K available (13312K kernel code, 1611K rwdata, 3916K rodata, 1024K init, 308K bss, 40036K reserved, 65536K cma-reserved, 1212328K highmem)
[    0.010526] devtmpfs: initialized
[    0.018163] VFP support v0.3: implementor 41 architecture 4 part 30 variant f rev 0
[    0.018287] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.018305] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.018801] pinctrl core: initialized pinctrl subsystem
[    0.019429] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.019986] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.020481] thermal_sys: Registered thermal governor 'step_wise'
[    0.020508] cpuidle: using governor menu
[    0.020694] ramoops: The memory size and the record/console size must be non-zero
[    0.020706] ramoops 87f00000.ramoops: probe with driver ramoops failed with error -22
[    0.025001] platform 70000868.pinmux: Fixed dependency cycle(s) with /pinmux@70000868/pinmux
[    0.033048] No ATAGs?
[    0.033113] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.033125] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.043938] iommu: Default domain type: Translated
[    0.043954] iommu: DMA domain TLB invalidation policy: strict mode
[    0.044440] SCSI subsystem initialized
[    0.044527] libata version 3.00 loaded.
[    0.044609] usbcore: registered new interface driver usbfs
[    0.044631] usbcore: registered new interface driver hub
[    0.044653] usbcore: registered new device driver usb
[    0.044705] mc: Linux media interface: v0.10
[    0.044725] videodev: Linux video capture interface: v2.00
[    0.044747] pps_core: LinuxPPS API ver. 1 registered
[    0.044754] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.044768] PTP clock support registered
[    0.044939] Advanced Linux Sound Architecture Driver Initialized.
[    0.045225] Bluetooth: Core ver 2.22
[    0.045242] NET: Registered PF_BLUETOOTH protocol family
[    0.045249] Bluetooth: HCI device and connection manager initialized
[    0.045260] Bluetooth: HCI socket layer initialized
[    0.045269] Bluetooth: L2CAP socket layer initialized
[    0.045278] Bluetooth: SCO socket layer initialized
[    0.045455] nfc: nfc_init: NFC Core ver 0.1
[    0.045497] NET: Registered PF_NFC protocol family
[    0.045559] vgaarb: loaded
[    0.045700] clocksource: Switched to clocksource arch_sys_counter
[    0.053802] NET: Registered PF_INET protocol family
[    0.053898] IP idents hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.054504] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.054569] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.054582] TCP established hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.054618] TCP bind hash table entries: 8192 (order: 5, 131072 bytes, linear)
[    0.054734] TCP: Hash tables configured (established 8192 bind 8192)
[    0.054777] UDP hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.054802] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.054876] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.055075] RPC: Registered named UNIX socket transport module.
[    0.055085] RPC: Registered udp transport module.
[    0.055091] RPC: Registered tcp transport module.
[    0.055098] RPC: Registered tcp-with-tls transport module.
[    0.055104] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.055471] PCI: CLS 0 bytes, default 64
[    0.055979] Initialise system trusted keyrings
[    0.056055] workingset: timestamp_bits=30 max_order=19 bucket_order=0
[    0.056180] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.056298] NFS: Registering the id_resolver key type
[    0.056328] Key type id_resolver registered
[    0.056335] Key type id_legacy registered
[    0.101793] Key type asymmetric registered
[    0.101804] Asymmetric key parser 'x509' registered
[    0.101844] bounce: pool size: 64 pages
[    0.101862] io scheduler mq-deadline registered
[    0.101870] io scheduler kyber registered
[    0.101884] io scheduler bfq registered
[    0.102846] gpio gpiochip0: Static allocation of GPIO base is deprecated, use dynamic allocation.
[    0.105957] tegra-apbdma 60020000.dma: Tegra20 APB DMA driver registered 32 channels
[    0.106547] tegra-pmc 7000e400.pmc: i2c-thermtrip node not found, emergency thermal reset disabled.
[    0.106943] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    0.108294] 70006000.serial: ttyS0 at MMIO 0x70006000 (irq = 70, base_baud = 25500000) is a Tegra
[    0.109015] tegra-host1x 50000000.host1x: Adding to iommu group 0
[    0.111705] tegra-vic 54340000.vic: Adding to iommu group 1
[    0.115216] loop: module loaded
[    0.116163] spi spi0.0: Invalid delay unit 2, should be SPI_DELAY_UNIT_SCK
[    0.116190] spi-tegra114 7000d400.spi: can't setup spi0.0, status -22
[    0.116202] spi_master spi0: spi_device register error /spi@7000d400/cros-ec@0
[    0.116218] spi_master spi0: Failed to create SPI device for /spi@7000d400/cros-ec@0
[    0.116731] spi spi1.0: Invalid delay unit 2, should be SPI_DELAY_UNIT_SCK
[    0.116752] spi-tegra114 7000da00.spi: can't setup spi1.0, status -22
[    0.116763] spi_master spi1: spi_device register error /spi@7000da00/flash@0
[    0.116777] spi_master spi1: Failed to create SPI device for /spi@7000da00/flash@0
[    0.117754] CAN device driver interface
[    0.117775] igb: Intel(R) Gigabit Ethernet Network Driver
[    0.117783] igb: Copyright (c) 2007-2014 Intel Corporation.
[    0.117814] pegasus: Pegasus/Pegasus II USB Ethernet driver
[    0.117835] usbcore: registered new interface driver pegasus
[    0.117855] usbcore: registered new interface driver asix
[    0.117876] usbcore: registered new interface driver ax88179_178a
[    0.117896] usbcore: registered new interface driver cdc_ether
[    0.117915] usbcore: registered new interface driver smsc75xx
[    0.117934] usbcore: registered new interface driver smsc95xx
[    0.117955] usbcore: registered new interface driver net1080
[    0.117975] usbcore: registered new interface driver cdc_subset
[    0.117994] usbcore: registered new interface driver zaurus
[    0.118013] usbcore: registered new interface driver cdc_ncm
[    0.118035] usbcore: registered new interface driver r8153_ecm
[    0.118319] usbcore: registered new interface driver cdc_acm
[    0.118328] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[    0.118349] usbcore: registered new interface driver cdc_wdm
[    0.118371] usbcore: registered new interface driver usb-storage
[    0.119712] tegra_rtc 7000e000.rtc: registered as rtc1
[    0.119724] tegra_rtc 7000e000.rtc: Tegra internal Real Time Clock
[    0.119845] i2c_dev: i2c /dev entries driver
[    0.123391] i2c 4-0040: Fixed dependency cycle(s) with /i2c@7000d000/pmic@40/pinmux
[    0.123893] as3722 4-0040: AS3722 with revision 0x1 found
[    0.128740] as3722-rtc as3722-rtc: registered as rtc0
[    0.129352] as3722-rtc as3722-rtc: setting system clock to 2024-11-07T16:19:17 UTC (1730996357)
[    0.129368] as3722-rtc as3722-rtc: RTC interrupt 97
[    0.131393] +1.35V_LP0(sd3): Bringing 0uV into 1350000-1350000uV
[    0.133030] gspca_main: v2.14.0 registered
[    0.133056] usbcore: registered new interface driver uvcvideo
[    0.133630] lm90 0-004c: supply vcc not found, using dummy regulator
[    0.133952] +1.05V_RUN: Bringing 0uV into 1050000-1050000uV
[    0.136111] +1.8V_RUN_CAM: Bringing 0uV into 1800000-1800000uV
[    0.137302] +1.00V_LP0_VDD_RTC: Bringing 1100000uV into 1000000-1000000uV
[    0.138245] +3.3V_RUN_CAM: Bringing 0uV into 2800000-2800000uV
[    0.138618] +1.2V_RUN_CAM_FRONT: Bringing 0uV into 1200000-1200000uV
[    0.138963] +VDDIO_SDMMC3: bypassed regulator has no supply!
[    0.138981] as3722-regulator as3722-regulator: regulator 13 register failed -517
[    0.146036] hwmon hwmon0: temp2_input not attached to any thermal zone
[    0.146381] tegra-wdt 60005000.timer: initialized (heartbeat = 120 sec, nowayout = 0)
[    0.146508] Bluetooth: HCI UART driver ver 2.3
[    0.146518] Bluetooth: HCI UART protocol H4 registered
[    0.146565] Bluetooth: HCI UART protocol Broadcom registered
[    0.146981] sdhci: Secure Digital Host Controller Interface driver
[    0.146991] sdhci: Copyright(c) Pierre Ossman
[    0.146998] sdhci-pltfm: SDHCI platform and OF driver helper
[    0.147323] usbcore: registered new interface driver usbhid
[    0.147333] usbhid: USB HID core driver
[    0.148064] tegra-emc 7001b000.external-memory-controller: 64bit DRAM bus
[    0.148375] tegra-emc 7001b000.external-memory-controller: OPP HW ver. 0x1, current clock rate 792 MHz
[    0.149082] sdhci-tegra 700b0400.mmc: Got CD GPIO
[    0.149105] sdhci-tegra 700b0400.mmc: Got WP GPIO
[    0.149471] hw perfevents: enabled with armv7_cortex_a15 PMU driver, 7 counters available
[    0.152953] tegra30-i2s 70301100.i2s: DMA channels sourced from device 70300000.ahub
[    0.155968] mmc1: Invalid maximum block size, assuming 512 bytes
[    0.158720] input: tegra-hda HDMI/DP,pcm=3 as /devices/soc0/70030000.hda/sound/card0/input0
[    0.186205] max98090 0-0010: MAX98090 REVID=0x43
[    0.188092] max98090 0-0010: use default 2.8v micbias
[    0.188249] mmc1: SDHCI controller on 700b0600.mmc [700b0600.mmc] using ADMA 64-bit
[    0.192274] input: GoogleNyanBig Headphones as /devices/soc0/sound/sound/card1/input1
[    0.192389] input: GoogleNyanBig Mic Jack as /devices/soc0/sound/sound/card1/input2
[    0.192782] NET: Registered PF_INET6 protocol family
[    0.193516] Segment Routing with IPv6
[    0.193551] In-situ OAM (IOAM) with IPv6
[    0.193598] mip6: Mobile IPv6
[    0.193607] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    0.194112] NET: Registered PF_PACKET protocol family
[    0.194127] NET: Registered PF_KEY protocol family
[    0.194135] can: controller area network core
[    0.194158] NET: Registered PF_CAN protocol family
[    0.194167] can: raw protocol
[    0.194175] can: broadcast manager protocol
[    0.194184] can: netlink gateway - max_hops=1
[    0.194320] Bluetooth: RFCOMM socket layer initialized
[    0.194333] Bluetooth: RFCOMM ver 1.11
[    0.194345] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    0.194356] Bluetooth: BNEP socket layer initialized
[    0.194363] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[    0.194373] Bluetooth: HIDP socket layer initialized
[    0.194538] Key type dns_resolver registered
[    0.194940] Registering SWP/SWPB emulation handler
[    0.200319] Loading compiled-in X.509 certificates
[    0.204792] tegra-dc 54200000.dc: Adding to iommu group 1
[    0.207458] as3722 4-0040: Failed to create device link (0x180) with regulator-3v3run
[    0.213131] tegra-dc 54240000.dc: Adding to iommu group 1
[    0.220514] as3722-regulator as3722-regulator: DMA mask not set
[    0.222339] sdhci-tegra 700b0000.mmc: allocated mmc-pwrseq
[    0.222628] sdhci-tegra 700b0400.mmc: Got CD GPIO
[    0.222650] sdhci-tegra 700b0400.mmc: Got WP GPIO
[    0.228221] cpufreq: cpufreq_online: CPU0: Running at unlisted initial frequency: 2100000 KHz, changing to: 2116500 KHz
[    0.229900] +VDDIO_SDMMC3: bypassed regulator has no supply!
[    0.230455] +1.05V_RUN_CAM_REAR: Bringing 0uV into 1050000-1050000uV
[    0.230642] mmc0: Invalid maximum block size, assuming 512 bytes
[    0.230929] +2.8V_RUN_TOUCH: Bringing 0uV into 2800000-2800000uV
[    0.232363] +2.8V_RUN_CAM_AF: Bringing 0uV into 2800000-2800000uV
[    0.232884] +1.8V_RUN_VPP_FUSE: Bringing 0uV into 1800000-1800000uV
[    0.245060] tegra-xusb 70090000.usb: Firmware timestamp: 2014-09-16 02:10:07 UTC
[    0.245076] tegra-xusb 70090000.usb: xHCI Host Controller
[    0.245092] tegra-xusb 70090000.usb: new USB bus registered, assigned bus number 1
[    0.245940] tegra-xusb 70090000.usb: hcc params 0x0184f525 hci version 0x100 quirks 0x0000000000000010
[    0.245968] tegra-xusb 70090000.usb: irq 130, io mem 0x70090000
[    0.245988] tegra-xusb 70090000.usb: xHCI Host Controller
[    0.246000] tegra-xusb 70090000.usb: new USB bus registered, assigned bus number 2
[    0.246011] tegra-xusb 70090000.usb: Host supports USB 3.0 SuperSpeed
[    0.246371] hub 1-0:1.0: USB hub found
[    0.246400] hub 1-0:1.0: 6 ports detected
[    0.246825] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[    0.247083] hub 2-0:1.0: USB hub found
[    0.247105] hub 2-0:1.0: 2 ports detected
[    0.248673] sdhci-tegra 700b0400.mmc: Got CD GPIO
[    0.248742] sdhci-tegra 700b0400.mmc: Got WP GPIO
[    0.249997] tegra-sor 54540000.sor: missing output definition for heads in DT
[    0.253930] [drm] Initialized tegra 1.0.0 for drm on minor 0
[    0.255617] mmc0: SDHCI controller on 700b0000.mmc [700b0000.mmc] using ADMA 64-bit
[    0.256521] mmc2: Invalid maximum block size, assuming 512 bytes
[    0.287527] mmc2: SDHCI controller on 700b0400.mmc [700b0400.mmc] using ADMA 64-bit
[    0.329810] mmc1: new high speed MMC card at address 0001
[    0.330546] mmcblk1: mmc1:0001 HBG4e\x05 29.1 GiB
[    0.337644]  mmcblk1: p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13
[    0.343061] mmcblk1boot0: mmc1:0001 HBG4e\x05 4.00 MiB
[    0.344278] mmcblk1boot1: mmc1:0001 HBG4e\x05 4.00 MiB
[    0.345450] mmcblk1rpmb: mmc1:0001 HBG4e\x05 4.00 MiB, chardev (246:0)
[    0.410334] mmc0: new high speed SDIO card at address 0001
[    0.514957] Console: switching to colour frame buffer device 240x67
[    0.535014] drm drm: [drm] fb0: tegradrmfb frame buffer device
[    0.535995] input: gpio-keys as /devices/soc0/gpio-keys/input/input3
[    0.536181] usb 1-2: new high-speed USB device number 2 using tegra-xusb
[    0.537208] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    0.540678] Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    0.541839] Loaded X.509 cert 'wens: 61c038651aabdcf94bd0ac7ff06c7248db18c600'
[    0.542017] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    0.542101] cfg80211: failed to load regulatory.db
[    0.542258] clk: Disabling unused clocks
[    0.542639] PM: genpd: Disabling unused power domains
[    0.542754] ALSA device list:
[    0.542790]   #0: tegra-hda at 0x70038000 irq 120
[    0.542837]   #1: GoogleNyanBig
[    0.543054] Waiting for root device /dev/sda1...
[    0.863043] usb 1-2: Found UVC 1.00 device HD WebCam (1bcf:2c67)
[    1.236190] usb 1-1: new low-speed USB device number 3 using tegra-xusb
[    1.440140] input: NOVATEK Classic USB Keyboard as /devices/soc0/70090000.usb/usb1/1-1/1-1:1.0/0003:0461:4EBC.0001/input/input4
[    1.507155] hid-generic 0003:0461:4EBC.0001: input: USB HID v1.10 Keyboard [NOVATEK Classic USB Keyboard] on usb-70090000.usb-1/input0
[    1.516640] input: NOVATEK Classic USB Keyboard System Control as /devices/soc0/70090000.usb/usb1/1-1/1-1:1.1/0003:0461:4EBC.0002/input/input5
[    1.587044] input: NOVATEK Classic USB Keyboard Consumer Control as /devices/soc0/70090000.usb/usb1/1-1/1-1:1.1/0003:0461:4EBC.0002/input/input6
[    1.588012] hid-generic 0003:0461:4EBC.0002: input: USB HID v1.10 Device [NOVATEK Classic USB Keyboard] on usb-70090000.usb-1/input1
[    5.025919] usb 1-3: new high-speed USB device number 4 using tegra-xusb
[    5.216597] usb-storage 1-3:1.0: USB Mass Storage device detected
[    5.221034] scsi host0: usb-storage 1-3:1.0
[    6.247409] scsi 0:0:0:0: Direct-Access     Generic  External         1.04 PQ: 0 ANSI: 4
[    6.298002] sd 0:0:0:0: [sda] 234441648 512-byte logical blocks: (120 GB/112 GiB)
[    6.300264] sd 0:0:0:0: [sda] Write Protect is off
[    6.300516] sd 0:0:0:0: [sda] Mode Sense: 21 00 00 00
[    6.302205] sd 0:0:0:0: [sda] No Caching mode page found
[    6.302458] sd 0:0:0:0: [sda] Assuming drive cache: write through
[    6.443808]  sda: sda1 sda2 sda3
[    6.446555] sd 0:0:0:0: [sda] Attached SCSI disk
[    6.585614] EXT4-fs (sda1): mounted filesystem 49f9b3ca-0ce0-4992-8f69-2a9a5e70acdc ro with ordered data mode. Quota mode: disabled.
[    6.594391] VFS: Mounted root (ext4 filesystem) readonly on device 8:1.
[    6.639695] devtmpfs: mounted
[    6.655034] Freeing unused kernel image (initmem) memory: 1024K
[    6.666667] Run /sbin/init as init process
[    6.668804]   with arguments:
[    6.668811]     /sbin/init
[    6.668815]     cros_secure
[    6.668818]   with environment:
[    6.668820]     HOME=/
[    6.668823]     TERM=linux
[   11.176988] EXT4-fs (sda1): re-mounted 49f9b3ca-0ce0-4992-8f69-2a9a5e70acdc r/w. Quota mode: disabled.
[   12.495757] random: crng init done
[   13.772411] tegra_soctherm 700e2000.thermal-sensor: thermtrip: will shut down when cpu reaches 103000 mC
[   13.774547] tegra_soctherm 700e2000.thermal-sensor: throttrip: will throttle when cpu reaches 103000 mC
[   13.780614] tegra_soctherm 700e2000.thermal-sensor: thermtrip: will shut down when gpu reaches 101000 mC
[   13.780634] tegra_soctherm 700e2000.thermal-sensor: throttrip: will throttle when gpu reaches 101000 mC
[   13.781301] tegra_soctherm 700e2000.thermal-sensor: thermtrip: will shut down when pll reaches 103000 mC
[   13.781945] tegra_soctherm 700e2000.thermal-sensor: thermtrip: will shut down when mem reaches 103000 mC
[   14.651457] elan_i2c 1-0015: supply vcc not found, using dummy regulator
[   14.833148] elan_i2c 1-0015: Elan Touchpad: Module ID: 0x002a, Firmware: 0x000b, Sample: 0x000e, IAP: 0x000b
[   14.835200] input: Elan Touchpad as /devices/soc0/7000c400.i2c/i2c-1/1-0015/input/input7
[   23.276303] mwifiex_sdio mmc0:0001:1: info: FW download over, size 717068 bytes
[   24.006644] mwifiex_sdio mmc0:0001:1: WLAN FW is active
[   24.128926] mwifiex_sdio mmc0:0001:1: info: MWIFIEX VERSION: mwifiex 1.0 (15.68.19.p54) 
[   24.129169] mwifiex_sdio mmc0:0001:1: driver_version = mwifiex 1.0 (15.68.19.p54) 
[   27.299651] nouveau 57000000.gpu: Adding to iommu group 2
[   27.300284] nouveau 57000000.gpu: NVIDIA GK20A (0ea000a1)
[   27.300369] nouveau 57000000.gpu: imem: using IOMMU
[   27.438681] nouveau 57000000.gpu: DRM: VRAM: 0 MiB
[   27.438732] nouveau 57000000.gpu: DRM: GART: 1048576 MiB
[   27.440090] nouveau 57000000.gpu: DRM: MM: using COPY for buffer copies
[   27.440489] [drm] Initialized nouveau 1.4.0 for 57000000.gpu on minor 1
[   30.566037] +5V_VDD_TS_SW: disabling
[  217.502892] mwifiex_sdio mmc0:0001:1: info: trying to associate to bssid 64:66:b3:eb:12:ae
[  217.553093] mwifiex_sdio mmc0:0001:1: info: associated to bssid 64:66:b3:eb:12:ae successfully
[  221.398904] mwifiex_sdio mmc0:0001:1: info: successfully disconnected from 64:66:b3:eb:12:ae: reason code 3
[  232.161403] mwifiex_sdio mmc0:0001:1: info: trying to associate to bssid 64:66:b3:eb:12:ae
[  232.209457] mwifiex_sdio mmc0:0001:1: info: associated to bssid 64:66:b3:eb:12:ae successfully

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Reviving Nyan support
  2024-11-08  0:46 Reviving Nyan support Michał Pecio
@ 2024-12-04 17:50 ` Thierry Reding
  2024-12-04 19:30   ` Michał Pecio
  0 siblings, 1 reply; 4+ messages in thread
From: Thierry Reding @ 2024-12-04 17:50 UTC (permalink / raw)
  To: Michał Pecio; +Cc: linux-tegra

[-- Attachment #1: Type: text/plain, Size: 4489 bytes --]

On Fri, Nov 08, 2024 at 01:46:03AM +0100, Michał Pecio wrote:
> Hi,
> 
> It came to my attention that Nvidia provides some degree of mainline
> support for old Tegra SoCs, so I wanted to try it on my Acer CB5-311.

Exciting! I think I do have one of those devices, though equipped with a
Tegra132, so the 64-bit equivalent of Tegra124.

> I checked out v6.11.5, applied tegra_defconfig and booted this kernel
> with tegra124-nyan-big-fhd.dts from mainline, using CrOS bootloader.
> 
> The kernel came up and userspace got to the login prompt, but then some
> issues appeared:

Okay, that's pretty good given that we haven't had testers for a few
years now.

> 1. Most importantly, the EC keyboard doesn't work, I had to use USB to
> log in and see what's going on. Turns out, tegra_spi_set_hw_cs_timing()
> rejects timings expressed in units other than clock cycles, while slave
> drivers like cros_ec apparently prefer to specify us/ns.
> 
> Searching around, I found I'm not the first one to run into this issue,
> not only on Nyan, not only on T124. I got around it by disabling this
> callback altogether, because SPI core apparently has a workaround. But 
> maybe it's preferable to fix it properly?

I'm not sure what the right way is to fix this. The values in DT are
clearly required to be nanoseconds, so either the driver needs to learn
about those or the core would need to convert somehow. The core doesn't
know about what the driver supports, so it can't do a really good job.
Maybe a good compromise would be to have the core expose a helper that
can convert to clock cycles (the reverse is already done in
spi_delay_to_ns()), which drivers can then use if they only support
clock cycles.

I think that'd still be preferable over relying on the core's manual
delaying. If we can make it work, obviously.

> 2. I noticed that tegra_defconfig doesn't include LPAE. Tomorrow I will
> see if full 4GB works. Maybe LPAE could be a default on 32 bits?

I think LPAE cannot be enabled by default because it would break on
Tegra20 and Tegra30 which both don't support LPAE. Tegra114 was the
first to feature this (I think), so we'd need an extra LPAE config
that's applicable only for newer chips.

> 3. Some more warnings about bypassed regulators and missing touchpad
> supply (but the touchpad is enabled and works, per evtest at least).

Not sure how much can be done about this. Unless you can find the
schematics we'd probably have to do this on a best effort basis.

> 4. Doesn't come out of suspend. No idea what's wrong, how to debug it?

My first step when debugging suspend/resume issues is usually to pass
no_console_suspend on the kernel command-line. That's really only useful
for debugging consoles and it probably doesn't work well if you've only
got the framebuffer console.

Other than that it might be possible to try and validate suspend/resume
on a more "accessible" device (such as a Jetson TK1), fix any issues
that might have and hope that also fixes Nyan.

You may also want to play around with different suspend modes. Suspend
to memory is usually easier to make work. Anything else might require
assistance from the bootloader/firmware side (there's often a warmboot
binary that needs to be executed when resuming from lower, or I guess
higher depending on how you look at it, suspend modes).

> 5. USB is power-cycled on boot, which is a bit annoying as I'm booting
> from a USB connected disk. IIRC CrOS kernel 3.10 wasn't doing it. Any
> suggestions where to look?

Is this really the power going away and coming back up? In that case it
might be a regulator that's being temporarily disabled during boot and
then brought back up. It could also be a USB reset, which I think is
something that's absolutely necessary in order for the kernel to be able
to properly enumerate the devices.

If it's a regulator it might be possible to mark it as always-on.

What exactly are the side-effects of the power-cycle? Does it cause the
USB device not to work at all, or does it stall the boot, or perhaps
even break it (I assume not since you mentioned you can get to a login
prompt).

Let me know if you make any progress, or have any questions that I can
help with. I have limited options since most of the devices from that
era that I used to have access to have stopped working (or accumulated
lots of dust at this point), but I'm happy to help if I can.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Reviving Nyan support
  2024-12-04 17:50 ` Thierry Reding
@ 2024-12-04 19:30   ` Michał Pecio
  2024-12-05 11:16     ` Thierry Reding
  0 siblings, 1 reply; 4+ messages in thread
From: Michał Pecio @ 2024-12-04 19:30 UTC (permalink / raw)
  To: Thierry Reding; +Cc: linux-tegra

Hi,

> > The kernel came up and userspace got to the login prompt, but then
> > some issues appeared:  
> 
> Okay, that's pretty good given that we haven't had testers for a few
> years now.

I had some hopes because I saw that NVIDIA still tests new kernel
releases on T124 Jetson, although I don't know how much is tested.
The kernel seems to be in pretty good shape, save for those issues.

I found that graphics are a bigger problem: X is dog slow, and I get
black glxgears window and some 150fps, which doesn't look great.

Do you know if it's supposed to be like that or if it's a regression
or some screwup on my side? I have enabled Nouveau in the kernel and
installed X11 Nouveau driver and xorg.log shows that it loads.

Are there any other options besides Nouveau? Perhaps some newer L4T
release which would work with mainline host1x driver and Kepler? I
suppose anything that works on Jetson will work on Nyan too.

Currently this machine runs Ubuntu 14.04 L4T and 3.10 CrOS kernel,
so practically anything would be an improvement :)

>> SPI
>
> I'm not sure what the right way is to fix this. The values in DT are
> clearly required to be nanoseconds, so either the driver needs to
> learn about those or the core would need to convert somehow. The core
> doesn't know about what the driver supports, so it can't do a really
> good job. Maybe a good compromise would be to have the core expose a
> helper that can convert to clock cycles (the reverse is already done
> in spi_delay_to_ns()), which drivers can then use if they only support
> clock cycles.

I see that a few other drivers which bother to implement this callback
convert ns to clocks, so options would be to copy-paste their code or
put that stuff in SPI core. I have never looked at SPI before...

> I think LPAE cannot be enabled by default because it would break on
> Tegra20 and Tegra30 which both don't support LPAE.

Fair enough, it's not a huge deal.

> > 3. Some more warnings about bypassed regulators and missing touchpad
> > supply (but the touchpad is enabled and works, per evtest at
> > least).  
> 
> Not sure how much can be done about this. Unless you can find the
> schematics we'd probably have to do this on a best effort basis.

I actually have the schematic from some shady laptop repair website.
IIRC the touchpad runs from some major 3.3V rail which is always on,
so I didn't bother fixing this yet.

I also learned something new, that platform drivers can ask for their
probe to be deferred, which was responsible for some other warnings.
At this point I'm not sure if anything serious remains, but regulators
are another subsystem I know practically nothing about.

> My first step when debugging suspend/resume issues is usually to pass
> no_console_suspend on the kernel command-line. That's really only
> useful for debugging consoles and it probably doesn't work well if
> you've only got the framebuffer console.

I made zero progress on this, and frankly didn't even try. Serial ports
are only accessible by soldering to the board. I suppose I could try a
USB dongle, but it will go dark as soon as xhci is suspended.

> > 5. USB is power-cycled on boot, which is a bit annoying as I'm
> > booting from a USB connected disk. IIRC CrOS kernel 3.10 wasn't
> > doing it. Any suggestions where to look?  
> 
> Is this really the power going away and coming back up? In that case
> it might be a regulator that's being temporarily disabled during boot
> and then brought back up.

Yep, this exactly. I have fixed it already.

Thanks,
Michal

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Reviving Nyan support
  2024-12-04 19:30   ` Michał Pecio
@ 2024-12-05 11:16     ` Thierry Reding
  0 siblings, 0 replies; 4+ messages in thread
From: Thierry Reding @ 2024-12-05 11:16 UTC (permalink / raw)
  To: Michał Pecio; +Cc: linux-tegra

[-- Attachment #1: Type: text/plain, Size: 7136 bytes --]

On Wed, Dec 04, 2024 at 08:30:45PM +0100, Michał Pecio wrote:
> Hi,
> 
> > > The kernel came up and userspace got to the login prompt, but then
> > > some issues appeared:  
> > 
> > Okay, that's pretty good given that we haven't had testers for a few
> > years now.
> 
> I had some hopes because I saw that NVIDIA still tests new kernel
> releases on T124 Jetson, although I don't know how much is tested.
> The kernel seems to be in pretty good shape, save for those issues.
> 
> I found that graphics are a bigger problem: X is dog slow, and I get
> black glxgears window and some 150fps, which doesn't look great.
> Do you know if it's supposed to be like that or if it's a regression
> or some screwup on my side? I have enabled Nouveau in the kernel and
> installed X11 Nouveau driver and xorg.log shows that it loads.

That's kind of expected. At one point this was working mostly reliably
but given that there's been very limited testing, it's not a surprise
that this is somewhat defunct.

One thing to know, though, is that the Nouveau X11 driver won't do you
any good. The way that it works on Tegra is that the GPU is used only to
render to offscreen surfaces and the Tegra DRM/KMS driver will then scan
those buffers out to your display (via X's modesetting driver). In order
for this to work you need to enable the Nouveau and Tegra drivers in
Mesa and then they should be able to work together if you've got an up-
to-date X server. You might also need a bit of luck.

> Are there any other options besides Nouveau? Perhaps some newer L4T
> release which would work with mainline host1x driver and Kepler? I
> suppose anything that works on Jetson will work on Nyan too.

Unfortunately L4T doesn't work with any of this. Both the display and
GPU drivers are completely different things in L4T vs. upstream Linux. I
suppose you could try and port those drivers to a more recent kernel,
but I can't recommend it.

> Currently this machine runs Ubuntu 14.04 L4T and 3.10 CrOS kernel,
> so practically anything would be an improvement :)

The plan was to get upstream mostly to feature parity with L4T so that
it could serve as a long-term option for people after official software
support was dropped. We managed to do a bunch of things, but there are
certain aspects that aren't quite as polished as I wanted. Hardware
accelerated multimedia is among those. You can probably get some of it
working using the V4L2 Tegra VDE driver. GPU acceleration is another,
somewhat unfinished bit. Again, an up-to-date Mesa and X server should
get you there most of the way, but it's not been tested for a while, so
may have regressed.

> >> SPI
> >
> > I'm not sure what the right way is to fix this. The values in DT are
> > clearly required to be nanoseconds, so either the driver needs to
> > learn about those or the core would need to convert somehow. The core
> > doesn't know about what the driver supports, so it can't do a really
> > good job. Maybe a good compromise would be to have the core expose a
> > helper that can convert to clock cycles (the reverse is already done
> > in spi_delay_to_ns()), which drivers can then use if they only support
> > clock cycles.
> 
> I see that a few other drivers which bother to implement this callback
> convert ns to clocks, so options would be to copy-paste their code or
> put that stuff in SPI core. I have never looked at SPI before...

Yeah, that sounds about right.

> > I think LPAE cannot be enabled by default because it would break on
> > Tegra20 and Tegra30 which both don't support LPAE.
> 
> Fair enough, it's not a huge deal.

Yeah, it's a bit unfortunate, but you'll probably want some custom
kernel image anyway for this particular use-case. Things are much more
standardized on 64-bit ARM nowadays, but 32-bit ARM had some wild west,
shoot-from-the-hip vibes. =)

> > > 3. Some more warnings about bypassed regulators and missing touchpad
> > > supply (but the touchpad is enabled and works, per evtest at
> > > least).  
> > 
> > Not sure how much can be done about this. Unless you can find the
> > schematics we'd probably have to do this on a best effort basis.
> 
> I actually have the schematic from some shady laptop repair website.
> IIRC the touchpad runs from some major 3.3V rail which is always on,
> so I didn't bother fixing this yet.

Yeah, if it's an always-on regulator you can usually ignore those
warnings. It's always good to describe them and that'll get rid of the
warnings, but it shouldn't be necessary.

> I also learned something new, that platform drivers can ask for their
> probe to be deferred, which was responsible for some other warnings.
> At this point I'm not sure if anything serious remains, but regulators
> are another subsystem I know practically nothing about.

What kinds of warning were related to deferred probe? Normally the
related messages are debug level, so unless you've enabled those (which
is probably a good idea for what you're doing) you shouldn't be seeing
those.

> > My first step when debugging suspend/resume issues is usually to pass
> > no_console_suspend on the kernel command-line. That's really only
> > useful for debugging consoles and it probably doesn't work well if
> > you've only got the framebuffer console.
> 
> I made zero progress on this, and frankly didn't even try. Serial ports
> are only accessible by soldering to the board. I suppose I could try a
> USB dongle, but it will go dark as soon as xhci is suspended.

You could always try to see if you can prevent XHCI from being
suspended. Not sure if there's a standard way to do it, but worst case
you could try commenting out the code that does it, see if that gets you
anywhere. It'll probably still break at some point when interrupts get
disabled and such. Or it may break earlier since the USB subsystem is
probably not designed to stay up until that late.

Again, it might be better to check with a developer friendly device what
the status is with suspend/resume on Tegra124 in general. I think the
tests that we run periodically would've flagged any generic suspend and
resume issue, so it might be something specific to Nyan (possibly
display?). Have you tried poking the device in different ways after the
resume? Does it react at all? Does a network ping perhaps work? I could
also be that the system wake isn't properly hooked up or something. One
thing worth trying would be to use the RTC to wake the system up from
suspend. I think that's what we use in the daily testing. rtcwake is the
tool that you want to look into for that.

> > > 5. USB is power-cycled on boot, which is a bit annoying as I'm
> > > booting from a USB connected disk. IIRC CrOS kernel 3.10 wasn't
> > > doing it. Any suggestions where to look?  
> > 
> > Is this really the power going away and coming back up? In that case
> > it might be a regulator that's being temporarily disabled during boot
> > and then brought back up.
> 
> Yep, this exactly. I have fixed it already.

Excellent!

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-12-05 11:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-08  0:46 Reviving Nyan support Michał Pecio
2024-12-04 17:50 ` Thierry Reding
2024-12-04 19:30   ` Michał Pecio
2024-12-05 11:16     ` Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox