// SPDX-License-Identifier: GPL-2.0 /* * Driver for the 98626/98644/internal serial interface on hp300/hp400 * (based on the National Semiconductor INS8250/NS16550AF/WD16C552 UARTs) * * Ported from 2.2 and modified to use the normal 8250 driver * by Kars de Jong <jongk@linux-m68k.org>, May 2004.
*/ #include <linux/module.h> #include <linux/init.h> #include <linux/string.h> #include <linux/kernel.h> #include <linux/serial.h> #include <linux/serial_8250.h> #include <linux/delay.h> #include <linux/dio.h> #include <linux/console.h> #include <linux/slab.h> #include <asm/io.h>
#include"8250.h"
#if !defined(CONFIG_HPDCA) && !defined(CONFIG_HPAPCI) && !defined(CONFIG_COMPILE_TEST) #warning CONFIG_SERIAL_8250 defined but neither CONFIG_HPDCA nor CONFIG_HPAPCI defined, are you sure? #endif
#ifdef CONFIG_HPAPCI struct hp300_port { struct hp300_port *next; /* next port */ int line; /* line (tty) number */
};
/* Base address of the Frodo part */ #define FRODO_BASE (0x41c000)
/* * Where we find the 8250-like APCI ports, and how far apart they are.
*/ #define FRODO_APCIBASE 0x0 #define FRODO_APCISPACE 0x20 #define FRODO_APCI_OFFSET(x) (FRODO_APCIBASE + ((x) * FRODO_APCISPACE))
#define HPAPCI_BAUD_BASE 500400
#ifdef CONFIG_SERIAL_8250_CONSOLE /* * Parse the bootinfo to find descriptions for headless console and * debug serial ports and register them with the 8250 driver.
*/ int __init hp300_setup_serial_console(void)
{ int scode; struct uart_port port;
memset(&port, 0, sizeof(port));
if (hp300_uart_scode < 0 || hp300_uart_scode > DIO_SCMAX) return 0;
if (DIO_ID(pa + DIO_VIRADDRBASE) & 0x80)
add_preferred_console("ttyS", port.line, "9600n8"); #else
pr_warn("Serial console is DCA but support is disabled (CONFIG_HPDCA)!\n"); return 0; #endif
}
staticint __init hp300_8250_init(void)
{ staticint called; #ifdef CONFIG_HPAPCI int line; unsignedlong base; struct uart_8250_port uart; struct hp300_port *port; int i; #endif if (called) return -ENODEV;
called = 1;
if (!MACH_IS_HP300) return -ENODEV;
#ifdef CONFIG_HPDCA
dio_register_driver(&hpdca_driver); #endif #ifdef CONFIG_HPAPCI if (hp300_model < HP_400) { if (!num_ports) return -ENODEV; return 0;
} /* These models have the Frodo chip. * Port 0 is reserved for the Apollo Domain keyboard. * Port 1 is either the console or the DCA.
*/ for (i = 1; i < 4; i++) { /* Port 1 is the console on a 425e, on other machines it's * mapped to DCA.
*/ #ifdef CONFIG_SERIAL_8250_CONSOLE if (i == 1) continue; #endif
/* Create new serial device */
port = kmalloc(sizeof(struct hp300_port), GFP_KERNEL); if (!port) return -ENOMEM;
module_init(hp300_8250_init);
module_exit(hp300_8250_exit);
MODULE_DESCRIPTION("HP DCA/APCI serial driver");
MODULE_AUTHOR("Kars de Jong ");
MODULE_LICENSE("GPL");
Messung V0.5
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.