diff -Naur mvme5500.orig/bsp_specs mvme5500/bsp_specs
old
|
new
|
|
4 | 4 | |
5 | 5 | *startfile: |
6 | 6 | %{!qrtems: %(old_startfile)} \ |
7 | | %{!nostdlib: %{qrtems: ecrti%O%s rtems_crti%O%s crtbegin.o%s \ |
8 | | mvme5500start.o%s -e __rtems_entry_point -u __vectors}} |
| 7 | %{!nostdlib: %{qrtems: ecrti%O%s rtems_crti%O%s crtbegin.o%s -e __rtems_entry_point -u __vectors mvme5500start.o%s}} |
9 | 8 | |
10 | 9 | *link: |
11 | 10 | %{!qrtems: %(old_link)} %{qrtems: -dp -Bstatic} |
diff -Naur mvme5500.orig/ChangeLog mvme5500/ChangeLog
old
|
new
|
|
| 1 | 2011-04-10 Kate Feng <feng@bnl.gov> |
| 2 | * Makefile.am: Add support for Altivec. |
| 3 | * startup/bspstart.c, Makefile.am: Use shared/startup/zerobss.c instead. |
| 4 | * make/custom/mvme5500.cfg : CPU_CFLAGS = -mcpu=7450 -mtune=7450 -Dmpc7455 |
| 5 | * irq/BSP_irq.c, pci/detect_host_bridge.c,pci.c,pcifinddevice.c:Remove warnings. |
| 6 | * vme/VMEConfig.h, include/bsp.h: use VME shared IRQ handlers. |
| 7 | |
1 | 8 | 2011-02-02 Ralf Corsépius <ralf.corsepius@rtems.org> |
2 | 9 | |
3 | 10 | * configure.ac: Require autoconf-2.68, automake-1.11.1. |
diff -Naur mvme5500.orig/include/bsp.h mvme5500/include/bsp.h
old
|
new
|
|
103 | 103 | |
104 | 104 | /* The glues to Till's vmeUniverse, although the name does not |
105 | 105 | * actually reflect the relevant architect of the MVME5500. |
106 | | * Till TODO ? : BSP_PCI_DO_EOI instead ? |
107 | | * BSP_EXT_IRQ0 instead of BSP_PCI_IRQ0 ? |
108 | | * |
109 | 106 | */ |
110 | | #define BSP_PIC_DO_EOI inl(0xc34) /* PCI IACK */ |
111 | 107 | #define BSP_PCI_IRQ0 BSP_GPP_IRQ_LOWEST_OFFSET |
112 | 108 | |
113 | 109 | /* |
diff -Naur mvme5500.orig/irq/BSP_irq.c mvme5500/irq/BSP_irq.c
old
|
new
|
|
381 | 381 | * bit 10:GPP interrupts as level sensitive(1) or edge sensitive(0). |
382 | 382 | * MOTload default is set as level sensitive(1). Set it agin to make sure. |
383 | 383 | */ |
384 | | out_le32(GT_CommUnitArb_Ctrl, (in_le32(GT_CommUnitArb_Ctrl)| (1<<10))); |
| 384 | out_le32((volatile unsigned int *)GT_CommUnitArb_Ctrl, |
| 385 | (in_le32((volatile unsigned int *)GT_CommUnitArb_Ctrl)| (1<<10))); |
385 | 386 | |
386 | 387 | #if 0 |
387 | 388 | printk("BSP_irqMask_reg[0] = 0x%x, BSP_irqCause_reg[0] 0x%x\n", |
diff -Naur mvme5500.orig/make/custom/mvme5500.cfg mvme5500/make/custom/mvme5500.cfg
old
|
new
|
|
9 | 9 | RTEMS_CPU=powerpc |
10 | 10 | RTEMS_CPU_MODEL=mpc7455 |
11 | 11 | |
| 12 | # This is the actual bsp directory used during the build process. |
| 13 | RTEMS_BSP_FAMILY=mvme5500 |
| 14 | |
12 | 15 | # This contains the compiler options necessary to select the CPU model |
13 | 16 | # and (hopefully) optimize for it. |
14 | | # if gcc does not regonize 7450 then change -mcpu=750 |
15 | | # |
16 | | CPU_CFLAGS = -fno-strict-aliasing -mcpu=7450 -Dmpc7455 -mno-altivec -mabi=altivec -mvrsave=no -mmultiple -mstring -mstrict-align |
17 | | #T. Straumann; disable sdata=eabi for now until CEXP supports it -meabi -msdata=eabi |
| 17 | CPU_CFLAGS = -mcpu=7450 -mtune=7450 -Dmpc7455 |
18 | 18 | |
19 | 19 | # optimize flag: typically -O2 |
20 | 20 | CFLAGS_OPTIMIZE_V = -O2 -g |
… |
… |
|
23 | 23 | $(default-bsp-post-link) |
24 | 24 | $(OBJCOPY) -O binary $(basename $@).exe $(basename $@)$(DOWNEXT) |
25 | 25 | endef |
| 26 | |
| 27 | # |
| 28 | START_BASE=mvme5500start |
diff -Naur mvme5500.orig/Makefile.am mvme5500/Makefile.am
old
|
new
|
|
34 | 34 | libbsp_a_SOURCES += startup/bspstart.c \ |
35 | 35 | ../../powerpc/shared/startup/pgtbl_setup.c startup/pgtbl_activate.c \ |
36 | 36 | ../../powerpc/shared/startup/pretaskinghook.c \ |
| 37 | ../../powerpc/shared/startup/zerobss.c \ |
37 | 38 | ../../powerpc/shared/startup/bspgetworkarea.c \ |
38 | 39 | ../../powerpc/shared/startup/sbrk.c ../../shared/bootcard.c \ |
39 | 40 | ../../shared/bsppredriverhook.c startup/bspclean.c \ |
… |
… |
|
121 | 122 | ../../../libcpu/@RTEMS_CPU@/@exceptions@/exc_bspsupport.rel \ |
122 | 123 | ../../../libcpu/@RTEMS_CPU@/@exceptions@/irq_bspsupport.rel \ |
123 | 124 | ../../../libcpu/@RTEMS_CPU@/mpc6xx/mmu.rel \ |
124 | | ../../../libcpu/@RTEMS_CPU@/mpc6xx/timer.rel |
| 125 | ../../../libcpu/@RTEMS_CPU@/mpc6xx/timer.rel\ |
| 126 | ../../../libcpu/@RTEMS_CPU@/mpc6xx/altivec.rel |
| 127 | |
125 | 128 | if HAS_NETWORKING |
126 | 129 | libbsp_a_LIBADD += network.rel |
127 | 130 | endif |
diff -Naur mvme5500.orig/network/if_1GHz/if_wm.c mvme5500/network/if_1GHz/if_wm.c
old
|
new
|
|
1730 | 1730 | /* We have MII. */ |
1731 | 1731 | sc->sc_flags |= WM_F_HAS_MII; |
1732 | 1732 | |
1733 | | #if 1 |
| 1733 | #if 0 |
1734 | 1734 | /* <skf> May 2009 : The value that should be programmed into IPGT is 10 */ |
1735 | 1735 | sc->sc_tipg = TIPG_IPGT(10)+TIPG_IPGR1(8)+TIPG_IPGR2(6); |
1736 | 1736 | #else |
diff -Naur mvme5500.orig/pci/detect_host_bridge.c mvme5500/pci/detect_host_bridge.c
old
|
new
|
|
27 | 27 | |
28 | 28 | unsigned long _BSP_clear_hostbridge_errors(int enableMCP, int quiet) |
29 | 29 | { |
30 | | unsigned int pcidata, pcidata1; |
| 30 | uint32_t pcidata, pcidata1; |
31 | 31 | int PciLocal, busNumber=0; |
32 | 32 | |
33 | 33 | /* On the mvme5500 board, the GT64260B system controller had the MCP |
diff -Naur mvme5500.orig/pci/pci.c mvme5500/pci/pci.c
old
|
new
|
|
108 | 108 | BSP_pci[n].config_data,pciConfigPack(bus,dev,func,offset)); |
109 | 109 | #endif |
110 | 110 | |
111 | | out_be32(BSP_pci[n].pci_config_addr, pciConfigPack(bus,dev,func,offset)); |
| 111 | out_be32((volatile unsigned int *) BSP_pci[n].pci_config_addr, pciConfigPack(bus,dev,func,offset)); |
112 | 112 | *val = in_8(BSP_pci[n].pci_config_data + (offset&3)); |
113 | 113 | return PCIBIOS_SUCCESSFUL; |
114 | 114 | } |
… |
… |
|
129 | 129 | printk("addr %x, data %x, pack %x \n", config_addr, |
130 | 130 | config_data,pciConfigPack(bus,dev,func,offset)); |
131 | 131 | #endif |
132 | | out_be32(BSP_pci[n].pci_config_addr, pciConfigPack(bus,dev,func,offset)); |
133 | | *val = in_le16(BSP_pci[n].pci_config_data + (offset&2)); |
| 132 | out_be32((volatile unsigned int *) BSP_pci[n].pci_config_addr, pciConfigPack(bus,dev,func,offset)); |
| 133 | *val = in_le16((volatile unsigned short *) (BSP_pci[n].pci_config_data + (offset&2))); |
134 | 134 | return PCIBIOS_SUCCESSFUL; |
135 | 135 | } |
136 | 136 | |
… |
… |
|
147 | 147 | *val = 0xffffffff; |
148 | 148 | if ((offset&3)|| (offset & ~0xff)) return PCIBIOS_BAD_REGISTER_NUMBER; |
149 | 149 | |
150 | | out_be32(BSP_pci[n].pci_config_addr, pciConfigPack(bus,dev,func,offset)); |
151 | | *val = in_le32(BSP_pci[n].pci_config_data); |
| 150 | out_be32((volatile unsigned int *)BSP_pci[n].pci_config_addr, pciConfigPack(bus,dev,func,offset)); |
| 151 | *val = in_le32((volatile unsigned int *)BSP_pci[n].pci_config_data); |
152 | 152 | return PCIBIOS_SUCCESSFUL; |
153 | 153 | } |
154 | 154 | |
… |
… |
|
163 | 163 | |
164 | 164 | if (offset & ~0xff) return PCIBIOS_BAD_REGISTER_NUMBER; |
165 | 165 | |
166 | | out_be32(BSP_pci[n].pci_config_addr, pciConfigPack(bus,dev,func,offset)); |
167 | | out_8(BSP_pci[n].pci_config_data + (offset&3), val); |
| 166 | out_be32((volatile unsigned int *)BSP_pci[n].pci_config_addr, pciConfigPack(bus,dev,func,offset)); |
| 167 | out_8((volatile unsigned char *) (BSP_pci[n].pci_config_data + (offset&3)), val); |
168 | 168 | return PCIBIOS_SUCCESSFUL; |
169 | 169 | } |
170 | 170 | |
… |
… |
|
179 | 179 | |
180 | 180 | if ((offset&1)|| (offset & ~0xff)) return PCIBIOS_BAD_REGISTER_NUMBER; |
181 | 181 | |
182 | | out_be32(BSP_pci[n].pci_config_addr, pciConfigPack(bus,dev,func,offset)); |
183 | | out_le16(BSP_pci[n].pci_config_data + (offset&3), val); |
| 182 | out_be32((volatile unsigned int *)BSP_pci[n].pci_config_addr, pciConfigPack(bus,dev,func,offset)); |
| 183 | out_le16((volatile unsigned short *)(BSP_pci[n].pci_config_data + (offset&3)), val); |
184 | 184 | return PCIBIOS_SUCCESSFUL; |
185 | 185 | } |
186 | 186 | |
… |
… |
|
195 | 195 | |
196 | 196 | if ((offset&3)|| (offset & ~0xff)) return PCIBIOS_BAD_REGISTER_NUMBER; |
197 | 197 | |
198 | | out_be32(BSP_pci[n].pci_config_addr, pciConfigPack(bus,dev,func,offset)); |
199 | | out_le32(BSP_pci[n].pci_config_data, val); |
| 198 | out_be32((volatile unsigned int *)BSP_pci[n].pci_config_addr, pciConfigPack(bus,dev,func,offset)); |
| 199 | out_le32((volatile unsigned int *)BSP_pci[n].pci_config_data, val); |
200 | 200 | return PCIBIOS_SUCCESSFUL; |
201 | 201 | } |
202 | 202 | |
diff -Naur mvme5500.orig/pci/pcifinddevice.c mvme5500/pci/pcifinddevice.c
old
|
new
|
|
35 | 35 | int pci_find_device( unsigned short vendorid, unsigned short deviceid, |
36 | 36 | int instance, int *pbus, int *pdev, int *pfun ) |
37 | 37 | { |
38 | | unsigned int d; |
| 38 | uint32_t d; |
39 | 39 | unsigned short s; |
40 | 40 | unsigned char bus,dev,fun,hd; |
41 | 41 | |
diff -Naur mvme5500.orig/start/start.S mvme5500/start/start.S
old
|
new
|
|
4 | 4 | * Copyright (C) 1999 Eric Valette. valette@crf.canon.fr |
5 | 5 | * |
6 | 6 | * S. Kate Feng <feng1@bnl.gov>, April 2004 |
7 | | * Mapped the 2nd 256MB of RAM to support the MVME5500 boards. |
8 | | * |
| 7 | * Mapped the 2nd 256MB of RAM to support the MVME5500/MVME6100 boards |
| 8 | * |
9 | 9 | * The license and distribution terms for this file may be |
10 | 10 | * found in the file LICENSE in this distribution or at |
11 | 11 | * http://www.rtems.com/license/LICENSE. |
12 | 12 | * |
| 13 | <<<<<<< start.S |
| 14 | * $Id: start.S,v 1.26 2009/12/02 01:51:22 strauman Exp $ |
| 15 | ======= |
| 16 | * $Id: start.S,v 1.26 2009/12/02 01:51:22 strauman Exp $ |
| 17 | >>>>>>> 1.25 |
13 | 18 | * |
14 | 19 | */ |
15 | 20 | |
16 | 21 | #include <rtems/asm.h> |
17 | 22 | #include <rtems/score/cpu.h> |
18 | 23 | #include <rtems/powerpc/powerpc.h> |
| 24 | |
19 | 25 | #include <libcpu/io.h> |
20 | 26 | #include <libcpu/bat.h> |
| 27 | #include <bspopts.h> |
21 | 28 | |
22 | 29 | #define SYNC \ |
23 | 30 | sync; \ |
… |
… |
|
33 | 40 | li r10,0x63 ; \ |
34 | 41 | sc |
35 | 42 | |
36 | | |
37 | 43 | .text |
38 | 44 | .globl __rtems_entry_point |
39 | 45 | .type __rtems_entry_point,@function |
… |
… |
|
62 | 68 | mr r29,r5 |
63 | 69 | mr r28,r6 |
64 | 70 | mr r27,r7 |
| 71 | |
| 72 | #ifdef __ALTIVEC__ |
| 73 | /* enable altivec; gcc may use it! */ |
| 74 | mfmsr r0 |
| 75 | oris r0, r0, (1<<(31-16-6)) |
| 76 | mtmsr r0 |
| 77 | /* |
| 78 | * set vscr and vrsave to known values |
| 79 | */ |
| 80 | li r0, 0 |
| 81 | mtvrsave r0 |
| 82 | vxor 0,0,0 |
| 83 | mtvscr 0 |
| 84 | #endif |
| 85 | |
65 | 86 | /* |
66 | 87 | * Make sure we have nothing in BATS and TLB |
67 | 88 | */ |
… |
… |
|
72 | 93 | * of RAM to KERNELBASE. |
73 | 94 | */ |
74 | 95 | lis r11,KERNELBASE@h |
75 | | ori r11,r11,0x1ffe /* set up BAT0 registers for 604+ */ |
| 96 | /* set up BAT registers for 604 */ |
| 97 | ori r11,r11,0x1ffe |
76 | 98 | li r8,2 /* R/W access */ |
77 | 99 | isync |
78 | 100 | mtspr DBAT0L,r8 /* N.B. 6xx (not 601) have valid */ |
… |
… |
|
81 | 103 | mtspr IBAT0U,r11 |
82 | 104 | isync |
83 | 105 | /* |
84 | | * Use the 2nd pair of BAT registers to map the 2nd 256MB |
85 | | * of RAM to 0x10000000. <SKF> |
| 106 | * <skf> Use the 2nd pair of BAT registers to map the 2nd 256MB |
| 107 | * of RAM to 0x10000000. |
86 | 108 | */ |
87 | 109 | lis r11,MEM256MB@h |
88 | 110 | ori r11,r11,0x1ffe /* set up BAT1 registers for 604+ */ |
… |
… |
|
106 | 128 | |
107 | 129 | enter_C_code: |
108 | 130 | bl MMUon |
109 | | bl __eabi /* setup EABI and SYSV environment */ |
| 131 | bl __eabi /* setup EABI and SYSV environment */ |
110 | 132 | bl zero_bss |
111 | 133 | /* |
112 | 134 | * restore prep boot params |
… |
… |
|
121 | 143 | * stack = &__rtems_end + 4096 |
122 | 144 | */ |
123 | 145 | addis r9,r0, __stack-PPC_MINIMUM_STACK_FRAME_SIZE@ha |
124 | | addi r9,r9, __stack-PPC_MINIMUM_STACK_FRAME_SIZE@l |
125 | | mr r1, r9 |
| 146 | addi r9,r9, __stack-PPC_MINIMUM_STACK_FRAME_SIZE@l |
126 | 147 | /* |
127 | | * We are know in a environment that is totally independent from bootloader setup. |
| 148 | * align initial stack |
| 149 | * (we hope that the bootloader stack was 16-byte aligned |
| 150 | * or we haven't used altivec yet...) |
| 151 | */ |
| 152 | li r0, (CPU_STACK_ALIGNMENT-1) |
| 153 | andc r1, r9, r0 |
| 154 | /* |
| 155 | * We are now in a environment that is totally independent from |
| 156 | * bootloader setup. |
128 | 157 | */ |
129 | 158 | /* pass result of 'save_boot_params' to 'boot_card' in R3 */ |
130 | 159 | bl boot_card |
… |
… |
|
161 | 190 | .globl _return_to_ppcbug |
162 | 191 | .type _return_to_ppcbug,@function |
163 | 192 | |
164 | | |
165 | 193 | _return_to_ppcbug: |
166 | 194 | mflr r30 |
167 | 195 | bl MMUoff |
diff -Naur mvme5500.orig/startup/bspstart.c mvme5500/startup/bspstart.c
old
|
new
|
|
56 | 56 | #include <rtems/score/wkspace.h> |
57 | 57 | |
58 | 58 | extern uint32_t probeMemoryEnd(void); /* from shared/startup/probeMemoryEnd.c */ |
59 | | |
60 | | |
61 | 59 | BSP_output_char_function_type BSP_output_char = BSP_output_char_via_serial; |
62 | 60 | |
63 | 61 | extern void _return_to_ppcbug(void); |
… |
… |
|
70 | 68 | |
71 | 69 | extern unsigned char ReadConfVPD_buff(int offset); |
72 | 70 | |
73 | | extern unsigned long __bss_start[], __SBSS_START__[], __SBSS_END__[]; |
74 | | extern unsigned long __SBSS2_START__[], __SBSS2_END__[]; |
75 | | |
76 | 71 | uint32_t bsp_clicks_per_usec; |
77 | 72 | |
78 | | SPR_RW(SPRG1) |
79 | | |
80 | 73 | typedef struct CmdLineRec_ { |
81 | 74 | unsigned long size; |
82 | 75 | char buf[0]; |
… |
… |
|
133 | 126 | __asm__ __volatile ("sc"); |
134 | 127 | } |
135 | 128 | |
136 | | void zero_bss(void) |
137 | | { |
138 | | memset( |
139 | | __SBSS_START__, |
140 | | 0, |
141 | | ((unsigned) __SBSS_END__) - ((unsigned)__SBSS_START__) |
142 | | ); |
143 | | memset( |
144 | | __SBSS2_START__, |
145 | | 0, |
146 | | ((unsigned) __SBSS2_END__) - ((unsigned)__SBSS2_START__) |
147 | | ); |
148 | | memset( |
149 | | __bss_start, |
150 | | 0, |
151 | | ((unsigned) __rtems_end) - ((unsigned)__bss_start) |
152 | | ); |
153 | | } |
154 | | |
155 | 129 | /* NOTE: we cannot simply malloc the commandline string; |
156 | 130 | * save_boot_params() is called during a very early stage when |
157 | 131 | * libc/malloc etc. are not yet initialized! |
… |
… |
|
293 | 267 | printk("-----------------------------------------\n"); |
294 | 268 | |
295 | 269 | BSP_mem_size = probeMemoryEnd(); |
| 270 | |
296 | 271 | /* TODO: calculate the BSP_bus_frequency using the REF_CLK bit |
297 | 272 | * of System Status register |
298 | 273 | */ |
… |
… |
|
302 | 277 | /* P94 : 7455 clocks the TB/DECR at 1/4 of the system bus clock frequency */ |
303 | 278 | BSP_time_base_divisor = 4000; |
304 | 279 | |
305 | | |
306 | 280 | /* Maybe not setup yet becuase of the warning message */ |
307 | 281 | /* Allocate and set up the page table mappings |
308 | 282 | * This is only available on >604 CPUs. |
diff -Naur mvme5500.orig/vme/VMEConfig.h mvme5500/vme/VMEConfig.h
old
|
new
|
|
1 | 1 | #ifndef RTEMS_BSP_VME_CONFIG_H |
2 | 2 | #define RTEMS_BSP_VME_CONFIG_H |
3 | | /* VMEConfig.h, S. Kate Feng modified it for MVME5500 3/04 */ |
| 3 | /* VMEConfig.h, S. Kate Feng modified it for MVME5500 3/04 |
| 4 | * |
| 5 | * May 2011 : Use the VME shared IRQ handlers. |
| 6 | * |
| 7 | * It seems that the implementation of VMEUNIVERSE_IRQ_MGR_FLAG_PW_WORKAROUND |
| 8 | * is not fully developed. The UNIV_REGOFF_VCSR_BS is defined for VME64 |
| 9 | * specification, which does not apply to a VME32 crate. In order to avoid |
| 10 | * spurious VME interrupts, a better and more universal solution is |
| 11 | * to flush the vmeUniverse FIFO by reading a register back within the |
| 12 | * users' Interrupt Service Routine (ISR) before returning. |
| 13 | * |
| 14 | * Some devices might require the ISR to issue an interrupt status READ |
| 15 | * after its IRQ is cleared, but before its corresponding interrupt |
| 16 | * is enabled again. |
| 17 | * |
| 18 | */ |
4 | 19 | /* BSP specific address space configuration parameters */ |
5 | 20 | |
6 | | /* |
| 21 | /* |
7 | 22 | * The BSP maps VME address ranges into |
8 | 23 | * one BAT. |
9 | 24 | * NOTE: the BSP (startup/bspstart.c) uses |
… |
… |
|
11 | 26 | * layout: |
12 | 27 | */ |
13 | 28 | #define _VME_A32_WIN0_ON_PCI 0x90000000 |
| 29 | /* If _VME_CSR_ON_PCI is defined then the A32 window is reduced to accommodate |
| 30 | * CSR for space. |
| 31 | */ |
| 32 | #define _VME_CSR_ON_PCI 0x9e000000 |
14 | 33 | #define _VME_A24_ON_PCI 0x9f000000 |
15 | 34 | #define _VME_A16_ON_PCI 0x9fff0000 |
16 | 35 | |
… |
… |
|
30 | 49 | |
31 | 50 | #define BSP_VME_UNIVERSE_INSTALL_IRQ_MGR(err) \ |
32 | 51 | do { \ |
33 | | err = vmeUniverseInstallIrqMgr(0,64+12,1,64+13); \ |
| 52 | err = vmeUniverseInstallIrqMgrAlt(VMEUNIVERSE_IRQ_MGR_FLAG_SHARED,\ |
| 53 | 0, BSP_GPP_VME_VLINT0, \ |
| 54 | 1, BSP_GPP_VME_VLINT1, \ |
| 55 | 2, BSP_GPP_VME_VLINT2, \ |
| 56 | 3, BSP_GPP_VME_VLINT3, \ |
| 57 | -1 /* terminate list */); \ |
34 | 58 | } while (0) |
35 | 59 | |
36 | 60 | #endif |