Files
system76-coreboot/src/superio/smsc/sio1007/early_serial.c
Patrick Georgi 6b5bc77c9b treewide: Remove "this file is part of" lines
Stefan thinks they don't add value.

Command used:
sed -i -e '/file is part of /d' $(git grep "file is part of " |egrep ":( */\*.*\*/\$|#|;#|-- | *\* )" | cut -d: -f1 |grep -v crossgcc |grep -v gcov | grep -v /elf.h |grep -v nvramtool)

The exceptions are for:
 - crossgcc (patch file)
 - gcov (imported from gcc)
 - elf.h (imported from GNU's libc)
 - nvramtool (more complicated header)

The removed lines are:
-       fmt.Fprintln(f, "/* This file is part of the coreboot project. */")
-# This file is part of a set of unofficial pre-commit hooks available
-/* This file is part of coreboot */
-# This file is part of msrtool.
-/* This file is part of msrtool. */
- * This file is part of ncurses, designed to be appended after curses.h.in
-/* This file is part of pgtblgen. */
- * This file is part of the coreboot project.
- /* This file is part of the coreboot project. */
-#  This file is part of the coreboot project.
-# This file is part of the coreboot project.
-## This file is part of the coreboot project.
--- This file is part of the coreboot project.
-/* This file is part of the coreboot project */
-/* This file is part of the coreboot project. */
-;## This file is part of the coreboot project.
-# This file is part of the coreboot project. It originated in the
- * This file is part of the coreinfo project.
-## This file is part of the coreinfo project.
- * This file is part of the depthcharge project.
-/* This file is part of the depthcharge project. */
-/* This file is part of the ectool project. */
- * This file is part of the GNU C Library.
- * This file is part of the libpayload project.
-## This file is part of the libpayload project.
-/* This file is part of the Linux kernel. */
-## This file is part of the superiotool project.
-/* This file is part of the superiotool project */
-/* This file is part of uio_usbdebug */

Change-Id: I82d872b3b337388c93d5f5bf704e9ee9e53ab3a9
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/41194
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-05-11 17:11:40 +00:00

46 lines
1.0 KiB
C

/* SPDX-License-Identifier: GPL-2.0-only */
#include <stdint.h>
#include <arch/io.h>
#include "sio1007.h"
void sio1007_setreg(u16 lpc_port, u8 reg, u8 value, u8 mask)
{
u8 reg_value;
outb(reg, lpc_port);
reg_value = inb(lpc_port + 1);
reg_value &= ~mask;
reg_value |= (value & mask);
outb(reg_value, lpc_port + 1);
}
int sio1007_enable_uart_at(u16 port)
{
/* Enable config mode. */
outb(0x55, port);
if (inb(port) != 0x55)
return 0; /* There is no LPC device at this address. */
/* Registers 12 and 13 hold config address, look for a match. */
outb(0x12, port);
if (inb(port + 1) != (port & 0xff))
return 0;
outb(0x13, port);
if (inb(port + 1) != (port >> 8))
return 0;
/* This must be the sio1007, enable the UART. */
/* turn on power */
sio1007_setreg(port, 0x2, 1 << 3, 1 << 3);
/* enable high speed */
sio1007_setreg(port, 0xc, 1 << 6, 1 << 6);
/* set the base address */
sio1007_setreg(port, 0x24, CONFIG_TTYS0_BASE >> 2, 0xff);
/* Disable config mode. */
outb(0xaa, port);
return 1;
}