public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH 1/2] pinctrl: k210: Fix inverted IE and OE for I2C
@ 2020-10-25 20:00 Sean Anderson
  2020-10-25 20:00 ` [PATCH 2/2] pinctrl: k210: Rename power domains to match datasheet Sean Anderson
  2020-11-03  6:40 ` [PATCH 1/2] pinctrl: k210: Fix inverted IE and OE for I2C Rick Chen
  0 siblings, 2 replies; 6+ messages in thread
From: Sean Anderson @ 2020-10-25 20:00 UTC (permalink / raw)
  To: u-boot

I2C and SCCB previously shared defaults. However, SCCB needs OE_INV and
IE_INV set, but I2C cannot have those bits set. This adds a separate
default for SCCB.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reported-by: Damien Le Moal <Damien.LeMoal@wdc.com>
---

 drivers/pinctrl/pinctrl-kendryte.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-kendryte.c b/drivers/pinctrl/pinctrl-kendryte.c
index 5ad049d955..259a0b507b 100644
--- a/drivers/pinctrl/pinctrl-kendryte.c
+++ b/drivers/pinctrl/pinctrl-kendryte.c
@@ -55,8 +55,9 @@
 
 #define K210_PC_MODE_IN   (K210_PC_IE | K210_PC_ST)
 #define K210_PC_MODE_OUT  (K210_PC_DRIVE_7 | K210_PC_OE)
-#define K210_PC_MODE_I2C  (K210_PC_MODE_IN | K210_PC_IE_INV | K210_PC_SL | \
-			   K210_PC_OE | K210_PC_OE_INV | K210_PC_PU)
+#define K210_PC_MODE_I2C  (K210_PC_MODE_IN | K210_PC_SL | K210_PC_OE | \
+			   K210_PC_PU)
+#define K210_PC_MODE_SCCB (K210_PC_MODE_I2C | K210_PC_OE_INV | K210_PC_IE_INV)
 #define K210_PC_MODE_SPI  (K210_PC_MODE_IN | K210_PC_IE_INV | \
 			   K210_PC_MODE_OUT | K210_PC_OE_INV)
 #define K210_PC_MODE_GPIO (K210_PC_MODE_IN | K210_PC_MODE_OUT)
@@ -189,6 +190,7 @@ static const u32 k210_pc_mode_id_to_mode[] = {
 	[K210_PC_DEFAULT_IN_TIE] = K210_PC_MODE_IN,
 	DEFAULT(OUT),
 	DEFAULT(I2C),
+	DEFAULT(SCCB),
 	DEFAULT(SPI),
 	DEFAULT(GPIO),
 	[K210_PC_DEFAULT_INT13] = K210_PC_MODE_IN | K210_PC_PU,
@@ -362,8 +364,8 @@ static const struct k210_pcf_info k210_pcf_infos[] = {
 	FUNC(DVP_D5,         IN),
 	FUNC(DVP_D6,         IN),
 	FUNC(DVP_D7,         IN),
-	FUNC(SCCB_SCLK,      I2C),
-	FUNC(SCCB_SDA,       I2C),
+	FUNC(SCCB_SCLK,      SCCB),
+	FUNC(SCCB_SDA,       SCCB),
 	FUNC(UART1_CTS,      IN),
 	FUNC(UART1_DSR,      IN),
 	FUNC(UART1_DCD,      IN),
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] pinctrl: k210: Rename power domains to match datasheet
  2020-10-25 20:00 [PATCH 1/2] pinctrl: k210: Fix inverted IE and OE for I2C Sean Anderson
@ 2020-10-25 20:00 ` Sean Anderson
  2020-11-03  6:41   ` Rick Chen
  2020-11-03  6:40 ` [PATCH 1/2] pinctrl: k210: Fix inverted IE and OE for I2C Rick Chen
  1 sibling, 1 reply; 6+ messages in thread
From: Sean Anderson @ 2020-10-25 20:00 UTC (permalink / raw)
  To: u-boot

This renames power domains to match the names on the k210 datasheet.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reported-by: Damien Le Moal <Damien.LeMoal@wdc.com>
---

 .../pinctrl/kendryte,k210-fpioa.txt                    |  2 +-
 drivers/pinctrl/pinctrl-kendryte.c                     | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/doc/device-tree-bindings/pinctrl/kendryte,k210-fpioa.txt b/doc/device-tree-bindings/pinctrl/kendryte,k210-fpioa.txt
index 06a9cc060f..73871f5930 100644
--- a/doc/device-tree-bindings/pinctrl/kendryte,k210-fpioa.txt
+++ b/doc/device-tree-bindings/pinctrl/kendryte,k210-fpioa.txt
@@ -18,7 +18,7 @@ Pin configuration nodes are documented in pinctrl-bindings.txt
 Required properties for pin-configuration nodes or sub-nodes are:
 - groups: list of power groups to which the configuration applies. Valid groups
   are:
-	A0, A1, A2, B0, B1, B2, C0, C1
+	A0, A1, A2, B3, B4, B5, C6, C7
   (either this or "pinmux" must be specified)
 - pinmux: integer array representing pin multiplexing configuration. In addition
   to the 256 standard functions, each pin can also output the direction
diff --git a/drivers/pinctrl/pinctrl-kendryte.c b/drivers/pinctrl/pinctrl-kendryte.c
index 259a0b507b..3bdafc1e6b 100644
--- a/drivers/pinctrl/pinctrl-kendryte.c
+++ b/drivers/pinctrl/pinctrl-kendryte.c
@@ -153,11 +153,11 @@ static const char k210_pc_group_names[][3] = {
 	[0] = "A0",
 	[1] = "A1",
 	[2] = "A2",
-	[3] = "B0",
-	[4] = "B1",
-	[5] = "B2",
-	[6] = "C0",
-	[7] = "C1",
+	[3] = "B3",
+	[4] = "B4",
+	[5] = "B5",
+	[6] = "C6",
+	[7] = "C7",
 };
 
 static int k210_pc_get_groups_count(struct udevice *dev)
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 1/2] pinctrl: k210: Fix inverted IE and OE for I2C
  2020-10-25 20:00 [PATCH 1/2] pinctrl: k210: Fix inverted IE and OE for I2C Sean Anderson
  2020-10-25 20:00 ` [PATCH 2/2] pinctrl: k210: Rename power domains to match datasheet Sean Anderson
@ 2020-11-03  6:40 ` Rick Chen
  2020-11-13  7:19   ` Rick Chen
  1 sibling, 1 reply; 6+ messages in thread
From: Rick Chen @ 2020-11-03  6:40 UTC (permalink / raw)
  To: u-boot

> I2C and SCCB previously shared defaults. However, SCCB needs OE_INV and
> IE_INV set, but I2C cannot have those bits set. This adds a separate
> default for SCCB.
>
> Signed-off-by: Sean Anderson <seanga2@gmail.com>
> Reported-by: Damien Le Moal <Damien.LeMoal@wdc.com>
> ---
>
>  drivers/pinctrl/pinctrl-kendryte.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/pinctrl/pinctrl-kendryte.c b/drivers/pinctrl/pinctrl-kendryte.c
> index 5ad049d955..259a0b507b 100644
> --- a/drivers/pinctrl/pinctrl-kendryte.c
> +++ b/drivers/pinctrl/pinctrl-kendryte.c
> @@ -55,8 +55,9 @@
>

Reviewed-by: Rick Chen <rick@andestech.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/2] pinctrl: k210: Rename power domains to match datasheet
  2020-10-25 20:00 ` [PATCH 2/2] pinctrl: k210: Rename power domains to match datasheet Sean Anderson
@ 2020-11-03  6:41   ` Rick Chen
  0 siblings, 0 replies; 6+ messages in thread
From: Rick Chen @ 2020-11-03  6:41 UTC (permalink / raw)
  To: u-boot

> This renames power domains to match the names on the k210 datasheet.
>
> Signed-off-by: Sean Anderson <seanga2@gmail.com>
> Reported-by: Damien Le Moal <Damien.LeMoal@wdc.com>
> ---
>
>  .../pinctrl/kendryte,k210-fpioa.txt                    |  2 +-
>  drivers/pinctrl/pinctrl-kendryte.c                     | 10 +++++-----
>  2 files changed, 6 insertions(+), 6 deletions(-)
>

Reviewed-by: Rick Chen <rick@andestech.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] pinctrl: k210: Fix inverted IE and OE for I2C
  2020-11-03  6:40 ` [PATCH 1/2] pinctrl: k210: Fix inverted IE and OE for I2C Rick Chen
@ 2020-11-13  7:19   ` Rick Chen
  2020-11-13 13:44     ` Sean Anderson
  0 siblings, 1 reply; 6+ messages in thread
From: Rick Chen @ 2020-11-13  7:19 UTC (permalink / raw)
  To: u-boot

Hi Sean

> > I2C and SCCB previously shared defaults. However, SCCB needs OE_INV and
> > IE_INV set, but I2C cannot have those bits set. This adds a separate
> > default for SCCB.
> >
> > Signed-off-by: Sean Anderson <seanga2@gmail.com>
> > Reported-by: Damien Le Moal <Damien.LeMoal@wdc.com>
> > ---
> >
> >  drivers/pinctrl/pinctrl-kendryte.c | 10 ++++++----
> >  1 file changed, 6 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/pinctrl/pinctrl-kendryte.c b/drivers/pinctrl/pinctrl-kendryte.c
> > index 5ad049d955..259a0b507b 100644
> > --- a/drivers/pinctrl/pinctrl-kendryte.c
> > +++ b/drivers/pinctrl/pinctrl-kendryte.c
> > @@ -55,8 +55,9 @@
> >
>
> Reviewed-by: Rick Chen <rick@andestech.com>

Please check about the CI failure items:
https://travis-ci.org/github/rickchen36/u-boot-riscv/builds/742884254

+drivers/pinctrl/pinctrl-kendryte.c:187:3: error:
'K210_PC_DEFAULT_SCCB' undeclared here (not in a function); did you
mean 'K210_PC_DEFAULT_SPI'?
1282+  187 |  [K210_PC_DEFAULT_##mode] = K210_PC_MODE_##mode
1283+      |   ^~~~~~~~~~~~~~~~
1284+drivers/pinctrl/pinctrl-kendryte.c:193:2: note: in expansion of
macro 'DEFAULT'
1285+  193 |  DEFAULT(SCCB),
1286+      |  ^~~~~~~
1287+drivers/pinctrl/pinctrl-kendryte.c:187:3: error: array index in
initializer not of integer type
1288+drivers/pinctrl/pinctrl-kendryte.c:187:3: note: (near
initialization for 'k210_pc_mode_id_to_mode')
1289+make[3]: *** [drivers/pinctrl/pinctrl-kendryte.o] Error 1
1290+make[2]: *** [drivers/pinctrl] Error 2
1291+make[1]: *** [drivers] Error 2
1292+make: *** [sub-make] Error 2
1293     riscv:  +   sipeed_maix_smode
1294+drivers/pinctrl/pinctrl-kendryte.c:187:3: error:
'K210_PC_DEFAULT_SCCB' undeclared here (not in a function); did you
mean 'K210_PC_DEFAULT_SPI'?
1295+  187 |  [K210_PC_DEFAULT_##mode] = K210_PC_MODE_##mode
1296+      |   ^~~~~~~~~~~~~~~~
1297+drivers/pinctrl/pinctrl-kendryte.c:193:2: note: in expansion of
macro 'DEFAULT'
1298+  193 |  DEFAULT(SCCB),
1299+      |  ^~~~~~~
1300+drivers/pinctrl/pinctrl-kendryte.c:187:3: error: array index in
initializer not of integer type
1301+drivers/pinctrl/pinctrl-kendryte.c:187:3: note: (near
initialization for 'k210_pc_mode_id_to_mode')
1302+make[3]: *** [drivers/pinctrl/pinctrl-kendryte.o] Error 1

Thanks,
Rick

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] pinctrl: k210: Fix inverted IE and OE for I2C
  2020-11-13  7:19   ` Rick Chen
@ 2020-11-13 13:44     ` Sean Anderson
  0 siblings, 0 replies; 6+ messages in thread
From: Sean Anderson @ 2020-11-13 13:44 UTC (permalink / raw)
  To: u-boot

On 11/13/20 2:19 AM, Rick Chen wrote:
> Hi Sean
> 
>>> I2C and SCCB previously shared defaults. However, SCCB needs OE_INV and
>>> IE_INV set, but I2C cannot have those bits set. This adds a separate
>>> default for SCCB.
>>>
>>> Signed-off-by: Sean Anderson <seanga2@gmail.com>
>>> Reported-by: Damien Le Moal <Damien.LeMoal@wdc.com>
>>> ---
>>>
>>>  drivers/pinctrl/pinctrl-kendryte.c | 10 ++++++----
>>>  1 file changed, 6 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/drivers/pinctrl/pinctrl-kendryte.c b/drivers/pinctrl/pinctrl-kendryte.c
>>> index 5ad049d955..259a0b507b 100644
>>> --- a/drivers/pinctrl/pinctrl-kendryte.c
>>> +++ b/drivers/pinctrl/pinctrl-kendryte.c
>>> @@ -55,8 +55,9 @@
>>>
>>
>> Reviewed-by: Rick Chen <rick@andestech.com>
> 
> Please check about the CI failure items:
> https://travis-ci.org/github/rickchen36/u-boot-riscv/builds/742884254
> 
> +drivers/pinctrl/pinctrl-kendryte.c:187:3: error:
> 'K210_PC_DEFAULT_SCCB' undeclared here (not in a function); did you
> mean 'K210_PC_DEFAULT_SPI'?
> 1282+  187 |  [K210_PC_DEFAULT_##mode] = K210_PC_MODE_##mode
> 1283+      |   ^~~~~~~~~~~~~~~~
> 1284+drivers/pinctrl/pinctrl-kendryte.c:193:2: note: in expansion of
> macro 'DEFAULT'
> 1285+  193 |  DEFAULT(SCCB),
> 1286+      |  ^~~~~~~
> 1287+drivers/pinctrl/pinctrl-kendryte.c:187:3: error: array index in
> initializer not of integer type
> 1288+drivers/pinctrl/pinctrl-kendryte.c:187:3: note: (near
> initialization for 'k210_pc_mode_id_to_mode')
> 1289+make[3]: *** [drivers/pinctrl/pinctrl-kendryte.o] Error 1
> 1290+make[2]: *** [drivers/pinctrl] Error 2
> 1291+make[1]: *** [drivers] Error 2
> 1292+make: *** [sub-make] Error 2
> 1293     riscv:  +   sipeed_maix_smode
> 1294+drivers/pinctrl/pinctrl-kendryte.c:187:3: error:
> 'K210_PC_DEFAULT_SCCB' undeclared here (not in a function); did you
> mean 'K210_PC_DEFAULT_SPI'?
> 1295+  187 |  [K210_PC_DEFAULT_##mode] = K210_PC_MODE_##mode
> 1296+      |   ^~~~~~~~~~~~~~~~
> 1297+drivers/pinctrl/pinctrl-kendryte.c:193:2: note: in expansion of
> macro 'DEFAULT'
> 1298+  193 |  DEFAULT(SCCB),
> 1299+      |  ^~~~~~~
> 1300+drivers/pinctrl/pinctrl-kendryte.c:187:3: error: array index in
> initializer not of integer type
> 1301+drivers/pinctrl/pinctrl-kendryte.c:187:3: note: (near
> initialization for 'k210_pc_mode_id_to_mode')
> 1302+make[3]: *** [drivers/pinctrl/pinctrl-kendryte.o] Error 1
> 
> Thanks,
> Rick
> 

Ok, should be fixed in v2.

--Sean

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-11-13 13:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-25 20:00 [PATCH 1/2] pinctrl: k210: Fix inverted IE and OE for I2C Sean Anderson
2020-10-25 20:00 ` [PATCH 2/2] pinctrl: k210: Rename power domains to match datasheet Sean Anderson
2020-11-03  6:41   ` Rick Chen
2020-11-03  6:40 ` [PATCH 1/2] pinctrl: k210: Fix inverted IE and OE for I2C Rick Chen
2020-11-13  7:19   ` Rick Chen
2020-11-13 13:44     ` Sean Anderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox