ata: move library code from ahci_platform.c to libahci_platform.c