Re: imx8mp spi fail

2023-02-13 Thread Fabio Estevam
Hi Elmar,

On Mon, Feb 13, 2023 at 4:46 PM Elmar Psilog  wrote:
>
> Thank you so much, you made my day! Sorry, I didn't see the alias was
> used different.

Glad to know it is working.

> Although my credibility gambled away I think I found a real bug in EQOS
> driver with fixed-phy:
>
> In file fixed.c in in function fixedphy_config() the call
>
>  val = ofnode_read_u32_default(node, "speed", 0);
>
> returns 0 instead of 1000 and also the duplex is not set. I found that
> in file/function dwc_eth_qos.c / eqos_start() the line
>
> eqos->phy->node = eqos->phy_of_node;
>
> is reponsible for losing the info. Don't know what magic happens here -
> so I can't fix it - just followed the data. So all works well and even
> the parsing of old and new fixed-link devicetree works til that line.
> After that I don't get speed anymore. Can someone please confirm?

I don't have an imx8mp board to confirm.

Please open a new thread to discuss this new issue.


Re: imx8mp spi fail

2023-02-13 Thread Elmar Psilog

Thank you so much, you made my day! Sorry, I didn't see the alias was
used different.

Although my credibility gambled away I think I found a real bug in EQOS
driver with fixed-phy:

In file fixed.c in in function fixedphy_config() the call

    val = ofnode_read_u32_default(node, "speed", 0);

returns 0 instead of 1000 and also the duplex is not set. I found that 
in file/function dwc_eth_qos.c / eqos_start() the line

eqos->phy->node = eqos->phy_of_node;

is reponsible for losing the info. Don't know what magic happens here -
so I can't fix it - just followed the data. So all works well and even
the parsing of old and new fixed-link devicetree works til that line.
After that I don't get speed anymore. Can someone please confirm?

Best regards,

Elmar

Am 13.02.23 um 00:38 schrieb Fabio Estevam:

Hi Elmar,

On Sun, Feb 12, 2023 at 3:04 PM Elmar Psilog  wrote:

Hello, kindly ask for help about SPI at an IMX8MP. I tried latest
2023.01. If you can please have a look and check it works on your side?

sspi command returns: Invalid bus 0

Could you try passing an aliases entry in your dts like this?

aliases {
 spi0 = 
};

Does this help?


What am I doing wrong or is this a bug? Thanks ahead for any hint.
dt: (tested with both types of cs-gpios)
 {
  pinctrl-names = "default";
  pinctrl-0 = <_ecspi1>;
  cs-gpios = <0>, < 9 GPIO_ACTIVE_LOW>;
//  cs-gpios = < 9 GPIO_ACTIVE_LOW>;

This last format is the correct one.


Re: imx8mp spi fail

2023-02-12 Thread Fabio Estevam
Hi Elmar,

On Sun, Feb 12, 2023 at 3:04 PM Elmar Psilog  wrote:
>
> Hello, kindly ask for help about SPI at an IMX8MP. I tried latest
> 2023.01. If you can please have a look and check it works on your side?
>
> sspi command returns: Invalid bus 0

Could you try passing an aliases entry in your dts like this?

aliases {
spi0 = 
};

Does this help?

> What am I doing wrong or is this a bug? Thanks ahead for any hint.

> dt: (tested with both types of cs-gpios)
>  {
>  pinctrl-names = "default";
>  pinctrl-0 = <_ecspi1>;
>  cs-gpios = <0>, < 9 GPIO_ACTIVE_LOW>;
> //  cs-gpios = < 9 GPIO_ACTIVE_LOW>;

This last format is the correct one.


imx8mp spi fail

2023-02-12 Thread Elmar Psilog

Hello, kindly ask for help about SPI at an IMX8MP. I tried latest
2023.01. If you can please have a look and check it works on your side?

sspi command returns: Invalid bus 0

Turning on the log-level:

drivers/core/lists.c:201-  lists_bind_fdt() bind node spi@3082
drivers/core/lists.c:222-  lists_bind_fdt()- attempt to match
compatible string 'fsl,imx8mp-ecspi'
drivers/core/lists.c:222-  lists_bind_fdt()- attempt to match
compatible string 'fsl,imx51-ecspi'
drivers/core/lists.c:250-  lists_bind_fdt()- found match at
'mxc_spi': 'fsl,imx51-ecspi' matches 'fsl,imx51-ecspi'

u-boot=> sspi
drivers/core/uclass.c:338-uclass_find_device_by_seq() 0
drivers/core/uclass.c:346-uclass_find_device_by_seq()- 1 'spi@3082'
drivers/core/uclass.c:353-uclass_find_device_by_seq()- not found
drivers/spi/spi-uclass.c:431- _spi_get_bus_and_cs() Invalid bus 0 (err=-19)

What am I doing wrong or is this a bug? Thanks ahead for any hint.

Best regards,
Elmar



---

Pretty sure my config and devicetree is not wrong as long there are no
changes about in last few month. I attache it below.

my config file:
CONFIG_SPL_DM_SPI=y
CONFIG_CMD_SPI=y
CONFIG_SPI=y
CONFIG_DM_SPI=y
CONFIG_MXC_SPI=y

dt: (tested with both types of cs-gpios)
 {
pinctrl-names = "default";
pinctrl-0 = <_ecspi1>;
cs-gpios = <0>, < 9 GPIO_ACTIVE_LOW>;
//  cs-gpios = < 9 GPIO_ACTIVE_LOW>;
status = "okay";
};

pinctrl_ecspi1: ecspi1grp {
fsl,pins = <
MX8MP_IOMUXC_ECSPI1_MISO__ECSPI1_MISO 0x0104
MX8MP_IOMUXC_ECSPI1_MOSI__ECSPI1_MOSI 0x0104
MX8MP_IOMUXC_ECSPI1_SCLK__ECSPI1_SCLK 0x0104
MX8MP_IOMUXC_ECSPI1_SS0__GPIO5_IO09 0x0104
>;
};