Qualcomm Snapdragon S4 Plus (MSM8960)

From postmarketOS Wiki
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
Partial
USB
Partial
Display
GPU
Pinctrl
Works
I²C
Partial
SPI
Audio
Video
Thermal
WiFi
Bluetooth
Modem
GPS
Camera
NPU
Suspend
Ethernet


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 Limited Classic blackberry-q20
Casio G'zOne casio-ca201l Y
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 820 nokia-arrow
Nokia Lumia 920 nokia-phi
Nokia Lumia 925 nokia-catwalk
Pantech SKY VEGA S5 pantech-ef44 P
Samsung Ativ S samsung-i8750
Samsung Galaxy Express SGH-I437 samsung-expressatt Y
Samsung Galaxy S III (Verizon) samsung-d2vzw
Samsung Galaxy S Relay 4G samsung-apexq
Samsung Galaxy SIII (US version, i747m) samsung-i747m
Sony Xperia SP sony-huashan N
Sony Xperia T sony-mint

Others

There are other SoC models part of the S4 Plus series:

  • APQ8064
  • APQ8060A
  • MSM8660A
  • MSM8260A
  • APQ8030
  • MSM8930
  • MSM8630
  • MSM8230
  • MSM8627
  • MSM8227
  • MSM8625
  • MSM8225

Source: https://www.qualcomm.com/content/dam/qcomm-martech/dm-assets/documents/SD_Product_Brief.pdf

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)

See also