HTC One S (htc-ville)

Based on Qualcomm Snapdragon S4 Plus (MSM8960).
== Users owning this device ==
== Enter fastboot ==
Hold while booting to go into bootloader mode, then choose Fastboot with button.
 alone is sufficient to get into bootloader mode, e.g. if your device bootloops. If the device is turned off, hold and press .
Alternatively, use adb reboot bootloader command when running Android.
See https://www.htcdev.com/bootloader/rom_flashing_guide for official instructions.
== Flashing ==
Fastboot sometimes refuses to flash the system image, like this
$ cd /tmp/postmarketOS-export
$ fastboot flash system htc-ville.img
Sending 'system' (990208 KB) FAILED (remote: 'data length is too large')
fastboot: error: Command failed
It is possible to try using -S option of fastboot flash command to break the image into smaller chunks.
The device always reboots after flashing the system partition, so you have to flash the kernel first.
A more reliable way to flash the system partition is to use TWRP recovery. Compress the images and upload them to /sdcard:
$ pmbootstrap export
$ cd /tmp/postmarketOS-export
$ xz <htc-ville.img >htc-ville.img.xz
$ adb push htc-ville.img.xz /sdcard
$ rm htc-ville.img.xz
Then, in adb shell, execute:
$ xz -d </sdcard/htc-ville.img.xz >/dev/block/mmcblk0p33
Be very careful, number of partition ( mmcblk0p33 ) can be different, check it with adb shell readlink /dev/block/platform/msm_sdcc.1/by-name/system!
The following trick does not work, at least with TWRP 3.5.1_9-0:
$ pmbootstrap export
$ adb push /tmp/postmarketOS-export/htc-ville.img /dev/block/platform/msm_sdcc.1/by-name/system
It simply replaces the destination, whether specified as /dev/block/mmcblk0p33 (device) or /dev/block/platform/msm_sdcc.1/by-name/system (symlink), with a regular file, instead of pushing to the device.
== LineageOS/CyanogenMod references ==
This section contains links to the latest sources used to build LineageOS for this device. It can be used as a reference, for example to lookup the kernel source.
* Downstream kernel: https://github.com/LineageOS/android_kernel_htc_msm8960/tree/cm-14.1
* Android Device tree: https://github.com/LineageOS/android_device_htc_ville
* Android Common part of device tree: https://github.com/LineageOS/android_device_htc_s4-common (dependency of android_device_htc_ville)
* TWRP recovery: https://github.com/TeamWin/android_device_htc_ville
Proprietary file lists:
* https://github.com/LineageOS/android_device_htc_ville/blob/cm-14.1/device-proprietary-files.txt
* https://github.com/LineageOS/android_device_htc_s4-common/blob/cm-14.1/proprietary-files.txt
* https://github.com/LineageOS/android_device_htc_s4-common/blob/cm-14.1/common-proprietary-files.txt
Proprietary firmware: https://github.com/TheMuppets/proprietary_vendor_htc/tree/cm-14.1 (ville + s4-common)
== Mainlining? ==
Mainline Linux has msm8960 device tree in arch/arm/boot/dts/qcom-msm8960.dtsi. There is no qcom-msm8690-htc-ville.dts file yet. The only available file to be used as a starting point is qcom-msm8960-cdp.dts, where CDP refers to the Core Development Platform.
Downstream kernel does not provide the device tree, instead relevant board-ville*.c files are stored in arch/arm/mach-msm/htc/ville/ and can be used as a reference for mainlining.
== See also ==
* Initial merge request
* Merge request adding armv7 and Wi-Fi firmware
* 
*