From: Marek Vasut Date: Tue, 31 Mar 2020 02:38:24 +0200 Subject: [PATCH 5/8] xhci: mediatek: Add support for MTK xHCI host controller In-Reply-To: References: <1583909445-27444-1-git-send-email-chunfeng.yun@mediatek.com> <1583909445-27444-6-git-send-email-chunfeng.yun@mediatek.com> <2a096d71-d4a3-a693-8822-791448f64f99@denx.de> <79af00d8-53d8-981e-6297-b1fdf0b3ce04@denx.de> <33cac1aa-96e7-f7a5-990f-5f96ba332c4b@denx.de> <6beb53e5-f761-7866-b2ed-6cfec292606c@denx.de> <1b9af8f6-a826-d7eb-2881-52ef0f2a31aa@denx.de> Message-ID: <665ba7ce-7da9-89b5-d1e7-8ee0dfe41c3c@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 3/31/20 1:31 AM, Simon Glass wrote: > Hi Marek, Hi, > On Sun, 22 Mar 2020 at 09:34, 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 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. > > OK I have updated the coding style page with all of this. Which page ?