📄 svinto_boot.h
字号:
IO_STATE (R_GEN_CONFIG, ata, disable) |\ IO_STATE (R_GEN_CONFIG, scsi0, disable))#elif defined CONFIG_DEBUG_PORT1#define R_GEN_CONFIG_SETUP \ (IO_STATE (R_GEN_CONFIG, g24dir, in) |\ IO_STATE (R_GEN_CONFIG, g16_20dir, in) |\ IO_STATE (R_GEN_CONFIG, g8_15dir, in) |\ IO_STATE (R_GEN_CONFIG, g0dir, in) |\ IO_STATE (R_GEN_CONFIG, dma9, unused) |\ IO_STATE (R_GEN_CONFIG, dma8, unused) |\ IO_STATE (R_GEN_CONFIG, dma7, unused) |\ IO_STATE (R_GEN_CONFIG, dma6, unused) |\ IO_STATE (R_GEN_CONFIG, dma5, par1) /* Unused, so par1 is ok, =0 */ |\ IO_STATE (R_GEN_CONFIG, dma4, par1) /* Unused, so par1 is ok, =0 */ |\ IO_STATE (R_GEN_CONFIG, dma3, scsi0) /* Unused, (must not be 0) */ |\ IO_STATE (R_GEN_CONFIG, dma2, scsi0) /* Unused (must not be 0) */ |\ IO_STATE (R_GEN_CONFIG, mio_w, disable) |\ IO_STATE (R_GEN_CONFIG, ser3, disable) |\ IO_STATE (R_GEN_CONFIG, par1, disable) |\ IO_STATE (R_GEN_CONFIG, scsi0w, disable) |\ IO_STATE (R_GEN_CONFIG, scsi1, disable) |\ IO_STATE (R_GEN_CONFIG, mio, disable) |\ IO_STATE (R_GEN_CONFIG, ser2, disable) |\ IO_STATE (R_GEN_CONFIG, par0, select) |\ IO_STATE (R_GEN_CONFIG, ata, disable) |\ IO_STATE (R_GEN_CONFIG, scsi0, disable))#elif defined CONFIG_DEBUG_PORT2#define R_GEN_CONFIG_SETUP \ (IO_STATE (R_GEN_CONFIG, g24dir, in) |\ IO_STATE (R_GEN_CONFIG, g16_20dir, in) |\ IO_STATE (R_GEN_CONFIG, g8_15dir, in) |\ IO_STATE (R_GEN_CONFIG, g0dir, in) |\ IO_STATE (R_GEN_CONFIG, dma9, unused) |\ IO_STATE (R_GEN_CONFIG, dma8, unused) |\ IO_STATE (R_GEN_CONFIG, dma7, unused) |\ IO_STATE (R_GEN_CONFIG, dma6, unused) |\ IO_STATE (R_GEN_CONFIG, dma5, par1) /* Unused, so par1 is ok, =0 */ |\ IO_STATE (R_GEN_CONFIG, dma4, par1) /* Unused, so par1 is ok, =0 */ |\ IO_STATE (R_GEN_CONFIG, dma3, scsi0) /* Unused, (must not be 0) */ |\ IO_STATE (R_GEN_CONFIG, dma2, scsi0) /* Unused (must not be 0) */ |\ IO_STATE (R_GEN_CONFIG, mio_w, disable) |\ IO_STATE (R_GEN_CONFIG, ser3, disable) |\ IO_STATE (R_GEN_CONFIG, par1, disable) |\ IO_STATE (R_GEN_CONFIG, scsi0w, disable) |\ IO_STATE (R_GEN_CONFIG, scsi1, disable) |\ IO_STATE (R_GEN_CONFIG, mio, disable) |\ IO_STATE (R_GEN_CONFIG, ser2, select) |\ IO_STATE (R_GEN_CONFIG, par0, select) |\ IO_STATE (R_GEN_CONFIG, ata, disable) |\ IO_STATE (R_GEN_CONFIG, scsi0, disable))#elif defined CONFIG_DEBUG_PORT3#define R_GEN_CONFIG_SETUP \ (IO_STATE (R_GEN_CONFIG, g24dir, in) |\ IO_STATE (R_GEN_CONFIG, g16_20dir, in) |\ IO_STATE (R_GEN_CONFIG, g8_15dir, in) |\ IO_STATE (R_GEN_CONFIG, g0dir, in) |\ IO_STATE (R_GEN_CONFIG, dma9, unused) |\ IO_STATE (R_GEN_CONFIG, dma8, unused) |\ IO_STATE (R_GEN_CONFIG, dma7, unused) |\ IO_STATE (R_GEN_CONFIG, dma6, unused) |\ IO_STATE (R_GEN_CONFIG, dma5, par1) /* Unused, so par1 is ok, =0 */ |\ IO_STATE (R_GEN_CONFIG, dma4, par1) /* Unused, so par1 is ok, =0 */ |\ IO_STATE (R_GEN_CONFIG, dma3, scsi0) /* Unused, (must not be 0) */ |\ IO_STATE (R_GEN_CONFIG, dma2, scsi0) /* Unused (must not be 0) */ |\ IO_STATE (R_GEN_CONFIG, mio_w, disable) |\ IO_STATE (R_GEN_CONFIG, ser3, select) |\ IO_STATE (R_GEN_CONFIG, par1, disable) |\ IO_STATE (R_GEN_CONFIG, scsi0w, disable) |\ IO_STATE (R_GEN_CONFIG, scsi1, disable) |\ IO_STATE (R_GEN_CONFIG, mio, disable) |\ IO_STATE (R_GEN_CONFIG, ser2, disable) |\ IO_STATE (R_GEN_CONFIG, par0, select) |\ IO_STATE (R_GEN_CONFIG, ata, disable) |\ IO_STATE (R_GEN_CONFIG, scsi0, disable))#endif #define LOAD_ADDRESS 0x38001000 #define SIZEOF_BOOT_LEVEL_1 2048#define DB 0#if DB == 1#define print_int(a) \*(volatile int*) 0x84000004 = a;\*(volatile unsigned char*) 0x84000000 = 15;#define print_hex(a) \*(volatile int*) 0x84000004 = a;\*(volatile unsigned char*) 0x84000000 = 22;#else#define print_int(a)#define print_hex(a)#endif#define IO_BUF_START 0x38001e00#define IO_BUF_END 0x38001fff#define byte unsigned char#define uword unsigned short#define udword unsigned int#define dword signed int/* This should only be used in the cbl, but if we compiler the sbl for * elinux __CRIS__ will be defined, and these are already defined in * uC-libc, check !defined(ELINUX) as well! */#if defined(__CRIS__) && defined(BUILDING_CBL)static inline udwordhtonl(udword x){ __asm__ ("swapwb %0" : "=r" (x) : "0" (x)); return(x);}#ifndef ntohl #define ntohl(x) htonl(x)#endifstatic inline uwordhtons(uword x){ __asm__ ("swapb %0" : "=r" (x) : "0" (x)); return(x);}#ifndef ntohs#define ntohs(x) htons(x)#endif#endif/*#define ntohs(x) \*//*((unsigned short)((((unsigned short)(x) & 0x00ffU) << 8) | \*//* (((unsigned short)(x) & 0xff00U) >> 8)))*//* *//*#define ntohl(x) \*//*((unsigned long int)((((unsigned long int)(x) & 0x000000ffU) << 24) | \*//* (((unsigned long int)(x) & 0x0000ff00U) << 8) | \*//* (((unsigned long int)(x) & 0x00ff0000U) >> 8) | \*//* (((unsigned long int)(x) & 0xff000000U) >> 24)))*/struct packet_header_T /* Size = 38 */{ byte dest[6]; byte src[6]; uword length; udword snap1; udword snap2; udword tag; udword seq; udword type; udword id; } __attribute__ ((packed));typedef struct dma_descr_T { uword sw_len; /* 0-1 */ uword ctrl; /* 2-3 */ udword next; /* 4-7 */ udword buf; /* 8-11 */ uword hw_len; /* 12-13 */ uword status; /* 14-15 */} dma_descr_T;typedef struct packet_info_T { udword type; udword addr; udword size;} packet_info_T;typedef struct set_register_T { udword type; udword addr; udword val;} set_register_T;typedef struct pause_loop_T { udword type; udword pause;} pause_loop_T;typedef struct get_register_T { udword type; udword addr;} get_register_T;typedef struct mem_verify_T { udword type; udword addr; udword val;} mem_verify_T;typedef struct mem_test_T { udword type; udword from; udword to;} mem_test_T;typedef struct mem_dump_T { udword type; udword from_addr; udword to_addr;} mem_dump_T;typedef struct mem_clear_T { udword type; udword from_addr; udword to_addr;} mem_clear_T;typedef struct flash_T { udword type; udword source; udword dest; udword size;} flash_T;typedef struct jump_T { udword type; udword addr;} jump_T;#define NETWORK_HEADER_LENGTH sizeof(struct packet_header_T)void flash_write(const unsigned char *source, unsigned int offset, unsigned int size);void memory_dump(udword *from, udword *to);byte crc_correct();int read_data(void);void boot_crt0(void);void boot_crt1(void);void send_serial_ack();void send_network_ack();void send_parallel_ack();int timeout();int handle_network_read();void send_serial_string(char *str);void send_parallel_string(char *str);void send_network_string(char *str);void start_network_trans();void send_serial_loop();void toggle_led();void ser_print(char *str);void send_serial_hex(udword v, byte nl);void send_serial_uword(uword v);void level2_boot();void ser_init();void net_init();void parallel_init();void read_load_info();void decode_load_info();void read_file(byte* addr, udword size);void print_descr(dma_descr_T *d);int memory_test(udword addr, udword size, udword *failed_address);extern udword crc_download_area;extern udword dont_touch;extern byte *target_address;extern udword nbr_read;extern byte interface;extern byte set_dest;extern udword last_timeout;extern byte *io_buf_next;extern byte *io_buf_cur;extern struct packet_header_T tx_header;extern dma_descr_T tx_descr;extern dma_descr_T tx_descr2;extern struct packet_header_T rx_header;extern dma_descr_T rx_descr;extern dma_descr_T rx_descr2;extern void (*send_ack[3])();extern void (*send_string[3])();extern void (*init_interface[3])();extern uword timeout_limit; extern udword seq;extern udword bytes_to_read;extern byte serial_up;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -