2021-11-02 21:46:23 +07:00
|
|
|
MCU_DIR = hw/mcu/broadcom
|
|
|
|
DEPS_SUBMODULES += $(MCU_DIR)
|
2021-09-17 16:51:34 -07:00
|
|
|
|
|
|
|
include $(TOP)/$(BOARD_PATH)/board.mk
|
|
|
|
|
|
|
|
CFLAGS += \
|
|
|
|
-Wall \
|
|
|
|
-O0 \
|
|
|
|
-ffreestanding \
|
|
|
|
-nostdlib \
|
|
|
|
-nostartfiles \
|
|
|
|
-mgeneral-regs-only \
|
2022-01-05 13:47:01 -08:00
|
|
|
-std=c17
|
2021-09-17 16:51:34 -07:00
|
|
|
|
2022-01-05 14:11:39 -08:00
|
|
|
CROSS_COMPILE = aarch64-none-elf-
|
|
|
|
|
2021-10-28 12:52:18 +07:00
|
|
|
# mcu driver cause following warnings
|
2022-06-24 19:45:49 +07:00
|
|
|
CFLAGS += -Wno-error=cast-qual -Wno-error=redundant-decls
|
2021-10-28 12:52:18 +07:00
|
|
|
|
2021-09-17 16:51:34 -07:00
|
|
|
SRC_C += \
|
2021-10-28 12:52:18 +07:00
|
|
|
src/portable/synopsys/dwc2/dcd_dwc2.c \
|
2021-10-12 16:47:53 -07:00
|
|
|
$(MCU_DIR)/broadcom/gen/interrupt_handlers.c \
|
2022-01-05 13:47:01 -08:00
|
|
|
$(MCU_DIR)/broadcom/gpio.c \
|
2021-10-05 18:20:44 -07:00
|
|
|
$(MCU_DIR)/broadcom/interrupts.c \
|
|
|
|
$(MCU_DIR)/broadcom/mmu.c \
|
2021-11-03 13:13:08 +07:00
|
|
|
$(MCU_DIR)/broadcom/caches.c \
|
2021-10-05 18:20:44 -07:00
|
|
|
$(MCU_DIR)/broadcom/vcmailbox.c
|
2021-09-17 16:51:34 -07:00
|
|
|
|
|
|
|
SKIP_NANOLIB = 1
|
|
|
|
|
2022-01-05 14:11:39 -08:00
|
|
|
LD_FILE = $(MCU_DIR)/broadcom/link8.ld
|
2021-09-17 16:51:34 -07:00
|
|
|
|
|
|
|
INC += \
|
|
|
|
$(TOP)/$(BOARD_PATH) \
|
2022-01-05 14:11:39 -08:00
|
|
|
$(TOP)/$(MCU_DIR) \
|
|
|
|
$(TOP)/lib/CMSIS_5/CMSIS/Core_A/Include
|
2021-09-17 16:51:34 -07:00
|
|
|
|
2022-01-05 14:11:39 -08:00
|
|
|
SRC_S += $(MCU_DIR)/broadcom/boot8.S
|
2021-09-17 16:51:34 -07:00
|
|
|
|
2022-01-05 14:11:39 -08:00
|
|
|
$(BUILD)/kernel8.img: $(BUILD)/$(PROJECT).elf
|
2021-09-17 16:51:34 -07:00
|
|
|
$(OBJCOPY) -O binary $^ $@
|
2021-10-28 12:52:18 +07:00
|
|
|
|
2021-11-02 18:17:59 +07:00
|
|
|
# Copy to kernel to netboot drive or SD card
|
|
|
|
# Change destinaation to fit your need
|
2022-01-05 14:11:39 -08:00
|
|
|
flash: $(BUILD)/kernel8.img
|
2022-01-05 13:47:01 -08:00
|
|
|
@$(CP) $< /home/$(USER)/Documents/code/pi_tinyusb/boot_cpy
|