#include <pc80/isa-dma.h>
#include <bitops.h>
#include <arch/io.h>
+#include <arch/ioapic.h>
#include "sb700.h"
static void lpc_init(device_t dev)
pci_write_config32(sm_dev, 0x64, dword);
/* Initialize isa dma */
+#if CONFIG_SOUTHBRIDGE_AMD_SB700_SKIP_ISA_DMA_INIT
+ printk(BIOS_DEBUG, "Skipping isa_dma_init() to avoid getting stuck.\n");
+#else
isa_dma_init();
+#endif
/* Enable DMA transaction on the LPC bus */
byte = pci_read_config8(dev, 0x40);
byte = pci_read_config8(dev, 0x78);
byte &= ~(1 << 1);
pci_write_config8(dev, 0x78, byte);
-
}
static void sb700_lpc_read_resources(device_t dev)
IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
res = new_resource(dev, 3); /* IOAPIC */
- res->base = 0xfec00000;
+ res->base = IO_APIC_ADDR;
res->size = 0x00001000;
res->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
static void sb700_lpc_set_resources(struct device *dev)
{
struct resource *res;
- u8 byte;
pci_dev_set_resources(dev);
/* Specical case. SPI Base Address. The SpiRomEnable should be set. */
res = find_resource(dev, 0xA0);
pci_write_config32(dev, 0xA0, res->base | 1 << 1);
-
}
/**
* @brief Enable resources for children devices
*
- * @param dev the device whos children's resources are to be enabled
- *
- * This function is call by the global enable_resources() indirectly via the
- * device_operation::enable_resources() method of devices.
+ * @param dev the device whose children's resources are to be enabled
*
- * Indirect mutual recursion:
- * enable_childrens_resources() -> enable_resources()
- * enable_resources() -> device_operation::enable_resources()
- * device_operation::enable_resources() -> enable_children_resources()
*/
static void sb700_lpc_enable_childrens_resources(device_t dev)
{
- u32 link;
+ struct bus *link;
u32 reg, reg_x;
- int i;
int var_num = 0;
u16 reg_var[3];
reg = pci_read_config32(dev, 0x44);
reg_x = pci_read_config32(dev, 0x48);
- for (link = 0; link < dev->links; link++) {
+ for (link = dev->link_list; link; link = link->next) {
device_t child;
- for (child = dev->link[link].children; child;
+ for (child = link->children; child;
child = child->sibling) {
- enable_resources(child);
if (child->enabled
&& (child->path.type == DEVICE_PATH_PNP)) {
- for (i = 0; i < child->resources; i++) {
- struct resource *res;
+ struct resource *res;
+ for (res = child->resource_list; res; res = res->next) {
u32 base, end; /* don't need long long */
- res = &child->resource[i];
if (!(res->flags & IORESOURCE_IO))
continue;
base = res->base;
end = resource_end(res);
- printk_debug
- ("sb700 lpc decode:%s, base=0x%08x, end=0x%08x\n",
+ printk(BIOS_DEBUG, "sb700 lpc decode:%s, base=0x%08x, end=0x%08x\n",
dev_path(child), base, end);
switch (base) {
case 0x60: /* KB */