给 Lumia 950 XL 跑 Debian 9 w/ 主线内核

2018-11-07 03:59:47 +08:00
 imbushuo

可能是住院期间过于无聊需要找一点事情做(。

其实看上去 MSM8994 的主线情况还是不错的(虽然不像 APQ8016/APQ8096 一样有 SBC,这两款的主线情况是最好的),除了设备树不齐,某些缺的 GCC/RPM 时钟需要补上,还需要一个 qcom,pcie-msm8994 的 PCIe 控制器。补上设备树后很多东西开箱能用。目前跑的是 4.18.6。rootfs 是直接 debootstrap 出来的。

走的 ARM64 UEFI + GRUB 启动,没有用 lk/uboot (都有 UEFI 用了,为什么要用那种玩意?)

Note: 现在这批 "Always Conncted PC" 也就是跑 8998/SDM850 的 Windows PC 虽然没有锁 Secure Boot,但是跑 Linux 有困难,因为它们的固件加载的位置太低了。UEFI 规范建议固件加载得越高越好,虽然这不是强制性要求。跑 Windows 和 XNU (其他系统我没测过)都是没问题的。我自己给 8994 写的 UEFI 实现加载在内存中段,留了足够多的 bottom memory 给 Linux

最后留一个 boot log 开头摘要:

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd032]
[    0.000000] Linux version 4.18.6-lumia-950xl-uefi (imbushuo@lumia-bldag-bl1) (gcc version 6.3.0 20170516 (Debian 6.3.0-18)) #2 SMP PREEMPT Wed Oct 31 00:35:34 EDT 2018
[    0.000000] Machine model: Microsoft Lumia 950 XL Single SIM (RM-1085)
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: EFI v2.70 by Little Moe, LLC.
[    0.000000] efi:  ACPI=0x5f030000  ACPI 2.0=0x5f030014  SMBIOS=0x5eb90000  SMBIOS 3.0=0x5eb40000  MEMATTR=0x5e9a0018 
[    0.000000] cma: Reserved 32 MiB at 0x00000000de000000
[    0.000000] NUMA: No NUMA configuration found
[    0.000000] NUMA: Faking a node at [mem 0x0000000000000000-0x00000000dfffffff]
[    0.000000] NUMA: NODE_DATA [mem 0xddfdb980-0xddfdd13f]
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000000100000-0x00000000dfffffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000100000-0x00000000002fffff]
[    0.000000]   node   0: [mem 0x0000000000300000-0x000000000038ffff]
[    0.000000]   node   0: [mem 0x0000000000390000-0x00000000003fffff]
[    0.000000]   node   0: [mem 0x0000000000400000-0x0000000000bfffff]
[    0.000000]   node   0: [mem 0x0000000000c00000-0x00000000064fffff]
[    0.000000]   node   0: [mem 0x0000000006500000-0x00000000069fffff]
[    0.000000]   node   0: [mem 0x0000000006c00000-0x000000000f1fffff]
[    0.000000]   node   0: [mem 0x000000000f200000-0x000000005c8c2fff]
[    0.000000]   node   0: [mem 0x000000005c8c3000-0x000000005c9ddfff]
[    0.000000]   node   0: [mem 0x000000005c9de000-0x000000005e96ffff]
[    0.000000]   node   0: [mem 0x000000005e970000-0x000000005e98ffff]
[    0.000000]   node   0: [mem 0x000000005e990000-0x000000005eb2ffff]
[    0.000000]   node   0: [mem 0x000000005eb30000-0x000000005eb5ffff]
[    0.000000]   node   0: [mem 0x000000005eb60000-0x000000005eb8ffff]
[    0.000000]   node   0: [mem 0x000000005eb90000-0x000000005eb9ffff]
[    0.000000]   node   0: [mem 0x000000005eba0000-0x000000005ebbffff]
[    0.000000]   node   0: [mem 0x000000005ebc0000-0x000000005ecfffff]
[    0.000000]   node   0: [mem 0x000000005ed00000-0x000000005ed2ffff]
[    0.000000]   node   0: [mem 0x000000005ed30000-0x000000005ed3ffff]
[    0.000000]   node   0: [mem 0x000000005ed40000-0x000000005ed4ffff]
[    0.000000]   node   0: [mem 0x000000005ed50000-0x000000005ee8ffff]
[    0.000000]   node   0: [mem 0x000000005ee90000-0x000000005eedffff]
[    0.000000]   node   0: [mem 0x000000005eee0000-0x000000005f01ffff]
[    0.000000]   node   0: [mem 0x000000005f020000-0x000000005ff9ffff]
[    0.000000]   node   0: [mem 0x000000005ffa0000-0x000000005ffeffff]
[    0.000000]   node   0: [mem 0x000000005fff0000-0x000000005fffffff]
[    0.000000]   node   0: [mem 0x0000000080000000-0x00000000dfffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000100000-0x00000000dfffffff]
[    0.000000] On node 0 totalpages: 785664
[    0.000000]   DMA32 zone: 12276 pages used for memmap
[    0.000000]   DMA32 zone: 0 pages reserved
[    0.000000]   DMA32 zone: 785664 pages, LIFO batch:31
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.0 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: MIGRATE_INFO_TYPE not supported.
[    0.000000] psci: SMC Calling Convention v1.0
[    0.000000] random: get_random_bytes called from start_kernel+0xac/0x414 with crng_init=0
[    0.000000] percpu: Embedded 23 pages/cpu @(____ptrval____) s54232 r8192 d31784 u94208
[    0.000000] pcpu-alloc: s54232 r8192 d31784 u94208 alloc=23*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 [0] 4 [0] 5 [0] 6 [0] 7 
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: enabling workaround for ARM errata 826319, 827319, 824069
[    0.000000] CPU features: enabling workaround for ARM erratum 843419
[    0.000000] CPU features: enabling workaround for ARM erratum 845719
[    0.000000] CPU features: detected: Kernel page table isolation (KPTI)
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 773388
[    0.000000] Policy zone: DMA32
[    0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-4.18.6-lumia-950xl-uefi nomodeset acpi=off earlyprintk=efi video=efifb root=UUID=4773c028-90b2-4032-bac6-b23126ef8f94
[    0.000000] Memory: 2867332K/3142656K available (7356K kernel code, 718K rwdata, 2776K rodata, 640K init, 339K bss, 242556K reserved, 32768K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000] 	RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=8.
[    0.000000] 	Tasks RCU enabled.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=8
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] arch_timer: cp15 and mmio timer(s) running at 19.20MHz (virt/virt).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns
[    0.000006] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns
[    0.000213] Console: colour dummy device 80x25
[    0.001147] console [tty0] enabled
[    0.001215] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=76800)
[    0.001248] pid_max: default: 32768 minimum: 301
[    0.001357] Security Framework initialized
[    0.003169] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes)
[    0.004082] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes)
[    0.004159] Mount-cache hash table entries: 8192 (order: 4, 65536 bytes)
[    0.004207] Mountpoint-cache hash table entries: 8192 (order: 4, 65536 bytes)
[    0.027993] ASID allocator initialised with 32768 entries
[    0.035990] Hierarchical SRCU implementation.
[    0.044231] Remapping and enabling EFI services.
[    0.044415] efi: memattr: Entry attributes invalid: RO and XP bits both cleared
[    0.044449] efi: memattr: ! 0x000000300000-0x00000037ffff [Runtime Code       |RUN|  |  |  |  |  |  |   |  |  |  |  ]
[    0.052033] smp: Bringing up secondary CPUs ...
[    0.084858] Detected VIPT I-cache on CPU1
[    0.084921] CPU1: Booted secondary processor 0x0000000001 [0x410fd032]
[    0.116903] Detected VIPT I-cache on CPU2
[    0.116944] CPU2: Booted secondary processor 0x0000000002 [0x410fd032]
[    0.148978] Detected VIPT I-cache on CPU3
[    0.149016] CPU3: Booted secondary processor 0x0000000003 [0x410fd032]
[    0.182264] CPU features: enabling workaround for ARM erratum 832075
[    0.182276] CPU features: enabling workaround for EL2 vector hardening
[    0.182291] Detected PIPT I-cache on CPU4
[    0.182370] CPU4: Booted secondary processor 0x0000000100 [0x411fd071]
[    0.213271] Detected PIPT I-cache on CPU5
[    0.213340] CPU5: Booted secondary processor 0x0000000101 [0x411fd071]
[    0.245384] Detected PIPT I-cache on CPU6
[    0.245457] CPU6: Booted secondary processor 0x0000000102 [0x411fd071]
[    0.277503] Detected PIPT I-cache on CPU7
[    0.277576] CPU7: Booted secondary processor 0x0000000103 [0x411fd071]
[    0.277753] smp: Brought up 1 node, 8 CPUs
[    0.277977] SMP: Total of 8 processors activated.
[    0.277996] CPU features: detected: 32-bit EL0 Support
[    0.290439] CPU: All CPU(s) started at EL1
8135 次点击
所在节点    Linux
55 条回复
DennyDai
2018-11-07 04:06:09 +08:00
劳群观光团
Dreista
2018-11-07 04:13:33 +08:00
劳群观光团
K4YT3X
2018-11-07 04:15:54 +08:00
劳群观光团
Showfom
2018-11-07 06:42:09 +08:00
劳群观光团
hanxiV2EX
2018-11-07 07:12:33 +08:00
牛逼
steveshi
2018-11-07 07:18:20 +08:00
这个是真牛逼
jingniao
2018-11-07 07:21:50 +08:00
640 吃灰中……
doresu
2018-11-07 07:24:05 +08:00
给大佬跪下了
ipeony
2018-11-07 07:24:19 +08:00
666,手上有台吃灰的 950
kekxv
2018-11-07 07:42:38 +08:00
有教程之类的吗
lyseky
2018-11-07 07:45:26 +08:00
920 坐等撸
IsaacYoung
2018-11-07 07:56:29 +08:00
🐂🍺
imbushuo
2018-11-07 08:05:18 +08:00
@lyseky 所有的 arm32 WP 都有这么一个问题:固件加载的地方太低了。arm32 Linux 对 bottom memory 的要求更为严格(必须在前 128MB 内,越前越好),很多设备都是在 `memory_base + 0x8000` 这个地方加载内核的。但是这个地方 WP 的 UEFI 占用了,同时放了数据和代码(还有 FrameBuffer ),所以会非常麻烦(特别是覆盖到了代码段,那段代码还是和 ARM ACPI MP Parking 多核启动协议有关的)

@kekxv 理论上只需要把 Windows 10 ARM 安装教程的最后几步换掉就好了。多分两个分区,一个放 grub 和 kernel,另一个放 rootfs。rootfs 只需要 debootstrap 一下就行。
LCD
2018-11-07 08:14:05 +08:00
膜拜
frittle
2018-11-07 08:14:34 +08:00
除了蓝牙能用,无线网能用吗?
imbushuo
2018-11-07 08:20:56 +08:00
@frittle PCIe 桥和 MMIO 配置了,能看到网卡了,然后目前在解决一个 CPU 0 Stalled 的问题

我估计我少开了一个 clock 然后整个 PCIe IP Core 在等对面
LowBi
2018-11-07 08:55:29 +08:00
牛逼,可以给 IT 之家投稿了
zhjits
2018-11-07 08:58:28 +08:00
劳群观光团
(我来晚了?
Myprincess
2018-11-07 09:07:32 +08:00
面对如今环境,WP 保护隐私还是可以的.
xiashali
2018-11-07 09:34:04 +08:00
@DennyDai #1
@Dreista #2
@K4YT3X #3
@Showfom #4
@zhjits #18
• 这里反对中文互联网上的无信息量习惯如 “顶”,“沙发”,“前排”,“留名”,“路过”,“不明觉厉”

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/505213

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX