blob: ff8b0c7bae25c6a2972ca8341b4046f7da815cca [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001# SPDX-License-Identifier: GPL-2.0+
Nobuhiro Iwamatsuf3db9da2012-06-13 16:29:47 +09002#
3# (C) Copyright 2000-2006
4# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
Nobuhiro Iwamatsuf3db9da2012-06-13 16:29:47 +09005
Nobuhiro Iwamatsu47527112013-11-21 17:06:44 +09006obj-y = cpu_info.o
Masahiro Yamadad4495752013-10-17 17:34:48 +09007obj-y += emac.o
Nobuhiro Iwamatsuf3db9da2012-06-13 16:29:47 +09008
Masahiro Yamadad4495752013-10-17 17:34:48 +09009obj-$(CONFIG_DISPLAY_BOARDINFO) += board.o
Marek Vasut19d78052018-05-02 12:09:23 +020010obj-$(CONFIG_TMU_TIMER) += ../../sh/lib/time.o
Nobuhiro Iwamatsu47527112013-11-21 17:06:44 +090011obj-$(CONFIG_R8A7740) += lowlevel_init.o cpu_info-r8a7740.o pfc-r8a7740.o
Marek Vasut19d78052018-05-02 12:09:23 +020012obj-$(CONFIG_RCAR_GEN2) += lowlevel_init_ca15.o cpu_info-rcar.o
Paul Barkerd5e2e692023-10-16 10:25:41 +010013obj-$(CONFIG_RCAR_64) += lowlevel_init_gen3.o
14obj-$(CONFIG_RCAR_GEN3) += cpu_info-rcar.o memmap-gen3.o
15obj-$(CONFIG_RCAR_GEN4) += cpu_info-rcar.o memmap-gen3.o
Biju Das2f611af2021-03-17 14:11:50 +000016obj-$(CONFIG_RZ_G2) += cpu_info-rzg.o
Paul Barkerd5e2e692023-10-16 10:25:41 +010017obj-$(CONFIG_RZG2L) += cpu_info-rzg2l.o memmap-rzg2l.o
Marek Vasute39fa7d2018-10-03 12:44:13 +020018
Hai Phamd3cf5c62020-10-27 19:06:51 +070019ifneq ($(CONFIG_R8A779A0),)
20obj-$(CONFIG_ARMV8_PSCI) += psci-r8a779a0.o
21endif
22
Marek Vasute39fa7d2018-10-03 12:44:13 +020023OBJCOPYFLAGS_u-boot-spl.srec := -O srec
24quiet_cmd_objcopy = OBJCOPY $@
25cmd_objcopy = $(OBJCOPY) --gap-fill=0x00 $(OBJCOPYFLAGS) \
26 $(OBJCOPYFLAGS_$(@F)) $< $@
27
28spl/u-boot-spl.srec: spl/u-boot-spl FORCE
29 $(call if_changed,objcopy)
30
Hai Pham1e349632023-06-20 00:43:18 +020031srec_cat_gte_160 := ${shell expr `srec_cat -VERSION | grep ^srec_cat | sed 's/^.* //g' | cut -f1-2 -d.` \>= "1.60"}
32ifeq "$(srec_cat_gte_160)" "1"
33 srec_cat_le_cmd := "-constant-l-e"
34else
35 srec_cat_le_cmd := "-l-e-constant"
36endif
37
Lad Prabhakarbef12c12021-03-15 22:24:06 +000038ifneq ($(CONFIG_R8A774C0)$(CONFIG_R8A77990)$(CONFIG_R8A77995),)
Marek Vasute39fa7d2018-10-03 12:44:13 +020039#
40# The first 6 generate statements generate the R-Car Gen3 SCIF loader header.
41# The subsequent generate statements represent the following chunk of assembler
42# code, which copies the loaded data from 0xe6304030 to 0xe6318000. This is to
43# work around a limitation of the D3/E3 BootROM, which does not permit loading
44# to 0xe6318000 directly.
45#
46# mov x0, #0xe6000000
47# orr x0, x0, #0x00300000
48# orr x1, x0, #0x00004000
49# orr x1, x1, #0x00000030
50#
51# orr x2, x0, #0x00018000
52# mov x0, x2
53# mov x3, #0x7000
54#1: ldp x4, x5, [x1], #16
55#
56# stp x4, x5, [x2], #16
57# subs x3, x3, #16
58# b.ge 1b
59# br x0
60#
61quiet_cmd_srec_cat = SRECCAT $@
62 cmd_srec_cat = srec_cat -output $@ -M 8 $< -M 8 \
63 -offset -0x13fd0 \
64 -Output_Block_Size 16 \
Hai Pham1e349632023-06-20 00:43:18 +020065 -generate 0xe6300400 0xe6300404 $(srec_cat_le_cmd) 0x0 4 \
66 -generate 0xe630048c 0xe6300490 $(srec_cat_le_cmd) 0x0 4 \
67 -generate 0xe63005d4 0xe63005d8 $(srec_cat_le_cmd) 0xe6304000 4 \
68 -generate 0xe63006e4 0xe63006e8 $(srec_cat_le_cmd) $2 4 \
69 -generate 0xe6301154 0xe6301158 $(srec_cat_le_cmd) 0xe6304000 4 \
70 -generate 0xe6301264 0xe6301268 $(srec_cat_le_cmd) $2 4 \
71 -generate 0xe6304000 0xe6304004 $(srec_cat_le_cmd) 0xd2bcc000 4 \
72 -generate 0xe6304004 0xe6304008 $(srec_cat_le_cmd) 0xb26c0400 4 \
73 -generate 0xe6304008 0xe630400c $(srec_cat_le_cmd) 0xb2720001 4 \
74 -generate 0xe630400c 0xe6304010 $(srec_cat_le_cmd) 0xb27c0421 4 \
75 -generate 0xe6304010 0xe6304014 $(srec_cat_le_cmd) 0xb2710402 4 \
76 -generate 0xe6304014 0xe6304018 $(srec_cat_le_cmd) 0xaa0203e0 4 \
77 -generate 0xe6304018 0xe630401c $(srec_cat_le_cmd) 0xd28e0003 4 \
78 -generate 0xe630401c 0xe6304020 $(srec_cat_le_cmd) 0xa8c11424 4 \
79 -generate 0xe6304020 0xe6304024 $(srec_cat_le_cmd) 0xa8811444 4 \
80 -generate 0xe6304024 0xe6304028 $(srec_cat_le_cmd) 0xf1004063 4 \
81 -generate 0xe6304028 0xe630402c $(srec_cat_le_cmd) 0x54ffffaa 4 \
82 -generate 0xe630402c 0xe6304030 $(srec_cat_le_cmd) 0xd61f0000 4
Marek Vasute39fa7d2018-10-03 12:44:13 +020083else
84quiet_cmd_srec_cat = SRECCAT $@
85 cmd_srec_cat = srec_cat -output $@ -M 8 $< -M 8 \
86 -Output_Block_Size 16 \
Hai Pham1e349632023-06-20 00:43:18 +020087 -generate 0xe6300400 0xe6300404 $(srec_cat_le_cmd) 0x0 4 \
88 -generate 0xe630048c 0xe6300490 $(srec_cat_le_cmd) 0x0 4 \
89 -generate 0xe63005d4 0xe63005d8 $(srec_cat_le_cmd) $(CONFIG_SPL_TEXT_BASE) 4 \
90 -generate 0xe63006e4 0xe63006e8 $(srec_cat_le_cmd) $2 4 \
91 -generate 0xe6301154 0xe6301158 $(srec_cat_le_cmd) $(CONFIG_SPL_TEXT_BASE) 4 \
92 -generate 0xe6301264 0xe6301268 $(srec_cat_le_cmd) $2 4
Marek Vasute39fa7d2018-10-03 12:44:13 +020093endif
94
95spl/u-boot-spl.scif: spl/u-boot-spl.srec spl/u-boot-spl.bin
96 $(call cmd,srec_cat,$(shell wc -c spl/u-boot-spl.bin | awk '{printf("0x%08x\n",$$1)}'))
97
98# if srec_cat is present build u-boot-spl.scif by default
99has_srec_cat = $(call try-run,srec_cat -VERSion,y,n)
Simon Glassc46090d2020-07-19 13:56:01 -0600100INPUTS-$(has_srec_cat) += u-boot-spl.scif
Marek Vasute39fa7d2018-10-03 12:44:13 +0200101CLEAN_FILES += u-boot-spl.scif