reMarkableWiki

Everything about the reMarkable Paper Tablet

User Tools

Site Tools


tech:rm2_otg_pogo

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tech:rm2_otg_pogo [2021/01/16 23:48]
alistair23 Add in the device tree diff
tech:rm2_otg_pogo [2021/02/20 17:34] (current)
tg-x
Line 1: Line 1:
 ===== rM2 Pogo Pins and OTG ===== ===== rM2 Pogo Pins and OTG =====
  
-The remarkable 2 has two USB port, one USB-port used for charging and connecting to a PC and a second one exposed on the pogo pins. +The remarkable 2 has two USB port, one USB-port used for charging and connecting to a PC and a second one exposed on the pogo pins. 
-The chip used for charging the device (max77818) only supports one Vbus with back power. This bus is connected to the pogo pins, so only this port can be used for USB OTG.+The chip used for charging the device (max77818) only supports one VBUS with back power. This bus is connected to the pogo pins, so only this port can be used for USB OTG.
  
 === Pogo Pins OTG === === Pogo Pins OTG ===
Line 12: Line 12:
     GND, ID, D+, D-, VBUS     GND, ID, D+, D-, VBUS
  
-With the VBUS closes ​to the USB-port. There is a custom linux drivers that controls the USB port dr mode and VBUS power ([[https://​github.com/​reMarkable/​linux/​tree/​zero-sugar/​drivers/​misc/​rm-otgcontrol]]). The driver monitors the status of the ID pin. If it gets grounded it tries to authenticate the device before changing the port to OTG mode. This authentication is intended to work over a one-wire protocol over the ID port, but is currently unimplemented. As a result the device detection is currently disabled by default ([[https://​github.com/​reMarkable/​linux/​commit/​e27d817e3c968624f7ae454f9b643157a2d39dab]]).+With the VBUS closest ​to the USB-port. There is a custom linux drivers that controls the USB port dr mode and VBUS power ([[https://​github.com/​reMarkable/​linux/​tree/​zero-sugar/​drivers/​misc/​rm-otgcontrol]]). The driver monitors the status of the ID pin. If it gets grounded it tries to authenticate the device before changing the port to OTG mode. This authentication is intended to work over a one-wire protocol over the ID port, but is currently unimplemented. As a result the device detection is currently disabled by default ([[https://​github.com/​reMarkable/​linux/​commit/​e27d817e3c968624f7ae454f9b643157a2d39dab]]).
  
 Luckily there is an unauthenticated mode that can be enabled by writing to sysfs: Luckily there is an unauthenticated mode that can be enabled by writing to sysfs:
     echo 2 > /​sys/​otgcontrol/​control/​otg1_controllermode     echo 2 > /​sys/​otgcontrol/​control/​otg1_controllermode
  
-Now whenever the ID pin is connected to ground, the VBUS supply will be set to OTG mode and the USB mode will change to host. This allows connecting any OTG device by connecting the pogo pins to a micro-USB connector and using an OTG cable (or creating a custom pogo cable that connects ID to ground).+Now whenever the ID pin is connected to ground, the VBUS supply will be set to OTG mode and the USB mode will change to host. This allows connecting any OTG device by connecting the pogo pins to a Micro-USB connector and using an OTG cable (or creating a custom pogo cable that connects ID to ground).
  
 It's also possible to manually control the VBUS and dr mode by using sysfs, for example to put it into OTG mode: It's also possible to manually control the VBUS and dr mode by using sysfs, for example to put it into OTG mode:
Line 28: Line 28:
 It is also possible to disable OTG from the pogo pins and instead use the ID pin as a UART TX. This allows the software to print logs via UART to the ID pin. This is especially useful for debugging or developing U-boot or kernel issue. It is also possible to disable OTG from the pogo pins and instead use the ID pin as a UART TX. This allows the software to print logs via UART to the ID pin. This is especially useful for debugging or developing U-boot or kernel issue.
  
-Currently this has been tested with the Linux kernel by printing the entire boot log via `uart6` which is broken out to the Pogo pin ID pin (see above). Although it should also work for u-boot.+Currently this has been tested with the Linux kernel by printing the entire boot log via `uart6` which is broken out to the pogo pin ID pin (see above). Although it should also work for u-boot.
  
 == Enable UART == == Enable UART ==
Line 112: Line 112:
 You should double check to make sure the args look like they originally did (without quiet) using fw_printenv mmcargs You should double check to make sure the args look like they originally did (without quiet) using fw_printenv mmcargs
  
-=== USB-in OTG mode ===+=== USB-in OTG mode ===
  
-There is a [[kernel#​otgcontrol| kernel module]] which controls the OTG mode of the USB-port, provided by remarkable.+There is a [[kernel#​otgcontrol| kernel module]] which controls the OTG mode of the USB-port, provided by remarkable.
 At present it does not correctly detect and configure when it should be an OTG host. At present it does not correctly detect and configure when it should be an OTG host.
  
-It's also possible to change the dr mode of the USB-port to OTG by executing:+It's also possible to change the dr mode of the USB-port to OTG by executing:
 <​code>​ <​code>​
-echo host > /​sys/​kernel/​debug/​ci_hdrc.1/role+echo host > /​sys/​kernel/​debug/​ci_hdrc.0/role
 </​code>​ </​code>​
  
 However, the VBUS will not be powered. However, the VBUS will not be powered.
-A powered ​usb hub does not work if the control chip still uses host vbus, which is required by the usb standard. + 
-USB-OTG forking cable might work, this has yet to be tested.+A USB-OTG forking cable does work with external power. This has been tested. 
 + 
 +A powered ​USB hub does not work if the control chip still uses host VBUS, which is required by the USB standard.
tech/rm2_otg_pogo.1610837324.txt.gz · Last modified: 2021/01/16 23:48 by alistair23