
CHAPTER 5 APPLICATION EXAMPLES
Application Note U17121EJ1V1AN
78
///////////////////////////////////////
// ATA Control Register Base Address //
///////////////////////////////////////
ConfigAddress = 0x40000014;
// bit 31-11 : IDSEL specification = 010000000000000000000b
// Select PCI device connected to AD30
// bit 10-08 : Function number = 00b
// bit 07-02 : Register number = 5 (000101b),
// -> ATA Control Register Base Address
// (In the case of PCI-IDE ASIC board used in this application)
// bit 01-00 : 00b (fixed)
PCI_ConfigWrite(ConfigAddress, 0x0C800008);
//////////////////////////////////////////////
// Bus Master Control Register Base Address //
//////////////////////////////////////////////
ConfigAddress = 0x40000018;
// bit 31-11 : IDSEL specification = 010000000000000000000b
// Select PCI device connected to AD30
// bit 10-08 : Function number = 00b
// bit 07-02 : Register number = 6 (000110b)
// -> Bus Master Control Register Base Address
// (In the case of PCI-IDE ASIC board used in this application)
// bit 01-00 : 00b (fixed)
PCI_ConfigWrite(ConfigAddress, 0x0C800010);
return;
}
/////////////////////////////////////////////////////////////////
// Function name: main //
// Function: Sets base address of configuration space. //
// Argument: None //
// Return value: 0: Normal end //
/////////////////////////////////////////////////////////////////
int main(void)
{
// Initializes PCI Host Bridge Macro.
PCI_HBM_Init();
// Sets base address of configuration space.
PCI_Config_BaseAddressInit();
return 0;
}