public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Weijie Gao <weijie.gao@mediatek.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 07/26] pinctrl: add support for MediaTek MT7628
Date: Thu, 29 Aug 2019 11:04:50 +0800	[thread overview]
Message-ID: <1567047890.2874.114.camel@mcddlt001> (raw)
In-Reply-To: <a3de6a2d-f372-e382-abc0-07ac97098d49@denx.de>

On Wed, 2019-08-28 at 14:37 +0200, Stefan Roese wrote:
> On 28.08.19 14:26, Stefan Roese wrote:
> > On 28.08.19 08:37, Weijie Gao wrote:
> >> This patch adds pinctrl support for mt7628, with a file for common pinmux
> >> functions and a file for mt7628 which has additional support for pinconf.
> >>
> >> Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
> >> ---
> >>    drivers/pinctrl/Kconfig                       |   1 +
> >>    drivers/pinctrl/Makefile                      |   1 +
> >>    drivers/pinctrl/mtmips/Kconfig                |  13 +
> >>    drivers/pinctrl/mtmips/Makefile               |   7 +
> >>    drivers/pinctrl/mtmips/pinctrl-mt7628.c       | 585 ++++++++++++++++++
> >>    .../pinctrl/mtmips/pinctrl-mtmips-common.c    |  87 +++
> >>    .../pinctrl/mtmips/pinctrl-mtmips-common.h    |  53 ++
> >>    7 files changed, 747 insertions(+)
> >>    create mode 100644 drivers/pinctrl/mtmips/Kconfig
> >>    create mode 100644 drivers/pinctrl/mtmips/Makefile
> >>    create mode 100644 drivers/pinctrl/mtmips/pinctrl-mt7628.c
> >>    create mode 100644 drivers/pinctrl/mtmips/pinctrl-mtmips-common.c
> >>    create mode 100644 drivers/pinctrl/mtmips/pinctrl-mtmips-common.h
> > 
> > Nice patch. I do have 2 questions though:
> > 
> > a) Why are you introducing a new "mtmips" directory and don't re-use
> > the already available "mediatek" directory? Is there nothing in
> > common with these "mediatek" drivers?
> > 
> > b) Somewhat related: You introduce a mtmips-common file. For which
> > platforms is this targeted (non-mt7628)? Is there nothing in common
> > with the "mediatek" files already available?
> > 
> > Other than that I've tested this on my MT7688 board and it works
> > just fine. Thanks a lot!
> 
> I do have another comment though:
> 
> I've used the common "pinctrl-single" driver in Linux a few weeks ago as
> there is no need for a separate MT7628 specific pin-mux driver [1][2] etc.
> Frankly, I don't know that status of the "pinctrl-single" U-Boot driver
> in depth. If its compatible with the Linux one (which I really hope), then
> we don't need a MT7628 specific pinctrl driver but can use the "pinctrl-single"
> driver as I've done in the Linux [1][2].
> 
> It would be great if you could check this and change this pinctrl support
> to the common "single" driver is possible.
> 
> Thanks,
> Stefan
> 
> [1] https://github.com/torvalds/linux/commit/380f072c57a590d7593050b8533d88e18b6a7daa
> [2] https://github.com/torvalds/linux/commit/6394de396ed36f3e8043734676eaa9c26f84bb1b

Although I am trying to write the pinctrl driver to be similar with the
"mediatek" one, they cannot share the same codebase because the register
map and definition are totally different. The "mtmips" chips have
separate pinmux registers, pinconf registers and gpio registers, while
the "mediatek" chips have uniformed registers for all these three
functionalities.

I introduced the common file to reserve space for mt7620.

If I use pinctrl-single, I still have to write a new driver for the
pinconf function and I'd rather just write them into one driver.

Besides the pinmux function takes advantages from the OpenWrt source.
Since some pinmux groups have 4 different function, I think is more
readable using the string configuration. And the users don't need to
read the programming guide to set the registers/shift/mask for a single
pinmux function.

Please see
https://github.com/torvalds/linux/blob/master/arch/mips/ralink/mt7620.c

Best Regards,

Weijie

  reply	other threads:[~2019-08-29  3:04 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-28  6:37 [U-Boot] [PATCH 00/26] Add and update drivers for MediaTek MT76x8 SoCs Weijie Gao
2019-08-28  6:37 ` [U-Boot] [PATCH 01/26] serial: serial_mtk: enable FIFO and disable flow control Weijie Gao
2019-08-28  6:37 ` [U-Boot] [PATCH 02/26] serial: serial_mtk: add non-DM version for SPL Weijie Gao
2019-08-28  6:37 ` [U-Boot] [PATCH 03/26] dts: mtmips: move uart property clock-frequency into mt7628an.dtsi Weijie Gao
2019-08-28  7:13   ` Stefan Roese
2019-08-28  6:37 ` [U-Boot] [PATCH 04/26] dts: mtmips: enable high-speed UART support for mt7628 Weijie Gao
2019-08-28  7:14   ` Stefan Roese
2019-08-28  6:37 ` [U-Boot] [PATCH 05/26] spi: mt7621-spi: remove data cache and rewrite its xfer function Weijie Gao
2019-08-28  7:55   ` Stefan Roese
2019-08-28  6:37 ` [U-Boot] [PATCH 06/26] spi: mt7621-spi: restore default register value after each xfer Weijie Gao
2019-08-28  8:01   ` Stefan Roese
2019-08-28  6:37 ` [U-Boot] [PATCH 07/26] pinctrl: add support for MediaTek MT7628 Weijie Gao
2019-08-28 12:26   ` Stefan Roese
2019-08-28 12:37     ` Stefan Roese
2019-08-29  3:04       ` Weijie Gao [this message]
2019-08-28  6:37 ` [U-Boot] [PATCH 08/26] dts: mtmips: add pinctrl node for mt7628 Weijie Gao
2019-08-28  6:37 ` [U-Boot] [PATCH 09/26] dts: mtmips: add default pinctrl for uart nodes Weijie Gao
2019-08-28  6:37 ` [U-Boot] [PATCH 10/26] reset: add reset controller driver for MediaTek MIPS platform Weijie Gao
2019-08-28  6:37 ` [U-Boot] [PATCH 11/26] dts: mtmips: update reset controller node for mt7628 Weijie Gao
2019-08-28 13:18   ` Stefan Roese
2019-08-29  3:18     ` Weijie Gao
2019-12-30  9:19   ` Mauro Condarelli
2019-12-30 10:22     ` Daniel Schwierzeck
2019-12-30 11:09       ` Mauro Condarelli
2019-12-30 12:14       ` Mauro Condarelli
2020-01-02 12:30         ` Stefan Roese
2020-01-02 13:36           ` Mauro Condarelli
2019-08-28  6:37 ` [U-Boot] [PATCH 12/26] clk: add clock gating driver for MediaTek MIPS platform Weijie Gao
2019-08-28 13:24   ` Daniel Schwierzeck
2019-08-29  3:25     ` Weijie Gao
2019-08-28  6:37 ` [U-Boot] [PATCH 13/26] dts: mtmips: add gate clock node for mt7628 Weijie Gao
2019-08-28  6:37 ` [U-Boot] [PATCH 14/26] phy: mt76x8-usb-phy: add slew rate calibration and remove non-mt7628 part Weijie Gao
2019-08-28  6:38 ` [U-Boot] [PATCH 15/26] net: mt7628-eth: remove hardcoded gpio settings and regmap-based phy reset Weijie Gao
2019-08-28 13:32   ` Stefan Roese
2019-08-28  6:38 ` [U-Boot] [PATCH 16/26] net: mt7628-eth: remove phy link up detection Weijie Gao
2019-08-28 13:37   ` Stefan Roese
2019-08-29  3:32     ` Weijie Gao
2019-08-28  6:38 ` [U-Boot] [PATCH 17/26] net: mt7628-eth: free rx descriptor on receiving failure Weijie Gao
2019-08-28 13:42   ` Stefan Roese
2019-08-28  6:38 ` [U-Boot] [PATCH 18/26] net: mt7628-eth: add support to isolate LAN/WAN ports Weijie Gao
2019-08-28 13:46   ` Stefan Roese
2019-08-29  4:27     ` Weijie Gao
2019-08-28  6:38 ` [U-Boot] [PATCH 19/26] dts: mtmips: enable eth port0 led function for all boards Weijie Gao
2019-08-28 13:47   ` Stefan Roese
2019-08-28  6:38 ` [U-Boot] [PATCH 20/26] mmc: mtk-sd: add support for MediaTek MT7620/MT7628 SoCs Weijie Gao
2019-08-28 13:50   ` Stefan Roese
2019-08-29  4:28     ` Weijie Gao
2019-08-28  6:38 ` [U-Boot] [PATCH 21/26] mmc: mtk-sd: add a dts property cd-active-high for builtin-cd mode Weijie Gao
2019-08-28  6:38 ` [U-Boot] [PATCH 22/26] dts: mtmips: add mmc related nodes for mt7628an.dtsi Weijie Gao
2019-08-28  6:38 ` [U-Boot] [PATCH 23/26] dts: mtmips: add default pinctrl for gardena-smart-gateway-mt7688 Weijie Gao
2019-08-28 13:52   ` Stefan Roese
2019-08-28  6:38 ` [U-Boot] [PATCH 24/26] dts: mtmips: add default pinctrl to eth nodes for all boards Weijie Gao
2019-08-28 13:55   ` Stefan Roese
2019-08-28  6:38 ` [U-Boot] [PATCH 25/26] configs: mtmips: change all boards to use mtk high-speed uart driver Weijie Gao
2019-08-28 13:57   ` Stefan Roese
2019-08-29  4:30     ` Weijie Gao
2019-08-28  6:38 ` [U-Boot] [PATCH 26/26] configs: mtmips: add necessary drivers for mtmips boards Weijie Gao
2019-08-28 13:35   ` Daniel Schwierzeck
2019-08-28 13:40     ` Stefan Roese
2019-08-29  3:34       ` Weijie Gao

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=1567047890.2874.114.camel@mcddlt001 \
    --to=weijie.gao@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox