MS Surface 9 Pro 5G
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?
Deleting qcadsp8280.mbn makes it boot again. Other files are allowed.
Attached is dmesg after this modification. dmesg_2.txt
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.
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.
Do you get a screen with the USB-C video adapter? Not impossible.
For debugging dp operation, please add drm.debug=0x100 to your boot command line.
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.
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.
For debugging dp operation, please add
drm.debug=0x100to your boot command line.
This is grub parameter, I suppose.
How about this qcadsp8280.mbn preventing it booting up. Might it be just some kind of loading order issue?
Need to look into the dmesg. The fun part is, after copying the firmwares they are also integrated into the initrd :grin: So they will be loaded, but they also should load. Yes it is a grub parameter.
Here is dmesg with grub debug option as you wished. dmesg_3.txt
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.
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.
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.
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 likesc8280xp-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.
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 shouldn't need to, I have provided both the .dts source but also the compiled .dtb files in my repository in the following branch: https://github.com/JeromeDeBretagne/linux_surface_pro_9_5G/commits/wip/sc8280xp-v6.7/
The latest .dtb should get external display working with the bottom USB-C port, if you provide the .dtb file at boot with a devicetree line and with the right firmware files extracted from the Windows partition / drive. I have used the following path for the firmware files "qcom/sc8280xp/MICROSOFT/SurfacePro9/" in the devicetree, so it needs to be in this specific location.
Can you list the firmware files fetched by fetch_sc8280xp_fw.sh? The output of it running in bash should be enough. As it seems the files are not there. The co-processors boot up, though.
The latest .dtb should get external display working with the bottom USB-C port, if you provide the .dtb file at boot with a devicetree line and with the right firmware files extracted from the Windows partition / drive. I have used the following path for the firmware files "qcom/sc8280xp/MICROSOFT/SurfacePro9/" in the devicetree, so it needs to be in this specific location.
I found the dtb file. I suppose dts is not needed if the device tee blob is loaded by bootloader, right?
I did not find the "qcom/sc8280xp/MICROSOFT/SurfacePro9/" folder anywhere. Are the files same as grabbed from Windows?
I did not find the "qcom/sc8280xp/MICROSOFT/SurfacePro9/" folder anywhere. Are the files same as grabbed from Windows?
Yes they are. You can just mv the directory tree: sudo mv /usr/lib/firmware/updates/qcom/sc8280xp/MICROSOFT/DEVKIT23 /usr/lib/firmware/updates/qcom/sc8280xp/MICROSOFT/SurfacePro9
would still be interesting what's in here
would still be interesting what's in here
There is all except the one I removed:
root@ubuntu: ls /usr/lib/firmware/qcom/sc8280xp/MICROSOFT/DEVKIT23/ -la total 5520 drwxr-xr-x 2 root root 4096 Mar 4 11:41 . drwxr-xr-x 3 root root 4096 Oct 22 20:10 .. -rwxr-xr-x 1 root root 534 Mar 4 11:27 adspr.jsn -rwxr-xr-x 1 root root 731 Mar 4 11:27 adspua.jsn -rwxr-xr-x 1 root root 537 Mar 4 11:27 battmgr.jsn -rwxr-xr-x 1 root root 534 Mar 4 11:27 cdspr.jsn -rwxr-xr-x 1 root root 3571712 Mar 4 11:37 qccdsp8280.mbn -rwxr-xr-x 1 root root 14392 Mar 4 11:39 qcdxkmsuc8280.mbn -rwxr-xr-x 1 root root 2035812 Mar 4 11:41 qcvss8280.mbn root@ubuntu
qcadsp8280.mbn is just moved to an other location. I can put it back when I try the other device tree.
Did I understand it right, the dtb-file has path to the FW directory, which is "qcom/sc8280xp/MICROSOFT/SurfacePro9/" in Jerome's dtb?
Looks okay to me:
jglathe@sdbox2:~/Downloads$ ls /usr/lib/firmware/qcom/sc8280xp/MICROSOFT/DEVKIT23/ -la
total 19728
drwxr-xr-x 2 root root 4096 Mar 13 1970 .
drwxr-xr-x 3 root root 4096 Oct 22 22:10 ..
-rwxr-xr-x 1 root root 534 Feb 19 08:23 adspr.jsn
-rwxr-xr-x 1 root root 731 Feb 19 08:23 adspua.jsn
-rwxr-xr-x 1 root root 537 Feb 19 08:23 battmgr.jsn
-rwxr-xr-x 1 root root 534 Feb 19 08:23 cdspr.jsn
-rwxr-xr-x 1 root root 14545260 Feb 19 08:23 qcadsp8280.mbn
-rwxr-xr-x 1 root root 3571712 Feb 19 08:23 qccdsp8280.mbn
-rwxr-xr-x 1 root root 14392 Feb 19 08:23 qcdxkmsuc8280.mbn
-rwxr-xr-x 1 root root 2035748 Feb 19 08:23 qcvss8280.mbn
Looks okay to me:
If you compare it to my listing above, mine is missing the one file I told.
Yep. You need to add some other stuff I'm afraid.
/etc/initramfs-tools/modules needs to be this:
pwm_bl
phy_qcom_qmp_pcie
pcie_qcom
phy_qcom_qmp_combo
qrtr
phy_qcom_edp
gpio_sbu_mux
i2c_hid_of
i2c_qcom_geni
pmic_glink_altmode
leds_qcom_lpg
gpucc_sc8280xp
dispcc_sc8280xp
panel_edp
msm
nvme
usb_storage
uas
The one for the wdk doesn't contain all of them (no panel).
Also, /etc/initramfs-tools/hooks/wdk23-firmware needs a changed path to the new firmwares.
#!/bin/sh
set -e
PREREQ=""
prereqs()
{
echo "$PREREQ"
}
case \\$1 in
# get pre-requisites
prereqs)
prereqs
exit 0
;;
esac
. /usr/share/initramfs-tools/hook-functions
#set target dir for firmware files
FW_BASEDIR="lib/firmware"
FW_USERDIR="usr/lib/firmware/updates"
# Define a list of firmware files to be included
FIRMWARE_FILES="\
$FW_USERDIR/qcom/sc8280xp/MICROSOFT/SurfacePro9/qcadsp8280.mbn \
$FW_USERDIR/qcom/sc8280xp/MICROSOFT/SurfacePro9/qccdsp8280.mbn \
$FW_USERDIR/qcom/sc8280xp/MICROSOFT/SurfacePro9/qcdxkmsuc8280.mbn \
$FW_USERDIR/qcom/sc8280xp/MICROSOFT/SurfacePro9/qcvss8280.mbn \
$FW_BASEDIR/qcom/a660_sqe.fw.zst \
$FW_BASEDIR/qcom/a660_gmu.bin.zst \
$FW_BASEDIR/rtl_nic/rtl8153b-2.fw.zst"
# Copy each firmware file to initramfs
for file in $FIRMWARE_FILES; do
dir=$(dirname "$file")
mkdir -p "${DESTDIR}/${dir}"
cp "/${file}" "${DESTDIR}/${dir}/"
done
afterwards, update initramfs:
sudo update-initramfs -u -k all
and reboot.
Did I understand it right, the dtb-file has path to the FW directory, which is "qcom/sc8280xp/MICROSOFT/SurfacePro9/" in Jerome's dtb?
yes. It is compiled-in.
This is what happened:
root@ubuntu:/etc# update-initramfs -u -k all
update-initramfs: Generating /boot/initrd.img-6.7.1-gd7da5073ce3d
/etc/initramfs-tools/hooks/wdk23-firmware: 1: !/bin/sh: not found
/etc/initramfs-tools/hooks/wdk23-firmware: 1: !/bin/sh: not found
update-initramfs: Generating /boot/initrd.img-6.6.0+
/etc/initramfs-tools/hooks/wdk23-firmware: 1: !/bin/sh: not found
/etc/initramfs-tools/hooks/wdk23-firmware: 1: !/bin/sh: not found
The # as the first char is missing, sorry my mistake. Edited the wdk23-firmware script. You can also save it as a more apropriate name, like sp9-firmware. The file must have root as owner and execute rights.
Now it's invining "invalid devicetree".
Should it be same version? Dbt is 6.7 InitRamFs is 6.7.1.
nah no real change. let me pull and compile it to be sure.
Weird, I've compiled the .dts file within a Linux 6.7 source tree... as you can see in my repository
Weird, I've compiled the .dts file within a Linux 6.7 source tree... as you can see in my repository
I made definitely some misstake. I have not been doing this for several years. I don't know the present systems well enough. Kernel version was 3.x something back then.
It's definitely better, Jens makes a full image.
I saw some boot message giving the devices own native screen resolution. So I think it's not very far away right now.