All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] configs: libretech: set SPI mode to 0
@ 2021-07-02 21:11 Da Xue
  2021-07-02 22:01 ` Neil Armstrong
  0 siblings, 1 reply; 4+ messages in thread
From: Da Xue @ 2021-07-02 21:11 UTC (permalink / raw)
  To: Neil Armstrong; +Cc: U-Boot Mailing List, u-boot-amlogic, Marek Vasut, Tom Rini

Kconfig defaults to mode 3 if CONFIG_SF_DEFAULT_MODE is not set.
It becomes an issue since meson_spifc does not support SPI_CPHA.
Needed after commit e2e95e5e25421fbef499e21bf94a5339701f9a99.

Signed-off-by:Da Xue <da@libre.computer>
---
 configs/libretech-ac_defconfig       | 1 +
 configs/libretech-cc_v2_defconfig    | 1 +
 configs/libretech-s905d-pc_defconfig | 1 +
 configs/libretech-s912-pc_defconfig  | 1 +
 4 files changed, 4 insertions(+)

diff --git a/configs/libretech-ac_defconfig b/configs/libretech-ac_defconfig
index ec51f2ad38..9abbcad3c0 100644
--- a/configs/libretech-ac_defconfig
+++ b/configs/libretech-ac_defconfig
@@ -39,6 +39,7 @@ CONFIG_MMC_MESON_GX=y
 CONFIG_MTD=y
 CONFIG_DM_MTD=y
 CONFIG_DM_SPI_FLASH=y
+CONFIG_SF_DEFAULT_MODE=0x0
 CONFIG_SPI_FLASH_GIGADEVICE=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_PHY_MESON_GXL=y
diff --git a/configs/libretech-cc_v2_defconfig
b/configs/libretech-cc_v2_defconfig
index 97c8a9e47b..7dc6ed2f29 100644
--- a/configs/libretech-cc_v2_defconfig
+++ b/configs/libretech-cc_v2_defconfig
@@ -35,6 +35,7 @@ CONFIG_MMC_MESON_GX=y
 CONFIG_MTD=y
 CONFIG_DM_MTD=y
 CONFIG_DM_SPI_FLASH=y
+CONFIG_SF_DEFAULT_MODE=0x0
 CONFIG_SPI_FLASH_GIGADEVICE=y
 CONFIG_PHY_MESON_GXL=y
 CONFIG_DM_ETH=y
diff --git a/configs/libretech-s905d-pc_defconfig
b/configs/libretech-s905d-pc_defconfig
index c0301a0aa0..93523c23cf 100644
--- a/configs/libretech-s905d-pc_defconfig
+++ b/configs/libretech-s905d-pc_defconfig
@@ -36,6 +36,7 @@ CONFIG_SARADC_MESON=y
 CONFIG_MMC_MESON_GX=y
 CONFIG_MTD=y
 CONFIG_DM_SPI_FLASH=y
+CONFIG_SF_DEFAULT_MODE=0x0
 CONFIG_SPI_FLASH_GIGADEVICE=y
 CONFIG_PHY_REALTEK=y
 CONFIG_DM_ETH=y
diff --git a/configs/libretech-s912-pc_defconfig
b/configs/libretech-s912-pc_defconfig
index e2faea6242..669f000f7f 100644
--- a/configs/libretech-s912-pc_defconfig
+++ b/configs/libretech-s912-pc_defconfig
@@ -35,6 +35,7 @@ CONFIG_SARADC_MESON=y
 CONFIG_MMC_MESON_GX=y
 CONFIG_MTD=y
 CONFIG_DM_SPI_FLASH=y
+CONFIG_SF_DEFAULT_MODE=0x0
 CONFIG_SPI_FLASH_GIGADEVICE=y
 CONFIG_PHY_REALTEK=y
 CONFIG_DM_ETH=y
-- 
2.30.2

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

* Re: [PATCH] configs: libretech: set SPI mode to 0
  2021-07-02 21:11 [PATCH] configs: libretech: set SPI mode to 0 Da Xue
@ 2021-07-02 22:01 ` Neil Armstrong
  2021-07-02 22:26   ` Marek Vasut
  0 siblings, 1 reply; 4+ messages in thread
From: Neil Armstrong @ 2021-07-02 22:01 UTC (permalink / raw)
  To: Da Xue; +Cc: U-Boot Mailing List, u-boot-amlogic, Marek Vasut, Tom Rini

On 02/07/2021 23:11, Da Xue wrote:
> Kconfig defaults to mode 3 if CONFIG_SF_DEFAULT_MODE is not set.
> It becomes an issue since meson_spifc does not support SPI_CPHA.
> Needed after commit e2e95e5e25421fbef499e21bf94a5339701f9a99.
> 
> Signed-off-by:Da Xue <da@libre.computer>
> ---
>  configs/libretech-ac_defconfig       | 1 +
>  configs/libretech-cc_v2_defconfig    | 1 +
>  configs/libretech-s905d-pc_defconfig | 1 +
>  configs/libretech-s912-pc_defconfig  | 1 +
>  4 files changed, 4 insertions(+)
> 
> diff --git a/configs/libretech-ac_defconfig b/configs/libretech-ac_defconfig
> index ec51f2ad38..9abbcad3c0 100644
> --- a/configs/libretech-ac_defconfig
> +++ b/configs/libretech-ac_defconfig
> @@ -39,6 +39,7 @@ CONFIG_MMC_MESON_GX=y
>  CONFIG_MTD=y
>  CONFIG_DM_MTD=y
>  CONFIG_DM_SPI_FLASH=y
> +CONFIG_SF_DEFAULT_MODE=0x0
>  CONFIG_SPI_FLASH_GIGADEVICE=y
>  CONFIG_SPI_FLASH_SPANSION=y
>  CONFIG_PHY_MESON_GXL=y
> diff --git a/configs/libretech-cc_v2_defconfig b/configs/libretech-cc_v2_defconfig
> index 97c8a9e47b..7dc6ed2f29 100644
> --- a/configs/libretech-cc_v2_defconfig
> +++ b/configs/libretech-cc_v2_defconfig
> @@ -35,6 +35,7 @@ CONFIG_MMC_MESON_GX=y
>  CONFIG_MTD=y
>  CONFIG_DM_MTD=y
>  CONFIG_DM_SPI_FLASH=y
> +CONFIG_SF_DEFAULT_MODE=0x0
>  CONFIG_SPI_FLASH_GIGADEVICE=y
>  CONFIG_PHY_MESON_GXL=y
>  CONFIG_DM_ETH=y
> diff --git a/configs/libretech-s905d-pc_defconfig b/configs/libretech-s905d-pc_defconfig
> index c0301a0aa0..93523c23cf 100644
> --- a/configs/libretech-s905d-pc_defconfig
> +++ b/configs/libretech-s905d-pc_defconfig
> @@ -36,6 +36,7 @@ CONFIG_SARADC_MESON=y
>  CONFIG_MMC_MESON_GX=y
>  CONFIG_MTD=y
>  CONFIG_DM_SPI_FLASH=y
> +CONFIG_SF_DEFAULT_MODE=0x0
>  CONFIG_SPI_FLASH_GIGADEVICE=y
>  CONFIG_PHY_REALTEK=y
>  CONFIG_DM_ETH=y
> diff --git a/configs/libretech-s912-pc_defconfig b/configs/libretech-s912-pc_defconfig
> index e2faea6242..669f000f7f 100644
> --- a/configs/libretech-s912-pc_defconfig
> +++ b/configs/libretech-s912-pc_defconfig
> @@ -35,6 +35,7 @@ CONFIG_SARADC_MESON=y
>  CONFIG_MMC_MESON_GX=y
>  CONFIG_MTD=y
>  CONFIG_DM_SPI_FLASH=y
> +CONFIG_SF_DEFAULT_MODE=0x0
>  CONFIG_SPI_FLASH_GIGADEVICE=y
>  CONFIG_PHY_REALTEK=y
>  CONFIG_DM_ETH=y
> -- 
> 2.30.2
> 
> 

Thanks,
Applying to u-boot-amlogic & sending PR to have it in this release

Neil

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

* Re: [PATCH] configs: libretech: set SPI mode to 0
  2021-07-02 22:01 ` Neil Armstrong
@ 2021-07-02 22:26   ` Marek Vasut
  2021-07-02 23:10     ` Tom Rini
  0 siblings, 1 reply; 4+ messages in thread
From: Marek Vasut @ 2021-07-02 22:26 UTC (permalink / raw)
  To: Neil Armstrong, Da Xue
  Cc: U-Boot Mailing List, u-boot-amlogic, Tom Rini, Patrick DELAUNAY

On 7/3/21 12:01 AM, Neil Armstrong wrote:

[...]

>> diff --git a/configs/libretech-s912-pc_defconfig b/configs/libretech-s912-pc_defconfig
>> index e2faea6242..669f000f7f 100644
>> --- a/configs/libretech-s912-pc_defconfig
>> +++ b/configs/libretech-s912-pc_defconfig
>> @@ -35,6 +35,7 @@ CONFIG_SARADC_MESON=y
>>   CONFIG_MMC_MESON_GX=y
>>   CONFIG_MTD=y
>>   CONFIG_DM_SPI_FLASH=y
>> +CONFIG_SF_DEFAULT_MODE=0x0
>>   CONFIG_SPI_FLASH_GIGADEVICE=y
>>   CONFIG_PHY_REALTEK=y
>>   CONFIG_DM_ETH=y
>> -- 
>> 2.30.2
>>
>>
> 
> Thanks,
> Applying to u-boot-amlogic & sending PR to have it in this release

I have a feeling the real fix would be to revisit

14453fbfad ("Convert CONFIG_SF_DEFAULT_* to Kconfig")

change the default mode to 0 in Kconfig and fix up the few boards which 
use SPI mode 3 .

But that can wait after the release, since I think most of the board 
configs did get updated with SF_DEFAULT_MODE=0 config. CCing Patrick.

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

* Re: [PATCH] configs: libretech: set SPI mode to 0
  2021-07-02 22:26   ` Marek Vasut
@ 2021-07-02 23:10     ` Tom Rini
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2021-07-02 23:10 UTC (permalink / raw)
  To: Marek Vasut
  Cc: Neil Armstrong, Da Xue, U-Boot Mailing List, u-boot-amlogic,
	Patrick DELAUNAY

[-- Attachment #1: Type: text/plain, Size: 1941 bytes --]

On Sat, Jul 03, 2021 at 12:26:51AM +0200, Marek Vasut wrote:
> On 7/3/21 12:01 AM, Neil Armstrong wrote:
> 
> [...]
> 
> > > diff --git a/configs/libretech-s912-pc_defconfig b/configs/libretech-s912-pc_defconfig
> > > index e2faea6242..669f000f7f 100644
> > > --- a/configs/libretech-s912-pc_defconfig
> > > +++ b/configs/libretech-s912-pc_defconfig
> > > @@ -35,6 +35,7 @@ CONFIG_SARADC_MESON=y
> > >   CONFIG_MMC_MESON_GX=y
> > >   CONFIG_MTD=y
> > >   CONFIG_DM_SPI_FLASH=y
> > > +CONFIG_SF_DEFAULT_MODE=0x0
> > >   CONFIG_SPI_FLASH_GIGADEVICE=y
> > >   CONFIG_PHY_REALTEK=y
> > >   CONFIG_DM_ETH=y
> > > -- 
> > > 2.30.2
> > > 
> > > 
> > 
> > Thanks,
> > Applying to u-boot-amlogic & sending PR to have it in this release
> 
> I have a feeling the real fix would be to revisit
> 
> 14453fbfad ("Convert CONFIG_SF_DEFAULT_* to Kconfig")
> 
> change the default mode to 0 in Kconfig and fix up the few boards which use
> SPI mode 3 .
> 
> But that can wait after the release, since I think most of the board configs
> did get updated with SF_DEFAULT_MODE=0 config. CCing Patrick.

So, lets do a little forensic work.  Stepping back to 14453fbfad and
none of the broken but fixed here boards existed.  So, picking on
configs/libretech-cc_v2_defconfig for a minute, ade0100a9162 introduced
that board and.. it wasn't setting SF_DEFAULT_MODE anywhere.  Digging
around a bit more right now, I don't see meson platforms setting that
value anywhere, ever (and aside, I see a few config.h files that need a
kick right now, sigh).  That means it was getting the default of
SPI_MODE_3.  Which means, are there other platforms that were using the
default before, but needed to really be using something else and
e2e95e5e2542 should have waited?  I'm not sure.  Does that also mean
that other amlogic platforms need a change here?  Not sure if my le
potato would show the problem off-hand.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

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

end of thread, other threads:[~2021-07-02 23:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-02 21:11 [PATCH] configs: libretech: set SPI mode to 0 Da Xue
2021-07-02 22:01 ` Neil Armstrong
2021-07-02 22:26   ` Marek Vasut
2021-07-02 23:10     ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.