Le 27/11/2019 à 10:11, Linus Walleij a écrit :
On Wed, Nov 27, 2019 at 10:07 AM Christophe Leroy
<christophe.leroy@xxxxxx> wrote:
Le 27/11/2019 à 09:26, Linus Walleij a écrit :
master->num_chipselect = pdata->max_chipselect;
I confirm it can't be that .... here I get ngpios = 9
Ah yeah you're right.
But the new code in the core has this:
nb = gpiod_count(dev, "cs");
However the above is likely the issue. The property in the DTS is
'gpios' and not 'cs-gpios'. According to commit e3023bf80639 ("gpio: of:
Handle the Freescale SPI CS"), it shouldn't be needed to rename it, and
that's also what I understand from commit log of 0f0581b24bd0 ("spi:
fsl: Convert to use CS GPIO descriptors")
Yeah I see it now, the gpio_get* does use the extra quirks to find
a node just named "gpios" but this gpiod_count doesn't work
because that does not loop through the same quirk.
In the meantime, I have tried changing "gpios" by "cs-gpios" in the
device tree, and I get the following warning:
[ 3.152279] ------------[ cut here ]------------
[ 3.156654] WARNING: CPU: 0 PID: 1 at drivers/spi/spi-fsl-spi.c:716
fsl_spi_cs_control+0x64/0x7c
[ 3.165320] CPU: 0 PID: 1 Comm: swapper Not tainted
5.4.0-s3k-dev-00898-gd57c00e2472d #2507
[ 3.173557] NIP: c030e8c4 LR: c030e898 CTR: c030e860
[ 3.178558] REGS: c60e1bd0 TRAP: 0700 Not tainted
(5.4.0-s3k-dev-00898-gd57c00e2472d)
[ 3.186536] MSR: 00029032 <EE,ME,IR,DR,RI> CR: 24004842 XER: 20000000
[ 3.193161]
[ 3.193161] GPR00: c030f630 c60e1c88 c60d4000 c6211c50 00000000
00000000 07de2900 c61f2210
[ 3.193161] GPR08: 00001208 c61f2210 00001200 000affff 24004848
00000000 c0003890 00000000
[ 3.193161] GPR16: 00000000 00000000 00000000 c7ffd478 c06aabc4
c06b0000 c06aaae0 c06aaaec
[ 3.193161] GPR24: c06aaaf8 c06aab04 00000000 c61f2210 c07bb2dc
00000000 c6244a40 00000000
[ 3.227800] NIP [c030e8c4] fsl_spi_cs_control+0x64/0x7c
[ 3.232963] LR [c030e898] fsl_spi_cs_control+0x38/0x7c
[ 3.238000] Call Trace:
[ 3.240450] [c60e1c98] [c030f630] fsl_spi_setup+0xc4/0x148
[ 3.245903] [c60e1cb8] [c030be98] spi_setup+0xd0/0x1c4
[ 3.250960] [c60e1cd8] [c030c030] spi_add_device+0xa4/0x190
[ 3.256472] [c60e1cf8] [c030cb28] spi_register_controller+0x75c/0xb50
[ 3.262840] [c60e1d48] [c030cf5c] devm_spi_register_controller+0x40/0x98
[ 3.269452] [c60e1d68] [c030edb0] of_fsl_spi_probe+0x2e0/0x3a0
[ 3.275220] [c60e1db8] [c02c4e94] platform_drv_probe+0x44/0xa4
[ 3.281010] [c60e1dc8] [c02c3038] really_probe+0x1ac/0x418
[ 3.286419] [c60e1df8] [c02c3ab8] device_driver_attach+0x88/0x90
[ 3.292355] [c60e1e18] [c02c3b60] __driver_attach+0xa0/0x154
[ 3.297947] [c60e1e38] [c02c1098] bus_for_each_dev+0x64/0xb4
[ 3.303540] [c60e1e68] [c02c1a74] bus_add_driver+0xe0/0x218
[ 3.309052] [c60e1e88] [c02c4318] driver_register+0x84/0x148
[ 3.314649] [c60e1e98] [c06d8d30] do_one_initcall+0x8c/0x1cc
[ 3.320232] [c60e1ef8] [c06d8fac] kernel_init_freeable+0x13c/0x1ec
[ 3.326341] [c60e1f28] [c00038a4] kernel_init+0x14/0x110
[ 3.331595] [c60e1f38] [c000e1cc] ret_from_kernel_thread+0x14/0x1c
[ 3.337656] Instruction dump:
[ 3.340590] 4bfffab1 80830018 2f840000 419e0024 80010014 215f0000
7c0803a6 83e1000c
[ 3.348246] 7c631910 54630000 38210010 4bd00028 <0fe00000> 80010014
83e1000c 7c0803a6
[ 3.356108] ---[ end trace 1b884d70796b2b85 ]---
And SPI doesn't work allthough it seems to get properly registered
Christophe