All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuo-Jung Su <dantesu@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 10/12] usb: gadget: add Faraday FOTG210 USB gadget support
Date: Thu, 18 Apr 2013 17:25:37 +0800	[thread overview]
Message-ID: <1366277139-29728-11-git-send-email-dantesu@gmail.com> (raw)
In-Reply-To: <1366277139-29728-1-git-send-email-dantesu@gmail.com>

From: Kuo-Jung Su <dantesu@faraday-tech.com>

The Faraday FOTG210 is an OTG chip which could operate
as either an EHCI Host or a USB Device as a time.

Signed-off-by: Kuo-Jung Su <dantesu@faraday-tech.com>
CC: Marek Vasut <marex@denx.de>
---
 drivers/usb/gadget/Makefile       |    1 +
 drivers/usb/gadget/fotg210.c      |  922 +++++++++++++++++++++++++++++++++++++
 drivers/usb/gadget/gadget_chips.h |    8 +
 3 files changed, 931 insertions(+)
 create mode 100644 drivers/usb/gadget/fotg210.c

diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
index e545b6b..432cf17 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -35,6 +35,7 @@ endif
 # new USB gadget layer dependencies
 ifdef CONFIG_USB_GADGET
 COBJS-$(CONFIG_USB_GADGET_S3C_UDC_OTG) += s3c_udc_otg.o
+COBJS-$(CONFIG_USB_GADGET_FOTG210) += fotg210.o
 COBJS-$(CONFIG_USBDOWNLOAD_GADGET) += g_dnl.o
 COBJS-$(CONFIG_DFU_FUNCTION) += f_dfu.o
 endif
diff --git a/drivers/usb/gadget/fotg210.c b/drivers/usb/gadget/fotg210.c
new file mode 100644
index 0000000..d662387
--- /dev/null
+++ b/drivers/usb/gadget/fotg210.c
@@ -0,0 +1,922 @@
+/*
+ * Faraday USB 2.0 OTG Controller
+ *
+ * (C) Copyright 2010 Faraday Technology
+ * Dante Su <dantesu@faraday-tech.com>
+ *
+ * This file is released under the terms of GPL v2 and any later version.
+ * See the file COPYING in the root directory of the source tree for details.
+ */
+
+#include <common.h>
+#include <command.h>
+#include <config.h>
+#include <net.h>
+#include <malloc.h>
+#include <asm/io.h>
+#include <asm/errno.h>
+#include <linux/types.h>
+#include <linux/usb/ch9.h>
+#include <linux/usb/gadget.h>
+
+#include <usb/fotg210.h>
+
+#define CFG_NUM_ENDPOINTS		4
+#define CFG_EP0_MAX_PACKET_SIZE	64
+#define CFG_EPX_MAX_PACKET_SIZE	512
+
+struct fotg210_chip;
+
+struct fotg210_ep {
+	struct usb_ep ep;
+
+	uint32_t maxpacket:16;
+	uint32_t id:4;
+	uint32_t stopped:1;
+	uint32_t rsvd:11;
+
+	struct list_head                      queue;
+	struct fotg210_chip                  *chip;
+	const struct usb_endpoint_descriptor *desc;
+};
+
+struct fotg210_request {
+	struct usb_request req;
+	struct list_head   queue;
+	struct fotg210_ep *ep;
+};
+
+struct fotg210_chip {
+	struct usb_gadget         gadget;
+	struct usb_gadget_driver *driver;
+	struct fotg210_regs      *iobase;
+	uint8_t                   irq;
+	uint16_t                  addr;
+	int                       pullup;
+	enum usb_device_state     state;
+	struct fotg210_ep         ep[1 + CFG_NUM_ENDPOINTS];
+};
+
+#define USB_READ(r)			le32_to_cpu(readl(r))
+#define USB_WRITE(v, r)		writel(cpu_to_le32(v), r)
+#define USB_SETBITS(m, r)	setbits_le32(r, m)
+#define USB_CLRBITS(m, r)	clrbits_le32(r, m)
+
+static struct usb_endpoint_descriptor ep0_desc = {
+	.bLength = sizeof(struct usb_endpoint_descriptor),
+	.bDescriptorType  = USB_DT_ENDPOINT,
+	.bEndpointAddress = USB_DIR_IN,
+	.bmAttributes =    USB_ENDPOINT_XFER_CONTROL,
+};
+
+static inline int
+fifo_to_ep(struct fotg210_chip *chip, int id, int in)
+{
+	return (id < 0) ? 0 : ((id % 4) + 1);
+}
+
+static inline int
+ep_to_fifo(struct fotg210_chip *chip, int id)
+{
+	return (id <= 0) ? -1 : ((id - 1) % 4);
+}
+
+static inline int
+ep_reset(struct fotg210_chip *chip, uint8_t ep_addr)
+{
+	int ep = ep_addr & USB_ENDPOINT_NUMBER_MASK;
+	struct fotg210_regs *regs = chip->iobase;
+
+	if (ep_addr & USB_DIR_IN) {
+		/* reset endpoint */
+		USB_SETBITS(BIT_MASK(12), &regs->iep[ep - 1]);
+		mdelay(1);
+		USB_CLRBITS(BIT_MASK(12), &regs->iep[ep - 1]);
+		/* clear endpoint stall */
+		USB_CLRBITS(BIT_MASK(11), &regs->iep[ep - 1]);
+	} else {
+		/* reset endpoint */
+		USB_SETBITS(BIT_MASK(12), &regs->oep[ep - 1]);
+		mdelay(1);
+		USB_CLRBITS(BIT_MASK(12), &regs->oep[ep - 1]);
+		/* clear endpoint stall */
+		USB_CLRBITS(BIT_MASK(11), &regs->oep[ep - 1]);
+	}
+
+	return 0;
+}
+
+static int fotg210_reset(struct fotg210_chip *chip)
+{
+	struct fotg210_regs *regs = chip->iobase;
+	uint32_t i;
+
+	chip->state = USB_STATE_POWERED;
+
+	/* chip enable */
+	USB_WRITE(BIT_MASK(5), &regs->dev_ctrl);
+
+	/* device address reset */
+	chip->addr = 0;
+	USB_WRITE(chip->addr, &regs->dev_addr);
+
+	/* set idle counter to 7ms */
+	USB_WRITE(7, &regs->idle);
+
+	/* disable interrupts */
+	USB_WRITE(0x0f, &regs->imr);
+	USB_WRITE(0x07, &regs->gimr);
+	USB_WRITE(0x3f, &regs->gimr0);
+	USB_WRITE(0xf00ff, &regs->gimr1);
+	USB_WRITE(0x7ff, &regs->gimr2);
+
+	/* clear interrupts */
+	USB_WRITE(0x07, &regs->isr);
+	USB_WRITE(0x00, &regs->gisr);
+	USB_WRITE(0x00, &regs->gisr0);
+	USB_WRITE(0x00, &regs->gisr1);
+	USB_WRITE(0x00, &regs->gisr2);
+
+	/* chip reset */
+	USB_SETBITS(BIT_MASK(4), &regs->dev_ctrl);
+	while (USB_READ(&regs->dev_ctrl) & BIT_MASK(4))
+		;
+
+	/* CX FIFO reset */
+	USB_SETBITS(BIT_MASK(3), &regs->cxfifo);
+	while (USB_READ(&regs->cxfifo) & BIT_MASK(3))
+		;
+
+	/* create static ep-fifo map (EP1-FIFO0, EP2-FIFO1 ...)*/
+	USB_WRITE(0x33221100, &regs->epmap14);
+	USB_WRITE(0x00000000, &regs->epmap58);
+	USB_WRITE(0x04030201, &regs->fifomap);
+	USB_WRITE(0x00000000, &regs->fifocfg);
+	for (i = 0; i < 8; ++i) {
+		USB_WRITE(CFG_EPX_MAX_PACKET_SIZE, &regs->iep[i]);
+		USB_WRITE(CFG_EPX_MAX_PACKET_SIZE, &regs->oep[i]);
+	}
+
+	/* FIFO reset */
+	for (i = 0; i < 4; ++i) {
+		USB_WRITE(BIT_MASK(12), &regs->fifocsr[i]);
+		while (USB_READ(&regs->fifocsr[i]) & BIT_MASK(12))
+			;
+	}
+
+	/* enable only device interrupt, interrupt=level,high active */
+	USB_WRITE(0x0e, &regs->imr);
+	USB_WRITE(0x07, &regs->isr);
+
+	/* disable EP0 IN/OUT interrupt */
+	USB_WRITE(0x06, &regs->gimr0);
+	/* disable EPX IN+SPK+OUT interrupts */
+	USB_WRITE(0xf00ff, &regs->gimr1);
+	/* disable wakeup+idle+dma+zlp interrupts */
+	USB_WRITE(0x7e0, &regs->gimr2);
+	/* enable all group interrupt */
+	USB_WRITE(0x00, &regs->gimr);
+
+	/* suspend delay = 3 ms */
+	USB_WRITE(3, &regs->idle);
+
+	/* turn-on device interrupts */
+	USB_SETBITS(BIT_MASK(2), &regs->dev_ctrl);
+
+	return 0;
+}
+
+static int fotg210_dma(struct fotg210_ep *ep, struct fotg210_request *req)
+{
+	struct fotg210_chip *chip = ep->chip;
+	struct fotg210_regs *regs = chip->iobase;
+	uint32_t tmp, ts;
+	uint8_t *buf  = req->req.buf + req->req.actual;
+	uint32_t len  = req->req.length - req->req.actual;
+	uint32_t fifo = ep_to_fifo(chip, ep->id);
+	int ret = -EBUSY;
+
+	/* 1. init dma buffer */
+	if (len > ep->maxpacket)
+		len = ep->maxpacket;
+
+	/* 2. wait for dma ready (hardware) */
+	for (ts = get_timer(0); get_timer(ts) < 100; ) {
+		if (!(USB_READ(&regs->dma_ctrl) & 0x01)) {
+			ret = 0;
+			break;
+		}
+	}
+	if (ret) {
+		printf("fotg210: dma busy\n");
+		req->req.status = ret;
+		return ret;
+	}
+
+	/* 3. DMA target setup */
+#ifndef CONFIG_SYS_DCACHE_OFF
+	if (ep->desc->bEndpointAddress & USB_DIR_IN)
+		flush_dcache_range((uint32_t)buf, (uint32_t)buf + len);
+	else
+		invalidate_dcache_range((uint32_t)buf, (uint32_t)buf + len);
+#endif
+	USB_WRITE(virt_to_phys(buf), &regs->dma_addr);
+
+	if (ep->desc->bEndpointAddress & USB_DIR_IN) {
+		if (ep->id == 0) {
+			/* Wait until fifo empty */
+			while (!(USB_READ(&regs->cxfifo) & 0x20))
+				;
+			USB_WRITE(BIT_MASK(4), &regs->dma_fifo);
+		} else {
+			/* Wait until fifo empty */
+			while (!(USB_READ(&regs->cxfifo) & (1 << (8 + fifo))))
+				;
+			USB_WRITE(1 << fifo, &regs->dma_fifo);
+		}
+		USB_WRITE((len << 8) | BIT_MASK(1), &regs->dma_ctrl);
+	} else {
+		uint32_t blen;
+		if (ep->id == 0) {
+			USB_WRITE(0x10, &regs->dma_fifo);
+			do {
+				blen = (USB_READ(&regs->cxfifo) >> 24) & 0x7f;
+			} while (blen < len);
+		} else {
+			USB_WRITE(1 << fifo, &regs->dma_fifo);
+			blen = USB_READ(&regs->fifocsr[fifo]) & 0x7ff;
+		}
+		len  = (len < blen) ? len : blen;
+		USB_WRITE(len << 8, &regs->dma_ctrl);
+	}
+
+	/* 4. DMA start */
+	USB_SETBITS(BIT_MASK(0), &regs->dma_ctrl);
+
+	/* 5. DMA wait */
+	ret = -EBUSY;
+	for (ts = get_timer(0); get_timer(ts) < 100; ) {
+		tmp = USB_READ(&regs->gisr2);
+		/* DMA complete */
+		if (tmp & 0x80) {
+			ret = 0;
+			break;
+		}
+		/* DMA error */
+		if (tmp & 0x100) {
+			printf("fotg210: dma error\n");
+			break;
+		}
+		/* resume, suspend, reset */
+		if (tmp & 0x07) {
+			printf("fotg210: dma reset by host\n");
+			break;
+		}
+	}
+
+	/* 7. DMA target reset */
+	if (ret)
+		USB_WRITE(BIT_MASK(4) | BIT_MASK(3), &regs->dma_ctrl);
+
+	USB_WRITE(0, &regs->gisr2);
+	USB_WRITE(0, &regs->dma_fifo);
+
+	req->req.status = ret;
+	if (!ret)
+		req->req.actual += len;
+	else
+		printf("fotg210: ep%d dma error(code=%d)\n", ep->id, ret);
+
+	return len;
+}
+
+/*
+ * result of setup packet
+ */
+#define CX_IDLE		0
+#define CX_FINISH	1
+#define CX_STALL	2
+
+static void fotg210_setup(struct fotg210_chip *chip)
+{
+	int id, ret = CX_IDLE;
+	uint32_t tmp[2];
+	struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)tmp;
+	struct fotg210_regs *regs = chip->iobase;
+
+	/*
+	 * If this is the first Cx 8 byte command,
+	 * we can now query USB mode (high/full speed; USB 2.0/USB 1.0)
+	 */
+	if (chip->state == USB_STATE_POWERED) {
+		chip->state = USB_STATE_DEFAULT;
+		if (USB_READ(&regs->otgcsr) & BIT_MASK(21)) {
+			/* Mini-B */
+			if (USB_READ(&regs->dev_ctrl) & BIT_MASK(6)) {
+				puts("fotg210: HS\n");
+				chip->gadget.speed = USB_SPEED_HIGH;
+				USB_WRITE(0x044c, &regs->sof_mtr);
+			} else {
+				puts("fotg210: FS\n");
+				chip->gadget.speed = USB_SPEED_FULL;
+				USB_WRITE(0x2710, &regs->sof_mtr);
+			}
+		} else {
+			printf("fotg210: mini-A?\n");
+		}
+	}
+
+	/* switch data port to ep0 */
+	USB_WRITE(0x10, &regs->dma_fifo);
+	/* fetch 8 bytes setup packet */
+	tmp[0] = USB_READ(&regs->dma_data);
+	tmp[1] = USB_READ(&regs->dma_data);
+	/* release data port */
+	USB_WRITE(0x00, &regs->dma_fifo);
+
+	if (req->bRequestType & USB_DIR_IN)
+		ep0_desc.bEndpointAddress = USB_DIR_IN;
+	else
+		ep0_desc.bEndpointAddress = USB_DIR_OUT;
+
+	ret = CX_IDLE;
+
+	if ((req->bRequestType & USB_TYPE_MASK) == USB_TYPE_STANDARD) {
+		switch (req->bRequest) {
+		case USB_REQ_SET_CONFIGURATION:
+			debug("fotg210: set_cfg(%d)\n", req->wValue & 0x00FF);
+			if (!(req->wValue & 0x00FF)) {
+				chip->state = USB_STATE_ADDRESS;
+				USB_WRITE(chip->addr, &regs->dev_addr);
+			} else {
+				chip->state = USB_STATE_CONFIGURED;
+				USB_WRITE(chip->addr | BIT_MASK(7),
+					&regs->dev_addr);
+			}
+			ret = CX_IDLE;
+			break;
+
+		case USB_REQ_SET_ADDRESS:
+			debug("fotg210: set_addr(0x%04X)\n", req->wValue);
+			chip->state = USB_STATE_ADDRESS;
+			chip->addr  = req->wValue;
+			ret = CX_FINISH;
+			USB_WRITE(chip->addr, &regs->dev_addr);
+			break;
+
+		case USB_REQ_CLEAR_FEATURE:
+			debug("fotg210: clr_feature(%d, %d)\n",
+				req->bRequestType & 0x03, req->wValue);
+			switch (req->wValue) {
+			case 0:    /* [Endpoint] halt */
+				ep_reset(chip, req->wIndex);
+				ret = CX_FINISH;
+				break;
+			case 1:    /* [Device] remote wake-up */
+			case 2:    /* [Device] test mode */
+			default:
+				ret = CX_STALL;
+				break;
+			}
+			break;
+
+		case USB_REQ_SET_FEATURE:
+			debug("fotg210: set_feature(%d, %d)\n",
+				req->wValue, req->wIndex & 0xf);
+			switch (req->wValue) {
+			case 0:    /* Endpoint Halt */
+				id = req->wIndex & 0xf;
+				USB_SETBITS(BIT_MASK(11), &regs->iep[id - 1]);
+				USB_SETBITS(BIT_MASK(11), &regs->oep[id - 1]);
+				ret = CX_FINISH;
+				break;
+			case 1:    /* Remote Wakeup */
+			case 2:    /* Test Mode */
+			default:
+				ret = CX_STALL;
+				break;
+			}
+			break;
+
+		case USB_REQ_GET_STATUS:
+			debug("fotg210: get_status\n");
+			ret = CX_STALL;
+			break;
+
+		case USB_REQ_SET_DESCRIPTOR:
+			debug("fotg210: set_descriptor\n");
+			ret = CX_STALL;
+			break;
+
+		case USB_REQ_SYNCH_FRAME:
+			debug("fotg210: sync frame\n");
+			ret = CX_STALL;
+			break;
+		}
+	}    /* if ((req->bRequestType & USB_TYPE_MASK) == USB_TYPE_STANDARD) */
+
+	if (ret == CX_IDLE && chip->driver->setup) {
+		if (chip->driver->setup(&chip->gadget, req) < 0)
+			ret = CX_STALL;
+		else
+			ret = CX_FINISH;
+	}
+
+	switch (ret) {
+	case CX_FINISH:
+		USB_SETBITS(BIT_MASK(0), &regs->cxfifo);
+		break;
+
+	case CX_STALL:
+		USB_SETBITS(BIT_MASK(2) | BIT_MASK(0), &regs->cxfifo);
+		printf("fotg210: cx_stall!\n");
+		break;
+
+	case CX_IDLE:
+		debug("fotg210: cx_idle?\n");
+	default:
+		break;
+	}
+}
+
+/*
+ * fifo - FIFO id
+ * zlp  - zero length packet
+ */
+static void fotg210_recv(struct fotg210_chip *chip, int ep_id)
+{
+	struct fotg210_regs *regs = chip->iobase;
+	struct fotg210_ep *ep = chip->ep + ep_id;
+	struct fotg210_request *req;
+	int len;
+
+	if (ep->stopped || (ep->desc->bEndpointAddress & USB_DIR_IN)) {
+		printf("fotg210: ep%d recv, invalid!\n", ep->id);
+		return;
+	}
+
+	if (list_empty(&ep->queue)) {
+		printf("fotg210: ep%d recv, drop!\n", ep->id);
+		return;
+	}
+
+	req = list_first_entry(&ep->queue, struct fotg210_request, queue);
+	len = fotg210_dma(ep, req);
+	if (len < ep->ep.maxpacket || req->req.length <= req->req.actual) {
+		list_del_init(&req->queue);
+		if (req->req.complete)
+			req->req.complete(&ep->ep, &req->req);
+	}
+
+	if (ep->id > 0 && list_empty(&ep->queue))
+		USB_SETBITS(3 << (ep_to_fifo(chip, ep->id) * 2), &regs->gimr1);
+}
+
+/*
+ * USB Gadget Layer
+ */
+static int fotg210_ep_enable(
+	struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc)
+{
+	struct fotg210_ep *ep = container_of(_ep, struct fotg210_ep, ep);
+	struct fotg210_chip *chip = ep->chip;
+	struct fotg210_regs *regs = chip->iobase;
+	int id = ep_to_fifo(chip, ep->id);
+	int in = (desc->bEndpointAddress & USB_DIR_IN) ? 1 : 0;
+
+	if (!_ep || !desc
+		|| desc->bDescriptorType != USB_DT_ENDPOINT
+		|| le16_to_cpu(desc->wMaxPacketSize) == 0) {
+		printf("fotg210: bad ep or descriptor\n");
+		return -EINVAL;
+	}
+
+	ep->desc = desc;
+	ep->stopped = 0;
+
+	if (in)
+		USB_SETBITS(0x10 << (8 * id), &regs->fifomap);
+
+	switch (desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) {
+	case USB_ENDPOINT_XFER_CONTROL:
+		return -EINVAL;
+
+	case USB_ENDPOINT_XFER_ISOC:
+		USB_SETBITS(0x21 << (8 * id), &regs->fifocfg);
+		break;
+
+	case USB_ENDPOINT_XFER_BULK:
+		USB_SETBITS(0x22 << (8 * id), &regs->fifocfg);
+		break;
+
+	case USB_ENDPOINT_XFER_INT:
+		USB_SETBITS(0x23 << (8 * id), &regs->fifocfg);
+		break;
+	}
+
+	return 0;
+}
+
+static int fotg210_ep_disable(struct usb_ep *_ep)
+{
+	struct fotg210_ep *ep = container_of(_ep, struct fotg210_ep, ep);
+	struct fotg210_chip *chip = ep->chip;
+	struct fotg210_regs *regs = chip->iobase;
+	int id = ep_to_fifo(chip, ep->id);
+
+	ep->desc = NULL;
+	ep->stopped = 1;
+
+	USB_CLRBITS(0x23 << (8 * id), &regs->fifocfg);
+	USB_CLRBITS(0x30 << (8 * id), &regs->fifomap);
+
+	return 0;
+}
+
+static struct usb_request *fotg210_ep_alloc_request(
+	struct usb_ep *_ep, gfp_t gfp_flags)
+{
+	struct fotg210_request *req = malloc(sizeof(*req));
+	if (req) {
+		memset(req, 0, sizeof(*req));
+		INIT_LIST_HEAD(&req->queue);
+	}
+	return &req->req;
+}
+
+static void fotg210_ep_free_request(
+	struct usb_ep *_ep, struct usb_request *_req)
+{
+	struct fotg210_request *req;
+	req = container_of(_req, struct fotg210_request, req);
+	free(req);
+}
+
+static int fotg210_ep_queue(
+	struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags)
+{
+	struct fotg210_ep *ep = container_of(_ep, struct fotg210_ep, ep);
+	struct fotg210_chip *chip = ep->chip;
+	struct fotg210_regs *regs = chip->iobase;
+	struct fotg210_request *req;
+
+	req = container_of(_req, struct fotg210_request, req);
+	if (!_req || !_req->complete || !_req->buf
+		|| !list_empty(&req->queue)) {
+		printf("fotg210: invalid request to ep%d\n", ep->id);
+		return -EINVAL;
+	}
+
+	if (!chip || chip->state == USB_STATE_SUSPENDED) {
+		printf("fotg210: request while chip suspended\n");
+		return -EINVAL;
+	}
+
+	req->req.actual = 0;
+	req->req.status = -EINPROGRESS;
+
+	if (req->req.length == 0) {
+		req->req.status = 0;
+		if (req->req.complete)
+			req->req.complete(&ep->ep, &req->req);
+		return 0;
+	}
+
+	if (ep->id == 0) {
+		do {
+			int len = fotg210_dma(ep, req);
+			if (len < ep->ep.maxpacket)
+				break;
+			if (ep->desc->bEndpointAddress & USB_DIR_IN)
+				udelay(100);
+		} while (req->req.length > req->req.actual);
+	} else {
+		if (ep->desc->bEndpointAddress & USB_DIR_IN) {
+			do {
+				int len = fotg210_dma(ep, req);
+				if (len < ep->ep.maxpacket)
+					break;
+			} while (req->req.length > req->req.actual);
+		} else {
+			list_add_tail(&req->queue, &ep->queue);
+			USB_CLRBITS(3 << (ep_to_fifo(chip, ep->id) * 2),
+				&regs->gimr1);
+		}
+	}
+
+	if (ep->id == 0 || (ep->desc->bEndpointAddress & USB_DIR_IN)) {
+		if (req->req.complete)
+			req->req.complete(&ep->ep, &req->req);
+	}
+
+	return 0;
+}
+
+static int fotg210_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req)
+{
+	struct fotg210_ep *ep = container_of(_ep, struct fotg210_ep, ep);
+	struct fotg210_request *req;
+
+	/* make sure it's actually queued on this endpoint */
+	list_for_each_entry(req, &ep->queue, queue) {
+		if (&req->req == _req)
+			break;
+	}
+	if (&req->req != _req)
+		return -EINVAL;
+
+	/* remove the request */
+	list_del_init(&req->queue);
+
+	/* update status & invoke complete callback */
+	if (req->req.status == -EINPROGRESS) {
+		req->req.status = -ECONNRESET;
+		if (req->req.complete)
+			req->req.complete(_ep, &req->req);
+	}
+
+	return 0;
+}
+
+static int fotg210_ep_halt(struct usb_ep *_ep, int halt)
+{
+	struct fotg210_ep *ep = container_of(_ep, struct fotg210_ep, ep);
+	struct fotg210_chip *chip = ep->chip;
+	struct fotg210_regs *regs = chip->iobase;
+	int ret = -1;
+
+	debug("fotg210: ep%d halt=%d\n", ep->id, halt);
+
+	/* Endpoint STALL */
+	if (ep->id > 0 && ep->id <= CFG_NUM_ENDPOINTS) {
+		if (halt) {
+			/* wait until fifo empty */
+			while ((USB_READ(&regs->cxfifo) & 0xf00) != 0xf00)
+				;
+			/* stall */
+			if (ep->desc->bEndpointAddress & USB_DIR_IN) {
+				USB_SETBITS(BIT_MASK(11),
+					regs->iep[ep->id - 1]);
+			} else {
+				USB_SETBITS(BIT_MASK(11),
+					regs->oep[ep->id - 1]);
+			}
+		} else {
+			if (ep->desc->bEndpointAddress & USB_DIR_IN) {
+				USB_CLRBITS(BIT_MASK(11),
+					regs->iep[ep->id - 1]);
+			} else {
+				USB_CLRBITS(BIT_MASK(11),
+					regs->oep[ep->id - 1]);
+			}
+		}
+		ret = 0;
+	}
+
+	return ret;
+}
+
+/*
+ * activate/deactivate link with host.
+ */
+static void pullup(struct fotg210_chip *chip, int is_on)
+{
+	struct fotg210_regs *regs = chip->iobase;
+	if (is_on) {
+		if (!chip->pullup) {
+			chip->state = USB_STATE_POWERED;
+			chip->pullup = 1;
+			/* enable the chip */
+			USB_SETBITS(BIT_MASK(5), &regs->dev_ctrl);
+			/* clear unplug bit (BIT0) */
+			USB_CLRBITS(BIT_MASK(0), &regs->phy_tmsr);
+		}
+	} else {
+		chip->state = USB_STATE_NOTATTACHED;
+		chip->pullup = 0;
+		chip->addr = 0;
+		USB_WRITE(chip->addr, &regs->dev_addr);
+		/* set unplug bit (BIT0) */
+		USB_SETBITS(BIT_MASK(0), &regs->phy_tmsr);
+		/* disable the chip */
+		USB_CLRBITS(BIT_MASK(5), &regs->dev_ctrl);
+	}
+}
+
+static int fotg210_pullup(struct usb_gadget *_gadget, int is_on)
+{
+	struct fotg210_chip *chip;
+
+	chip = container_of(_gadget, struct fotg210_chip, gadget);
+
+	debug("fotg210: pullup=%d\n", is_on);
+
+	pullup(chip, is_on);
+
+	return 0;
+}
+
+static int fotg210_get_frame(struct usb_gadget *_gadget)
+{
+	struct fotg210_chip *chip;
+	struct fotg210_regs *regs;
+
+	chip = container_of(_gadget, struct fotg210_chip, gadget);
+	regs = chip->iobase;
+
+	return USB_READ(&regs->sof_fnr) & 0x7ff;
+}
+
+static struct usb_gadget_ops fotg210_gadget_ops = {
+	.get_frame = fotg210_get_frame,
+	.pullup = fotg210_pullup,
+};
+
+static struct usb_ep_ops fotg210_ep_ops = {
+	.enable         = fotg210_ep_enable,
+	.disable        = fotg210_ep_disable,
+	.queue          = fotg210_ep_queue,
+	.dequeue        = fotg210_ep_dequeue,
+	.set_halt       = fotg210_ep_halt,
+	.alloc_request  = fotg210_ep_alloc_request,
+	.free_request   = fotg210_ep_free_request,
+};
+
+static struct fotg210_chip controller = {
+	.iobase = (void *)CONFIG_FOTG210_BASE,
+	.gadget = {
+		.name = "fotg210_udc",
+		.ops = &fotg210_gadget_ops,
+		.ep0 = &controller.ep[0].ep,
+		.speed = USB_SPEED_UNKNOWN,
+		.is_dualspeed = 1,
+		.is_otg = 0,
+		.is_a_peripheral = 0,
+		.b_hnp_enable = 0,
+		.a_hnp_support = 0,
+		.a_alt_hnp_support = 0,
+	},
+	.ep[0] = {
+		.id = 0,
+		.ep = {
+			.name    = "ep0",
+			.ops    = &fotg210_ep_ops,
+		},
+		.desc       = &ep0_desc,
+		.chip        = &controller,
+		.maxpacket    = CFG_EP0_MAX_PACKET_SIZE,
+	},
+	.ep[1] = {
+		.id = 1,
+		.ep = {
+			.name    = "ep1",
+			.ops    = &fotg210_ep_ops,
+		},
+		.chip        = &controller,
+		.maxpacket    = CFG_EPX_MAX_PACKET_SIZE,
+	},
+	.ep[2] = {
+		.id = 2,
+		.ep = {
+			.name    = "ep2",
+			.ops    = &fotg210_ep_ops,
+		},
+		.chip        = &controller,
+		.maxpacket    = CFG_EPX_MAX_PACKET_SIZE,
+	},
+	.ep[3] = {
+		.id = 3,
+		.ep = {
+			.name    = "ep3",
+			.ops    = &fotg210_ep_ops,
+		},
+		.chip        = &controller,
+		.maxpacket    = CFG_EPX_MAX_PACKET_SIZE,
+	},
+	.ep[4] = {
+		.id = 4,
+		.ep = {
+			.name    = "ep4",
+			.ops    = &fotg210_ep_ops,
+		},
+		.chip        = &controller,
+		.maxpacket    = CFG_EPX_MAX_PACKET_SIZE,
+	},
+};
+
+int usb_gadget_handle_interrupts(void)
+{
+	struct fotg210_chip *chip = &controller;
+	struct fotg210_regs *regs = chip->iobase;
+	uint32_t isr, gisr;
+
+	isr  = USB_READ(&regs->isr) & (~USB_READ(&regs->imr));
+	gisr = USB_READ(&regs->gisr) & (~USB_READ(&regs->gimr));
+	if (!(isr & BIT_MASK(0)) || !gisr)
+		return 0;
+
+	USB_WRITE(BIT_MASK(0), &regs->isr);
+
+	/* CX interrupts */
+	if (gisr & BIT_MASK(0)) {
+		uint32_t st = USB_READ(&regs->gisr0);
+		USB_WRITE(0, &regs->gisr0);
+
+		if (st & BIT_MASK(4))
+			printf("fotg210: cmd error\n");
+
+		if (st & BIT_MASK(5))
+			printf("fotg210: cmd abort\n");
+
+		if (st & BIT_MASK(0))            /* setup */
+			fotg210_setup(chip);
+		else if (st & BIT_MASK(3))        /* command finish */
+			USB_SETBITS(BIT_MASK(0), &regs->cxfifo);
+	}
+
+	/* FIFO interrupts */
+	if (gisr & BIT_MASK(1)) {
+		uint32_t id;
+		uint32_t st = USB_READ(&regs->gisr1);
+		for (id = 0; id < 4; ++id) {
+			if (st & (3 << (id * 2)))
+				fotg210_recv(chip, fifo_to_ep(chip, id, 0));
+		}
+	}
+
+	/* Device Status Interrupts */
+	if (gisr & BIT_MASK(2)) {
+		uint32_t st = USB_READ(&regs->gisr2);
+		USB_WRITE(0, &regs->gisr2);
+
+		if (st & BIT_MASK(0))
+			printf("fotg210: reset by host\n");
+		else if (st & BIT_MASK(1))
+			printf("fotg210: suspend/removed\n");
+		else if (st & BIT_MASK(2))
+			printf("fotg210: resume\n");
+
+		/* Errors */
+		if (st & BIT_MASK(3))
+			printf("fotg210: iso error\n");
+		if (st & BIT_MASK(4))
+			printf("fotg210: iso abort\n");
+		if (st & BIT_MASK(8))
+			printf("fotg210: dma error\n");
+	}
+
+	return 0;
+}
+
+int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+{
+	int i, ret = 0;
+	struct fotg210_chip *chip = &controller;
+
+	if (!driver    || !driver->bind || !driver->setup) {
+		puts("fotg210: bad parameter.\n");
+		return -EINVAL;
+	}
+
+	INIT_LIST_HEAD(&chip->gadget.ep_list);
+	for (i = 0; i < CFG_NUM_ENDPOINTS + 1; ++i) {
+		struct fotg210_ep *ep = chip->ep + i;
+
+		ep->ep.maxpacket = ep->maxpacket;
+		INIT_LIST_HEAD(&ep->queue);
+
+		if (ep->id == 0) {
+			ep->stopped = 0;
+		} else {
+			ep->stopped = 1;
+			list_add_tail(&ep->ep.ep_list, &chip->gadget.ep_list);
+		}
+	}
+
+	if (fotg210_reset(chip)) {
+		puts("fotg210: reset failed.\n");
+		return -EINVAL;
+	}
+
+	ret = driver->bind(&chip->gadget);
+	if (ret) {
+		debug("fotg210: driver->bind() returned %d\n", ret);
+		dcache_enable();
+		return ret;
+	}
+	chip->driver = driver;
+
+	return ret;
+}
+
+int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
+{
+	struct fotg210_chip *chip = &controller;
+
+	driver->unbind(&chip->gadget);
+	chip->driver = NULL;
+
+	pullup(chip, 0);
+
+	return 0;
+}
diff --git a/drivers/usb/gadget/gadget_chips.h b/drivers/usb/gadget/gadget_chips.h
index e570142..f038747 100644
--- a/drivers/usb/gadget/gadget_chips.h
+++ b/drivers/usb/gadget/gadget_chips.h
@@ -150,6 +150,12 @@
 #define gadget_is_mv(g)        0
 #endif

+#ifdef CONFIG_USB_GADGET_FOTG210
+#define gadget_is_fotg210(g)        (!strcmp("fotg210_udc", (g)->name))
+#else
+#define gadget_is_fotg210(g)        0
+#endif
+
 /*
  * CONFIG_USB_GADGET_SX2
  * CONFIG_USB_GADGET_AU1X00
@@ -215,5 +221,7 @@ static inline int usb_gadget_controller_number(struct usb_gadget *gadget)
 		return 0x20;
 	else if (gadget_is_mv(gadget))
 		return 0x21;
+	else if (gadget_is_fotg210(gadget))
+		return 0x22;
 	return -ENOENT;
 }
--
1.7.9.5

  parent reply	other threads:[~2013-04-18  9:25 UTC|newest]

Thread overview: 311+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-29  7:06 [U-Boot] [PATCH 00/11] arm: add Faraday A36x SoC platform support Kuo-Jung Su
2013-03-29  7:06 ` [U-Boot] [PATCH 01/11] arm: add MMU/d-cache support for Faraday cores Kuo-Jung Su
2013-04-18  9:25   ` [U-Boot] [PATCH v2 00/12] arm: add Faraday A36x SoC platform support Kuo-Jung Su
2013-04-18  9:25     ` [U-Boot] [PATCH v2 01/12] mtd: spi: winbond: add W25PXX support Kuo-Jung Su
2013-04-26  8:02       ` [U-Boot] [PATCH v3 00/11] arm: add Faraday A36x SoC platform support Kuo-Jung Su
2013-04-26  8:02         ` [U-Boot] [PATCH v3 01/11] arm: add MMU/D-Cache support for Faraday cores Kuo-Jung Su
2013-05-07  6:25           ` [U-Boot] [PATCH v4 0/7] arm: add Faraday A36x SoC platform support Kuo-Jung Su
2013-05-07  6:25             ` [U-Boot] [PATCH v4 1/7] arm: add MMU/D-Cache support for Faraday cores Kuo-Jung Su
2013-06-10 17:59               ` Albert ARIBAUD
2013-06-11  3:09                 ` Kuo-Jung Su
2013-06-11 15:28                   ` Albert ARIBAUD
2013-06-14  5:44                     ` Kuo-Jung Su
2013-05-07  6:25             ` [U-Boot] [PATCH v4 2/7] arm: add Faraday common utilities Kuo-Jung Su
2013-06-10 18:05               ` Albert ARIBAUD
2013-06-11  3:02                 ` Kuo-Jung Su
2013-05-07  6:25             ` [U-Boot] [PATCH v4 3/7] arm: add Faraday interrupt controller support Kuo-Jung Su
2013-05-07  6:25             ` [U-Boot] [PATCH v4 4/7] arm: add Faraday FTTMR010 timer support Kuo-Jung Su
2013-05-07  6:25             ` [U-Boot] [PATCH v4 5/7] arm: add Faraday FTPWMTMR010 " Kuo-Jung Su
2013-05-07  6:25             ` [U-Boot] [PATCH v4 6/7] arm: add Faraday firmware image utility Kuo-Jung Su
2013-06-10 18:38               ` Albert ARIBAUD
2013-06-11  3:00                 ` Kuo-Jung Su
2013-05-07  6:25             ` [U-Boot] [PATCH v4 7/7] arm: add Faraday A36x SoC platform support Kuo-Jung Su
2013-06-10 18:39               ` Albert ARIBAUD
2013-06-11  3:01                 ` Kuo-Jung Su
2013-04-26  8:02         ` [U-Boot] [PATCH v3 02/11] net: ftgmac100: add MMU/D-cache support Kuo-Jung Su
2013-05-07  6:33           ` [U-Boot] [PATCH v4] net: update FTGMAC100 for " Kuo-Jung Su
2013-07-08 16:21             ` Joe Hershberger
2013-04-26  8:02         ` [U-Boot] [PATCH v3 03/11] net: add Faraday FTMAC110 10/100Mbps ethernet support Kuo-Jung Su
2013-05-02 16:03           ` Tom Rini
2013-05-03  6:01             ` Kuo-Jung Su
2013-05-07  6:33           ` [U-Boot] [PATCH v4] " Kuo-Jung Su
2013-07-08 16:19             ` Joe Hershberger
2013-04-26  8:02         ` [U-Boot] [PATCH v3 04/11] i2c: add Faraday FTI2C010 I2C controller support Kuo-Jung Su
2013-04-29  3:34           ` Heiko Schocher
2013-05-07  6:32           ` [U-Boot] [PATCH v4 03/16] " Kuo-Jung Su
2013-05-07 13:19             ` Heiko Schocher
2013-05-08  1:51               ` Kuo-Jung Su
2013-05-08  4:30                 ` Heiko Schocher
2013-05-08  5:47                   ` Kuo-Jung Su
2013-05-08  7:36             ` [U-Boot] [PATCH v5] " Kuo-Jung Su
2013-04-26  8:02         ` [U-Boot] [PATCH v3 05/11] spi: add Faraday FTSPI010 SPI " Kuo-Jung Su
2013-05-07  6:34           ` [U-Boot] [PATCH v4] " Kuo-Jung Su
2013-06-12 18:56             ` [U-Boot] [U-Boot, " Jagan Teki
2013-06-14  6:00               ` Kuo-Jung Su
2013-11-22  7:44             ` [U-Boot] [PATCH v5] spi: ftssp010_spi: add Faraday " Kuo-Jung Su
2013-11-28  2:46             ` [U-Boot] [PATCH v6] " Kuo-Jung Su
2013-04-26  8:02         ` [U-Boot] [PATCH v3 06/11] mmc: update the Faraday FTSDC010 driver to fix performance issue Kuo-Jung Su
2013-05-03 22:35           ` Andy Fleming
2013-05-06  6:44             ` Kuo-Jung Su
2013-05-07  6:32           ` [U-Boot] [PATCH v4] mmc: update Faraday FTSDC010 for rw performance Kuo-Jung Su
2013-04-26  8:02         ` [U-Boot] [PATCH v3 07/11] mtd: nand: add Faraday FTNANDC021 NAND controller support Kuo-Jung Su
2013-04-26 23:41           ` Scott Wood
2013-04-29  3:28             ` Kuo-Jung Su
2013-04-29 20:46               ` Scott Wood
2013-04-30  1:33                 ` Kuo-Jung Su
2013-05-07  6:33           ` [U-Boot] [PATCH v4] " Kuo-Jung Su
2013-05-09  0:43             ` Scott Wood
2013-05-09  1:45               ` Kuo-Jung Su
2013-05-09  1:51             ` [U-Boot] [PATCH v5] " Kuo-Jung Su
2013-04-26  8:02         ` [U-Boot] [PATCH v3 08/11] usb: ehci: add Faraday USB 2.0 EHCI support Kuo-Jung Su
2013-04-26 12:19           ` Marek Vasut
2013-04-29  3:10             ` Kuo-Jung Su
2013-04-29 22:50               ` Marek Vasut
2013-04-30  1:32                 ` Kuo-Jung Su
2013-05-01 19:34                   ` Marek Vasut
2013-05-02  1:14                     ` Kuo-Jung Su
2013-05-07  6:26           ` [U-Boot] [PATCH v4 0/2] usb: ehci: add Faraday USB EHCI&Gadget support Kuo-Jung Su
2013-05-07  6:26             ` [U-Boot] [PATCH v4 1/2] usb: ehci: add Faraday USB 2.0 EHCI support Kuo-Jung Su
2013-05-07 21:42               ` Marek Vasut
2013-05-08  2:18                 ` Kuo-Jung Su
2013-05-08  3:09                   ` Marek Vasut
2013-05-08  5:41                     ` Kuo-Jung Su
2013-05-08 11:52                       ` Marek Vasut
2013-05-09  1:51                         ` Kuo-Jung Su
2013-05-09  3:20               ` [U-Boot] [PATCH v5 0/4] usb: add Faraday EHCI & Gadget support Kuo-Jung Su
2013-05-09  3:20                 ` [U-Boot] [PATCH v5 1/4] usb: hub: make minimum power-on delay configurable Kuo-Jung Su
2013-05-10 11:41                   ` Marek Vasut
2013-05-13  1:11                     ` Kuo-Jung Su
2013-05-13  2:07                   ` [U-Boot] [PATCH v6 0/4] usb: add Faraday EHCI & Gadget support Kuo-Jung Su
2013-05-13  2:07                     ` [U-Boot] [PATCH v6 1/4] usb: hub: make minimum power-on delay configurable Kuo-Jung Su
2013-05-13  2:36                       ` Marek Vasut
2013-05-13  8:12                         ` Kuo-Jung Su
2013-05-13  8:28                       ` [U-Boot] [PATCH v7 0/4] usb: add Faraday EHCI & Gadget support Kuo-Jung Su
2013-05-13  8:28                         ` [U-Boot] [PATCH v7 1/4] usb: hub: make minimum power-on delay configurable Kuo-Jung Su
2013-05-14  2:29                           ` [U-Boot] [PATCH v8 0/4] usb: add Faraday EHCI & Gadget support Kuo-Jung Su
2013-05-14  2:29                             ` [U-Boot] [PATCH v8 1/4] usb: hub: make minimum power-on delay configurable Kuo-Jung Su
2013-05-15  7:29                               ` [U-Boot] [PATCH v9 0/5] usb: add Faraday EHCI & Gadget support Kuo-Jung Su
2013-05-15  7:29                                 ` [U-Boot] [PATCH v9 1/5] usb: ehci: prevent bad PORTSC register access Kuo-Jung Su
2013-05-21 20:09                                   ` Marek Vasut
2013-05-15  7:29                                 ` [U-Boot] [PATCH v9 2/5] usb: ehci: add weak-aliased function for PORTSC Kuo-Jung Su
2013-05-15  7:29                                 ` [U-Boot] [PATCH v9 3/5] usb: hub: make minimum power-on delay configurable Kuo-Jung Su
2013-05-15  7:29                                 ` [U-Boot] [PATCH v9 4/5] usb: ehci: add Faraday USB 2.0 EHCI support Kuo-Jung Su
2013-05-15  7:29                                 ` [U-Boot] [PATCH v9 5/5] usb: gadget: add Faraday FOTG210 USB gadget support Kuo-Jung Su
2013-05-19 18:37                                   ` Marek Vasut
2013-05-20  0:56                                     ` Kuo-Jung Su
2013-05-14  2:29                             ` [U-Boot] [PATCH v8 2/4] usb: ehci: add weak-aliased function for PORTSC Kuo-Jung Su
2013-05-14  2:29                             ` [U-Boot] [PATCH v8 3/4] usb: ehci: add Faraday USB 2.0 EHCI support Kuo-Jung Su
2013-05-14  2:29                             ` [U-Boot] [PATCH v8 4/4] usb: gadget: add Faraday FOTG210 USB gadget support Kuo-Jung Su
2013-05-13  8:28                         ` [U-Boot] [PATCH v7 2/4] usb: ehci: add weak-aliased function for PORTSC Kuo-Jung Su
2013-05-13  8:28                         ` [U-Boot] [PATCH v7 3/4] usb: ehci: add Faraday USB 2.0 EHCI support Kuo-Jung Su
2013-05-13  8:28                         ` [U-Boot] [PATCH v7 4/4] usb: gadget: add Faraday FOTG210 USB gadget support Kuo-Jung Su
2013-05-13  2:07                     ` [U-Boot] [PATCH v6 2/4] usb: ehci: add weak-aliased functions to portsc & tdi Kuo-Jung Su
2013-05-13  2:32                       ` Marek Vasut
2013-05-13  8:09                         ` Kuo-Jung Su
2013-05-13 15:10                           ` Marek Vasut
2013-05-14  1:26                             ` Kuo-Jung Su
2013-05-14 13:47                               ` Marek Vasut
2013-05-15  1:03                                 ` Kuo-Jung Su
2013-05-15  2:42                                   ` Kuo-Jung Su
2013-05-15  3:29                                     ` Marek Vasut
2013-05-15  4:07                                       ` Kuo-Jung Su
2013-05-13  2:07                     ` [U-Boot] [PATCH v6 3/4] usb: ehci: add Faraday USB 2.0 EHCI support Kuo-Jung Su
2013-05-13  2:07                     ` [U-Boot] [PATCH v6 4/4] usb: gadget: add Faraday FOTG210 USB gadget support Kuo-Jung Su
2013-05-09  3:20                 ` [U-Boot] [PATCH v5 2/4] usb: ehci: add weak-aliased functions to portsc & tdi Kuo-Jung Su
2013-05-10 11:44                   ` Marek Vasut
2013-05-13  1:10                     ` Kuo-Jung Su
2013-05-09  3:20                 ` [U-Boot] [PATCH v5 3/4] usb: ehci: add Faraday USB 2.0 EHCI support Kuo-Jung Su
2013-05-09  3:20                 ` [U-Boot] [PATCH v5 4/4] usb: gadget: add Faraday FOTG210 USB gadget support Kuo-Jung Su
2013-05-07  6:26             ` [U-Boot] [PATCH v4 2/2] " Kuo-Jung Su
2013-05-07 21:37               ` Marek Vasut
2013-05-08  2:30                 ` Kuo-Jung Su
2013-05-08  3:07                   ` Marek Vasut
2013-04-26  8:02         ` [U-Boot] [PATCH v3 09/11] " Kuo-Jung Su
2013-04-26 12:21           ` Marek Vasut
2013-04-29  3:11             ` Kuo-Jung Su
2013-04-26  8:02         ` [U-Boot] [PATCH v3 10/11] video: add Faraday FTLCDC200 LCD controller support Kuo-Jung Su
2013-05-06 20:18           ` Anatolij Gustschin
2013-05-07  6:34           ` [U-Boot] [PATCH v2] " Kuo-Jung Su
2013-04-26  8:02         ` [U-Boot] [PATCH v3 11/11] arm: add Faraday A36x SoC platform support Kuo-Jung Su
2013-05-02 22:27         ` [U-Boot] [PATCH v3 00/11] " Tom Rini
2013-05-03  6:02           ` Kuo-Jung Su
2013-04-18  9:25     ` [U-Boot] [PATCH v2 02/12] net: ftgmac100: add MMU/D-cache support Kuo-Jung Su
2013-04-18  9:25     ` [U-Boot] [PATCH v2 03/12] net: add Faraday FTMAC110 10/100Mbps ethernet support Kuo-Jung Su
2013-04-18 10:52       ` Wolfgang Denk
2013-04-22  2:56         ` Kuo-Jung Su
2013-04-18  9:25     ` [U-Boot] [PATCH v2 04/12] i2c: add Faraday FTI2C010 I2C controller support Kuo-Jung Su
2013-04-18 10:54       ` Wolfgang Denk
2013-04-22  2:52         ` Kuo-Jung Su
2013-04-18  9:25     ` [U-Boot] [PATCH v2 05/12] spi: add Faraday FTSPI010 SPI " Kuo-Jung Su
2013-04-18 10:56       ` Wolfgang Denk
2013-04-22  2:52         ` Kuo-Jung Su
2013-08-08 13:38       ` Jagan Teki
2013-08-09  0:47         ` Kuo-Jung Su
2013-08-09 11:27           ` Jagan Teki
2013-08-12  0:37             ` Kuo-Jung Su
2013-10-03 19:53               ` Jagan Teki
2013-04-18  9:25     ` [U-Boot] [PATCH v2 06/12] mmc: add an alternative driver to Faraday FTSDC010 Kuo-Jung Su
2013-04-18 10:57       ` Wolfgang Denk
2013-04-22  2:51         ` Kuo-Jung Su
2013-04-18  9:25     ` [U-Boot] [PATCH v2 07/12] mtd: nand: add Faraday FTNANDC021 NAND controller support Kuo-Jung Su
2013-04-18 11:04       ` Wolfgang Denk
2013-04-22  1:52         ` Kuo-Jung Su
2013-04-18 19:44       ` Scott Wood
2013-04-22  2:45         ` Kuo-Jung Su
2013-04-22 23:11           ` Scott Wood
2013-04-23  1:19             ` Kuo-Jung Su
2013-04-23 22:57               ` Scott Wood
2013-04-24  1:03                 ` Kuo-Jung Su
2013-04-23  1:22             ` Kuo-Jung Su
2013-04-18  9:25     ` [U-Boot] [PATCH v2 08/12] mtd: spi: add FTSPI020 SPI Flash " Kuo-Jung Su
2013-04-18 11:08       ` Wolfgang Denk
2013-04-22  1:51         ` Kuo-Jung Su
2013-04-18  9:25     ` [U-Boot] [PATCH v2 09/12] usb: ehci: add Faraday USB 2.0 EHCI support Kuo-Jung Su
2013-04-18 11:09       ` Wolfgang Denk
2013-04-22  1:45         ` Kuo-Jung Su
2013-04-18  9:25     ` Kuo-Jung Su [this message]
2013-04-18 11:11       ` [U-Boot] [PATCH v2 10/12] usb: gadget: add Faraday FOTG210 USB gadget support Wolfgang Denk
2013-04-22  1:45         ` Kuo-Jung Su
2013-04-18  9:25     ` [U-Boot] [PATCH v2 11/12] arm: add MMU/d-cache support for Faraday cores Kuo-Jung Su
2013-04-18 11:13       ` Wolfgang Denk
2013-04-22  1:23         ` Kuo-Jung Su
2013-04-18 19:09       ` Albert ARIBAUD
2013-04-22  1:27         ` Kuo-Jung Su
2013-04-18  9:25     ` [U-Boot] [PATCH v2 12/12] arm: add Faraday A36x SoC platform support Kuo-Jung Su
2013-04-18 11:16       ` Wolfgang Denk
2013-04-22  1:30         ` Kuo-Jung Su
2013-04-18 10:43     ` [U-Boot] [PATCH v2 00/12] " Wolfgang Denk
2013-04-22  1:27       ` Kuo-Jung Su
2013-03-29  7:06 ` [U-Boot] [PATCH 02/11] net/ftgmac100: add MMU/D-cache support Kuo-Jung Su
2013-03-29  7:06 ` [U-Boot] [PATCH 03/11] net: add FTMAC110 10/100Mbps ethernet support Kuo-Jung Su
2013-03-29  7:06 ` [U-Boot] [PATCH 04/11] usb-ehci: add Faraday USB 2.0 EHCI controller support Kuo-Jung Su
2013-03-30  6:29   ` Marek Vasut
2013-04-01  1:21     ` Kuo-Jung Su
2013-03-29  7:06 ` [U-Boot] [PATCH 05/11] usb-gadget: add FOTG210 USB gadget support Kuo-Jung Su
2013-03-30  6:27   ` Marek Vasut
2013-04-01  1:20     ` Kuo-Jung Su
2013-03-29  7:06 ` [U-Boot] [PATCH 06/11] i2c: add FTI2C010 I2C controller support Kuo-Jung Su
2013-03-29  7:06 ` [U-Boot] [PATCH 07/11] spi: add FTSPI010 SPI " Kuo-Jung Su
2013-03-29  7:06 ` [U-Boot] [PATCH 08/11] mtd/nand: add FTNANDC021 NAND flash " Kuo-Jung Su
2013-03-29  7:06 ` [U-Boot] [PATCH 09/11] mtd/spi: add FTSPI020 SPI Flash " Kuo-Jung Su
2013-03-29  7:06 ` [U-Boot] [PATCH 10/11] mmc: add an alternative FTSDC010 driver support Kuo-Jung Su
2013-03-29  7:06 ` [U-Boot] [PATCH 11/11] arm: add Faraday A36x SoC platform support Kuo-Jung Su
2013-06-17 12:06 ` [U-Boot] [PATCH v5 00/14] " Kuo-Jung Su
2013-06-17 12:06   ` [U-Boot] [PATCH v5 01/14] arm: dma_alloc_coherent: malloc() -> memalign() Kuo-Jung Su
2013-06-17 12:06   ` [U-Boot] [PATCH v5 02/14] net: ftgmac100: add MMU/D-cache support Kuo-Jung Su
2013-06-23  7:16     ` Albert ARIBAUD
2013-06-24  1:31       ` Kuo-Jung Su
2013-06-17 12:06   ` [U-Boot] [PATCH v5 03/14] net: add Faraday FTMAC110 10/100Mbps ethernet support Kuo-Jung Su
2013-06-23  7:18     ` Albert ARIBAUD
2013-06-23 11:09       ` Tom Rini
2013-06-23 13:18         ` Albert ARIBAUD
2013-06-23 15:17           ` Tom Rini
2013-06-17 12:06   ` [U-Boot] [PATCH v5 04/14] video: add Faraday FTLCDC200 LCD controller support Kuo-Jung Su
2013-06-17 12:06   ` [U-Boot] [PATCH v5 05/14] nand: add Faraday FTNANDC021 NAND " Kuo-Jung Su
2013-06-18  0:08     ` Scott Wood
2013-06-18  0:51       ` Kuo-Jung Su
2013-06-18  0:56         ` Scott Wood
2013-06-17 12:06   ` [U-Boot] [PATCH v5 06/14] cfi_flash: use buffer length in unmap_physmem() Kuo-Jung Su
2013-06-17 12:06   ` [U-Boot] [PATCH v5 07/14] arm: add MMU/D-Cache support for Faraday cores Kuo-Jung Su
2013-06-17 12:06   ` [U-Boot] [PATCH v5 08/14] arm: add Faraday processor core support Kuo-Jung Su
2013-06-17 12:06   ` [U-Boot] [PATCH v5 09/14] arm: add Faraday FTINTC020 interrupt controller support Kuo-Jung Su
2013-06-17 12:07   ` [U-Boot] [PATCH v5 10/14] arm: add Faraday FTTMR010 timer support Kuo-Jung Su
2013-06-17 12:07   ` [U-Boot] [PATCH v5 11/14] arm: add Faraday FTPWMTMR010 " Kuo-Jung Su
2013-06-17 12:07   ` [U-Boot] [PATCH v5 12/14] arm: add Faraday specific boot command Kuo-Jung Su
2013-06-23  7:22     ` Albert ARIBAUD
2013-06-24  1:30       ` Kuo-Jung Su
2013-06-17 12:07   ` [U-Boot] [PATCH v5 13/14] mmc: ftsdc010_mci: clk_get_rate() -> clock_get_rate() Kuo-Jung Su
2013-06-17 18:32     ` Andy Fleming
2013-06-18  0:48       ` Kuo-Jung Su
2013-06-17 12:07   ` [U-Boot] [PATCH v5 14/14] arm: add Faraday A360/A369 SoC platform support Kuo-Jung Su
2013-07-04  3:40 ` [U-Boot] [PATCH v6 00/12] arm: add Faraday A36x " Kuo-Jung Su
2013-07-04  3:40   ` [U-Boot] [PATCH v6 01/12] arm: dma_alloc_coherent: malloc() -> memalign() Kuo-Jung Su
2013-07-04  3:40   ` [U-Boot] [PATCH v6 02/12] video: add Faraday FTLCDC200 LCD controller support Kuo-Jung Su
2013-07-04  3:40   ` [U-Boot] [PATCH v6 03/12] nand: add Faraday FTNANDC021 NAND " Kuo-Jung Su
2013-07-08 23:59     ` Scott Wood
2013-07-09  1:42       ` Kuo-Jung Su
2013-07-09  1:48         ` Scott Wood
2013-07-09  1:57           ` Kuo-Jung Su
2013-07-04  3:40   ` [U-Boot] [PATCH v6 04/12] cfi_flash: use buffer length in unmap_physmem() Kuo-Jung Su
2013-07-25 14:46     ` Stefan Roese
2013-07-04  3:40   ` [U-Boot] [PATCH v6 05/12] arm: add MMU/D-Cache support for Faraday cores Kuo-Jung Su
2013-07-04  3:40   ` [U-Boot] [PATCH v6 06/12] arm: add Faraday processor core support Kuo-Jung Su
2013-07-04  3:40   ` [U-Boot] [PATCH v6 07/12] arm: add Faraday FTINTC020 interrupt controller support Kuo-Jung Su
2013-07-04  3:40   ` [U-Boot] [PATCH v6 08/12] arm: add Faraday FTTMR010 timer support Kuo-Jung Su
2013-07-04  3:40   ` [U-Boot] [PATCH v6 09/12] arm: add Faraday FTPWMTMR010 " Kuo-Jung Su
2013-07-04  3:40   ` [U-Boot] [PATCH v6 10/12] arm: add customized boot command for Faraday Images Kuo-Jung Su
2013-07-04  3:40   ` [U-Boot] [PATCH v6 11/12] mmc: ftsdc010_mci: clk_get_rate() -> clock_get_rate() Kuo-Jung Su
2013-07-04  3:40   ` [U-Boot] [PATCH v6 12/12] arm: add Faraday A360/A369 SoC platform support Kuo-Jung Su
2013-07-25  9:07   ` [U-Boot] [PATCH v6 00/12] arm: add Faraday A36x " Albert ARIBAUD
2013-07-26 14:15     ` Kuo-Jung Su
2013-07-29  5:51 ` [U-Boot] [PATCH v7 00/11] " Kuo-Jung Su
2013-07-29  5:51   ` [U-Boot] [PATCH v7 01/11] arm: dma_alloc_coherent: malloc() -> memalign() Kuo-Jung Su
2013-09-14 10:09     ` Albert ARIBAUD
2013-07-29  5:51   ` [U-Boot] [PATCH v7 02/11] video: add Faraday FTLCDC200 LCD controller support Kuo-Jung Su
2013-08-09 19:33     ` Anatolij Gustschin
2013-07-29  5:51   ` [U-Boot] [PATCH v7 03/11] nand: add Faraday FTNANDC021 NAND " Kuo-Jung Su
2013-07-29 22:59     ` Scott Wood
2013-07-30  0:39       ` Kuo-Jung Su
2013-07-29  5:51   ` [U-Boot] [PATCH v7 04/11] arm: add MMU/D-Cache support for Faraday cores Kuo-Jung Su
2013-07-29  5:51   ` [U-Boot] [PATCH v7 05/11] arm: add Faraday processor core support Kuo-Jung Su
2013-07-29  5:51   ` [U-Boot] [PATCH v7 06/11] arm: add Faraday FTINTC020 interrupt controller support Kuo-Jung Su
2013-07-29  5:51   ` [U-Boot] [PATCH v7 07/11] arm: add Faraday FTTMR010 timer support Kuo-Jung Su
2013-07-29  5:51   ` [U-Boot] [PATCH v7 08/11] arm: add Faraday FTPWMTMR010 " Kuo-Jung Su
2013-07-29  5:51   ` [U-Boot] [PATCH v7 09/11] arm: add customized boot command for Faraday Images Kuo-Jung Su
2013-09-14 10:28     ` Albert ARIBAUD
2013-10-02  0:53       ` Kuo-Jung Su
2013-07-29  5:51   ` [U-Boot] [PATCH v7 10/11] mmc: ftsdc010_mci: clk_get_rate() -> clock_get_rate() Kuo-Jung Su
2013-07-29  5:51   ` [U-Boot] [PATCH v7 11/11] arm: add Faraday A360/A369 SoC platform support Kuo-Jung Su
2013-11-28  2:48   ` [U-Boot] [PATCH v8] nand: add Faraday FTNANDC021 NAND controller support Kuo-Jung Su
2014-03-04  2:17     ` [U-Boot] [U-Boot, " Scott Wood
2014-03-04  3:58       ` Kuo-Jung Su
2013-12-30  9:23 ` [U-Boot] [PATCH v8 0/8] arm: add Faraday A36x SoC platform support Kuo-Jung Su
2013-12-30  9:23   ` [U-Boot] [PATCH v8 1/8] arm: global_data: prepare for Faraday SoC support Kuo-Jung Su
2013-12-30  9:23   ` [U-Boot] [PATCH v8 2/8] arm: make mmu_enabled() a global function Kuo-Jung Su
2013-12-30  9:23   ` [U-Boot] [PATCH v8 3/8] arm: add Faraday ARM cores support Kuo-Jung Su
2013-12-30  9:23   ` [U-Boot] [PATCH v8 4/8] arm: faraday: revise the DMA API Kuo-Jung Su
2013-12-30  9:23   ` [U-Boot] [PATCH v8 5/8] arm: faraday: add FTPWMTMR010 timer support Kuo-Jung Su
2013-12-30  9:23   ` [U-Boot] [PATCH v8 6/8] arm: faraday: add FTTMR010 " Kuo-Jung Su
2013-12-30  9:23   ` [U-Boot] [PATCH v8 7/8] arm: faraday: add A360 SoC support Kuo-Jung Su
2013-12-30  9:23   ` [U-Boot] [PATCH v8 8/8] arm: faraday: add A369 " Kuo-Jung Su
2014-01-16  8:31 ` [U-Boot] [PATCH v9 0/7] arm: add Faraday SoC platform support Kuo-Jung Su
2014-01-16  8:31   ` [U-Boot] [PATCH v9 1/7] arm: add Faraday ARMv5TE cores support Kuo-Jung Su
2014-01-16  8:31   ` [U-Boot] [PATCH v9 2/7] arm: add Faraday SoC helper files Kuo-Jung Su
2014-01-16  8:31   ` [U-Boot] [PATCH v9 3/7] arm: faraday: add FTTMR010 timer support Kuo-Jung Su
2014-01-16  8:31   ` [U-Boot] [PATCH v9 4/7] arm: faraday: add FTPWMTMR010 " Kuo-Jung Su
2014-01-16  8:31   ` [U-Boot] [PATCH v9 5/7] arm: faraday: ftsmc020: add a fail-safe macro constant Kuo-Jung Su
2014-01-16  8:31   ` [U-Boot] [PATCH v9 6/7] arm: faraday: add A369 evaluation board support Kuo-Jung Su
2014-01-16  8:31   ` [U-Boot] [PATCH v9 7/7] arm: faraday: add Faraday Virtual Machine support Kuo-Jung Su
2014-02-20  3:40 ` [U-Boot] [PATCH v10 0/6] arm: add Faraday SoC platform support Kuo-Jung Su
2014-02-20  3:40   ` [U-Boot] [PATCH v10 1/6] arm: add Faraday ARMv5TE cores support Kuo-Jung Su
2014-02-20  3:40   ` [U-Boot] [PATCH v10 2/6] arm: faraday: add FTTMR010 timer support Kuo-Jung Su
2014-02-20  3:40   ` [U-Boot] [PATCH v10 3/6] arm: faraday: add FTPWMTMR010 " Kuo-Jung Su
2014-02-20  3:40   ` [U-Boot] [PATCH v10 4/6] arm: faraday: add A369 evaluation board support Kuo-Jung Su
2014-02-20  3:40   ` [U-Boot] [PATCH v10 5/6] arm: faraday: add missing header file for FTSDC021 Kuo-Jung Su
2014-02-20  3:40   ` [U-Boot] [PATCH v10 6/6] arm: faraday: add virtual machine support Kuo-Jung Su
2014-03-25 12:41   ` [U-Boot] [PATCH v10 0/6] arm: add Faraday SoC platform support Albert ARIBAUD
2014-03-26  6:08     ` Kuo-Jung Su
2014-03-26  6:03 ` [U-Boot] [PATCH v11 " Kuo-Jung Su
2014-03-26  6:03   ` [U-Boot] [PATCH v11 1/6] arm: add Faraday ARMv5TE cores support Kuo-Jung Su
2014-03-26  6:47     ` Wolfgang Denk
2014-03-26  7:22       ` Kuo-Jung Su
2014-03-26  6:03   ` [U-Boot] [PATCH v11 2/6] arm: faraday: add FTTMR010 timer support Kuo-Jung Su
2014-03-26  6:03   ` [U-Boot] [PATCH v11 3/6] arm: faraday: add FTPWMTMR010 " Kuo-Jung Su
2014-03-26  6:03   ` [U-Boot] [PATCH v11 4/6] arm: faraday: add A369 evaluation board support Kuo-Jung Su
2014-03-26  6:03   ` [U-Boot] [PATCH v11 5/6] arm: faraday: add missing header file for FTSDC021 Kuo-Jung Su
2014-03-26  6:03   ` [U-Boot] [PATCH v11 6/6] arm: faraday: add virtual machine support Kuo-Jung Su
2014-03-26  6:52     ` Wolfgang Denk
2014-03-26  7:24       ` Kuo-Jung Su
2014-04-01  8:46 ` [U-Boot] [PATCH v12 0/8] arm: add Faraday SoC platform support Kuo-Jung Su
2014-04-01  8:46   ` [U-Boot] [PATCH v12 1/8] libc: move strlcpy() from ether.c to string.c Kuo-Jung Su
2014-04-01  9:16     ` Marek Vasut
2014-04-03  0:58       ` Kuo-Jung Su
2014-04-03  8:16         ` Marek Vasut
2014-04-07  4:07           ` Kuo-Jung Su
2014-04-01  8:46   ` [U-Boot] [PATCH v12 2/8] arm: add legacy linux clock framework support Kuo-Jung Su
2014-04-01  8:46   ` [U-Boot] [PATCH v12 3/8] arm: add Faraday ARMv5TE platform common libraries Kuo-Jung Su
2014-04-01  8:46   ` [U-Boot] [PATCH v12 4/8] arm: faraday: add FTTMR010 timer suppor Kuo-Jung Su
2014-04-01  8:46   ` [U-Boot] [PATCH v12 5/8] arm: faraday: add FTPWMTMR010 timer support Kuo-Jung Su
2014-04-01  8:46   ` [U-Boot] [PATCH v12 6/8] arm: faraday: add A369 evaluation board support Kuo-Jung Su
2014-04-01  8:46   ` [U-Boot] [PATCH v12 7/8] arm: faraday: add missing header file for FTSDC021 Kuo-Jung Su
2014-04-01  8:46   ` [U-Boot] [PATCH v12 8/8] arm: faraday: add faraday virtual machine support Kuo-Jung Su

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1366277139-29728-11-git-send-email-dantesu@gmail.com \
    --to=dantesu@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.