Makefile 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #
  2. # This is free software, licensed under the GNU General Public License v2.
  3. # See /LICENSE for more information.
  4. #
  5. include $(TOPDIR)/rules.mk
  6. include $(INCLUDE_DIR)/kernel.mk
  7. PKG_VERSION:=2020.07
  8. PKG_RELEASE:=3
  9. PKG_HASH:=c1f5bf9ee6bb6e648edbf19ce2ca9452f614b08a9f886f1a566aa42e8cf05f6a
  10. PKG_MAINTAINER:=Tobias Maedel <openwrt@tbspace.de>
  11. include $(INCLUDE_DIR)/u-boot.mk
  12. include $(INCLUDE_DIR)/package.mk
  13. define U-Boot/Default
  14. BUILD_TARGET:=rockchip
  15. UENV:=default
  16. HIDDEN:=1
  17. endef
  18. # RK3328 boards
  19. define U-Boot/nanopi-r2s-rk3328
  20. BUILD_SUBTARGET:=armv8
  21. NAME:=NanoPi R2S
  22. BUILD_DEVICES:= \
  23. friendlyarm_nanopi-r2s
  24. DEPENDS:=+PACKAGE_u-boot-nanopi-r2s-rk3328:arm-trusted-firmware-rockchip
  25. PKG_BUILD_DEPENDS:=arm-trusted-firmware-rockchip
  26. ATF:=rk3328_bl31.elf
  27. OF_PLATDATA:=$(1)
  28. endef
  29. define U-Boot/tpe-r1400-rk3328
  30. BUILD_SUBTARGET:=armv8
  31. NAME:=TPE-R1400
  32. BUILD_DEVICES:= \
  33. thinkpenguin_tpe-r1400
  34. DEPENDS:=+PACKAGE_u-boot-tpe-r1400-rk3328:arm-trusted-firmware-rockchip
  35. PKG_BUILD_DEPENDS:=arm-trusted-firmware-rockchip
  36. ATF:=rk3328_bl31.elf
  37. OF_PLATDATA:=$(1)
  38. endef
  39. # RK3399 boards
  40. define U-Boot/rock-pi-4-rk3399
  41. BUILD_SUBTARGET:=armv8
  42. NAME:=Rock Pi 4
  43. BUILD_DEVICES:= \
  44. radxa_rock-pi-4
  45. DEPENDS:=+PACKAGE_u-boot-rock-pi-4-rk3399:arm-trusted-firmware-rockchip
  46. PKG_BUILD_DEPENDS:=arm-trusted-firmware-rockchip
  47. ATF:=rk3399_bl31.elf
  48. endef
  49. define U-Boot/rockpro64-rk3399
  50. BUILD_SUBTARGET:=armv8
  51. NAME:=RockPro64
  52. BUILD_DEVICES:= \
  53. pine64_rockpro64
  54. DEPENDS:=+PACKAGE_u-boot-rockpro64-rk3399:arm-trusted-firmware-rockchip
  55. PKG_BUILD_DEPENDS:=arm-trusted-firmware-rockchip
  56. ATF:=rk3399_bl31.elf
  57. endef
  58. UBOOT_TARGETS := \
  59. rock-pi-4-rk3399 \
  60. rockpro64-rk3399 \
  61. nanopi-r2s-rk3328 \
  62. tpe-r1400-rk3328
  63. UBOOT_CONFIGURE_VARS += USE_PRIVATE_LIBGCC=yes
  64. UBOOT_MAKE_FLAGS += \
  65. BL31=$(STAGING_DIR_IMAGE)/$(ATF)
  66. define Build/Configure
  67. $(call Build/Configure/U-Boot)
  68. ifneq ($(OF_PLATDATA),)
  69. mkdir -p $(PKG_BUILD_DIR)/tpl/dts
  70. mkdir -p $(PKG_BUILD_DIR)/include/generated
  71. $(CP) $(PKG_BUILD_DIR)/of-platdata/$(OF_PLATDATA)/dt-platdata.c $(PKG_BUILD_DIR)/tpl/dts/dt-platdata.c
  72. $(CP) $(PKG_BUILD_DIR)/of-platdata/$(OF_PLATDATA)/dt-structs-gen.h $(PKG_BUILD_DIR)/include/generated/dt-structs-gen.h
  73. endif
  74. $(SED) 's#CONFIG_MKIMAGE_DTC_PATH=.*#CONFIG_MKIMAGE_DTC_PATH="$(PKG_BUILD_DIR)/scripts/dtc/dtc"#g' $(PKG_BUILD_DIR)/.config
  75. echo 'CONFIG_IDENT_STRING=" OpenWrt"' >> $(PKG_BUILD_DIR)/.config
  76. endef
  77. define Build/InstallDev
  78. $(INSTALL_DIR) $(STAGING_DIR_IMAGE)
  79. $(CP) $(PKG_BUILD_DIR)/idbloader.img $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-idbloader.img
  80. $(CP) $(PKG_BUILD_DIR)/u-boot.itb $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-u-boot.itb
  81. endef
  82. define Package/u-boot/install/default
  83. endef
  84. $(eval $(call BuildPackage/U-Boot))