adafruit / adafruit-raspberrypi-linux

Adafruit's hacking-friendly Raspberry Pi linux kernel
Other
132 stars 36 forks source link

Make st7735fb work #1

Closed ngreatorex closed 9 years ago

ngreatorex commented 12 years ago
  1. Prevent bcm2708 binding spidev to SPI CS0.
  2. Add module to bind SPI CS0 to ST7735FB instead (CONFIG_FB_ST7735_MAP).
  3. Move st7735fb driver to separate folder to allow loading after SPI if driver is built-in to kernel.

Can now be built either as two modules or built-in to kernel. NOTE: if built-in, you still cannot use it with fbcon as it appears the fbcon is incompatible with SPI and/or deferred I/O framebuffers.

If built as modules, run:

modprobe st7735fb modprobe st7735fb_map

You should then get /dev/fb1.

kamalmostafa commented 11 years ago

Hi Neil and Lady Ada-

Thanks for publishing your work on the ST7735 framebuffer modules. I rebased your code to the 3.2.27+ rpi kernel, and made a bunch of enhancements to it. A demo of the results is at http://www.whence.com/rpi .

My ST7735 framebuffer branch is available at https://github.com/kamalmostafa/raspberrypi-linux/commits/rpi-3.2.27%2Bkamal-st7735fb .

I added build-time configurable support for "red tab" vs. "green tab" Adafruit panels, based on comments in the Adafruit graphics library. I think my panel is a "red tab" type, but I'd appreciate any additional information about the panel types and/or verification from anyone with a "green tab" type.

I also found that I cannot properly drive my panel at the 12 MHz SPI clock rate as coded in Neil's _map module. The fastest reliable SPI rate I've seen is 4 MHz for the image data -- and the initial panel config commands even seem to need to be limited to 2 MHz. (My branch makes both rates configurable). I'm curious about the 12 MHz rate as coded (note that given the clock divisor in spi-bcm2708, that actually results in a rate of 7812500 Hz).

Lady Ada, please also note in particular this bug kamalmostafa/raspberrypi-linux@8a6df98b7d41bf0c97db6b82188ba32723c34647 (wrong number of params in the initial panel config sequence), which was introduced in your original commit of the ST7735 driver.

Any feedback will be appreciated. Thanks again!

ngreatorex commented 11 years ago

Hi Kamal,

I'm glad to see my work on this helped someone else get it going, and even more glad that you were able to enhance it.

Did you manage to get fbcon to work on the screen? Is that the terminal you show on your website? That was my ultimate aim when I started this work, but it wouldn't work for me.

With regards to the data rate, I was aware that the coded data rate wasn't theoretically possible, but it seemed to work for me. I haven't got much free time at the moment, so I am not able to verify that it actually works at that rate for me, but as soon as I have the chance I will investigate further.

Cheers, Neil

On Sunday, 28 October 2012 at 7:57PM, Kamal Mostafa wrote:

Hi Neil and Lady Ada- Thanks for publishing your work on the ST7735 framebuffer modules. I rebased your code to the 3.2.27+ rpi kernel, and made a bunch of enhancements to it. A demo of the results is at http://www.whence.com/rpi . My ST7735 framebuffer branch is available at https://github.com/kamalmostafa/raspberrypi-linux/commits/rpi-3.2.27%2Bkamal-st7735fb . I added build-time configurable support for "red tab" vs. "green tab" Adafruit panels, based on comments in the Adafruit graphics library. I think my panel is a "red tab" type, but I'd appreciate any additional information about the panel types and/or verification from anyone with a "green tab" type. I also found that I cannot properly drive my panel at the 12 MHz SPI clock rate as coded in Neil's _map module. The fastest reliable SPI rate I've seen is 4 MHz for the image data -- the initial panel config commands seem to need to be limited to 2 MHz. (My branch makes both rates configurable). I'm curious about the 12 MHz rate as coded (note that given the clock divisor in spi-bcm2708, that actually results in a rate of 7812500 Hz). Lady Ada, please also note in particular this bug kamalmostafa/raspberrypi-linux@8a6df98 (https://github.com/kamalmostafa/raspberrypi-linux/commit/8a6df98b7d41bf0c97db6b82188ba32723c34647) (wrong number of params in the initial panel config sequence), which was introduced in your original commit of the ST7735 driver. Any feedback will be appreciated. Thanks again!

— Reply to this email directly or view it on GitHub (https://github.com/adafruit/adafruit-raspberrypi-linux/pull/1#issuecomment-9849710).

kamalmostafa commented 11 years ago

Hi Neil-

I can't get fbcon to work with this driver either. I'm interested in trying to make it work too... Is your comment about fbcon not working with deferred I/O a fact, or just a guess? ;-)

The terminal session I'm using in my http://www.whence.com/rpi demo is fbterm (standard apt-get installable version), which I'm launching from inittab. I've just added more details to that page, explaining the particulars of that.

ohporter commented 11 years ago

fbcon works well on my current version at https://github.com/ohporter/linux/commit/aa6a0583845d48fcd538af7129eed728983ec2bb

You might want to incorporate the fbcon fixes into your working version. After some regmap changes this is what I plan to send upstream.