OpenCores
URL https://opencores.org/ocsvn/s6soc/s6soc/trunk

Subversion Repositories s6soc

[/] [s6soc/] [trunk/] [sw/] [host/] [zipload.cpp] - Diff between revs 11 and 14

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 11 Rev 14
Line 480... Line 480...
                        secp=  secpp[i];
                        secp=  secpp[i];
                        if ((secp->m_start >= RESET_ADDRESS)
                        if ((secp->m_start >= RESET_ADDRESS)
                                &&(secp->m_start+secp->m_len
                                &&(secp->m_start+secp->m_len
                                                <= SPIFLASH+FLASHWORDS))
                                                <= SPIFLASH+FLASHWORDS))
                                valid = true;
                                valid = true;
 
                        if ((secp->m_start >= RAMBASE)
 
                                &&(secp->m_start+secp->m_len
 
                                                <= RAMBASE+MEMWORDS))
 
                                valid = true;
                        if (!valid) {
                        if (!valid) {
                                fprintf(stderr, "No such memory on board: 0x%08x - %08x\n",
                                fprintf(stderr, "No such memory on board: 0x%08x - %08x\n",
                                        secp->m_start, secp->m_start+secp->m_len);
                                        secp->m_start, secp->m_start+secp->m_len);
                                exit(EXIT_FAILURE);
                                exit(EXIT_FAILURE);
                        }
                        }
                }
                }
 
 
                for(int i=0; secpp[i]->m_len; i++) {
                for(int i=0; secpp[i]->m_len; i++) {
                        secp = secpp[i];
                        secp = secpp[i];
                        if (!flash->write(secp->m_start, secp->m_len, secp->m_data, true)) {
                        if ((secp->m_start >= RAMBASE)
 
                                &&(secp->m_start+secp->m_len
 
                                                <= RAMBASE+MEMWORDS)) {
 
                                for(int i=0; (unsigned)i<secp->m_len; i++) {
 
                                        if (secp->m_data[i] != 0) {
 
                                                fprintf(stderr, "ERR: Cannot set RAM upon bootup!\n");
 
                                                fprintf(stderr, "(The bootloaders just not that smart ... yet)\n");
 
                                                exit(EXIT_FAILURE);
 
                                        }
 
                                }
 
                        } else if (!flash->write(secp->m_start, secp->m_len, secp->m_data, true)) {
                                fprintf(stderr, "ERR: Could not write program to flash\n");
                                fprintf(stderr, "ERR: Could not write program to flash\n");
                                exit(EXIT_FAILURE);
                                exit(EXIT_FAILURE);
                        }
                        }
                }
                }
                m_fpga->readio(R_VERSION); // Check for bus errors
                m_fpga->readio(R_VERSION); // Check for bus errors

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.