Jump to content

LG G Watch R (lg-lenok): Difference between revisions

From postmarketOS Wiki
No edit summary
Cristianc (talk | contribs)
Device owners, fix headers
 
(20 intermediate revisions by 13 users not shown)
Line 1: Line 1:
{{note| This device is still running on armhf, although the processor supports armv7. If you own it, change it and test it [https://wiki.postmarketos.org/wiki/Tips_and_tricks#Update_the_architecture_of_your_device that] way.}}
{{Infobox device
{{Infobox device
| manufacturer = LG
| manufacturer = LG
| name = G Watch R
| name = G Watch R
| codename = lg-lenok
| codename = lg-lenok
| model = LG-W110
| image = File:Lg-g-watch-r.jpg
| image = File:Lg-g-watch-r.jpg
| imagecaption = LG G Watch R running the weston demo
| imagecaption = LG G Watch R running the weston demo
| releaseyear = 2015
| releaseyear = 2015
| originalsoftware = Android Wear 1.0 and 2.0
| originalsoftware = Wear OS
| chipset = Qualcomm APQ8026 Snapdragon 400
| originalversion = 1.0
| extendedversion = 2.0
| chipset = Qualcomm Snapdragon 400 (APQ8026)
| cpu = Quad-core 1.2 GHz Cortex-A7
| cpu = Quad-core 1.2 GHz Cortex-A7
| gpu = Adreno 305
| gpu = Adreno 305
Line 15: Line 17:
| memory = 512 MB
| memory = 512 MB
| architecture = armv7
| architecture = armv7
| type = Watch
| status_usbnet = Y
| status_usbnet = Y
| status_flashing = Y
| status_flashing = Y
Line 22: Line 25:
| status_xwayland = Y
| status_xwayland = Y
| status_fde =  
| status_fde =  
| status_mainline =  
| status_mainline = Y
| status_battery =
| status_battery =
| status_3d =  
| status_3d =  
Line 33: Line 36:
| status_sms = -
| status_sms = -
| status_calls = -
| status_calls = -
| status_nfc = -
| status_irtx = -
| booting = yes
| booting = yes
}}
}}
=== Contributors ===
== Contributors ==


* Bloo
* Bloo
Line 42: Line 47:
* ata2001
* ata2001
* opendata
* opendata
* z3ntu


=== Entering Fastboot mode ===
== Users owning this device ==
{{Device owners}}
 
== Entering Fastboot mode ==


Turn on your watch and swipe from the top left corner (so thatd be where 11 would be on the watch) as soon as you see the LG logo.
Turn on your watch and swipe from the top left corner (so thatd be where 11 would be on the watch) as soon as you see the LG logo.


=== Preperation ===
== Preparation ==


* Add <code>deviceinfo_flash_sparse="true"</code> the deviceinfo file
* Add <code>deviceinfo_flash_sparse="true"</code> the deviceinfo file
* Replace sshd with dropbear as seen in the [[USB Network]][https://wiki.postmarketos.org/wiki/USB_Network] page
* Replace sshd with dropbear as seen in the [[USB_Network]] page


=== Installation ===
== Installation ==


First build the image:
First build the image:


<source lang="shell-session">
<syntaxhighlight lang="shell-session">
$ pmbootstrap init
$ pmbootstrap init
$ pmbootstrap install
$ pmbootstrap install
</source>
</syntaxhighlight>


Then in order to flash it put your device in fastboot mode, and plug it in USB. Then do:  
Then in order to flash it put your device in fastboot mode, and plug it in USB. Then do:  


<source lang="shell-session">
<syntaxhighlight lang="shell-session">
$ pmbootstrap flasher flash_rootfs --partition userdata
$ pmbootstrap flasher flash_rootfs --partition userdata
$ pmbootstrap flasher flash_kernel
$ pmbootstrap flasher flash_kernel
</source>
</syntaxhighlight>


It will boot straight into pmOS once the kernel is flashed and the system is on userdata.
We flash to the `userdata` partition as the system partition is not big enough for postmarketOS.
We flash to the `userdata` partition as the system partition is not big enough for postmarketOS.


=== Links ===
You can then either reboot or run <code>fastboot continue</code> to boot into postmarketOS.
* {{github|489}} initial PR
 
* [https://github.com/JamesHealdUK/pmbootstrap/tree/device-lg-g-watch-r JamesHealdUK's repo with the device-lg-g-watch-r branch] (should have all been merged to master by now, see the PR above)
 
== UART ==
 
UART is multiplexed on the USB port. The watch has five pads that are directly connected to the docking station's USB connector.
This makes it possible to build a custom cable that just plugs into the dock to read the UART output, no resistor needed. Neat!
 
Pin order is the following, when looking at the docking station from the top, USB cable on the left:
 
{| class="wikitable"
|+Pogo pin order on dock, USB on the left
|-
|TOP
|GND
|GND
|-
|2
|ID
|
|-
|3
|D+
|UART TX
|-
|4
|D-
|
|-
|BOTTOM
|VCC
|
|}
 
 
According to the kernel code, there seems to be some code checking if v(USB id) is about 900 mV
before muxing UART to the USB connector, and an extra command line parameter, <code>uart_console=enable</code> might have to be enabled to output the kernel messages.
Still according to that code, adding <code>lge.earjack-debugger=always</code> seems force muxing without applying a voltage on the id pin. Despite this, logging seems to always be enabled, and none of the above is necessary when connected to a test circuit with just GND and TX.
 
The following is the complete early boot sequence captured at 115200 bauds. UART output seems to be enabled by default during early boot, so applying a specific voltage to the ID pin is not needed. Note that you will need to keep the power button pushed until "welcome to lenok bootloader" appears, otherwise the boot process is interrupted.
<syntaxhighlight lang="text">
Format: Log Type - Time(microsec) - Message
Log type: B - since boot(excluding boot rom).  D - delta
B -    168756 - SBL1, Start
B -    174002 - scatterload_region && ram_init, Start
D -        30 - scatterload_region && ram_init, Delta
B -    189527 - pm_device_init, Start
D -    16775 - pm_device_init, Delta
B -    216428 - volume_down: not pressed
B -    216824 - boot_flash_init, Start
D -    20587 - boot_flash_init, Delta
B -    247812 - volume_down: not pressed
B -    247843 - boot_config_data_table_init, Start
D -        0 - boot_config_data_table_init, Delta
B -    254248 - sbl1_ddr_set_params, Start
B -    257999 - Pre_DDR_clock_init, Start
D -      183 - Pre_DDR_clock_init, Delta
D -        0 - sbl1_ddr_set_params, Delta
B -    272395 - pm_driver_init, Start
D -    24186 - pm_driver_init, Delta
B -    296765 - clock_init, Start
D -      213 - clock_init, Delta
B -    315919 - Image Load, Start
B -    416203 - Tz Execution, Start
D -    133773 - Tz Execution, Delta
B -    551043 - Image Load, Start
B -    616984 - Signal PBL to Jump to RPM FW
B -  1546380 - Image Load, Start
B -  1547234 - hw_rev adc result:1791
B -  1547936 - Cable ADC: 1749
B -  1549430 - charger type: non DCP
B -  1553609 - hw_rev adc result:1791
B -  1556293 - [bq27421] config params start
B -  1622905 - [bq27421] config params end
B -  1622966 - Image Load, Start
B -  1727733 - sbl1_efs_handle_cookies, Start
D -      335 - sbl1_efs_handle_cookies, Delta
B -  1729716 - RPM sync cookie updated
B -  1734748 - qfuse: fusing unFlaged
B -  1736761 - SBL1, End
 
 
welcome to lenok bootloader
[0] Power on reason 80
[10] platform_init()
[90] touch synaptics: touch_poll init
[140] Done initialization of the card
[160] Loaded IMGDATA at 0x8000000
[170] LCD: 320P OLED cmd panel
[170] bpp 24
[220] Config MIPI_CMD_PANEL.
[400] Turn on MIPI_CMD_PANEL.
[440] cable type from shared memory: 10
[440] reboot_mode restart reason = power_on
[490] splash: boot
[1530] use_signed_kernel=0, is_unlocked=0, is_tampered=0.
[1530] Loading boot image (15646720): start
[1660] Loading boot image (15646720): done
[1660] Found Appeneded Flattened Device tree
[1670] DTB: platform id 199, board id 132, soc rev 20000, board rev 10
[1680] get_display_kcal = 0, 0, 0, x
[1680]
Booting Linux
[3680] Updating device tree: start
[3760] Updating device tree: done
[3770] Turn off MIPI_CMD_PANEL.
[3770] Continuous splash enabled, keeping panel alive.
[3770] booting linux @ 0x8000, ramdisk @ 0x2000000 (1246306), tags/device tree @ 0x1e00000
</syntaxhighlight>
 
== Internal storage ==
 
<syntaxhighlight lang="shell-session">
$ ls -al /dev/block/platform/msm_sdcc.1/by-name/
drwxr-xr-x    2 root    root          480 Jan  1 05:08 .
drwxr-xr-x    4 root    root          560 Jan  1 05:08 ..
lrwxrwxrwx    1 root    root            21 Jan  1 05:08 DDR -> /dev/block/mmcblk0p18
lrwxrwxrwx    1 root    root            20 Jan  1 05:08 aboot -> /dev/block/mmcblk0p5
lrwxrwxrwx    1 root    root            20 Jan  1 05:08 abootb -> /dev/block/mmcblk0p9
lrwxrwxrwx    1 root    root            21 Jan  1 05:08 boot -> /dev/block/mmcblk0p15
lrwxrwxrwx    1 root    root            21 Jan  1 05:08 cache -> /dev/block/mmcblk0p20
lrwxrwxrwx    1 root    root            21 Jan  1 05:08 grow -> /dev/block/mmcblk0p22
lrwxrwxrwx    1 root    root            21 Jan  1 05:08 imgdata -> /dev/block/mmcblk0p10
lrwxrwxrwx    1 root    root            21 Jan  1 05:08 laf -> /dev/block/mmcblk0p14
lrwxrwxrwx    1 root    root            21 Jan  1 05:08 metadata -> /dev/block/mmcblk0p11
lrwxrwxrwx    1 root    root            21 Jan  1 05:08 misc -> /dev/block/mmcblk0p12
lrwxrwxrwx    1 root    root            21 Jan  1 05:08 persist -> /dev/block/mmcblk0p13
lrwxrwxrwx    1 root    root            21 Jan  1 05:08 recovery -> /dev/block/mmcblk0p16
lrwxrwxrwx    1 root    root            20 Jan  1 05:08 rpm -> /dev/block/mmcblk0p2
lrwxrwxrwx    1 root    root            20 Jan  1 05:08 rpmb -> /dev/block/mmcblk0p7
lrwxrwxrwx    1 root    root            20 Jan  1 05:08 sbl1 -> /dev/block/mmcblk0p1
lrwxrwxrwx    1 root    root            20 Jan  1 05:08 sbl1b -> /dev/block/mmcblk0p6
lrwxrwxrwx    1 root    root            20 Jan  1 05:08 sdi -> /dev/block/mmcblk0p4
lrwxrwxrwx    1 root    root            21 Jan  1 05:08 ssd -> /dev/block/mmcblk0p17
lrwxrwxrwx    1 root    root            21 Jan  1 05:08 system -> /dev/block/mmcblk0p19
lrwxrwxrwx    1 root    root            20 Jan  1 05:08 tz -> /dev/block/mmcblk0p3
lrwxrwxrwx    1 root    root            20 Jan  1 05:08 tzb -> /dev/block/mmcblk0p8
lrwxrwxrwx    1 root    root            21 Jan  1 05:08 userdata -> /dev/block/mmcblk0p21
</syntaxhighlight>
 
Note, that the system partition is a squashfs image and needs to be mounted differently compared to ext4 or f2fs.
 
== Links ==
* {{MR|489}} initial PR
* {{MR|2169|pmaports}}
* [https://github.com/pmsourcedump/kernel_lge_bass-lenok/ kernel source backup]
* [https://github.com/pmsourcedump/kernel_lge_bass-lenok/ kernel source backup]
* [https://asteroidos.org/install/lenok/ AsteroidOS device page]
* [https://asteroidos.org/install/lenok/ AsteroidOS device page]
* [https://lore.kernel.org/linux-arm-msm/20210911232707.259615-1-luca@z3ntu.xyz/T/ Initial mainline support]

Latest revision as of 14:38, 20 November 2023

LG G Watch R
LG G Watch R running the weston demo
LG G Watch R running the weston demo
Manufacturer LG
Name G Watch R
Codename lg-lenok
Model LG-W110
Released 2015
Type watch
Hardware
Chipset Qualcomm Snapdragon 400 (APQ8026)
CPU Quad-core 1.2 GHz Cortex-A7
GPU Adreno 305
Display 320x320 P-OLED
Storage 4 GB
Memory 512 MB
Architecture armv7
Software
Original software Wear OS
Original version 1.0
Extended version 2.0
postmarketOS
Category testing
Pre-built images no
Mainline yes
Features
Flashing
Works
USB Networking
Works
Internal storage
No data
SD card
No data
Battery
No data
Screen
Works
Touchscreen
Works
Multimedia
3D Acceleration
No data
Camera Flash
No data
Connectivity
WiFi
No data
Bluetooth
No data
Miscellaneous
FDE
No data
USB OTG
No data
HDMI/DP
No data
Sensors
Accelerometer
No data
Magnetometer
No data
Ambient Light
No data
Proximity
No data
Hall Effect
No data
Haptics
No data
Barometer
No data

Contributors

  • Bloo
  • drebrez
  • ollieparanoid
  • ata2001
  • opendata
  • z3ntu

Users owning this device


Entering Fastboot mode

Turn on your watch and swipe from the top left corner (so thatd be where 11 would be on the watch) as soon as you see the LG logo.

Preparation

  • Add deviceinfo_flash_sparse="true" the deviceinfo file
  • Replace sshd with dropbear as seen in the USB_Network page

Installation

First build the image:

$ pmbootstrap init
$ pmbootstrap install

Then in order to flash it put your device in fastboot mode, and plug it in USB. Then do:

$ pmbootstrap flasher flash_rootfs --partition userdata
$ pmbootstrap flasher flash_kernel

We flash to the `userdata` partition as the system partition is not big enough for postmarketOS.

You can then either reboot or run fastboot continue to boot into postmarketOS.


UART

UART is multiplexed on the USB port. The watch has five pads that are directly connected to the docking station's USB connector. This makes it possible to build a custom cable that just plugs into the dock to read the UART output, no resistor needed. Neat!

Pin order is the following, when looking at the docking station from the top, USB cable on the left:

Pogo pin order on dock, USB on the left
TOP GND GND
2 ID
3 D+ UART TX
4 D-
BOTTOM VCC


According to the kernel code, there seems to be some code checking if v(USB id) is about 900 mV before muxing UART to the USB connector, and an extra command line parameter, uart_console=enable might have to be enabled to output the kernel messages. Still according to that code, adding lge.earjack-debugger=always seems force muxing without applying a voltage on the id pin. Despite this, logging seems to always be enabled, and none of the above is necessary when connected to a test circuit with just GND and TX.

The following is the complete early boot sequence captured at 115200 bauds. UART output seems to be enabled by default during early boot, so applying a specific voltage to the ID pin is not needed. Note that you will need to keep the power button pushed until "welcome to lenok bootloader" appears, otherwise the boot process is interrupted.

Format: Log Type - Time(microsec) - Message
Log type: B - since boot(excluding boot rom).  D - delta
B -    168756 - SBL1, Start
B -    174002 - scatterload_region && ram_init, Start
D -        30 - scatterload_region && ram_init, Delta
B -    189527 - pm_device_init, Start
D -     16775 - pm_device_init, Delta
B -    216428 - volume_down: not pressed
B -    216824 - boot_flash_init, Start
D -     20587 - boot_flash_init, Delta
B -    247812 - volume_down: not pressed
B -    247843 - boot_config_data_table_init, Start
D -         0 - boot_config_data_table_init, Delta
B -    254248 - sbl1_ddr_set_params, Start
B -    257999 - Pre_DDR_clock_init, Start
D -       183 - Pre_DDR_clock_init, Delta
D -         0 - sbl1_ddr_set_params, Delta
B -    272395 - pm_driver_init, Start
D -     24186 - pm_driver_init, Delta
B -    296765 - clock_init, Start
D -       213 - clock_init, Delta
B -    315919 - Image Load, Start
B -    416203 - Tz Execution, Start
D -    133773 - Tz Execution, Delta
B -    551043 - Image Load, Start
B -    616984 - Signal PBL to Jump to RPM FW
B -   1546380 - Image Load, Start
B -   1547234 - hw_rev adc result:1791
B -   1547936 - Cable ADC: 1749
B -   1549430 - charger type: non DCP
B -   1553609 - hw_rev adc result:1791
B -   1556293 - [bq27421] config params start
B -   1622905 - [bq27421] config params end
B -   1622966 - Image Load, Start
B -   1727733 - sbl1_efs_handle_cookies, Start
D -       335 - sbl1_efs_handle_cookies, Delta
B -   1729716 - RPM sync cookie updated
B -   1734748 - qfuse: fusing unFlaged
B -   1736761 - SBL1, End


welcome to lenok bootloader
[0] Power on reason 80
[10] platform_init()
[90] touch synaptics: touch_poll init
[140] Done initialization of the card
[160] Loaded IMGDATA at 0x8000000
[170] LCD: 320P OLED cmd panel
[170] bpp 24
[220] Config MIPI_CMD_PANEL.
[400] Turn on MIPI_CMD_PANEL.
[440] cable type from shared memory: 10
[440] reboot_mode restart reason = power_on
[490] splash: boot
[1530] use_signed_kernel=0, is_unlocked=0, is_tampered=0.
[1530] Loading boot image (15646720): start
[1660] Loading boot image (15646720): done
[1660] Found Appeneded Flattened Device tree
[1670] DTB: platform id 199, board id 132, soc rev 20000, board rev 10
[1680] get_display_kcal = 0, 0, 0, x
[1680] 
Booting Linux
[3680] Updating device tree: start
[3760] Updating device tree: done
[3770] Turn off MIPI_CMD_PANEL.
[3770] Continuous splash enabled, keeping panel alive.
[3770] booting linux @ 0x8000, ramdisk @ 0x2000000 (1246306), tags/device tree @ 0x1e00000

Internal storage

$ ls -al /dev/block/platform/msm_sdcc.1/by-name/
drwxr-xr-x    2 root     root           480 Jan  1 05:08 .
drwxr-xr-x    4 root     root           560 Jan  1 05:08 ..
lrwxrwxrwx    1 root     root            21 Jan  1 05:08 DDR -> /dev/block/mmcblk0p18
lrwxrwxrwx    1 root     root            20 Jan  1 05:08 aboot -> /dev/block/mmcblk0p5
lrwxrwxrwx    1 root     root            20 Jan  1 05:08 abootb -> /dev/block/mmcblk0p9
lrwxrwxrwx    1 root     root            21 Jan  1 05:08 boot -> /dev/block/mmcblk0p15
lrwxrwxrwx    1 root     root            21 Jan  1 05:08 cache -> /dev/block/mmcblk0p20
lrwxrwxrwx    1 root     root            21 Jan  1 05:08 grow -> /dev/block/mmcblk0p22
lrwxrwxrwx    1 root     root            21 Jan  1 05:08 imgdata -> /dev/block/mmcblk0p10
lrwxrwxrwx    1 root     root            21 Jan  1 05:08 laf -> /dev/block/mmcblk0p14
lrwxrwxrwx    1 root     root            21 Jan  1 05:08 metadata -> /dev/block/mmcblk0p11
lrwxrwxrwx    1 root     root            21 Jan  1 05:08 misc -> /dev/block/mmcblk0p12
lrwxrwxrwx    1 root     root            21 Jan  1 05:08 persist -> /dev/block/mmcblk0p13
lrwxrwxrwx    1 root     root            21 Jan  1 05:08 recovery -> /dev/block/mmcblk0p16
lrwxrwxrwx    1 root     root            20 Jan  1 05:08 rpm -> /dev/block/mmcblk0p2
lrwxrwxrwx    1 root     root            20 Jan  1 05:08 rpmb -> /dev/block/mmcblk0p7
lrwxrwxrwx    1 root     root            20 Jan  1 05:08 sbl1 -> /dev/block/mmcblk0p1
lrwxrwxrwx    1 root     root            20 Jan  1 05:08 sbl1b -> /dev/block/mmcblk0p6
lrwxrwxrwx    1 root     root            20 Jan  1 05:08 sdi -> /dev/block/mmcblk0p4
lrwxrwxrwx    1 root     root            21 Jan  1 05:08 ssd -> /dev/block/mmcblk0p17
lrwxrwxrwx    1 root     root            21 Jan  1 05:08 system -> /dev/block/mmcblk0p19
lrwxrwxrwx    1 root     root            20 Jan  1 05:08 tz -> /dev/block/mmcblk0p3
lrwxrwxrwx    1 root     root            20 Jan  1 05:08 tzb -> /dev/block/mmcblk0p8
lrwxrwxrwx    1 root     root            21 Jan  1 05:08 userdata -> /dev/block/mmcblk0p21

Note, that the system partition is a squashfs image and needs to be mounted differently compared to ext4 or f2fs.

Links