summaryrefslogtreecommitdiff
path: root/cesar/hal/phy/Module
blob: 60ed46518ddc6c4b78fc4237394fe2502a339c39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
SOURCES := access.c pbdma.c phy.c pratic.c rx.c tx.c resys.c vsr.S bridgedma.c
MODULES := hal/phy/spoc

ifeq ($(CONFIG_TRACE),y)
SOURCES += trace.c
endif

hal_phy_resys_prog_h = $(OBJ_DIR)/inc/hal_phy_resys_prog.h
hal_phy_resys_offsettable_h = $(OBJ_DIR)/inc/hal_phy_resys_offsettable.h
hal_phy_resys_labels_h = $(OBJ_DIR)/inc/hal_phy_resys_labels.h
hal_phy_params_h = $(OBJ_DIR)/inc/hal_phy_params.h
CLEAN_FILES += $(hal_phy_resys_prog_h) $(hal_phy_resys_offsettable_h) \
	       $(hal_phy_resys_labels_h) $(hal_phy_params_h)

$(call src2obj,hal/phy/src/resys.c,target): $(hal_phy_resys_prog_h) \
$(hal_phy_resys_offsettable_h)
COMPILE_DEPS += $(hal_phy_resys_labels_h) $(hal_phy_params_h)

hal_phy_resys_prog_hex = $(OBJ_DIR)/resys_mem.hex
hal_phy_resys_prog_dis = $(OBJ_DIR)/resys_mem.dis
hal_phy_resys_offsettable_hex = $(OBJ_DIR)/offsettable_mem.hex
hal_phy_hex2c = $(call src2src,hex2c.pl,hal/phy/src/resys)
hal_phy_resys_labels = $(call src2src,resys_labels.pl,hal/phy/src/resys)
CLEAN_FILES += $(hal_phy_resys_prog_hex) $(hal_phy_resys_prog_dis) \
	       $(hal_phy_resys_offsettable_hex)

vpath $(hal_phy_hex2c) $(BASE)
vpath $(hal_phy_resys_labels) $(BASE)

$(hal_phy_resys_prog_h): $(hal_phy_hex2c) $(hal_phy_resys_prog_hex) \
	| $(OBJ_INC_DIR_STAMP)
	perl $^ > $@

$(hal_phy_resys_offsettable_h): $(hal_phy_hex2c) \
	$(hal_phy_resys_offsettable_hex) | $(OBJ_INC_DIR_STAMP)
	perl $^ > $@

$(hal_phy_resys_labels_h): $(hal_phy_resys_labels) $(hal_phy_resys_prog_dis) \
	| $(OBJ_INC_DIR_STAMP)
	perl $^ > $@

hal_phy_parasites = $(OBJ_DIR)/resys_mem.tsmc \
		    $(OBJ_DIR)/resys_mem.readmemh \
		    $(OBJ_DIR)/offsettable_mem.tsmc \
		    $(OBJ_DIR)/offsettable_mem.dis \
		    $(OBJ_DIR)/offsettable_mem.readmemh
CLEAN_FILES += $(hal_phy_parasites)

vpath %/resys_compil.pl $(BASE)
vpath %/prog_resys.txt $(BASE)
vpath %/resys_offsettable.txt $(BASE)

$(hal_phy_resys_prog_hex) $(hal_phy_resys_offsettable_hex): \
	$(call src2src,resys_compil.pl prog_resys.txt \
	resys_offsettable.txt,hal/phy/src/resys)
	perl $^ -B $(OBJ_DIR) -D $(OBJ_DIR) > /dev/null

$(hal_phy_resys_prog_dis): $(hal_phy_resys_prog_hex)

hal_phy_params_txt = $(call src2src,phy_params.txt,hal/phy/inc)

vpath %/phy_params.txt $(BASE)
vpath %/phy_params.pl $(BASE)

$(hal_phy_params_h): $(call src2src,phy_params.pl,hal/phy/src) \
	$(hal_phy_params_txt) | $(OBJ_INC_DIR_STAMP)
	perl $^ > $@