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
This commit is contained in:
parent
edabf54da9
commit
50270b822f
|
@ -19,3 +19,4 @@
|
||||||
|
|
||||||
smm-$(CONFIG_HAVE_SMI_HANDLER) += mainboard_smi.c dock.c
|
smm-$(CONFIG_HAVE_SMI_HANDLER) += mainboard_smi.c dock.c
|
||||||
romstage-y += dock.c
|
romstage-y += dock.c
|
||||||
|
ramstage-y += dock.c
|
||||||
|
|
|
@ -156,7 +156,7 @@ chip northbridge/intel/i945
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
device pci 1f.1 off # IDE
|
device pci 1f.1 on # IDE
|
||||||
subsystemid 0x17aa 0x200c
|
subsystemid 0x17aa 0x200c
|
||||||
end
|
end
|
||||||
device pci 1f.2 on # SATA
|
device pci 1f.2 on # SATA
|
||||||
|
|
|
@ -247,3 +247,8 @@ int dock_present(void)
|
||||||
{
|
{
|
||||||
return !((inb(DEFAULT_GPIOBASE + 0x0c) >> 13) & 1);
|
return !((inb(DEFAULT_GPIOBASE + 0x0c) >> 13) & 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int dock_ultrabay_device_present(void)
|
||||||
|
{
|
||||||
|
return inb(0x1621) & 0x02 ? 0 : 1;
|
||||||
|
}
|
||||||
|
|
|
@ -5,4 +5,5 @@ extern int dock_connect(void);
|
||||||
extern void dock_disconnect(void);
|
extern void dock_disconnect(void);
|
||||||
extern int dock_present(void);
|
extern int dock_present(void);
|
||||||
extern int dlpc_init(void);
|
extern int dlpc_init(void);
|
||||||
|
extern int dock_ultrabay_device_present(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -34,10 +34,11 @@
|
||||||
#include <ec/acpi/ec.h>
|
#include <ec/acpi/ec.h>
|
||||||
#include <ec/lenovo/h8/h8.h>
|
#include <ec/lenovo/h8/h8.h>
|
||||||
#include <northbridge/intel/i945/i945.h>
|
#include <northbridge/intel/i945/i945.h>
|
||||||
|
#include "dock.h"
|
||||||
|
|
||||||
static void mainboard_enable(device_t dev)
|
static void mainboard_enable(device_t dev)
|
||||||
{
|
{
|
||||||
device_t dev0;
|
device_t dev0, idedev;
|
||||||
|
|
||||||
/* enable Audio */
|
/* enable Audio */
|
||||||
h8_set_audio_mute(0);
|
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));
|
dev0 = dev_find_slot(0, PCI_DEVFN(0,0));
|
||||||
if (dev0 && pci_read_config32(dev0, SKPAD) == 0xcafed00d)
|
if (dev0 && pci_read_config32(dev0, SKPAD) == 0xcafed00d)
|
||||||
ec_write(0x0c, 0xc7);
|
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 = {
|
struct chip_operations mainboard_ops = {
|
||||||
|
|
Loading…
Reference in New Issue