/* tegra_ahub_wait_for_space() - Wait for space in the FIFO */
static int tegra_ahub_wait_for_space(struct udevice *dev)
/* tegra_ahub_wait_for_space() - Wait for space in the FIFO */
static int tegra_ahub_wait_for_space(struct udevice *dev)
{
	int i = 100000;
	ulong start;
	while (i--) {
		if (!tegra_ahub_apbif_is_full(dev))
			return 0;
	}
	start = get_timer(0);
	while (tegra_ahub_apbif_is_full(dev)) {
		if (get_timer(start) > 100)
			return -ETIMEDOUT;
	}
	return 0;
}