TCL A3 (tcl-bangkok tf)

The TCL A3 (also known as the A509DL) is a low-range smartphone manufactured by TCL. The device is quite powerful for its low price-point, making it a prime candidate for porting. The device is either carrier locked to the U.S. carrier Tracfone or US Cellular. The back cover can be removed with a small notch on the bottom right portion of the phone. Removing this reveals one microsd card slot, one sim card slot, and the battery, which is removable.
It is nearly identical to the TCL A30. 
== Contributors ==
* Justsoup
* hexaheximal
* adomerle
== Users owning this device ==
== How to enter flash mode ==
* Recovery: Power on the device while holding Volume Up + Power.
* MTKClient: Hold Volume Up + Volume Down and plug the device into the host computer running MTKClient.
== Installation (pmbootstrap) ==
Use pmbootstrap to build your own installation image.
$ pmbootstrap init
$ pmbootstrap install
$ pmbootstrap flasher flash_kernel
$ pmbootstrap flasher flash_rootfs
$ pmbootstrap flasher flash_dtbo
== Installation (recovery) ==
The normal pmbootstrap flashing can take a while depending on the user interface chosen. As such, flashing with the recovery installation is also supported.
Use pmbootstrap to build your own installation image.
$ pmbootstrap init
$ pmbootstrap install --android-recovery-zip --recovery-install-partition=data
Put TWRP into sideload mode.
$ pmbootstrap flasher --method=adb sideload
The install will error around 59%. This is to be expected. If the device states that the installation was completed, then this error can be ignored and flashing is complete.
== MTKClient ==
Due to the disabling of fastboot in the device bootloader, it is required that TWRP is installed to flash easily. As such, to install TWRP in the first place, a tool called MTKClient is required.
To install TWRP:
* Unlock Bootloader
$ python mtk e metadata,userdata,md_udc
$ python mtk da seccfg unlock
$ python mtk reset
* Download TWRP
* Flash to Recovery
$ python mtk w recovery <name of TWRP file>
$ python mtk reset
Then, reboot your device and TWRP should be installed. Enter TWRP by holding Power + Volume Up during boot.
== Feature Progress ==
Feature 	Model 	State 	Notes
USB Networking 	Unknown 	Broken 	USB support added to the dts and kernel but unable to test due to kernel build issue.
Flashing 	N/A 	Works 	With the addition of MTKClient as a flashing option, flashing is available.
Touchscreen 	Focaltech(?) 	Broken 	No work done yet for mainline.
Display 	Zhunyi Z69001-ZC (gc9702p) 	Partial	Framebuffer is able to appear.
Framebuffer 	Unknown 	Partial	See Display.
WiFi 	Unknown 	Broken 	No work done yet for mainline.
FDE 	N/A 	Broken 	No work done yet for mainline.
Mainline 	N/A 	Partial	Justsoup and Adomerle have added basic mt6762 support to a mainline fork but is only able to get past the bootloader.
Battery 	TLi028C7 (Alcatel Branding)	Broken 	Battery should work but has not been tested yet.
3D Acceleration	PowerVR GE8320 	Broken 	No work done yet for mainline.
Audio 	Unknown 	Broken 	No work done yet for mainline.
Bluetooth 	Unknown 	Broken 	No work done yet for mainline.
Camera 	Unknown 	Broken 	No work done yet for mainline.
GPS 	Unknown 	Broken 	No work done yet for mainline.
Mobile Data 	Unknown 	Broken 	No work done yet for mainline.
SMS 	Unknown 	Broken 	No work done yet for mainline.
Calls 	Unknown 	Broken 	No work done yet for mainline.
USB OTG 	Unknown 	Broken 	No work done yet for mainline.
NFC 	Unknown 	Broken 	No work done yet for mainline.
Accelerometer 	Unknown 	Broken 	No work done yet for mainline.
Magnetometer 	Unknown 	Broken 	No work done yet for mainline.
Ambient Light 	Unknown 	Broken 	No work done yet for mainline.
Proximity 	Unknown 	Broken 	No work done yet for mainline.
Barometer 	Unknown 	Broken 	No work done yet for mainline.
Power Sensor 	Unknown 	Broken 	See battery.
Camera Flash 	Unknown 	Broken 	Should work but has not been tested yet.
Haptics 	Unknown 	Works 	Vibration motors kick in when a specific command is sent.
Downstream 	N/A 	Works 	Abandoned. Only the display and storage access works.
FOSS Bootloader	N/A 	Broken 	MediaTek secure boot is enabled so a new lk cannot be flashed. Most likely will require a U-Boot port.
== Hardware / sensors detail ==
For reference, sensor information from sensors sandbox (f-droid) on A509DL; unfortunately no part numbers.
sensor details (sensorssandbox)
name 	vendor	version	type
Accelerometer	MTK 	1 	1
Magnetometer 	MTK 	1 	2
Orientation 	MTK 	1 	3
Light 	MTK 	1 	5
Pressure 	MTK 	1 	6
Proximity 	MTK 	1 	8
== Mainlining ==
The mainlining workflow for this device is the following:
* Patch Kernel
* Commit
* mtk e expdb
* pmbootstrap flasher flash_kernel
* Boot Device Twice
* Remove Battery Before Third Boot
* mtk r expdb expdb.img
* Read expdb.img as a Text File
* Read Logs from expdb.img
== Bugs ==
* Sometimes TWRP is unable to read the /data partition. An easy fix is to wipe the partition using TWRP [THIS WILL WIPE YOUR PMOS INSTALL AND/OR ANY ANDROID DATA LEFTOVER] and then continue with flashing.
* USB Networking is hindered by some form of power issue within the kernel drivers.
== See also ==
* Mainline Fork
* MTKClient
* lowendlibre Project
* MTKClient integration into pmbootstrap
* TWRP
* Downstream Kernel Source