Skip to content

Commit

Permalink
Updated to compile on Bone
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkAYoder committed Nov 20, 2014
1 parent f61af1c commit 255df7e
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 39 deletions.
75 changes: 37 additions & 38 deletions LEDstring/driver/Makefile
Original file line number Diff line number Diff line change
@@ -1,39 +1,38 @@
CC=gcc

TARGETS=test \
test.o

all: $(TARGETS)

.PHONY: lpd8806 clean

kernel:
cp -f ./lpd8806.c ~/BeagleBoard/linux-dev/KERNEL/drivers/char
./buildKernel.sh
scp ~/BeagleBoard/linux-dev/KERNEL/drivers/char/lpd8806.ko root@yoder-white-bone.dhcp.rose-hulman.edu:.

lpd8806:
cp -f ./lpd8806.c ~/BeagleBoard/linux-dev/KERNEL/drivers/char
./buildKernel.sh
scp ~/BeagleBoard/linux-dev/KERNEL/drivers/char/lpd8806.ko root@192.168.7.2:/lib/modules/3.2.25+/kernel/drivers/char

dt: # Set up device tree for SPI
# SPI1
# dtc -O dtb -o BB-SPI1-01-00A0.dtbo -b 0 -@ BB-SPI1-01-00A0.dts
# cp BB-SPI1-01-00A0.dtbo /lib/firmware/
# echo BB-SPI1-01 > /sys/devices/bone_capemgr.*/slots
# Makefile for compiling out-of-tree
# From Free Electrons
# If $ARCH is arm, then we are cross compiling, use the kernel sources
# If on the Bone run apt-get install linux-headers-`uname -r`

ifeq ($(ARCH),arm)
KDIR := ~/BeagleBoard/bb-kernel/KERNEL
else
KDIR := /lib/modules/$(shell uname -r)/build
endif

ifeq ($(KERNELRELEASE),)
obj-$(CONFIG_EXAMPLES) += lpd8806.o
else
obj-m += lpd8806.o
endif

all:
$(MAKE) -C $(KDIR) M=$$PWD

dt:
# Set up device tree for SPI
# SPI0
dtc -O dtb -o BB-SPI0-01-00A0.dtbo -b 0 -@ BB-SPI0-01-00A0.dts
cp BB-SPI0-01-00A0.dtbo /lib/firmware/

clean:
clear
rm -f $(TARGETS)

test: test.o
$(CC) $^ -o $@

%.o: %.c
$(CC) -c $< -o $@


echo ADAFRUIT-SPI0 > /sys/devices/bone_capemgr.*/slots
# SPI1
# echo ADAFRUIT-SPI1 > /sys/devices/bone_capemgr.*/slots

install:
scp hello*.ko bone:.

print:
@echo KERNELRELEASE= $(KERNELRELEASE)
@echo CONFIG_EXAMPLES= $(CONFIG_EXAMPLES)
@echo obj-m= $(obj-m)

clean:
rm -rf .tmp_versions .lpd8806* lpd8806*.mod.c *.o
rm Module.symvers modules.order
37 changes: 37 additions & 0 deletions LEDstring/driver/Makefile.orig
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
CC=gcc

TARGETS=test \
test.o

all: $(TARGETS)

.PHONY: lpd8806 clean

kernel:
cp -f ./lpd8806.c ~/BeagleBoard/linux-dev/KERNEL/drivers/char
./buildKernel.sh
scp ~/BeagleBoard/linux-dev/KERNEL/drivers/char/lpd8806.ko root@yoder-white-bone.dhcp.rose-hulman.edu:.

lpd8806:
cp -f ./lpd8806.c ~/BeagleBoard/linux-dev/KERNEL/drivers/char
./buildKernel.sh
scp ~/BeagleBoard/linux-dev/KERNEL/drivers/char/lpd8806.ko root@192.168.7.2:/lib/modules/3.2.25+/kernel/drivers/char

dt: # Set up device tree for SPI
# SPI1
# dtc -O dtb -o BB-SPI1-01-00A0.dtbo -b 0 -@ BB-SPI1-01-00A0.dts
# cp BB-SPI1-01-00A0.dtbo /lib/firmware/
# echo BB-SPI1-01 > /sys/devices/bone_capemgr.*/slots
# SPI0
dtc -O dtb -o BB-SPI0-01-00A0.dtbo -b 0 -@ BB-SPI0-01-00A0.dts
cp BB-SPI0-01-00A0.dtbo /lib/firmware/

clean:
clear
rm -f $(TARGETS)

test: test.o
$(CC) $^ -o $@

%.o: %.c
$(CC) -c $< -o $@
1 change: 1 addition & 0 deletions LEDstring/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
apt-get install linux-headers-`uname -r`
2 changes: 1 addition & 1 deletion modules/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ print:

clean:
rm -rf .tmp_versions .hello* hello*.mod.c *.o
rm Module.symvers modules.order
rm Module.symvers modules.order

0 comments on commit 255df7e

Please sign in to comment.