coreboot-kgpe-d16/src/mainboard/google/parrot/ec.c
Patrick Georgi a2fe7789e9 mainboard/google: Remove copyright notices
They're listed in AUTHORS and often incorrect anyway, for example:
- What's a "Copyright $year-present"?
- Which incarnation of Google (Inc, LLC, ...) is the current
  copyright holder?
- People sometimes have their editor auto-add themselves to files even
  though they only deleted stuff
- Or they let the editor automatically update the copyright year,
  because why not?
- Who is the copyright holder "The coreboot project Authors"?
- Or "Generated Code"?

Sidestep all these issues by simply not putting these notices in
individual files, let's list all copyright holders in AUTHORS instead
and use the git history to deal with the rest.

Change-Id: I09cc279b1f75952bb397de2c3f2b299255163685
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/39607
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
2020-03-18 16:44:31 +00:00

75 lines
1.9 KiB
C

/*
* This file is part of the coreboot project.
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <arch/acpi.h>
#include <types.h>
#include <console/console.h>
#include <device/device.h>
#include <ec/compal/ene932/ec.h>
#include "ec.h"
void parrot_ec_init(void)
{
printk(BIOS_DEBUG, "Parrot EC Init\n");
/* Clean up the buffers. We don't know the initial condition. */
kbc_cleanup_buffers();
/* Report EC info */
/* EC version: cmd 0x51 - returns three bytes */
ec_kbc_write_cmd(0x51);
printk(BIOS_DEBUG," EC version %x.%x.%x\n",
ec_kbc_read_ob(), ec_kbc_read_ob(), ec_kbc_read_ob());
/* EC Project name: cmd 0x52, 0xA0 - returns five bytes */
ec_kbc_write_cmd(0x52);
ec_kbc_write_ib(0xA0);
printk(BIOS_DEBUG," EC Project: %c%c%c%c%c\n",
ec_kbc_read_ob(),ec_kbc_read_ob(),ec_kbc_read_ob(),
ec_kbc_read_ob(), ec_kbc_read_ob());
/* Print the hardware revision */
printk(BIOS_DEBUG," Parrot Revision %x\n", parrot_rev());
/* US Keyboard */
ec_kbc_write_cmd(0x59);
ec_kbc_write_ib(0xE5);
/* Enable IRQ1 */
ec_kbc_write_cmd(0x59);
ec_kbc_write_ib(0xD1);
/* TODO - Do device detection and device maintain state (nvs) */
/* Enable Wireless and Bluetooth */
ec_kbc_write_cmd(0x45);
ec_kbc_write_ib(0xAD);
/* Set Wireless and Bluetooth Available */
ec_kbc_write_cmd(0x45);
ec_kbc_write_ib(0xA8);
/* Set Wireless and Bluetooth Enable */
ec_kbc_write_cmd(0x45);
ec_kbc_write_ib(0xA2);
}
/* Parrot Hardware Revision */
u8 parrot_rev(void)
{
ec_kbc_write_cmd(0x45);
ec_kbc_write_ib(0x40);
return ec_kbc_read_ob();
}