Changeset 758 for trunk/softs/tsar_boot/include
- Timestamp:
- Jul 24, 2014, 3:19:18 PM (10 years ago)
- Location:
- trunk/softs/tsar_boot/include
- Files:
-
- 1 added
- 3 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/softs/tsar_boot/include/defs.h
r755 r758 1 #include < defs_platform.h>1 #include <hard_config.h> 2 2 3 #define RESET_VERSION 0x00010002 4 #define RESET_STACK_SIZE 0x2000 3 #define RESET_VERSION 0x00010003 4 #define RESET_STACK_SIZE 0x2000 5 #define RESET_LOADER_LBA 2 6 #define RESET_PHDR_ARRAY_SIZE 16 5 7 6 #define BOOT_LOADER_LBA 2 7 #define PHDR_ARRAY_SIZE 16 8 9 #define BLOCK_SIZE 512 10 11 #ifndef CLUSTER_IO 12 # define CLUSTER_IO 0 8 #ifndef RESET_DEBUG 9 # define RESET_DEBUG 0 13 10 #endif 14 11 15 // vim: tabstop=4 : softtabstop=4 : shiftwidth=4 : expandtab 12 #ifndef RESET_HARD_CC 13 # define RESET_HARD_CC 0 14 #endif 16 15 16 /** 17 * Default clock frequency (by default is 25 MHz for FPGA dev card DE2-115) 18 */ 19 #ifndef RESET_SYSTEM_CLK 20 # define RESET_SYSTEM_CLK 25000 /* KHz */ 21 #endif 22 23 /* 24 * TSAR platform independent hardware parameters 25 */ 26 27 #define BLOCK_SIZE 512 /* bytes */ 28 #define CACHE_LINE_SIZE 64 /* bytes */ 29 30 /* 31 * Verify that all used constants have been defined in the hard_config.h file 32 */ 33 34 #ifndef NB_PROCS_MAX 35 # error "NB_PROCS_MAX constant must be defined in hard_config.h" 36 #endif 37 38 #ifndef IRQ_PER_PROCESSOR 39 # error "IRQ_PER_PROCESSOR constant must be defined in hard_config.h file" 40 #endif 41 42 #ifndef SEG_XCU_BASE 43 # error "SEG_XCU_BASE constant must be defined in the hard_config.h file" 44 #endif 45 46 #ifndef SEG_ROM_BASE 47 # error "SEG_ROM_BASE constant must be defined in the hard_config.h file" 48 #endif 49 50 /* 51 * IO cluster constants 52 */ 53 54 #ifndef USE_IOB 55 # error "USE_IOB constant must be defined in the hard_config.h file" 56 #endif 57 58 #if !defined(X_IO) || !defined(Y_IO) 59 # error "X_IO and Y_IO constants must be defined in the hard_config.h file" 60 #endif 61 62 #if !defined(X_WIDTH) || !defined(Y_WIDTH) 63 # error "X_WIDTH and Y_WIDTH constants must be defined in the hard_config.h " 64 "file" 65 #endif 66 67 #define CLUSTER_IO ((X_IO << Y_WIDTH) | Y_IO) 68 69 /* 70 * vim: tabstop=4 : softtabstop=4 : shiftwidth=4 : expandtab 71 */ -
trunk/softs/tsar_boot/include/reset_ioc.h
r653 r758 1 /** 2 * \file reset_ioc.h 3 * \date December 14, 2013 4 * \author Cesar Fuguet 5 * 6 * \brief API for accessing the disk controller 7 * 8 * \note These functions call the specific disk controller driver depending 9 * on the USE_IOC_BDV, USE_IOC_SPI or USE_RAMDISK constants 10 */ 1 11 #ifndef RESET_IOC_H 2 12 #define RESET_IOC_H 3 13 4 #if USE_SPI 5 #include <sdcard.h> 6 #include <spi.h> 7 #endif /* USE_SPI */ 14 int reset_ioc_init(); 8 15 9 #if USE_BDV 10 #include <block_device.h> 11 #include <mcc.h> 12 #endif /* USE_BDV */ 13 14 #include <defs.h> 15 #include <reset_tty.h> 16 #include <io.h> 17 #include <reset_utils.h> 18 19 #if USE_SPI 20 extern int reset_ioc_init(); 21 #endif /* USE_SPI */ 22 23 extern int reset_ioc_read( unsigned int lba, 24 void* buffer, 25 unsigned int count ); 16 int reset_ioc_read( unsigned int lba, void* buffer, unsigned int count ); 26 17 27 18 #endif /* RESET_IOC_H */ 28 19 29 20 /* 30 * vim: tabstop=4 : s hiftwidth=4 : expandtab21 * vim: tabstop=4 : softtabstop=4 : shiftwidth=4 : expandtab 31 22 */ -
trunk/softs/tsar_boot/include/reset_utils.h
r701 r758 5 5 */ 6 6 7 #ifndef BOOT_UTILS_H8 #define BOOT_UTILS_H7 #ifndef RESET_UTILS_H 8 #define RESET_UTILS_H 9 9 10 10 #include <elf-types.h> 11 #include <reset_tty.h> 12 #include <reset_ioc.h> 11 #include <inttypes.h> 13 12 #include <defs.h> 14 #include <mcc.h>15 #include <io.h>16 17 /********************************************************************18 * Integer types definition19 ********************************************************************/20 typedef unsigned int size_t;21 typedef unsigned int addr_t;22 13 23 14 /******************************************************************** … … 26 17 27 18 /* 28 * cache line aligned disk block (sector) buffer 19 * cache line aligned disk block (sector) buffer 29 20 */ 30 21 struct aligned_blk … … 37 28 ********************************************************************/ 38 29 39 extern unsigned int proctime(); 30 /** 31 * \brief processor waits for n cycles 32 */ 33 static inline void reset_sleep(int cycles) 34 { 35 volatile int i; 36 for (i = 0; i < cycles; i++); 37 } 40 38 41 extern int pread(size_t file_offset, void *buf, size_t nbyte, size_t offset); 39 /** 40 * \brief returns processor count 41 */ 42 static inline unsigned int proctime() 43 { 44 register unsigned int ret asm ("v0"); 45 asm volatile ("mfc0 %0, $9":"=r" (ret)); 46 return ret; 47 } 42 48 43 extern void* memcpy(void *_dst, const void *_src, size_t n); 44 extern void* memset(void *_dst, int c, size_t len); 49 int pread(size_t file_offset, void *buf, size_t nbyte, size_t offset); 45 50 46 extern void check_elf_header(Elf32_Ehdr *ehdr);47 extern void reset_print_elf_phdr(Elf32_Phdr * elf_phdr_ptr);51 void* memcpy(void *_dst, const void *_src, size_t n); 52 void* memset(void *_dst, int c, size_t len); 48 53 49 #if USE_IOB 50 void reset_mcc_invalidate (const void * buf, size_t size); 51 #endif /* USE_IOB */ 54 void check_elf_header(Elf32_Ehdr *ehdr); 55 void reset_print_elf_phdr(Elf32_Phdr * elf_phdr_ptr); 52 56 53 #if (CACHE_COHERENCE == 0) || USE_IOB 54 void reset_buf_invalidate (const void * buf, size_t line_size, size_t size); 55 #endif /* (CACHE_COHERENCE == 0) || USE_IOB */ 56 #endif /* BOOT_UTILS_H */ 57 #endif /* RESET_UTILS_H */ 57 58 58 59 // vim: tabstop=4 : softtabstop=4 : shiftwidth=4 : expandtab
Note: See TracChangeset
for help on using the changeset viewer.