Changeset 415 for trunk/softs/tsar_boot/src
- Timestamp:
- Jun 18, 2013, 10:25:15 AM (12 years ago)
- Location:
- trunk/softs/tsar_boot/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/softs/tsar_boot/src/boot_elf_loader.c
r412 r415 109 109 if (init_state != init_state_debug) 110 110 { 111 boot_puts(" init_state = ");111 boot_puts("\ninit_state = "); 112 112 boot_puts(init_state_str[init_state]); 113 113 boot_puts("\n"); … … 189 189 { 190 190 #if (BOOT_DEBUG == 1) 191 boot_puts("found a loadable segment: \n");192 boot_puts(" - type : "); boot_putx(elf_pht_ptr[pseg].p_type); boot_puts("\n");193 boot_puts(" - offset : "); boot_putx(elf_pht_ptr[pseg].p_offset); boot_puts("\n");194 boot_puts(" - vaddr : "); boot_putx(elf_pht_ptr[pseg].p_vaddr); boot_puts("\n");195 boot_puts(" - paddr : "); boot_putx(elf_pht_ptr[pseg].p_paddr); boot_puts("\n");196 boot_puts(" - filesz : "); boot_putx(elf_pht_ptr[pseg].p_filesz); boot_puts("\n");197 boot_puts(" - memsz : "); boot_putx(elf_pht_ptr[pseg].p_memsz); boot_puts("\n");198 boot_puts(" - flags : "); boot_putx(elf_pht_ptr[pseg].p_flags); boot_puts("\n");199 boot_puts(" - align : "); boot_putx(elf_pht_ptr[pseg].p_align); boot_puts("\n");191 boot_puts("found a loadable segment:"); 192 boot_puts("\n- type : "); boot_putx(elf_pht_ptr[pseg].p_type); 193 boot_puts("\n- offset : "); boot_putx(elf_pht_ptr[pseg].p_offset); 194 boot_puts("\n- vaddr : "); boot_putx(elf_pht_ptr[pseg].p_vaddr); 195 boot_puts("\n- paddr : "); boot_putx(elf_pht_ptr[pseg].p_paddr); 196 boot_puts("\n- filesz : "); boot_putx(elf_pht_ptr[pseg].p_filesz); 197 boot_puts("\n- memsz : "); boot_putx(elf_pht_ptr[pseg].p_memsz); 198 boot_puts("\n- flags : "); boot_putx(elf_pht_ptr[pseg].p_flags); 199 boot_puts("\n- align : "); boot_putx(elf_pht_ptr[pseg].p_align); 200 200 #endif 201 201 if (elf_pht_ptr[pseg].p_offset < offset) 202 202 { 203 /* case where the segment to load includes the elf and program headers */ 203 /* 204 * Case where the segment to load includes the elf 205 * and program headers 206 * */ 204 207 nb_rest = elf_pht_ptr[pseg].p_filesz - offset; 205 208 init_state = ELF_SEGMENT_STATE; … … 207 210 else 208 211 { 209 /* segment to load is further away in memory */ 212 /* 213 * Segment to load is further away in ELF file 214 * */ 210 215 nb_rest = elf_pht_ptr[pseg].p_offset - offset; 211 216 init_state = ELF_OFFSET_STATE; … … 230 235 231 236 /** 232 * Go to the offset of the first not null program segment in the ELF file 237 * Go to the offset of the first not null program segment in the 238 * ELF file 233 239 */ 234 240 case ELF_OFFSET_STATE: -
trunk/softs/tsar_boot/src/spi.c
r398 r415 92 92 93 93 _spi_wait_if_busy(spi); 94 94 95 /* switch to 128 bits words */ 95 96 spi_ctrl0 = ioread32(&spi->ctrl); … … 99 100 /* read data */ 100 101 for (i = 0; i + 3 < count / 4; i += 4) { 101 iowrite32(&spi->rx_tx[0], 0xffffffff); 102 iowrite32(&spi->rx_tx[1], 0xffffffff); 103 iowrite32(&spi->rx_tx[2], 0xffffffff); 104 iowrite32(&spi->rx_tx[3], 0xffffffff); 105 iowrite32(&spi->ctrl, spi_ctrl | SPI_CTRL_GO_BSY); 102 iowrite32(&spi->rx_tx[0], 0xffffffff); 103 iowrite32(&spi->rx_tx[1], 0xffffffff); 104 iowrite32(&spi->rx_tx[2], 0xffffffff); 105 iowrite32(&spi->rx_tx[3], 0xffffffff); 106 iowrite32(&spi->ctrl, spi_ctrl | SPI_CTRL_GO_BSY); 107 106 108 _spi_wait_if_busy(spi); 107 *data = bswap32(ioread32(&spi->rx_tx[3])); 108 data++; 109 *data = bswap32(ioread32(&spi->rx_tx[2])); 110 data++; 111 *data = bswap32(ioread32(&spi->rx_tx[1])); 112 data++; 113 *data = bswap32(ioread32(&spi->rx_tx[0])); 114 data++; 109 110 *data = bswap32(ioread32(&spi->rx_tx[3])); 111 data++; 112 *data = bswap32(ioread32(&spi->rx_tx[2])); 113 data++; 114 *data = bswap32(ioread32(&spi->rx_tx[1])); 115 data++; 116 *data = bswap32(ioread32(&spi->rx_tx[0])); 117 data++; 115 118 } 119 116 120 /* switch back to original word size */ 117 121 iowrite32(&spi->ctrl, spi_ctrl0); 122 118 123 /* read missing bits */ 119 124 data8 = (void *)data; 120 125 i = i * 4; 121 for (; i < count; i++) { 122 iowrite32(&spi->rx_tx[0], 0xffffffff); 123 iowrite32(&spi->ctrl, spi_ctrl0 | SPI_CTRL_GO_BSY); 124 _spi_wait_if_busy(spi); 125 *data8 = spi_get_rx(spi, 0); 126 data8++; 126 for (; i < count; i++) 127 { 128 iowrite32(&spi->rx_tx[0], 0xffffffff); 129 iowrite32(&spi->ctrl, spi_ctrl0 | SPI_CTRL_GO_BSY); 130 131 _spi_wait_if_busy(spi); 132 133 *data8 = spi_get_rx(spi, 0); 134 data8++; 127 135 } 128 136 return; … … 145 153 void spi_dev_config ( 146 154 struct spi_dev * spi, 147 int spi_freq 155 int spi_freq , 148 156 int sys_freq , 149 int char_len 150 int tx_edge 151 int rx_edge 157 int char_len , 158 int tx_edge , 159 int rx_edge ) 152 160 { 153 161 unsigned int spi_ctrl = ioread32(&spi->ctrl);
Note: See TracChangeset
for help on using the changeset viewer.