BoardSetup revision 3d02d66b
1# Raspberry Pi 2 board-specific definitions
2
3HAIKU_BOARD_DESCRIPTION = "Raspberry Pi 2" ;
4HAIKU_BOARD_FDT_NAME = "rpi2" ;
5
6#
7# Various hardcoded addresses
8#
9
10HAIKU_BOARD_LOADER_BASE = 0x00080000 ;
11HAIKU_BOARD_LOADER_ENTRY_RAW = $(HAIKU_BOARD_LOADER_BASE) ;
12HAIKU_BOARD_LOADER_ENTRY_NBSD = `printf \"obase=16;ibase=16;8 + %x\\n\" $(HAIKU_BOARD_LOADER_BASE)|bc` ;
13HAIKU_BOARD_LOADER_ENTRY_LINUX = `printf \"obase=16;ibase=16;10 + %x\\n\" $(HAIKU_BOARD_LOADER_BASE)|bc` ;
14
15#
16# mmc/SD image
17#
18
19# u-boot image
20HAIKU_BOARD_UBOOT_IMAGE_URL = https://github.com/kallisti5/rpi-uboot-bins/raw/master/rpi2 ;
21ubootFile = [ DownloadFile u-boot.bin : $(HAIKU_BOARD_UBOOT_IMAGE_URL)/u-boot.bin ] ;
22configFile = [ DownloadFile config.txt : $(HAIKU_BOARD_UBOOT_IMAGE_URL)/config.txt ] ;
23
24# Raspberry Pi foundation loader
25HAIKU_BOARD_FIRMWARE_URL = https://github.com/raspberrypi/firmware/raw/master/boot ;
26bootcodeFile = [ DownloadFile bootcode.bin : $(HAIKU_BOARD_FIRMWARE_URL)/bootcode.bin ] ;
27startFile = [ DownloadFile start.elf : $(HAIKU_BOARD_FIRMWARE_URL)/start.elf ] ;
28licenseFile = [ DownloadFile LICENCE.broadcom : $(HAIKU_BOARD_FIRMWARE_URL)/LICENCE.broadcom ] ;
29
30local fdtBinary = [ FDirName $(HAIKU_OUTPUT_DIR) $(HAIKU_BOARD_FDT_NAME).dtb ] ;
31CompileDTS $(fdtBinary) : [ FDirName $(HAIKU_TOP) src data dts arch arm $(HAIKU_BOARD_FDT_NAME).dts ] ;
32
33HAIKU_BOARD_FIRMWARE_FILES =
34	$(bootcodeFile)
35	$(startFile)
36	$(licenseFile)
37;
38
39HAIKU_BOARD_SDIMAGE_UBOOT_SCRIPT_NAME = boot.scr ;
40HAIKU_BOARD_SDIMAGE_UBOOT_SCRIPT = "\
41fatload mmc 0 ${fdt_addr_r} $(HAIKU_BOARD_FDT_NAME).dtb \
42    fdt addr ${fdt_addr_r} \
43    fatload mmc 0 ${ramdisk_addr_r} haiku-floppyboot.tgz.ub \
44    fatload mmc 0 ${kernel_addr_r} haiku_loader_linux.ub \
45    bootm ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}" ;
46
47HAIKU_BOARD_SDIMAGE_FAT_SIZE = 32 ;
48HAIKU_BOARD_SDIMAGE_FILES = 
49	$(HAIKU_BOARD_FIRMWARE_FILES)
50	$(configFile)
51	$(fdtBinary)
52	$(ubootFile)
53	haiku_loader_linux.ub
54	haiku-floppyboot.tgz.ub
55	$(HAIKU_BOARD_SDIMAGE_UBOOT_SCRIPT_NAME)
56;
57
58HAIKU_BOARD_SDIMAGE_SIZE = 128 ;
59
60#
61# gcc flags for the specific cpu
62#
63
64local flags = -mtune=arm1176jzf-s -march=armv7-a ;
65
66HAIKU_ASFLAGS_$(HAIKU_PACKAGING_ARCH) += $(flags) ;
67HAIKU_CCFLAGS_$(HAIKU_PACKAGING_ARCH) += $(flags) ;
68HAIKU_C++FLAGS_$(HAIKU_PACKAGING_ARCH) += $(flags) ;
69
70# Workaround for ld using 32k for alignment despite forcing it in the config...
71# should definitely not be needed!
72HAIKU_KERNEL_LINKFLAGS +=
73	-Wl,-z -Wl,max-page-size=0x1000
74	-Wl,-z -Wl,common-page-size=0x1000 ;
75HAIKU_LINKFLAGS_$(HAIKU_PACKAGING_ARCH) +=
76	-Wl,-z -Wl,max-page-size=0x1000
77	-Wl,-z -Wl,common-page-size=0x1000 ;
78
79