Skip to content

Instantly share code, notes, and snippets.

@jadonk
Last active September 19, 2017 03:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jadonk/fe636e79c691525ab2960bf5dd7956cf to your computer and use it in GitHub Desktop.
Save jadonk/fe636e79c691525ab2960bf5dd7956cf to your computer and use it in GitHub Desktop.

Test initially with:

sudo modprobe fbtft_device name=adafruit28 busnum=2 cs=1 rotate=90 gpios=reset:86,dc:45

Build the overlay:

dtc -W no-unit_address_vs_reg -@ -I dts -O dtb -o /lib/firmware/am335x-spilcd-adafruit28.dtbo am335x-spilcd-adafruit28.dts
/*
* Copyright (C) 2017 Jason Kridner, Texas Instruments Incorporated
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
/dts-v1/;
/plugin/;
/ {
compatible = "ti,am335x-bone", "ti,am335x-pocketbeagle";
fragment@0 {
target = <&spi1>;
__overlay__ {
status = "okay";
spidev@0{
status = "disabled";
};
spidev@1{
status = "disabled";
};
};
};
fragment@1 {
target = <&spi0>;
__overlay__ {
/* needed to avoid dtc warning */
#address-cells = <1>;
#size-cells = <0>;
adafruit28: adafruit28@0{
compatible = "ilitek,ili9341";
reg = <0>;
buswidth = <8>;
reset-gpios = <&gpio2 22 0>;
dc-gpios = <&gpio2 1 0>;
debug = <0>;
spi-max-frequency = <32000000>;
rotate = <270>;
/* bgr; */
fps = <30>;
};
};
};
__overrides__ {
speed = <&rpidisplay>,"spi-max-frequency:0";
rotate = <&rpidisplay>,"rotate:0";
fps = <&rpidisplay>,"fps:0";
debug = <&rpidisplay>,"debug:0";
};
};
/dts-v1/;
#include "am335x-XXX-common.dtsi"
#include "am335x-peripheral-spi0.dtsi"
&spi1 {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
adafruit28: adafruit28@1{
compatible = "ilitek,ili9341";
reg = <1>;
buswidth = <8>;
reset-gpios = <&gpio2 22 0>;
dc-gpios = <&gpio1 13 0>;
debug = <1>;
spi-max-frequency = <32000000>;
rotate = <90>;
/* bgr; */
fps = <30>;
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment