From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] usb: musb: add support for Blackfin MUSB
Date: Sun, 21 Jun 2009 17:42:35 -0400 [thread overview]
Message-ID: <200906211742.36969.vapier@gentoo.org> (raw)
In-Reply-To: <3efb10970906211254n2262bac3o947350e884afcc83@mail.gmail.com>
On Sunday 21 June 2009 15:54:13 Remy Bohmer wrote:
> Hello Mike,
>
> I got a remark about this patch:
>
> 2009/6/16 Mike Frysinger <vapier@gentoo.org>:
> > From: Bryan Wu <bryan.wu@analog.com>
> >
> > Signed-off-by: Bryan Wu <bryan.wu@analog.com>
> > Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> > ---
> > drivers/usb/musb/Makefile | 1 +
> > drivers/usb/musb/blackfin_usb.c | 152 +++++++++++++++
> > drivers/usb/musb/blackfin_usb.h | 27 +++
> > drivers/usb/musb/musb_core.h | 73 +++++++
> > include/asm-blackfin/mach-common/bits/usb.h | 280
> > +++++++++++++++++++++++++++ include/usb.h |
> > 3 +-
> > 6 files changed, 535 insertions(+), 1 deletions(-)
> >
> > --- a/drivers/usb/musb/musb_core.h
> > +++ b/drivers/usb/musb/musb_core.h
> > @@ -42,6 +42,68 @@
> >
> > /* Mentor USB core register overlay structure */
> > struct musb_regs {
> > +#if defined(CONFIG_USB_BLACKFIN)
> > + /* Every register is 32bit aligned, but only 16bits in size */
> > +# define ureg(name) u16 name; u16 __pad_##name;
> > + /* common registers */
> > + ureg(faddr)
> > + ureg(power)
> > + ureg(intrtx)
> > + ureg(intrrx)
> > + ureg(intrtxe)
> > + ureg(intrrxe)
> > + ureg(intrusb)
> > + ureg(intrusbe)
> > + ureg(frame)
> > + ureg(index)
> > + ureg(testmode)
> > + ureg(globintr)
> > + ureg(global_ctl)
> > + u32 reserved0[3];
> > + /* indexed registers */
> > + ureg(txmaxp)
> > + ureg(txcsr)
> > + ureg(rxmaxp)
> > + ureg(rxcsr)
> > + ureg(rxcount)
> > + ureg(txtype)
> > + ureg(txinterval)
> > + ureg(rxtype)
> > + ureg(rxinterval)
> > + u32 reserved1;
> > + ureg(txcount)
> > + u32 reserved2[5];
> > + /* fifo */
> > + u16 fifox[32];
> > + /* OTG, dynamic FIFO, version & vendor registers */
> > + u32 reserved3[16];
> > + ureg(devctl)
> > + ureg(vbus_irq)
> > + ureg(vbus_mask)
> > + u32 reserved4[15];
> > + ureg(linkinfo)
> > + ureg(vplen)
> > + ureg(hseof1)
> > + ureg(fseof1)
> > + ureg(lseof1)
> > + u32 reserved5[41];
> > + /* target address registers */
> > + struct musb_tar_regs {
> > + ureg(txmaxp)
> > + ureg(txcsr)
> > + ureg(rxmaxp)
> > + ureg(rxcsr)
> > + ureg(rxcount)
> > + ureg(txtype)
> > + ureg(txinternal)
> > + ureg(rxtype)
> > + ureg(rxinternal)
> > + u32 reserved6;
> > + ureg(txcount)
> > + u32 reserved7[5];
> > + } tar[8];
> > +# undef ureg
> > +#else
> > /* common registers */
> > u8 faddr;
> > u8 power;
> > @@ -97,6 +159,7 @@ struct musb_regs {
> > u8 rxhubaddr;
> > u8 rxhubport;
> > } tar[16];
> > +#endif
>
> Can both branches of this ifdef be merged somehow, such that the ifdef
> is much smaller?
>
> Both branches seem to contain the same elements, only type differs (
> which could maybe be handled with ureg() constructions also)
the layout isnt exactly the same, the sizes arent uniform enough for ureg(),
and the registers available dont match either. we'd still have ifdefs, but
interleaved, and i think that'd be much more likely to lead to breakage for
architectures invovled.
> > } __attribute__((aligned(32)));
>
> Shouldn't this be '__attribute__((packed))' too?
i didnt add that, but adding packed would probably make sense
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090621/14e8dc34/attachment-0001.pgp
next prev parent reply other threads:[~2009-06-21 21:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-16 9:26 [U-Boot] [PATCH] usb: musb: drop old musb read/write prototypes Mike Frysinger
2009-06-16 9:26 ` [U-Boot] [PATCH] usb: musb: add support for Blackfin MUSB Mike Frysinger
2009-06-21 19:54 ` Remy Bohmer
2009-06-21 21:42 ` Mike Frysinger [this message]
2009-09-02 10:43 ` Remy Bohmer
2009-09-02 10:53 ` Mike Frysinger
2009-09-02 9:17 ` Mike Frysinger
2009-06-16 9:26 ` [U-Boot] [PATCH] usb: musb: add timeout via CONFIG_MUSB_TIMEOUT Mike Frysinger
2009-06-21 19:56 ` Remy Bohmer
2009-06-21 20:05 ` Remy Bohmer
2009-06-21 21:43 ` Mike Frysinger
2009-06-21 19:55 ` [U-Boot] [PATCH] usb: musb: drop old musb read/write prototypes Remy Bohmer
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=200906211742.36969.vapier@gentoo.org \
--to=vapier@gentoo.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox