Skip to content

Commit

Permalink
96boards: Declare SPI0_CS pin as GPIO for Dragonboard410c
Browse files Browse the repository at this point in the history
On the 96Boards Dragonboard410c, hardware controlled Chip Select
on the SPI0_CS pin is unreliable. So make it as a GPIO pin for
enabling the user to toggle it manually.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
  • Loading branch information
Mani-Sadhasivam committed Aug 29, 2018
1 parent 77d4676 commit fce203d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/arm/96boards.c
Expand Up @@ -356,7 +356,13 @@ mraa_96boards()
mraa_96boards_pininfo(b, 9, -1, 0, "UART0_RTS");
mraa_96boards_pininfo(b, 10, -1, 0, "SPI0_DIN");
mraa_96boards_pininfo(b, 11, -1, 0, "UART1_TXD");
mraa_96boards_pininfo(b, 12, -1, 0, "SPI0_CS");
// Only on Dragonboard410c, SPI0_CS pin is configured as GPIO for
// manual control since the HW Chip Select is not reliable
if (strncmp(b->platform_name, PLATFORM_NAME_DB410C, MAX_SIZE) == 0) {
mraa_96boards_pininfo(b, 12, 18, 1, "SPI0_CS", 0, 18);
} else {
mraa_96boards_pininfo(b, 12, -1, 0, "SPI0_CS");
}
mraa_96boards_pininfo(b, 13, -1, 0, "UART1_RXD");
mraa_96boards_pininfo(b, 14, -1, 0, "SPI0_DOUT");
mraa_96boards_pininfo(b, 15, -1, 0, "I2C0_SCL");
Expand Down

2 comments on commit fce203d

@daniel-thompson
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we wanted the kernel to manage the CS pin then we can use the GPIO support in the kernel to do this. However, such DT changes cannot easily be applied using a DT overlay because current (18.01) DB410C releases do not have symbol table export enabled.

In other words the code is fine but the description isn't correct... this is not caused by difficulties configuring hardware chip select.

@Mani-Sadhasivam
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@daniel-thompson I didn't say that there are difficulties in configuring hardware chip select. I was intended to say that the Hardware controlled Chip Select is unreliable so the pin is configured as GPIO in kernel. so we should mark it as GPIO.

I will elaborate it a bit!

Please sign in to comment.