2 # Copyright (C) 2020 Álvaro Fernández Rojas <noltari@gmail.com>
3 # Copyright (C) 2014 Jonas Gorski <jogo@openwrt.org>
4 # Copyright (C) 2011 OpenWrt.org
5 # Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org>
7 # This is free software, licensed under the GNU General Public License v2.
8 # See /LICENSE for more information.
11 include $(TOPDIR
)/rules.mk
13 LZMA_TEXT_START
:= 0x80a00000
15 LOADER_NAME
:= $(basename $(notdir $(LOADER
)))
19 UART_BASE_3329
:= 0xb0000100
20 UART_BASE_3368
:= 0xfff8c100
21 UART_BASE_3380
:= 0xb4e00200
22 UART_BASE_3383
:= 0xb4e00500
23 UART_BASE_3384
:= 0xb4e00500
24 UART_BASE_6318
:= 0xb0000100
25 UART_BASE_6328
:= 0xb0000100
26 UART_BASE_6338
:= 0xfffe0300
27 UART_BASE_6345
:= 0xfffe0300
28 UART_BASE_6348
:= 0xfffe0300
29 UART_BASE_6358
:= 0xfffe0100
30 UART_BASE_6362
:= 0xb0000100
31 UART_BASE_6368
:= 0xb0000100
32 UART_BASE_63268
:= 0xb0000180
33 UART_BASE_6816
:= 0xb0000100
34 UART_BASE_6818
:= 0xb0000100
35 UART_BASE_6828
:= 0xb0000180
36 UART_BASE
:= $(if
$(UART_BASE_
$(CHIP_ID
)),$(UART_BASE_
$(CHIP_ID
)),0)
42 LOADER_BIN
:= $(TARGET_DIR
)/$(LOADER_NAME
).bin
43 LOADER_ELF
:= $(TARGET_DIR
)/$(LOADER_NAME
).elf
45 PKG_NAME
:= lzma-loader
46 PKG_BUILD_DIR
:= $(KDIR
)/$(PKG_NAME
)
48 .PHONY
: loader-compile loader.bin loader.elf
50 $(PKG_BUILD_DIR
)/.prepared
:
51 mkdir
$(PKG_BUILD_DIR
)
52 $(CP
) .
/src
/* $(PKG_BUILD_DIR
)/
55 loader-compile
: $(PKG_BUILD_DIR
)/.prepared
56 $(MAKE
) -C
$(PKG_BUILD_DIR
) CROSS_COMPILE
="$(TARGET_CROSS)" \
57 LZMA_TEXT_START
=$(LZMA_TEXT_START
) \
58 LOADER_DATA
=$(LOADER_DATA
) \
59 UART_BASE
=$(UART_BASE
) \
62 loader.elf
: $(PKG_BUILD_DIR
)/loader.elf
63 $(CP
) $< $(LOADER_ELF
)
65 loader.bin
: $(PKG_BUILD_DIR
)/loader.bin
66 $(CP
) $< $(LOADER_BIN
)
69 prepare
: $(PKG_BUILD_DIR
)/.prepared
70 compile
: loader-compile
75 rm -rf
$(PKG_BUILD_DIR
)