| 
									
										
										
										
											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 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | CC = clang | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | CFLAGS += \
 | 
					
						
							| 
									
										
										
										
											2021-11-03 12:24:10 +07:00
										 |  |  | 	-mcpu=cortex-a72 \
 | 
					
						
							| 
									
										
										
										
											2021-09-17 16:51:34 -07:00
										 |  |  | 	-Wall \
 | 
					
						
							|  |  |  | 	-O0 \
 | 
					
						
							|  |  |  | 	-ffreestanding \
 | 
					
						
							|  |  |  | 	-nostdlib \
 | 
					
						
							|  |  |  | 	-nostartfiles \
 | 
					
						
							|  |  |  | 	-std=c17 \
 | 
					
						
							|  |  |  | 	-mgeneral-regs-only \
 | 
					
						
							|  |  |  | 	-DCFG_TUSB_MCU=OPT_MCU_BCM2711 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-28 12:52:18 +07:00
										 |  |  | # mcu driver cause following warnings
 | 
					
						
							|  |  |  | CFLAGS += -Wno-error=cast-qual | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											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 \
 | 
					
						
							| 
									
										
										
										
											2021-10-05 18:20:44 -07:00
										 |  |  | 	$(MCU_DIR)/broadcom/interrupts.c \
 | 
					
						
							|  |  |  | 	$(MCU_DIR)/broadcom/io.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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-03 12:24:10 +07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-17 16:51:34 -07:00
										 |  |  | CROSS_COMPILE = aarch64-none-elf- | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | SKIP_NANOLIB = 1 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-05 18:20:44 -07:00
										 |  |  | LD_FILE = $(MCU_DIR)/broadcom/link.ld | 
					
						
							| 
									
										
										
										
											2021-09-17 16:51:34 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | INC += \
 | 
					
						
							|  |  |  | 	$(TOP)/$(BOARD_PATH) \
 | 
					
						
							| 
									
										
										
										
											2021-10-05 18:20:44 -07:00
										 |  |  | 	$(TOP)/$(MCU_DIR) \
 | 
					
						
							|  |  |  | 	$(TOP)/lib/CMSIS_5/CMSIS/Core_A/Include | 
					
						
							| 
									
										
										
										
											2021-09-17 16:51:34 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-05 18:20:44 -07:00
										 |  |  | SRC_S += $(MCU_DIR)/broadcom/boot.S | 
					
						
							| 
									
										
										
										
											2021-09-17 16:51:34 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | $(BUILD)/kernel8.img: $(BUILD)/$(PROJECT).elf | 
					
						
							|  |  |  | 	$(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
 | 
					
						
							| 
									
										
										
										
											2021-10-28 12:52:18 +07:00
										 |  |  | flash: $(BUILD)/kernel8.img | 
					
						
							| 
									
										
										
										
											2021-11-04 12:31:16 +07:00
										 |  |  | 	$(CP) $< /home/$(USER)/Documents/code/pi4_tinyusb/boot_cpy |