1/*- 2 * Copyright (c) 1998 Michael Smith (msmith@freebsd.org) 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 10 unchanged lines hidden (view full) --- 19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 * SUCH DAMAGE. 24 */ 25 26#include <sys/cdefs.h> |
27__FBSDID("$FreeBSD: stable/10/sys/boot/pc98/libpc98/comconsole.c 261573 2014-02-07 04:09:15Z mav $"); |
28 29#include <stand.h> 30#include <bootstrap.h> 31#include <machine/cpufunc.h> 32#include <dev/ic/ns16550.h> 33#include <dev/pci/pcireg.h> 34#include "libi386.h" 35 --- 140 unchanged lines hidden (view full) --- 176{ 177 int speed; 178 179 if (value == NULL || (speed = comc_parseint(value)) <= 0) { 180 printf("Invalid speed\n"); 181 return (CMD_ERROR); 182 } 183 |
184 if (comc_curspeed != speed) |
185 comc_setup(speed, comc_port); 186 187 env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); 188 189 return (CMD_OK); 190} 191 192static int 193comc_port_set(struct env_var *ev, int flags, const void *value) 194{ 195 int port; 196 197 if (value == NULL || (port = comc_parseint(value)) <= 0) { 198 printf("Invalid port\n"); 199 return (CMD_ERROR); 200 } 201 |
202 if (comc_port != port) |
203 comc_setup(comc_curspeed, port); 204 205 env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); 206 207 return (CMD_OK); 208} 209 210/* --- 91 unchanged lines hidden (view full) --- 302{ 303 static int TRY_COUNT = 1000000; 304 char intbuf[64]; 305 int tries; 306 307 unsetenv("hw.uart.console"); 308 comc_curspeed = speed; 309 comc_port = port; |
310 if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) == 0) 311 return; |
312 313 outb(comc_port + com_cfcr, CFCR_DLAB | COMC_FMT); 314 outb(comc_port + com_dlbl, COMC_BPS(speed) & 0xff); 315 outb(comc_port + com_dlbh, COMC_BPS(speed) >> 8); 316 outb(comc_port + com_cfcr, COMC_FMT); 317 outb(comc_port + com_mcr, MCR_RTS | MCR_DTR); 318 319 tries = 0; --- 48 unchanged lines hidden --- |