klipper/src/pru/Makefile
Kevin O'Connor e8356afa26 pru: Rework command processing so that most of it is done on pru0
Change the command dispatch and response generation so that most of
the work is done on pru0 instead of pru1.  This allows more code to
fit into the limited space on pru1.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-06-30 19:53:04 -04:00

34 lines
985 B
Makefile

# Additional PRU build rules
# Setup the toolchain
CROSS_PREFIX=pru-
dirs-y += src/pru src/generic
dirs-y += lib/pru_rpmsg
CFLAGS += -minrt -mmcu=am335x.pru1
CFLAGS += -Ilib/pru_rpmsg/include -Ilib/pru_rpmsg/include/am335x
CFLAGS_klipper.elf := $(filter-out -mmcu=%, $(CFLAGS))
CFLAGS_klipper.elf += -Wl,-r -nostdlib -Wl,-T,src/pru/pru.lds
CFLAGS_pru0.elf := $(filter-out -mmcu=%, $(CFLAGS)) -mmcu=am335x.pru0
CFLAGS_pru1.elf := $(CFLAGS)
# Add source files
src-y += pru/main.c pru/gpio.c generic/timer_irq.c
pru0-y := pru/pru0.c generic/crc16_ccitt.c command.c
pru0-y += ../lib/pru_rpmsg/pru_rpmsg.c ../lib/pru_rpmsg/pru_virtqueue.c
# Build the PRU binaries
target-y += $(OUT)pru0.elf $(OUT)pru1.elf
$(OUT)pru0.elf: $(patsubst %.c, $(OUT)src/%.o,$(pru0-y))
@echo " Linking $@"
$(Q)$(CC) $(CFLAGS_klipper.elf) $^ -o $(OUT)pru0.o
$(Q)$(CC) $(CFLAGS_pru0.elf) $(OUT)pru0.o -o $@
$(OUT)pru1.elf: $(OUT)klipper.elf
@echo " Linking $@"
$(Q)$(CC) $(CFLAGS_pru1.elf) $^ -o $@