/* Given the source and destination available bus masks, select which will be routed to each port. We try to have source and destination on separate ports, but always respect the allowable settings.  */
static u32 pl08x_select_bus(u8 src, u8 dst)
/* Given the source and destination available bus masks, select which will be routed to each port. We try to have source and destination on separate ports, but always respect the allowable settings.  */
static u32 pl08x_select_bus(u8 src, u8 dst)
{
	u32 cctl = 0;
	if (!(dst & PL08X_AHB1) || ((dst & PL08X_AHB2) && (src & PL08X_AHB1)))
		cctl |= PL080_CONTROL_DST_AHB2;
	if (!(src & PL08X_AHB1) || ((src & PL08X_AHB2) && !(dst & PL08X_AHB2)))
		cctl |= PL080_CONTROL_SRC_AHB2;
	return cctl;
}