XO 4 HDMI Debug

From OLPC
Revision as of 07:42, 29 October 2012 by Wad (talk | contribs) (Created page with 'Some notes for testing the HDMI Interface of the XO-4 laptop. ==Setup== Start with an [XO_4_B1|XO-4 laptop]] running the latest firmware ( [http://dev.laptop.org/pub/fi…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Some notes for testing the HDMI Interface of the XO-4 laptop.

Setup

Start with an [XO_4_B1|XO-4 laptop]] running the latest firmware ( Q7B04 ). It should have a second serial port connected. You will want to download the following two pieces of software and place them on a USB stick:

Install the zImage file as /boot/vmlinuz using the following OFW command:

ok copy u:\zImhdmi int:\boot\vmlinuz

Type y when it asks if it is OK to overwrite the existing file.

Boot Linux. Then mount the USB key and install hdmi_ctl into the local directory:

mount /dev/sda1 /mnt
cp /mnt/hdmi_ctl .
chmod a+x hdmi_ctl

Video Init

At this point, you can initialize HDMI output from within Linux:


Patching CForth

In order to manipulate the video parameters in real time, we use a second serial port connected to CForth running on the security processor. It must be enabled by holding down the "rotate" key while booting. Then start ofw using the command:

ok dbg ofw

The following forth commands need to be downloaded:

: w1 20b000 + io! ;  : r1 20b000 + io@ ;
: video-on 104 r1 44 w1  fc r1 3c w1  f4 r1 34 w1  80 r1 100 or 80 w1  ;
alias v video-on
: +hdmi  20bc00 +  ;
: hdmi!  +hdmi io!  ;
: hdmi@  +hdmi io@  ;
: hdmi-i!  ( b reg# -- )  swap  0 hdmi!  h# 8000.0000 or 4 hdmi!  ;
: hdmi-i@  ( reg# -- b )  h# 4000.0000 or 4 hdmi!  0 hdmi@  ;
alias r hdmi@  alias w hdmi!   alias ii hdmi-i!   alias ir hdmi-i@
: access-phy  h# 20 hdmi@  1 or  h# 20 hdmi!  ;
alias phy access-phy
: access-3d  h# 20 hdmi@  1 invert and  h# 20 hdmi!  ;
alias 3d access-3d

And these allow for easier manipulation of the PHY0 and PHY1 registers:

5 value damp  1 value eamp  0 value cp
: phy0
   damp o# 1111 *
   eamp o# 11110000 * or
   cp h# 55000000 * or
   8 w
;
\  2 to eamp  phy0
0 value ajd  1 value svtx  8 value idrv  
: phy1
   ajd  h# f0000000 *
   svtx o# 1111 * d# 16 lshift  or
   idrv h# 1111 *  or
   h# c w
;
\  1 to ajd  phy1

Changing PHY Settings