Merge branch 'master' into upstream.
[pandora-kernel.git] / arch / cris / include / arch-v32 / arch / hwregs / Makefile
1 # Makefile to generate or copy the latest register definitions
2 # and related datastructures and helpermacros.
3 # The official place for these files is at:
4 RELEASE ?= r1_alfa5
5 OFFICIAL_INCDIR = /n/asic/projects/guinness/releases/$(RELEASE)/design/top/sw/include/
6
7 # which is updated on each new release.
8 INCL_ASMFILES   =
9 INCL_FILES      = ata_defs.h
10 INCL_FILES     += bif_core_defs.h
11 INCL_ASMFILES  += bif_core_defs_asm.h
12 INCL_FILES     += bif_slave_defs.h
13 #INCL_FILES     += bif_slave_ext_defs.h
14 INCL_FILES     += config_defs.h
15 INCL_ASMFILES  += config_defs_asm.h
16 INCL_FILES     += cpu_vect.h
17 #INCL_FILES     += cris_defs.h
18 #INCL_FILES     += cris_supp_reg.h # In handcrafted supp_reg.h
19 INCL_FILES     += dma.h
20 INCL_FILES     += dma_defs.h
21 INCL_FILES     += eth_defs.h
22 INCL_FILES     += extmem_defs.h
23 INCL_FILES     += gio_defs.h
24 INCL_ASMFILES  += gio_defs_asm.h
25 INCL_FILES     += intr_vect.h
26 INCL_FILES     += intr_vect_defs.h
27 INCL_ASMFILES  += intr_vect_defs_asm.h
28 INCL_FILES     += marb_bp_defs.h
29 INCL_FILES     += marb_defs.h
30 INCL_ASMFILES  += mmu_defs_asm.h
31 #INCL_FILES     += mmu_supp_reg.h # In handcrafted supp_reg.h
32 #INCL_FILES     += par_defs.h # No useful content
33 INCL_FILES     += pinmux_defs.h
34 INCL_FILES     += reg_map.h
35 INCL_ASMFILES  += reg_map_asm.h
36 INCL_FILES     += reg_rdwr.h
37 INCL_FILES     += ser_defs.h
38 #INCL_FILES     += spec_reg.h # In handcrafted supp_reg.h
39 INCL_FILES     += sser_defs.h
40 INCL_FILES     += strcop_defs.h
41 #INCL_FILES     += strcop.h # Where is this?
42 INCL_FILES     += strmux_defs.h
43 #INCL_FILES     += supp_reg.h # Handcrafted instead
44 INCL_FILES     += timer_defs.h
45
46 REGDESC =
47 REGDESC += $(BASEDIR)/io/ata/rtl/ata_regs.r
48 REGDESC += $(BASEDIR)/io/bif/rtl/bif_core_regs.r
49 REGDESC += $(BASEDIR)/io/bif/rtl/bif_slave_regs.r
50 #REGDESC += $(BASEDIR)/io/bif/sw/bif_slave_ext_regs.r
51 REGDESC += $(DESIGNDIR)/top/rtl/config_regs.r
52 REGDESC += $(BASEDIR)/mod/dma_common/rtl/dma_regdes.r
53 REGDESC += $(BASEDIR)/io/eth/rtl/eth_regs.r
54 REGDESC += $(BASEDIR)/io/bif/mod/extmem/extmem_regs.r
55 REGDESC += $(DESIGNDIR)/gio/rtl/gio_regs.r
56 REGDESC += $(BASEDIR)/core/cpu/intr_vect/rtl/guinness/ivmask.config.r
57 REGDESC += $(BASEDIR)/core/memarb/rtl/guinness/marb_top.r
58 REGDESC += $(BASEDIR)/core/cpu/mmu/doc/mmu_regs.r
59 #REGDESC += $(BASEDIR)/io/par_port/rtl/par_regs.r
60 REGDESC += $(BASEDIR)/io/pinmux/rtl/guinness/pinmux_regs.r
61 REGDESC += $(BASEDIR)/io/ser/rtl/ser_regs.r
62 REGDESC += $(BASEDIR)/core/strcop/rtl/strcop_regs.r
63 REGDESC += $(BASEDIR)/io/strmux/rtl/guinness/strmux_regs.r
64 REGDESC += $(BASEDIR)/io/timer/rtl/timer_regs.r
65 #REGDESC += $(BASEDIR)/io/usb/usb1_1/rtl/usb_regs.r
66
67
68 BASEDIR = /n/asic/design
69 DESIGNDIR = /n/asic/projects/guinness/design
70 RDES2C = /n/asic/bin/rdes2c
71 RDES2C = /n/asic/design/tools/rdesc/rdes2c
72 RDES2INTR = /n/asic/design/tools/rdesc/rdes2intr
73 RDES2TXT = /n/asic/design/tools/rdesc/rdes2txt
74
75 ## all    - Just print help - you probably want to do 'make gen'
76 all: help
77
78 # Disable implicit rule that may generate deleted files from RCS/ directory.
79 %.r:
80
81 %.h:
82
83 ## help   - This help
84 help:
85         @grep '^## ' Makefile
86
87 ## gen    - Generate include files
88 gen: $(INCL_FILES) $(INCL_ASMFILES)
89
90 ata_defs.h: $(BASEDIR)/io/ata/rtl/ata_regs.r
91         $(RDES2C) $<
92 config_defs.h: $(DESIGNDIR)/top/rtl/config_regs.r
93         $(RDES2C) $<
94 config_defs_asm.h: $(DESIGNDIR)/top/rtl/config_regs.r
95         $(RDES2C) -asm $<
96 # Can't generate cpu_vect.h yet
97 #cpu_vect.h: $(DESIGNDIR)/top/rtl/cpu_vect.r # ????
98 #       $(RDES2INTR) $<
99 cpu_vect.h: $(OFFICIAL_INCDIR)cpu_vect.h
100         cat $< | sed -e 's/\$$Id\:/id\:/g' >$@
101 dma_defs.h: $(BASEDIR)/core/dma/rtl/common/dma_regdes.r
102         $(RDES2C) $<
103 $(BASEDIR)/core/dma/sw/dma.h:
104 dma.h: $(BASEDIR)/core/dma/sw/dma.h
105         cat $< | sed -e 's/\$$Id\:/id\:/g' >$@
106 eth_defs.h: $(BASEDIR)/io/eth/rtl/eth_regs.r
107         $(RDES2C) $<
108 extmem_defs.h: $(BASEDIR)/io/bif/mod/extmem/extmem_regs.r
109         $(RDES2C) $<
110 gio_defs.h: $(DESIGNDIR)/gio/rtl/gio_regs.r
111         $(RDES2C) $<
112 intr_vect_defs.h: $(BASEDIR)/core/cpu/intr_vect/rtl/guinness/ivmask.config.r
113         $(RDES2C) $<
114 intr_vect_defs_asm.h: $(BASEDIR)/core/cpu/intr_vect/rtl/guinness/ivmask.config.r
115         $(RDES2C) -asm $<
116 # Can't generate intr_vect.h yet
117 #intr_vect.h: $(BASEDIR)/core/cpu/intr_vect/rtl/guinness/ivmask.config.r
118 #       $(RDES2INTR) $<
119 intr_vect.h: $(OFFICIAL_INCDIR)intr_vect.h
120         cat $< | sed -e 's/\$$Id\:/id\:/g' >$@
121 mmu_defs_asm.h: $(BASEDIR)/core/cpu/mmu/doc/mmu_regs.r
122         $(RDES2C) -asm $<
123 par_defs.h: $(BASEDIR)/io/par_port/rtl/par_regs.r
124         $(RDES2C) $<
125
126 # From /n/asic/projects/guinness/design/
127 reg_map.h: $(DESIGNDIR)/top/rtl/global.rmap $(DESIGNDIR)/top/mod/modreg.rmap
128         $(RDES2C) -base 0xb0000000 $^
129 reg_map_asm.h: $(DESIGNDIR)/top/rtl/global.rmap $(DESIGNDIR)/top/mod/modreg.rmap
130         $(RDES2C) -base 0xb0000000 -asm -outfile $@ $^
131
132 reg_rdwr.h: $(DESIGNDIR)/top/sw/include/reg_rdwr.h
133         cat $< | sed -e 's/\$$Id\:/id\:/g' >$@
134
135 ser_defs.h: $(BASEDIR)/io/ser/rtl/ser_regs.r
136         $(RDES2C) $<
137 strcop_defs.h: $(BASEDIR)/core/strcop/rtl/strcop_regs.r
138         $(RDES2C) $<
139 strcop.h: $(BASEDIR)/core/strcop/rtl/strcop.h
140         cat $< | sed -e 's/\$$Id\:/id\:/g' >$@
141 strmux_defs.h: $(BASEDIR)/io/strmux/rtl/guinness/strmux_regs.r
142         $(RDES2C) $<
143 timer_defs.h: $(BASEDIR)/io/timer/rtl/timer_regs.r
144         $(RDES2C) $<
145 usb_defs.h: $(BASEDIR)/io/usb/usb1_1/rtl/usb_regs.r
146         $(RDES2C) $<
147
148 ## copy   - Copy files from official location
149 copy:
150         @for HFILE in $(INCL_FILES); do \
151                 echo "  $$HFILE"; \
152                 cat $(OFFICIAL_INCDIR)$$HFILE | sed -e 's/\$$Id\:/id\:/g' > $$HFILE; \
153         done
154         @for HFILE in $(INCL_ASMFILES); do \
155                 echo "  $$HFILE"; \
156                 cat $(OFFICIAL_INCDIR)asm/$$HFILE | sed -e 's/\$$Id\:/id\:/g' > $$HFILE; \
157         done
158 ## ls_official - List official location
159 ls_official:
160         (cd $(OFFICIAL_INCDIR); ls -l *.h )
161
162 ## diff_official - Diff current directory with official location
163 diff_official:
164         diff . $(OFFICIAL_INCDIR)
165
166 ## doc    - Generate .axw files from register description.
167 doc: $(REGDESC)
168         for RDES in $^; do \
169                 $(RDES2TXT) $$RDES; \
170         done
171
172 .PHONY: axw
173 ## %.axw  - Generate the specified .axw file (doesn't work for all files
174 ##          due to inconsistent naming ir .r files.
175 %.axw: axw
176         @for RDES in $(REGDESC); do \
177                 if echo "$$RDES" | grep $* ; then \
178                   $(RDES2TXT) $$RDES; \
179                 fi \
180         done
181
182 .PHONY: clean
183 ## clean  - Remove .h files and .axw files.
184 clean:
185         rm -rf $(INCL_FILES) *.axw
186