BoardSetup revision a2ddc1c0
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
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} $(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	$(HAIKU_BOARD_FDT_NAME).dtb
49	$(ubootFile)
50	haiku_loader_linux.ub
51	haiku-floppyboot.tgz.ub
52	$(HAIKU_BOARD_SDIMAGE_UBOOT_SCRIPT_NAME)
53;
54
55HAIKU_BOARD_SDIMAGE_SIZE = 128 ;
56
57#
58# gcc flags for the specific cpu
59#
60
61local flags = -mtune=arm1176jzf-s -march=armv7-a ;
62
63HAIKU_ASFLAGS_$(HAIKU_PACKAGING_ARCH) += $(flags) ;
64HAIKU_CCFLAGS_$(HAIKU_PACKAGING_ARCH) += $(flags) ;
65HAIKU_C++FLAGS_$(HAIKU_PACKAGING_ARCH) += $(flags) ;
66
67# Workaround for ld using 32k for alignment despite forcing it in the config...
68# should definitely not be needed!
69HAIKU_KERNEL_LINKFLAGS +=
70	-Wl,-z -Wl,max-page-size=0x1000
71	-Wl,-z -Wl,common-page-size=0x1000 ;
72HAIKU_LINKFLAGS_$(HAIKU_PACKAGING_ARCH) +=
73	-Wl,-z -Wl,max-page-size=0x1000
74	-Wl,-z -Wl,common-page-size=0x1000 ;
75
76