Re: [PATCH] ath79: drop cs-gpios property

2021-04-18 Thread Chuanhong Guo
Hi!

On Fri, Apr 16, 2021 at 6:23 PM David Bauer  wrote:
>
> Hi,
>
> On 4/16/21 4:12 AM, Chuanhong Guo wrote:
> > Hi!
> >
> > On Fri, Apr 16, 2021 at 4:43 AM David Bauer  wrote:
> >>
> >> The spi-ath79 driver performs the chipselect by writing to dedicated
> >> register in the SPI register block. So the GPIO numbers were not used.
> >
> > This is cs-gpios is a hack to override incorrect num_chipselects in 
> > spi-ath79
> > driver (which is set to fixed 1). spi-ath79 should be patched to fix
> > this problem
> > before cs-gpios for ar7161/ar7242 devices can be dropped.
>
> Thanks for the hint, i missed ar93xx uses the newer SPI driver.
>
> Looking at spi-ath79, the number of CS lines can be modified using platform
> data, however all datasheets from ar71xx up to qca956x i could get my hand on
> list 3 chipselect lines available - so a patch which sets the CS count to 3
> should be sufficient?

Correct.

-- 
Regards,
Chuanhong Guo

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH] ath79: drop cs-gpios property

2021-04-16 Thread David Bauer
Hi,

On 4/16/21 4:12 AM, Chuanhong Guo wrote:
> Hi!
> 
> On Fri, Apr 16, 2021 at 4:43 AM David Bauer  wrote:
>>
>> The spi-ath79 driver performs the chipselect by writing to dedicated
>> register in the SPI register block. So the GPIO numbers were not used.
> 
> This is cs-gpios is a hack to override incorrect num_chipselects in spi-ath79
> driver (which is set to fixed 1). spi-ath79 should be patched to fix
> this problem
> before cs-gpios for ar7161/ar7242 devices can be dropped.

Thanks for the hint, i missed ar93xx uses the newer SPI driver.

Looking at spi-ath79, the number of CS lines can be modified using platform
data, however all datasheets from ar71xx up to qca956x i could get my hand on
list 3 chipselect lines available - so a patch which sets the CS count to 3
should be sufficient?

I have some other SPI patches waiting to be sent upstream, so I can take care
of that.

Best wishes
David

> It's not needed on ar9344 because the new spi-ar934x driver doesn't have
> this problem.
> 

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH] ath79: drop cs-gpios property

2021-04-15 Thread Chuanhong Guo
Hi!

On Fri, Apr 16, 2021 at 4:43 AM David Bauer  wrote:
>
> The spi-ath79 driver performs the chipselect by writing to dedicated
> register in the SPI register block. So the GPIO numbers were not used.

This is cs-gpios is a hack to override incorrect num_chipselects in spi-ath79
driver (which is set to fixed 1). spi-ath79 should be patched to fix
this problem
before cs-gpios for ar7161/ar7242 devices can be dropped.
It's not needed on ar9344 because the new spi-ar934x driver doesn't have
this problem.

-- 
Regards,
Chuanhong Guo

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] ath79: drop cs-gpios property

2021-04-15 Thread David Bauer
The spi-ath79 driver performs the chipselect by writing to dedicated
register in the SPI register block. So the GPIO numbers were not used.

Tested-on: Enterasys WS-AP3705i

Signed-off-by: David Bauer 
---
 target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi| 1 -
 target/linux/ath79/dts/ar7242_buffalo_wzr-bhr.dtsi  | 2 --
 target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts | 2 --
 target/linux/ath79/dts/ar9344_enterasys_ws-ap3705i.dts  | 2 --
 4 files changed, 7 deletions(-)

diff --git a/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi 
b/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi
index 109ed0caf3..b8176dc059 100644
--- a/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi
+++ b/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi
@@ -219,7 +219,6 @@
  {
status = "okay";
 
-   cs-gpios = <0>, <0>;
 
flash0: flash@0 {
compatible = "jedec,spi-nor";
diff --git a/target/linux/ath79/dts/ar7242_buffalo_wzr-bhr.dtsi 
b/target/linux/ath79/dts/ar7242_buffalo_wzr-bhr.dtsi
index 98f6759eac..df28111598 100644
--- a/target/linux/ath79/dts/ar7242_buffalo_wzr-bhr.dtsi
+++ b/target/linux/ath79/dts/ar7242_buffalo_wzr-bhr.dtsi
@@ -107,8 +107,6 @@
  {
status = "okay";
 
-   cs-gpios = <0>, <0>;
-
flash0: flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
diff --git a/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts 
b/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts
index 7cb051a475..111d06491e 100644
--- a/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts
+++ b/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts
@@ -163,8 +163,6 @@
  {
status = "okay";
 
-   cs-gpios = <0>, <0>;
-
flash0: flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
diff --git a/target/linux/ath79/dts/ar9344_enterasys_ws-ap3705i.dts 
b/target/linux/ath79/dts/ar9344_enterasys_ws-ap3705i.dts
index 52becec18b..8f8276255a 100644
--- a/target/linux/ath79/dts/ar9344_enterasys_ws-ap3705i.dts
+++ b/target/linux/ath79/dts/ar9344_enterasys_ws-ap3705i.dts
@@ -114,8 +114,6 @@
  {
status = "okay";
 
-   cs-gpios = <0>, <0>;
-
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
-- 
2.31.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel