VoCore2 SPI: full duplex

mt7628a has a wafer/silicon bug on SPI, we can not use its SPI in full duplex mode, but we can use bitbang for that mode. For some device do not support half-duplex, maybe this is the only way. To enable bitbang on VoCore2, we need to modify Linux kernel code, VOCORE2.DTS and kernel setting. Setup […]

VoCore2: develop SPI driver 6

Recently Wuhan Virus is pretty bad in China, hopefully everything back well soon. Now I have success use GPIO as CS pins, it is not hard but have to cost a lot of time understanding how the SPI driver works 🙂 Here is the patch for spi-mt7621.c, also upload to github.com/vonger/vocore2, 811-spi-gpio-chip-select.patch — a/drivers/spi/spi-mt7621.c +++ […]

VoCore2: develop SPI driver 5

In order to start further hack on MT7628 spi driver, must make the test process clear first. I am using spidev_test.c in linux kernel for the test. To compile it, 1. enable spidev in make menuconfig -> Kernel Modules -> SPI Support -> kmod-spi-dev 2. enable spidev_test in make menuconfig -> Utilities -> spidev_test For […]

VoCore2: develop SPI driver 4

Thanks for Leo, I find this new patch https://github.com/openwrt/openwrt/pull/1954. This patch increases a lot of SPI speed. I have a quick check, looks like it speeds up because of morebuf mode. … /* * Select SPI device 7, enable “more buffer mode” and disable * full-duplex (only half-duplex really works on this chip * reliably) […]

VoCore2: develop SPI driver 3

Now in the deep zone. From /proc/interrupts, I know esw, gdma, sdhci etc have interrupts. Check gdma source code, we can add similar irq code to spi. static irqreturn_t mt7621_spi_irq(int irq, void *devid) { struct mt7621_spi *rs = (struct mt7621_spi *)devid; printk(KERN_INFO “mt7621_spi_irq %d trigger\n”, irq); return IRQ_HANDLED; } … irq = platform_get_irq(pdev, 0); if […]

VoCore2: develop SPI driver 2

Continue with last blog… PS: because I am a totally noob of kernel develop, the process is pretty slow 🙂 I only have a little experience on DMA, I2S and sound codec…for SPI part, still a blank paper. This blog must be hard to understand and very few people will read, but the process is […]

VoCore2: develop SPI driver

I start this SPI driver blog because it is pretty useful and it can be a tutorial for kernel develop. Currently the SPI driver is from mt7621/mt7620, it works well. I think maybe there is someway to improve it? I have done similar to i2c driver, and for myself it is much better than the […]

VoCore2: Connect to SPI Screen 4

Now the LCD works 🙂 I change CPOL/CHPA from mode 0 to mode 3, that SPI wave shape is correct now. Also finish a simple app to drive the TFT, refresh full screen from red/green/blue pixel by pixel. Download source code here: tft.c From my test, the LCD screen max speed is around 3.8MHz (speed=49), can not […]

VoCore2: Connect to SPI Screen 3

Arrrr!!!! Last day after updated Eagle, I find it is now need to pay monthly…I know this six months delayed. 😅 Stupid autodesk. Thanks God, there is an opensource toolkit named KiCAD. I spend two days to study KiCAD, now EAGLE has moved into trash. Now continue my adventure. This time I will show you […]