Skip to contentSkip to conversation

Add drive-strength-microamp in Meson pinctrl driver

PATCH New Guillaume La Roque 2 participants 6 messages Jun 4, 2019 – Jun 5, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Add drive-strength-microamp in Meson pinctrl driver

The purpose of this patchset is to add drive-strength-microamp support in meson pinconf driver. This is a new feature that was added on the g12a. It is critical for us to support this since many functions are failing with default pad drive-strength.

The value achievable by the SoC are 500uA, 2500uA, 3000uA and 4000uA and the DT property 'drive-strength-microamp' is expressed in uA.
So this patch add another generic property "drive-strength-microamp". The change to do so would be minimal and could be benefit to other platforms later on.

it's backport from linux :
https://lore.kernel.org/lkml/20190514082652.20686-1-glaroque at baylibre.com/

Cheers
Guillaume

Guillaume La Roque (3):
dm: pinctrl: Add driver-strength-microamp property
pinctrl: meson: add support of drive-strength-microamp
pinctrl: meson: g12a: add DS bank value

 drivers/pinctrl/meson/pinctrl-meson-axg-pmx.c |  1 +
 drivers/pinctrl/meson/pinctrl-meson-g12a.c    | 20 ++++----
 drivers/pinctrl/meson/pinctrl-meson.c         | 46 ++++++++++++++++++-
 drivers/pinctrl/meson/pinctrl-meson.h         | 43 +++++++++++------
 include/dm/pinctrl.h                          |  3 ++
 5 files changed, 89 insertions(+), 24 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/3 dm: pinctrl: Add driver-strength-microamp property

Add drive-strength-microamp property support to allow drive strength in uA

---
 include/dm/pinctrl.h | 3 +++
 1 file changed, 3 insertions(+)
include/dm/pinctrl.h +3 -0
index e7b8ad9078..3eca34fbf7 100644
@@ -225,6 +225,8 @@ struct pinctrl_ops {
  *	push-pull mode, the argument is ignored.
  * @PIN_CONFIG_DRIVE_STRENGTH: the pin will sink or source at most the current
  *	passed as argument. The argument is in mA.
+ * @PIN_CONFIG_DRIVE_STRENGTH_UA: the pin will sink or source at most the current
+ *	passed as argument. The argument is in uA.
  * @PIN_CONFIG_INPUT_DEBOUNCE: this will configure the pin to debounce mode,
  *	which means it will wait for signals to settle when reading inputs. The
  *	argument gives the debounce time in usecs. Setting the
@@ -281,6 +283,7 @@ enum pin_config_param {
 	PIN_CONFIG_DRIVE_OPEN_SOURCE,
 	PIN_CONFIG_DRIVE_PUSH_PULL,
 	PIN_CONFIG_DRIVE_STRENGTH,
+	PIN_CONFIG_DRIVE_STRENGTH_UA,
 	PIN_CONFIG_INPUT_DEBOUNCE,
 	PIN_CONFIG_INPUT_ENABLE,
 	PIN_CONFIG_INPUT_SCHMITT,
Signature · 1 line
2.17.1
#2 lore raw

PATCH 2/3 pinctrl: meson: add support of drive-strength-microamp

In reply to Guillaume La Roque

drive-strength-microamp is a new feature needed for G12A SoC. the default DS setting after boot is usually 500uA and it is not enough for many functions. We need to be able to set the drive strength to reliably enable things like MMC, I2C, etc ...

---
 drivers/pinctrl/meson/pinctrl-meson-axg-pmx.c |  1 +
 drivers/pinctrl/meson/pinctrl-meson.c         | 46 ++++++++++++++++++-
 drivers/pinctrl/meson/pinctrl-meson.h         | 43 +++++++++++------
 3 files changed, 76 insertions(+), 14 deletions(-)
drivers/pinctrl/meson/pinctrl-meson-axg-pmx.c +1 -0
index f23b188f2f..6af404ed68 100644
@@ -97,6 +97,7 @@ const struct pinconf_param meson_axg_pinconf_params[] = {
 	{ "bias-disable", PIN_CONFIG_BIAS_DISABLE, 0 },
 	{ "bias-pull-up", PIN_CONFIG_BIAS_PULL_UP, 1 },
 	{ "bias-pull-down", PIN_CONFIG_BIAS_PULL_DOWN, 1 },
+	{ "drive-strength-microamp", PIN_CONFIG_DRIVE_STRENGTH_UA, 0 },
 };
 
 const struct pinctrl_ops meson_axg_pinctrl_ops = {
drivers/pinctrl/meson/pinctrl-meson.c +44 -1

57 lines not on this page · raw message

drivers/pinctrl/meson/pinctrl-meson.h +29 -13

60 lines not on this page · raw message

Signature · 1 line
2.17.1
#3 lore raw

PATCH 3/3 pinctrl: meson: g12a: add DS bank value

In reply to Guillaume La Roque

add drive-strength bank regiter and bit value for G12A SoC

---
 drivers/pinctrl/meson/pinctrl-meson-g12a.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/pinctrl/meson/pinctrl-meson-g12a.c +10 -10
index 9cc2b9d52b..115e8b5616 100644
@@ -1204,19 +1204,19 @@ static struct meson_pmx_func meson_g12a_aobus_functions[] = {
 };
 
 static struct meson_bank meson_g12a_periphs_banks[] = {
-	/*    name   first                   last                   pullen  pull   dir     out     in   */
-	BANK("Z",    PIN(GPIOZ_0, EE_OFF),   PIN(GPIOZ_15, EE_OFF), 4,  0,  4,  0, 12,  0, 13,  0, 14,  0),
-	BANK("H",    PIN(GPIOH_0, EE_OFF),   PIN(GPIOH_8,  EE_OFF), 3,  0,  3,  0,  9,  0, 10,  0, 11,  0),
-	BANK("BOOT", PIN(BOOT_0,  EE_OFF),   PIN(BOOT_15,  EE_OFF), 0,  0,  0,  0,  0,  0,  1,  0,  2,  0),
-	BANK("C",    PIN(GPIOC_0, EE_OFF),   PIN(GPIOC_7,  EE_OFF), 1,  0,  1,  0,  3,  0,  4,  0,  5,  0),
-	BANK("A",    PIN(GPIOA_0, EE_OFF),   PIN(GPIOA_15, EE_OFF), 5,  0,  5,  0, 16,  0, 17,  0, 18,  0),
-	BANK("X",    PIN(GPIOX_0, EE_OFF),   PIN(GPIOX_19, EE_OFF), 2,  0,  2,  0,  6,  0,  7,  0,  8,  0),
+	/*       name   first                   last                   pullen  pull   dir     out     in      ds*/
+	BANK_DS("Z",    PIN(GPIOZ_0, EE_OFF),   PIN(GPIOZ_15, EE_OFF), 4,  0,  4,  0, 12,  0, 13,  0, 14,  0, 5, 0),
+	BANK_DS("H",    PIN(GPIOH_0, EE_OFF),   PIN(GPIOH_8,  EE_OFF), 3,  0,  3,  0,  9,  0, 10,  0, 11,  0, 4, 0),
+	BANK_DS("BOOT", PIN(BOOT_0,  EE_OFF),   PIN(BOOT_15,  EE_OFF), 0,  0,  0,  0,  0,  0,  1,  0,  2,  0, 0, 0),
+	BANK_DS("C",    PIN(GPIOC_0, EE_OFF),   PIN(GPIOC_7,  EE_OFF), 1,  0,  1,  0,  3,  0,  4,  0,  5,  0, 1, 0),
+	BANK_DS("A",    PIN(GPIOA_0, EE_OFF),   PIN(GPIOA_15, EE_OFF), 5,  0,  5,  0, 16,  0, 17,  0, 18,  0, 6, 0),
+	BANK_DS("X",    PIN(GPIOX_0, EE_OFF),   PIN(GPIOX_19, EE_OFF), 2,  0,  2,  0,  6,  0,  7,  0,  8,  0, 2, 0),
 };
 
 static struct meson_bank meson_g12a_aobus_banks[] = {
-	/*   name    first                   last                   pullen  pull   dir     out     in  */
-	BANK("AO",   PIN(GPIOAO_0, 0),       PIN(GPIOAO_11, 0),     3,  0,  2,  0,  0,  0,  4,  0,  1,  0),
-	BANK("E",    PIN(GPIOE_0, 0),        PIN(GPIOE_2, 0),       3, 16,  2, 16,  0, 16,  4, 16,  1,  16),
+	/*      name    first                   last                   pullen  pull   dir     out     in      ds*/
+	BANK_DS("AO",   PIN(GPIOAO_0, 0),       PIN(GPIOAO_11, 0),     3,  0,  2,  0,  0,  0,  4,  0,  1,  0, 0, 0),
+	BANK_DS("E",    PIN(GPIOE_0, 0),        PIN(GPIOE_2, 0),       3, 16,  2, 16,  0, 16,  4, 16,  1,  16, 1, 0),
 };
 
 static struct meson_pmx_bank meson_g12a_periphs_pmx_banks[] = {
Signature · 1 line
2.17.1
#4 lore raw

cover Add drive-strength-microamp in Meson pinctrl driver

In reply to Guillaume La Roque

Hi Guillaume,

Quoted 20 lines · Guillaume La Roque

The purpose of this patchset is to add drive-strength-microamp support in meson pinconf driver. This is a new feature that was added on the g12a. It is critical for us to support this since many functions are failing with default pad drive-strength.

The value achievable by the SoC are 500uA, 2500uA, 3000uA and 4000uA and the DT property 'drive-strength-microamp' is expressed in uA.
So this patch add another generic property "drive-strength-microamp". The change to do so would be minimal and could be benefit to other platforms later on.

it's backport from linux :
https://lore.kernel.org/lkml/20190514082652.20686-1-glaroque at baylibre.com/

Cheers
Guillaume

Guillaume La Roque (3):
dm: pinctrl: Add driver-strength-microamp property
pinctrl: meson: add support of drive-strength-microamp
pinctrl: meson: g12a: add DS bank value

Quoted 7 lines
 drivers/pinctrl/meson/pinctrl-meson-axg-pmx.c |  1 +
 drivers/pinctrl/meson/pinctrl-meson-g12a.c    | 20 ++++----
 drivers/pinctrl/meson/pinctrl-meson.c         | 46 ++++++++++++++++++-
 drivers/pinctrl/meson/pinctrl-meson.h         | 43 +++++++++++------
 include/dm/pinctrl.h                          |  3 ++
 5 files changed, 89 insertions(+), 24 deletions(-)

Thanks

Tested on an Odroid-N2 !

Neil

#5 lore raw

cover Add drive-strength-microamp in Meson pinctrl driver

In reply to Guillaume La Roque
Quoted 20 lines · Guillaume La Roque

The purpose of this patchset is to add drive-strength-microamp support in meson pinconf driver. This is a new feature that was added on the g12a. It is critical for us to support this since many functions are failing with default pad drive-strength.

The value achievable by the SoC are 500uA, 2500uA, 3000uA and 4000uA and the DT property 'drive-strength-microamp' is expressed in uA.
So this patch add another generic property "drive-strength-microamp". The change to do so would be minimal and could be benefit to other platforms later on.

it's backport from linux :
https://lore.kernel.org/lkml/20190514082652.20686-1-glaroque at baylibre.com/

Cheers
Guillaume

Guillaume La Roque (3):
dm: pinctrl: Add driver-strength-microamp property
pinctrl: meson: add support of drive-strength-microamp
pinctrl: meson: g12a: add DS bank value

Quoted 7 lines
 drivers/pinctrl/meson/pinctrl-meson-axg-pmx.c |  1 +
 drivers/pinctrl/meson/pinctrl-meson-g12a.c    | 20 ++++----
 drivers/pinctrl/meson/pinctrl-meson.c         | 46 ++++++++++++++++++-
 drivers/pinctrl/meson/pinctrl-meson.h         | 43 +++++++++++------
 include/dm/pinctrl.h                          |  3 ++
 5 files changed, 89 insertions(+), 24 deletions(-)

Applied to u-boot-amlogic