1# 2# (C) Copyright 2006 3# Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4# 5# Copyright 2004 Freescale Semiconductor, Inc. 6# 7# SPDX-License-Identifier: GPL-2.0+ 8# 9 10include $(TOPDIR)/config.mk 11 12LIB = $(obj)lib$(CPU).o 13 14MINIMAL= 15 16ifdef CONFIG_SPL_BUILD 17ifdef CONFIG_SPL_INIT_MINIMAL 18MINIMAL=y 19endif 20endif 21 22START = start.o 23 24ifdef MINIMAL 25 26COBJS-y += spl_minimal.o 27 28else 29 30COBJS-y += traps.o 31COBJS-y += cpu.o 32COBJS-y += cpu_init.o 33COBJS-y += speed.o 34COBJS-y += interrupts.o 35COBJS-y += ecc.o 36COBJS-$(CONFIG_QE) += qe_io.o 37COBJS-$(CONFIG_FSL_SERDES) += serdes.o 38COBJS-$(CONFIG_PCI) += pci.o 39COBJS-$(CONFIG_PCIE) += pcie.o 40COBJS-$(CONFIG_OF_LIBFDT) += fdt.o 41 42# Stub implementations of cache management functions for USB 43COBJS-y += cache.o 44 45ifdef CONFIG_FSL_DDR2 46COBJS_LN-$(CONFIG_MPC8349) += ddr-gen2.o 47else 48COBJS-y += spd_sdram.o 49endif 50COBJS-$(CONFIG_FSL_DDR2) += law.o 51 52endif # not minimal 53 54COBJS := $(COBJS-y) 55SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c) $(addprefix $(obj),$(COBJS_LN-y:.o=.c)) 56OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS) $(COBJS_LN-y)) 57START := $(addprefix $(obj),$(START)) 58 59all: $(obj).depend $(START) $(LIB) 60 61$(LIB): $(OBJS) 62 $(call cmd_link_o_target, $(OBJS)) 63 64$(obj)ddr-gen1.c: 65 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/ddr-gen1.c $(obj)ddr-gen1.c 66 67$(obj)ddr-gen2.c: 68 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/ddr-gen2.c $(obj)ddr-gen2.c 69 70$(obj)ddr-gen3.c: 71 ln -sf $(SRCTREE)/arch/powerpc/cpu/mpc85xx/ddr-gen3.c $(obj)ddr-gen3.c 72 73######################################################################### 74 75# defines $(obj).depend target 76include $(SRCTREE)/rules.mk 77 78sinclude $(obj).depend 79 80######################################################################### 81