coreboot-kgpe-d16/src/ec/hp/kbc1126/early_init.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

96 lines
1.9 KiB
C

/* SPDX-License-Identifier: GPL-2.0-only */
#include <arch/io.h>
#include <device/pnp_ops.h>
#include <device/pnp.h>
#include "ec.h"
void kbc1126_enter_conf(void)
{
outb(0x55, 0x2e);
outb(0x22, 0x2e);
outb(0x00, 0x2f);
outb(0x23, 0x2e);
outb(0x00, 0x2f);
outb(0x24, 0x2e);
outb(0x84, 0x2f);
}
void kbc1126_exit_conf(void)
{
outb(0xaa, 0x2e);
/* one more time in PlatformStage1 of vendor firmware */
outb(0xaa, 0x2e);
outb(0x83, 0x200);
outb(0x00, 0x201);
inb(0x201);
}
void kbc1126_mailbox_init(void)
{
pnp_devfn_t dev = PNP_DEV(0x2e, KBC1100_MAILBOX);
pnp_set_logical_device(dev);
pnp_set_iobase(dev, PNP_IDX_IO0, 0x200);
pnp_set_enable(dev, 1);
}
void kbc1126_kbc_init(void)
{
pnp_devfn_t dev = PNP_DEV(0x2e, KBC1100_KBC);
pnp_set_logical_device(dev);
pnp_set_irq(dev, PNP_IDX_IRQ0, 0x1);
pnp_set_irq(dev, PNP_IDX_IRQ1, 0xc);
pnp_set_enable(dev, 1);
}
void kbc1126_ec_init(void)
{
pnp_devfn_t dev = PNP_DEV(0x2e, KBC1100_EC0);
pnp_set_logical_device(dev);
pnp_set_iobase(dev, PNP_IDX_IO0, 0x62);
pnp_set_enable(dev, 1);
}
void kbc1126_com1_init(void)
{
pnp_devfn_t dev = PNP_DEV(0x2e, SMSCSUPERIO_SP1);
pnp_set_logical_device(dev);
pnp_set_iobase(dev, PNP_IDX_IO0, 0x280);
pnp_set_irq(dev, PNP_IDX_IRQ0, 0x6);
pnp_set_enable(dev, 1);
}
void kbc1126_pm1_init(void)
{
pnp_devfn_t dev = PNP_DEV(0x2e, KBC1100_PM1);
pnp_set_logical_device(dev);
pnp_set_iobase(dev, PNP_IDX_IO0, 0x220);
pnp_set_enable(dev, 1);
}
/*
* This code is found in PEI module F65354B9-1FF0-46D7-A5F7-0926CB238048
* of the OEM firmware.
*
* For mainboards without a Super I/O at 0x4e, without this code, superiotool
* will detect an Infineon Super I/O at 0x4e.
*/
void kbc1126_disable4e(void)
{
outb(0x55, 0x4e);
outb(0x26, 0x4e);
outb(0x00, 0x4f);
outb(0x27, 0x4e);
outb(0xfe, 0x4f);
outb(0x60, 0x4e);
outb(0xfe, 0x4f);
outb(0x61, 0x4e);
outb(0x80, 0x4f);
outb(0x30, 0x4e);
outb(0x01, 0x4f);
outb(0xaa, 0x4e);
}