LG G2 International (lg-d802)

== Contributors ==
* Federico Proverbio (fproverbio)
== Maintainer(s) ==
Federico Proverbio (fproverbio)
== Users owning this device ==
== How to enter flash mode ==
Instructions are shared between this device and others from the same manufacturer (LG). The detailed steps can be found here https://wiki.postmarketos.org/wiki/LG_G3_Europe_(lg-d855).
Currently flashing the kernel results in the following error:
fastboot: error: Couldn't parse partition size '0x'
Booting using pmbootstrap flasher boot does succesfully boot the device, allowing ssh connection via USB.
== Installation ==
== Mainlining ==
This device is very similar to Nexus 5, sharing large parts of the schematic. Main differences are:
* Charger IC - Nexus 5 has bq24192 while D802 uses smb349 (no driver upstream); mostly needed for OTG to work;
* Proximity sensor - APDS9930 versus APDS9900 (no driver, though part-numbers seem similar);
* IMU - LSM330 instead of MPU6515 (no driver);
* Slight differences in I2C topology, some PMIC outputs adjusted;
* Different panels
I had some success booting mainline kernel, getting up panel, USB, WiFi, touchscreen, buttons, battery level reading, MMC;
== Quirks ==
My D802 overheats very quickly - because of the lack of DVFS CPU does not adjust clock speed, running at full constantly. After 5-10 minutes messages indicating thermal overrun appear and the device shuts off.
Somehow there's no serial output on 6.8 kernel, even though serial is routed exactly the same as Nexus 5. It works only if the bootloader configures it in advance (lk2nd is of no help because it has serial routed to UART2).
I managed to get serial working by patching lk2nd, switching it to UART1 (both registers, clocks and pinctrl) After lk2nd configures all above-mentioned blocks you can get serial output from the kernel.
By the quick look there are no pinctrl nodes for UART1 in the msm8974 device tree - may be that's why?
== Partition Layout==
 lg-d802:/home/user# fdisk -l -o Device,Start,End,Sectors,Size,Name /dev/mmcblk0
 Disk /dev/mmcblk0: 29.12 GiB, 31268536320 bytes, 61071360 sectors
 Units: sectors of 1 * 512 = 512 bytes
 Sector size (logical/physical): 512 bytes / 512 bytes
 I/O size (minimum/optimal): 512 bytes / 512 bytes
 Disklabel type: gpt
 Disk identifier: 98101B32-BBE2-4BF2-A06E-2BB33D000C20
 ----------------------------------------------------------
 Device Start End Sectors Size Name
 /dev/mmcblk0p1 32768 163839 131072 64M modem
 /dev/mmcblk0p2 163840 165887 2048 1M sbl1
 /dev/mmcblk0p3 165888 166911 1024 512K dbi
 /dev/mmcblk0p4 196608 197631 1024 512K DDR
 /dev/mmcblk0p5 229376 231423 2048 1M aboot
 /dev/mmcblk0p6 231424 233471 2048 1M rpm
 /dev/mmcblk0p7 262144 294911 32768 16M boot
 /dev/mmcblk0p8 294912 296959 2048 1M tz
 /dev/mmcblk0p9 296960 296961 2 1K pad
 /dev/mmcblk0p10 327680 333823 6144 3M modemst1
 /dev/mmcblk0p11 333824 339967 6144 3M modemst2
 /dev/mmcblk0p12 339968 339969 2 1K pad1
 /dev/mmcblk0p13 360448 393215 32768 16M misc
 /dev/mmcblk0p14 393216 458751 65536 32M persist
 /dev/mmcblk0p15 458752 491519 32768 16M recovery
 /dev/mmcblk0p16 491520 497663 6144 3M fsg
 /dev/mmcblk0p17 524288 525311 1024 512K fsc
 /dev/mmcblk0p18 525312 526335 1024 512K ssd
 /dev/mmcblk0p19 526336 526337 2 1K pad2
 /dev/mmcblk0p20 526338 527361 1024 512K encrypt
 /dev/mmcblk0p21 557056 573439 16384 8M drm
 /dev/mmcblk0p22 573440 589823 16384 8M sns
 /dev/mmcblk0p23 589824 655359 65536 32M laf
 /dev/mmcblk0p24 655360 720895 65536 32M fota
 /dev/mmcblk0p25 720896 786431 65536 32M mpt
 /dev/mmcblk0p26 786432 787455 1024 512K dbibak
 /dev/mmcblk0p27 787456 789503 2048 1M rpmbak
 /dev/mmcblk0p28 789504 791551 2048 1M tzbak
 /dev/mmcblk0p29 791552 791567 16 8K rct
 /dev/mmcblk0p30 819200 6488063 5668864 2.7G system
 /dev/mmcblk0p31 6488064 7733247 1245184 608M cache
 /dev/mmcblk0p32 7733248 7897087 163840 80M tombstones
 /dev/mmcblk0p33 7897088 7929855 32768 16M spare
 /dev/mmcblk0p34 7929856 8028159 98304 48M cust
 /dev/mmcblk0p35 8028160 60948479 52920320 25.2G userdata
 /dev/mmcblk0p36 60948480 61071326 122847 60M grow
== See also ==