Page 1 of 1

more than 4 slave devices on spi

Posted: Wed Nov 20, 2019 5:50 pm
by Ganesh
Hello,
Platform: sama5d27
Kernel version: 4.14.88

We are trying to integrate 9 spi slaves in spi1. if i add only 4 slave devices its working fine. if i add more than 4 devices in spi1, error is coming, please find from the attached file for error log. we are using the gpios as chipselects. below given the added devicetree.

spi1: spi@fc000000 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_spi1_default>;
cs-gpios =<&pioA PIN_PC31 GPIO_ACTIVE_LOW>,<&pioA PIN_PC30 GPIO_ACTIVE_LOW>,
<&pioA PIN_PC25 GPIO_ACTIVE_LOW>,<&pioA PIN_PD24 GPIO_ACTIVE_LOW>,
<&pioA PIN_PC29 GPIO_ACTIVE_LOW>;
//<&pioA PIN_PD24 GPIO_ACTIVE_LOW>,
// <&pioA PIN_PC29 GPIO_ACTIVE_LOW>,<&pioA PIN_PD30 GPIO_ACTIVE_LOW>,*/
// <&pioA PIN_PD7 GPIO_ACTIVE_LOW>;
status = "okay";

ad5761_0: ad5761_0@0 {
compatible = "ad5761";
reg = <0>;
spi-max-frequency = <10000000>;
ldac-gpio =<&pioA PIN_PC28 0>;
reset-gpio =<&pioA PIN_PA24 0>;
spi-cpha;
status = "okay";
};

ad5761_1: ad5761_1@1 {
compatible = "ad5761";
reg = <1>;
spi-max-frequency = <10000000>;
ldac-gpio =<&pioA PIN_PC27 0>;
reset-gpio =<&pioA PIN_PB12 0>;
spi-cpha;
status = "okay";
};

max14661_1: max14661_2@2 {
compatible = "max14661";
reg = <2>;
spi-max-frequency = <10000000>;
gpio-en =<&pioA PIN_PB2 0>;
status = "okay";
};

max14661_2: max14661_3@3 {
compatible = "max14661";
reg = <3>;
spi-max-frequency = <10000000>;
gpio-en =<&pioA PIN_PC20 0>;
status = "okay";
};

max14661_3: max14661_2@2 {
compatible = "max14661";
reg = <2>;
spi-max-frequency = <10000000>;
gpio-en =<&pioA PIN_PC26 0>;
status = "okay";
};
};

pinctrl_spi1_default: spi1_default {
pinmux = <PIN_PD25__SPI1_SPCK>,
<PIN_PD26__SPI1_MOSI>,
<PIN_PD27__SPI1_MISO>,
<PIN_PC31__GPIO>, /* chip select for dac1 */
<PIN_PC30__GPIO>, /* chip select for dac2 */
<PIN_PC25__GPIO>, /* chip select for max14661_1 *
<PIN_PD24__GPIO>, /* chip select for max14661_2 */
<PIN_PC29__GPIO>, /* chip select for max14661_3 */
<PIN_PC28__GPIO>, /* ldac for dac1 */
<PIN_PA24__GPIO>, /* reset for dac1 */
<PIN_PC27__GPIO>, /* ldac for dac2 */
<PIN_PB12__GPIO>, /* reset for dac2 */
<PIN_PB2__GPIO>, /* enable gpio for max14661_1 */
<PIN_PC20__GPIO>, /* enable gpio for max14661_2 */
<PIN_PC26__GPIO>, /* enable gpio for max14661_3 */
<PIN_PA26__GPIO>; /* select pin for max14661 */

bias-disable;
};
Please give a solution to add more than 4 devices in spi1.

Thanks & Regards
Ganesh.K

Re: more than 4 slave devices on spi

Posted: Fri Nov 22, 2019 1:50 am
by blue_z
Ganesh wrote: We are trying to integrate 9 spi slaves in spi1. if i add only 4 slave devices its working fine. if i add more than 4 devices in spi1, error is coming, please find from the attached file for error log.
There is no "attached file for error log" to review.

The Microchip/Atmel SPI master typically uses GPIO control (rather than its internal logic) to toggle the CS lines.
So in that sense the master is not limited to just 4 slaves.
You'll have to study the driver(s) to see where the restriction(s) of 4 slaves is/are imposed.

Regards

Re: more than 4 slave devices on spi

Posted: Fri Nov 22, 2019 6:37 am
by Ganesh
find the attachment of error log

Re: more than 4 slave devices on spi

Posted: Wed Nov 27, 2019 11:19 am
by Ganesh
hi,

can you provide, if any patch is available for this issue.to increase the number of slaves.
platform: sama5d27
kernel version: 4.14.77

Thanks & Regards
Ganesh.K

Re: more than 4 slave devices on spi

Posted: Sat Nov 30, 2019 2:24 am
by blue_z
AFAIK there is no such patch.

Regards