build.ck 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /*++
  2. Copyright (c) 2015 Minoca Corp. All Rights Reserved
  3. Module Name:
  4. Raspberry Pi 2 UEFI Firmware
  5. Abstract:
  6. This module implements UEFI firmware for the Raspberry Pi 2.
  7. Author:
  8. Chris Stevens 19-Mar-2015
  9. Environment:
  10. Firmware
  11. --*/
  12. function build() {
  13. plat = "rpi2";
  14. text_address = "0x00008000";
  15. sources = [
  16. "armv7/entry.S",
  17. "armv7/smpa.S",
  18. "armv7/timera.S",
  19. "debug.c",
  20. "fwvol.c",
  21. "intr.c",
  22. "main.c",
  23. "memmap.c",
  24. "ramdenum.c",
  25. ":" + plat + "fwv.o",
  26. "smbios.c",
  27. "smp.c",
  28. "timer.c",
  29. ];
  30. includes = [
  31. "$//uefi/include"
  32. ];
  33. sources_config = {
  34. "CFLAGS": ["-fshort-wchar"]
  35. };
  36. link_ldflags = [
  37. "-nostdlib",
  38. "-Wl,--no-wchar-size-warning",
  39. "-static"
  40. ];
  41. link_config = {
  42. "LDFLAGS": link_ldflags
  43. };
  44. common_libs = [
  45. "//uefi/core:ueficore",
  46. "//kernel/kd:kdboot",
  47. "//uefi/core:ueficore",
  48. "//uefi/archlib:uefiarch",
  49. "//lib/fatlib:fat",
  50. "//lib/basevid:basevid",
  51. "//lib/rtl/base:basertlb",
  52. "//kernel/kd/kdusb:kdnousb",
  53. "//kernel:archboot",
  54. "//uefi/core:emptyrd",
  55. ];
  56. libs = [
  57. "//uefi/dev/pl11:pl11",
  58. "//uefi/dev/bcm2709:bcm2709",
  59. "//uefi/dev/sd/core:sd",
  60. ];
  61. libs += common_libs;
  62. platfw = plat + "fw";
  63. elf = {
  64. "label": platfw + ".elf",
  65. "inputs": sources + libs,
  66. "sources_config": sources_config,
  67. "includes": includes,
  68. "config": link_config,
  69. "text_address": text_address
  70. };
  71. entries = executable(elf);
  72. //
  73. // Build the firmware volume.
  74. //
  75. ffs = [
  76. "//uefi/core/runtime:rtbase.ffs",
  77. "//uefi/plat/" + plat + "/runtime:" + plat + "rt.ffs",
  78. "//uefi/plat/" + plat + "/acpi:acpi.ffs"
  79. ];
  80. fw_volume = uefi_fwvol_o(plat, ffs);
  81. entries += fw_volume;
  82. //
  83. // Flatten the firmware image.
  84. //
  85. flattened = {
  86. "label": platfw,
  87. "inputs": [":" + platfw + ".elf"],
  88. "implicit": ["//uefi/plat/rpi2/blobs:blobs"],
  89. "binplace": TRUE
  90. };
  91. entries += flattened_binary(flattened);
  92. return entries;
  93. }
  94. return build();