<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/drivers/pinctrl/mediatek, branch v2024.01</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/u-boot.git/atom/drivers/pinctrl/mediatek?h=v2024.01</id>
<link rel='self' href='http://cgit.235523.xyz/u-boot.git/atom/drivers/pinctrl/mediatek?h=v2024.01'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<updated>2023-08-03T13:40:50Z</updated>
<entry>
<title>pinctrl: mediatek: add pinctrl driver for MT7988 SoC</title>
<updated>2023-08-03T13:40:50Z</updated>
<author>
<name>Weijie Gao</name>
<email>weijie.gao@mediatek.com</email>
</author>
<published>2023-07-19T09:16:50Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=e34cf6fd179d8e8e3dac4d5a1ae1eb72404d50fa'/>
<id>urn:sha1:e34cf6fd179d8e8e3dac4d5a1ae1eb72404d50fa</id>
<content type='text'>
This patch adds pinctrl and gpio support for MT7988 SoC

Signed-off-by: Weijie Gao &lt;weijie.gao@mediatek.com&gt;
</content>
</entry>
<entry>
<title>pinctrl: mediatek: add pinmux_set ops support</title>
<updated>2023-08-03T13:40:50Z</updated>
<author>
<name>Weijie Gao</name>
<email>weijie.gao@mediatek.com</email>
</author>
<published>2023-07-19T09:16:46Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=f9c610618cc46df76b3b27eba0456554bfb1ed46'/>
<id>urn:sha1:f9c610618cc46df76b3b27eba0456554bfb1ed46</id>
<content type='text'>
This patch adds pinmux_set ops for mediatek pinctrl framework

Signed-off-by: Sam Shih &lt;sam.shih@mediatek.com&gt;
Signed-off-by: Weijie Gao &lt;weijie.gao@mediatek.com&gt;
</content>
</entry>
<entry>
<title>pinctrl: mediatek: fix the return value in driving configuration functions</title>
<updated>2023-08-03T13:40:50Z</updated>
<author>
<name>Weijie Gao</name>
<email>weijie.gao@mediatek.com</email>
</author>
<published>2023-07-19T09:16:42Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=4fd0be037229bb558e36002d061967880d80ce88'/>
<id>urn:sha1:4fd0be037229bb558e36002d061967880d80ce88</id>
<content type='text'>
The original mediatek pinctrl functions for driving configuration
'mtk_pinconf_drive_set_*' do not return -ENOSUPP even if input
parameters are not supported.
This patch fixes the return value in those functions.

Signed-off-by: Sam Shih &lt;sam.shih@mediatek.com&gt;
Signed-off-by: Weijie Gao &lt;weijie.gao@mediatek.com&gt;
</content>
</entry>
<entry>
<title>pinctrl: mediatek: convert most definitions to const</title>
<updated>2023-08-03T13:40:50Z</updated>
<author>
<name>Weijie Gao</name>
<email>weijie.gao@mediatek.com</email>
</author>
<published>2023-07-19T09:16:37Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=7cb50cd477b7a28221614e28400fdfe1ba4e61c2'/>
<id>urn:sha1:7cb50cd477b7a28221614e28400fdfe1ba4e61c2</id>
<content type='text'>
There exists a situation of the mediatek pinctrl driver that may return
wrong pin function value for the pinmux driver:
- All pin function arrays are defined without const
- Some pin function arrays contain all-zero value, e.g.:
  static int mt7622_spi_funcs[] = { 0, 0, 0, 0, 0, 0, };
- These arrays will be put into .bss section during compilation
- .bss section has no "a" attribute and does not exist in the final binary
  file after objcopy.
- FDT binary blob is appended to the u-boot binary, which occupies the
  .bss section.
- During board_f stage, .bss has not been initialized, and contains the
  data of FDT, which is not full-zero data.
- pinctrl driver is initialized in board_f stage, and it will get wrong
  data if another driver is going to set default pinctrl.

Since pinmux information and soc data are only meant to be read-only, thus
should be declared as const. This will force all pinctrl data being put
into .rodata section. Since .rodata has "a" attribute, even the all-zero
data will be allocated and filled with correct value in to u-boot binary.

Signed-off-by: Weijie Gao &lt;weijie.gao@mediatek.com&gt;
</content>
</entry>
<entry>
<title>pinctrl: mediatek: set R1/R0 in case pullen/pullsel succeeded</title>
<updated>2023-05-03T13:05:24Z</updated>
<author>
<name>Daniel Golle</name>
<email>daniel@makrotopia.org</email>
</author>
<published>2023-04-12T20:36:43Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=bcfb23ec7ef007f637a699031c8a3417dbb3b7e5'/>
<id>urn:sha1:bcfb23ec7ef007f637a699031c8a3417dbb3b7e5</id>
<content type='text'>
Commit dafe0fbfb0f3 ("pinctrl: mediatek: rewrite mtk_pinconf_set and
related functions") changed the logic deciding to set R0 and R1
registers for V1 devices.

Before:
	/* Also set PUPD/R0/R1 if the pin has them */
	err = mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_PUPD, !pullup);
	if (err != -EINVAL) {
		mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_R0, r0);
		mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_R1, r1);
	}

After:
	/* try pupd_r1_r0 if pullen_pullsel return error */
	err = mtk_pinconf_bias_set_pullen_pullsel(dev, pin, disable, pullup,
						  val);
	if (err)
		return mtk_pinconf_bias_set_pupd_r1_r0(dev, pin, disable,
						       pullup, val);

Tracing mtk_pinconf_bias_set_pullen_pullsel shows that the function
always either returns 0 in case of success or -EINVAL in case any error
has occurred. Hence the logic responsible of the decision to program R0
and R1 has been inverted.

This leads to problems on BananaPi R2 (MT7623N) when booting from
SDMMC, it turns out accessing eMMC no longer works since
U-Boot 2022.07:

MT7623&gt; mmc dev 0
Card did not respond to voltage select! : -110

The problem wasn't detected for a long time as both eMMC and SDMMC work
fine if they are used to boot from, and hence R0 and R1 were already
setup by the bootrom and/or preloader.

Fix the logic to restore the originally intended and correct behavior
and also change the descriptive comment accordingly.

Fixes: dafe0fbfb0f3 ("pinctrl: mediatek: rewrite mtk_pinconf_set and related functions")
Signed-off-by: Daniel Golle &lt;daniel@makrotopia.org&gt;
Tested-By: Frank Wunderlich &lt;frank-w@public-files.de&gt;
</content>
</entry>
<entry>
<title>pinctrl: mediatek: add pinctrl driver for MT7986 SoC</title>
<updated>2022-09-23T19:09:15Z</updated>
<author>
<name>Weijie Gao</name>
<email>weijie.gao@mediatek.com</email>
</author>
<published>2022-09-09T11:59:57Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=59acdf8afe4a5c676f8b6ed7af48821980a2bda5'/>
<id>urn:sha1:59acdf8afe4a5c676f8b6ed7af48821980a2bda5</id>
<content type='text'>
This patch adds pinctrl and gpio support for MT7986 SoC

Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
Tested-by: Daniel Golle &lt;daniel@makrotopia.org&gt;
Signed-off-by: Weijie Gao &lt;weijie.gao@mediatek.com&gt;
</content>
</entry>
<entry>
<title>pinctrl: mediatek: add pinctrl driver for MT7981 SoC</title>
<updated>2022-09-23T19:09:15Z</updated>
<author>
<name>Weijie Gao</name>
<email>weijie.gao@mediatek.com</email>
</author>
<published>2022-09-09T11:59:55Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=ace67d109719823c05a4c2c7c09b9c71ee82dd9b'/>
<id>urn:sha1:ace67d109719823c05a4c2c7c09b9c71ee82dd9b</id>
<content type='text'>
This patch adds pinctrl and gpio support for MT7981 SoC

Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
Signed-off-by: Weijie Gao &lt;weijie.gao@mediatek.com&gt;
</content>
</entry>
<entry>
<title>pinctrl: mediatek: add support for different types of IO pins</title>
<updated>2022-05-05T13:29:58Z</updated>
<author>
<name>Sam Shih</name>
<email>sam.shih@mediatek.com</email>
</author>
<published>2022-04-21T06:23:53Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=1a80ef5520fc0751c5055d422810bf22c6c7e526'/>
<id>urn:sha1:1a80ef5520fc0751c5055d422810bf22c6c7e526</id>
<content type='text'>
There are many pins in an SoC, and register usage may vary by pins.
This patch introduces a concept of "io type" and "io type group"
to mediatek pinctrl drivers. This can provide different pinconf
handlers implementation (eg: "bias-pull-up/down", "driving" and
"input-enable") for IO pins that belong to different types.

Signed-off-by: Sam Shih &lt;sam.shih@mediatek.com&gt;
</content>
</entry>
<entry>
<title>pinctrl: mediatek: introduce multiple memory bases support</title>
<updated>2022-05-05T13:29:58Z</updated>
<author>
<name>Sam Shih</name>
<email>sam.shih@mediatek.com</email>
</author>
<published>2022-04-21T06:23:52Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=10334e0bc8884301466bbca9c474a8a580a3e7ee'/>
<id>urn:sha1:10334e0bc8884301466bbca9c474a8a580a3e7ee</id>
<content type='text'>
Pinctrl design of some mediatek SoC need to access registers that
distribute in multiple memory base address. this patch introduce new
mechanism in mediatek pinctrl driver to support the chips which have
the new design.

This patch add a member 'base_calc' in pinctrl private data, and changed
original 'base' private data to an array of *iomem.

When 'base_calc' attribute is set, it will requests multiplue regs base
from the DT, if 'base_calc' attribute is not set, it only use legacy way
to request single reg resource from the DT.

Signed-off-by: Sam Shih &lt;sam.shih@mediatek.com&gt;
</content>
</entry>
<entry>
<title>pinctrl: mediatek: rewrite mtk_pinconf_set and related functions</title>
<updated>2022-05-05T13:29:57Z</updated>
<author>
<name>Sam Shih</name>
<email>sam.shih@mediatek.com</email>
</author>
<published>2022-04-21T06:23:51Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=dafe0fbfb0f37e2d3be3e25a60975e1eb31ef8b7'/>
<id>urn:sha1:dafe0fbfb0f37e2d3be3e25a60975e1eb31ef8b7</id>
<content type='text'>
There are many pins in a SoCs, and different pin may belong
to different "io_type", For example: some pins of MT7622 belongs
to "io_type A", the other belongs to "io_type B", and pinctrl "V0"
means handle pinconf via "io_type A" or "io_type B", so SoCs that
contain "io_type A" and "io_type B" pins, use "V0" in pinctrl driver.

This patch separates the implementation of register operations
(e.g: "bias-pull-up/down", "driving" and "input-enable") into
different functions, and lets the original V0/V1
ops to call the new functions.

Signed-off-by: Sam Shih &lt;sam.shih@mediatek.com&gt;
</content>
</entry>
</feed>
