diff options
author | Ben Dooks <ben-linux@fluff.org> | 2010-05-25 00:36:50 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-06-04 16:16:19 -0400 |
commit | 0f002d200598918f5058dfcfda3da46f29019765 (patch) | |
tree | 734136aaeb72c3e0094dfa9078ad9976c3215e4f /drivers | |
parent | 0287e43dda1a425da662f879dd27352021b0ca63 (diff) |
USB: s3c-hsotg: Ensure TX FIFO addresses setup when initialising FIFOs
Some versions of the S3C HS OtG block startup with overlapping TX FIFO
information, so change the fifo_init code to ensure that known values
are set into the FIFO registers at initialisation/reset time.
This also ensures that the FIFO RAM pointers are in a known state
before use.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/gadget/s3c-hsotg.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index a6d725dd7335..9abf96c5715d 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c | |||
@@ -297,6 +297,11 @@ static void s3c_hsotg_ctrl_epint(struct s3c_hsotg *hsotg, | |||
297 | */ | 297 | */ |
298 | static void s3c_hsotg_init_fifo(struct s3c_hsotg *hsotg) | 298 | static void s3c_hsotg_init_fifo(struct s3c_hsotg *hsotg) |
299 | { | 299 | { |
300 | unsigned int ep; | ||
301 | unsigned int addr; | ||
302 | unsigned int size; | ||
303 | u32 val; | ||
304 | |||
300 | /* the ryu 2.6.24 release ahs | 305 | /* the ryu 2.6.24 release ahs |
301 | writel(0x1C0, hsotg->regs + S3C_GRXFSIZ); | 306 | writel(0x1C0, hsotg->regs + S3C_GRXFSIZ); |
302 | writel(S3C_GNPTXFSIZ_NPTxFStAddr(0x200) | | 307 | writel(S3C_GNPTXFSIZ_NPTxFStAddr(0x200) | |
@@ -310,6 +315,26 @@ static void s3c_hsotg_init_fifo(struct s3c_hsotg *hsotg) | |||
310 | writel(S3C_GNPTXFSIZ_NPTxFStAddr(2048) | | 315 | writel(S3C_GNPTXFSIZ_NPTxFStAddr(2048) | |
311 | S3C_GNPTXFSIZ_NPTxFDep(0x1C0), | 316 | S3C_GNPTXFSIZ_NPTxFDep(0x1C0), |
312 | hsotg->regs + S3C_GNPTXFSIZ); | 317 | hsotg->regs + S3C_GNPTXFSIZ); |
318 | |||
319 | /* arange all the rest of the TX FIFOs, as some versions of this | ||
320 | * block have overlapping default addresses. This also ensures | ||
321 | * that if the settings have been changed, then they are set to | ||
322 | * known values. */ | ||
323 | |||
324 | /* start at the end of the GNPTXFSIZ, rounded up */ | ||
325 | addr = 2048 + 1024; | ||
326 | size = 768; | ||
327 | |||
328 | /* currently we allocate TX FIFOs for all possible endpoints, | ||
329 | * and assume that they are all the same size. */ | ||
330 | |||
331 | for (ep = 0; ep <= 15; ep++) { | ||
332 | val = addr; | ||
333 | val |= size << S3C_DPTXFSIZn_DPTxFSize_SHIFT; | ||
334 | addr += size; | ||
335 | |||
336 | writel(val, hsotg->regs + S3C_DPTXFSIZn(ep)); | ||
337 | } | ||
313 | } | 338 | } |
314 | 339 | ||
315 | /** | 340 | /** |