b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2016 Ben Whitten <ben.whitten@gmail.com> |
| 3 | # |
| 4 | # This is free software, licensed under the GNU General Public License v2. |
| 5 | # See /LICENSE for more information. |
| 6 | # |
| 7 | |
| 8 | include $(TOPDIR)/rules.mk |
| 9 | |
| 10 | PKG_VERSION:=linux4sam-2020.04 |
| 11 | PKG_RELEASE:=2 |
| 12 | |
| 13 | PKG_SOURCE_PROTO:=git |
| 14 | PKG_SOURCE_URL:=https://github.com/linux4sam/u-boot-at91.git |
| 15 | PKG_MIRROR_HASH:=4f106d215c01c4d024c4612bbd3ef189188d19abc1ab2cc316b257d308534feb |
| 16 | PKG_SOURCE_VERSION:=0e1d1b6efb7f8e27c372279a906fcd2524df09da |
| 17 | |
| 18 | include $(INCLUDE_DIR)/u-boot.mk |
| 19 | include $(INCLUDE_DIR)/package.mk |
| 20 | include $(INCLUDE_DIR)/kernel.mk |
| 21 | |
| 22 | define U-Boot/Default |
| 23 | BUILD_TARGET:=at91 |
| 24 | HIDDEN:=1 |
| 25 | UBOOT_IMAGE:=u-boot.bin |
| 26 | endef |
| 27 | |
| 28 | define U-Boot/at91sam9m10g45ek_nandflash |
| 29 | NAME:=AT91SAM9M10G45-EK board (NandFlash) |
| 30 | BUILD_SUBTARGET:=sam9x |
| 31 | BUILD_DEVICES:=atmel_at91sam9m10g45ek |
| 32 | endef |
| 33 | |
| 34 | define U-Boot/at91sam9x5ek_nandflash |
| 35 | NAME:=AT91SAM9X5-EK board (NandFlash) |
| 36 | BUILD_SUBTARGET:=sam9x |
| 37 | BUILD_DEVICES:=atmel_at91sam9g15ek atmel_at91sam9g25ek \ |
| 38 | atmel_at91sam9g35ek atmel_at91sam9x25ek \ |
| 39 | atmel_at91sam9x35ek |
| 40 | endef |
| 41 | |
| 42 | define U-Boot/at91sam9x5ek_mmc |
| 43 | NAME:=AT91SAM9X5-EK board (SDcard) |
| 44 | BUILD_SUBTARGET:=sam9x |
| 45 | BUILD_DEVICES:=atmel_at91sam9g15ek atmel_at91sam9g25ek \ |
| 46 | atmel_at91sam9g35ek atmel_at91sam9x25ek \ |
| 47 | atmel_at91sam9x35ek |
| 48 | endef |
| 49 | |
| 50 | define U-Boot/sama5d3_xplained_nandflash |
| 51 | NAME:=SAMA5D3 Xplained board (NandFlash) |
| 52 | BUILD_SUBTARGET:=sama5 |
| 53 | BUILD_DEVICES:=microchip_sama5d3-xplained |
| 54 | endef |
| 55 | |
| 56 | define U-Boot/sama5d3_xplained_mmc |
| 57 | NAME:=SAMA5D3 Xplained board (SDcard) |
| 58 | BUILD_SUBTARGET:=sama5 |
| 59 | BUILD_DEVICES:=microchip_sama5d3-xplained |
| 60 | endef |
| 61 | |
| 62 | define U-Boot/sama5d2_xplained_spiflash |
| 63 | NAME:=SAMA5D2 Xplained board (SPI Flash) |
| 64 | BUILD_SUBTARGET:=sama5 |
| 65 | BUILD_DEVICES:=microchip_sama5d2-xplained |
| 66 | endef |
| 67 | |
| 68 | define U-Boot/sama5d2_xplained_mmc |
| 69 | NAME:=SAMA5D2 Xplained board (SDcard/EMMC) |
| 70 | BUILD_SUBTARGET:=sama5 |
| 71 | BUILD_DEVICES:=microchip_sama5d2-xplained |
| 72 | endef |
| 73 | |
| 74 | define U-Boot/sama5d4_xplained_spiflash |
| 75 | NAME:=SAMA5D4 Xplained board (SPI Flash) |
| 76 | BUILD_SUBTARGET:=sama5 |
| 77 | BUILD_DEVICES:=microchip_sama5d4-xplained |
| 78 | endef |
| 79 | |
| 80 | define U-Boot/sama5d4_xplained_mmc |
| 81 | NAME:=SAMA5D4 Xplained board (SDcard) |
| 82 | BUILD_SUBTARGET:=sama5 |
| 83 | BUILD_DEVICES:=microchip_sama5d4-xplained |
| 84 | endef |
| 85 | |
| 86 | define U-Boot/sama5d4_xplained_nandflash |
| 87 | NAME:=SAMA5D4 Xplained board (NandFlash) |
| 88 | BUILD_SUBTARGET:=sama5 |
| 89 | BUILD_DEVICES:=microchip_sama5d3-xplained |
| 90 | endef |
| 91 | |
| 92 | define U-Boot/sama5d27_som1_ek_mmc1 |
| 93 | NAME:=SAMA5D27 SOM1 Ek (SDCard1) |
| 94 | BUILD_SUBTARGET:=sama5 |
| 95 | BUILD_DEVICES:=microchip_sama5d27-som1-ek |
| 96 | endef |
| 97 | |
| 98 | define U-Boot/sama5d27_som1_ek_qspiflash |
| 99 | NAME:=SAMA5D27 SOM1 Ek (QSPI Flash) |
| 100 | BUILD_SUBTARGET:=sama5 |
| 101 | BUILD_DEVICES:=microchip_sama5d27-som1-ek |
| 102 | endef |
| 103 | |
| 104 | define U-Boot/sama5d2_ptc_ek_nandflash |
| 105 | NAME:=SAMA5D2 PTC Ek (Nand Flash) |
| 106 | BUILD_SUBTARGET:=sama5 |
| 107 | BUILD_DEVICES:=microchip_sama5d2-ptc-ek |
| 108 | endef |
| 109 | |
| 110 | define U-Boot/sama5d2_ptc_ek_mmc |
| 111 | NAME:=SAMA5D2 PTC Ek (SDCard) |
| 112 | BUILD_SUBTARGET:=sama5 |
| 113 | BUILD_DEVICES:=microchip_sama5d2-ptc-ek |
| 114 | endef |
| 115 | |
| 116 | UBOOT_TARGETS := \ |
| 117 | at91sam9m10g45ek_nandflash \ |
| 118 | at91sam9x5ek_nandflash \ |
| 119 | at91sam9x5ek_mmc \ |
| 120 | sama5d3_xplained_nandflash \ |
| 121 | sama5d3_xplained_mmc \ |
| 122 | sama5d2_xplained_mmc \ |
| 123 | sama5d2_xplained_spiflash \ |
| 124 | sama5d4_xplained_mmc \ |
| 125 | sama5d4_xplained_spiflash \ |
| 126 | sama5d4_xplained_nandflash\ |
| 127 | sama5d27_som1_ek_mmc1 \ |
| 128 | sama5d27_som1_ek_qspiflash \ |
| 129 | sama5d2_ptc_ek_nandflash \ |
| 130 | sama5d2_ptc_ek_mmc |
| 131 | |
| 132 | define Build/Compile |
| 133 | +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ |
| 134 | CROSS_COMPILE=$(TARGET_CROSS) \ |
| 135 | DTC=$(PKG_BUILD_DIR)/scripts/dtc/dtc \ |
| 136 | KCFLAGS="$(filter-out -fstack-protector \ |
| 137 | -mfloat-abi=hard, $(TARGET_CFLAGS)) -mfloat-abi=soft" |
| 138 | endef |
| 139 | |
| 140 | $(eval $(call BuildPackage/U-Boot)) |