<p>Kevin Cody-Little has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/26224">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">superio/ite/it8623e: initialize the PWM fan controller<br><br>Copies the common/env_ctrl support code from the it8728f driver.<br><br>Tested on an ASUS AM1I-A using Linux. Prior to this change, an<br>error was given during boot:<br><br>it87 it87.656: Detected broken BIOS defaults, disabling PWM interface<br><br>After this change, the message is gone, and PWM fan control works<br>through the /sys/class/hwmon interface.<br><br>Change-Id: Id97c4ec19562e7c78308c5afe6ff7c938922c9e7<br>Signed-off-by: Kevin Cody-Little <kcodyjr@gmail.com><br>---<br>M src/superio/ite/it8623e/Kconfig<br>A src/superio/ite/it8623e/chip.h<br>M src/superio/ite/it8623e/superio.c<br>3 files changed, 39 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/26224/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/superio/ite/it8623e/Kconfig b/src/superio/ite/it8623e/Kconfig</span><br><span>index 1b4fe4a..274959e 100644</span><br><span>--- a/src/superio/ite/it8623e/Kconfig</span><br><span>+++ b/src/superio/ite/it8623e/Kconfig</span><br><span>@@ -4,6 +4,7 @@</span><br><span> ## Copyright (C) 2009 Ronald G. Minnich</span><br><span> ## Copyright (C) 2014 Edward O'Callaghan <eocallaghan@alterapraxis.com></span><br><span> ## Copyright (C) 2017 Gergely Kiss <mail.gery@gmail.com></span><br><span style="color: hsl(120, 100%, 40%);">+## Copyright (C) 2018 Kevin Cody-Little <kcodyjr@gmail.com></span><br><span> ##</span><br><span> ## This program is free software; you can redistribute it and/or modify</span><br><span> ## it under the terms of the GNU General Public License as published by</span><br><span>@@ -18,3 +19,7 @@</span><br><span> config SUPERIO_ITE_IT8623E</span><br><span>      bool</span><br><span>         select SUPERIO_ITE_COMMON_ROMSTAGE</span><br><span style="color: hsl(120, 100%, 40%);">+    select SUPERIO_ITE_ENV_CTRL</span><br><span style="color: hsl(120, 100%, 40%);">+   select SUPERIO_ITE_ENV_CTRL_PWM_FREQ2</span><br><span style="color: hsl(120, 100%, 40%);">+ select SUPERIO_ITE_ENV_CTRL_FAN16_CONFIG</span><br><span style="color: hsl(120, 100%, 40%);">+      select SUPERIO_ITE_ENV_CTRL_8BIT_PWM</span><br><span>diff --git a/src/superio/ite/it8623e/chip.h b/src/superio/ite/it8623e/chip.h</span><br><span>new file mode 100644</span><br><span>index 0000000..c92b451</span><br><span>--- /dev/null</span><br><span>+++ b/src/superio/ite/it8623e/chip.h</span><br><span>@@ -0,0 +1,26 @@</span><br><span style="color: hsl(120, 100%, 40%);">+/*</span><br><span style="color: hsl(120, 100%, 40%);">+ * This file is part of the coreboot project.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * Copyright (C) 2014 Edward O'Callaghan <eocallaghan@alterapraxis.com></span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This program is free software; you can redistribute it and/or modify</span><br><span style="color: hsl(120, 100%, 40%);">+ * it under the terms of the GNU General Public License as published by</span><br><span style="color: hsl(120, 100%, 40%);">+ * the Free Software Foundation; either version 2 of the License, or</span><br><span style="color: hsl(120, 100%, 40%);">+ * (at your option) any later version.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This program is distributed in the hope that it will be useful,</span><br><span style="color: hsl(120, 100%, 40%);">+ * but WITHOUT ANY WARRANTY; without even the implied warranty of</span><br><span style="color: hsl(120, 100%, 40%);">+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span><br><span style="color: hsl(120, 100%, 40%);">+ * GNU General Public License for more details.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#ifndef SUPERIO_ITE_IT8623E_CHIP_H</span><br><span style="color: hsl(120, 100%, 40%);">+#define SUPERIO_ITE_IT8623E_CHIP_H</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#include <superio/ite/common/env_ctrl_chip.h></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+struct superio_ite_it8623e_config {</span><br><span style="color: hsl(120, 100%, 40%);">+        struct ite_ec_config ec;</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#endif /* SUPERIO_ITE_IT8623E_CHIP_H */</span><br><span>diff --git a/src/superio/ite/it8623e/superio.c b/src/superio/ite/it8623e/superio.c</span><br><span>index e1ae503..a9cd4e5 100644</span><br><span>--- a/src/superio/ite/it8623e/superio.c</span><br><span>+++ b/src/superio/ite/it8623e/superio.c</span><br><span>@@ -22,17 +22,25 @@</span><br><span> #include <arch/io.h></span><br><span> #include <stdlib.h></span><br><span> #include <superio/conf_mode.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <superio/ite/common/env_ctrl.h></span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+#include "chip.h"</span><br><span> #include "it8623e.h"</span><br><span> </span><br><span> static void it8623e_init(struct device *dev)</span><br><span> {</span><br><span style="color: hsl(120, 100%, 40%);">+ const struct superio_ite_it8623e_config *conf = dev->chip_info;</span><br><span style="color: hsl(120, 100%, 40%);">+    const struct resource *res;</span><br><span> </span><br><span>      if (!dev->enabled)</span><br><span>                return;</span><br><span> </span><br><span>  switch (dev->path.pnp.device) {</span><br><span>   case IT8623E_EC:</span><br><span style="color: hsl(120, 100%, 40%);">+              res = find_resource(dev, PNP_IDX_IO0);</span><br><span style="color: hsl(120, 100%, 40%);">+                if (!conf || !res)</span><br><span style="color: hsl(120, 100%, 40%);">+                    break;</span><br><span style="color: hsl(120, 100%, 40%);">+                ite_ec_init(res->base, &conf->ec);</span><br><span>                 break;</span><br><span>       case IT8623E_KBCK:</span><br><span>           pc_keyboard_init(NO_AUX_DEVICE);</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/26224">change 26224</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/26224"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Id97c4ec19562e7c78308c5afe6ff7c938922c9e7 </div>
<div style="display:none"> Gerrit-Change-Number: 26224 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Kevin Cody-Little <kcodyjr@gmail.com> </div>