1 | # |
---|
2 | # Config file for a PowerPC MPC821- or MPC860-based MBX card |
---|
3 | # |
---|
4 | # This file is derived from: |
---|
5 | # |
---|
6 | # Config file for a PowerPC 403 based helas403 card |
---|
7 | # Config file for MPC860 based Ethernet Comm Board |
---|
8 | # |
---|
9 | |
---|
10 | include $(RTEMS_ROOT)/make/custom/default.cfg |
---|
11 | |
---|
12 | RTEMS_CPU=powerpc |
---|
13 | RTEMS_CPU_MODEL=mpc8xx |
---|
14 | |
---|
15 | # This is the actual bsp directory used during the build process. |
---|
16 | RTEMS_BSP_FAMILY=mbx8xx |
---|
17 | |
---|
18 | # The value assigned to RTEMS_CPU, RTEMS_CPU_MODEL and RTEMS_BSP get |
---|
19 | # #defined in targopts.h. Source code can switch on these values with #ifdef |
---|
20 | # to select what code to compile for a specific CPU family member and specific |
---|
21 | # board. The RTEMS_CPU_MODEL is also used as the name of the libcpu directory, |
---|
22 | # while the RTEMS_BSP_FAMILY is used as the name of the libbsp directory. |
---|
23 | # For the MBX860 and MBX821, the boards and processors are sufficiently |
---|
24 | # similar that the ports are unified and use RTEMS_CPU_MODEL=mpc8xx and |
---|
25 | # RTEMS_BSP_FAMILY=mbx8xx. Because there are minor differences in the CPUs |
---|
26 | # and the boards, it is necessary to specify them fully during the build. |
---|
27 | # Do a "make RTEMS_BSP=<your_board> <target>" See below for a list of valid |
---|
28 | # values for <your_board>. |
---|
29 | |
---|
30 | ifeq ($(findstring mbx821,$(RTEMS_MBX_MODEL)),mbx821) |
---|
31 | CPU_TYPE=821 |
---|
32 | else |
---|
33 | ifeq ($(findstring mbx860,$(RTEMS_MBX_MODEL)),mbx860) |
---|
34 | CPU_TYPE=860 |
---|
35 | else |
---|
36 | RTEMS_BSP = mbx860_002 |
---|
37 | RTEMS_MBX_MODEL = mbx860_002 |
---|
38 | TARGET_ARCH=o-mbx860_002 |
---|
39 | CPU_TYPE=860 |
---|
40 | endif # mbx860 |
---|
41 | endif # mbx821 |
---|
42 | |
---|
43 | # This section makes the target dependent options file. |
---|
44 | # |
---|
45 | # Note that RTEMS_BSP matches the RTEMS_MBX_MODEL. Its value must be |
---|
46 | # defined in targopts.h, so the few places that require different code |
---|
47 | # for different MBX models can be distinguished. The value of |
---|
48 | # RTEMS_BSP is already defined in targopts.h and is one of: |
---|
49 | # mbx860_001 mbx821_001 |
---|
50 | # mbx860_002 mbx821_002 |
---|
51 | # mbx860_003 mbx821_003 |
---|
52 | # mbx860_004 mbx821_004 |
---|
53 | # mbx860_005 mbx821_005 |
---|
54 | # mbx860_001b mbx821_001b |
---|
55 | # mbx860_002b mbx821_002b |
---|
56 | # mbx860_003b mbx821_003b |
---|
57 | # mbx860_004b mbx821_004b |
---|
58 | # mbx860_005b mbx821_005b |
---|
59 | # mbx860_006b mbx821_006b |
---|
60 | |
---|
61 | # The specific CPU model is defined, so the few places that require |
---|
62 | # different code for the MPC860 and MPC821 can be distinguished. |
---|
63 | # Either mpc860 or mpc821 is defined. |
---|
64 | # |
---|
65 | # MBX8xx-specific options: |
---|
66 | # |
---|
67 | # INSTRUCTION_CACHE_ENABLE (BSP--RTEMS) |
---|
68 | # If defined, the instruction cache will be enabled after address translation |
---|
69 | # is turned on. |
---|
70 | # |
---|
71 | # DATA_CACHE_ENABLE (BSP--RTEMS) |
---|
72 | # If defined, the data cache will be enabled after address translation |
---|
73 | # is turned on. |
---|
74 | # |
---|
75 | |
---|
76 | define make-target-options |
---|
77 | @echo "#ifdef mpc$(CPU_TYPE)" >>$@ |
---|
78 | @echo "#undef mpc$(CPU_TYPE)" >>$@ |
---|
79 | @echo "#endif" >>$@ |
---|
80 | @echo "#define mpc$(CPU_TYPE) 1" >>$@ |
---|
81 | @echo >>$@ |
---|
82 | @echo "#define INSTRUCTION_CACHE_ENABLE 1" >>$@ |
---|
83 | @echo "#define DATA_CACHE_ENABLE 1" >>$@ |
---|
84 | @echo >>$@ |
---|
85 | endef |
---|
86 | |
---|
87 | # This contains the compiler options necessary to select the CPU model |
---|
88 | # and (hopefully) optimize for it. |
---|
89 | # |
---|
90 | CPU_CFLAGS = -mcpu=$(CPU_TYPE) |
---|
91 | |
---|
92 | CFLAGS_DEBUG_V += -ggdb |
---|
93 | CXXFLAGS_DEBUG_V += -ggdb |
---|
94 | |
---|
95 | # optimize flag: typically -O, could use -O4 or -fast |
---|
96 | # -O4 is ok for RTEMS |
---|
97 | # NOTE: some level of -O may be actually required by inline assembler |
---|
98 | # CFLAGS_OPTIMIZE_V=-O4 -fno-keep-inline-functions |
---|
99 | CFLAGS_OPTIMIZE_V=-O4 -fno-keep-inline-functions |
---|
100 | CXXFLAGS_OPTIMIZE_V=-O4 |
---|
101 | |
---|
102 | # The following are definitions of make-exe which will work using ld as |
---|
103 | # is currently required. It is expected that as of gcc 2.8, the end user |
---|
104 | # will be able to override parts of the compilers specs and link using gcc. |
---|
105 | |
---|
106 | ifeq ($(RTEMS_USE_GCC272),yes) |
---|
107 | # The --defsym arguments define arguments which are required by the linkcmds |
---|
108 | # file which is designed for gcc 2.8 |
---|
109 | define make-exe |
---|
110 | $(LD) $(XLDFLAGS) -T $(LINKCMDS) -o $(basename $@)_sym.exe \ |
---|
111 | --defsym __fini=0 --defsym __init=0 \ |
---|
112 | -u atexit -u __vectors -u start \ |
---|
113 | $(START_FILE) $(LINK_OBJS) --start-group $(LINK_LIBS) --end-group |
---|
114 | $(NM) -g -n $(basename $@)_sym.exe> $(basename $@).nm |
---|
115 | cp $(basename $@)_sym.exe $(basename $@).exe |
---|
116 | $(STRIP) $(basename $@).exe |
---|
117 | $(SIZE) $(basename $@)_sym.exe |
---|
118 | endef |
---|
119 | else |
---|
120 | define make-exe |
---|
121 | $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) $(MBX8xx_LDFLAGS) \ |
---|
122 | -o $(basename $@)_sym.exe $(LINK_OBJS) $(LINK_LIBS) |
---|
123 | $(NM) -g -n $(basename $@)_sym.exe > $(basename $@).nm |
---|
124 | cp $(basename $@)_sym.exe $(basename $@).exe |
---|
125 | $(STRIP) $(basename $@).exe |
---|
126 | $(SIZE) $(basename $@)_sym.exe |
---|
127 | endef |
---|
128 | endif |
---|
129 | |
---|
130 | # Miscellaneous additions go here |
---|
131 | |
---|
132 | # Override default start file |
---|
133 | START_BASE= |
---|
134 | |
---|