Changeset 36 in XOpenSparcT1


Ignore:
Timestamp:
04/11/11 09:54:25 (13 years ago)
Author:
pntsvt00
Message:

modificati i file per la compilazione. boot.s linkato a 0xFFF0000020

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/os2wb/os2wb.v

    r33 r36  
    438438                           if(pcx_packet_d[122:118]==5'b10000 && !pcx_req_d[4]) 
    439439                           begin 
    440                               $display("INFO: OS2WB: ifill"); 
     440                              $display("INFO: OS2WB: DRAM ifill"); 
    441441                              wb_addr<={pcx_req_d,19'b0,pcx_packet_d[103:64+5],5'b00000}; //DRAM ifill 
    442442                           end 
    443443                           else 
    444444                              if(pcx_packet_d[64+39:64+28]==12'hFFF && pcx_packet_d[64+27:64+24]!=4'b0) // flash remap FFF1->FFF8 
    445                                  wb_addr<={pcx_req_d,19'b0,pcx_packet_d[103:64+3]+37'h0000E00000,3'b000}; 
    446                               else 
     445                                 begin 
     446                                  $display("INFO: OS2WB: flash remap"); 
     447                                  wb_addr<={pcx_req_d,19'b0,pcx_packet_d[103:64+3]+37'h0000E00000,3'b000}; 
     448                                 end 
     449                                else 
    447450                                 wb_addr<={pcx_req_d,19'b0,pcx_packet_d[103:64+3],3'b000}; 
    448451                        wb_data_o<=pcx_packet_d[63:0]; 
     
    689692               if(wb_ack) 
    690693                  begin 
    691                      $display("INFO: OS2WB: PCX_REQ_STEP1_1 wb_addr = %x wb_data_i = %x wb_data_o = ",wb_addr, wb_data_i,wb_data_o); 
     694                     $display("INFO: OS2WB: PCX_REQ_STEP1_1 wb_addr = %x wb_data_i = %x wb_data_o = %x ",wb_addr, wb_data_i,wb_data_o); 
    692695                     cpx_packet_1[144]<=1;     // Valid 
    693696                     cpx_packet_1[139]<=(pcx_packet_d[122:118]==5'b00000) || (pcx_packet_d[122:118]==5'b10000) ? 1:0; // L2 always miss on load and ifill 
  • trunk/sw/boot.S

    r35 r36  
    3333        mov    %g0, %o5 
    3434 
    35         !wrpr   %g0, 0, %gl 
     35        !wrpr   %g0, 0, %gl 
    3636        !wrpr   %g0, 0, %tl 
    3737 
  • trunk/sw/linker.lds

    r33 r36  
    66 
    77SECTIONS {  
    8   .boot 0x0000000000000020 : { *(.boot);} 
     8  .boot 0xf0000020: { *(.boot);} 
    99  .text : { *(.text) } 
    1010  .data : { *(.data) }  
  • trunk/sw/uart.c

    r34 r36  
    11#include "uart.h" 
    22 
    3 const long UART_BASE_ADR[1] = {0x800000FFF0C2C000}; 
    4 const int UART_BAUDS[1] = {0}; 
     3#define BASE_UART 0x800000FFF0C2C000  
     4#define BAUD_UART 100000  
     5//const long UART_BASE_ADR[1] = {0x800000FFF0C2C000}; 
     6//const int UART_BAUDS[1] = {0}; 
    57const int BAUD_RATE =100000; 
    68const int IN_CLK =50000000; 
     
    1214#define WAIT_FOR_XMITR(core)                    \ 
    1315do { \ 
    14 lsr = REG8(UART_BASE_ADR[core] + UART_LSR); \ 
     16lsr = REG8(BASE_UART + UART_LSR); \ 
    1517} while ((lsr & BOTH_EMPTY) != BOTH_EMPTY) 
    1618 
    1719#define WAIT_FOR_THRE(core)                     \ 
    1820do { \ 
    19 lsr = REG8(UART_BASE_ADR[core] + UART_LSR); \ 
     21lsr = REG8(BASE_UART + UART_LSR); \ 
    2022} while ((lsr & UART_LSR_THRE) != UART_LSR_THRE) 
    2123 
    22 #define CHECK_FOR_CHAR(core) (REG8(UART_BASE_ADR[core] + UART_LSR) & UART_LSR_DR) 
     24#define CHECK_FOR_CHAR(core) (REG8(BASE_UART + UART_LSR) & UART_LSR_DR) 
    2325 
    2426#define WAIT_FOR_CHAR(core)                     \ 
    2527do { \ 
    26 lsr = REG8(UART_BASE_ADR[core] + UART_LSR); \ 
     28lsr = REG8(BASE_UART + UART_LSR); \ 
    2729} while ((lsr & UART_LSR_DR) != UART_LSR_DR) 
    2830 
     
    5052*/ 
    5153        uart_init(0); 
     54 
    5255        for(;;) {  
    5356                uart_puts(0,"XOpenSparc is alive \n");  
     
    6265        //float float_divisor; 
    6366        /* Reset receiver and transmiter */ 
    64         REG8( UART_FCR ) = UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT | UART_FCR_TRIGGER_14; 
    65         //asm("clr %sp \n");     
     67        asm("nop \n");   
     68        asm("nop \n");   
     69        asm("nop \n");   
     70        asm("nop \n"); 
     71        REG8( BASE_UART + UART_FCR ) = UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT | UART_FCR_TRIGGER_14; 
     72        //REG8( UART_BASE_ADR[core] + UART_FCR ) = UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT | UART_FCR_TRIGGER_14; 
     73        asm("nop \n");   
     74        asm("nop \n");   
     75        asm("nop \n");   
     76        asm("nop \n");   
     77        asm("nop \n");   
    6678        //asm("sethi %hi(8), %sp \n");   
    6779        //asm("mov 0xfff, %sp \n");      
    6880 
    6981        /* Disable all interrupts */ 
    70         REG8(UART_BASE_ADR[core] + UART_IER) = 0x00; 
     82        REG8(BASE_UART + UART_IER) = 0x00; 
     83        //REG8(UART_BASE_ADR[core] + UART_IER) = 0x00; 
    7184         
    7285        /* Set 8 bit char, 1 stop bit, no parity */ 
    73         REG8(UART_BASE_ADR[core] + UART_LCR) = UART_LCR_WLEN8 & ~(UART_LCR_STOP | UART_LCR_PARITY); 
     86        REG8(BASE_UART + UART_LCR) = UART_LCR_WLEN8 & ~(UART_LCR_STOP | UART_LCR_PARITY); 
    7487         
    7588        /* Set baud rate */ 
     
    7992        divisor = BAUD_RATE; 
    8093 
    81         REG8(UART_BASE_ADR[core] + UART_LCR) |= UART_LCR_DLAB; 
    82         REG8(UART_BASE_ADR[core] + UART_DLL) = divisor & 0x000000ff; 
    83         REG8(UART_BASE_ADR[core] + UART_DLM) = (divisor >> 8) & 0x000000ff; 
    84         REG8(UART_BASE_ADR[core] + UART_LCR) &= ~(UART_LCR_DLAB); 
     94        REG8(BASE_UART + UART_LCR) |= UART_LCR_DLAB; 
     95        REG8(BASE_UART + UART_DLL) = divisor & 0x000000ff; 
     96        REG8(BASE_UART + UART_DLM) = (divisor >> 8) & 0x000000ff; 
     97        REG8(BASE_UART + UART_LCR) &= ~(UART_LCR_DLAB); 
    8598         
    8699        return; 
     
    92105         
    93106        WAIT_FOR_THRE(core); 
    94         REG8(UART_BASE_ADR[core] + UART_TX) = c; 
     107        REG8(BASE_UART + UART_TX) = c; 
    95108        if(c == '\n') { 
    96109                WAIT_FOR_THRE(core); 
    97                 REG8(UART_BASE_ADR[core] + UART_TX) = '\r'; 
     110                REG8(BASE_UART + UART_TX) = '\r'; 
    98111        } 
    99112        WAIT_FOR_XMITR(core); 
  • trunk/tools/compila

    r33 r36  
    1010 
    1111#assembla il boot.S 
    12 /opt/sparc64-sun-solaris2.8-toolchain/bin/sparc-sun-solaris2.8-as -64 boot.S -o boot.o 
     12echo "create boot.o" 
     13/opt/sparc64-sun-solaris2.8-toolchain/bin/sparc-sun-solaris2.8-as -xarch=v9 -64 boot.S -o boot.o 
    1314 
    1415## compila con ISA SPARC-V9 
     16echo "compile $1.c" 
    1517/opt/sparc64-sun-solaris2.8-toolchain/bin/sparc64-sun-solaris2.8-gcc -m64 -ffreestanding -nostdinc -Os -c $1.c 
    1618 
    1719## linka con ISA SPARC-V9 a 64 bits 
    1820echo "create $1.bin" 
    19 /opt/sparc64-sun-solaris2.8-toolchain/sparc64-sun-solaris2.8/bin/ld -melf64_sparc --script linker.lds boot.o $1.o -o $1.bin 
     21#/opt/sparc64-sun-solaris2.8-toolchain/sparc64-sun-solaris2.8/bin/ld -melf64_sparc --script linker.lds boot.o $1.o -o $1.bin 
     22 
     23### da codice S1 
     24/opt/sparc64-sun-solaris2.8-toolchain/sparc64-sun-solaris2.8/bin/ld -melf64_sparc --script=linker.map -EB -o $1.bin boot.o $1.o 
    2025 
    2126 
    2227## fa il dump del file 
    23 /opt/sparc64-sun-solaris2.8-toolchain/sparc64-sun-solaris2.8/bin/objdump -d $1.bin >$1.dump 
     28/opt/sparc64-sun-solaris2.8-toolchain/sparc64-sun-solaris2.8/bin/objdump -zD $1.bin >$1.dump 
    2429 
    2530### crea memory.hex 
  • trunk/tools/dump2hex.php

    r30 r36  
    3131  while (!feof($fp)) { 
    3232    $line = fgets($fp); 
    33     $opcode1 = substr($line, 6, 2); 
    34     $opcode2 = substr($line, 9, 2); 
    35     $opcode3 = substr($line, 12, 2); 
    36     $opcode4 = substr($line, 15, 2); 
     33    $opcode1 = substr($line, 14, 2); 
     34    $opcode2 = substr($line, 17, 2); 
     35    $opcode3 = substr($line, 20, 2); 
     36    $opcode4 = substr($line, 23, 2); 
    3737    $caratteri = strlen($opcode1); 
    3838    if($caratteri != 0){ 
     
    4444    } 
    4545    else{ 
    46         for($i=0; $i<1; $i++) fgets($fp); 
     46        echo "//".$line; 
     47        $line = fgets($fp); 
     48        echo "//".$line; 
    4749     }  
    4850    } 
Note: See TracChangeset for help on using the changeset viewer.