Re: [OpenWrt-Devel] [PATCH 3/3] ipq40xx: ipq4019: Add new device Compex WPJ419

2019-10-31 Thread Daniel Danzberger
It turned out that the wifi wasn't working because of a missmatch in the mtd
"art" partition naming. The ath10k caldata hotplug script was expecting it named
"0:ART" instead of "art".
Wifi seems to work fine now.
I will drop those files in the next PR.

On 10/31/19 1:12 PM, Robert Marko wrote:
> On Thu, 31 Oct 2019 at 13:10, Daniel Danzberger  wrote:
>>
>> Hi Jeff,
>>>
>>>  .../arch/arm/boot/dts/qcom-ipq4019-bus.dtsi   | 1142 +
>>>  .../include/dt-bindings/msm/msm-bus-ids.h |  869 +
>>>
>>> The sudden appearance of a need the MSM bus and its IDs worries me.
>>>
>>> With 25 devices already on the ipq40xx platform without them, it feels
>>> like something is missing if they are needed by this one.
>>
>> I already tried it without those files, but the wifi won't get detected in 
>> that
>> case.
> That is because you are trying to reuse QSDK DTS, this wont wont
> neither its supported.
> You need to convert it to OpenWrt/Upstream kernel style and bindings.
> There are lot of examples in ipq40xx already.
>>
>>>
>>>
 diff --git a/target/linux/ipq40xx/config-4.19 
 b/target/linux/ipq40xx/config-4.19
 index 8948b73ff7..3ee921abed 100644
 --- a/target/linux/ipq40xx/config-4.19
 +++ b/target/linux/ipq40xx/config-4.19
 @@ -303,6 +303,9 @@ CONFIG_MTD_NAND_ECC=y
   CONFIG_MTD_NAND_QCOM=y
   CONFIG_MTD_SPI_NAND=y
   CONFIG_MTD_SPI_NOR=y
 +CONFIG_MTD_SPINAND_MT29F=y
 +CONFIG_MTD_SPINAND_GIGADEVICE=y
 +CONFIG_MTD_SPINAND_ONDIEECC=y
>>>
>>>
>>> The CONFIG_SPINAND_* additions are not required for upstream SPI-NAND
>>>
>>>
   CONFIG_MTD_SPLIT_FIRMWARE=y
   CONFIG_MTD_SPLIT_FIT_FW=y
   CONFIG_MTD_UBI=y

 [...]

 diff --git
 a/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
 b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
 new file mode 100644
 index 00..5553bbd166
 --- /dev/null
 +++ 
 b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
 @@ -0,0 +1,371 @@
 +/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
 + * Copyright (c) 2019, Nguyen Dinh Phi 
 + *
 + * Permission to use, copy, modify, and/or distribute this software for 
 any
 + * purpose with or without fee is hereby granted, provided that the above
 + * copyright notice and this permission notice appear in all copies.
 + *
 + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 
 WARRANTIES
 + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 + *
 + */
 +

 [...]

 +
 +spi_0: spi@78b5000 {
 +pinctrl-0 = <_0_pins>;
 +pinctrl-names = "default";
 +status = "okay";
 +cs-gpios = < 12 GPIO_ACTIVE_HIGH>, < 41 
 GPIO_ACTIVE_HIGH>;
 +num-cs = <2>;
 +
 +m25p80@0 {
 +#address-cells = <1>;
 +#size-cells = <1>;
 +reg = <0>;
 +linux,modalias = "m25p80", "n25q128a11";
 +compatible = "jedec,spi-nor", "n25q128a11";
 +spi-max-frequency = <2400>;
>>>
>>>
>>> I don't think you need linux,modalias here, nor the chip type in the 
>>> compatible
>>> line.
>>> I believe that the following compatible line is sufficient
>>>
>>> compatible = "jedec,spi-nor";
>>>
>>>
>>> You might also want to consider "flash@0" or "nor@0" or "nor_flash@0",
>>> or the like, rather than a chip-specific name. (I'm not a committer.)
>>>
>>>
 +
 +partitions {
 +compatible = "fixed-partitions";
 +
 +partition@0 {
 +label = "0:SBL1";
 +reg = <0x00 0x04>;
 +read-only;
 +};
 +
 +partition@4 {
 +label = "0:MIBIB";
 +reg = <0x04 0x02>;
 +read-only;
 +};
 +
 +partition@6 {
 +label = "0:QSEE";
 +reg = <0x06 0x06>;
 +read-only;
 +};
 +
 +partition@c {
 +label = "0:CDT";
 +reg = <0x0c 0x01>;

Re: [OpenWrt-Devel] [PATCH 3/3] ipq40xx: ipq4019: Add new device Compex WPJ419

2019-10-31 Thread Robert Marko
On Thu, 31 Oct 2019 at 13:10, Daniel Danzberger  wrote:
>
> Hi Jeff,
> >
> >  .../arch/arm/boot/dts/qcom-ipq4019-bus.dtsi   | 1142 +
> >  .../include/dt-bindings/msm/msm-bus-ids.h |  869 +
> >
> > The sudden appearance of a need the MSM bus and its IDs worries me.
> >
> > With 25 devices already on the ipq40xx platform without them, it feels
> > like something is missing if they are needed by this one.
>
> I already tried it without those files, but the wifi won't get detected in 
> that
> case.
That is because you are trying to reuse QSDK DTS, this wont wont
neither its supported.
You need to convert it to OpenWrt/Upstream kernel style and bindings.
There are lot of examples in ipq40xx already.
>
> >
> >
> >> diff --git a/target/linux/ipq40xx/config-4.19 
> >> b/target/linux/ipq40xx/config-4.19
> >> index 8948b73ff7..3ee921abed 100644
> >> --- a/target/linux/ipq40xx/config-4.19
> >> +++ b/target/linux/ipq40xx/config-4.19
> >> @@ -303,6 +303,9 @@ CONFIG_MTD_NAND_ECC=y
> >>   CONFIG_MTD_NAND_QCOM=y
> >>   CONFIG_MTD_SPI_NAND=y
> >>   CONFIG_MTD_SPI_NOR=y
> >> +CONFIG_MTD_SPINAND_MT29F=y
> >> +CONFIG_MTD_SPINAND_GIGADEVICE=y
> >> +CONFIG_MTD_SPINAND_ONDIEECC=y
> >
> >
> > The CONFIG_SPINAND_* additions are not required for upstream SPI-NAND
> >
> >
> >>   CONFIG_MTD_SPLIT_FIRMWARE=y
> >>   CONFIG_MTD_SPLIT_FIT_FW=y
> >>   CONFIG_MTD_UBI=y
> >>
> >> [...]
> >>
> >> diff --git
> >> a/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
> >> b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
> >> new file mode 100644
> >> index 00..5553bbd166
> >> --- /dev/null
> >> +++ 
> >> b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
> >> @@ -0,0 +1,371 @@
> >> +/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
> >> + * Copyright (c) 2019, Nguyen Dinh Phi 
> >> + *
> >> + * Permission to use, copy, modify, and/or distribute this software for 
> >> any
> >> + * purpose with or without fee is hereby granted, provided that the above
> >> + * copyright notice and this permission notice appear in all copies.
> >> + *
> >> + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 
> >> WARRANTIES
> >> + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
> >> + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
> >> + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
> >> + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
> >> + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
> >> + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
> >> + *
> >> + */
> >> +
> >>
> >> [...]
> >>
> >> +
> >> +spi_0: spi@78b5000 {
> >> +pinctrl-0 = <_0_pins>;
> >> +pinctrl-names = "default";
> >> +status = "okay";
> >> +cs-gpios = < 12 GPIO_ACTIVE_HIGH>, < 41 
> >> GPIO_ACTIVE_HIGH>;
> >> +num-cs = <2>;
> >> +
> >> +m25p80@0 {
> >> +#address-cells = <1>;
> >> +#size-cells = <1>;
> >> +reg = <0>;
> >> +linux,modalias = "m25p80", "n25q128a11";
> >> +compatible = "jedec,spi-nor", "n25q128a11";
> >> +spi-max-frequency = <2400>;
> >
> >
> > I don't think you need linux,modalias here, nor the chip type in the 
> > compatible
> > line.
> > I believe that the following compatible line is sufficient
> >
> > compatible = "jedec,spi-nor";
> >
> >
> > You might also want to consider "flash@0" or "nor@0" or "nor_flash@0",
> > or the like, rather than a chip-specific name. (I'm not a committer.)
> >
> >
> >> +
> >> +partitions {
> >> +compatible = "fixed-partitions";
> >> +
> >> +partition@0 {
> >> +label = "0:SBL1";
> >> +reg = <0x00 0x04>;
> >> +read-only;
> >> +};
> >> +
> >> +partition@4 {
> >> +label = "0:MIBIB";
> >> +reg = <0x04 0x02>;
> >> +read-only;
> >> +};
> >> +
> >> +partition@6 {
> >> +label = "0:QSEE";
> >> +reg = <0x06 0x06>;
> >> +read-only;
> >> +};
> >> +
> >> +partition@c {
> >> +label = "0:CDT";
> >> +reg = <0x0c 0x01>;
> >> +read-only;
> >> +};
> >
> >
> > Someone may rip on you for capitalization of labels. (I'm not a committer.)
> >
> >
> >> +
> >> +partition@d {
> >> +label = "0:DDRPARAMS";
> >> +reg = 

Re: [OpenWrt-Devel] [PATCH 3/3] ipq40xx: ipq4019: Add new device Compex WPJ419

2019-10-31 Thread Daniel Danzberger
Hi Jeff,
> 
>  .../arch/arm/boot/dts/qcom-ipq4019-bus.dtsi   | 1142 +
>  .../include/dt-bindings/msm/msm-bus-ids.h |  869 +
> 
> The sudden appearance of a need the MSM bus and its IDs worries me.
> 
> With 25 devices already on the ipq40xx platform without them, it feels
> like something is missing if they are needed by this one.

I already tried it without those files, but the wifi won't get detected in that
case.

> 
> 
>> diff --git a/target/linux/ipq40xx/config-4.19 
>> b/target/linux/ipq40xx/config-4.19
>> index 8948b73ff7..3ee921abed 100644
>> --- a/target/linux/ipq40xx/config-4.19
>> +++ b/target/linux/ipq40xx/config-4.19
>> @@ -303,6 +303,9 @@ CONFIG_MTD_NAND_ECC=y
>>   CONFIG_MTD_NAND_QCOM=y
>>   CONFIG_MTD_SPI_NAND=y
>>   CONFIG_MTD_SPI_NOR=y
>> +CONFIG_MTD_SPINAND_MT29F=y
>> +CONFIG_MTD_SPINAND_GIGADEVICE=y
>> +CONFIG_MTD_SPINAND_ONDIEECC=y
> 
> 
> The CONFIG_SPINAND_* additions are not required for upstream SPI-NAND
> 
> 
>>   CONFIG_MTD_SPLIT_FIRMWARE=y
>>   CONFIG_MTD_SPLIT_FIT_FW=y
>>   CONFIG_MTD_UBI=y
>>
>> [...]
>>
>> diff --git
>> a/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
>> b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
>> new file mode 100644
>> index 00..5553bbd166
>> --- /dev/null
>> +++ 
>> b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
>> @@ -0,0 +1,371 @@
>> +/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
>> + * Copyright (c) 2019, Nguyen Dinh Phi 
>> + *
>> + * Permission to use, copy, modify, and/or distribute this software for any
>> + * purpose with or without fee is hereby granted, provided that the above
>> + * copyright notice and this permission notice appear in all copies.
>> + *
>> + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
>> + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
>> + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
>> + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
>> + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
>> + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
>> + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
>> + *
>> + */
>> +
>>
>> [...]
>>
>> +
>> +    spi_0: spi@78b5000 {
>> +    pinctrl-0 = <_0_pins>;
>> +    pinctrl-names = "default";
>> +    status = "okay";
>> +    cs-gpios = < 12 GPIO_ACTIVE_HIGH>, < 41 
>> GPIO_ACTIVE_HIGH>;
>> +    num-cs = <2>;
>> +
>> +    m25p80@0 {
>> +    #address-cells = <1>;
>> +    #size-cells = <1>;
>> +    reg = <0>;
>> +    linux,modalias = "m25p80", "n25q128a11";
>> +    compatible = "jedec,spi-nor", "n25q128a11";
>> +    spi-max-frequency = <2400>;
> 
> 
> I don't think you need linux,modalias here, nor the chip type in the 
> compatible
> line.
> I believe that the following compatible line is sufficient
> 
>     compatible = "jedec,spi-nor";
> 
> 
> You might also want to consider "flash@0" or "nor@0" or "nor_flash@0",
> or the like, rather than a chip-specific name. (I'm not a committer.)
> 
> 
>> +
>> +    partitions {
>> +    compatible = "fixed-partitions";
>> +
>> +    partition@0 {
>> +    label = "0:SBL1";
>> +    reg = <0x00 0x04>;
>> +    read-only;
>> +    };
>> +
>> +    partition@4 {
>> +    label = "0:MIBIB";
>> +    reg = <0x04 0x02>;
>> +    read-only;
>> +    };
>> +
>> +    partition@6 {
>> +    label = "0:QSEE";
>> +    reg = <0x06 0x06>;
>> +    read-only;
>> +    };
>> +
>> +    partition@c {
>> +    label = "0:CDT";
>> +    reg = <0x0c 0x01>;
>> +    read-only;
>> +    };
> 
> 
> Someone may rip on you for capitalization of labels. (I'm not a committer.)
> 
> 
>> +
>> +    partition@d {
>> +    label = "0:DDRPARAMS";
>> +    reg = <0x0d 0x01>;
>> +    read-only;
>> +    };
>> +
>> +    partition@e {
>> +    label = "u-boot-env";
>> +    reg = <0x0e 0x01>;
>> +    read-only;
>> +    };
> 
> 
> U-Boot environment may want/need to be writable
> 
> 
>> +
>> +    partition@f {
>> +    label = "u-boot";
>> +    reg = <0x0f 0x08>;
>> +

Re: [OpenWrt-Devel] [PATCH 3/3] ipq40xx: ipq4019: Add new device Compex WPJ419

2019-10-31 Thread Robert Marko
Because of old MT29F driver, it was basically a hack just to get
SPI-NANDs working.

On Thu, 31 Oct 2019 at 11:34, Daniel Danzberger  wrote:
>
> Well, that makes sense and now it works :)
> I am just wondering why it has been working before with the other driver.
>
> On 10/31/19 11:30 AM, Robert Marko wrote:
> > On Thu, 31 Oct 2019 at 11:30, Daniel Danzberger  wrote:
> >>
> >> I am already using 'ubi.mtd=rootfs root=/dev/ubiblock0_1', which has 
> >> worked before
> > Well this is the issue, your ubi.mtd needs to be ubi.mtd=ubi
> >>
> >> On 10/31/19 11:26 AM, Robert Marko wrote:
> >>> On Thu, 31 Oct 2019 at 11:25, Daniel Danzberger  wrote:
> 
>  On the deprecated staging driver, it somehow directly came up as 
>  "rootfs" and
>  not "ubi". Even though it has been named "ubi" in the dts.
>  Now the image won't boot because no rootfs is detected:
> 
>  
>  [1.919001] Creating 1 MTD partitions on "spi0.1":
>  [1.925399] 0x-0x0800 : "ubi"
>  [1.940324] random: fast init done
>  ...
>  [3.170978] UBI error: cannot open mtd rootfs, error -2
>  [3.171027] hctosys: unable to open rtc device ([3.180802] 
>  Waiting for
>  root device /dev/ubiblock0_1...
> >>> This is due to your bootargs, you can either use bootargs-append to
> >>> set rootfs to ubi or change them in bootloader.
> >>> This is classic on boards derived from QCA reference designs
>  
> 
> 
>  On 10/31/19 11:19 AM, Robert Marko wrote:
> > On Thu, 31 Oct 2019 at 11:17, Daniel Danzberger  
> > wrote:
> >>
> >> Using 'compatible = "spi-nand"' worked and the device got detected by 
> >> the
> >> driver. However it won't create and "rootfs" partition like it did 
> >> before.
> >>
> >> ---
> >> [1.901930] spi-nand spi0.1: GigaDevice SPI NAND was found.
> >> [1.905266] spi-nand spi0.1: 128 MiB, block size: 128 KiB, page 
> >> size: 2048,
> >> OOB size: 128
> >> [1.911015] 1 fixed-partitions partitions found on MTD device spi0.1
> >> [1.919010] Creating 1 MTD partitions on "spi0.1":
> >> [1.925410] 0x-0x0800 : "ubi"
> > It creates the partitions like set in DTS, ubi partition contains both
> > kernel and rootfs.
> >> ---
> >>
> >>
> >> On 10/30/19 4:51 PM, Jeff Kletsky wrote:
> >>> On 10/30/19 4:27 AM, Daniel Danzberger wrote:
> >>>
>  This device contains 2 flash devices. One NOR (32M) and one NAND 
>  (128M).
>  U-boot and caldata are on the NOR, the firmware on the NAND.
> 
>   SoC:IPQ4019
>   CPU:4x 710MHz ARMv7
>   RAM:256MB
>   FLASH:  NOR:32MB NAND:128MB
> 
>  [...]
> 
> 
> >>>
> >>>  .../arch/arm/boot/dts/qcom-ipq4019-bus.dtsi   | 1142 
> >>> +
> >>>  .../include/dt-bindings/msm/msm-bus-ids.h |  869 +
> >>>
> >>> The sudden appearance of a need the MSM bus and its IDs worries me.
> >>>
> >>> With 25 devices already on the ipq40xx platform without them, it feels
> >>> like something is missing if they are needed by this one.
> >>>
> >>>
>  diff --git a/target/linux/ipq40xx/config-4.19 
>  b/target/linux/ipq40xx/config-4.19
>  index 8948b73ff7..3ee921abed 100644
>  --- a/target/linux/ipq40xx/config-4.19
>  +++ b/target/linux/ipq40xx/config-4.19
>  @@ -303,6 +303,9 @@ CONFIG_MTD_NAND_ECC=y
>    CONFIG_MTD_NAND_QCOM=y
>    CONFIG_MTD_SPI_NAND=y
>    CONFIG_MTD_SPI_NOR=y
>  +CONFIG_MTD_SPINAND_MT29F=y
>  +CONFIG_MTD_SPINAND_GIGADEVICE=y
>  +CONFIG_MTD_SPINAND_ONDIEECC=y
> >>>
> >>>
> >>> The CONFIG_SPINAND_* additions are not required for upstream SPI-NAND
> >>>
> >>>
>    CONFIG_MTD_SPLIT_FIRMWARE=y
>    CONFIG_MTD_SPLIT_FIT_FW=y
>    CONFIG_MTD_UBI=y
> 
>  [...]
> 
>  diff --git
>  a/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
>  b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
>  new file mode 100644
>  index 00..5553bbd166
>  --- /dev/null
>  +++ 
>  b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
>  @@ -0,0 +1,371 @@
>  +/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
>  + * Copyright (c) 2019, Nguyen Dinh Phi 
>  + *
>  + * Permission to use, copy, modify, and/or distribute this software 
>  for any
>  + * purpose with or without fee is hereby granted, provided that the 
>  above
>  + * copyright notice and this permission notice appear in all copies.
>  + *
>  + * THE 

Re: [OpenWrt-Devel] [PATCH 3/3] ipq40xx: ipq4019: Add new device Compex WPJ419

2019-10-31 Thread Daniel Danzberger
Well, that makes sense and now it works :)
I am just wondering why it has been working before with the other driver.

On 10/31/19 11:30 AM, Robert Marko wrote:
> On Thu, 31 Oct 2019 at 11:30, Daniel Danzberger  wrote:
>>
>> I am already using 'ubi.mtd=rootfs root=/dev/ubiblock0_1', which has worked 
>> before
> Well this is the issue, your ubi.mtd needs to be ubi.mtd=ubi
>>
>> On 10/31/19 11:26 AM, Robert Marko wrote:
>>> On Thu, 31 Oct 2019 at 11:25, Daniel Danzberger  wrote:

 On the deprecated staging driver, it somehow directly came up as "rootfs" 
 and
 not "ubi". Even though it has been named "ubi" in the dts.
 Now the image won't boot because no rootfs is detected:

 
 [1.919001] Creating 1 MTD partitions on "spi0.1":
 [1.925399] 0x-0x0800 : "ubi"
 [1.940324] random: fast init done
 ...
 [3.170978] UBI error: cannot open mtd rootfs, error -2
 [3.171027] hctosys: unable to open rtc device ([3.180802] Waiting 
 for
 root device /dev/ubiblock0_1...
>>> This is due to your bootargs, you can either use bootargs-append to
>>> set rootfs to ubi or change them in bootloader.
>>> This is classic on boards derived from QCA reference designs
 


 On 10/31/19 11:19 AM, Robert Marko wrote:
> On Thu, 31 Oct 2019 at 11:17, Daniel Danzberger  wrote:
>>
>> Using 'compatible = "spi-nand"' worked and the device got detected by the
>> driver. However it won't create and "rootfs" partition like it did 
>> before.
>>
>> ---
>> [1.901930] spi-nand spi0.1: GigaDevice SPI NAND was found.
>> [1.905266] spi-nand spi0.1: 128 MiB, block size: 128 KiB, page size: 
>> 2048,
>> OOB size: 128
>> [1.911015] 1 fixed-partitions partitions found on MTD device spi0.1
>> [1.919010] Creating 1 MTD partitions on "spi0.1":
>> [1.925410] 0x-0x0800 : "ubi"
> It creates the partitions like set in DTS, ubi partition contains both
> kernel and rootfs.
>> ---
>>
>>
>> On 10/30/19 4:51 PM, Jeff Kletsky wrote:
>>> On 10/30/19 4:27 AM, Daniel Danzberger wrote:
>>>
 This device contains 2 flash devices. One NOR (32M) and one NAND 
 (128M).
 U-boot and caldata are on the NOR, the firmware on the NAND.

  SoC:IPQ4019
  CPU:4x 710MHz ARMv7
  RAM:256MB
  FLASH:  NOR:32MB NAND:128MB

 [...]


>>>
>>>  .../arch/arm/boot/dts/qcom-ipq4019-bus.dtsi   | 1142 +
>>>  .../include/dt-bindings/msm/msm-bus-ids.h |  869 +
>>>
>>> The sudden appearance of a need the MSM bus and its IDs worries me.
>>>
>>> With 25 devices already on the ipq40xx platform without them, it feels
>>> like something is missing if they are needed by this one.
>>>
>>>
 diff --git a/target/linux/ipq40xx/config-4.19 
 b/target/linux/ipq40xx/config-4.19
 index 8948b73ff7..3ee921abed 100644
 --- a/target/linux/ipq40xx/config-4.19
 +++ b/target/linux/ipq40xx/config-4.19
 @@ -303,6 +303,9 @@ CONFIG_MTD_NAND_ECC=y
   CONFIG_MTD_NAND_QCOM=y
   CONFIG_MTD_SPI_NAND=y
   CONFIG_MTD_SPI_NOR=y
 +CONFIG_MTD_SPINAND_MT29F=y
 +CONFIG_MTD_SPINAND_GIGADEVICE=y
 +CONFIG_MTD_SPINAND_ONDIEECC=y
>>>
>>>
>>> The CONFIG_SPINAND_* additions are not required for upstream SPI-NAND
>>>
>>>
   CONFIG_MTD_SPLIT_FIRMWARE=y
   CONFIG_MTD_SPLIT_FIT_FW=y
   CONFIG_MTD_UBI=y

 [...]

 diff --git
 a/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
 b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
 new file mode 100644
 index 00..5553bbd166
 --- /dev/null
 +++ 
 b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
 @@ -0,0 +1,371 @@
 +/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
 + * Copyright (c) 2019, Nguyen Dinh Phi 
 + *
 + * Permission to use, copy, modify, and/or distribute this software 
 for any
 + * purpose with or without fee is hereby granted, provided that the 
 above
 + * copyright notice and this permission notice appear in all copies.
 + *
 + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 
 WARRANTIES
 + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE 
 LIABLE FOR
 + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY 
 DAMAGES
 + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 

Re: [OpenWrt-Devel] [PATCH 3/3] ipq40xx: ipq4019: Add new device Compex WPJ419

2019-10-31 Thread Robert Marko
On Thu, 31 Oct 2019 at 11:30, Daniel Danzberger  wrote:
>
> I am already using 'ubi.mtd=rootfs root=/dev/ubiblock0_1', which has worked 
> before
Well this is the issue, your ubi.mtd needs to be ubi.mtd=ubi
>
> On 10/31/19 11:26 AM, Robert Marko wrote:
> > On Thu, 31 Oct 2019 at 11:25, Daniel Danzberger  wrote:
> >>
> >> On the deprecated staging driver, it somehow directly came up as "rootfs" 
> >> and
> >> not "ubi". Even though it has been named "ubi" in the dts.
> >> Now the image won't boot because no rootfs is detected:
> >>
> >> 
> >> [1.919001] Creating 1 MTD partitions on "spi0.1":
> >> [1.925399] 0x-0x0800 : "ubi"
> >> [1.940324] random: fast init done
> >> ...
> >> [3.170978] UBI error: cannot open mtd rootfs, error -2
> >> [3.171027] hctosys: unable to open rtc device ([3.180802] Waiting 
> >> for
> >> root device /dev/ubiblock0_1...
> > This is due to your bootargs, you can either use bootargs-append to
> > set rootfs to ubi or change them in bootloader.
> > This is classic on boards derived from QCA reference designs
> >> 
> >>
> >>
> >> On 10/31/19 11:19 AM, Robert Marko wrote:
> >>> On Thu, 31 Oct 2019 at 11:17, Daniel Danzberger  wrote:
> 
>  Using 'compatible = "spi-nand"' worked and the device got detected by the
>  driver. However it won't create and "rootfs" partition like it did 
>  before.
> 
>  ---
>  [1.901930] spi-nand spi0.1: GigaDevice SPI NAND was found.
>  [1.905266] spi-nand spi0.1: 128 MiB, block size: 128 KiB, page size: 
>  2048,
>  OOB size: 128
>  [1.911015] 1 fixed-partitions partitions found on MTD device spi0.1
>  [1.919010] Creating 1 MTD partitions on "spi0.1":
>  [1.925410] 0x-0x0800 : "ubi"
> >>> It creates the partitions like set in DTS, ubi partition contains both
> >>> kernel and rootfs.
>  ---
> 
> 
>  On 10/30/19 4:51 PM, Jeff Kletsky wrote:
> > On 10/30/19 4:27 AM, Daniel Danzberger wrote:
> >
> >> This device contains 2 flash devices. One NOR (32M) and one NAND 
> >> (128M).
> >> U-boot and caldata are on the NOR, the firmware on the NAND.
> >>
> >>  SoC:IPQ4019
> >>  CPU:4x 710MHz ARMv7
> >>  RAM:256MB
> >>  FLASH:  NOR:32MB NAND:128MB
> >>
> >> [...]
> >>
> >>
> >
> >  .../arch/arm/boot/dts/qcom-ipq4019-bus.dtsi   | 1142 +
> >  .../include/dt-bindings/msm/msm-bus-ids.h |  869 +
> >
> > The sudden appearance of a need the MSM bus and its IDs worries me.
> >
> > With 25 devices already on the ipq40xx platform without them, it feels
> > like something is missing if they are needed by this one.
> >
> >
> >> diff --git a/target/linux/ipq40xx/config-4.19 
> >> b/target/linux/ipq40xx/config-4.19
> >> index 8948b73ff7..3ee921abed 100644
> >> --- a/target/linux/ipq40xx/config-4.19
> >> +++ b/target/linux/ipq40xx/config-4.19
> >> @@ -303,6 +303,9 @@ CONFIG_MTD_NAND_ECC=y
> >>   CONFIG_MTD_NAND_QCOM=y
> >>   CONFIG_MTD_SPI_NAND=y
> >>   CONFIG_MTD_SPI_NOR=y
> >> +CONFIG_MTD_SPINAND_MT29F=y
> >> +CONFIG_MTD_SPINAND_GIGADEVICE=y
> >> +CONFIG_MTD_SPINAND_ONDIEECC=y
> >
> >
> > The CONFIG_SPINAND_* additions are not required for upstream SPI-NAND
> >
> >
> >>   CONFIG_MTD_SPLIT_FIRMWARE=y
> >>   CONFIG_MTD_SPLIT_FIT_FW=y
> >>   CONFIG_MTD_UBI=y
> >>
> >> [...]
> >>
> >> diff --git
> >> a/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
> >> b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
> >> new file mode 100644
> >> index 00..5553bbd166
> >> --- /dev/null
> >> +++ 
> >> b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
> >> @@ -0,0 +1,371 @@
> >> +/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
> >> + * Copyright (c) 2019, Nguyen Dinh Phi 
> >> + *
> >> + * Permission to use, copy, modify, and/or distribute this software 
> >> for any
> >> + * purpose with or without fee is hereby granted, provided that the 
> >> above
> >> + * copyright notice and this permission notice appear in all copies.
> >> + *
> >> + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 
> >> WARRANTIES
> >> + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
> >> + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE 
> >> LIABLE FOR
> >> + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY 
> >> DAMAGES
> >> + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 
> >> AN
> >> + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 
> >> OUT OF
> >> + * OR IN CONNECTION WITH THE USE OR 

Re: [OpenWrt-Devel] [PATCH 3/3] ipq40xx: ipq4019: Add new device Compex WPJ419

2019-10-31 Thread Daniel Danzberger
I am already using 'ubi.mtd=rootfs root=/dev/ubiblock0_1', which has worked 
before

On 10/31/19 11:26 AM, Robert Marko wrote:
> On Thu, 31 Oct 2019 at 11:25, Daniel Danzberger  wrote:
>>
>> On the deprecated staging driver, it somehow directly came up as "rootfs" and
>> not "ubi". Even though it has been named "ubi" in the dts.
>> Now the image won't boot because no rootfs is detected:
>>
>> 
>> [1.919001] Creating 1 MTD partitions on "spi0.1":
>> [1.925399] 0x-0x0800 : "ubi"
>> [1.940324] random: fast init done
>> ...
>> [3.170978] UBI error: cannot open mtd rootfs, error -2
>> [3.171027] hctosys: unable to open rtc device ([3.180802] Waiting for
>> root device /dev/ubiblock0_1...
> This is due to your bootargs, you can either use bootargs-append to
> set rootfs to ubi or change them in bootloader.
> This is classic on boards derived from QCA reference designs
>> 
>>
>>
>> On 10/31/19 11:19 AM, Robert Marko wrote:
>>> On Thu, 31 Oct 2019 at 11:17, Daniel Danzberger  wrote:

 Using 'compatible = "spi-nand"' worked and the device got detected by the
 driver. However it won't create and "rootfs" partition like it did before.

 ---
 [1.901930] spi-nand spi0.1: GigaDevice SPI NAND was found.
 [1.905266] spi-nand spi0.1: 128 MiB, block size: 128 KiB, page size: 
 2048,
 OOB size: 128
 [1.911015] 1 fixed-partitions partitions found on MTD device spi0.1
 [1.919010] Creating 1 MTD partitions on "spi0.1":
 [1.925410] 0x-0x0800 : "ubi"
>>> It creates the partitions like set in DTS, ubi partition contains both
>>> kernel and rootfs.
 ---


 On 10/30/19 4:51 PM, Jeff Kletsky wrote:
> On 10/30/19 4:27 AM, Daniel Danzberger wrote:
>
>> This device contains 2 flash devices. One NOR (32M) and one NAND (128M).
>> U-boot and caldata are on the NOR, the firmware on the NAND.
>>
>>  SoC:IPQ4019
>>  CPU:4x 710MHz ARMv7
>>  RAM:256MB
>>  FLASH:  NOR:32MB NAND:128MB
>>
>> [...]
>>
>>
>
>  .../arch/arm/boot/dts/qcom-ipq4019-bus.dtsi   | 1142 +
>  .../include/dt-bindings/msm/msm-bus-ids.h |  869 +
>
> The sudden appearance of a need the MSM bus and its IDs worries me.
>
> With 25 devices already on the ipq40xx platform without them, it feels
> like something is missing if they are needed by this one.
>
>
>> diff --git a/target/linux/ipq40xx/config-4.19 
>> b/target/linux/ipq40xx/config-4.19
>> index 8948b73ff7..3ee921abed 100644
>> --- a/target/linux/ipq40xx/config-4.19
>> +++ b/target/linux/ipq40xx/config-4.19
>> @@ -303,6 +303,9 @@ CONFIG_MTD_NAND_ECC=y
>>   CONFIG_MTD_NAND_QCOM=y
>>   CONFIG_MTD_SPI_NAND=y
>>   CONFIG_MTD_SPI_NOR=y
>> +CONFIG_MTD_SPINAND_MT29F=y
>> +CONFIG_MTD_SPINAND_GIGADEVICE=y
>> +CONFIG_MTD_SPINAND_ONDIEECC=y
>
>
> The CONFIG_SPINAND_* additions are not required for upstream SPI-NAND
>
>
>>   CONFIG_MTD_SPLIT_FIRMWARE=y
>>   CONFIG_MTD_SPLIT_FIT_FW=y
>>   CONFIG_MTD_UBI=y
>>
>> [...]
>>
>> diff --git
>> a/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
>> b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
>> new file mode 100644
>> index 00..5553bbd166
>> --- /dev/null
>> +++ 
>> b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
>> @@ -0,0 +1,371 @@
>> +/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
>> + * Copyright (c) 2019, Nguyen Dinh Phi 
>> + *
>> + * Permission to use, copy, modify, and/or distribute this software for 
>> any
>> + * purpose with or without fee is hereby granted, provided that the 
>> above
>> + * copyright notice and this permission notice appear in all copies.
>> + *
>> + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 
>> WARRANTIES
>> + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
>> + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE 
>> FOR
>> + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY 
>> DAMAGES
>> + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
>> + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT 
>> OF
>> + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
>> + *
>> + */
>> +
>>
>> [...]
>>
>> +
>> +spi_0: spi@78b5000 {
>> +pinctrl-0 = <_0_pins>;
>> +pinctrl-names = "default";
>> +status = "okay";
>> +cs-gpios = < 12 GPIO_ACTIVE_HIGH>, < 41 
>> GPIO_ACTIVE_HIGH>;
>> +num-cs = <2>;
>> +
>> +   

Re: [OpenWrt-Devel] [PATCH 3/3] ipq40xx: ipq4019: Add new device Compex WPJ419

2019-10-31 Thread Robert Marko
On Thu, 31 Oct 2019 at 11:25, Daniel Danzberger  wrote:
>
> On the deprecated staging driver, it somehow directly came up as "rootfs" and
> not "ubi". Even though it has been named "ubi" in the dts.
> Now the image won't boot because no rootfs is detected:
>
> 
> [1.919001] Creating 1 MTD partitions on "spi0.1":
> [1.925399] 0x-0x0800 : "ubi"
> [1.940324] random: fast init done
> ...
> [3.170978] UBI error: cannot open mtd rootfs, error -2
> [3.171027] hctosys: unable to open rtc device ([3.180802] Waiting for
> root device /dev/ubiblock0_1...
This is due to your bootargs, you can either use bootargs-append to
set rootfs to ubi or change them in bootloader.
This is classic on boards derived from QCA reference designs
> 
>
>
> On 10/31/19 11:19 AM, Robert Marko wrote:
> > On Thu, 31 Oct 2019 at 11:17, Daniel Danzberger  wrote:
> >>
> >> Using 'compatible = "spi-nand"' worked and the device got detected by the
> >> driver. However it won't create and "rootfs" partition like it did before.
> >>
> >> ---
> >> [1.901930] spi-nand spi0.1: GigaDevice SPI NAND was found.
> >> [1.905266] spi-nand spi0.1: 128 MiB, block size: 128 KiB, page size: 
> >> 2048,
> >> OOB size: 128
> >> [1.911015] 1 fixed-partitions partitions found on MTD device spi0.1
> >> [1.919010] Creating 1 MTD partitions on "spi0.1":
> >> [1.925410] 0x-0x0800 : "ubi"
> > It creates the partitions like set in DTS, ubi partition contains both
> > kernel and rootfs.
> >> ---
> >>
> >>
> >> On 10/30/19 4:51 PM, Jeff Kletsky wrote:
> >>> On 10/30/19 4:27 AM, Daniel Danzberger wrote:
> >>>
>  This device contains 2 flash devices. One NOR (32M) and one NAND (128M).
>  U-boot and caldata are on the NOR, the firmware on the NAND.
> 
>   SoC:IPQ4019
>   CPU:4x 710MHz ARMv7
>   RAM:256MB
>   FLASH:  NOR:32MB NAND:128MB
> 
>  [...]
> 
> 
> >>>
> >>>  .../arch/arm/boot/dts/qcom-ipq4019-bus.dtsi   | 1142 +
> >>>  .../include/dt-bindings/msm/msm-bus-ids.h |  869 +
> >>>
> >>> The sudden appearance of a need the MSM bus and its IDs worries me.
> >>>
> >>> With 25 devices already on the ipq40xx platform without them, it feels
> >>> like something is missing if they are needed by this one.
> >>>
> >>>
>  diff --git a/target/linux/ipq40xx/config-4.19 
>  b/target/linux/ipq40xx/config-4.19
>  index 8948b73ff7..3ee921abed 100644
>  --- a/target/linux/ipq40xx/config-4.19
>  +++ b/target/linux/ipq40xx/config-4.19
>  @@ -303,6 +303,9 @@ CONFIG_MTD_NAND_ECC=y
>    CONFIG_MTD_NAND_QCOM=y
>    CONFIG_MTD_SPI_NAND=y
>    CONFIG_MTD_SPI_NOR=y
>  +CONFIG_MTD_SPINAND_MT29F=y
>  +CONFIG_MTD_SPINAND_GIGADEVICE=y
>  +CONFIG_MTD_SPINAND_ONDIEECC=y
> >>>
> >>>
> >>> The CONFIG_SPINAND_* additions are not required for upstream SPI-NAND
> >>>
> >>>
>    CONFIG_MTD_SPLIT_FIRMWARE=y
>    CONFIG_MTD_SPLIT_FIT_FW=y
>    CONFIG_MTD_UBI=y
> 
>  [...]
> 
>  diff --git
>  a/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
>  b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
>  new file mode 100644
>  index 00..5553bbd166
>  --- /dev/null
>  +++ 
>  b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
>  @@ -0,0 +1,371 @@
>  +/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
>  + * Copyright (c) 2019, Nguyen Dinh Phi 
>  + *
>  + * Permission to use, copy, modify, and/or distribute this software for 
>  any
>  + * purpose with or without fee is hereby granted, provided that the 
>  above
>  + * copyright notice and this permission notice appear in all copies.
>  + *
>  + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 
>  WARRANTIES
>  + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
>  + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE 
>  FOR
>  + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY 
>  DAMAGES
>  + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
>  + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT 
>  OF
>  + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
>  + *
>  + */
>  +
> 
>  [...]
> 
>  +
>  +spi_0: spi@78b5000 {
>  +pinctrl-0 = <_0_pins>;
>  +pinctrl-names = "default";
>  +status = "okay";
>  +cs-gpios = < 12 GPIO_ACTIVE_HIGH>, < 41 
>  GPIO_ACTIVE_HIGH>;
>  +num-cs = <2>;
>  +
>  +m25p80@0 {
>  +#address-cells = <1>;
>  +#size-cells = <1>;
>  +reg = <0>;
>  

Re: [OpenWrt-Devel] [PATCH 3/3] ipq40xx: ipq4019: Add new device Compex WPJ419

2019-10-31 Thread Daniel Danzberger
On the deprecated staging driver, it somehow directly came up as "rootfs" and
not "ubi". Even though it has been named "ubi" in the dts.
Now the image won't boot because no rootfs is detected:


[1.919001] Creating 1 MTD partitions on "spi0.1":
[1.925399] 0x-0x0800 : "ubi"
[1.940324] random: fast init done
...
[3.170978] UBI error: cannot open mtd rootfs, error -2
[3.171027] hctosys: unable to open rtc device ([3.180802] Waiting for
root device /dev/ubiblock0_1...



On 10/31/19 11:19 AM, Robert Marko wrote:
> On Thu, 31 Oct 2019 at 11:17, Daniel Danzberger  wrote:
>>
>> Using 'compatible = "spi-nand"' worked and the device got detected by the
>> driver. However it won't create and "rootfs" partition like it did before.
>>
>> ---
>> [1.901930] spi-nand spi0.1: GigaDevice SPI NAND was found.
>> [1.905266] spi-nand spi0.1: 128 MiB, block size: 128 KiB, page size: 
>> 2048,
>> OOB size: 128
>> [1.911015] 1 fixed-partitions partitions found on MTD device spi0.1
>> [1.919010] Creating 1 MTD partitions on "spi0.1":
>> [1.925410] 0x-0x0800 : "ubi"
> It creates the partitions like set in DTS, ubi partition contains both
> kernel and rootfs.
>> ---
>>
>>
>> On 10/30/19 4:51 PM, Jeff Kletsky wrote:
>>> On 10/30/19 4:27 AM, Daniel Danzberger wrote:
>>>
 This device contains 2 flash devices. One NOR (32M) and one NAND (128M).
 U-boot and caldata are on the NOR, the firmware on the NAND.

  SoC:IPQ4019
  CPU:4x 710MHz ARMv7
  RAM:256MB
  FLASH:  NOR:32MB NAND:128MB

 [...]


>>>
>>>  .../arch/arm/boot/dts/qcom-ipq4019-bus.dtsi   | 1142 +
>>>  .../include/dt-bindings/msm/msm-bus-ids.h |  869 +
>>>
>>> The sudden appearance of a need the MSM bus and its IDs worries me.
>>>
>>> With 25 devices already on the ipq40xx platform without them, it feels
>>> like something is missing if they are needed by this one.
>>>
>>>
 diff --git a/target/linux/ipq40xx/config-4.19 
 b/target/linux/ipq40xx/config-4.19
 index 8948b73ff7..3ee921abed 100644
 --- a/target/linux/ipq40xx/config-4.19
 +++ b/target/linux/ipq40xx/config-4.19
 @@ -303,6 +303,9 @@ CONFIG_MTD_NAND_ECC=y
   CONFIG_MTD_NAND_QCOM=y
   CONFIG_MTD_SPI_NAND=y
   CONFIG_MTD_SPI_NOR=y
 +CONFIG_MTD_SPINAND_MT29F=y
 +CONFIG_MTD_SPINAND_GIGADEVICE=y
 +CONFIG_MTD_SPINAND_ONDIEECC=y
>>>
>>>
>>> The CONFIG_SPINAND_* additions are not required for upstream SPI-NAND
>>>
>>>
   CONFIG_MTD_SPLIT_FIRMWARE=y
   CONFIG_MTD_SPLIT_FIT_FW=y
   CONFIG_MTD_UBI=y

 [...]

 diff --git
 a/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
 b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
 new file mode 100644
 index 00..5553bbd166
 --- /dev/null
 +++ 
 b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
 @@ -0,0 +1,371 @@
 +/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
 + * Copyright (c) 2019, Nguyen Dinh Phi 
 + *
 + * Permission to use, copy, modify, and/or distribute this software for 
 any
 + * purpose with or without fee is hereby granted, provided that the above
 + * copyright notice and this permission notice appear in all copies.
 + *
 + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 
 WARRANTIES
 + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 + *
 + */
 +

 [...]

 +
 +spi_0: spi@78b5000 {
 +pinctrl-0 = <_0_pins>;
 +pinctrl-names = "default";
 +status = "okay";
 +cs-gpios = < 12 GPIO_ACTIVE_HIGH>, < 41 
 GPIO_ACTIVE_HIGH>;
 +num-cs = <2>;
 +
 +m25p80@0 {
 +#address-cells = <1>;
 +#size-cells = <1>;
 +reg = <0>;
 +linux,modalias = "m25p80", "n25q128a11";
 +compatible = "jedec,spi-nor", "n25q128a11";
 +spi-max-frequency = <2400>;
>>>
>>>
>>> I don't think you need linux,modalias here, nor the chip type in the 
>>> compatible
>>> line.
>>> I believe that the following compatible line is sufficient
>>>
>>> compatible = "jedec,spi-nor";
>>>
>>>
>>> You might also want to consider "flash@0" or "nor@0" or "nor_flash@0",
>>> or the like, rather than a 

Re: [OpenWrt-Devel] [PATCH 3/3] ipq40xx: ipq4019: Add new device Compex WPJ419

2019-10-31 Thread Robert Marko
On Thu, 31 Oct 2019 at 11:17, Daniel Danzberger  wrote:
>
> Using 'compatible = "spi-nand"' worked and the device got detected by the
> driver. However it won't create and "rootfs" partition like it did before.
>
> ---
> [1.901930] spi-nand spi0.1: GigaDevice SPI NAND was found.
> [1.905266] spi-nand spi0.1: 128 MiB, block size: 128 KiB, page size: 2048,
> OOB size: 128
> [1.911015] 1 fixed-partitions partitions found on MTD device spi0.1
> [1.919010] Creating 1 MTD partitions on "spi0.1":
> [1.925410] 0x-0x0800 : "ubi"
It creates the partitions like set in DTS, ubi partition contains both
kernel and rootfs.
> ---
>
>
> On 10/30/19 4:51 PM, Jeff Kletsky wrote:
> > On 10/30/19 4:27 AM, Daniel Danzberger wrote:
> >
> >> This device contains 2 flash devices. One NOR (32M) and one NAND (128M).
> >> U-boot and caldata are on the NOR, the firmware on the NAND.
> >>
> >>  SoC:IPQ4019
> >>  CPU:4x 710MHz ARMv7
> >>  RAM:256MB
> >>  FLASH:  NOR:32MB NAND:128MB
> >>
> >> [...]
> >>
> >>
> >
> >  .../arch/arm/boot/dts/qcom-ipq4019-bus.dtsi   | 1142 +
> >  .../include/dt-bindings/msm/msm-bus-ids.h |  869 +
> >
> > The sudden appearance of a need the MSM bus and its IDs worries me.
> >
> > With 25 devices already on the ipq40xx platform without them, it feels
> > like something is missing if they are needed by this one.
> >
> >
> >> diff --git a/target/linux/ipq40xx/config-4.19 
> >> b/target/linux/ipq40xx/config-4.19
> >> index 8948b73ff7..3ee921abed 100644
> >> --- a/target/linux/ipq40xx/config-4.19
> >> +++ b/target/linux/ipq40xx/config-4.19
> >> @@ -303,6 +303,9 @@ CONFIG_MTD_NAND_ECC=y
> >>   CONFIG_MTD_NAND_QCOM=y
> >>   CONFIG_MTD_SPI_NAND=y
> >>   CONFIG_MTD_SPI_NOR=y
> >> +CONFIG_MTD_SPINAND_MT29F=y
> >> +CONFIG_MTD_SPINAND_GIGADEVICE=y
> >> +CONFIG_MTD_SPINAND_ONDIEECC=y
> >
> >
> > The CONFIG_SPINAND_* additions are not required for upstream SPI-NAND
> >
> >
> >>   CONFIG_MTD_SPLIT_FIRMWARE=y
> >>   CONFIG_MTD_SPLIT_FIT_FW=y
> >>   CONFIG_MTD_UBI=y
> >>
> >> [...]
> >>
> >> diff --git
> >> a/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
> >> b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
> >> new file mode 100644
> >> index 00..5553bbd166
> >> --- /dev/null
> >> +++ 
> >> b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
> >> @@ -0,0 +1,371 @@
> >> +/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
> >> + * Copyright (c) 2019, Nguyen Dinh Phi 
> >> + *
> >> + * Permission to use, copy, modify, and/or distribute this software for 
> >> any
> >> + * purpose with or without fee is hereby granted, provided that the above
> >> + * copyright notice and this permission notice appear in all copies.
> >> + *
> >> + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 
> >> WARRANTIES
> >> + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
> >> + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
> >> + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
> >> + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
> >> + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
> >> + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
> >> + *
> >> + */
> >> +
> >>
> >> [...]
> >>
> >> +
> >> +spi_0: spi@78b5000 {
> >> +pinctrl-0 = <_0_pins>;
> >> +pinctrl-names = "default";
> >> +status = "okay";
> >> +cs-gpios = < 12 GPIO_ACTIVE_HIGH>, < 41 
> >> GPIO_ACTIVE_HIGH>;
> >> +num-cs = <2>;
> >> +
> >> +m25p80@0 {
> >> +#address-cells = <1>;
> >> +#size-cells = <1>;
> >> +reg = <0>;
> >> +linux,modalias = "m25p80", "n25q128a11";
> >> +compatible = "jedec,spi-nor", "n25q128a11";
> >> +spi-max-frequency = <2400>;
> >
> >
> > I don't think you need linux,modalias here, nor the chip type in the 
> > compatible
> > line.
> > I believe that the following compatible line is sufficient
> >
> > compatible = "jedec,spi-nor";
> >
> >
> > You might also want to consider "flash@0" or "nor@0" or "nor_flash@0",
> > or the like, rather than a chip-specific name. (I'm not a committer.)
> >
> >
> >> +
> >> +partitions {
> >> +compatible = "fixed-partitions";
> >> +
> >> +partition@0 {
> >> +label = "0:SBL1";
> >> +reg = <0x00 0x04>;
> >> +read-only;
> >> +};
> >> +
> >> +partition@4 {
> >> +label = "0:MIBIB";
> >> +reg = <0x04 0x02>;
> >> +read-only;
> >> +};
> 

Re: [OpenWrt-Devel] [PATCH 3/3] ipq40xx: ipq4019: Add new device Compex WPJ419

2019-10-31 Thread Daniel Danzberger
Using 'compatible = "spi-nand"' worked and the device got detected by the
driver. However it won't create and "rootfs" partition like it did before.

---
[1.901930] spi-nand spi0.1: GigaDevice SPI NAND was found.
[1.905266] spi-nand spi0.1: 128 MiB, block size: 128 KiB, page size: 2048,
OOB size: 128
[1.911015] 1 fixed-partitions partitions found on MTD device spi0.1
[1.919010] Creating 1 MTD partitions on "spi0.1":
[1.925410] 0x-0x0800 : "ubi"
---


On 10/30/19 4:51 PM, Jeff Kletsky wrote:
> On 10/30/19 4:27 AM, Daniel Danzberger wrote:
> 
>> This device contains 2 flash devices. One NOR (32M) and one NAND (128M).
>> U-boot and caldata are on the NOR, the firmware on the NAND.
>>
>>  SoC:    IPQ4019
>>  CPU:    4x 710MHz ARMv7
>>  RAM:    256MB
>>  FLASH:  NOR:32MB NAND:128MB
>>
>> [...]
>>
>>
> 
>  .../arch/arm/boot/dts/qcom-ipq4019-bus.dtsi   | 1142 +
>  .../include/dt-bindings/msm/msm-bus-ids.h |  869 +
> 
> The sudden appearance of a need the MSM bus and its IDs worries me.
> 
> With 25 devices already on the ipq40xx platform without them, it feels
> like something is missing if they are needed by this one.
> 
> 
>> diff --git a/target/linux/ipq40xx/config-4.19 
>> b/target/linux/ipq40xx/config-4.19
>> index 8948b73ff7..3ee921abed 100644
>> --- a/target/linux/ipq40xx/config-4.19
>> +++ b/target/linux/ipq40xx/config-4.19
>> @@ -303,6 +303,9 @@ CONFIG_MTD_NAND_ECC=y
>>   CONFIG_MTD_NAND_QCOM=y
>>   CONFIG_MTD_SPI_NAND=y
>>   CONFIG_MTD_SPI_NOR=y
>> +CONFIG_MTD_SPINAND_MT29F=y
>> +CONFIG_MTD_SPINAND_GIGADEVICE=y
>> +CONFIG_MTD_SPINAND_ONDIEECC=y
> 
> 
> The CONFIG_SPINAND_* additions are not required for upstream SPI-NAND
> 
> 
>>   CONFIG_MTD_SPLIT_FIRMWARE=y
>>   CONFIG_MTD_SPLIT_FIT_FW=y
>>   CONFIG_MTD_UBI=y
>>
>> [...]
>>
>> diff --git
>> a/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
>> b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
>> new file mode 100644
>> index 00..5553bbd166
>> --- /dev/null
>> +++ 
>> b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
>> @@ -0,0 +1,371 @@
>> +/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
>> + * Copyright (c) 2019, Nguyen Dinh Phi 
>> + *
>> + * Permission to use, copy, modify, and/or distribute this software for any
>> + * purpose with or without fee is hereby granted, provided that the above
>> + * copyright notice and this permission notice appear in all copies.
>> + *
>> + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
>> + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
>> + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
>> + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
>> + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
>> + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
>> + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
>> + *
>> + */
>> +
>>
>> [...]
>>
>> +
>> +    spi_0: spi@78b5000 {
>> +    pinctrl-0 = <_0_pins>;
>> +    pinctrl-names = "default";
>> +    status = "okay";
>> +    cs-gpios = < 12 GPIO_ACTIVE_HIGH>, < 41 
>> GPIO_ACTIVE_HIGH>;
>> +    num-cs = <2>;
>> +
>> +    m25p80@0 {
>> +    #address-cells = <1>;
>> +    #size-cells = <1>;
>> +    reg = <0>;
>> +    linux,modalias = "m25p80", "n25q128a11";
>> +    compatible = "jedec,spi-nor", "n25q128a11";
>> +    spi-max-frequency = <2400>;
> 
> 
> I don't think you need linux,modalias here, nor the chip type in the 
> compatible
> line.
> I believe that the following compatible line is sufficient
> 
>     compatible = "jedec,spi-nor";
> 
> 
> You might also want to consider "flash@0" or "nor@0" or "nor_flash@0",
> or the like, rather than a chip-specific name. (I'm not a committer.)
> 
> 
>> +
>> +    partitions {
>> +    compatible = "fixed-partitions";
>> +
>> +    partition@0 {
>> +    label = "0:SBL1";
>> +    reg = <0x00 0x04>;
>> +    read-only;
>> +    };
>> +
>> +    partition@4 {
>> +    label = "0:MIBIB";
>> +    reg = <0x04 0x02>;
>> +    read-only;
>> +    };
>> +
>> +    partition@6 {
>> +    label = "0:QSEE";
>> +    reg = <0x06 0x06>;
>> +    read-only;
>> +    };
>> +
>> +    partition@c {
>> +    label = "0:CDT";
>> +    reg = <0x0c 0x01>;
>> +    read-only;
>> +   

Re: [OpenWrt-Devel] [PATCH 3/3] ipq40xx: ipq4019: Add new device Compex WPJ419

2019-10-30 Thread Adrian Schmutzler
Hi,

> > +   m25p80@0 {
> > +   #address-cells = <1>;
> > +   #size-cells = <1>;
> > +   reg = <0>;
> > +   linux,modalias = "m25p80", "n25q128a11";
> > +   compatible = "jedec,spi-nor", "n25q128a11";
> > +   spi-max-frequency = <2400>;
> 
> 
> I don't think you need linux,modalias here, nor the chip type in the
> compatible line.
> I believe that the following compatible line is sufficient
> 
>      compatible = "jedec,spi-nor";
> 
> 
> You might also want to consider "flash@0" or "nor@0" or "nor_flash@0",
> or the like, rather than a chip-specific name. (I'm not a committer.)

Indeed.

Best

Adrian 


openpgp-digital-signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 3/3] ipq40xx: ipq4019: Add new device Compex WPJ419

2019-10-30 Thread Jeff Kletsky

On 10/30/19 4:27 AM, Daniel Danzberger wrote:


This device contains 2 flash devices. One NOR (32M) and one NAND (128M).
U-boot and caldata are on the NOR, the firmware on the NAND.

 SoC:IPQ4019
 CPU:4x 710MHz ARMv7
 RAM:256MB
 FLASH:  NOR:32MB NAND:128MB

[...]




 .../arch/arm/boot/dts/qcom-ipq4019-bus.dtsi   | 1142 +
 .../include/dt-bindings/msm/msm-bus-ids.h |  869 +

The sudden appearance of a need the MSM bus and its IDs worries me.

With 25 devices already on the ipq40xx platform without them, it feels
like something is missing if they are needed by this one.



diff --git a/target/linux/ipq40xx/config-4.19 b/target/linux/ipq40xx/config-4.19
index 8948b73ff7..3ee921abed 100644
--- a/target/linux/ipq40xx/config-4.19
+++ b/target/linux/ipq40xx/config-4.19
@@ -303,6 +303,9 @@ CONFIG_MTD_NAND_ECC=y
  CONFIG_MTD_NAND_QCOM=y
  CONFIG_MTD_SPI_NAND=y
  CONFIG_MTD_SPI_NOR=y
+CONFIG_MTD_SPINAND_MT29F=y
+CONFIG_MTD_SPINAND_GIGADEVICE=y
+CONFIG_MTD_SPINAND_ONDIEECC=y



The CONFIG_SPINAND_* additions are not required for upstream SPI-NAND



  CONFIG_MTD_SPLIT_FIRMWARE=y
  CONFIG_MTD_SPLIT_FIT_FW=y
  CONFIG_MTD_UBI=y

[...]

diff --git 
a/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts 
b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
new file mode 100644
index 00..5553bbd166
--- /dev/null
+++ b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
@@ -0,0 +1,371 @@
+/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2019, Nguyen Dinh Phi 
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+

[...]

+
+   spi_0: spi@78b5000 {
+   pinctrl-0 = <_0_pins>;
+   pinctrl-names = "default";
+   status = "okay";
+   cs-gpios = < 12 GPIO_ACTIVE_HIGH>, < 41 
GPIO_ACTIVE_HIGH>;
+   num-cs = <2>;
+
+   m25p80@0 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   reg = <0>;
+   linux,modalias = "m25p80", "n25q128a11";
+   compatible = "jedec,spi-nor", "n25q128a11";
+   spi-max-frequency = <2400>;



I don't think you need linux,modalias here, nor the chip type in the 
compatible line.

I believe that the following compatible line is sufficient

    compatible = "jedec,spi-nor";


You might also want to consider "flash@0" or "nor@0" or "nor_flash@0",
or the like, rather than a chip-specific name. (I'm not a committer.)



+
+   partitions {
+   compatible = "fixed-partitions";
+
+   partition@0 {
+   label = "0:SBL1";
+   reg = <0x00 0x04>;
+   read-only;
+   };
+
+   partition@4 {
+   label = "0:MIBIB";
+   reg = <0x04 0x02>;
+   read-only;
+   };
+
+   partition@6 {
+   label = "0:QSEE";
+   reg = <0x06 0x06>;
+   read-only;
+   };
+
+   partition@c {
+   label = "0:CDT";
+   reg = <0x0c 0x01>;
+   read-only;
+   };



Someone may rip on you for capitalization of labels. (I'm not a committer.)



+
+   partition@d {
+   label = "0:DDRPARAMS";
+ 

Re: [OpenWrt-Devel] [PATCH 3/3] ipq40xx: ipq4019: Add new device Compex WPJ419

2019-10-30 Thread Adrian Schmutzler
Hi,

just some cosmetical drive-by comments below:

...
> diff --git 
> a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
> b/target/linux/ipq40xx/base-
> files/etc/hotplug.d/firmware/11-ath10k-caldata
> index 2336ef3c7b..b18d17e422 100644
> --- a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
> +++ b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
> @@ -71,6 +71,7 @@ case "$FIRMWARE" in
>   /usr/bin/fritz_cal_extract -i 1 -s 0x3D000 -e 0x207 -l 12064 -o 
> /lib/firmware/$FIRMWARE $(find_mtd_chardev
> "urlader1")
>   ;;
>   compex,wpj428 |\
> + compex,wpj419 |\

Please apply correct alphabetic sorting.

>   engenius,eap1300 |\
>   openmesh,a42 |\
>   openmesh,a62 |\
> @@ -134,6 +135,7 @@ case "$FIRMWARE" in
>   /usr/bin/fritz_cal_extract -i 1 -s 0x3C000 -e 0x208 -l 12064 -o 
> /lib/firmware/$FIRMWARE $(find_mtd_chardev
> "urlader1")
>   ;;
>   compex,wpj428 |\
> + compex,wpj419 |\

Please apply correct alphabetic sorting.

>   engenius,eap1300 |\
>   openmesh,a42 |\
>   openmesh,a62 |\
> diff --git a/target/linux/ipq40xx/config-4.19 
> b/target/linux/ipq40xx/config-4.19
> index 8948b73ff7..3ee921abed 100644
> --- a/target/linux/ipq40xx/config-4.19
> +++ b/target/linux/ipq40xx/config-4.19
> @@ -303,6 +303,9 @@ CONFIG_MTD_NAND_ECC=y
>  CONFIG_MTD_NAND_QCOM=y
>  CONFIG_MTD_SPI_NAND=y
>  CONFIG_MTD_SPI_NOR=y
> +CONFIG_MTD_SPINAND_MT29F=y
> +CONFIG_MTD_SPINAND_GIGADEVICE=y
> +CONFIG_MTD_SPINAND_ONDIEECC=y
>  CONFIG_MTD_SPLIT_FIRMWARE=y
>  CONFIG_MTD_SPLIT_FIT_FW=y
>  CONFIG_MTD_UBI=y
> diff --git 
> a/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-bus.dtsi 
> b/target/linux/ipq40xx/files-
> 4.19/arch/arm/boot/dts/qcom-ipq4019-bus.dtsi
> new file mode 100644
> index 00..169505973f
> --- /dev/null
> +++ b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-bus.dtsi
> @@ -0,0 +1,1142 @@
> +/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
> + *
> + * Permission to use, copy, modify, and/or distribute this software for any
> + * purpose with or without fee is hereby granted, provided that the above
> + * copyright notice and this permission notice appear in all copies.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
> + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
> + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
> + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
> + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
> + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
> + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
> + *
> + */
> +
> +#include 
> +
> +/ {
> +
> +soc {

Child nodes  (=soc) should be indented.

> + ad_hoc_bus: ad-hoc-bus {
> + compatible = "qcom,msm-bus-device";
...

> diff --git 
> a/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts 
> b/target/linux/ipq40xx/files-
> 4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
> new file mode 100644
> index 00..5553bbd166
> --- /dev/null
> +++ 
> b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
> @@ -0,0 +1,371 @@
...
> + {
> +qcom,phy_mdio_addr = <4>;
> +qcom,poll_required = <1>;
> +qcom,forced_speed = <1000>;
> +qcom,forced_duplex = <1>;
> +vlan_tag = <2 0x20>;
> +};
> +
> + {
> +qcom,phy_mdio_addr = <3>;
> +qcom,poll_required = <1>;
> +qcom,forced_speed = <1000>;
> +qcom,forced_duplex = <1>;
> +vlan_tag = <1 0x10>;
> +};
> +
> + {
> +status = "okay";
> +};
> +
> + {
> +status = "okay";
> +};

Fix indent for the content of the four nodes above.

> diff --git 
> a/target/linux/ipq40xx/files-4.19/include/dt-bindings/msm/msm-bus-ids.h 
> b/target/linux/ipq40xx/files-4.19/include/dt-
> bindings/msm/msm-bus-ids.h
> new file mode 100644
> index 00..da0b83e831
> --- /dev/null
> +++ b/target/linux/ipq40xx/files-4.19/include/dt-bindings/msm/msm-bus-ids.h
...
> +#define  MSM_BUS_SLAVE_CATS_128 663
> +#define  MSM_BUS_SLAVE_OCMEM_64 664
> +#define MSM_BUS_SLAVE_PCIE_0 665
> +#define MSM_BUS_SLAVE_PCIE_1 666

Mixed indent here ...

...
> +#define  MSM_BUS_SLAVE_SRVC_SNOC 754
> +
> +#define  MSM_BUS_SYSTEM_FPB_SLAVE_SYSTEM  MSM_BUS_SYSTEM_SLAVE_SYSTEM_FPB
> +#define MSM_BUS_CPSS_FPB_SLAVE_SYSTEM MSM_BUS_SYSTEM_SLAVE_CPSS_FPB

and here.

...
> diff --git a/target/linux/ipq40xx/image/Makefile 
> b/target/linux/ipq40xx/image/Makefile
> index ed46bca649..a13a17b3cf 100644
> --- a/target/linux/ipq40xx/image/Makefile
> +++ b/target/linux/ipq40xx/image/Makefile
> @@ -179,6 +179,20 @@ define Device/compex_wpj428
>  endef
>  TARGET_DEVICES += compex_wpj428
> 
> +define Device/compex_wpj419
> + $(call Device/FitImage)
> + $(call Device/UbiFit)
> + DEVICE_VENDOR := Compex
> + 

[OpenWrt-Devel] [PATCH 3/3] ipq40xx: ipq4019: Add new device Compex WPJ419

2019-10-30 Thread Daniel Danzberger
This device contains 2 flash devices. One NOR (32M) and one NAND (128M).
U-boot and caldata are on the NOR, the firmware on the NAND.

SoC:IPQ4019
CPU:4x 710MHz ARMv7
RAM:256MB
FLASH:  NOR:32MB NAND:128MB
ETH:2x GMAC Gigabit
POE:802.3 af/at POE, IEEE802.3af/IEEE802.3at(48-56V)
WIFI:   1x 2.4Ghz Atheros qca4019 2x2 MU-MIMO
1x 5.0Ghz Atheros qca4019 2x2 MU-MIMO
USB:1x 3.0
PCI:1x Mini PCIe
SIM:1x Slot
SD: 1x MicroSD slot
BTN:Reset
LED:- Power
- Ethernet
UART:  1x Serial Port 4 Pin Connector (UART)
   1x Serial Port 6 Pin Connector (High Speed UART)
POWER: 12V 2A

Installation

Initial flashing can only be done via u-boot using the following commands:

tftpboot openwrt-ipq40xx-generic-compex_wpj419-nand-squashfs-nand-factory.ubi
nand erase.chip; nand write ${fileaddr} 0x0 ${filesize}
set fsbootargs ubi.mtd=rootfs root=/dev/ubiblock0_1 rootfstype=squashfs
saveenv
res

Signed-off-by: Daniel Danzberger 
---
 .../ipq40xx/base-files/etc/board.d/02_network |1 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata  |2 +
 target/linux/ipq40xx/config-4.19  |3 +
 .../arch/arm/boot/dts/qcom-ipq4019-bus.dtsi   | 1142 +
 .../arch/arm/boot/dts/qcom-ipq4019-wpj419.dts |  371 ++
 .../include/dt-bindings/msm/msm-bus-ids.h |  869 +
 target/linux/ipq40xx/image/Makefile   |   14 +
 .../901-arm-boot-add-dts-files.patch  |3 +-
 8 files changed, 2404 insertions(+), 1 deletion(-)
 create mode 100644 
target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-bus.dtsi
 create mode 100644 
target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts
 create mode 100644 
target/linux/ipq40xx/files-4.19/include/dt-bindings/msm/msm-bus-ids.h

diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network 
b/target/linux/ipq40xx/base-files/etc/board.d/02_network
index 25402b7eb4..dafd83234e 100755
--- a/target/linux/ipq40xx/base-files/etc/board.d/02_network
+++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network
@@ -48,6 +48,7 @@ ipq40xx_setup_interfaces()
ucidef_set_interface_lan "eth0"
;;
avm,fritzrepeater-3000|\
+   compex,wpj419|\
compex,wpj428)
ucidef_set_interface_lan "eth0 eth1"
;;
diff --git 
a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 2336ef3c7b..b18d17e422 100644
--- a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -71,6 +71,7 @@ case "$FIRMWARE" in
/usr/bin/fritz_cal_extract -i 1 -s 0x3D000 -e 0x207 -l 12064 -o 
/lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1")
;;
compex,wpj428 |\
+   compex,wpj419 |\
engenius,eap1300 |\
openmesh,a42 |\
openmesh,a62 |\
@@ -134,6 +135,7 @@ case "$FIRMWARE" in
/usr/bin/fritz_cal_extract -i 1 -s 0x3C000 -e 0x208 -l 12064 -o 
/lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1")
;;
compex,wpj428 |\
+   compex,wpj419 |\
engenius,eap1300 |\
openmesh,a42 |\
openmesh,a62 |\
diff --git a/target/linux/ipq40xx/config-4.19 b/target/linux/ipq40xx/config-4.19
index 8948b73ff7..3ee921abed 100644
--- a/target/linux/ipq40xx/config-4.19
+++ b/target/linux/ipq40xx/config-4.19
@@ -303,6 +303,9 @@ CONFIG_MTD_NAND_ECC=y
 CONFIG_MTD_NAND_QCOM=y
 CONFIG_MTD_SPI_NAND=y
 CONFIG_MTD_SPI_NOR=y
+CONFIG_MTD_SPINAND_MT29F=y
+CONFIG_MTD_SPINAND_GIGADEVICE=y
+CONFIG_MTD_SPINAND_ONDIEECC=y
 CONFIG_MTD_SPLIT_FIRMWARE=y
 CONFIG_MTD_SPLIT_FIT_FW=y
 CONFIG_MTD_UBI=y
diff --git 
a/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-bus.dtsi 
b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-bus.dtsi
new file mode 100644
index 00..169505973f
--- /dev/null
+++ b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-bus.dtsi
@@ -0,0 +1,1142 @@
+/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR