HAOUAS Elyes has uploaded this change for review.

View Change

mb/ibase/mb899: Reformat code

Change-Id: Ic8c131b8dc6308ed813820f67477d157ccea5b05
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
---
M src/mainboard/ibase/mb899/early_init.c
M src/mainboard/ibase/mb899/mainboard.c
M src/mainboard/ibase/mb899/superio_hwm.c
3 files changed, 50 insertions(+), 37 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/27/38127/1
diff --git a/src/mainboard/ibase/mb899/early_init.c b/src/mainboard/ibase/mb899/early_init.c
index fd96f66..997cf04 100644
--- a/src/mainboard/ibase/mb899/early_init.c
+++ b/src/mainboard/ibase/mb899/early_init.c
@@ -14,12 +14,12 @@
*/

#include <bootblock_common.h>
-#include <stdint.h>
-#include <device/pnp_ops.h>
#include <cpu/x86/lapic.h>
#include <device/pnp_def.h>
+#include <device/pnp_ops.h>
#include <northbridge/intel/i945/i945.h>
#include <southbridge/intel/i82801gx/i82801gx.h>
+#include <stdint.h>
#include <superio/winbond/common/winbond.h>
#include <superio/winbond/w83627ehg/w83627ehg.h>

@@ -65,7 +65,7 @@
pnp_set_enable(dev, 0);
pnp_set_iobase(dev, PNP_IDX_IO0, 0x60);
pnp_set_iobase(dev, PNP_IDX_IO1, 0x64);
- //pnp_write_config(dev, 0xf0, 0x82);
+ // pnp_write_config(dev, 0xf0, 0x82);
pnp_set_enable(dev, 1);

dev = PNP_DEV(0x4e, W83627EHG_GPIO2);
diff --git a/src/mainboard/ibase/mb899/mainboard.c b/src/mainboard/ibase/mb899/mainboard.c
index d4d05c3..ada5fa3 100644
--- a/src/mainboard/ibase/mb899/mainboard.c
+++ b/src/mainboard/ibase/mb899/mainboard.c
@@ -15,6 +15,7 @@

#include <device/device.h>
#include <drivers/intel/gma/int15.h>
+
#include "superio_hwm.h"

// mainboard_enable is executed as first thing after
@@ -22,7 +23,9 @@

static void mainboard_enable(struct device *dev)
{
- install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_DEFAULT, 3);
+ install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS,
+ GMA_INT15_PANEL_FIT_DEFAULT,
+ GMA_INT15_BOOT_DISPLAY_DEFAULT, 3);
hwm_setup();
}

diff --git a/src/mainboard/ibase/mb899/superio_hwm.c b/src/mainboard/ibase/mb899/superio_hwm.c
index 175c9a0..3bf3314 100644
--- a/src/mainboard/ibase/mb899/superio_hwm.c
+++ b/src/mainboard/ibase/mb899/superio_hwm.c
@@ -14,22 +14,22 @@
* GNU General Public License for more details.
*/

-#include <types.h>
#include <console/console.h>
#include <device/device.h>
#include <pc80/mc146818rtc.h>
#include <superio/hwm5_conf.h>
#include <superio/nuvoton/common/hwm.h>
+#include <types.h>

#include "superio_hwm.h"

/* Hardware Monitor */

-#define FAN_CRUISE_CONTROL_DISABLED 0
-#define FAN_CRUISE_CONTROL_SPEED 1
-#define FAN_CRUISE_CONTROL_THERMAL 2
+#define FAN_CRUISE_CONTROL_DISABLED 0
+#define FAN_CRUISE_CONTROL_SPEED 1
+#define FAN_CRUISE_CONTROL_THERMAL 2

-#define FAN_SPEED_5625 0
+#define FAN_SPEED_5625 0
//#define FAN_TEMPERATURE_30DEGC 0

#define HWM_BASE 0x290
@@ -42,11 +42,11 @@
// FANIN Target Speed Register
// FANIN = 337500 / RPM
struct fan_speed fan_speeds[] = {
- { 0x3c, 5625 }, { 0x41, 5192 }, { 0x47, 4753 }, { 0x4e, 4326 },
- { 0x56, 3924 }, { 0x5f, 3552 }, { 0x69, 3214 }, { 0x74, 2909 },
- { 0x80, 2636 }, { 0x8d, 2393 }, { 0x9b, 2177 }, { 0xaa, 1985 },
- { 0xba, 1814 }, { 0xcb, 1662 }, { 0xdd, 1527 }, { 0xf0, 1406 }
-};
+ {0x3c, 5625}, {0x41, 5192}, {0x47, 4753}, {0x4e, 4326},
+ {0x56, 3924}, {0x5f, 3552}, {0x69, 3214}, {0x74, 2909},
+ {0x80, 2636}, {0x8d, 2393}, {0x9b, 2177}, {0xaa, 1985},
+ {0xba, 1814}, {0xcb, 1662}, {0xdd, 1527}, {0xf0, 1406}
+ };

struct temperature {
u8 deg_celsius;
@@ -54,11 +54,11 @@
};

struct temperature temperatures[] = {
- { 30, 86 }, { 33, 91 }, { 36, 96 }, { 39, 102 },
- { 42, 107 }, { 45, 113 }, { 48, 118 }, { 51, 123 },
- { 54, 129 }, { 57, 134 }, { 60, 140 }, { 63, 145 },
- { 66, 150 }, { 69, 156 }, { 72, 161 }, { 75, 167 }
-};
+ {30, 86}, {33, 91}, {36, 96}, {39, 102},
+ {42, 107}, {45, 113}, {48, 118}, {51, 123},
+ {54, 129}, {57, 134}, {60, 140}, {63, 145},
+ {66, 150}, {69, 156}, {72, 161}, {75, 167}
+ };

void hwm_setup(void)
{
@@ -70,15 +70,15 @@
get_option(&cpufan_control, "cpufan_cruise_control");
cpufan_speed = FAN_SPEED_5625;
get_option(&cpufan_speed, "cpufan_speed");
- //cpufan_temperature = FAN_TEMPERATURE_30DEGC;
- //get_option(&cpufan_temperature, "cpufan_temperature");
+ // cpufan_temperature = FAN_TEMPERATURE_30DEGC;
+ // get_option(&cpufan_temperature, "cpufan_temperature");

sysfan_control = FAN_CRUISE_CONTROL_DISABLED;
get_option(&sysfan_control, "sysfan_cruise_control");
sysfan_speed = FAN_SPEED_5625;
get_option(&sysfan_speed, "sysfan_speed");
- //sysfan_temperature = FAN_TEMPERATURE_30DEGC;
- //get_option(&sysfan_temperature, "sysfan_temperature");
+ // sysfan_temperature = FAN_TEMPERATURE_30DEGC;
+ // get_option(&sysfan_temperature, "sysfan_temperature");

// pnp_write_hwm5_index(HWM_BASE, 0x31, 0x20); // AVCC high limit
// pnp_write_hwm5_index(HWM_BASE, 0x34, 0x06); // VIN2 low limit
@@ -99,12 +99,20 @@
// 01 FANOUT is Thermal Cruise Mode
// 10 FANOUT is Fan Speed Cruise Mode
switch (cpufan_control) {
- case FAN_CRUISE_CONTROL_SPEED: fan_config |= (2 << 4); break;
- case FAN_CRUISE_CONTROL_THERMAL: fan_config |= (1 << 4); break;
+ case FAN_CRUISE_CONTROL_SPEED:
+ fan_config |= (2 << 4);
+ break;
+ case FAN_CRUISE_CONTROL_THERMAL:
+ fan_config |= (1 << 4);
+ break;
}
switch (sysfan_control) {
- case FAN_CRUISE_CONTROL_SPEED: fan_config |= (2 << 2); break;
- case FAN_CRUISE_CONTROL_THERMAL: fan_config |= (1 << 2); break;
+ case FAN_CRUISE_CONTROL_SPEED:
+ fan_config |= (2 << 2);
+ break;
+ case FAN_CRUISE_CONTROL_THERMAL:
+ fan_config |= (1 << 2);
+ break;
}
// This register must be written first
pnp_write_hwm5_index(HWM_BASE, 0x04, fan_config);
@@ -112,13 +120,14 @@
switch (cpufan_control) {
case FAN_CRUISE_CONTROL_SPEED: /* CPUFANIN target speed */
printk(BIOS_DEBUG, "Fan Cruise Control setting CPU fan to %d RPM\n",
- fan_speeds[cpufan_speed].fan_speed);
+ fan_speeds[cpufan_speed].fan_speed);
pnp_write_hwm5_index(HWM_BASE, 0x06, fan_speeds[cpufan_speed].fan_in);
break;
case FAN_CRUISE_CONTROL_THERMAL: /* CPUFANIN target temperature */
- printk(BIOS_DEBUG, "Fan Cruise Control setting CPU fan to activation at %d deg C/%d deg F\n",
- temperatures[cpufan_temperature].deg_celsius,
- temperatures[cpufan_temperature].deg_fahrenheit);
+ printk(BIOS_DEBUG,
+ "Fan Cruise Control setting CPU fan to activation at %d deg C/%d deg F\n",
+ temperatures[cpufan_temperature].deg_celsius,
+ temperatures[cpufan_temperature].deg_fahrenheit);
pnp_write_hwm5_index(HWM_BASE, 0x06,
temperatures[cpufan_temperature].deg_celsius);
break;
@@ -127,15 +136,16 @@
switch (sysfan_control) {
case FAN_CRUISE_CONTROL_SPEED: /* SYSFANIN target speed */
printk(BIOS_DEBUG, "Fan Cruise Control setting system fan to %d RPM\n",
- fan_speeds[sysfan_speed].fan_speed);
+ fan_speeds[sysfan_speed].fan_speed);
pnp_write_hwm5_index(HWM_BASE, 0x05, fan_speeds[sysfan_speed].fan_in);
break;
case FAN_CRUISE_CONTROL_THERMAL: /* SYSFANIN target temperature */
- printk(BIOS_DEBUG, "Fan Cruise Control setting system fan to activation at %d deg C/%d deg F\n",
- temperatures[sysfan_temperature].deg_celsius,
- temperatures[sysfan_temperature].deg_fahrenheit);
- pnp_write_hwm5_index(HWM_BASE,
- 0x05, temperatures[sysfan_temperature].deg_celsius);
+ printk(BIOS_DEBUG,
+ "Fan Cruise Control setting system fan to activation at %d deg C/%d deg F\n",
+ temperatures[sysfan_temperature].deg_celsius,
+ temperatures[sysfan_temperature].deg_fahrenheit);
+ pnp_write_hwm5_index(HWM_BASE, 0x05,
+ temperatures[sysfan_temperature].deg_celsius);
break;
}


To view, visit change 38127. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ic8c131b8dc6308ed813820f67477d157ccea5b05
Gerrit-Change-Number: 38127
Gerrit-PatchSet: 1
Gerrit-Owner: HAOUAS Elyes <ehaouas@noos.fr>
Gerrit-MessageType: newchange