File indexing completed on 2025-05-11 08:23:48
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #include <bsp.h>
0018 #include <bsp/bootcard.h>
0019 #include <mrm332.h>
0020 #include <rtems/m68k/sim.h>
0021 #define __START_C__
0022
0023
0024
0025
0026
0027
0028 void start_c(void);
0029
0030 void start_c(void) {
0031
0032 #ifdef SET_EDIV
0033 #define OPTIONAL_EDIV EDIV
0034 #else
0035 #define OPTIONAL_EDIV 0
0036 #endif
0037
0038
0039
0040
0041 *SYNCR = (unsigned short int) (SAM(MRM_W, 15, VCO) | SAM(0x0, 14, PRESCALE)
0042 | SAM(MRM_Y, 8, COUNTER) | OPTIONAL_EDIV);
0043 while (!(*SYNCR & SLOCK))
0044 ;
0045
0046 *SYNCR = (unsigned short int) (SAM(MRM_W, 15, VCO) | SAM(MRM_X, 14,
0047 PRESCALE) | SAM(MRM_Y, 8, COUNTER) | OPTIONAL_EDIV);
0048
0049
0050
0051
0052 *SYPCR = (unsigned char) (HME | BME);
0053
0054
0055
0056 *PICR = (unsigned short int) (SAM(0, 8, PIRQL) | SAM(MRM_PIV, 0, PIV));
0057
0058
0059
0060
0061
0062 *PITR = (unsigned short int) (SAM(0x09, 0, PITM));
0063
0064
0065
0066
0067 *PORTC = (unsigned char) 0x0;
0068
0069
0070
0071 *PORTE0 = (unsigned char) 0;
0072 *PORTF0 = (unsigned char) 0;
0073
0074
0075
0076 *DDRE = (unsigned char) 0xff;
0077 *DDRF = (unsigned char) 0xfd;
0078
0079
0080
0081 *PEPAR = (unsigned char) 0;
0082 *PFPAR = (unsigned char) 0;
0083
0084
0085
0086
0087
0088
0089
0090
0091 {
0092 register char *src = _etext;
0093 register char *dst = _copy_start;
0094
0095 if (_copy_data_from_rom) {
0096
0097 while (dst < _edata)
0098 *dst++ = *src++;
0099 }
0100
0101 for (dst = _clear_start; dst < end; dst++) {
0102 *dst = 0;
0103 }
0104 }
0105
0106
0107
0108
0109 {
0110 rtems_isr_entry *monitors_vector_table;
0111
0112 m68k_get_vbr(monitors_vector_table);
0113
0114 M68Kvec[4] = monitors_vector_table[4];
0115 M68Kvec[9] = monitors_vector_table[9];
0116 M68Kvec[31] = monitors_vector_table[31];
0117 M68Kvec[47] = monitors_vector_table[47];
0118 M68Kvec[66] = monitors_vector_table[66];
0119
0120 m68k_set_vbr(&M68Kvec);
0121 }
0122
0123
0124
0125
0126
0127 boot_card((void*)0);
0128 reboot();
0129
0130 }