Skip to content

MS Surface 9 Pro 5G #46

Open
Open

Description

@tilator

Let's discuss here about MS Surface.

I booted the new image now. Then I removed all new files from /usr/lib/firmware/qcom/sc8280xp/MICROSOFT/DEVKIT23 folder.

Now it boots and reboots letting network and SSH come up.

Is it possible to run the script again to get those files back?

Activity

  1. tilator commented on Mar 4, 2024

    @tilator
    Author

    Deleting qcadsp8280.mbn makes it boot again. Other files are allowed.

    Attached is dmesg after this modification.
    dmesg_2.txt

  2. tilator commented on Mar 4, 2024

    @tilator
    Author

    Here is some addition to the dmesg:

    [  407.185520] r8152-cfgselector 5-1: USB disconnect, device number 2
    [  407.216411] firmware_class:__free_fw_priv: firmware_class: __free_fw_priv: fw-rtl_nic/rtl8153a-3.fw fw_priv=000000006b97e10a data=00000000803d95d2 size=1440
    [  407.240122] firmware_class:fw_name_devm_release: firmware_class: fw_name_devm_release: fw_name-rtl_nic/rtl8153a-3.fw devm-000000005ee3e6a4 released
    [  442.194004] usb 5-1: new full-speed USB device number 3 using xhci-hcd
    [  442.362830] usb 5-1: not running at top speed; connect to a high speed hub
    [  442.389990] usb 5-1: New USB device found, idVendor=25a4, idProduct=9311, bcdDevice= 2.01
    [  442.390029] usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [  442.390041] usb 5-1: Product: USB C Video Adaptor
    [  442.390052] usb 5-1: Manufacturer: USB C
    [  442.390061] usb 5-1: SerialNumber: 000000000001
    [  457.509207] usb 5-1: USB disconnect, device number 3
    [  467.314754] usb 5-1: new full-speed USB device number 4 using xhci-hcd
    [  467.482770] usb 5-1: not running at top speed; connect to a high speed hub
    [  467.511212] usb 5-1: New USB device found, idVendor=25a4, idProduct=9311, bcdDevice= 2.01
    [  467.511254] usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [  467.511267] usb 5-1: Product: USB C Video Adaptor
    [  467.511277] usb 5-1: Manufacturer: USB C
    [  467.511286] usb 5-1: SerialNumber: 000000000001
    [  481.143084] usb 5-1: USB disconnect, device number 4
    [  496.696187] usb 5-1: new high-speed USB device number 5 using xhci-hcd
    [  496.851861] usb 5-1: New USB device found, idVendor=0bda, idProduct=8153, bcdDevice=30.00
    [  496.851901] usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=6
    [  496.851914] usb 5-1: Product: USB 10/100/1000 LAN
    [  496.851924] usb 5-1: Manufacturer: Realtek
    [  496.851932] usb 5-1: SerialNumber: 000001000000
    [  497.061800] r8152-cfgselector 5-1: reset high-speed USB device number 5 using xhci-hcd
    [  497.224598] firmware_class:__allocate_fw_priv: firmware_class: __allocate_fw_priv: fw-rtl_nic/rtl8153a-3.fw fw_priv=0000000005c09bb9
    [  497.224736] firmware_class:fw_get_filesystem_firmware: r8152 5-1:1.0: loading /lib/firmware/updates/6.7.1-gd7da5073ce3d/rtl_nic/rtl8153a-3.fw failed for no such file or directory.
    [  497.224809] firmware_class:fw_get_filesystem_firmware: r8152 5-1:1.0: loading /lib/firmware/updates/rtl_nic/rtl8153a-3.fw failed for no such file or directory.
    [  497.224835] firmware_class:fw_get_filesystem_firmware: r8152 5-1:1.0: loading /lib/firmware/6.7.1-gd7da5073ce3d/rtl_nic/rtl8153a-3.fw failed for no such file or directory.
    [  497.227767] firmware_class:fw_get_filesystem_firmware: r8152 5-1:1.0: loading /lib/firmware/rtl_nic/rtl8153a-3.fw failed for no such file or directory.
    [  497.227794] firmware_class:fw_get_filesystem_firmware: r8152 5-1:1.0: loading /lib/firmware/updates/6.7.1-gd7da5073ce3d/rtl_nic/rtl8153a-3.fw.zst failed for no such file or directory.
    [  497.227810] firmware_class:fw_get_filesystem_firmware: r8152 5-1:1.0: loading /lib/firmware/updates/rtl_nic/rtl8153a-3.fw.zst failed for no such file or directory.
    [  497.227823] firmware_class:fw_get_filesystem_firmware: r8152 5-1:1.0: loading /lib/firmware/6.7.1-gd7da5073ce3d/rtl_nic/rtl8153a-3.fw.zst failed for no such file or directory.
    [  497.239634] firmware_class:fw_get_filesystem_firmware: r8152 5-1:1.0: Loading firmware from /lib/firmware/rtl_nic/rtl8153a-3.fw.zst
    [  497.239648] firmware_class:fw_get_filesystem_firmware: r8152 5-1:1.0: f/w decompressing rtl_nic/rtl8153a-3.fw
    [  497.239788] firmware_class:fw_set_page_data: firmware_class: fw_set_page_data: fw-rtl_nic/rtl8153a-3.fw fw_priv=0000000005c09bb9 data=000000007f121b56 size=1440
    [  497.239868] firmware_class:fw_log_firmware_info: r8152 5-1:1.0: Loaded FW: rtl_nic/rtl8153a-3.fw, sha256: c7099a1b0fc80e02ff7276aacbb08b5771e2f5c763fb76a7a8df3a89d58d8208
    [  497.261019] r8152 5-1:1.0: load rtl8153a-3 v2 02/07/20 successfully
    [  497.290504] r8152 5-1:1.0 eth0: v1.12.13
    [  497.313277] usbcore: registered new interface driver r8153_ecm
    [  497.319984] r8152 5-1:1.0 enxa0cec80839bf: renamed from eth0
    [  499.917878] r8152 5-1:1.0 enxa0cec80839bf: carrier on
    

    This was taken by first removing USB-RJ45 adapter. Then connecting USB-HDMI adapter. Removing and connecting it second time. Then removing USB-HDMI and connecting USB-RJ45 again.

  3. jglathe commented on Mar 4, 2024

    @jglathe

    You can execute sudo fetch_sc8280xp_fw.sh, fetches the firmwares to /usr/lib/firmware/updates. Every time you think they should be refreshed. @JeromeDeBretagne how about setting up a separate dts file like sc8280xp-microsoft-arcata.dts ? There will be some differences I'm sure, DP use for example and WWAN. Maybe a good idea to declare a separate firmware path, too.

  4. jglathe commented on Mar 4, 2024

    @jglathe

    Do you get a screen with the USB-C video adapter? Not impossible.

  5. jglathe commented on Mar 4, 2024

    @jglathe

    For debugging dp operation, please add drm.debug=0x100 to your boot command line.

  6. tilator commented on Mar 4, 2024

    @tilator
    Author

    how about setting up a separate dts file like sc8280xp-microsoft-arcata.dts ? There will be some differences I'm sure, DP use for example and WWAN. Maybe a good idea to declare a separate firmware path, too.

    How are these made? Does it need dtb compiled again using the arcata dts? I have not been compiling linux kernel for some years. I don't even know which cross-compiler it takes.

  7. tilator commented on Mar 4, 2024

    @tilator
    Author

    Do you get a screen with the USB-C video adapter? Not impossible.

    Nothing come up. I tried cold booting and connecting adapter while it was already up.

  8. tilator commented on Mar 4, 2024

    @tilator
    Author

    For debugging dp operation, please add drm.debug=0x100 to your boot command line.

    This is grub parameter, I suppose.

  9. tilator commented on Mar 4, 2024

    @tilator
    Author

    How about this qcadsp8280.mbn preventing it booting up. Might it be just some kind of loading order issue?

  10. jglathe commented on Mar 4, 2024

    @jglathe

    Need to look into the dmesg. The fun part is, after copying the firmwares they are also integrated into the initrd 😁 So they will be loaded, but they also should load. Yes it is a grub parameter.

  11. tilator commented on Mar 4, 2024

    @tilator
    Author

    Here is dmesg with grub debug option as you wished.
    dmesg_3.txt

  12. jglathe commented on Mar 4, 2024

    @jglathe

    How are these made? Does it need dtb compiled again using the arcata dts? I have not been compiling linux kernel for some years. I don't even know which cross-compiler it takes.

    You can compile on the sp9, no prob. Tthe separate dts file is given as boot parameter, usually by providing a link before update-grub. Thanks for the dmesg. I have created the new dts and a new branch.

  13. tilator commented on Mar 4, 2024

    @tilator
    Author

    Need to look into the dmesg. The fun part is, after copying the firmwares theay are also integrated into the initrd :grin So they will be loaded, but they also should load.

    Thats weird. How could removing one of the firmware files from userspace FS effect booting then.

  14. jglathe commented on Mar 4, 2024

    @jglathe

    Thats weird. How could removing one of the firmware files from userspace FS effect booting then.

    No idea yet. But many of these are actually loaded.

  15. JeromeDeBretagne commented on Mar 4, 2024

    @JeromeDeBretagne

    You can execute sudo fetch_sc8280xp_fw.sh, fetches the firmwares to /usr/lib/firmware/updates. Every time you think they should be refreshed. @JeromeDeBretagne how about setting up a separate dts file like sc8280xp-microsoft-arcata.dts ? There will be some differences I'm sure, DP use for example and WWAN. Maybe a good idea to declare a separate firmware path, too.

    Yes, I just did in fact :-) You can find my update here, I can copy & past it here if you want.

  16. 170 remaining items

  17. JeromeDeBretagne commented on Jun 28, 2024

    @JeromeDeBretagne

    I have added the 2 commits to this branch for reference:
    https://github.com/JeromeDeBretagne/linux_surface_pro_9_5G/commits/surface/sp9-5G/surface-keyboard-wip/

    With these latest hacks, I'm getting very close to a usable Surface Pro 9 5G running Linux.

  18. qzed commented on Jun 28, 2024

    @qzed
    Member

    If this was the right assumption, do you have any other suggestions to find out the correct one? From the ACPI table again? From the Windows drivers somehow?

    It should be specified in ACPI. I doubt that the driver somehow hard-codes it, so that will just look it up from ACPI as well.

  19. JeromeDeBretagne commented on Jun 28, 2024

    @JeromeDeBretagne

    It should be specified in ACPI. I doubt that the driver somehow hard-codes it, so that will just look it up from ACPI as well.

    Got it, that makes sense. Sadly I'm struggling with ACPI...

    Earlier, you had mentioned this approach:

    And you can actually also verify the GPIO: There's a command to tell the EC that the device is suspended (without actually suspending it). If you send that to the EC it will stop sending messages, but it will start pulling on the GPIO. So you can add a print statement to the IRQ handler. And with that you can then check that e.g. when you plug in/out a charger you actually trigger that IRQ.

    Is there an easy way to send this command to the EC?

  20. qzed commented on Jun 28, 2024

    @qzed
    Member

    And you can actually also verify the GPIO: There's a command to tell the EC that the device is suspended (without actually suspending it). If you send that to the EC it will stop sending messages, but it will start pulling on the GPIO. So you can add a print statement to the IRQ handler. And with that you can then check that e.g. when you plug in/out a charger you actually trigger that IRQ.

    Is there an easy way to send this command to the EC?

    You would have to set up the pin in the driver first.

    Then you can modprobe surface_aggregator_cdev and use this script to run

    ./scripts/ssam/ctrl.py 0x01 0x01 0x15 0x00 0x01 
    

    to send the "display off" notification which should disable events and

    ./scripts/ssam/ctrl.py 0x01 0x01 0x16 0x00 0x01 
    

    to send the "display on" notification and enable events again.

    When it's in "display-off state", events should be disabled, and the EC should pull on the GPIO instead. You'll also need to enable debug logging (or change the respective log level in the IRQ handler here).

  21. JeromeDeBretagne commented on Jun 29, 2024

    @JeromeDeBretagne

    Thanks, not for the faint of heart !

  22. qzed commented on Jun 30, 2024

    @qzed
    Member

    What I forgot to mention: When it's in display off mode, you can trigger events by connecting/disconnecting the AC cable.

    Also: I think you can't really break or brick anything by sending commands to the EC (at least so far I haven't managed to do any permanent harm and I've poked at it quite a bit...). Worst case, you have to do a hard-reset by holding the power + volume up button until it reboots into UEFI.

  23. rthorntn commented on Jul 17, 2024

    @rthorntn

    Just checking if this work changes anything:

    https://www.phoronix.com/news/ASUS-Vivbook-S-15-Elite-X-Linux

    I have a Windows Dev Kit 2023 gathering dust (Windows bloat is horrible) and would love to put Linux on it, do you know if your project has got Linux working on the dev kit?

    Thanks.

  24. JeromeDeBretagne commented on Jul 17, 2024

    @JeromeDeBretagne

    Yes, there is a devicetree working for the MS Windows Dev Kit from 2023, it hasn't been submitted upstream to the mainline Linux kernel though AFAIK. Look for Volterra or Blackrock, it's the codename of this device.

  25. jglathe commented on Jul 17, 2024

    @jglathe

    The repo for wdk2023 is here. Also, there are pre-installed desktop images available here, and installable kernel packages here. I guess I will create one new image for Ubuntu 24.04, which is on par with flash-kernel and can handle newly installed kernel packages well. Maybe for 6.10, it's out now.

  26. rthorntn commented on Jul 24, 2024

    @rthorntn

    Thanks!

  27. added a commit that references this issue on Aug 13, 2024
  28. JeromeDeBretagne commented on Aug 19, 2024

    @JeromeDeBretagne

    So it looks like it can't configure the GPIO you set as wakeup pin (gpio85). I guess this likely means [...] that it has been configured for something else wrongly before (maybe check the DT and its includes that you don't specify it twice).

    I've finally found the issue: the dmesg error message was not pointing explicitly to it, but I've realised that this gpio was blocked because it was within the gpio-reserved-ranges of the &tlmm entry... I had reused the ranges from the CRD but I should have used the ranges from the ThinkPad X13s as it had been fixed in this patch:
    https://lore.kernel.org/all/20230803-topic-x13s_pin-v1-1-fae792274e89@linaro.org/

    Now I don't need my two commits "hack:" anymore!

  29. qzed commented on Aug 20, 2024

    @qzed
    Member

    Ahh that makes sense now. I think I loosely remember having to deal with the reserved ranges on the SPX in the early days as well... sorry I didn't remember that earlier.

  30. JeromeDeBretagne commented on Aug 20, 2024

    @JeromeDeBretagne

    No worries at all, you've been of fantastic help!

    I've just seen that some patches [1] based on your work are being proposed / discussed on the kernel mailing list to get the support upstream, that's excellent news, congratulations.

    [1] https://lore.kernel.org/lkml/20240814-topic-sam-v3-0-a84588aad233@quicinc.com/

  31. qzed commented on Aug 20, 2024

    @qzed
    Member

    Yeah, @konradybcio has picked those up (and significantly improved them). Now I just need to find some time to clean up and break down the SPX tree and prep it for sumission...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions