From: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: u-boot@lists.denx.de
Subject: [PATCH 5/8] xhci: mediatek: Add support for MTK xHCI host controller
Date: Tue, 24 Mar 2020 11:56:13 +0800 [thread overview]
Message-ID: <1585022173.28859.8.camel@mhfsdcap03> (raw)
In-Reply-To: <1b9af8f6-a826-d7eb-2881-52ef0f2a31aa@denx.de>
Hi Marek & Simon,
Firstly, thanks for your suggestion and discussion.
As Simon guess, MediaTek indeed has some policies to avoid to move
registers around for USB IP, I think we will not encounter the
worst-case scenarios as Marek mentioned. Due to there is only a little
registers, both struct and macros approach are OK for me.
And in a word, I tend to agree with Simon's opinion, choose struct or
macro approach, case by case, after weigh the pros and cons. But Marek
is the maintainer of USB subsystem, so I'd better to make him happy, and
should follow his suggetions:)
Again, thank you guys
On Sun, 2020-03-22 at 16:34 +0100, Marek Vasut wrote:
> On 3/22/20 4:17 PM, Simon Glass wrote:
> > Hi Marek,
>
> Hi,
>
> > On Sat, 21 Mar 2020 at 20:15, Marek Vasut <marex@denx.de> wrote:
> >>
> >> On 3/22/20 3:08 AM, Simon Glass wrote:
> >>> Hi Marek,
> >>
> >> Hi,
> >>
> >>> I think at this point we've covered all the ground and mentioned the
> >>> pros and cons of each method, so I'll leave the discussion where it
> >>> is.
> >>
> >> Great, so let's remove the struct-based access from the driver and use
> >> regular #define REGISTER 0xoffset.
> >
> > I think any individual decision depends on the pros and cons we
> > outlined in our discussion. I don't have any information to suggest
> > that the Mediatek XHCI driver has any of the variations you talked
> > about in your worst-case scenarios, so I can't comment on that. I am
> > more concerned about this as a general rule as I feel that the
> > struct-based approach is generally best for U-Boot, except for the
> > cases you highlighted:
> >
> > - where the registers appear at different offsets in different
> > hardware revisions served by the same driver
> > - where the driver only uses a small subset of the registers and it is
> > not worth defining a struct to cover them all, with associated empty
> > regions, etc.
> >
> > Anything else?
>
> It's also very difficult to easily figure out the address of a register
> that's buried somewhere down in a long structure, possibly with embedded
> sub-structures.
>
> > This is a USB driver and you are the USB maintainer, so your decision
> > is OK with me. For driver model in general I feel that struct access
> > should be the default, but individual maintainers with strong views on
> > their subsystem need to have preference.
>
> Well, like I said, my experience tells me the struct approach was a big
> mistake in multiple places, so I would prefer macros here.
>
next prev parent reply other threads:[~2020-03-24 3:56 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-11 6:50 [PATCH 0/8] Add support for MediaTek xHCI host controller Chunfeng Yun
2020-03-11 6:50 ` [PATCH 1/8] phy: phy-mtk-tphy: add support USB phys Chunfeng Yun
2020-03-11 6:50 ` [PATCH 2/8] phy: phy-mtk-tphy: add support new version Chunfeng Yun
2020-03-11 6:50 ` [PATCH 3/8] phy: phy-mtk-tphy: add a new reference clock Chunfeng Yun
2020-03-11 6:50 ` [PATCH 4/8] dm: core: Add function to get child count of ofnode Chunfeng Yun
2020-03-11 12:17 ` Simon Glass
2020-03-12 6:24 ` Chunfeng Yun
2020-03-11 6:50 ` [PATCH 5/8] xhci: mediatek: Add support for MTK xHCI host controller Chunfeng Yun
2020-03-11 7:11 ` Marek Vasut
2020-03-11 8:17 ` Chunfeng Yun
2020-03-21 8:53 ` Chunfeng Yun
2020-03-21 14:12 ` Simon Glass
2020-03-21 15:08 ` Marek Vasut
2020-03-21 16:42 ` Simon Glass
2020-03-21 16:59 ` Marek Vasut
2020-03-21 18:41 ` Simon Glass
2020-03-21 19:01 ` Marek Vasut
2020-03-21 19:34 ` Simon Glass
2020-03-21 20:04 ` Marek Vasut
2020-03-22 2:08 ` Simon Glass
2020-03-22 2:15 ` Marek Vasut
2020-03-22 15:17 ` Simon Glass
2020-03-22 15:34 ` Marek Vasut
2020-03-24 3:56 ` Chunfeng Yun [this message]
2020-03-30 23:31 ` Simon Glass
2020-03-31 0:38 ` Marek Vasut
2020-03-31 13:24 ` Simon Glass
2020-03-31 13:29 ` Marek Vasut
2020-03-31 14:16 ` Simon Glass
2020-03-31 16:05 ` Marek Vasut
2020-04-10 18:41 ` Marek Vasut
2020-04-10 19:14 ` Simon Glass
2020-04-10 19:27 ` Marek Vasut
2020-04-19 23:38 ` Simon Glass
2020-03-11 12:18 ` Simon Glass
2020-03-12 6:23 ` Chunfeng Yun
2020-03-11 6:50 ` [PATCH 6/8] arm: dts: mt7629: add support usb related nodes Chunfeng Yun
2020-03-11 6:50 ` [PATCH 7/8] dt-bindings: phy-mtk-tphy: add properties of address mapping and clocks Chunfeng Yun
2020-03-11 6:50 ` [PATCH 8/8] dt-bindings: usb: mtk-xhci: Add binding for MediaTek xHCI host controller Chunfeng Yun
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=1585022173.28859.8.camel@mhfsdcap03 \
--to=chunfeng.yun@mediatek.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.