Author: wmb
Date: 2009-10-12 21:50:49 +0200 (Mon, 12 Oct 2009)
New Revision: 1419
Modified:
cpu/x86/pc/olpc/via/romreset.bth
Log:
Via - Moved the enabling of power-glitch suppression to happen after other register initialization, thus preventing write-lockout of some power well registers.
Modified: cpu/x86/pc/olpc/via/romreset.bth
===================================================================
--- cpu/x86/pc/olpc/via/romreset.bth 2009-10-12 07:51:36 UTC (rev 1418)
+++ cpu/x86/pc/olpc/…
[View More]via/romreset.bth 2009-10-12 19:50:49 UTC (rev 1419)
@@ -125,8 +125,6 @@
cominit #) call
[then]
- 8c 8881 config-wb \ Enable ACPI regs, 32-bit PM timer, guard RTC against power glitches
-
char + report
long-offsets on
@@ -215,6 +213,9 @@
fload ${BP}/cpu/x86/pc/olpc/via/starttherm.fth \ Enables thermal monitor
fload ${BP}/cpu/x86/pc/olpc/via/startcpuspeed.fth \ Turns up clock rate
+ \ Do this as late as possible so power well registers aren't locked out by the glitch suppressor
+ 8c 8881 config-wb \ Enable ACPI regs, 32-bit PM timer, guard RTC against power glitches
+
\ Cache is now setup normally, backed by memory
\ Setup a small stack for subroutine calls
h# 10.0000 # esp mov
[View Less]
Author: wmb
Date: 2009-10-12 09:51:36 +0200 (Mon, 12 Oct 2009)
New Revision: 1418
Modified:
cpu/x86/pc/olpc/via/demodram.fth
cpu/x86/pc/olpc/via/ioinit.fth
cpu/x86/pc/olpc/via/starthostctl.fth
Log:
Via - folded in a few register settings as recommended by Via,
and added commentary relative to a few others.
Modified: cpu/x86/pc/olpc/via/demodram.fth
===================================================================
--- cpu/x86/pc/olpc/via/demodram.fth 2009-10-11 09:19:26 UTC (rev …
[View More]1417)
+++ cpu/x86/pc/olpc/via/demodram.fth 2009-10-12 07:51:36 UTC (rev 1418)
@@ -228,6 +228,8 @@
0 3 devfunc
50 ee ee mreg \ DDR default MA7 for DRAM init
51 ee 60 mreg \ DDR default MA3 for CHB init
+ \ Via says 11, 1F gives slightly better performance in their environment,
+ \ but that setting doesn't work for us - it crashes with Forth+X+
52 ff 33 mreg \ DDR use BA0=M17, BA1=M18,
53 ff 3F mreg \ DDR BA2=M19
@@ -240,7 +242,7 @@
65 ff d1 mreg \ AGP timer = D; Host timer = 1; (coreboot uses 9 for host timer)
66 ff 88 mreg \ DRAMC Queue Size = 4; park at the last bus owner,Priority promotion timer = 8
68 ff 0C mreg
- 69 0F 04 mreg \ set RX69[3:0]=0000b
+ 69 0F 04 mreg \ Disable multiple page and page active for now, enable refresh priority
6A ff 00 mreg \ refresh counter
6E 87 80 mreg \ must set 6E[7],or else DDR2 probe test will fail
85 ff 00 mreg
@@ -327,9 +329,9 @@
0 3 devfunc
forth #banks 8 = assembler [if]
- 69 c3 c3 mreg \ Reinstate page optimizations (03) 8-bank interleave (c0)
+ 69 c3 c3 mreg \ Enable page optimizations (03) 8-bank interleave (c0)
[else]
- 69 c3 83 mreg \ Reinstate page optimizations (03) 4-bank interleave (80)
+ 69 c3 83 mreg \ Enable page optimizations (03) 4-bank interleave (80)
[then]
Modified: cpu/x86/pc/olpc/via/ioinit.fth
===================================================================
--- cpu/x86/pc/olpc/via/ioinit.fth 2009-10-11 09:19:26 UTC (rev 1417)
+++ cpu/x86/pc/olpc/via/ioinit.fth 2009-10-12 07:51:36 UTC (rev 1418)
@@ -43,6 +43,11 @@
89 ff f8 mreg \ Dynamic clocks
8b ff bf mreg \ Dynamic clocks
8d ff 30 mreg \ Self-refresh in C3 and C4
+ \ LuckeLin at Via says: If D0F4 Rx8e[5] was set to 0, we could turn-off PLL in S1 state.
+ \ If your machine does not support S1, it was fine to set it to 1 at all time.
+ \ (wmb adds - D0F4 Rx8e[5] needs to be set to 1 before entering S3, even if set to 0 for S1)
+ \ LuckeLin also says: [Phoenix] Set(s) Rx8e[4] to 1 to fix another S3 issue. Chip internal control
+ \ signal was hard-wired to 1 in new chip. It does not control anything. Please just keep it to be default setting.
8e ff 20 mreg \ Leave PLL on in suspend state - necessary for reliable S3
90 ff ff mreg \ Gate clocks
91 ff ff mreg \ Gate clocks
Modified: cpu/x86/pc/olpc/via/starthostctl.fth
===================================================================
--- cpu/x86/pc/olpc/via/starthostctl.fth 2009-10-11 09:19:26 UTC (rev 1417)
+++ cpu/x86/pc/olpc/via/starthostctl.fth 2009-10-12 07:51:36 UTC (rev 1418)
@@ -25,6 +25,7 @@
55 06 04 mreg \ Miscellaneous Control 2
56 f7 63 mreg \ Write Policy 1
+ 57 01 01 mreg \ Enable fast TRDY by detecting HREQa[5]# de-assertion
5d ff a2 mreg \ Write Policy
5e ff 88 mreg \ Bandwidth Timer
5f 46 46 mreg \ CPU Misc Ctrl
[View Less]
Author: wmb
Date: 2009-10-10 03:04:57 +0200 (Sat, 10 Oct 2009)
New Revision: 1415
Modified:
cpu/x86/pc/olpc/via/startcominit.fth
Log:
Via - startup optimization to use new fast-path EC board ID command.
Modified: cpu/x86/pc/olpc/via/startcominit.fth
===================================================================
--- cpu/x86/pc/olpc/via/startcominit.fth 2009-10-10 01:04:08 UTC (rev 1414)
+++ cpu/x86/pc/olpc/via/startcominit.fth 2009-10-10 01:04:57 UTC (rev 1415)
@@ -44,6 +44,7 @@
\…
[View More] When the RTC is guarded against power glitches, there is a 50 mS delay before
\ reads return the correct data upon wakeup from S3. On power-up, the delay is
\ present even with the RTC unguarded. Unguarding it here speeds up S3 startup.
+ \ !! Not only does it affect the RTC, empirically it affects D17F0 Rx9Bh too!
81 ff 88 mreg \ Enable ACPI regs, 32-bit PM timer, disable RTC power glitch guard
4e 08 08 mreg \ Enable ports 74/75 for high-bank CMOS RAM access
end-table
@@ -52,50 +53,17 @@
70 fb 82 mreg \ CPU to PCI flow control - CPU to PCI posted write, Enable Delay Transaction
end-table
- \ Wait until RTC PSON Gating is complete. See PG_VX855_VX875_092 page 139 (pdf page 160)
- \ This takes about 48 mS in the power-on case, and is almost instantaneous in the
- \ resume-from-S3 case due to the clearing of D17F0 Rx81[2] above.
- cx cx xor
- begin cx inc 8882 config-rb h# 40 # al and 0<> until
- cl al mov
- h# 88 # al mov al h# 74 # out cl al mov al h# 75 # out
- h# 89 # al mov al h# 74 # out ch al mov al h# 75 # out
- d# 16 # cx shr
- h# 8a # al mov al h# 74 # out cl al mov al h# 75 # out
+\ rdtsc ax bx mov \ Mark time
- \ As an optimization to avoid long waits for the EC to respond, read the board ID
- \ that is cached in CMOS RAM.
- h# 83 # al mov al h# 74 # out h# 75 # al in \ check byte - should be ~board-id
- al ah mov ah not \ ~check byte in AH
- h# 82 # al mov al h# 74 # out h# 75 # al in \ board-id in AL
+ \ Read board ID from the EC
+ h# 62 # al in \ Read output register to ensure that OBF is clear
+ begin h# 66 # al in 2 # al test 0= until \ Wait IBF empty
+ h# d4 # al mov al h# 66 # out \ Write command 0xd4
+ begin h# 66 # al in 1 # al test 0<> until \ Wait OBF full
+ h# 62 # al in \ Get the board ID
- al ah cmp 0<> if \ If the check byte matches, fall through with the ID in AL
+\ rdtsc bx ax sub ax bx mov h# 4d0 config-setup bx ax mov ax dx out \ Elapsed time in BIOS scratch register
- \ If check byte is wrong, we have to ask the EC
-
- h# 6c # al in \ EC status register
- 2 # al and \ input buffer full bit
- 0<> if \ If the bit is nonzero, we can't send a command yet
- \ We don't wait for the EC; if it is busy we assume B-test
- \ It shouldn't be busy at this point because we haven't tried to talk to it yet
- h# d1 # al mov \ EC busy - report B-test
- else
- h# 19 # al mov al h# 6c # out \ Send board ID command to EC
- d# 200 # cx mov \ Wait up to 200 mS for the EC to respond
- begin
- d# 1000 wait-us \ 1 mS delay so we don't pound on the EC
- h# 6c # al in \ Get status register
- 3 # al and \ Check for output buffer full
- 1 # al cmp
- loopne
- <> if \ Not equal means timeout
- h# d1 # al mov \ EC timeout - report B-test
- else
- h# 68 # al in \ Get board ID byte from EC
- then
- then
- then
-
\ Now AL contains the board ID
h# d1 # al cmp u< if
acpi-io-base h# 4c + port-rl h# 200000 bitclr ax dx out \ Turn off WLAN activity LED (GPIO10)
[View Less]