Changeset 32cf23b1 in rtems for c/src/lib/libbsp


Ignore:
Timestamp:
Jun 2, 2005, 1:41:35 PM (16 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
b2a4e861
Parents:
d1747cb
Message:

2005-06-01 Philippe Simons <loki_666@…>

  • bsp_specs: Add rules for cpp support
  • include/bsp.h: Add gp32 support fct prototypes
  • console/conio.c: Moved video buffer to 0x0c7ed000
  • startup/bspstart.c: Add some init code, some cleaning...
Location:
c/src/lib/libbsp/arm/gp32
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/gp32/ChangeLog

    rd1747cb r32cf23b1  
     12005-06-01      Philippe Simons <loki_666@fastmail.fm>
     2
     3        * bsp_specs: Add rules for cpp support
     4        * include/bsp.h: Add gp32 support fct prototypes
     5        * console/conio.c: Moved video buffer to 0x0c7ed000
     6        * startup/bspstart.c: Add some init code, some cleaning...
     7
    182005-05-26      Ralf Corsepius <ralf.corsepius@rtems.org>
    29
  • c/src/lib/libbsp/arm/gp32/bsp_specs

    rd1747cb r32cf23b1  
    66
    77*cpp:
    8 %(old_cpp) %{qrtems: -D__embedded__ -DUSE_ENHANCED_INTR_API} -Asystem(embedded)
     8%(old_cpp) %{qrtems: -D__embedded__ -D__USE_INIT_FINI__ -DUSE_ENHANCED_INTR_API} -Asystem(embedded)
    99
    1010*lib:
    11 %{!qrtems: %(old_lib)} %{qrtems: --start-group \
    12 %{!qrtems_debug: -lrtemsbsp -lrtemscpu} %{qrtems_debug: -lrtemsbsp_g -lrtemscpu_g} \
     11%{!qrtems: %(old_lib)} %{!nostdlib: %{qrtems: --start-group \
     12%{!qrtems_debug: -lrtemsbsp -lrtemscpu} \
     13  %{qrtems_debug: -lrtemsbsp_g -lrtemscpu_g} \
    1314-lc -lgcc --end-group \
    14 %{!qnolinkcmds: -T linkcmds%s}}
     15%{!qnolinkcmds: -T linkcmds%s}}}
    1516
    1617*startfile:
    17 %{!qrtems: %(old_startfile)} %{qrtems: \
    18 %{!qrtems_debug: start.o%s crtbegin.o%s} \
    19 %{qrtems_debug: start_g.o%s crtbegin.o%s}}
     18%{!qrtems: %(old_startfile)} %{!nostdlib: %{qrtems: \
     19%{!qrtems_debug: start.o%s crti.o%s crtbegin.o%s} \
     20%{qrtems_debug: start_g.o%s crti.o%s crtbegin.o%s}}}
    2021
    2122*link:
    22 %{!qrtems: %(old_link)} %{qrtems: -Qy -dp -Bstatic -N -e _start}
     23%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e _start}
    2324
     25*endfile:
     26%{!qrtems: *(old_endfiles)} %{qrtems: crtend.o%s crtn.o%s }
  • c/src/lib/libbsp/arm/gp32/console/conio.c

    rd1747cb r32cf23b1  
    2323#include <rtems/score/types.h>
    2424#include <s3c2400.h>
     25#include <bsp.h>
    2526#include <conio.h>
    2627#include <stdio.h>
     
    3435 * Defines                                                                   *
    3536 *---------------------------------------------------------------------------*/
    36 #define LCD_WIDTH 240
    37 #define LCD_HEIGHT 320
    3837#define DEFAULT_FONT_WIDTH  4
    3938#define DEFAULT_FONT_HEIGHT 6
     
    4241
    4342typedef unsigned char       Bitmap[LCD_HEIGHT][LCD_WIDTH];
    44 #define GP32_VRAM 0x0c7b4000
    45 #define bg_bitmap          (*(Bitmap *)GP32_VRAM)
     43#define GP32_CONIO_VRAM 0x0c7ed000
     44#define bg_bitmap          (*(Bitmap *)GP32_CONIO_VRAM)
    4645
    4746/* color conversion */
     
    229228}
    230229
    231 
    232 /*---------------------------------------------------------------------------*
    233  *  InitConIO                                                                *
    234  *---------------------------------------------------------------------------*/
    235 void InitConIO()
    236 {
    237     uint32_t GPHCLK = 66750000;
     230void ShowConIO()
     231{
    238232    unsigned short BPPMODE = 11;
    239     unsigned short CLKVAL = (GPHCLK/(83385*2*60))-1;
    240     uint32_t LCDBANK  =  GP32_VRAM >> 22;
    241     uint32_t LCDBASEU = (GP32_VRAM & 0x3FFFFF) >> 1;
     233    unsigned short CLKVAL = (get_HCLK()/(83385*2*60))-1;
     234    uint32_t LCDBANK  =  GP32_CONIO_VRAM >> 22;
     235    uint32_t LCDBASEU = (GP32_CONIO_VRAM & 0x3FFFFF) >> 1;
    242236    uint32_t LCDBASEL;
    243237    unsigned short OFFSIZE = 0;
     
    261255    rLCDSADDR2 = (LCDBASEL<<0) ;
    262256    rLCDSADDR3 = (OFFSIZE<<11) | (PAGEWIDTH<<0) ;
    263 
     257}
     258
     259
     260/*---------------------------------------------------------------------------*
     261 *  InitConIO                                                                *
     262 *---------------------------------------------------------------------------*/
     263void InitConIO()
     264{
     265    ShowConIO();
     266   
    264267    gp_initButtons();
    265268    gpconio_textattr(0);
  • c/src/lib/libbsp/arm/gp32/include/bsp.h

    rd1747cb r32cf23b1  
    3333extern rtems_configuration_table BSP_Configuration;
    3434
    35 void LCD_BREAK();
     35void gp32_setFramebuffer(void *add);
     36short gp32_initFramebufferN(void *add, uint32_t bitmode, uint32_t refreshrate);
     37short gp32_initFramebufferBP(void *add, uint32_t bitmode, uint32_t refreshrate);
     38#define gp32_initButtons() {rPBCON=0x0;}
     39#define gp32_getButtons() ( (((~rPEDAT >> 6) & 0x3 )<<8) | (((~rPBDAT >> 8) & 0xFF)<<0) )
     40
     41/*functions to get the differents s3c2400 clks*/
     42uint32_t get_FCLK(void);
     43uint32_t get_HCLK(void);
     44uint32_t get_PCLK(void);
     45uint32_t get_UCLK(void);
     46
     47
     48void gp32_setPalette( unsigned char pos, uint16_t color);
    3649
    3750/* What is the input clock freq in hertz? */
    3851#define BSP_OSC_FREQ  12000000    /* 12 MHz oscillator */
    39 #define M_MDIV 81
     52#define M_MDIV 81       /* FCLK=133Mhz */
    4053#define M_PDIV 2
    4154#define M_SDIV 1
     55#define M_CLKDIVN 2     /* HCLK=FCLK/2, PCLK=FCLK/2 */
     56
     57#define REFEN   0x1     /* enable refresh */
     58#define TREFMD  0x0     /* CBR(CAS before RAS)/auto refresh */
     59#define Trp     0x0     /* 2 clk */
     60#define Trc     0x3     /* 7 clk */
     61#define Tchr    0x2     /* 3 clk */
     62
    4263
    4364/* How many serial ports? */
  • c/src/lib/libbsp/arm/gp32/include/conio.h

    rd1747cb r32cf23b1  
    7272char    gpconio_getch_noblock(void);
    7373
     74void    InitConIO();
     75void    ShowConIO();
     76
    7477
    7578#ifdef __cplusplus
  • c/src/lib/libbsp/arm/gp32/startup/bspstart.c

    rd1747cb r32cf23b1  
    2020#include <rtems/bspIo.h>
    2121#include <s3c2400.h>
     22#include <conio.h>
    2223
    2324/*-------------------------------------------------------------------------+
     
    9091{
    9192    uint32_t cr;
     93    uint32_t pend,last;
     94    uint32_t REFCNT;
     95    int i;
    9296    /* If we don't have command line arguments set default program name. */
    9397
     
    101105    Cpu_table.extra_mpci_receive_server_stack = 0;
    102106
    103     /* stop all timers */
     107    /* setup rCLKCON */
     108    /* disable all but IIS,IIC,PWMTIMER and LCD */
     109    rCLKCON=0x6048;
     110
     111    /* stop RTC */
     112    rTICINT=0x0;
     113
     114    /* stop watchdog,ADC and timers */
     115    rWTCON=0x0;
    104116    rTCON=0x0;
     117    rADCCON=0x0;
    105118
    106119    /* disable interrupts */
    107120    rINTMOD=0x0;
    108121    rINTMSK=BIT_ALLMSK; /* unmasked by drivers */
    109     rSRCPND=BIT_ALLMSK;
     122    /*rSRCPND=BIT_ALLMSK;
    110123    rINTMSK=BIT_ALLMSK;
    111     rINTPND=BIT_ALLMSK;
    112 
    113     /* setup clocks 133/66/33) */
    114     rCLKDIVN=3;
     124    rINTPND=BIT_ALLMSK;*/
     125    for(i=0; i<4; i++) {
     126        pend=rSRCPND;
     127        if(pend == 0 || pend == last)
     128            break;
     129        rSRCPND=pend;
     130        rINTPND=pend;
     131        last=pend;
     132    }
     133
     134    /* setup clocks */
     135    rCLKDIVN=M_CLKDIVN;
    115136    rMPLLCON=((M_MDIV<<12)+(M_PDIV<<4)+M_SDIV);
     137    /* setup rREFRESH */
     138    REFCNT=2048+1-(15.6*get_HCLK()/1000000); /* period=15.6 us, HCLK=66Mhz, (2048+1-15.6*66) */
     139    rREFRESH=((REFEN<<23)+(TREFMD<<22)+(Trp<<20)+(Trc<<18)+(Tchr<<16)+REFCNT);
    116140
    117141    /* set prescaler for timers 2,3,4 to 16(15+1) */
     
    177201    _CPU_ISR_Disable(level);
    178202    printk("bsp_reset.....\n");
     203    ShowConIO();
    179204    while(1);
    180205}
    181 
    182 void LCD_BREAK()
    183 {
    184     int x,y;
    185     unsigned short color=0;
    186     volatile unsigned char* framebuffer = (unsigned char*) 0x0C7B4000;
    187     while(1) {
    188         for(y = 0; y < 240; y++) {
    189             for(x = 0; x < 320; x++) {
    190                 *(framebuffer + (239 - y) + (240 * x)) = color;
    191             }
    192         }
    193         color++;
    194     }
    195 }
    196 
Note: See TracChangeset for help on using the changeset viewer.