BoardSetup revision 855fc5a0
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/haiku/firmware/raw/master/arm/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
30HAIKU_BOARD_FIRMWARE_FILES =
31	$(bootcodeFile)
32	$(startFile)
33	$(licenseFile)
34;
35
36HAIKU_BOARD_SDIMAGE_UBOOT_SCRIPT_NAME = boot.scr ;
37HAIKU_BOARD_SDIMAGE_UBOOT_SCRIPT = "\
38fatload mmc 0 ${fdt_addr_r} /fdt/$(HAIKU_BOARD_FDT_NAME).dtb \
39    fdt addr ${fdt_addr_r} \
40    fatload mmc 0 ${ramdisk_addr_r} haiku-floppyboot.tgz.ub \
41    fatload mmc 0 ${kernel_addr_r} haiku_loader_linux.ub \
42    bootm ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}" ;
43
44HAIKU_BOARD_SDIMAGE_FAT_SIZE = 32 ;
45HAIKU_BOARD_SDIMAGE_FILES = 
46	$(HAIKU_BOARD_FIRMWARE_FILES)
47	$(configFile)
48	$(ubootFile)
49	haiku_loader_linux.ub
50	haiku-floppyboot.tgz.ub
51	$(HAIKU_BOARD_SDIMAGE_UBOOT_SCRIPT_NAME)
52;
53
54HAIKU_BOARD_SDIMAGE_SIZE = 128 ;
55
56#
57# gcc flags for the specific cpu
58#
59
60local flags = -march=armv7-a -mfloat-abi=hard ;
61
62HAIKU_ASFLAGS_$(HAIKU_PACKAGING_ARCH) += $(flags) ;
63HAIKU_CCFLAGS_$(HAIKU_PACKAGING_ARCH) += $(flags) ;
64HAIKU_C++FLAGS_$(HAIKU_PACKAGING_ARCH) += $(flags) ;
65
66# Workaround for ld using 32k for alignment despite forcing it in the config...
67# should definitely not be needed!
68HAIKU_KERNEL_LINKFLAGS +=
69	-Wl,-z -Wl,max-page-size=0x1000
70	-Wl,-z -Wl,common-page-size=0x1000 ;
71HAIKU_LINKFLAGS_$(HAIKU_PACKAGING_ARCH) +=
72	-Wl,-z -Wl,max-page-size=0x1000
73	-Wl,-z -Wl,common-page-size=0x1000 ;
74
75