Opened 6 years ago

Closed 5 years ago

Last modified 18 months ago

#10895 closed enhancement (fixed)

OFW XO-1.75 - drive PS/2 keyboard from SP

Reported by: wmb@… Owned by: saadia
Priority: blocker Milestone:
Component: kernel Version: 1.75-A3
Keywords: Cc:
Blocked By: Blocking:
Deployments affected: Action Needed: no action
Verified: no


Implement a PS/2 low-level hardware driver in the Secure Processor, thus eliminating the need to do it in the Embedded Controller. Will require defining a communication method to get the data to Linux and OFW on the P4J processor.

Change History (13)

comment:1 Changed 6 years ago by Quozl

  • Milestone changed from Not Triaged to 1.75-firmware

comment:2 Changed 6 years ago by rsmith

Will also require some sort of key mapping scheme to support both the ALPS and EnE keyboard controllers. The original idea was to push that up to Linux but OFW needs it too.

comment:3 Changed 6 years ago by martin.langhoff

  • Blocking 10979 added

comment:3 Changed 6 years ago by martin.langhoff

  • Blocking 10979 removed

After discussion last night with rsmith and wad, it seems that a minimal implementation to get confirmation that we can do this as expected is likely B1 blocker. Needs discussion.

comment:4 Changed 6 years ago by wmb@…

  • Priority changed from normal to blocker
  • Status changed from new to assigned

comment:5 Changed 6 years ago by wmb@…

  • Action Needed changed from design to add to build

The SP end of things is implemented by git commit 81656ad...

The OFW end is implemented by svn 2292 but has not been integrated into a build, because testing it requires a modified motherboard.

comment:6 Changed 6 years ago by wmb@…

  • Action Needed changed from add to build to code
  • Component changed from ofw - open firmware to kernel
  • Owner changed from wmb@… to saadia
  • Status changed from assigned to new
  • Version changed from 1.75-A2 to 1.75-A3

cforth git commit 6ccc662dfc adds matrix decoding to the SP PS/2 handler.

OFW svn 2294 adds the /ap-sp driver to the build - but does not select it's subordinate keyboard node as the default keyboard.

The remaining firmware tasks, when it is time to turn on this feature (gated by hardware changes) are:

  • Call enable-ps2 in the CForth startup sequence.
  • Use /ap-sp/keyboard instead of /ec-spi/keyboard as the default system keyboard
  • (Perhaps) implement support for ALPS keyboards

The current next job is the Linux driver, so I'm reassigning the ticket to the kernel team for now.

comment:7 Changed 6 years ago by wmb@…

If anybody wants to test this code, here is the recipe:

  • Modify the board by moving R351, R353, R355, R357 to the R352, R354, R356, R358 positions.
  • With a serial port connected, power on while holding the rotate key to get to cforth
  • At cforth, type "enable-ps2". You should see "Matrix mode on"
  • Still at cforth, type "ofwdi" to start OFW. Hit esc to get to ok
  • Type ok " /ap-sp/keyboard" open-dev add-input
  • That will enable the keyboard through the SP
  • Type ok test /ap-sp/mouse

comment:8 Changed 6 years ago by wmb@…

cforth git 4b9cc1f6055ec improves the keyboard handling. It now supports both the newer EnE and the older ALPS keyboard controller. The ALPS keyboard events are passed through unmodified, since the ALPS controller correctly implements the OLPC keyboard coding scheme. The SP code runs the EnE controller in raw mode, translating to PC+OLPC codes. The translation now supports both scan sets 1 and 2, and handles function-key modifiers. I believe this is a complete implementation of the OLPC keyboard scheme.

The OLPC mechanical keyboard has not been tested with this code. If it presents as a standard keyboard ID, as with the ALPS keyboard, its events should be passed through unchanged, so I hope it will "Just Work".

comment:9 Changed 6 years ago by saadia

  • Status changed from new to assigned

The Linux driver has been checked in at drivers/input/serio/olpc_keyboard.c.

comment:10 Changed 6 years ago by Quozl

  • Action Needed changed from code to test in build

I've tested here with what I have. What isn't yet tested is an OLPC mechanical keyboard.

comment:11 Changed 5 years ago by Quozl

  • Action Needed changed from test in build to no action
  • Resolution set to fixed
  • Status changed from assigned to closed

Tested on B1 with mechanical keyboard.

comment:12 Changed 18 months ago by Quozl

  • Milestone 1.75-firmware deleted

Milestone 1.75-firmware deleted

Note: See TracTickets for help on using tickets.