Merge remote-tracking branch 'asoc/topic/pcm512x' into asoc-next
[sfrench/cifs-2.6.git] / arch / cris / include / arch-v32 / arch / hwregs / iop / Makefile
1 # SPDX-License-Identifier: GPL-2.0
2 # $Id: Makefile,v 1.3 2004/01/07 20:34:55 johana Exp $
3 # Makefile to generate or copy the latest register definitions
4 # and related datastructures and helpermacros.
5 # The official place for these files is probably at:
6 RELEASE ?= r1_alfa5
7 IOPOFFICIAL_INCDIR = /n/asic/projects/guinness/releases/$(RELEASE)/design/top/sw/include/
8
9 IOPROCDIR = /n/asic/design/io/io_proc/rtl
10
11 IOPROCINCL_FILES =
12 IOPROCINCL_FILES2=
13 IOPROCINCL_FILES += iop_crc_par_defs.h
14 IOPROCINCL_FILES += iop_dmc_in_defs.h
15 IOPROCINCL_FILES += iop_dmc_out_defs.h
16 IOPROCINCL_FILES += iop_fifo_in_defs.h
17 IOPROCINCL_FILES += iop_fifo_in_xtra_defs.h
18 IOPROCINCL_FILES += iop_fifo_out_defs.h
19 IOPROCINCL_FILES += iop_fifo_out_xtra_defs.h
20 IOPROCINCL_FILES += iop_mpu_defs.h
21 IOPROCINCL_FILES2+= iop_mpu_macros.h
22 IOPROCINCL_FILES2+= iop_reg_space.h
23 IOPROCINCL_FILES += iop_sap_in_defs.h
24 IOPROCINCL_FILES += iop_sap_out_defs.h
25 IOPROCINCL_FILES += iop_scrc_in_defs.h
26 IOPROCINCL_FILES += iop_scrc_out_defs.h
27 IOPROCINCL_FILES += iop_spu_defs.h
28 # in guiness/
29 IOPROCINCL_FILES += iop_sw_cfg_defs.h
30 IOPROCINCL_FILES += iop_sw_cpu_defs.h
31 IOPROCINCL_FILES += iop_sw_mpu_defs.h
32 IOPROCINCL_FILES += iop_sw_spu_defs.h
33 #
34 IOPROCINCL_FILES += iop_timer_grp_defs.h
35 IOPROCINCL_FILES += iop_trigger_grp_defs.h
36 # in guiness/
37 IOPROCINCL_FILES += iop_version_defs.h
38
39 IOPROCASMINCL_FILES = $(patsubst %_defs.h,%_defs_asm.h,$(IOPROCINCL_FILES))
40 IOPROCASMINCL_FILES+= iop_reg_space_asm.h
41
42
43 IOPROCREGDESC =
44 IOPROCREGDESC += $(IOPROCDIR)/iop_crc_par.r
45 #IOPROCREGDESC += $(IOPROCDIR)/iop_crc_ser.r
46 IOPROCREGDESC += $(IOPROCDIR)/iop_dmc_in.r
47 IOPROCREGDESC += $(IOPROCDIR)/iop_dmc_out.r
48 IOPROCREGDESC += $(IOPROCDIR)/iop_fifo_in.r
49 IOPROCREGDESC += $(IOPROCDIR)/iop_fifo_in_xtra.r
50 IOPROCREGDESC += $(IOPROCDIR)/iop_fifo_out.r
51 IOPROCREGDESC += $(IOPROCDIR)/iop_fifo_out_xtra.r
52 IOPROCREGDESC += $(IOPROCDIR)/iop_mpu.r
53 IOPROCREGDESC += $(IOPROCDIR)/iop_sap_in.r
54 IOPROCREGDESC += $(IOPROCDIR)/iop_sap_out.r
55 IOPROCREGDESC += $(IOPROCDIR)/iop_scrc_in.r
56 IOPROCREGDESC += $(IOPROCDIR)/iop_scrc_out.r
57 IOPROCREGDESC += $(IOPROCDIR)/iop_spu.r
58 IOPROCREGDESC += $(IOPROCDIR)/guinness/iop_sw_cfg.r
59 IOPROCREGDESC += $(IOPROCDIR)/guinness/iop_sw_cpu.r
60 IOPROCREGDESC += $(IOPROCDIR)/guinness/iop_sw_mpu.r
61 IOPROCREGDESC += $(IOPROCDIR)/guinness/iop_sw_spu.r
62 IOPROCREGDESC += $(IOPROCDIR)/iop_timer_grp.r
63 IOPROCREGDESC += $(IOPROCDIR)/iop_trigger_grp.r
64 IOPROCREGDESC += $(IOPROCDIR)/guinness/iop_version.r
65
66
67 RDES2C = /n/asic/bin/rdes2c
68 RDES2C = /n/asic/design/tools/rdesc/rdes2c
69 RDES2INTR = /n/asic/design/tools/rdesc/rdes2intr
70 RDES2TXT = /n/asic/design/tools/rdesc/rdes2txt
71
72 ## all    - Just print help - you probably want to do 'make gen'
73 all: help
74
75 ## help   - This help
76 help:
77         @grep '^## ' Makefile
78
79 ## gen    - Generate include files
80 gen: $(IOPROCINCL_FILES) $(IOPROCINCL_FILES2) $(IOPROCASMINCL_FILES)
81         echo "INCL: $(IOPROCINCL_FILES)"
82         echo "INCL2: $(IOPROCINCL_FILES2)"
83         echo "ASMINCL: $(IOPROCASMINCL_FILES)"
84
85 # From the official location...
86 iop_reg_space.h: $(IOPOFFICIAL_INCDIR)/iop_reg_space.h
87         cat $< | sed -e 's/\$$Id\:/id\:/g' >$@
88 iop_mpu_macros.h: $(IOPOFFICIAL_INCDIR)/iop_mpu_macros.h
89         cat $< | sed -e 's/\$$Id\:/id\:/g' >$@
90
91 ## copy   - Copy files from official location
92 copy:
93         @echo "## Copying and fixing iop files ##"
94         @for HFILE in $(IOPROCINCL_FILES); do \
95                 echo "  $$HFILE"; \
96                 cat $(IOPOFFICIAL_INCDIR)$$HFILE | sed -e 's/\$$Id\:/id\:/g' > $$HFILE; \
97         done
98         @for HFILE in $(IOPROCINCL_FILES2); do \
99                 echo "  $$HFILE"; \
100                 cat $(IOPOFFICIAL_INCDIR)$$HFILE | sed -e 's/\$$Id\:/id\:/g' > $$HFILE; \
101         done
102         @echo "## Copying and fixing iop asm files ##"
103         @for HFILE in $(IOPROCASMINCL_FILES); do \
104                 echo "  $$HFILE"; \
105                 cat $(IOPOFFICIAL_INCDIR)asm/$$HFILE | sed -e 's/\$$Id\:/id\:/g' > asm/$$HFILE; \
106         done
107
108 # I/O processor files:
109 ## iop    - Generate I/O processor include files
110 iop: $(IOPROCINCL_FILES) $(IOPROCINCL_FILES2) $(IOPROCASMINCL_FILES)
111 iop_sw_%_defs.h: $(IOPROCDIR)/guinness/iop_sw_%.r
112         $(RDES2C) $<
113 iop_version_defs.h: $(IOPROCDIR)/guinness/iop_version.r
114         $(RDES2C) $<
115 %_defs.h: $(IOPROCDIR)/%.r
116         $(RDES2C) $<
117 %_defs_asm.h: $(IOPROCDIR)/%.r
118         $(RDES2C) -asm $<
119 iop_version_defs_asm.h: $(IOPROCDIR)/guinness/iop_version.r
120         $(RDES2C) -asm $<
121
122 ## doc    - Generate .axw files from register description.
123 doc: $(IOPROCREGDESC)
124         for RDES in $^; do \
125                 $(RDES2TXT) $$RDES; \
126         done
127
128 .PHONY: axw
129 ## %.axw  - Generate the specified .axw file (doesn't work for all files
130 ##          due to inconsistent naming of .r files.
131 %.axw: axw
132         @for RDES in $(IOPROCREGDESC); do \
133                 if echo "$$RDES" | grep $* ; then \
134                   $(RDES2TXT) $$RDES; \
135                 fi \
136         done
137
138 .PHONY: clean
139 ## clean  - Remove .h files and .axw files.
140 clean:
141         rm -rf $(IOPROCINCL_FILES) *.axw
142
143 .PHONY: cleandoc
144 ## cleandoc  - Remove .axw files.
145 cleandoc:
146         rm -rf *.axw
147