/* Given a TIOCE bus address, set the appropriate bit to indicate barrier attributes.  */
static u64 tioce_dma_barrier(u64 bus_addr, int on)
/* Given a TIOCE bus address, set the appropriate bit to indicate barrier attributes.  */
static u64 tioce_dma_barrier(u64 bus_addr, int on)
{
	u64 barrier_bit;
	if (TIOCE_M40_ADDR(bus_addr) || TIOCE_M40S_ADDR(bus_addr))
		return bus_addr;
	if (TIOCE_D64_ADDR(bus_addr))
		barrier_bit = (1UL << 62);
	else
		barrier_bit = (1UL << 30);
	return (on) ? (bus_addr | barrier_bit) : (bus_addr & ~barrier_bit);
}