devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>,
	Kishon Vijay Abraham I <kishon-l0cyMroinI0@public.gmane.org>,
	Maxime Ripard
	<maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Cc: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>,
	Roman Byshko <rbyshko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	devicetree <devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: [PATCH 00/15] musb: Add support for the Allwinner sunxi musb controller
Date: Mon,  9 Mar 2015 21:40:13 +0100	[thread overview]
Message-ID: <1425933628-9672-1-git-send-email-hdegoede@redhat.com> (raw)

Hi All,

This patch set has been a while in the making, so I'm very happy to present
the end result here, and I hope everyone likes it.

Before talking about merging this there are 2 things which I would like to
point out:

a) The musb controller in the sunxi SoCs uses some SRAM which needs to be
mapped to the musb controller by poking some bits in the SRAM controller,
just like the EMAC patches which were send a while back I've chosen to use
syscon for this, actually 2 of the patches in this set come directly from the
SRAM mapping patchset for the EMAC.

I know that Maxime is not 100% in favor of using syscon:
http://lists.infradead.org/pipermail/linux-arm-kernel/2015-January/320221.html

But I disagree with his arguments for writing a special driver for the SRAM
controller:
1) syscon was specifically designed for global system control registers like
this and is fine to use as long as there are no conflicts where 1 bit is of
interest to multiple drivers, and there is no such conflict here
2) Maxime's other arguments seem to boil down to it would be nice / prettier
to have a specific driver for this, without really proving a hard need for
such a driver. But writing such a driver is going to be a lot of work, and
we've a ton of other work to do, and as said there is no real need for a
separate driver, syscon works fine for this.
3) I actually believe that having a specific driver for this is a bad idea,
because that means inventing a whole new cross driver API for this, and
getting those right is, hard, a lot of work, and even then one is still likely
to get it wrong. We can avoid all this by going with the proven syscon solution.

Maxime, can we please have your ack for moving forward with this using syscon?
(see above for my arguments why)


b) If you look closely at the new drivers/usb/musb/sunxi.c file you will see
that there is some register address translation happening in the
sunxi_musb_readb() function and related functions. This is necessary because
the registermap of the sunxi musb implementation is different from the other
musb implementation and sunxi uses multi-platform kernels.

I've considered adding full dynamic register map support to musb but I've
chosen not to. The problem is that the way the musb code currently works is
that there are 4 different address spaces used within the musb code:

1) musb->regs, the base address of the controller used for general control
register access like the DEVCTL and POWER regs

2) The address space at the offset returned by musb_io.ep_offset, which
contains ep control registers, this may be a different offset per endpoint,
or indexed by the INDEX register

3) The address space at the offset returned by musb_io.fifo_offset, which
contains the endpoint fifo data register, this is a different offset per ep.

4) The address space at the offset returned by MUSB_BUSCTL_OFFSET macro
(which gets repaced by musb_io.busctl_offset in this patchset), this may be a
different offset per endpoint, or indexed by the INDEX register

Turning this into something using dynamic register mapping is quite hard, esp.
since some parts of the address range are per endpoint and the number of
endpoints varies from one implementation to the next.

Besides this there also is the issue that I lack hardware to test invasive
changes like this for all different musb variants. So I've chosen to do the
necessary address translation (which really is only necessary for the general
control registers) in a sunxi specific readb & friends implementation, avoiding
the need to make invasive chances elsewhere and thus hopefully avoiding any
regressions.

Note that some small core changes are still necessary, mostly to rationalize
the busctl register handling, and make it more generic as sunxi has indexed
busctl registers.


So with that all said lets talk about getting this merged upstream, assuming
that the code passes review :)

The first patch in the set adds a header with defines for the sun4i syscon
registers. Since this has already been acked by one of the MFD maintainers,
I suggest we simply merge this through the musb maintainer together with all
the other musb patches, as this introduces a new file without changing any
other files collisions are impossible.

The second patch makes some minimal changes to the phy-sun4i-usb driver,
I believe it is best to merge this through the musb maintainer too, so that
all buildtime deps go in through one tree. Kishon can you review this patch
please and let us know if it is ok to merge this through the musb tree?

Then we get 5 musb patches, 4 preparation patches and 1 adding the actual
sunxi musb support, which should go through the musb tree obviously.

So assuming everyone agrees this means that patches 1 - 7 should be merged
through Felipe's tree. Felipe, is that ok with you and can you review these
patches please?

That leaves us with patches 8 - 15 which are all sunxi dts patches and as such
should go upstream through Maxime's tree once patches 1 - 7 are queued up
for merging. Maxime can you give these a review so that I can address any
comments, so that they will be ready to go once patches 1 - 7 are in place ?

Thanks & Regards,

Hans

             reply	other threads:[~2015-03-09 20:40 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-09 20:40 Hans de Goede [this message]
     [not found] ` <1425933628-9672-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-03-09 20:40   ` [PATCH 01/15] ARM: sunxi: Add register bit definitions for SRAM mapping syscon Hans de Goede
2015-03-09 20:40   ` [PATCH 02/15] phy-sun4i-usb: Add a helper function to update the iscr register Hans de Goede
     [not found]     ` <1425933628-9672-3-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-03-09 21:47       ` Arnd Bergmann
2015-03-10  8:04         ` Hans de Goede
     [not found]           ` <54FEA59B.7020400-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-03-10  8:57             ` Arnd Bergmann
2015-03-10 10:13               ` Hans de Goede
     [not found]                 ` <54FEC3DD.10108-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-03-10 10:53                   ` Kishon Vijay Abraham I
     [not found]                     ` <54FECD30.6080106-l0cyMroinI0@public.gmane.org>
2015-03-10 11:03                       ` Hans de Goede
     [not found]                         ` <54FECF9F.7020606-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-03-11  9:13                           ` Kishon Vijay Abraham I
     [not found]                             ` <55000749.9040606-l0cyMroinI0@public.gmane.org>
2015-03-11 11:39                               ` Hans de Goede
     [not found]                                 ` <55002970.8090206-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-03-11 12:50                                   ` Kishon Vijay Abraham I
     [not found]                                     ` <55003A15.2070900-l0cyMroinI0@public.gmane.org>
2015-03-11 13:03                                       ` Hans de Goede
     [not found]                                         ` <55003D2B.60502-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-03-11 13:07                                           ` Kishon Vijay Abraham I
     [not found]                                             ` <55003E0D.9040509-l0cyMroinI0@public.gmane.org>
2015-03-11 14:44                                               ` Hans de Goede
2015-03-09 20:40   ` [PATCH 03/15] musb: Make musb_write_rxfun* and musb_write_rxhub* work like their tx versions Hans de Goede
2015-03-09 20:40   ` [PATCH 04/15] musb: Make busctl_offset an io-op rather then a define Hans de Goede
2015-03-09 20:40   ` [PATCH 05/15] musb: Do not use musb_read[b|w] / _write[b|w] wrappers in generic fifo functions Hans de Goede
     [not found]     ` <1425933628-9672-6-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-03-09 21:50       ` Arnd Bergmann
2015-03-10  7:43         ` Hans de Goede
     [not found]           ` <54FEA09A.6040401-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-03-10  8:50             ` Arnd Bergmann
2015-03-10  8:56               ` Hans de Goede
     [not found]                 ` <54FEB1D4.3080700-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-03-10 13:43                   ` Arnd Bergmann
2015-03-09 20:40   ` [PATCH 06/15] musb: Fix platform code being unable to override ep access ops Hans de Goede
2015-03-09 20:40   ` [PATCH 07/15] musb: Add support for the Allwinner sunxi musb controller Hans de Goede
2015-03-09 20:40   ` [PATCH 08/15] ARM: dts: sunxi: Add syscon node for controlling SRAM mapping Hans de Goede
2015-03-09 20:40   ` [PATCH 09/15] ARM: dts: sun4i: Add USB Dual Role Controller Hans de Goede
     [not found]     ` <1425933628-9672-10-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-03-09 23:31       ` Julian Calaby
     [not found]         ` <CAGRGNgVsf05rtLC2+yOPrbrPV-ceQzPC=ZX1zX+hfNxdC7OX-A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-10  9:10           ` Hans de Goede
2015-03-09 20:40   ` [PATCH 10/15] ARM: dts: sun5i: " Hans de Goede
2015-03-09 20:40   ` [PATCH 11/15] ARM: dts: sun7i: " Hans de Goede
2015-03-09 20:40   ` [PATCH 12/15] ARM: dts: sun4i: Enable USB DRC on Chuwi V7 CW0825 Hans de Goede
     [not found]     ` <1425933628-9672-13-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-03-10 15:07       ` Maxime Ripard
2015-03-10 15:23         ` Hans de Goede
     [not found]           ` <54FF0C5D.3090706-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-03-10 18:17             ` Maxime Ripard
2015-03-09 20:40   ` [PATCH 13/15] ARM: dts: sun5i: Enable USB DRC on UTOO P66 Hans de Goede
2015-03-09 20:40   ` [PATCH 14/15] ARM: dts: sun7i: Enable USB DRC on Cubietruck Hans de Goede
2015-03-09 20:40   ` [PATCH 15/15] ARM: dts: sun7i: Enable USB DRC on A20-OLinuxIno-Lime Hans de Goede
2015-03-09 21:44   ` [PATCH 00/15] musb: Add support for the Allwinner sunxi musb controller Arnd Bergmann
2015-03-10  1:46     ` Chen-Yu Tsai
     [not found]       ` <CAGb2v67GkL9Mdr98Chf6MhMff7CO8OGgfF2kaB3Xcnz=SkMG3w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-10  7:38         ` Hans de Goede
2015-03-10  8:31         ` Arnd Bergmann
2015-03-10 17:41   ` Maxime Ripard
2015-03-10 22:35     ` Hans de Goede

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=1425933628-9672-1-git-send-email-hdegoede@redhat.com \
    --to=hdegoede-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=balbi-l0cyMroinI0@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=kishon-l0cyMroinI0@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=rbyshko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=wens-jdAy2FN1RRM@public.gmane.org \
    /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;
as well as URLs for NNTP newsgroup(s).