Author: wmb
Date: 2009-06-04 21:35:48 +0200 (Thu, 04 Jun 2009)
New Revision: 1212
Modified:
cpu/x86/pc/olpc/via/fw.bth
cpu/x86/pc/olpc/via/olpc.bth
cpu/x86/pc/olpc/via/pcinode.fth
cpu/x86/pc/resetend.fth
dev/olpc/dcon/viadcon.fth
dev/via/unichrome/unichrome.fth
Log:
VIA - DCON and UHCI.
Modified: cpu/x86/pc/olpc/via/fw.bth
===================================================================
--- cpu/x86/pc/olpc/via/fw.bth 2009-06-01 05:42:04 UTC (rev 1211)
+++ cpu/x86/pc/olpc/via/fw.bth 2009-06-04 19:35:48 UTC (rev 1212)
@@ -330,15 +330,17 @@
fload ${BP}/cpu/x86/pc/olpc/help.fth
fload ${BP}/cpu/x86/pc/olpc/gui.fth
fload ${BP}/cpu/x86/pc/olpc/suspend.fth \ Suspend/resume setup
+[then]
fload ${BP}/dev/olpc/keyboard/selftest.fth \ Keyboard diagnostic
fload ${BP}/dev/olpc/touchpad/touchpad.fth \ Touchpad diagnostic
+[ifdef] Later
fload ${BP}/cpu/x86/pc/olpc/copynand.fth
\ fload ${BP}/cpu/x86/pc/olpc/carousel.fth \ Carouseled NAND writing
fload ${BP}/cpu/x86/pc/olpc/crypto.fth \ Cryptographic image validation
fload ${BP}/cpu/x86/pc/olpc/lzip.fth \ Access zip images from memory
+[then]
fload ${BP}/cpu/x86/pc/olpc/gamekeys.fth
-[then]
: emacs ( -- )
false to already-go?
Modified: cpu/x86/pc/olpc/via/olpc.bth
===================================================================
--- cpu/x86/pc/olpc/via/olpc.bth 2009-06-01 05:42:04 UTC (rev 1211)
+++ cpu/x86/pc/olpc/via/olpc.bth 2009-06-04 19:35:48 UTC (rev 1212)
@@ -12,7 +12,7 @@
in: ${BP}/dev/mmc/sdhci/build/sdhcixo.fc
in: ${BP}/dev/mmc/sdhci/build/sdmmc.fc
in: ${BP}/dev/mmc/sdhci/mv8686/build/mv8686.fc
-in: ${BP}/dev/usb2/hcd/ohci/build/ohci.fc
+in: ${BP}/dev/usb2/hcd/uhci/build/uhci.fc
in: ${BP}/dev/usb2/hcd/ehci/build/ehci.fc
in: ${BP}/dev/usb2/device/hub/build/hub.fc
in: ${BP}/dev/usb2/device/generic/build/generic.fc
@@ -82,7 +82,7 @@
" fw.img" " firmware" $add-deflated-dropin
\ " fw.img" " firmware" $add-dropin
- " ${BP}/dev/usb2/hcd/ohci/build/ohci.fc" " class0c0310" $add-deflated-dropin
+ " ${BP}/dev/usb2/hcd/uhci/build/uhci.fc" " class0c0300" $add-deflated-dropin
" ${BP}/dev/usb2/hcd/ehci/build/ehci.fc" " class0c0320" $add-deflated-dropin
" ${BP}/dev/usb2/device/hub/build/hub.fc" " usb,class9" $add-dropin
" ${BP}/dev/usb2/device/generic/build/generic.fc" " usbdevice" $add-deflated-dropin
Modified: cpu/x86/pc/olpc/via/pcinode.fth
===================================================================
--- cpu/x86/pc/olpc/via/pcinode.fth 2009-06-01 05:42:04 UTC (rev 1211)
+++ cpu/x86/pc/olpc/via/pcinode.fth 2009-06-04 19:35:48 UTC (rev 1212)
@@ -73,8 +73,8 @@
previous definitions
-h# b000.0000 to first-mem
-h# c000.0000 to mem-space-top
+h# 8000.0000 to first-mem
+h# 9000.0000 to mem-space-top
h# 0000.8000 to first-io \ Avoid mappings established by BIOS
0 [if]
Modified: cpu/x86/pc/resetend.fth
===================================================================
--- cpu/x86/pc/resetend.fth 2009-06-01 05:42:04 UTC (rev 1211)
+++ cpu/x86/pc/resetend.fth 2009-06-04 19:35:48 UTC (rev 1212)
@@ -83,7 +83,7 @@
\ and use it to inflate the firmware into RAM
ax push \ Save address of firmware dropin
-\ ascii h report
+ascii h report
\ h# 23 # al mov al h# 80 # out
" inflate" $find-dropin, \ Assemble call to find-dropin with literal arg
Modified: dev/olpc/dcon/viadcon.fth
===================================================================
--- dev/olpc/dcon/viadcon.fth 2009-06-01 05:42:04 UTC (rev 1211)
+++ dev/olpc/dcon/viadcon.fth 2009-06-04 19:35:48 UTC (rev 1212)
@@ -192,30 +192,79 @@
d# 1200 d# 900 d# 16 set-primary-mode
+ 60 60 9b crt-mask \ Sync polarity - negative
+
00 07 h# 79 crt-mask \ Disable scaling
- 8 8 h# 6a crt-mask
+ 30 30 h# 1e seq-mask \ Power up DVP1 pads
+
+ 0c 0c h# 2a seq-mask \ Power up LVDS pads
+ 80 80 h# f3 crt-mask \ 18-bit TTL mode
\ 1 01 h# 88 crt-mask Something to do with LVDS; check
\ set vclk
\ VIASetOutputPath
- 00 08 h# 6b crt-mask
+ 00 08 h# 6b crt-mask \ Not simultaneous mode
\ DisableSecondDisplayChannel XXX check me out
- 08 08 h# 6a crt-mask
\ VIALCDPatchSkew
\ VIASetDisplayChannel Seems to be lvds-specific
- 40 40 h# 16 seq! \ Check what is VIASR - is it really seq! ?
+ 40 40 h# 16 seq! \ Check what is VIASR - is it really seq! ? - reserved bits, apparently control something about using crt and lcd at the same time
\ VIALoadLCDPatchRegs
dcon-load
dcon-enable ( maybe-set-cmos )
\ dcon-enable leaves mode set to 69 - 40:antialias, 20:swizzle, 8:backlight on, 1:passthru off
- 2 bright! \ lower brightness for testing
+ set-fb
+;
+: panel2
+ smb-init
+ 0 dcon@ .
+
+ 0 9 cr 0 h# 70 h# 11 crt-mask
+ 0 h# 80 h# 17 crt-mask
+
+ f0 f0 h# 1b seq-mask \ Secondary display clock on
+
+ d# 1200 d# 900 d# 16 set-secondary-mode
+
+\ 60 60 9b crt-mask \ Sync polarity - negative
+
+ 00 07 h# 79 crt-mask \ Disable scaling
+ 00 37 h# a3 crt-mask \ iga2 from S.L., start addr
+
+ 30 30 h# 1e seq-mask \ Power up DVP1 pads
+
+ 0c 0c h# 2a seq-mask \ Power up LVDS pads
+ 2b fb h# d2 crt-mask
+ c0 c0 h# d4 crt-mask
+ 00 40 h# e8 crt-mask
+ 80 80 h# f3 crt-mask \ 18-bit TTL mode
+ 0a h# f9 crt!
+ 0d h# fb crt!
+ \ 1 01 h# 88 crt-mask Something to do with LVDS; check
+ \ set vclk
+ \ VIASetOutputPath
+ 00 08 h# 6b crt-mask \ Not simultaneous mode
+\ DisableSecondDisplayChannel XXX check me out
+
+\ VIALCDPatchSkew
+\ VIASetDisplayChannel Seems to be lvds-specific
+
+ 40 40 h# 16 seq! \ Check what is VIASR - is it really seq! ? - reserved bits, apparently control something about using crt and lcd at the same time
+
+\ VIALoadLCDPatchRegs
+
+ dcon-load
+ dcon-enable ( maybe-set-cmos )
+ \ dcon-enable leaves mode set to 69 - 40:antialias, 20:swizzle, 8:backlight on, 1:passthru off
+ d# 1200 depth 8 / * to /scanline
+ set-fb
;
+' panel2 is init-hook
\ LICENSE_BEGIN
Modified: dev/via/unichrome/unichrome.fth
===================================================================
--- dev/via/unichrome/unichrome.fth 2009-06-01 05:42:04 UTC (rev 1211)
+++ dev/via/unichrome/unichrome.fth 2009-06-04 19:35:48 UTC (rev 1212)
@@ -73,7 +73,10 @@
640 w, 480 w, 800 w, 656 w, 752 w, 525 w, 489 w, 523 w, hex 8d 10 05 cf pll, decimal
800 w, 600 w, 1056 w, 840 w, 968 w, 628 w, 600 w, 619 w, hex 70 0c 05 0f pll, decimal
1024 w, 768 w, 1344 w, 1048 w, 1184 w, 806 w, 770 w, 776 w, hex b6 0c 05 cf pll, decimal
- 1200 w, 900 w, 1240 w, 1208 w, 1216 w, 912 w, 905 w, 907 w, hex 9d 8c 85 cf pll, decimal
+\ This clock value doesn't work very well with iga1, but it is good with iga2/lcd
+1200 w, 900 w, 1264 w, 1210 w, 1242 w, 912 w, 900 w, 910 w, hex 05 0c a0 cf pll, decimal
+\ 1200 w, 900 w, 1264 w, 1210 w, 1242 w, 912 w, 900 w, 910 w, hex 9d 8c 85 cf pll, decimal
+\ 1200 w, 900 w, 1240 w, 1208 w, 1216 w, 912 w, 905 w, 907 w, hex 9d 8c 85 cf pll, decimal
1280 w, 768 w, 1664 w, 1344 w, 1472 w, 798 w, 770 w, 777 w, hex 6f 08 05 4f pll, decimal
1280 w, 800 w, 1680 w, 1352 w, 1480 w, 831 w, 802 w, 808 w, hex 46 88 83 4f pll, decimal
1280 w, 1024 w, 1688 w, 1328 w, 1440 w, 1066 w, 1024 w, 1027 w, hex 97 08 05 0f pll, decimal
@@ -227,8 +230,8 @@
: lower-power ( -- )
7f 19 seq! \ clock gating
- 30 1b seq! \ clock gating
- f3 2d seq! \ Power control enables
+ f0 1b seq! \ clock gating
+ ff 2d seq! \ Power control enables
ff 2e seq! \ clock gating
ff 3f seq! \ clock gating
5f 4f seq! \ clock gating threshold
@@ -449,7 +452,6 @@
false \ No error
;
-0 [if]
: set-secondary-dotclock ( clock -- )
lbsplit drop h# 4a seq! h# 4b seq! h# 4c seq!
@@ -464,6 +466,8 @@
endcase
c0 67 crt-mask
+ 00 20 67 crt-mask \ Turn off interlace bit
+
htotal 1- dup 50 crt! 8 >> 0f 55 crt-mask
hdisplay 1- dup 51 crt! 4 >> 70 55 crt-mask
hblank 1- dup 52 crt! 8 >> 07 54 crt-mask
@@ -480,25 +484,45 @@
vblankend 1- dup 5b crt! 5 >> 38 5c crt-mask
vsync dup 5e crt! 3 >> e0 5f crt-mask
- vsyncend 5f 1f crt-mask
+ vsyncend 1f 5f crt-mask
\ Offset
- width pixels>bytes bytes>chunks dup 66 crt! 8 >> 03 67 crt-mask
+ width pixels>bytes bytes>chunks dup 66 crt! dup 8 >> 03 67 crt-mask 6 >> 80 71 crt-mask
\ fetch count
- hdisplay pixels>bytes bytes>chunks 8 + dup 1 >> 65 crt! 7 >> 0c 67 crt-mask
+ hdisplay pixels>bytes bytes>chunks ( 8 + ) dup 1 >> 65 crt! 7 >> 0c 67 crt-mask
;
-: set-secondary-mode ( -- )
+: random-stuff ( -- )
+ 00 62 crt! 00 63 crt! 00 64 crt! \ Second display starting address
+
+ f0 f0 68 crt-mask
+
+ c8 c8 6a crt-mask \ 2nd display not reset, first hw power sequence
+ 00 0e 6b crt-mask
+ 60 60 88 crt-mask \ LVDS sequential
+ 01 01 8a crt-mask \ LCD adjust LP
+ 08 7f 94 crt-mask \ Expire number
+ 11 f7 95 crt-mask \ extension bits
+ 10 10 97 crt-mask \ LVDS channel 2 - secondary display
+ 1b ff 9b crt-mask \ DVP mode - alpha:80, VSYNC:40, HSYNC:20, secondary:10, clk polarity:8, clk adjust:7
+ 8b ff a7 crt-mask \ expected vertical display low
+ 01 07 a8 crt-mask \ expected vertical display high
+;
+
+: set-secondary-mode ( width height depth -- )
+ to depth to height to width
+ width height depth find-timing-table ?dup if exit then
+
80 17 crt-clr \ Assert reset - Turn off screen
set-secondary-vga-mode
+ random-stuff
\ Turn on power here?
1e 6c crt-clr
- dotclock set-secondary-dotclock
+ pll set-secondary-dotclock
use-ext-clock
80 17 crt-set \ Release reset
;
-[then]
[ifdef] xo-board
: setup-lcd ( -- )
@@ -560,12 +584,16 @@
: display-remove ( -- )
;
+: set-fb
+ width height ( width height )
+ over char-width / over char-height / ( width height rows cols )
+ /scanline depth fb-install ( gp-install ) ( )
+;
+
: display-install ( -- )
init-all
default-font set-font
- width height ( width height )
- over char-width / over char-height / ( width height rows cols )
- /scanline depth fb-install ( gp-install ) ( )
+ set-fb
init-hook
;