History log of /openbsd-current/sys/dev/ic/comvar.h
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.61 29-May-2024 jsg

remove prototypes with no matching function


# 1.60 12-May-2024 jsg

comsiraddr was removed in 2016


Revision tags: OPENBSD_7_1_BASE OPENBSD_7_2_BASE OPENBSD_7_3_BASE OPENBSD_7_4_BASE OPENBSD_7_5_BASE
# 1.59 11-Jan-2022 uaa

add Synopsys Degisnware UART (dw-apb-uart) support

To fix Allwinner H6's UART problem, need to add dw-apb-uart special code.
ok kettenis@


Revision tags: OPENBSD_6_8_BASE OPENBSD_6_9_BASE OPENBSD_7_0_BASE
# 1.58 14-Aug-2020 jcs

Re-commit Exar XR17V35x serial port support previously backed out:

The Exar XR17V354 has 4 ports that have a 256-byte FIFO, use a
frequency of 125Mhz, and have a unique sleep register. A custom
interrupt handler is setup in puc for these ports so it can check a
register which reports which ports triggered the interrupt, rather
than having to run comintr for every port every time.

To avoid probing for these ports in com_attach_subr which requires
access to registers that may be reserved on certain platforms, pass
the sc_uarttype from com_puc_attach since the port type is already
known based on the puc device vendor/id.

Input from kettenis, tested in snaps


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE
# 1.57 14-May-2018 kettenis

Add support for register shift/io-width to the console code as well.

ok visa@, patrick@


# 1.56 02-May-2018 kettenis

Revert previous commit; the XR17V35X probe that was added accesses registers
that aren't guaranteed to be there and may even belong to a different device.
This triggers a fault on hppa machines like the C3000 for example.


# 1.55 15-Apr-2018 jcs

The Exar XR17V354 has 4 com ports that have a 256-byte FIFO, use a
frequency of 125Mhz, and have a unique sleep register. A custom
interrupt handler is setup in puc for these ports so it can check a
register which reports which ports triggered the interrupt, rather
than having to run comintr for every port every time.

ok mlarkin deraadt


# 1.54 02-Apr-2018 kettenis

Add support for register shift/io-width. This allows us to support UARTs
that are mostly NS16550 compatible but use 32-bit instead of 8-bit registers
such as the Synopsys Designware UARTs found on many armv7, arm64 and amd64
SoCs.

tested by florian@, blum@
ok deraadt@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.53 30-Apr-2017 mpi

Unifdef KGDB.

It doesn't compile und hasn't been working during the last decade.

ok kettenis@, deraadt@


Revision tags: OPENBSD_6_1_BASE
# 1.52 03-Sep-2016 jsg

de-zaurus com.c
"looks correct" deraadt@ guenther@ on an earlier rev


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.51 12-May-2012 kettenis

Remove unused variable.

ok mpi@, miod@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE
# 1.50 06-Aug-2010 kettenis

Initial stab at making com@puc suspend and resume properly. Works fine
for using cu(1) between two OpenBSD machines. Probably doesn't work for
serial consoles but we don't support those on puc(4) anyway.

ok deraadt@


# 1.49 01-Aug-2010 yasuoka

Change COM_IBUFSIZE 8K to 16K because 8K is not enough for CDMA1X card
by KDDI.


# 1.48 26-Jun-2010 yasuoka

Grow COM_IBUFSIZE from 1024 to 8192 to be enough size for recent
devices. This will fix the problem using KDDI W04K that has 3.1 Mbps
in downlink.

ok deraadt@


Revision tags: OPENBSD_4_7_BASE
# 1.47 04-Nov-2009 kettenis

Get rid of __HAVE_GENERIC_SOFT_INTERRUPTS now that all our platforms support it.

ok jsing@, miod@


# 1.46 13-Oct-2009 pirofti

Get rid of devact enum, substitute it with an int and coresponding defines.

This is needed for the addition of further suspend/resume actions.

Okay deraadt@, marco@.


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.45 08-Jun-2008 kettenis

Make serial console on non-primary ports work to on i386.

tested by jbg@, "it is right" deraadt@


# 1.44 30-Apr-2008 dlg

fix serial console handling on amd64. currently only glass console ever
works, even if the boot loader is configured to use serial console.

after the changes jsing and i made, the initial probe of the serial port
was failing since the default base addres for the port is invalid. cos of
that the kernel would only ever consider the glass console for use. this
fixes it by reprobing the serial port if we get any config for it from the
boot loader.

advice on aesthetics from miod@
advice and ok from kettenis@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.43 08-May-2007 deraadt

backout while the amd64 puc situation is rethought


# 1.42 08-May-2007 deraadt

move com_activate() to where it belongs


# 1.41 08-May-2007 deraadt

put more foo_detach() routines where they are used


Revision tags: OPENBSD_4_1_BASE
# 1.40 28-Dec-2006 miod

Support for ST16C654 chips, however these aren't detected as such, so the
attachment code has to know better for now;
from Alexei G. Malinin (alexei.malinin@inetcomm.ru)


Revision tags: OPENBSD_4_0_BASE
# 1.39 31-Jul-2006 mickey

puc@cardbus (only added (commented out) to whom has puc@pci enabled)
tested on puc@pci by fkr and meself on the cardbus.
still needs a bit more work but generally works.
deraadt@ ok and some input from miod@


# 1.38 27-Mar-2006 deraadt

in detach, mark device with COM_SW_DEAD, so that close() will not go
tapping additional registes. allows it to work on macppc, where doing
such a tap after unplug is very bad. drahn helped fkr@bytemine.de
ok miod and drahn


Revision tags: OPENBSD_3_9_BASE
# 1.37 24-Oct-2005 fgsch

fix compilation for KGDB; looked by miod@.


Revision tags: OPENBSD_3_8_BASE
# 1.36 27-May-2005 uwe

- Merge changes from pxacom back into the common com driver.

Changes to the common com driver (partly from NetBSD):
- Multiply before divide in comspeed() to avoid overflow (from NetBSD).
- Don't call getc() and send -1 if the output queue is empty.
- Take UART clock frequency as a parameter instead of using COM_FREQ.

ok deraadt@


Revision tags: OPENBSD_3_7_BASE
# 1.35 20-Oct-2004 pefo

Use bus_addr_t instead of int for port address/offset, ok mickey


Revision tags: OPENBSD_3_5_BASE OPENBSD_3_6_BASE SMP_SYNC_A SMP_SYNC_B
# 1.34 23-Sep-2003 millert

Replace select backends with poll backends. selscan() and pollscan()
now call the poll backend. With this change we implement greater
poll(2) functionality instead of emulating it via the select backend.
Adapted from NetBSD and including some changes from FreeBSD.
Tested by many, deraadt@ OK


Revision tags: OPENBSD_3_4_BASE
# 1.33 15-Jul-2003 jason

move prototype for com_raisedtr() to comvar.h (just like pccom).


# 1.32 03-Jun-2003 deraadt

terms 3 & 4 cleanup based on "terms" file


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE UBC_SYNC_A UBC_SYNC_B
# 1.31 14-Mar-2002 millert

First round of __P removal in sys


Revision tags: OPENBSD_3_0_BASE UBC_BASE
# 1.30 05-Oct-2001 mickey

branches: 1.30.4;
restore some of that dead code needed for dev/cons functionality


# 1.29 30-Sep-2001 art

Enable break interrupt earlier.


# 1.28 30-Sep-2001 art

Remove dead code.


# 1.27 30-Sep-2001 art

Remove the COM_HAYESP code. It doesn't appear to have been ever used and
it's very intrusive and makes the code less readable.


# 1.26 29-Sep-2001 art

- compoll is now scheduled once for every sc instead of just one timeout for
all ports and looping over them.
- support for generic soft interrupts.


# 1.25 27-Sep-2001 art

Split out comattach that does isa and isapnp attachment and initialization,
into comattach that does the isa stuff and com_attach_subr that does the
init.


Revision tags: OPENBSD_2_9_BASE
# 1.24 15-Mar-2001 art

Put back new timeouts. This time with correct timeout for compoll.


# 1.23 15-Mar-2001 deraadt

bzzzt


# 1.22 15-Mar-2001 mjacob

Add in missing prototype for comspeedcomspeed.


# 1.21 15-Mar-2001 art

back out new timeouts until I find out why they break alpha.


# 1.20 15-Mar-2001 deraadt

support puc devices with higher speeds (not tested yet)


# 1.19 13-Mar-2001 mickey

new timeouts


# 1.18 24-Jan-2001 hugh

KGDB for i386 from NetBSD via niklas, with tweaks and accommodations.
Tested by various, vetted by mickey & theo.


# 1.17 08-Nov-2000 art

Add comcnattach that does the basic steps needed to attach
a com as a serial console. (idea from NetBSD).

If cn_tab->cn_dev == NODEV, try to find comopen in cdevsw and set cn_dev
to the right device.


Revision tags: OPENBSD_2_7_BASE OPENBSD_2_8_BASE SMP_BASE
# 1.16 04-Feb-2000 angelos

branches: 1.16.2;
Externalize comstop()


# 1.15 01-Feb-2000 mickey

missed in last com.c commit, sc_ic usage was replaced w/ ia_ic where needed; niklas@ ok


Revision tags: OPENBSD_2_6_BASE kame_19991208
# 1.14 08-Aug-1999 niklas

Detach support for com; NetBSD and me


# 1.13 26-Jul-1999 niklas

fix my last commit where I committed more than intended


# 1.12 26-Jul-1999 niklas

Remove obsolete detach code that has been dead for very long


Revision tags: OPENBSD_2_4_BASE OPENBSD_2_5_BASE
# 1.11 14-May-1998 downsj

* Better support for XR16C850.
* Copyright.


Revision tags: OPENBSD_2_3_BASE
# 1.10 23-Feb-1998 downsj

New probe routine and support for ST16650.

Compiles, but completely untested.


Revision tags: OPENBSD_2_2_BASE
# 1.9 07-Jul-1997 niklas

Removed an unused arg


Revision tags: OPENBSD_2_1_BASE
# 1.8 06-Mar-1997 tholo

Add control flag to call hardpps() on carrier change


# 1.7 29-Jan-1997 niklas

Export comdefaultrate


# 1.6 10-Dec-1996 deraadt

the real changes by niklas... I did not merge correctly


# 1.5 29-Nov-1996 niklas

Missing pieces of new bus.h that CVS lost behind my back


# 1.4 30-Oct-1996 niklas

cominit is used from the outside (the alpha port)


# 1.3 10-May-1996 deraadt

proto change


# 1.2 21-Apr-1996 deraadt

partial sync with netbsd 960418, more to come


# 1.1 19-Apr-1996 niklas

NetBSD 960317 merge


# 1.60 12-May-2024 jsg

comsiraddr was removed in 2016


Revision tags: OPENBSD_7_1_BASE OPENBSD_7_2_BASE OPENBSD_7_3_BASE OPENBSD_7_4_BASE OPENBSD_7_5_BASE
# 1.59 11-Jan-2022 uaa

add Synopsys Degisnware UART (dw-apb-uart) support

To fix Allwinner H6's UART problem, need to add dw-apb-uart special code.
ok kettenis@


Revision tags: OPENBSD_6_8_BASE OPENBSD_6_9_BASE OPENBSD_7_0_BASE
# 1.58 14-Aug-2020 jcs

Re-commit Exar XR17V35x serial port support previously backed out:

The Exar XR17V354 has 4 ports that have a 256-byte FIFO, use a
frequency of 125Mhz, and have a unique sleep register. A custom
interrupt handler is setup in puc for these ports so it can check a
register which reports which ports triggered the interrupt, rather
than having to run comintr for every port every time.

To avoid probing for these ports in com_attach_subr which requires
access to registers that may be reserved on certain platforms, pass
the sc_uarttype from com_puc_attach since the port type is already
known based on the puc device vendor/id.

Input from kettenis, tested in snaps


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE
# 1.57 14-May-2018 kettenis

Add support for register shift/io-width to the console code as well.

ok visa@, patrick@


# 1.56 02-May-2018 kettenis

Revert previous commit; the XR17V35X probe that was added accesses registers
that aren't guaranteed to be there and may even belong to a different device.
This triggers a fault on hppa machines like the C3000 for example.


# 1.55 15-Apr-2018 jcs

The Exar XR17V354 has 4 com ports that have a 256-byte FIFO, use a
frequency of 125Mhz, and have a unique sleep register. A custom
interrupt handler is setup in puc for these ports so it can check a
register which reports which ports triggered the interrupt, rather
than having to run comintr for every port every time.

ok mlarkin deraadt


# 1.54 02-Apr-2018 kettenis

Add support for register shift/io-width. This allows us to support UARTs
that are mostly NS16550 compatible but use 32-bit instead of 8-bit registers
such as the Synopsys Designware UARTs found on many armv7, arm64 and amd64
SoCs.

tested by florian@, blum@
ok deraadt@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.53 30-Apr-2017 mpi

Unifdef KGDB.

It doesn't compile und hasn't been working during the last decade.

ok kettenis@, deraadt@


Revision tags: OPENBSD_6_1_BASE
# 1.52 03-Sep-2016 jsg

de-zaurus com.c
"looks correct" deraadt@ guenther@ on an earlier rev


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.51 12-May-2012 kettenis

Remove unused variable.

ok mpi@, miod@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE
# 1.50 06-Aug-2010 kettenis

Initial stab at making com@puc suspend and resume properly. Works fine
for using cu(1) between two OpenBSD machines. Probably doesn't work for
serial consoles but we don't support those on puc(4) anyway.

ok deraadt@


# 1.49 01-Aug-2010 yasuoka

Change COM_IBUFSIZE 8K to 16K because 8K is not enough for CDMA1X card
by KDDI.


# 1.48 26-Jun-2010 yasuoka

Grow COM_IBUFSIZE from 1024 to 8192 to be enough size for recent
devices. This will fix the problem using KDDI W04K that has 3.1 Mbps
in downlink.

ok deraadt@


Revision tags: OPENBSD_4_7_BASE
# 1.47 04-Nov-2009 kettenis

Get rid of __HAVE_GENERIC_SOFT_INTERRUPTS now that all our platforms support it.

ok jsing@, miod@


# 1.46 13-Oct-2009 pirofti

Get rid of devact enum, substitute it with an int and coresponding defines.

This is needed for the addition of further suspend/resume actions.

Okay deraadt@, marco@.


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.45 08-Jun-2008 kettenis

Make serial console on non-primary ports work to on i386.

tested by jbg@, "it is right" deraadt@


# 1.44 30-Apr-2008 dlg

fix serial console handling on amd64. currently only glass console ever
works, even if the boot loader is configured to use serial console.

after the changes jsing and i made, the initial probe of the serial port
was failing since the default base addres for the port is invalid. cos of
that the kernel would only ever consider the glass console for use. this
fixes it by reprobing the serial port if we get any config for it from the
boot loader.

advice on aesthetics from miod@
advice and ok from kettenis@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.43 08-May-2007 deraadt

backout while the amd64 puc situation is rethought


# 1.42 08-May-2007 deraadt

move com_activate() to where it belongs


# 1.41 08-May-2007 deraadt

put more foo_detach() routines where they are used


Revision tags: OPENBSD_4_1_BASE
# 1.40 28-Dec-2006 miod

Support for ST16C654 chips, however these aren't detected as such, so the
attachment code has to know better for now;
from Alexei G. Malinin (alexei.malinin@inetcomm.ru)


Revision tags: OPENBSD_4_0_BASE
# 1.39 31-Jul-2006 mickey

puc@cardbus (only added (commented out) to whom has puc@pci enabled)
tested on puc@pci by fkr and meself on the cardbus.
still needs a bit more work but generally works.
deraadt@ ok and some input from miod@


# 1.38 27-Mar-2006 deraadt

in detach, mark device with COM_SW_DEAD, so that close() will not go
tapping additional registes. allows it to work on macppc, where doing
such a tap after unplug is very bad. drahn helped fkr@bytemine.de
ok miod and drahn


Revision tags: OPENBSD_3_9_BASE
# 1.37 24-Oct-2005 fgsch

fix compilation for KGDB; looked by miod@.


Revision tags: OPENBSD_3_8_BASE
# 1.36 27-May-2005 uwe

- Merge changes from pxacom back into the common com driver.

Changes to the common com driver (partly from NetBSD):
- Multiply before divide in comspeed() to avoid overflow (from NetBSD).
- Don't call getc() and send -1 if the output queue is empty.
- Take UART clock frequency as a parameter instead of using COM_FREQ.

ok deraadt@


Revision tags: OPENBSD_3_7_BASE
# 1.35 20-Oct-2004 pefo

Use bus_addr_t instead of int for port address/offset, ok mickey


Revision tags: OPENBSD_3_5_BASE OPENBSD_3_6_BASE SMP_SYNC_A SMP_SYNC_B
# 1.34 23-Sep-2003 millert

Replace select backends with poll backends. selscan() and pollscan()
now call the poll backend. With this change we implement greater
poll(2) functionality instead of emulating it via the select backend.
Adapted from NetBSD and including some changes from FreeBSD.
Tested by many, deraadt@ OK


Revision tags: OPENBSD_3_4_BASE
# 1.33 15-Jul-2003 jason

move prototype for com_raisedtr() to comvar.h (just like pccom).


# 1.32 03-Jun-2003 deraadt

terms 3 & 4 cleanup based on "terms" file


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE UBC_SYNC_A UBC_SYNC_B
# 1.31 14-Mar-2002 millert

First round of __P removal in sys


Revision tags: OPENBSD_3_0_BASE UBC_BASE
# 1.30 05-Oct-2001 mickey

branches: 1.30.4;
restore some of that dead code needed for dev/cons functionality


# 1.29 30-Sep-2001 art

Enable break interrupt earlier.


# 1.28 30-Sep-2001 art

Remove dead code.


# 1.27 30-Sep-2001 art

Remove the COM_HAYESP code. It doesn't appear to have been ever used and
it's very intrusive and makes the code less readable.


# 1.26 29-Sep-2001 art

- compoll is now scheduled once for every sc instead of just one timeout for
all ports and looping over them.
- support for generic soft interrupts.


# 1.25 27-Sep-2001 art

Split out comattach that does isa and isapnp attachment and initialization,
into comattach that does the isa stuff and com_attach_subr that does the
init.


Revision tags: OPENBSD_2_9_BASE
# 1.24 15-Mar-2001 art

Put back new timeouts. This time with correct timeout for compoll.


# 1.23 15-Mar-2001 deraadt

bzzzt


# 1.22 15-Mar-2001 mjacob

Add in missing prototype for comspeedcomspeed.


# 1.21 15-Mar-2001 art

back out new timeouts until I find out why they break alpha.


# 1.20 15-Mar-2001 deraadt

support puc devices with higher speeds (not tested yet)


# 1.19 13-Mar-2001 mickey

new timeouts


# 1.18 24-Jan-2001 hugh

KGDB for i386 from NetBSD via niklas, with tweaks and accommodations.
Tested by various, vetted by mickey & theo.


# 1.17 08-Nov-2000 art

Add comcnattach that does the basic steps needed to attach
a com as a serial console. (idea from NetBSD).

If cn_tab->cn_dev == NODEV, try to find comopen in cdevsw and set cn_dev
to the right device.


Revision tags: OPENBSD_2_7_BASE OPENBSD_2_8_BASE SMP_BASE
# 1.16 04-Feb-2000 angelos

branches: 1.16.2;
Externalize comstop()


# 1.15 01-Feb-2000 mickey

missed in last com.c commit, sc_ic usage was replaced w/ ia_ic where needed; niklas@ ok


Revision tags: OPENBSD_2_6_BASE kame_19991208
# 1.14 08-Aug-1999 niklas

Detach support for com; NetBSD and me


# 1.13 26-Jul-1999 niklas

fix my last commit where I committed more than intended


# 1.12 26-Jul-1999 niklas

Remove obsolete detach code that has been dead for very long


Revision tags: OPENBSD_2_4_BASE OPENBSD_2_5_BASE
# 1.11 14-May-1998 downsj

* Better support for XR16C850.
* Copyright.


Revision tags: OPENBSD_2_3_BASE
# 1.10 23-Feb-1998 downsj

New probe routine and support for ST16650.

Compiles, but completely untested.


Revision tags: OPENBSD_2_2_BASE
# 1.9 07-Jul-1997 niklas

Removed an unused arg


Revision tags: OPENBSD_2_1_BASE
# 1.8 06-Mar-1997 tholo

Add control flag to call hardpps() on carrier change


# 1.7 29-Jan-1997 niklas

Export comdefaultrate


# 1.6 10-Dec-1996 deraadt

the real changes by niklas... I did not merge correctly


# 1.5 29-Nov-1996 niklas

Missing pieces of new bus.h that CVS lost behind my back


# 1.4 30-Oct-1996 niklas

cominit is used from the outside (the alpha port)


# 1.3 10-May-1996 deraadt

proto change


# 1.2 21-Apr-1996 deraadt

partial sync with netbsd 960418, more to come


# 1.1 19-Apr-1996 niklas

NetBSD 960317 merge


# 1.59 11-Jan-2022 uaa

add Synopsys Degisnware UART (dw-apb-uart) support

To fix Allwinner H6's UART problem, need to add dw-apb-uart special code.
ok kettenis@


Revision tags: OPENBSD_6_8_BASE OPENBSD_6_9_BASE OPENBSD_7_0_BASE
# 1.58 14-Aug-2020 jcs

Re-commit Exar XR17V35x serial port support previously backed out:

The Exar XR17V354 has 4 ports that have a 256-byte FIFO, use a
frequency of 125Mhz, and have a unique sleep register. A custom
interrupt handler is setup in puc for these ports so it can check a
register which reports which ports triggered the interrupt, rather
than having to run comintr for every port every time.

To avoid probing for these ports in com_attach_subr which requires
access to registers that may be reserved on certain platforms, pass
the sc_uarttype from com_puc_attach since the port type is already
known based on the puc device vendor/id.

Input from kettenis, tested in snaps


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE
# 1.57 14-May-2018 kettenis

Add support for register shift/io-width to the console code as well.

ok visa@, patrick@


# 1.56 02-May-2018 kettenis

Revert previous commit; the XR17V35X probe that was added accesses registers
that aren't guaranteed to be there and may even belong to a different device.
This triggers a fault on hppa machines like the C3000 for example.


# 1.55 15-Apr-2018 jcs

The Exar XR17V354 has 4 com ports that have a 256-byte FIFO, use a
frequency of 125Mhz, and have a unique sleep register. A custom
interrupt handler is setup in puc for these ports so it can check a
register which reports which ports triggered the interrupt, rather
than having to run comintr for every port every time.

ok mlarkin deraadt


# 1.54 02-Apr-2018 kettenis

Add support for register shift/io-width. This allows us to support UARTs
that are mostly NS16550 compatible but use 32-bit instead of 8-bit registers
such as the Synopsys Designware UARTs found on many armv7, arm64 and amd64
SoCs.

tested by florian@, blum@
ok deraadt@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.53 30-Apr-2017 mpi

Unifdef KGDB.

It doesn't compile und hasn't been working during the last decade.

ok kettenis@, deraadt@


Revision tags: OPENBSD_6_1_BASE
# 1.52 03-Sep-2016 jsg

de-zaurus com.c
"looks correct" deraadt@ guenther@ on an earlier rev


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.51 12-May-2012 kettenis

Remove unused variable.

ok mpi@, miod@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE
# 1.50 06-Aug-2010 kettenis

Initial stab at making com@puc suspend and resume properly. Works fine
for using cu(1) between two OpenBSD machines. Probably doesn't work for
serial consoles but we don't support those on puc(4) anyway.

ok deraadt@


# 1.49 01-Aug-2010 yasuoka

Change COM_IBUFSIZE 8K to 16K because 8K is not enough for CDMA1X card
by KDDI.


# 1.48 26-Jun-2010 yasuoka

Grow COM_IBUFSIZE from 1024 to 8192 to be enough size for recent
devices. This will fix the problem using KDDI W04K that has 3.1 Mbps
in downlink.

ok deraadt@


Revision tags: OPENBSD_4_7_BASE
# 1.47 04-Nov-2009 kettenis

Get rid of __HAVE_GENERIC_SOFT_INTERRUPTS now that all our platforms support it.

ok jsing@, miod@


# 1.46 13-Oct-2009 pirofti

Get rid of devact enum, substitute it with an int and coresponding defines.

This is needed for the addition of further suspend/resume actions.

Okay deraadt@, marco@.


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.45 08-Jun-2008 kettenis

Make serial console on non-primary ports work to on i386.

tested by jbg@, "it is right" deraadt@


# 1.44 30-Apr-2008 dlg

fix serial console handling on amd64. currently only glass console ever
works, even if the boot loader is configured to use serial console.

after the changes jsing and i made, the initial probe of the serial port
was failing since the default base addres for the port is invalid. cos of
that the kernel would only ever consider the glass console for use. this
fixes it by reprobing the serial port if we get any config for it from the
boot loader.

advice on aesthetics from miod@
advice and ok from kettenis@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.43 08-May-2007 deraadt

backout while the amd64 puc situation is rethought


# 1.42 08-May-2007 deraadt

move com_activate() to where it belongs


# 1.41 08-May-2007 deraadt

put more foo_detach() routines where they are used


Revision tags: OPENBSD_4_1_BASE
# 1.40 28-Dec-2006 miod

Support for ST16C654 chips, however these aren't detected as such, so the
attachment code has to know better for now;
from Alexei G. Malinin (alexei.malinin@inetcomm.ru)


Revision tags: OPENBSD_4_0_BASE
# 1.39 31-Jul-2006 mickey

puc@cardbus (only added (commented out) to whom has puc@pci enabled)
tested on puc@pci by fkr and meself on the cardbus.
still needs a bit more work but generally works.
deraadt@ ok and some input from miod@


# 1.38 27-Mar-2006 deraadt

in detach, mark device with COM_SW_DEAD, so that close() will not go
tapping additional registes. allows it to work on macppc, where doing
such a tap after unplug is very bad. drahn helped fkr@bytemine.de
ok miod and drahn


Revision tags: OPENBSD_3_9_BASE
# 1.37 24-Oct-2005 fgsch

fix compilation for KGDB; looked by miod@.


Revision tags: OPENBSD_3_8_BASE
# 1.36 27-May-2005 uwe

- Merge changes from pxacom back into the common com driver.

Changes to the common com driver (partly from NetBSD):
- Multiply before divide in comspeed() to avoid overflow (from NetBSD).
- Don't call getc() and send -1 if the output queue is empty.
- Take UART clock frequency as a parameter instead of using COM_FREQ.

ok deraadt@


Revision tags: OPENBSD_3_7_BASE
# 1.35 20-Oct-2004 pefo

Use bus_addr_t instead of int for port address/offset, ok mickey


Revision tags: OPENBSD_3_5_BASE OPENBSD_3_6_BASE SMP_SYNC_A SMP_SYNC_B
# 1.34 23-Sep-2003 millert

Replace select backends with poll backends. selscan() and pollscan()
now call the poll backend. With this change we implement greater
poll(2) functionality instead of emulating it via the select backend.
Adapted from NetBSD and including some changes from FreeBSD.
Tested by many, deraadt@ OK


Revision tags: OPENBSD_3_4_BASE
# 1.33 15-Jul-2003 jason

move prototype for com_raisedtr() to comvar.h (just like pccom).


# 1.32 03-Jun-2003 deraadt

terms 3 & 4 cleanup based on "terms" file


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE UBC_SYNC_A UBC_SYNC_B
# 1.31 14-Mar-2002 millert

First round of __P removal in sys


Revision tags: OPENBSD_3_0_BASE UBC_BASE
# 1.30 05-Oct-2001 mickey

branches: 1.30.4;
restore some of that dead code needed for dev/cons functionality


# 1.29 30-Sep-2001 art

Enable break interrupt earlier.


# 1.28 30-Sep-2001 art

Remove dead code.


# 1.27 30-Sep-2001 art

Remove the COM_HAYESP code. It doesn't appear to have been ever used and
it's very intrusive and makes the code less readable.


# 1.26 29-Sep-2001 art

- compoll is now scheduled once for every sc instead of just one timeout for
all ports and looping over them.
- support for generic soft interrupts.


# 1.25 27-Sep-2001 art

Split out comattach that does isa and isapnp attachment and initialization,
into comattach that does the isa stuff and com_attach_subr that does the
init.


Revision tags: OPENBSD_2_9_BASE
# 1.24 15-Mar-2001 art

Put back new timeouts. This time with correct timeout for compoll.


# 1.23 15-Mar-2001 deraadt

bzzzt


# 1.22 15-Mar-2001 mjacob

Add in missing prototype for comspeedcomspeed.


# 1.21 15-Mar-2001 art

back out new timeouts until I find out why they break alpha.


# 1.20 15-Mar-2001 deraadt

support puc devices with higher speeds (not tested yet)


# 1.19 13-Mar-2001 mickey

new timeouts


# 1.18 24-Jan-2001 hugh

KGDB for i386 from NetBSD via niklas, with tweaks and accommodations.
Tested by various, vetted by mickey & theo.


# 1.17 08-Nov-2000 art

Add comcnattach that does the basic steps needed to attach
a com as a serial console. (idea from NetBSD).

If cn_tab->cn_dev == NODEV, try to find comopen in cdevsw and set cn_dev
to the right device.


Revision tags: OPENBSD_2_7_BASE OPENBSD_2_8_BASE SMP_BASE
# 1.16 04-Feb-2000 angelos

branches: 1.16.2;
Externalize comstop()


# 1.15 01-Feb-2000 mickey

missed in last com.c commit, sc_ic usage was replaced w/ ia_ic where needed; niklas@ ok


Revision tags: OPENBSD_2_6_BASE kame_19991208
# 1.14 08-Aug-1999 niklas

Detach support for com; NetBSD and me


# 1.13 26-Jul-1999 niklas

fix my last commit where I committed more than intended


# 1.12 26-Jul-1999 niklas

Remove obsolete detach code that has been dead for very long


Revision tags: OPENBSD_2_4_BASE OPENBSD_2_5_BASE
# 1.11 14-May-1998 downsj

* Better support for XR16C850.
* Copyright.


Revision tags: OPENBSD_2_3_BASE
# 1.10 23-Feb-1998 downsj

New probe routine and support for ST16650.

Compiles, but completely untested.


Revision tags: OPENBSD_2_2_BASE
# 1.9 07-Jul-1997 niklas

Removed an unused arg


Revision tags: OPENBSD_2_1_BASE
# 1.8 06-Mar-1997 tholo

Add control flag to call hardpps() on carrier change


# 1.7 29-Jan-1997 niklas

Export comdefaultrate


# 1.6 10-Dec-1996 deraadt

the real changes by niklas... I did not merge correctly


# 1.5 29-Nov-1996 niklas

Missing pieces of new bus.h that CVS lost behind my back


# 1.4 30-Oct-1996 niklas

cominit is used from the outside (the alpha port)


# 1.3 10-May-1996 deraadt

proto change


# 1.2 21-Apr-1996 deraadt

partial sync with netbsd 960418, more to come


# 1.1 19-Apr-1996 niklas

NetBSD 960317 merge


# 1.58 14-Aug-2020 jcs

Re-commit Exar XR17V35x serial port support previously backed out:

The Exar XR17V354 has 4 ports that have a 256-byte FIFO, use a
frequency of 125Mhz, and have a unique sleep register. A custom
interrupt handler is setup in puc for these ports so it can check a
register which reports which ports triggered the interrupt, rather
than having to run comintr for every port every time.

To avoid probing for these ports in com_attach_subr which requires
access to registers that may be reserved on certain platforms, pass
the sc_uarttype from com_puc_attach since the port type is already
known based on the puc device vendor/id.

Input from kettenis, tested in snaps


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE
# 1.57 14-May-2018 kettenis

Add support for register shift/io-width to the console code as well.

ok visa@, patrick@


# 1.56 02-May-2018 kettenis

Revert previous commit; the XR17V35X probe that was added accesses registers
that aren't guaranteed to be there and may even belong to a different device.
This triggers a fault on hppa machines like the C3000 for example.


# 1.55 15-Apr-2018 jcs

The Exar XR17V354 has 4 com ports that have a 256-byte FIFO, use a
frequency of 125Mhz, and have a unique sleep register. A custom
interrupt handler is setup in puc for these ports so it can check a
register which reports which ports triggered the interrupt, rather
than having to run comintr for every port every time.

ok mlarkin deraadt


# 1.54 02-Apr-2018 kettenis

Add support for register shift/io-width. This allows us to support UARTs
that are mostly NS16550 compatible but use 32-bit instead of 8-bit registers
such as the Synopsys Designware UARTs found on many armv7, arm64 and amd64
SoCs.

tested by florian@, blum@
ok deraadt@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.53 30-Apr-2017 mpi

Unifdef KGDB.

It doesn't compile und hasn't been working during the last decade.

ok kettenis@, deraadt@


Revision tags: OPENBSD_6_1_BASE
# 1.52 03-Sep-2016 jsg

de-zaurus com.c
"looks correct" deraadt@ guenther@ on an earlier rev


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.51 12-May-2012 kettenis

Remove unused variable.

ok mpi@, miod@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE
# 1.50 06-Aug-2010 kettenis

Initial stab at making com@puc suspend and resume properly. Works fine
for using cu(1) between two OpenBSD machines. Probably doesn't work for
serial consoles but we don't support those on puc(4) anyway.

ok deraadt@


# 1.49 01-Aug-2010 yasuoka

Change COM_IBUFSIZE 8K to 16K because 8K is not enough for CDMA1X card
by KDDI.


# 1.48 26-Jun-2010 yasuoka

Grow COM_IBUFSIZE from 1024 to 8192 to be enough size for recent
devices. This will fix the problem using KDDI W04K that has 3.1 Mbps
in downlink.

ok deraadt@


Revision tags: OPENBSD_4_7_BASE
# 1.47 04-Nov-2009 kettenis

Get rid of __HAVE_GENERIC_SOFT_INTERRUPTS now that all our platforms support it.

ok jsing@, miod@


# 1.46 13-Oct-2009 pirofti

Get rid of devact enum, substitute it with an int and coresponding defines.

This is needed for the addition of further suspend/resume actions.

Okay deraadt@, marco@.


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.45 08-Jun-2008 kettenis

Make serial console on non-primary ports work to on i386.

tested by jbg@, "it is right" deraadt@


# 1.44 30-Apr-2008 dlg

fix serial console handling on amd64. currently only glass console ever
works, even if the boot loader is configured to use serial console.

after the changes jsing and i made, the initial probe of the serial port
was failing since the default base addres for the port is invalid. cos of
that the kernel would only ever consider the glass console for use. this
fixes it by reprobing the serial port if we get any config for it from the
boot loader.

advice on aesthetics from miod@
advice and ok from kettenis@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.43 08-May-2007 deraadt

backout while the amd64 puc situation is rethought


# 1.42 08-May-2007 deraadt

move com_activate() to where it belongs


# 1.41 08-May-2007 deraadt

put more foo_detach() routines where they are used


Revision tags: OPENBSD_4_1_BASE
# 1.40 28-Dec-2006 miod

Support for ST16C654 chips, however these aren't detected as such, so the
attachment code has to know better for now;
from Alexei G. Malinin (alexei.malinin@inetcomm.ru)


Revision tags: OPENBSD_4_0_BASE
# 1.39 31-Jul-2006 mickey

puc@cardbus (only added (commented out) to whom has puc@pci enabled)
tested on puc@pci by fkr and meself on the cardbus.
still needs a bit more work but generally works.
deraadt@ ok and some input from miod@


# 1.38 27-Mar-2006 deraadt

in detach, mark device with COM_SW_DEAD, so that close() will not go
tapping additional registes. allows it to work on macppc, where doing
such a tap after unplug is very bad. drahn helped fkr@bytemine.de
ok miod and drahn


Revision tags: OPENBSD_3_9_BASE
# 1.37 24-Oct-2005 fgsch

fix compilation for KGDB; looked by miod@.


Revision tags: OPENBSD_3_8_BASE
# 1.36 27-May-2005 uwe

- Merge changes from pxacom back into the common com driver.

Changes to the common com driver (partly from NetBSD):
- Multiply before divide in comspeed() to avoid overflow (from NetBSD).
- Don't call getc() and send -1 if the output queue is empty.
- Take UART clock frequency as a parameter instead of using COM_FREQ.

ok deraadt@


Revision tags: OPENBSD_3_7_BASE
# 1.35 20-Oct-2004 pefo

Use bus_addr_t instead of int for port address/offset, ok mickey


Revision tags: OPENBSD_3_5_BASE OPENBSD_3_6_BASE SMP_SYNC_A SMP_SYNC_B
# 1.34 23-Sep-2003 millert

Replace select backends with poll backends. selscan() and pollscan()
now call the poll backend. With this change we implement greater
poll(2) functionality instead of emulating it via the select backend.
Adapted from NetBSD and including some changes from FreeBSD.
Tested by many, deraadt@ OK


Revision tags: OPENBSD_3_4_BASE
# 1.33 15-Jul-2003 jason

move prototype for com_raisedtr() to comvar.h (just like pccom).


# 1.32 03-Jun-2003 deraadt

terms 3 & 4 cleanup based on "terms" file


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE UBC_SYNC_A UBC_SYNC_B
# 1.31 14-Mar-2002 millert

First round of __P removal in sys


Revision tags: OPENBSD_3_0_BASE UBC_BASE
# 1.30 05-Oct-2001 mickey

branches: 1.30.4;
restore some of that dead code needed for dev/cons functionality


# 1.29 30-Sep-2001 art

Enable break interrupt earlier.


# 1.28 30-Sep-2001 art

Remove dead code.


# 1.27 30-Sep-2001 art

Remove the COM_HAYESP code. It doesn't appear to have been ever used and
it's very intrusive and makes the code less readable.


# 1.26 29-Sep-2001 art

- compoll is now scheduled once for every sc instead of just one timeout for
all ports and looping over them.
- support for generic soft interrupts.


# 1.25 27-Sep-2001 art

Split out comattach that does isa and isapnp attachment and initialization,
into comattach that does the isa stuff and com_attach_subr that does the
init.


Revision tags: OPENBSD_2_9_BASE
# 1.24 15-Mar-2001 art

Put back new timeouts. This time with correct timeout for compoll.


# 1.23 15-Mar-2001 deraadt

bzzzt


# 1.22 15-Mar-2001 mjacob

Add in missing prototype for comspeedcomspeed.


# 1.21 15-Mar-2001 art

back out new timeouts until I find out why they break alpha.


# 1.20 15-Mar-2001 deraadt

support puc devices with higher speeds (not tested yet)


# 1.19 13-Mar-2001 mickey

new timeouts


# 1.18 24-Jan-2001 hugh

KGDB for i386 from NetBSD via niklas, with tweaks and accommodations.
Tested by various, vetted by mickey & theo.


# 1.17 08-Nov-2000 art

Add comcnattach that does the basic steps needed to attach
a com as a serial console. (idea from NetBSD).

If cn_tab->cn_dev == NODEV, try to find comopen in cdevsw and set cn_dev
to the right device.


Revision tags: OPENBSD_2_7_BASE OPENBSD_2_8_BASE SMP_BASE
# 1.16 04-Feb-2000 angelos

branches: 1.16.2;
Externalize comstop()


# 1.15 01-Feb-2000 mickey

missed in last com.c commit, sc_ic usage was replaced w/ ia_ic where needed; niklas@ ok


Revision tags: OPENBSD_2_6_BASE kame_19991208
# 1.14 08-Aug-1999 niklas

Detach support for com; NetBSD and me


# 1.13 26-Jul-1999 niklas

fix my last commit where I committed more than intended


# 1.12 26-Jul-1999 niklas

Remove obsolete detach code that has been dead for very long


Revision tags: OPENBSD_2_4_BASE OPENBSD_2_5_BASE
# 1.11 14-May-1998 downsj

* Better support for XR16C850.
* Copyright.


Revision tags: OPENBSD_2_3_BASE
# 1.10 23-Feb-1998 downsj

New probe routine and support for ST16650.

Compiles, but completely untested.


Revision tags: OPENBSD_2_2_BASE
# 1.9 07-Jul-1997 niklas

Removed an unused arg


Revision tags: OPENBSD_2_1_BASE
# 1.8 06-Mar-1997 tholo

Add control flag to call hardpps() on carrier change


# 1.7 29-Jan-1997 niklas

Export comdefaultrate


# 1.6 10-Dec-1996 deraadt

the real changes by niklas... I did not merge correctly


# 1.5 29-Nov-1996 niklas

Missing pieces of new bus.h that CVS lost behind my back


# 1.4 30-Oct-1996 niklas

cominit is used from the outside (the alpha port)


# 1.3 10-May-1996 deraadt

proto change


# 1.2 21-Apr-1996 deraadt

partial sync with netbsd 960418, more to come


# 1.1 19-Apr-1996 niklas

NetBSD 960317 merge


# 1.57 14-May-2018 kettenis

Add support for register shift/io-width to the console code as well.

ok visa@, patrick@


# 1.56 02-May-2018 kettenis

Revert previous commit; the XR17V35X probe that was added accesses registers
that aren't guaranteed to be there and may even belong to a different device.
This triggers a fault on hppa machines like the C3000 for example.


# 1.55 15-Apr-2018 jcs

The Exar XR17V354 has 4 com ports that have a 256-byte FIFO, use a
frequency of 125Mhz, and have a unique sleep register. A custom
interrupt handler is setup in puc for these ports so it can check a
register which reports which ports triggered the interrupt, rather
than having to run comintr for every port every time.

ok mlarkin deraadt


# 1.54 02-Apr-2018 kettenis

Add support for register shift/io-width. This allows us to support UARTs
that are mostly NS16550 compatible but use 32-bit instead of 8-bit registers
such as the Synopsys Designware UARTs found on many armv7, arm64 and amd64
SoCs.

tested by florian@, blum@
ok deraadt@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.53 30-Apr-2017 mpi

Unifdef KGDB.

It doesn't compile und hasn't been working during the last decade.

ok kettenis@, deraadt@


Revision tags: OPENBSD_6_1_BASE
# 1.52 03-Sep-2016 jsg

de-zaurus com.c
"looks correct" deraadt@ guenther@ on an earlier rev


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.51 12-May-2012 kettenis

Remove unused variable.

ok mpi@, miod@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE
# 1.50 06-Aug-2010 kettenis

Initial stab at making com@puc suspend and resume properly. Works fine
for using cu(1) between two OpenBSD machines. Probably doesn't work for
serial consoles but we don't support those on puc(4) anyway.

ok deraadt@


# 1.49 01-Aug-2010 yasuoka

Change COM_IBUFSIZE 8K to 16K because 8K is not enough for CDMA1X card
by KDDI.


# 1.48 26-Jun-2010 yasuoka

Grow COM_IBUFSIZE from 1024 to 8192 to be enough size for recent
devices. This will fix the problem using KDDI W04K that has 3.1 Mbps
in downlink.

ok deraadt@


Revision tags: OPENBSD_4_7_BASE
# 1.47 04-Nov-2009 kettenis

Get rid of __HAVE_GENERIC_SOFT_INTERRUPTS now that all our platforms support it.

ok jsing@, miod@


# 1.46 13-Oct-2009 pirofti

Get rid of devact enum, substitute it with an int and coresponding defines.

This is needed for the addition of further suspend/resume actions.

Okay deraadt@, marco@.


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.45 08-Jun-2008 kettenis

Make serial console on non-primary ports work to on i386.

tested by jbg@, "it is right" deraadt@


# 1.44 30-Apr-2008 dlg

fix serial console handling on amd64. currently only glass console ever
works, even if the boot loader is configured to use serial console.

after the changes jsing and i made, the initial probe of the serial port
was failing since the default base addres for the port is invalid. cos of
that the kernel would only ever consider the glass console for use. this
fixes it by reprobing the serial port if we get any config for it from the
boot loader.

advice on aesthetics from miod@
advice and ok from kettenis@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.43 08-May-2007 deraadt

backout while the amd64 puc situation is rethought


# 1.42 08-May-2007 deraadt

move com_activate() to where it belongs


# 1.41 08-May-2007 deraadt

put more foo_detach() routines where they are used


Revision tags: OPENBSD_4_1_BASE
# 1.40 28-Dec-2006 miod

Support for ST16C654 chips, however these aren't detected as such, so the
attachment code has to know better for now;
from Alexei G. Malinin (alexei.malinin@inetcomm.ru)


Revision tags: OPENBSD_4_0_BASE
# 1.39 31-Jul-2006 mickey

puc@cardbus (only added (commented out) to whom has puc@pci enabled)
tested on puc@pci by fkr and meself on the cardbus.
still needs a bit more work but generally works.
deraadt@ ok and some input from miod@


# 1.38 27-Mar-2006 deraadt

in detach, mark device with COM_SW_DEAD, so that close() will not go
tapping additional registes. allows it to work on macppc, where doing
such a tap after unplug is very bad. drahn helped fkr@bytemine.de
ok miod and drahn


Revision tags: OPENBSD_3_9_BASE
# 1.37 24-Oct-2005 fgsch

fix compilation for KGDB; looked by miod@.


Revision tags: OPENBSD_3_8_BASE
# 1.36 27-May-2005 uwe

- Merge changes from pxacom back into the common com driver.

Changes to the common com driver (partly from NetBSD):
- Multiply before divide in comspeed() to avoid overflow (from NetBSD).
- Don't call getc() and send -1 if the output queue is empty.
- Take UART clock frequency as a parameter instead of using COM_FREQ.

ok deraadt@


Revision tags: OPENBSD_3_7_BASE
# 1.35 20-Oct-2004 pefo

Use bus_addr_t instead of int for port address/offset, ok mickey


Revision tags: OPENBSD_3_5_BASE OPENBSD_3_6_BASE SMP_SYNC_A SMP_SYNC_B
# 1.34 23-Sep-2003 millert

Replace select backends with poll backends. selscan() and pollscan()
now call the poll backend. With this change we implement greater
poll(2) functionality instead of emulating it via the select backend.
Adapted from NetBSD and including some changes from FreeBSD.
Tested by many, deraadt@ OK


Revision tags: OPENBSD_3_4_BASE
# 1.33 15-Jul-2003 jason

move prototype for com_raisedtr() to comvar.h (just like pccom).


# 1.32 03-Jun-2003 deraadt

terms 3 & 4 cleanup based on "terms" file


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE UBC_SYNC_A UBC_SYNC_B
# 1.31 14-Mar-2002 millert

First round of __P removal in sys


Revision tags: OPENBSD_3_0_BASE UBC_BASE
# 1.30 05-Oct-2001 mickey

branches: 1.30.4;
restore some of that dead code needed for dev/cons functionality


# 1.29 30-Sep-2001 art

Enable break interrupt earlier.


# 1.28 30-Sep-2001 art

Remove dead code.


# 1.27 30-Sep-2001 art

Remove the COM_HAYESP code. It doesn't appear to have been ever used and
it's very intrusive and makes the code less readable.


# 1.26 29-Sep-2001 art

- compoll is now scheduled once for every sc instead of just one timeout for
all ports and looping over them.
- support for generic soft interrupts.


# 1.25 27-Sep-2001 art

Split out comattach that does isa and isapnp attachment and initialization,
into comattach that does the isa stuff and com_attach_subr that does the
init.


Revision tags: OPENBSD_2_9_BASE
# 1.24 15-Mar-2001 art

Put back new timeouts. This time with correct timeout for compoll.


# 1.23 15-Mar-2001 deraadt

bzzzt


# 1.22 15-Mar-2001 mjacob

Add in missing prototype for comspeedcomspeed.


# 1.21 15-Mar-2001 art

back out new timeouts until I find out why they break alpha.


# 1.20 15-Mar-2001 deraadt

support puc devices with higher speeds (not tested yet)


# 1.19 13-Mar-2001 mickey

new timeouts


# 1.18 24-Jan-2001 hugh

KGDB for i386 from NetBSD via niklas, with tweaks and accommodations.
Tested by various, vetted by mickey & theo.


# 1.17 08-Nov-2000 art

Add comcnattach that does the basic steps needed to attach
a com as a serial console. (idea from NetBSD).

If cn_tab->cn_dev == NODEV, try to find comopen in cdevsw and set cn_dev
to the right device.


Revision tags: OPENBSD_2_7_BASE OPENBSD_2_8_BASE SMP_BASE
# 1.16 04-Feb-2000 angelos

branches: 1.16.2;
Externalize comstop()


# 1.15 01-Feb-2000 mickey

missed in last com.c commit, sc_ic usage was replaced w/ ia_ic where needed; niklas@ ok


Revision tags: OPENBSD_2_6_BASE kame_19991208
# 1.14 08-Aug-1999 niklas

Detach support for com; NetBSD and me


# 1.13 26-Jul-1999 niklas

fix my last commit where I committed more than intended


# 1.12 26-Jul-1999 niklas

Remove obsolete detach code that has been dead for very long


Revision tags: OPENBSD_2_4_BASE OPENBSD_2_5_BASE
# 1.11 14-May-1998 downsj

* Better support for XR16C850.
* Copyright.


Revision tags: OPENBSD_2_3_BASE
# 1.10 23-Feb-1998 downsj

New probe routine and support for ST16650.

Compiles, but completely untested.


Revision tags: OPENBSD_2_2_BASE
# 1.9 07-Jul-1997 niklas

Removed an unused arg


Revision tags: OPENBSD_2_1_BASE
# 1.8 06-Mar-1997 tholo

Add control flag to call hardpps() on carrier change


# 1.7 29-Jan-1997 niklas

Export comdefaultrate


# 1.6 10-Dec-1996 deraadt

the real changes by niklas... I did not merge correctly


# 1.5 29-Nov-1996 niklas

Missing pieces of new bus.h that CVS lost behind my back


# 1.4 30-Oct-1996 niklas

cominit is used from the outside (the alpha port)


# 1.3 10-May-1996 deraadt

proto change


# 1.2 21-Apr-1996 deraadt

partial sync with netbsd 960418, more to come


# 1.1 19-Apr-1996 niklas

NetBSD 960317 merge


# 1.56 02-May-2018 kettenis

Revert previous commit; the XR17V35X probe that was added accesses registers
that aren't guaranteed to be there and may even belong to a different device.
This triggers a fault on hppa machines like the C3000 for example.


# 1.55 15-Apr-2018 jcs

The Exar XR17V354 has 4 com ports that have a 256-byte FIFO, use a
frequency of 125Mhz, and have a unique sleep register. A custom
interrupt handler is setup in puc for these ports so it can check a
register which reports which ports triggered the interrupt, rather
than having to run comintr for every port every time.

ok mlarkin deraadt


# 1.54 02-Apr-2018 kettenis

Add support for register shift/io-width. This allows us to support UARTs
that are mostly NS16550 compatible but use 32-bit instead of 8-bit registers
such as the Synopsys Designware UARTs found on many armv7, arm64 and amd64
SoCs.

tested by florian@, blum@
ok deraadt@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.53 30-Apr-2017 mpi

Unifdef KGDB.

It doesn't compile und hasn't been working during the last decade.

ok kettenis@, deraadt@


Revision tags: OPENBSD_6_1_BASE
# 1.52 03-Sep-2016 jsg

de-zaurus com.c
"looks correct" deraadt@ guenther@ on an earlier rev


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.51 12-May-2012 kettenis

Remove unused variable.

ok mpi@, miod@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE
# 1.50 06-Aug-2010 kettenis

Initial stab at making com@puc suspend and resume properly. Works fine
for using cu(1) between two OpenBSD machines. Probably doesn't work for
serial consoles but we don't support those on puc(4) anyway.

ok deraadt@


# 1.49 01-Aug-2010 yasuoka

Change COM_IBUFSIZE 8K to 16K because 8K is not enough for CDMA1X card
by KDDI.


# 1.48 26-Jun-2010 yasuoka

Grow COM_IBUFSIZE from 1024 to 8192 to be enough size for recent
devices. This will fix the problem using KDDI W04K that has 3.1 Mbps
in downlink.

ok deraadt@


Revision tags: OPENBSD_4_7_BASE
# 1.47 04-Nov-2009 kettenis

Get rid of __HAVE_GENERIC_SOFT_INTERRUPTS now that all our platforms support it.

ok jsing@, miod@


# 1.46 13-Oct-2009 pirofti

Get rid of devact enum, substitute it with an int and coresponding defines.

This is needed for the addition of further suspend/resume actions.

Okay deraadt@, marco@.


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.45 08-Jun-2008 kettenis

Make serial console on non-primary ports work to on i386.

tested by jbg@, "it is right" deraadt@


# 1.44 30-Apr-2008 dlg

fix serial console handling on amd64. currently only glass console ever
works, even if the boot loader is configured to use serial console.

after the changes jsing and i made, the initial probe of the serial port
was failing since the default base addres for the port is invalid. cos of
that the kernel would only ever consider the glass console for use. this
fixes it by reprobing the serial port if we get any config for it from the
boot loader.

advice on aesthetics from miod@
advice and ok from kettenis@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.43 08-May-2007 deraadt

backout while the amd64 puc situation is rethought


# 1.42 08-May-2007 deraadt

move com_activate() to where it belongs


# 1.41 08-May-2007 deraadt

put more foo_detach() routines where they are used


Revision tags: OPENBSD_4_1_BASE
# 1.40 28-Dec-2006 miod

Support for ST16C654 chips, however these aren't detected as such, so the
attachment code has to know better for now;
from Alexei G. Malinin (alexei.malinin@inetcomm.ru)


Revision tags: OPENBSD_4_0_BASE
# 1.39 31-Jul-2006 mickey

puc@cardbus (only added (commented out) to whom has puc@pci enabled)
tested on puc@pci by fkr and meself on the cardbus.
still needs a bit more work but generally works.
deraadt@ ok and some input from miod@


# 1.38 27-Mar-2006 deraadt

in detach, mark device with COM_SW_DEAD, so that close() will not go
tapping additional registes. allows it to work on macppc, where doing
such a tap after unplug is very bad. drahn helped fkr@bytemine.de
ok miod and drahn


Revision tags: OPENBSD_3_9_BASE
# 1.37 24-Oct-2005 fgsch

fix compilation for KGDB; looked by miod@.


Revision tags: OPENBSD_3_8_BASE
# 1.36 27-May-2005 uwe

- Merge changes from pxacom back into the common com driver.

Changes to the common com driver (partly from NetBSD):
- Multiply before divide in comspeed() to avoid overflow (from NetBSD).
- Don't call getc() and send -1 if the output queue is empty.
- Take UART clock frequency as a parameter instead of using COM_FREQ.

ok deraadt@


Revision tags: OPENBSD_3_7_BASE
# 1.35 20-Oct-2004 pefo

Use bus_addr_t instead of int for port address/offset, ok mickey


Revision tags: OPENBSD_3_5_BASE OPENBSD_3_6_BASE SMP_SYNC_A SMP_SYNC_B
# 1.34 23-Sep-2003 millert

Replace select backends with poll backends. selscan() and pollscan()
now call the poll backend. With this change we implement greater
poll(2) functionality instead of emulating it via the select backend.
Adapted from NetBSD and including some changes from FreeBSD.
Tested by many, deraadt@ OK


Revision tags: OPENBSD_3_4_BASE
# 1.33 15-Jul-2003 jason

move prototype for com_raisedtr() to comvar.h (just like pccom).


# 1.32 03-Jun-2003 deraadt

terms 3 & 4 cleanup based on "terms" file


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE UBC_SYNC_A UBC_SYNC_B
# 1.31 14-Mar-2002 millert

First round of __P removal in sys


Revision tags: OPENBSD_3_0_BASE UBC_BASE
# 1.30 05-Oct-2001 mickey

branches: 1.30.4;
restore some of that dead code needed for dev/cons functionality


# 1.29 30-Sep-2001 art

Enable break interrupt earlier.


# 1.28 30-Sep-2001 art

Remove dead code.


# 1.27 30-Sep-2001 art

Remove the COM_HAYESP code. It doesn't appear to have been ever used and
it's very intrusive and makes the code less readable.


# 1.26 29-Sep-2001 art

- compoll is now scheduled once for every sc instead of just one timeout for
all ports and looping over them.
- support for generic soft interrupts.


# 1.25 27-Sep-2001 art

Split out comattach that does isa and isapnp attachment and initialization,
into comattach that does the isa stuff and com_attach_subr that does the
init.


Revision tags: OPENBSD_2_9_BASE
# 1.24 15-Mar-2001 art

Put back new timeouts. This time with correct timeout for compoll.


# 1.23 15-Mar-2001 deraadt

bzzzt


# 1.22 15-Mar-2001 mjacob

Add in missing prototype for comspeedcomspeed.


# 1.21 15-Mar-2001 art

back out new timeouts until I find out why they break alpha.


# 1.20 15-Mar-2001 deraadt

support puc devices with higher speeds (not tested yet)


# 1.19 13-Mar-2001 mickey

new timeouts


# 1.18 24-Jan-2001 hugh

KGDB for i386 from NetBSD via niklas, with tweaks and accommodations.
Tested by various, vetted by mickey & theo.


# 1.17 08-Nov-2000 art

Add comcnattach that does the basic steps needed to attach
a com as a serial console. (idea from NetBSD).

If cn_tab->cn_dev == NODEV, try to find comopen in cdevsw and set cn_dev
to the right device.


Revision tags: OPENBSD_2_7_BASE OPENBSD_2_8_BASE SMP_BASE
# 1.16 04-Feb-2000 angelos

branches: 1.16.2;
Externalize comstop()


# 1.15 01-Feb-2000 mickey

missed in last com.c commit, sc_ic usage was replaced w/ ia_ic where needed; niklas@ ok


Revision tags: OPENBSD_2_6_BASE kame_19991208
# 1.14 08-Aug-1999 niklas

Detach support for com; NetBSD and me


# 1.13 26-Jul-1999 niklas

fix my last commit where I committed more than intended


# 1.12 26-Jul-1999 niklas

Remove obsolete detach code that has been dead for very long


Revision tags: OPENBSD_2_4_BASE OPENBSD_2_5_BASE
# 1.11 14-May-1998 downsj

* Better support for XR16C850.
* Copyright.


Revision tags: OPENBSD_2_3_BASE
# 1.10 23-Feb-1998 downsj

New probe routine and support for ST16650.

Compiles, but completely untested.


Revision tags: OPENBSD_2_2_BASE
# 1.9 07-Jul-1997 niklas

Removed an unused arg


Revision tags: OPENBSD_2_1_BASE
# 1.8 06-Mar-1997 tholo

Add control flag to call hardpps() on carrier change


# 1.7 29-Jan-1997 niklas

Export comdefaultrate


# 1.6 10-Dec-1996 deraadt

the real changes by niklas... I did not merge correctly


# 1.5 29-Nov-1996 niklas

Missing pieces of new bus.h that CVS lost behind my back


# 1.4 30-Oct-1996 niklas

cominit is used from the outside (the alpha port)


# 1.3 10-May-1996 deraadt

proto change


# 1.2 21-Apr-1996 deraadt

partial sync with netbsd 960418, more to come


# 1.1 19-Apr-1996 niklas

NetBSD 960317 merge


# 1.54 02-Apr-2018 kettenis

Add support for register shift/io-width. This allows us to support UARTs
that are mostly NS16550 compatible but use 32-bit instead of 8-bit registers
such as the Synopsys Designware UARTs found on many armv7, arm64 and amd64
SoCs.

tested by florian@, blum@
ok deraadt@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.53 30-Apr-2017 mpi

Unifdef KGDB.

It doesn't compile und hasn't been working during the last decade.

ok kettenis@, deraadt@


Revision tags: OPENBSD_6_1_BASE
# 1.52 03-Sep-2016 jsg

de-zaurus com.c
"looks correct" deraadt@ guenther@ on an earlier rev


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.51 12-May-2012 kettenis

Remove unused variable.

ok mpi@, miod@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE
# 1.50 06-Aug-2010 kettenis

Initial stab at making com@puc suspend and resume properly. Works fine
for using cu(1) between two OpenBSD machines. Probably doesn't work for
serial consoles but we don't support those on puc(4) anyway.

ok deraadt@


# 1.49 01-Aug-2010 yasuoka

Change COM_IBUFSIZE 8K to 16K because 8K is not enough for CDMA1X card
by KDDI.


# 1.48 26-Jun-2010 yasuoka

Grow COM_IBUFSIZE from 1024 to 8192 to be enough size for recent
devices. This will fix the problem using KDDI W04K that has 3.1 Mbps
in downlink.

ok deraadt@


Revision tags: OPENBSD_4_7_BASE
# 1.47 04-Nov-2009 kettenis

Get rid of __HAVE_GENERIC_SOFT_INTERRUPTS now that all our platforms support it.

ok jsing@, miod@


# 1.46 13-Oct-2009 pirofti

Get rid of devact enum, substitute it with an int and coresponding defines.

This is needed for the addition of further suspend/resume actions.

Okay deraadt@, marco@.


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.45 08-Jun-2008 kettenis

Make serial console on non-primary ports work to on i386.

tested by jbg@, "it is right" deraadt@


# 1.44 30-Apr-2008 dlg

fix serial console handling on amd64. currently only glass console ever
works, even if the boot loader is configured to use serial console.

after the changes jsing and i made, the initial probe of the serial port
was failing since the default base addres for the port is invalid. cos of
that the kernel would only ever consider the glass console for use. this
fixes it by reprobing the serial port if we get any config for it from the
boot loader.

advice on aesthetics from miod@
advice and ok from kettenis@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.43 08-May-2007 deraadt

backout while the amd64 puc situation is rethought


# 1.42 08-May-2007 deraadt

move com_activate() to where it belongs


# 1.41 08-May-2007 deraadt

put more foo_detach() routines where they are used


Revision tags: OPENBSD_4_1_BASE
# 1.40 28-Dec-2006 miod

Support for ST16C654 chips, however these aren't detected as such, so the
attachment code has to know better for now;
from Alexei G. Malinin (alexei.malinin@inetcomm.ru)


Revision tags: OPENBSD_4_0_BASE
# 1.39 31-Jul-2006 mickey

puc@cardbus (only added (commented out) to whom has puc@pci enabled)
tested on puc@pci by fkr and meself on the cardbus.
still needs a bit more work but generally works.
deraadt@ ok and some input from miod@


# 1.38 27-Mar-2006 deraadt

in detach, mark device with COM_SW_DEAD, so that close() will not go
tapping additional registes. allows it to work on macppc, where doing
such a tap after unplug is very bad. drahn helped fkr@bytemine.de
ok miod and drahn


Revision tags: OPENBSD_3_9_BASE
# 1.37 24-Oct-2005 fgsch

fix compilation for KGDB; looked by miod@.


Revision tags: OPENBSD_3_8_BASE
# 1.36 27-May-2005 uwe

- Merge changes from pxacom back into the common com driver.

Changes to the common com driver (partly from NetBSD):
- Multiply before divide in comspeed() to avoid overflow (from NetBSD).
- Don't call getc() and send -1 if the output queue is empty.
- Take UART clock frequency as a parameter instead of using COM_FREQ.

ok deraadt@


Revision tags: OPENBSD_3_7_BASE
# 1.35 20-Oct-2004 pefo

Use bus_addr_t instead of int for port address/offset, ok mickey


Revision tags: OPENBSD_3_5_BASE OPENBSD_3_6_BASE SMP_SYNC_A SMP_SYNC_B
# 1.34 23-Sep-2003 millert

Replace select backends with poll backends. selscan() and pollscan()
now call the poll backend. With this change we implement greater
poll(2) functionality instead of emulating it via the select backend.
Adapted from NetBSD and including some changes from FreeBSD.
Tested by many, deraadt@ OK


Revision tags: OPENBSD_3_4_BASE
# 1.33 15-Jul-2003 jason

move prototype for com_raisedtr() to comvar.h (just like pccom).


# 1.32 03-Jun-2003 deraadt

terms 3 & 4 cleanup based on "terms" file


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE UBC_SYNC_A UBC_SYNC_B
# 1.31 14-Mar-2002 millert

First round of __P removal in sys


Revision tags: OPENBSD_3_0_BASE UBC_BASE
# 1.30 05-Oct-2001 mickey

branches: 1.30.4;
restore some of that dead code needed for dev/cons functionality


# 1.29 30-Sep-2001 art

Enable break interrupt earlier.


# 1.28 30-Sep-2001 art

Remove dead code.


# 1.27 30-Sep-2001 art

Remove the COM_HAYESP code. It doesn't appear to have been ever used and
it's very intrusive and makes the code less readable.


# 1.26 29-Sep-2001 art

- compoll is now scheduled once for every sc instead of just one timeout for
all ports and looping over them.
- support for generic soft interrupts.


# 1.25 27-Sep-2001 art

Split out comattach that does isa and isapnp attachment and initialization,
into comattach that does the isa stuff and com_attach_subr that does the
init.


Revision tags: OPENBSD_2_9_BASE
# 1.24 15-Mar-2001 art

Put back new timeouts. This time with correct timeout for compoll.


# 1.23 15-Mar-2001 deraadt

bzzzt


# 1.22 15-Mar-2001 mjacob

Add in missing prototype for comspeedcomspeed.


# 1.21 15-Mar-2001 art

back out new timeouts until I find out why they break alpha.


# 1.20 15-Mar-2001 deraadt

support puc devices with higher speeds (not tested yet)


# 1.19 13-Mar-2001 mickey

new timeouts


# 1.18 24-Jan-2001 hugh

KGDB for i386 from NetBSD via niklas, with tweaks and accommodations.
Tested by various, vetted by mickey & theo.


# 1.17 08-Nov-2000 art

Add comcnattach that does the basic steps needed to attach
a com as a serial console. (idea from NetBSD).

If cn_tab->cn_dev == NODEV, try to find comopen in cdevsw and set cn_dev
to the right device.


Revision tags: OPENBSD_2_7_BASE OPENBSD_2_8_BASE SMP_BASE
# 1.16 04-Feb-2000 angelos

branches: 1.16.2;
Externalize comstop()


# 1.15 01-Feb-2000 mickey

missed in last com.c commit, sc_ic usage was replaced w/ ia_ic where needed; niklas@ ok


Revision tags: OPENBSD_2_6_BASE kame_19991208
# 1.14 08-Aug-1999 niklas

Detach support for com; NetBSD and me


# 1.13 26-Jul-1999 niklas

fix my last commit where I committed more than intended


# 1.12 26-Jul-1999 niklas

Remove obsolete detach code that has been dead for very long


Revision tags: OPENBSD_2_4_BASE OPENBSD_2_5_BASE
# 1.11 14-May-1998 downsj

* Better support for XR16C850.
* Copyright.


Revision tags: OPENBSD_2_3_BASE
# 1.10 23-Feb-1998 downsj

New probe routine and support for ST16650.

Compiles, but completely untested.


Revision tags: OPENBSD_2_2_BASE
# 1.9 07-Jul-1997 niklas

Removed an unused arg


Revision tags: OPENBSD_2_1_BASE
# 1.8 06-Mar-1997 tholo

Add control flag to call hardpps() on carrier change


# 1.7 29-Jan-1997 niklas

Export comdefaultrate


# 1.6 10-Dec-1996 deraadt

the real changes by niklas... I did not merge correctly


# 1.5 29-Nov-1996 niklas

Missing pieces of new bus.h that CVS lost behind my back


# 1.4 30-Oct-1996 niklas

cominit is used from the outside (the alpha port)


# 1.3 10-May-1996 deraadt

proto change


# 1.2 21-Apr-1996 deraadt

partial sync with netbsd 960418, more to come


# 1.1 19-Apr-1996 niklas

NetBSD 960317 merge


Revision tags: OPENBSD_6_2_BASE
# 1.53 30-Apr-2017 mpi

Unifdef KGDB.

It doesn't compile und hasn't been working during the last decade.

ok kettenis@, deraadt@


Revision tags: OPENBSD_6_1_BASE
# 1.52 03-Sep-2016 jsg

de-zaurus com.c
"looks correct" deraadt@ guenther@ on an earlier rev


Revision tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.51 12-May-2012 kettenis

Remove unused variable.

ok mpi@, miod@


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE
# 1.50 06-Aug-2010 kettenis

Initial stab at making com@puc suspend and resume properly. Works fine
for using cu(1) between two OpenBSD machines. Probably doesn't work for
serial consoles but we don't support those on puc(4) anyway.

ok deraadt@


# 1.49 01-Aug-2010 yasuoka

Change COM_IBUFSIZE 8K to 16K because 8K is not enough for CDMA1X card
by KDDI.


# 1.48 26-Jun-2010 yasuoka

Grow COM_IBUFSIZE from 1024 to 8192 to be enough size for recent
devices. This will fix the problem using KDDI W04K that has 3.1 Mbps
in downlink.

ok deraadt@


Revision tags: OPENBSD_4_7_BASE
# 1.47 04-Nov-2009 kettenis

Get rid of __HAVE_GENERIC_SOFT_INTERRUPTS now that all our platforms support it.

ok jsing@, miod@


# 1.46 13-Oct-2009 pirofti

Get rid of devact enum, substitute it with an int and coresponding defines.

This is needed for the addition of further suspend/resume actions.

Okay deraadt@, marco@.


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.45 08-Jun-2008 kettenis

Make serial console on non-primary ports work to on i386.

tested by jbg@, "it is right" deraadt@


# 1.44 30-Apr-2008 dlg

fix serial console handling on amd64. currently only glass console ever
works, even if the boot loader is configured to use serial console.

after the changes jsing and i made, the initial probe of the serial port
was failing since the default base addres for the port is invalid. cos of
that the kernel would only ever consider the glass console for use. this
fixes it by reprobing the serial port if we get any config for it from the
boot loader.

advice on aesthetics from miod@
advice and ok from kettenis@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.43 08-May-2007 deraadt

backout while the amd64 puc situation is rethought


# 1.42 08-May-2007 deraadt

move com_activate() to where it belongs


# 1.41 08-May-2007 deraadt

put more foo_detach() routines where they are used


Revision tags: OPENBSD_4_1_BASE
# 1.40 28-Dec-2006 miod

Support for ST16C654 chips, however these aren't detected as such, so the
attachment code has to know better for now;
from Alexei G. Malinin (alexei.malinin@inetcomm.ru)


Revision tags: OPENBSD_4_0_BASE
# 1.39 31-Jul-2006 mickey

puc@cardbus (only added (commented out) to whom has puc@pci enabled)
tested on puc@pci by fkr and meself on the cardbus.
still needs a bit more work but generally works.
deraadt@ ok and some input from miod@


# 1.38 27-Mar-2006 deraadt

in detach, mark device with COM_SW_DEAD, so that close() will not go
tapping additional registes. allows it to work on macppc, where doing
such a tap after unplug is very bad. drahn helped fkr@bytemine.de
ok miod and drahn


Revision tags: OPENBSD_3_9_BASE
# 1.37 24-Oct-2005 fgsch

fix compilation for KGDB; looked by miod@.


Revision tags: OPENBSD_3_8_BASE
# 1.36 27-May-2005 uwe

- Merge changes from pxacom back into the common com driver.

Changes to the common com driver (partly from NetBSD):
- Multiply before divide in comspeed() to avoid overflow (from NetBSD).
- Don't call getc() and send -1 if the output queue is empty.
- Take UART clock frequency as a parameter instead of using COM_FREQ.

ok deraadt@


Revision tags: OPENBSD_3_7_BASE
# 1.35 20-Oct-2004 pefo

Use bus_addr_t instead of int for port address/offset, ok mickey


Revision tags: OPENBSD_3_5_BASE OPENBSD_3_6_BASE SMP_SYNC_A SMP_SYNC_B
# 1.34 23-Sep-2003 millert

Replace select backends with poll backends. selscan() and pollscan()
now call the poll backend. With this change we implement greater
poll(2) functionality instead of emulating it via the select backend.
Adapted from NetBSD and including some changes from FreeBSD.
Tested by many, deraadt@ OK


Revision tags: OPENBSD_3_4_BASE
# 1.33 15-Jul-2003 jason

move prototype for com_raisedtr() to comvar.h (just like pccom).


# 1.32 03-Jun-2003 deraadt

terms 3 & 4 cleanup based on "terms" file


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE UBC_SYNC_A UBC_SYNC_B
# 1.31 14-Mar-2002 millert

First round of __P removal in sys


Revision tags: OPENBSD_3_0_BASE UBC_BASE
# 1.30 05-Oct-2001 mickey

branches: 1.30.4;
restore some of that dead code needed for dev/cons functionality


# 1.29 30-Sep-2001 art

Enable break interrupt earlier.


# 1.28 30-Sep-2001 art

Remove dead code.


# 1.27 30-Sep-2001 art

Remove the COM_HAYESP code. It doesn't appear to have been ever used and
it's very intrusive and makes the code less readable.


# 1.26 29-Sep-2001 art

- compoll is now scheduled once for every sc instead of just one timeout for
all ports and looping over them.
- support for generic soft interrupts.


# 1.25 27-Sep-2001 art

Split out comattach that does isa and isapnp attachment and initialization,
into comattach that does the isa stuff and com_attach_subr that does the
init.


Revision tags: OPENBSD_2_9_BASE
# 1.24 15-Mar-2001 art

Put back new timeouts. This time with correct timeout for compoll.


# 1.23 15-Mar-2001 deraadt

bzzzt


# 1.22 15-Mar-2001 mjacob

Add in missing prototype for comspeedcomspeed.


# 1.21 15-Mar-2001 art

back out new timeouts until I find out why they break alpha.


# 1.20 15-Mar-2001 deraadt

support puc devices with higher speeds (not tested yet)


# 1.19 13-Mar-2001 mickey

new timeouts


# 1.18 24-Jan-2001 hugh

KGDB for i386 from NetBSD via niklas, with tweaks and accommodations.
Tested by various, vetted by mickey & theo.


# 1.17 08-Nov-2000 art

Add comcnattach that does the basic steps needed to attach
a com as a serial console. (idea from NetBSD).

If cn_tab->cn_dev == NODEV, try to find comopen in cdevsw and set cn_dev
to the right device.


Revision tags: OPENBSD_2_7_BASE OPENBSD_2_8_BASE SMP_BASE
# 1.16 04-Feb-2000 angelos

branches: 1.16.2;
Externalize comstop()


# 1.15 01-Feb-2000 mickey

missed in last com.c commit, sc_ic usage was replaced w/ ia_ic where needed; niklas@ ok


Revision tags: OPENBSD_2_6_BASE kame_19991208
# 1.14 08-Aug-1999 niklas

Detach support for com; NetBSD and me


# 1.13 26-Jul-1999 niklas

fix my last commit where I committed more than intended


# 1.12 26-Jul-1999 niklas

Remove obsolete detach code that has been dead for very long


Revision tags: OPENBSD_2_4_BASE OPENBSD_2_5_BASE
# 1.11 14-May-1998 downsj

* Better support for XR16C850.
* Copyright.


Revision tags: OPENBSD_2_3_BASE
# 1.10 23-Feb-1998 downsj

New probe routine and support for ST16650.

Compiles, but completely untested.


Revision tags: OPENBSD_2_2_BASE
# 1.9 07-Jul-1997 niklas

Removed an unused arg


Revision tags: OPENBSD_2_1_BASE
# 1.8 06-Mar-1997 tholo

Add control flag to call hardpps() on carrier change


# 1.7 29-Jan-1997 niklas

Export comdefaultrate


# 1.6 10-Dec-1996 deraadt

the real changes by niklas... I did not merge correctly


# 1.5 29-Nov-1996 niklas

Missing pieces of new bus.h that CVS lost behind my back


# 1.4 30-Oct-1996 niklas

cominit is used from the outside (the alpha port)


# 1.3 10-May-1996 deraadt

proto change


# 1.2 21-Apr-1996 deraadt

partial sync with netbsd 960418, more to come


# 1.1 19-Apr-1996 niklas

NetBSD 960317 merge