USB: fsl_udc_core: prepare for SoCs with BE registers and descriptors

On some SoCs, the USB controller registers and descriptors can be big
or little endian, depending on the version of the chip. In order to be
able to run the same kernel binary on different versions of an SoC, the
BE/LE decision must be made at run time. Provide appropriate register
and descriptor accessors which are configurable at run time using the
configuration flags from fsl_usb2_platform_data data structure.

This is in preparation for adding support for MPC5121E DR USB2 Controller
to the FSL UDC driver.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
diff --git a/drivers/usb/gadget/fsl_usb2_udc.h b/drivers/usb/gadget/fsl_usb2_udc.h
index e88cce5..24efba9 100644
--- a/drivers/usb/gadget/fsl_usb2_udc.h
+++ b/drivers/usb/gadget/fsl_usb2_udc.h
@@ -461,6 +461,7 @@
 struct fsl_udc {
 	struct usb_gadget gadget;
 	struct usb_gadget_driver *driver;
+	struct fsl_usb2_platform_data *pdata;
 	struct completion *done;	/* to make sure release() is done */
 	struct fsl_ep *eps;
 	unsigned int max_ep;
@@ -473,6 +474,7 @@
 	unsigned vbus_active:1;
 	unsigned stopped:1;
 	unsigned remote_wakeup:1;
+	unsigned big_endian_desc:1;
 
 	struct ep_queue_head *ep_qh;	/* Endpoints Queue-Head */
 	struct fsl_req *status_req;	/* ep0 status request */