[coreboot-gerrit] Change in coreboot[master]: superio/ite/it8623e: initialize the PWM fan controller

Kevin Cody-Little (Code Review) gerrit at coreboot.org
Fri May 11 03:38:29 CEST 2018


Kevin Cody-Little has uploaded this change for review. ( https://review.coreboot.org/26224


Change subject: superio/ite/it8623e: initialize the PWM fan controller
......................................................................

superio/ite/it8623e: initialize the PWM fan controller

Copies the common/env_ctrl support code from the it8728f driver.

Tested on an ASUS AM1I-A using Linux. Prior to this change, an
error was given during boot:

it87 it87.656: Detected broken BIOS defaults, disabling PWM interface

After this change, the message is gone, and PWM fan control works
through the /sys/class/hwmon interface.

Change-Id: Id97c4ec19562e7c78308c5afe6ff7c938922c9e7
Signed-off-by: Kevin Cody-Little <kcodyjr at gmail.com>
---
M src/superio/ite/it8623e/Kconfig
A src/superio/ite/it8623e/chip.h
M src/superio/ite/it8623e/superio.c
3 files changed, 39 insertions(+), 0 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/26224/1

diff --git a/src/superio/ite/it8623e/Kconfig b/src/superio/ite/it8623e/Kconfig
index 1b4fe4a..274959e 100644
--- a/src/superio/ite/it8623e/Kconfig
+++ b/src/superio/ite/it8623e/Kconfig
@@ -4,6 +4,7 @@
 ## Copyright (C) 2009 Ronald G. Minnich
 ## Copyright (C) 2014 Edward O'Callaghan <eocallaghan at alterapraxis.com>
 ## Copyright (C) 2017 Gergely Kiss <mail.gery at gmail.com>
+## Copyright (C) 2018 Kevin Cody-Little <kcodyjr at gmail.com>
 ##
 ## 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
@@ -18,3 +19,7 @@
 config SUPERIO_ITE_IT8623E
 	bool
 	select SUPERIO_ITE_COMMON_ROMSTAGE
+	select SUPERIO_ITE_ENV_CTRL
+	select SUPERIO_ITE_ENV_CTRL_PWM_FREQ2
+	select SUPERIO_ITE_ENV_CTRL_FAN16_CONFIG
+	select SUPERIO_ITE_ENV_CTRL_8BIT_PWM
diff --git a/src/superio/ite/it8623e/chip.h b/src/superio/ite/it8623e/chip.h
new file mode 100644
index 0000000..c92b451
--- /dev/null
+++ b/src/superio/ite/it8623e/chip.h
@@ -0,0 +1,26 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2014 Edward O'Callaghan <eocallaghan at alterapraxis.com>
+ *
+ * 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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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.
+ */
+
+#ifndef SUPERIO_ITE_IT8623E_CHIP_H
+#define SUPERIO_ITE_IT8623E_CHIP_H
+
+#include <superio/ite/common/env_ctrl_chip.h>
+
+struct superio_ite_it8623e_config {
+	struct ite_ec_config ec;
+};
+
+#endif /* SUPERIO_ITE_IT8623E_CHIP_H */
diff --git a/src/superio/ite/it8623e/superio.c b/src/superio/ite/it8623e/superio.c
index e1ae503..a9cd4e5 100644
--- a/src/superio/ite/it8623e/superio.c
+++ b/src/superio/ite/it8623e/superio.c
@@ -22,17 +22,25 @@
 #include <arch/io.h>
 #include <stdlib.h>
 #include <superio/conf_mode.h>
+#include <superio/ite/common/env_ctrl.h>
 
+#include "chip.h"
 #include "it8623e.h"
 
 static void it8623e_init(struct device *dev)
 {
+	const struct superio_ite_it8623e_config *conf = dev->chip_info;
+	const struct resource *res;
 
 	if (!dev->enabled)
 		return;
 
 	switch (dev->path.pnp.device) {
 	case IT8623E_EC:
+		res = find_resource(dev, PNP_IDX_IO0);
+		if (!conf || !res)
+			break;
+		ite_ec_init(res->base, &conf->ec);
 		break;
 	case IT8623E_KBCK:
 		pc_keyboard_init(NO_AUX_DEVICE);

-- 
To view, visit https://review.coreboot.org/26224
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id97c4ec19562e7c78308c5afe6ff7c938922c9e7
Gerrit-Change-Number: 26224
Gerrit-PatchSet: 1
Gerrit-Owner: Kevin Cody-Little <kcodyjr at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180511/54c370b7/attachment.html>


More information about the coreboot-gerrit mailing list