USB host

From Openmoko

Revision as of 22:56, 20 July 2008 by Iknowjoseph (Talk | contribs)

Jump to: navigation, search

The Neo1973 as a USB host

The Neo1973's mini-USB port can be configured to act as a usb host instead of a usb device. This opens up a range of possibilities, such as USB cameras and usb input devices.

This used to require a kernel patch provided as an attachment in Bugzilla, but that same page now details how to do this without any kernel hacking:


Tell the device that it is logically a host:

echo "host" > /sys/devices/platform/s3c2410-ohci/usb_mode

Instruct the device to provide 5 volts:

echo "1" > /sys/devices/platform/neo1973-pm-host.0/hostmode


Note: You may want to run ifconfig usb0 down prior to switching to usb host mode, as the Neo's usb networking may not like having its USB port disappear. You'll probably want to ssh into your Neo over WiFi or Bluetooth before starting all of this, alternatively use an on screen keyboard.

Three-Headed Cable

At the moment, you'll have to manufacture this one yourself. You need to make a cable with three ends:

  • A mini-usb type B cable for the Neo itself
  • A cable of whatever type to go to your USB device.
  • A cable going to a +5V voltage source with enough power for your device and to charge the Neo. This could be a wall charger or even another USB plug.

You just connect the Data+ and Data- wires of the Neo and the device, and connect all of the ground wires together and all of the +5V wires together. This powers the Neo and the device, while letting the neo talk to the device.

Just for reference, the USB wires from left to right are:

  • Black: Power -
  • Green: Data -
  • White: Data +
  • Red: Power +

Power Concerns

You'll need to force the Neo to go into fast charge mode, since it can't do its usual power negotiation over USB.

echo -n "fast_cccv" >  /sys/devices/platform/s3c2410-i2c/i2c-adapter/i2c-0/0-0008/chgmode
Personal tools

The Neo1973 as a USB host

The Neo1973's mini-USB port can be configured to act as a usb host instead of a usb device. This opens up a range of possibilities, such as USB cameras and usb input devices.

This used to require a kernel patch provided as an attachment in Bugzilla, but that same page now details how to do this without any kernel hacking:


Tell the device that it is logically a host:

echo "host" > /sys/devices/platform/s3c2410-ohci/usb_mode

Instruct the device to provide 5 volts:

echo "1" > /sys/devices/platform/neo1973-pm-host.0/hostmode


Note: You may want to run ifconfig usb0 down prior to switching to usb host mode, as the Neo's usb networking may not like having its USB port disappear. You'll probably want to ssh into your Neo over WiFi or Bluetooth before starting all of this, alternatively use an on screen keyboard.

Three-Headed Cable

At the moment, you'll have to manufacture this one yourself. You need to make a cable with three ends:

  • A mini-usb type B cable for the Neo itself
  • A cable of whatever type to go to your USB device.
  • A cable going to a +5V voltage source with enough power for your device and to charge the Neo. This could be a wall charger or even another USB plug.

You just connect the Data+ and Data- wires of the Neo and the device, and connect all of the ground wires together and all of the +5V wires together. This powers the Neo and the device, while letting the neo talk to the device.

Just for reference, the USB wires from left to right are:

  • Black: Power -
  • Green: Data -
  • White: Data +
  • Red: Power +

Power Concerns

You'll need to force the Neo to go into fast charge mode, since it can't do its usual power negotiation over USB.

echo -n "fast_cccv" >  /sys/devices/platform/s3c2410-i2c/i2c-adapter/i2c-0/0-0008/chgmode