summaryrefslogtreecommitdiff
path: root/src/mainboard/lenovo/x60/mainboard.c
diff options
context:
space:
mode:
authorSven Schnelle <svens@stackframe.org>2011-04-27 19:48:05 +0000
committerSven Schnelle <svens@stackframe.org>2011-04-27 19:48:05 +0000
commit50270b822fcfe0e58deb18210001a92661e52401 (patch)
tree546df70b781c0980857b0a3fc6238feefe33dd1c /src/mainboard/lenovo/x60/mainboard.c
parentedabf54da9abd4b5d7d37606595b4a97553897b8 (diff)
downloadcoreboot-50270b822fcfe0e58deb18210001a92661e52401.tar.xz
X60: enable Ultrabay if device is plugged in
Signed-off-by: Sven Schnelle <svens@stackframe.org> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6548 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/mainboard/lenovo/x60/mainboard.c')
-rw-r--r--src/mainboard/lenovo/x60/mainboard.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/mainboard/lenovo/x60/mainboard.c b/src/mainboard/lenovo/x60/mainboard.c
index b9416b5c20..f7bcb61f63 100644
--- a/src/mainboard/lenovo/x60/mainboard.c
+++ b/src/mainboard/lenovo/x60/mainboard.c
@@ -34,10 +34,11 @@
#include <ec/acpi/ec.h>
#include <ec/lenovo/h8/h8.h>
#include <northbridge/intel/i945/i945.h>
+#include "dock.h"
static void mainboard_enable(device_t dev)
{
- device_t dev0;
+ device_t dev0, idedev;
/* enable Audio */
h8_set_audio_mute(0);
@@ -46,6 +47,19 @@ static void mainboard_enable(device_t dev)
dev0 = dev_find_slot(0, PCI_DEVFN(0,0));
if (dev0 && pci_read_config32(dev0, SKPAD) == 0xcafed00d)
ec_write(0x0c, 0xc7);
+
+ idedev = dev_find_slot(0, PCI_DEVFN(0x1f,1));
+ if (idedev && idedev->chip_info && dock_ultrabay_device_present()) {
+ struct southbridge_intel_i82801gx_config *config = idedev->chip_info;
+ config->ide_enable_primary = 1;
+ /* enable Ultrabay power */
+ outb(inb(0x1628) | 0x01, 0x1628);
+ ec_write(0x0c, 0x84);
+ } else {
+ /* disable Ultrabay power */
+ outb(inb(0x1628) & ~0x01, 0x1628);
+ ec_write(0x0c, 0x04);
+ }
}
struct chip_operations mainboard_ops = {