[SPH-L520][ROM][UNOfficial][5.1.1] CyanogenMod 12.1 for Sprint S4 Mini [8/15]

s0be

Inactive Recognized Developer
Dec 26, 2007
726
498
0
Seattle, WA
WARNING! This ROM is for the SPH-L520 variant only!

Code:
/*
 * Your warranty is now void.
 *
 * We are not responsible for bricked devices, dead SD cards,
 * thermonuclear war, or you getting fired because the alarm app failed. Please
 * do some research if you have any concerns about features included in this ROM
 * before flashing it! YOU are choosing to make these modifications, and if
 * you point the finger at us for messing up your device, we will laugh at you.
 *
 */
Code:
[ROM]

[What works]
 Boot Animation
 Wifi/Teather
 Bluetooth
 Basic Sound
 Adb/Usb/Charging
 Camera
 Notification LEDs
 FM Radio
Calls

[Doesn't work right]
NFC 
 LTE/SMS/MMS/
GPS
 IR Remote
 
[Untested]

 Everything Else

[Bugs]
  Camera crashes on startup if switched to external storage - to fix crash, go to settings -> apps -> all -> camera -> clear data
Code:
[Recovery]

[What works]
 Nandroid backup
 Nandroid Restore
 Install Rom
 Factory Restore

[Untested]
 Everything else

[Bugs]
 None Known
This is based off of arco's work at:

https://github.com/CyanogenMod/android_device_samsung_serranoltexx/tree/stable/cm-11.0

and all the rest of upstream.


Here's my github for gpl compliance/etc.

https://github.com/s0be/android_device_samsung_serranoltespr

Installation

Here's a simple list of what you need.


THIS ROM ONLY WORKS WITH THIS RECOVERY. Do not use recoveries for other devices with the sprint s4 mini

Make sure to take a nandroid then wipe /data before installing this rom.

I'm too lazy to write proper install instructions, if someone would like to, I'll happily add them to this post.
I'm too lazy to update anything after this point. It's all old.
XDA:DevDB Information
CM11.0 for Sprint Galaxy S4 Mini, a ROM for the Samsung Galaxy S 4 Mini

Contributors
s0be
ROM OS Version: 4.4.x KitKat
ROM Kernel: Linux 3.4.x
Based On: CyanogenMod

Version Information
Status: Beta

Created 2014-03-04
Last Updated 2014-03-26
 
Last edited:

s0be

Inactive Recognized Developer
Dec 26, 2007
726
498
0
Seattle, WA
3/10
- First release.
- Waiting on goo.im account

3/11
- Resync'd with upstream
- no local changes

3/17
- Still using the 3/11 upstream
- Switched to init.carrier.sh from stock
- Switched to ril files from stock
- Lots of other changes to make the previous 2 things work.
- Now feature complete, stable, daily driver, etc.


3/23
- Resync'd with upstream
- First build based off of grand unified serrano vendor tree
- Based on arco68's device tree.
 
Last edited:

arco68

Recognized Developer
Oct 11, 2010
2,820
24,313
203
Welcome s0be! Been a while since I've seen you around, so it's great to see you here! :) Let me know if you need anything.
 
  • Like
Reactions: sks93

s0be

Inactive Recognized Developer
Dec 26, 2007
726
498
0
Seattle, WA
Welcome s0be! Been a while since I've seen you around, so it's great to see you here! :) Let me know if you need anything.
Will do. Just flashed my recovery. If you check my github you'll see a .patch file for the cm msm8930 kernel tree. I suspect my change in the gpio's was, in fact, exactly as wrong as I suspected. When I booted the recovery, the phone vibrated continuously. I did a nandroid backup and that seemed to work, backing up to sdcard1. Going to alter my change to the gpio defines for the cypress touch panel so that it always uses 24 for sda and 25 for scl.

I was actually amazed at exactly how LITTLE invasion I had to do into areas outside devices/samsung/serranoltespr to get it to compile. The kernel was the only place any non trivial changes were required (aside from extract-files.sh, but that's so device/rom specific that it's not a surprise at all).
 

arco68

Recognized Developer
Oct 11, 2010
2,820
24,313
203
I've added serranoltespr to the build barriers. Without it the HAL for camera, gps and a few other things won't build.

Which reminds me, I need to add it to vendor barrier as well. :)
 

s0be

Inactive Recognized Developer
Dec 26, 2007
726
498
0
Seattle, WA
I've added serranoltespr to the build barriers. Without it the HAL for camera, gps and a few other things won't build.

Which reminds me, I need to add it to vendor barrier as well. :)
Cool, thanks. Once I get a msm8930-common kernel working with USB, I'll sync up. Are you a kernel-msm8930-common maintainer? Should kernel patches go through github fork/pull requests or ??
 

s0be

Inactive Recognized Developer
Dec 26, 2007
726
498
0
Seattle, WA
I have an 'only mostly broken' build done, is anyone actually waiting for this, or should I get it feature complete first. Currently missing:

3g/Cell calls.

Basically, LTE works, or you can force 1x, and calls work, no 3g at this time. Everything else seems to work.
 

s0be

Inactive Recognized Developer
Dec 26, 2007
726
498
0
Seattle, WA
Yeah, I'm the only maintainer. :) Patches usually goes through gerrit: http://review.cyanogenmod.org/#/q/status:open,n,z

I have elevated permissions on that repo, so I sometimes bypasses gerrit and pushes patches directly to github. Especially when there's a bulk of patches that needs to be merged.
only 1 patch so far is even remotely intrusive, and it's just updating the serial_msm_hs driver (which is disabled for the other 8930 boards). Now that I have USB charging working, I'm going to verify I need that change and likely drop it if not. I'm fine with the slow gerrit review.
 

arco68

Recognized Developer
Oct 11, 2010
2,820
24,313
203
I noticed that the US variants might need their own base defconfig, so you're using msm8930_serrano_usa_defconfig, right? If so, make sure CONFIG_USB_ANDROID_SAMSUNG_MTP is not enabled. That should probably give you working USB.
 

s0be

Inactive Recognized Developer
Dec 26, 2007
726
498
0
Seattle, WA
I noticed that the US variants might need their own base defconfig, so you're using msm8930_serrano_usa_defconfig, right? If so, make sure CONFIG_USB_ANDROID_SAMSUNG_MTP is not enabled. That should probably give you working USB.
Try with this base config. I've adjusted the US variant one to match CM's defconfig.

I'll try to adjust BoardConfig in serrano-common so it selects the base deconfig based on variant.
Oh, I just based it off of msm8930_serrano_spr_defconfig (which inherits cyanogenmod-serrano) then enabled the stuff to get USB going. The actual specific issue looks to have been needing:

CONFIG_MFD_MAX77693 along with the correct battery/charger/etc.

Here's my current 'working' spr_defconfig

Code:
# This needs cleaned up, I suspect a lot of this is unnecessary.

CONFIG_MACH_SERRANO_SPR=y
CONFIG_2MIC_QUP_I2C=y
CONFIG_2MIC_ES305=y
CONFIG_2MIC_QUP_I2C_GSBI11=y
CONFIG_AUTHENTEC_VPNCLIENT_INTERCEPTOR=m
CONFIG_KEYBOARD_CYPRESS_TOUCH=y

CONFIG_POWER_SUPPLY=y

CONFIG_CHARGER_MAX77XXX=y
CONFIG_CHARGER_MAX77803=y

CONFIG_MFD_PM8921_CORE=y
CONFIG_MFD_PM8821_CORE=y
CONFIG_MFD_PM8038_CORE=y
CONFIG_MFD_PM8XXX_SPK=y
CONFIG_MFD_PM8XXX_BATT_ALARM=y
CONFIG_MFD_MAX77693=y

CONFIG_PM8921_BMS=n
CONFIG_PM8921_CHARGER=y
CONFIG_PM8921_SEC_CHARGER=n
CONFIG_MFD_PM8921_CORE=y

CONFIG_FUELGAUGE_MAX17048=y

CONFIG_BATTERY_SAMSUNG=y
CONFIG_SEC_DEBUG=y
CONFIG_SEC_DEBUG_SCHED_LOG=y
CONFIG_SEC_DEBUG_SUBSYS=y

CONFIG_USB_SWITCH_TSU6721=n
CONFIG_SERIAL_MSM_HS=y
CONFIG_USB_CI13XXX_MSM_HSIC=y
The only broken bits right now are 3g/lte phonecall sms/mms handovers and notification LEDS.
 

arco68

Recognized Developer
Oct 11, 2010
2,820
24,313
203
There's one base config for all variants, and one that's specific for each variant. For the EU variants, the base config is msm8930_serrano_defconfig. This is for stock ROM, so for CM I've adapted it and enabled custom bits in a new defconfig called cyanogen_serrano_defconfig.

The US variants seems to be using msm8930_serrano_usa_defconfig as their base config, and most of the things you added to the spr_defconfig should be enabled there already.

Add the defconfig I attached earlier to your kernel tree, and modify BoardConfigCommon.mk in serrano-common with

TARGET_KERNEL_CONFIG := cyanogen_serrano_usa_defconfig

The msm8930_serrano_spr_defconfig can be left as original without your changes. Only change there should be removing CONFIG_AUTHENTEC_VPNCLIENT_INTERCEPTOR, as afaik it's not used in CM.

Are you sure you have a notification light? None of the other variants have one.
 

s0be

Inactive Recognized Developer
Dec 26, 2007
726
498
0
Seattle, WA
There's one base config for all variants, and one that's specific for each variant. For the EU variants, the base config is msm8930_serrano_defconfig. This is for stock ROM, so for CM I've adapted it and enabled custom bits in a new defconfig called cyanogen_serrano_defconfig.

The US variants seems to be using msm8930_serrano_usa_defconfig as their base config, and most of the things you added to the spr_defconfig should be enabled there already.

Add the defconfig I attached earlier to your kernel tree, and modify BoardConfigCommon.mk in serrano-common with

TARGET_KERNEL_CONFIG := cyanogen_serrano_usa_defconfig

The msm8930_serrano_spr_defconfig can be left as original without your changes. Only change there should be removing CONFIG_AUTHENTEC_VPNCLIENT_INTERCEPTOR, as afaik it's not used in CM.

Are you sure you have a notification light? None of the other variants have one.
Yep, notification light works fine in stock. at least tri-color (r/g/b). Will switch to the .config you sent. When I tried with the original usa_defconfig, the phone wouldn't boot.
 
  • Like
Reactions: sks93

arco68

Recognized Developer
Oct 11, 2010
2,820
24,313
203
Wow! Lucky you! :)

I'm pretty confident that's it's the same LED as in the regular S4 and the Mega, so you should be able to use this liblights: https://github.com/arco/android_device_samsung_melius-common/tree/cm-11.0/liblights

Also, you need to make the following changes to enable it: https://github.com/arco/android_dev...mmit/d002c6ee304e7caae71829b33135e26b5ea4e5f8

I'll need to figure out how to add this so it doesn't conflict with the variants that doesn't support it. Likely we need to move some stuff into device repos.
 
  • Like
Reactions: sks93

arco68

Recognized Developer
Oct 11, 2010
2,820
24,313
203
Just downloaded the kernel sauce for SPH-L520. Seems like it's using msm8930_serrano_defconfig as base config, and not the usa one. I'll need to compare what's different from the 9195 kernel, and also probably merge some code changes.