diff --git a/drivers/ieee1394log.c b/drivers/ieee1394log.c index 31d4fe4..4f89aea 100644 --- a/drivers/ieee1394log.c +++ b/drivers/ieee1394log.c @@ -41,6 +41,8 @@ enum ieee1394_regs { IEEE1394_REG_ASY_XMIT_RETRY = 0x8, IEEE1394_REG_BUSOPT = 0x20, + IEEE1394_REG_CONF_ROM_HDR = 0x18, + IEEE1394_REG_HC_CTRL_SET = 0x50, IEEE1394_REG_HC_CTRL_CLR = 0x54, @@ -165,6 +167,9 @@ ieee1394_reset (struct ieee1394 *ctx) /* Wait here to ensure reset completion. */ ieee1394_usleep (50 * 1000); + /* Set configuration rom header */ + ieee1394_write (ctx, IEEE1394_REG_CONF_ROM_HDR, 0x04 << 24); + /* Enable posted write and physical layer. */ ieee1394_write (ctx, IEEE1394_REG_HC_CTRL_SET, 0x40000); ieee1394_write (ctx, IEEE1394_REG_LINK_CTRL_SET, 0x400); @@ -204,6 +209,9 @@ ieee1394_reset (struct ieee1394 *ctx) ieee1394_write_phy (ctx, 8, status & ~1); } + /* Initiate bus reset. */ + ieee1394_write_phy (ctx, 1, 0x40); + /* Wait for bus reset to finish. */ for (i = 0; i < RETRY_COUNT / 3; i++) { ieee1394_usleep (200 * 1000); @@ -261,6 +269,14 @@ ieee1394log_new (struct pci_device *pci_device) printf ("IEEE1394 found. Occupy it for debug.\n"); + /* Enable device */ + u16 command; + int offset = PCI_CONFIG_COMMAND; + pci_handle_default_config_read (pci_device, sizeof(u16), offset, (union mem*)&command); + command |= PCI_CONFIG_COMMAND_MEMENABLE; + command |= PCI_CONFIG_COMMAND_BUSMASTER; + pci_handle_default_config_write (pci_device, sizeof(u16), offset, (union mem*)&command); + ctx = alloc (sizeof *ctx); ASSERT (ctx); diff --git a/drivers/pci.h b/drivers/pci.h index 9dfb24d..1972233 100644 --- a/drivers/pci.h +++ b/drivers/pci.h @@ -117,6 +117,7 @@ struct pci_config_space { #define PCI_CONFIG_COMMAND_IOENABLE 0x1 #define PCI_CONFIG_COMMAND_MEMENABLE 0x2 +#define PCI_CONFIG_COMMAND_BUSMASTER 0x4 struct pci_config_mmio_data; struct token;