Barebox bootloader
Kernel 5.19.3
OctavoSystems OSD3358-basic SOC
Solomon ssd1306 128x32 i2c (address: 0x3c) OLED module
I choose kernel 5.19.3 because it has support for the ssd1306-i2c via the ssd1307fb device driver. Previous kernel versions had support for the ssd1306 via SPI.
I enabled Kernel settings to build in (*) the frame buffer (FB) and ssd1307fb driver. I added the device to my custom device tree.
Here is snippet from my custom DT.
&i2c0 {
pinctrl-names = "default";
pinctrl-0 = <&i2c0_pins>;
status = "okay";
clock-frequency = <100000>;
tps: tps@24 {
reg = <0x24>;
};
baseboard_eeprom: baseboard_eeprom@50 {
compatible = "atmel,24c256";
reg = <0x50>;
#address-cells = <1>;
#size-cells = <1>;
baseboard_data: baseboard_data@0 {
reg = <0 0x100>;
};
};
// begin of ssd
ssd1306_i2c: oled@3c {
compatible = "solomon,ssd1306fb-i2c";
reg = <0x3c>;
solomon,height = <32>;
solomon,width = <128>;
solomon,com-seq;
solomon,com-invdir;
solomon,page-offset = <0>;
solomon,prechargep1 = <2>;
solomon,prechargep2 = <13>;
};
// end of ssd
};
After kernel boots, snippet from dmsg command
[ 3.899152] Console: switching to mono frame buffer device 16x4
[ 3.963033] ssd1307fb 0-003c: fb0: Solomon SSD1307 framebuffer device registered, using 512 bytes of video memory
The device shows up as /dev/fb0. I can open the frame buffer device /dev/fb0 in C code as FILE and fprintf() to the panel.
I understand that enabling the device in the kernel and editing the device tree is a way to add the device. However I would like to take the oppertunity to learn how to add a device using device tree overlay. I made no changes to the kernel, i.e. the FB and ssd1307 are built into the kernel.
I removed the ssd from my DT and created my_ssd1306.dts
/dts-v1/;
/plugin/;
/ {
fragment@0 {
target = <&i2c0>;
__overlay__ {
ssd1306_i2c: oled@3c {
compatible = "solomon,ssd1306fb-i2c";
reg = <0x3c>;
solomon,height = <32>;
solomon,width = <128>;
solomon,com-seq;
solomon,com-invdir;
solomon,page-offset = <0>;
solomon,prechargep1 = <2>;
solomon,prechargep2 = <13>;
};
};
};
};
I built the overlay using the kernel make command ‘make dtbs’.
I now have a ‘my_ssd1306.dtbo’ file but I don’t understand what to do next.
Do I copy the .dtbo to a folder?
If yes, which folder?
How do I tell the kernel to load/apply the overlay?
Thank you,