Buildroot included

This commit is contained in:
Andrew D'Angelo 2023-08-04 19:22:22 -05:00
parent 0f82af168d
commit 8d69debbcb
12 changed files with 77 additions and 8 deletions

10
Config.in Normal file
View File

@ -0,0 +1,10 @@
config BR2_PACKAGE_SHARP_DRM
bool "sharp_drm"
default y
depends on BR2_LINUX_KERNEL
select BR2_PACKAGE_LIBDRM
select BR2_PACKAGE_SPI
select BR2_PACKAGE_GPIO
select BR2_PACKAGE_RASPI_GPIO
help
DRM driver for Sharp Memory LCD

View File

@ -1,12 +1,11 @@
obj-m += sharp.o
sharp-objs += main.o drm_iface.o params_iface.o ioctl_iface.o
sharp-objs += src/main.o src/drm_iface.o src/params_iface.o src/ioctl_iface.o
ccflags-y := -DDEBUG -g -std=gnu99 -Wno-declaration-after-statement
export KROOT=/lib/modules/$(shell uname -r)/build
.PHONY: all clean
all: modules
all:
$(MAKE) -C '$(LINUX_DIR)' M='$(PWD)' modules
modules modules_install clean::
@$(MAKE) -C $(KROOT) M=$(shell pwd) $@
clean::
rm -rf Module.symvers modules.order
clean:
$(MAKE) -C '$(LINUX_DIR)' M='$(PWD)' clean

35
init/S01sharp Executable file
View File

@ -0,0 +1,35 @@
#!/bin/sh
#
# sharp_drm Loads sharp_drm driver.
#
umask 077
start() {
/sbin/modprobe sharp
echo "OK"
}
stop() {
echo "OK"
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
restart
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit $?

25
sharp.mk Normal file
View File

@ -0,0 +1,25 @@
SHARP_VERSION = 1.0
SHARP_SITE = $(BR2_EXTERNAL_BB_DRIVERS_PATH)/package/sharp
SHARP_SITE_METHOD = local
SHARP_INSTALL_IMAGES = YES
SHARP_MODULE_SUBDIRS = .
define SHARP_BUILD_CMDS
for dts in $(@D)/*.dts; do \
$(HOST_DIR)/bin/dtc -@ -I dts -O dtb -W no-unit_address_vs_reg -o $${dts%.dts}.dtbo $${dts}; \
done
endef
define SHARP_INSTALL_TARGET_CMDS
$(INSTALL) -D -m 0755 $(@D)/init/S01sharp $(TARGET_DIR)/etc/init.d/;
endef
define SHARP_INSTALL_IMAGES_CMDS
for dtbo in $(@D)/*.dtbo; do \
$(INSTALL) -D -m 0644 $${dtbo} $(BINARIES_DIR)/rpi-firmware/overlays; \
done
endef
$(eval $(kernel-module))
$(eval $(generic-package))

View File