aboutsummaryrefslogtreecommitdiffstats
path: root/arch/cris/include/arch-v32/arch/hwregs/iop/Makefile
blob: a90056a095e33674a6144ea1df157a4624ce8939 (plain) (blame)
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# $Id: Makefile,v 1.3 2004/01/07 20:34:55 johana Exp $
# Makefile to generate or copy the latest register definitions
# and related datastructures and helpermacros.
# The offical place for these files is probably at:
RELEASE ?= r1_alfa5
IOPOFFICIAL_INCDIR = /n/asic/projects/guinness/releases/$(RELEASE)/design/top/sw/include/

IOPROCDIR = /n/asic/design/io/io_proc/rtl

IOPROCINCL_FILES =
IOPROCINCL_FILES2=
IOPROCINCL_FILES += iop_crc_par_defs.h
IOPROCINCL_FILES += iop_dmc_in_defs.h
IOPROCINCL_FILES += iop_dmc_out_defs.h
IOPROCINCL_FILES += iop_fifo_in_defs.h
IOPROCINCL_FILES += iop_fifo_in_xtra_defs.h
IOPROCINCL_FILES += iop_fifo_out_defs.h
IOPROCINCL_FILES += iop_fifo_out_xtra_defs.h
IOPROCINCL_FILES += iop_mpu_defs.h
IOPROCINCL_FILES2+= iop_mpu_macros.h
IOPROCINCL_FILES2+= iop_reg_space.h
IOPROCINCL_FILES += iop_sap_in_defs.h
IOPROCINCL_FILES += iop_sap_out_defs.h
IOPROCINCL_FILES += iop_scrc_in_defs.h
IOPROCINCL_FILES += iop_scrc_out_defs.h
IOPROCINCL_FILES += iop_spu_defs.h
# in guiness/
IOPROCINCL_FILES += iop_sw_cfg_defs.h
IOPROCINCL_FILES += iop_sw_cpu_defs.h
IOPROCINCL_FILES += iop_sw_mpu_defs.h
IOPROCINCL_FILES += iop_sw_spu_defs.h
#
IOPROCINCL_FILES += iop_timer_grp_defs.h
IOPROCINCL_FILES += iop_trigger_grp_defs.h
# in guiness/
IOPROCINCL_FILES += iop_version_defs.h

IOPROCASMINCL_FILES = $(patsubst %_defs.h,%_defs_asm.h,$(IOPROCINCL_FILES))
IOPROCASMINCL_FILES+= iop_reg_space_asm.h


IOPROCREGDESC =
IOPROCREGDESC += $(IOPROCDIR)/iop_crc_par.r
#IOPROCREGDESC += $(IOPROCDIR)/iop_crc_ser.r
IOPROCREGDESC += $(IOPROCDIR)/iop_dmc_in.r
IOPROCREGDESC += $(IOPROCDIR)/iop_dmc_out.r
IOPROCREGDESC += $(IOPROCDIR)/iop_fifo_in.r
IOPROCREGDESC += $(IOPROCDIR)/iop_fifo_in_xtra.r
IOPROCREGDESC += $(IOPROCDIR)/iop_fifo_out.r
IOPROCREGDESC += $(IOPROCDIR)/iop_fifo_out_xtra.r
IOPROCREGDESC += $(IOPROCDIR)/iop_mpu.r
IOPROCREGDESC += $(IOPROCDIR)/iop_sap_in.r
IOPROCREGDESC += $(IOPROCDIR)/iop_sap_out.r
IOPROCREGDESC += $(IOPROCDIR)/iop_scrc_in.r
IOPROCREGDESC += $(IOPROCDIR)/iop_scrc_out.r
IOPROCREGDESC += $(IOPROCDIR)/iop_spu.r
IOPROCREGDESC += $(IOPROCDIR)/guinness/iop_sw_cfg.r
IOPROCREGDESC += $(IOPROCDIR)/guinness/iop_sw_cpu.r
IOPROCREGDESC += $(IOPROCDIR)/guinness/iop_sw_mpu.r
IOPROCREGDESC += $(IOPROCDIR)/guinness/iop_sw_spu.r
IOPROCREGDESC += $(IOPROCDIR)/iop_timer_grp.r
IOPROCREGDESC += $(IOPROCDIR)/iop_trigger_grp.r
IOPROCREGDESC += $(IOPROCDIR)/guinness/iop_version.r


RDES2C = /n/asic/bin/rdes2c
RDES2C = /n/asic/design/tools/rdesc/rdes2c
RDES2INTR = /n/asic/design/tools/rdesc/rdes2intr
RDES2TXT = /n/asic/design/tools/rdesc/rdes2txt

## all    - Just print help - you probably want to do 'make gen'
all: help

## help   - This help
help:
	@grep '^## ' Makefile

## gen    - Generate include files
gen: $(IOPROCINCL_FILES) $(IOPROCINCL_FILES2) $(IOPROCASMINCL_FILES)
	echo "INCL: $(IOPROCINCL_FILES)"
	echo "INCL2: $(IOPROCINCL_FILES2)"
	echo "ASMINCL: $(IOPROCASMINCL_FILES)"

# From the official location...
iop_reg_space.h: $(IOPOFFICIAL_INCDIR)/iop_reg_space.h
	cat $< | sed -e 's/\$$Id\:/id\:/g' >$@
iop_mpu_macros.h: $(IOPOFFICIAL_INCDIR)/iop_mpu_macros.h
	cat $< | sed -e 's/\$$Id\:/id\:/g' >$@

## copy   - Copy files from official location
copy:
	@echo "## Copying and fixing iop files ##"
	@for HFILE in $(IOPROCINCL_FILES); do \
		echo "  $$HFILE"; \
		cat $(IOPOFFICIAL_INCDIR)$$HFILE | sed -e 's/\$$Id\:/id\:/g' > $$HFILE; \
	done
	@for HFILE in $(IOPROCINCL_FILES2); do \
		echo "  $$HFILE"; \
		cat $(IOPOFFICIAL_INCDIR)$$HFILE | sed -e 's/\$$Id\:/id\:/g' > $$HFILE; \
	done
	@echo "## Copying and fixing iop asm files ##"
	@for HFILE in $(IOPROCASMINCL_FILES); do \
		echo "  $$HFILE"; \
		cat $(IOPOFFICIAL_INCDIR)asm/$$HFILE | sed -e 's/\$$Id\:/id\:/g' > asm/$$HFILE; \
	done

# I/O processor files:
## iop    - Generate I/O processor include files
iop: $(IOPROCINCL_FILES) $(IOPROCINCL_FILES2) $(IOPROCASMINCL_FILES)
iop_sw_%_defs.h: $(IOPROCDIR)/guinness/iop_sw_%.r
	$(RDES2C) $<
iop_version_defs.h: $(IOPROCDIR)/guinness/iop_version.r
	$(RDES2C) $<
%_defs.h: $(IOPROCDIR)/%.r
	$(RDES2C) $<
%_defs_asm.h: $(IOPROCDIR)/%.r
	$(RDES2C) -asm $<
iop_version_defs_asm.h: $(IOPROCDIR)/guinness/iop_version.r
	$(RDES2C) -asm $<

## doc    - Generate .axw files from register description.
doc: $(IOPROCREGDESC)
	for RDES in $^; do \
		$(RDES2TXT) $$RDES; \
	done

.PHONY: axw
## %.axw  - Generate the specified .axw file (doesn't work for all files
##          due to inconsistent naming of .r files.
%.axw: axw
	@for RDES in $(IOPROCREGDESC); do \
		if echo "$$RDES" | grep $* ; then \
		  $(RDES2TXT) $$RDES; \
		fi \
	done

.PHONY: clean
## clean  - Remove .h files and .axw files.
clean:
	rm -rf $(IOPROCINCL_FILES) *.axw

.PHONY: cleandoc
## cleandoc  - Remove .axw files.
cleandoc:
	rm -rf *.axw