Qualcomm Snapdragon S4 Plus (MSM8960)

From postmarketOS
Jump to navigation Jump to search
Qualcomm MSM8960
Manufacturer Qualcomm
Name MSM8960
Architecture armv7
CPU 2x Krait (ARMv7) CPU cores at 1.5 - 1.7 GHz
GPU Adreno 225
Year 2012
Process 28nm
Mainline yes
Components
CPU
Works
UART
Works
Storage
USB
Display
GPU
Pinctrl
I²C
Audio
Video
Thermal
WiFi
Bluetooth
Modem
GPS
Camera
Suspend


The Qualcomm MSM8960 (Snapdragon S4 series) is a high-end smartphone SoC in 2012. It contains two Krait (ARMv7) CPU cores at 1.5 - 1.7 GHz, an Adreno 225 GPU (400 MHz), a LPDDR2 memory controller (up to 500 MHz) and radio elements including LTE. The chip is produced in 28nm LP (low power process) at TSMC.

Devices

Snapdragon S4 Plus (MSM8960)

Device Codename Mainline
Acer CloudMobile S500 acer-swing N
BlackBerry Classic blackberry-q20
HTC One S htc-ville N
HTC One SV htc-k2ul
HTC One XL htc-evita
Motorola Moto X motorola-ghost
Motorola Photon Q motorola-asanti
NEC Terrain nec-terrain
Nokia Lumia 920 nokia-phi
Pantech VEGA S5 ef44s
Samsung Ativ S samsung-i8750
Samsung Galaxy Express SGH-I437 samsung-expressatt Y
Samsung Galaxy S III (US version, i747m) samsung-i747m
Samsung Galaxy S III (Verizon) samsung-d2vzw
Samsung Galaxy S Relay 4G samsung-apexq
Sony Xperia SP sony-huashan N
Sony Xperia T sony-mint

Mainline

At this moment, work is mostly done in https://github.com/apq8064-mainline/linux git tree

Mainline Tips

DTS

This chipset should be supported inside the mainline kernel, yet first devices trees (DT) based on arch/arm/boot/dts/qcom-msm8960-cdp.dts file are to be expected. Another starting point for MSM8960 devices: https://github.com/andersson/kernel/blob/41e99cea7c35e82d74862b0293a24a1930c322c4/arch/arm/boot/dts/sony-blue-mint.dts (beware, very old, 2015). Some other MSM8960 dts files are listed here: https://github.com/apq8064-mainline/linux/tree/qcom-apq8064-next/arch/arm/boot/dts

UART

This is all you need to get UART on your device (hopefully):

// SPDX-License-Identifier: GPL-2.0-only
#include <dt-bindings/input/input.h>

#include "qcom-msm8960.dtsi"

/ {
	model = "<device name>";
	compatible = "<vendor>,<codename>", "qcom,msm8960";

	aliases {
		serial0 = &gsbi5_serial;
	};

	chosen {
		stdout-path = "serial0:115200n8";
	};
	
	soc {
		gsbi@16400000 {
			status = "okay";
			qcom,mode = <GSBI_PROT_I2C_UART>;
			serial@16440000 {
				status = "okay";
			};
		};
	};
};

Initrd Error

If you get something like this:

[    3.068176] Trying to unpack rootfs image as initramfs...
[    3.070859] rootfs image is not initramfs (invalid magic at start of compressed archive); looks like an initrd

It's most likely the kernel overwriting parts of postmarketOS's initramfs. You need to do one of the following:

  • In device-<vendor>-<codename>/deviceinfo, increase the value in deviceinfo_flash_offset_ramdisk. Make sure it doesn't overlap with another region.
  • Decrease your kernel size by editing your CONFIGs. Some suggestions:
    • In https://github.com/apq8064-mainline/linux, do make qcom_apq8064_defconfig and use that as your new config-<vendor>-<codename>.armv7 in aports/device/testing/linux-<vendor>-<codename>. Make sure you source pmbootstrap/helpers/envkernel.sh first!
    • Set CONFIG_CC_OPTIMIZE_FOR_SIZE=y
    • Remove the entire networking stack (for now)

lk2nd

Icon
Warning!
If you try it, it could possibly break your device

Caleb was able to get lk2nd running on their MSM8960 device, however it died a while later for unknown reasons. YMMV and proceed to flash at your own caution: https://github.com/calebccff/lk2nd

See also

Very similar to the Qualcomm Snapdragon 600 (APQ8064)