summaryrefslogtreecommitdiff
path: root/cesar/hal/phy/Module
blob: 20e833f76f5ca763d5a29c9d354dd84c9dbd6aba (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
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

ifndef $(MODULE_VAR)_ONCE
$(MODULE_VAR)_ONCE = 1

hal_phy_resys_prog_h = $(OBJ_DIR)/inc/hal_phy_resys_prog.h
hal_phy_resys_prog_patch_h = $(OBJ_DIR)/inc/hal_phy_resys_prog_patch.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_prog_patch_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_prog_patch_h) $(hal_phy_resys_offsettable_h)
COMPILE_DEPS += $(hal_phy_resys_labels_h) $(hal_phy_params_h)

hal_phy_resys_prog_di_hex = $(OBJ_DIR)/resys_mem_di.hex
hal_phy_resys_prog_di_dis = $(OBJ_DIR)/resys_mem_di.dis
hal_phy_resys_prog_de_hex = $(OBJ_DIR)/resys_mem_de.hex
hal_phy_resys_prog_de_dis = $(OBJ_DIR)/resys_mem_de.dis
hal_phy_resys_offsettable_hex = $(OBJ_DIR)/offsettable_mem.hex
hal_phy_hex2c = $(call src2src,hex2c.pl,hal/phy/src/resys)
hal_phy_hexpatch2c = $(call src2src,hexpatch2c.pl,hal/phy/src/resys)
hal_phy_resys_labels = $(call src2src,resys_labels.pl,hal/phy/src/resys)
hal_phy_perl_lib = -I$(BASE)/$(call src2src,src/resys,hal/phy)
CLEAN_FILES += $(hal_phy_resys_prog_di_hex) $(hal_phy_resys_prog_di_dis) \
	       $(hal_phy_resys_prog_de_hex) $(hal_phy_resys_prog_de_dis) \
	       $(hal_phy_resys_offsettable_hex)

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

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

$(hal_phy_resys_prog_patch_h): $(hal_phy_hexpatch2c) \
	$(hal_phy_resys_prog_di_hex) $(hal_phy_resys_prog_de_hex) \
	| $(OBJ_INC_DIR_STAMP)
	perl $(hal_phy_perl_lib) $^ > $@

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

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

hal_phy_parasites = $(OBJ_DIR)/resys_mem_di.tsmc \
		    $(OBJ_DIR)/resys_mem_di.readmemh \
		    $(OBJ_DIR)/resys_mem_de.tsmc \
		    $(OBJ_DIR)/resys_mem_de.readmemh \
		    $(OBJ_DIR)/offsettable_mem.tsmc \
		    $(OBJ_DIR)/offsettable_mem.dis \
		    $(OBJ_DIR)/offsettable_mem.readmemh \
		    $(OBJ_DIR)/offsettable_mem_de.hex \
		    $(OBJ_DIR)/offsettable_mem_de.tsmc \
		    $(OBJ_DIR)/offsettable_mem_de.dis \
		    $(OBJ_DIR)/offsettable_mem_de.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_di_hex): \
	$(call src2src,resys_compil.pl prog_resys.txt \
	resys_offsettable.txt,hal/phy/src/resys)
	perl $^ --delta-internal -B $(OBJ_DIR) -D $(OBJ_DIR) \
		resys_mem_di offsettable_mem > /dev/null

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

$(hal_phy_resys_prog_di_dis): $(hal_phy_resys_prog_di_hex)
$(hal_phy_resys_offsettable_hex): $(hal_phy_resys_prog_di_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 $^ > $@

endif

$(call src2obj,hal/phy/src/resys.c,$(BUILD_TYPE)): $(hal_phy_resys_prog_h) \
$(hal_phy_resys_prog_patch_h) $(hal_phy_resys_offsettable_h)