[openfirmware] [commit] r2467 - dev/isa
repository service
svn at openfirmware.info
Thu Aug 18 22:44:02 CEST 2011
Author: wmb
Date: Thu Aug 18 22:44:02 2011
New Revision: 2467
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2467
Log:
Alex - tweaks to mem-uart-base code.
Modified:
dev/isa/diaguart.fth
Modified: dev/isa/diaguart.fth
==============================================================================
--- dev/isa/diaguart.fth Thu Aug 18 22:38:29 2011 (r2466)
+++ dev/isa/diaguart.fth Thu Aug 18 22:44:02 2011 (r2467)
@@ -2,14 +2,18 @@
purpose: Diagnostic (before console installation) access to serial port
headerless
+[ifdef] mem-uart-base
+d# 64,000,000 constant uart-clock-frequency
+[else]
d# 1843200 constant uart-clock-frequency
-
-h# 3f8 value uart-base \ Virtual address of UART; perhaps overridden later
+[then]
[ifdef] mem-uart-base
: uart@ ( reg# -- byte ) mem-uart-base + c@ ; \ Read from a UART register
: uart! ( byte reg# -- ) mem-uart-base + c! ; \ Write to a UART register
[else]
+h# 3f8 value uart-base \ Virtual address of UART; perhaps overridden later
+
: uart@ ( reg# -- byte ) uart-base + pc@ ; \ Read from a UART register
: uart! ( byte reg# -- ) uart-base + pc! ; \ Write to a UART register
[then]
@@ -25,13 +29,11 @@
;
: inituarts ( -- )
-[ifndef] mem-uart-base
3 3 uart! \ 8 bits, no parity
7 2 uart! \ Clear and enable FIFOs
\ d# 38400 baud
\ d# 9600 baud
d# 115200 baud
-[then]
;
: ukey? ( -- flag ) 5 uart@ 1 and 0<> ; \ Test for rcv character
More information about the openfirmware
mailing list