-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
H3-based devices support #257
Comments
Tried just now on Orange Pi One. GPIO works via sysfs without any tweaks.
Changes in gettingstarted.cpp:
Edit: Just so it's clear - this configuration works for me, tested with Raspberry Pi B with RF24 and Python wrapper on the other end. |
@zador-blood-stained thanks for hinting armbian, it looks great. Before I tried an adaptation of raspbian which had /sys/class/gpio_sw instead of standard /sys/class/gpio and even behaved differently. But armbian works perfectly with my orange pc. |
Improved Allwinner SoC detection. Signed-off-by: mz-fuzzy <mzfuzzy800@gmail.com>
I tried using NanoPi Neo that uses the same H3 and the status bits were all garbage. So i hooked up a logic analyzer and saw the clock signal going high before transmission despite SPI Mode = 0. Has anyone tried it and got it working in nanopi? Is it an SPIDEV issue on the kernel? I've checked the utilities/SPIDEV/spi.cpp and the mode is correctly being set to 0. |
After some research and pointers from people having also noticed that with older HW (sun4i), the raise to HIGH results from being SUN6I_GBL_CTL_BUS_ENABLE set too early. index 8533f4edd00a..6a14589cce32 100644
--- a/drivers/spi/spi-sun6i.c
+++ b/drivers/spi/spi-sun6i.c
@@ -304,6 +304,9 @@ static int sun6i_spi_transfer_one(struct spi_master *master,
sun6i_spi_write(sspi, SUN6I_CLK_CTL_REG, reg);
+ /* Finally enable the bus - doing so before might raise SCK to HIGH */
+ sun6i_spi_write(sspi, SUN6I_GBL_CTL_REG, sun6i_spi_read(sspi, SUN6I_GBL_CTL_REG) | SUN6I_GBL_CTL_BUS_ENABLE);
+
/* Setup the transfer now... */
if (sspi->tx_buf)
tx_len = tfr->len;
@@ -411,7 +414,7 @@ static int sun6i_spi_runtime_resume(struct device *dev)
}
sun6i_spi_write(sspi, SUN6I_GBL_CTL_REG,
- SUN6I_GBL_CTL_BUS_ENABLE | SUN6I_GBL_CTL_MASTER | SUN6I_GBL_CTL_TP);
+ SUN6I_GBL_CTL_MASTER | SUN6I_GBL_CTL_TP);
return 0; |
Hey,
has anybody tried/succeeded with running the lib on H3-based devices, like Oragne Pi, BPi M2+ etc? If so, can you describe steps, especially regarding used gpio driver?
The text was updated successfully, but these errors were encountered: