From 066ec6dc917e83102ea6d5f8ac07bc4209ba536d Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Thu, 15 Oct 2015 12:22:16 +0800 Subject: [PATCH] [BSP] remove display_controller.h/c from ls1cdev bsp --- bsp/ls1cdev/applications/application.c | 36 +--- bsp/ls1cdev/applications/startup.c | 6 - bsp/ls1cdev/drivers/SConscript | 4 - bsp/ls1cdev/drivers/board.c | 2 - bsp/ls1cdev/drivers/display_controller.c | 234 ----------------------- bsp/ls1cdev/drivers/display_controller.h | 59 ------ bsp/ls1cdev/rtconfig.h | 11 +- 7 files changed, 11 insertions(+), 341 deletions(-) delete mode 100644 bsp/ls1cdev/drivers/display_controller.c delete mode 100644 bsp/ls1cdev/drivers/display_controller.h diff --git a/bsp/ls1cdev/applications/application.c b/bsp/ls1cdev/applications/application.c index f907c9f347..6690da528a 100644 --- a/bsp/ls1cdev/applications/application.c +++ b/bsp/ls1cdev/applications/application.c @@ -9,44 +9,18 @@ * * Change Logs: * Date Author Notes - * 2010-06-25 Bernard first version - * 2011-08-08 lgnq modified for Loongson LS1B - * 2015-07-06 chinesebear modified for Loongson LS1C + * 2010-06-25 Bernard first version + * 2011-08-08 lgnq modified for Loongson LS1B + * 2015-07-06 chinesebear modified for Loongson LS1C */ #include -#include - -#ifdef RT_USING_COMPONENTS_INIT #include -#endif - -#ifdef RT_USING_RTGUI -#include -extern void rt_hw_dc_init(void); -#endif void rt_init_thread_entry(void *parameter) { -#ifdef RT_USING_RTGUI - { - rt_device_t dc; - - /* init Display Controller */ - rt_hw_dc_init(); - - /* find Display Controller device */ - dc = rt_device_find("dc"); - - /* set Display Controller device as rtgui graphic driver */ - rtgui_graphic_set_device(dc); - } -#endif - -#ifdef RT_USING_COMPONENTS_INIT /* initialization RT-Thread Components */ rt_components_init(); -#endif } int rt_application_init(void) @@ -56,11 +30,9 @@ int rt_application_init(void) /* create initialization thread */ tid = rt_thread_create("init", rt_init_thread_entry, RT_NULL, - 4096, 8, 20); + 4096, RT_THREAD_PRIORITY_MAX/3, 20); if (tid != RT_NULL) rt_thread_startup(tid); return 0; } - - diff --git a/bsp/ls1cdev/applications/startup.c b/bsp/ls1cdev/applications/startup.c index 36171b72c1..5c78776f84 100644 --- a/bsp/ls1cdev/applications/startup.c +++ b/bsp/ls1cdev/applications/startup.c @@ -77,12 +77,6 @@ void rtthread_startup(void) /* init application */ rt_application_init(); - /* init finsh*/ - #ifdef RT_USING_FINSH - finsh_system_init(); - finsh_set_device("uart2"); - #endif - /* start scheduler */ rt_system_scheduler_start(); diff --git a/bsp/ls1cdev/drivers/SConscript b/bsp/ls1cdev/drivers/SConscript index 5e1060d78e..6c6d2c7adb 100644 --- a/bsp/ls1cdev/drivers/SConscript +++ b/bsp/ls1cdev/drivers/SConscript @@ -3,10 +3,6 @@ from building import * cwd = GetCurrentDir() src = Glob('*.c') -# remove no need file. -if GetDepend('RT_USING_RTGUI') == False: - SrcRemove(src, 'display_controller.c') - CPPPATH = [cwd] group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH) diff --git a/bsp/ls1cdev/drivers/board.c b/bsp/ls1cdev/drivers/board.c index c1267b8f7d..f9c7454a16 100644 --- a/bsp/ls1cdev/drivers/board.c +++ b/bsp/ls1cdev/drivers/board.c @@ -110,5 +110,3 @@ void rt_hw_console_output(const char *ptr) } /*@}*/ - - diff --git a/bsp/ls1cdev/drivers/display_controller.c b/bsp/ls1cdev/drivers/display_controller.c deleted file mode 100644 index 1c91ebf8d8..0000000000 --- a/bsp/ls1cdev/drivers/display_controller.c +++ /dev/null @@ -1,234 +0,0 @@ -/* - * File : display_controller.c - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006-2012, RT-Thread Develop Team - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rt-thread.org/license/LICENSE - * - * Change Logs: - * Date Author Notes - * 2011-08-09 lgnq first version for LS1B DC - */ - -#include -#include "display_controller.h" - -struct vga_struct vga_mode[] = -{ - {/*"640x480_70.00"*/ 28560, 640, 664, 728, 816, 480, 481, 484, 500, }, - {/*"640x640_60.00"*/ 33100, 640, 672, 736, 832, 640, 641, 644, 663, }, - {/*"640x768_60.00"*/ 39690, 640, 672, 736, 832, 768, 769, 772, 795, }, - {/*"640x800_60.00"*/ 42130, 640, 680, 744, 848, 800, 801, 804, 828, }, - {/*"800x480_70.00"*/ 35840, 800, 832, 912, 1024, 480, 481, 484, 500, }, - {/*"800x600_60.00"*/ 38220, 800, 832, 912, 1024, 600, 601, 604, 622, }, - {/*"800x640_60.00"*/ 40730, 800, 832, 912, 1024, 640, 641, 644, 663, }, - {/*"832x600_60.00"*/ 40010, 832, 864, 952, 1072, 600, 601, 604, 622, }, - {/*"832x608_60.00"*/ 40520, 832, 864, 952, 1072, 608, 609, 612, 630, }, - {/*"1024x480_60.00"*/ 38170, 1024, 1048, 1152, 1280, 480, 481, 484, 497, }, - {/*"1024x600_60.00"*/ 48960, 1024, 1064, 1168, 1312, 600, 601, 604, 622, }, - {/*"1024x640_60.00"*/ 52830, 1024, 1072, 1176, 1328, 640, 641, 644, 663, }, - {/*"1024x768_60.00"*/ 64110, 1024, 1080, 1184, 1344, 768, 769, 772, 795, }, - {/*"1152x764_60.00"*/ 71380, 1152, 1208, 1328, 1504, 764, 765, 768, 791, }, - {/*"1280x800_60.00"*/ 83460, 1280, 1344, 1480, 1680, 800, 801, 804, 828, }, - {/*"1280x1024_55.00"*/ 98600, 1280, 1352, 1488, 1696, 1024, 1025, 1028, 1057, }, - {/*"1440x800_60.00"*/ 93800, 1440, 1512, 1664, 1888, 800, 801, 804, 828, }, - {/*"1440x900_67.00"*/ 120280, 1440, 1528, 1680, 1920, 900, 901, 904, 935, }, -}; - -ALIGN(16) -volatile rt_uint16_t _rt_framebuffer[FB_YSIZE][FB_XSIZE]; -static struct rt_device_graphic_info _dc_info; - -#define abs(x) ((x<0)?(-x):x) -#define min(a,b) ((atype = RT_Device_Class_Graphic; - dc->init = rt_dc_init; - dc->open = RT_NULL; - dc->close = RT_NULL; - dc->control = rt_dc_control; - dc->user_data = (void*)&_dc_info; - - /* register Display Controller device to RT-Thread */ - rt_device_register(dc, "dc", RT_DEVICE_FLAG_RDWR); -} diff --git a/bsp/ls1cdev/drivers/display_controller.h b/bsp/ls1cdev/drivers/display_controller.h deleted file mode 100644 index 6ea1657037..0000000000 --- a/bsp/ls1cdev/drivers/display_controller.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * File : display_controller.h - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006-2012, RT-Thread Develop Team - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rt-thread.org/license/LICENSE - * - * Change Logs: - * Date Author Notes - * 2011-08-08 lgnq first version for LS1B - * 2015-07-06 chinesebear modified for loongson 1c - */ - -#ifndef __DISPLAY_CONTROLLER_H__ -#define __DISPLAY_CONTROLLER_H__ - -#include -#include "ls1c.h" - -#define DC_BASE 0xBC301240 //Display Controller - -/* Frame Buffer registers */ -#define DC_FB_CONFIG __REG32(DC_BASE + 0x000) -#define DC_FB_BUFFER_ADDR0 __REG32(DC_BASE + 0x020) -#define DC_FB_BUFFER_STRIDE __REG32(DC_BASE + 0x040) -#define DC_FB_BUFFER_ORIGIN __REG32(DC_BASE + 0x060) -#define DC_DITHER_CONFIG __REG32(DC_BASE + 0x120) -#define DC_DITHER_TABLE_LOW __REG32(DC_BASE + 0x140) -#define DC_DITHER_TABLE_HIGH __REG32(DC_BASE + 0x160) -#define DC_PANEL_CONFIG __REG32(DC_BASE + 0x180) -#define DC_PANEL_TIMING __REG32(DC_BASE + 0x1A0) -#define DC_HDISPLAY __REG32(DC_BASE + 0x1C0) -#define DC_HSYNC __REG32(DC_BASE + 0x1E0) -#define DC_VDISPLAY __REG32(DC_BASE + 0x240) -#define DC_VSYNC __REG32(DC_BASE + 0x260) -#define DC_FB_BUFFER_ADDR1 __REG32(DC_BASE + 0x340) - -/* Display Controller driver for 1024x768 16bit */ -#define FB_XSIZE 1024 -#define FB_YSIZE 768 -#define CONFIG_VIDEO_16BPP - -#define APB_CLK 33333333 - -#define K1BASE 0xA0000000 -#define KSEG1(addr) ((void *)(K1BASE | (rt_uint32_t)(addr))) -#define HW_FB_ADDR KSEG1(_rt_framebuffer) -#define HW_FB_PIXEL(x, y) *(volatile rt_uint16_t*)((rt_uint8_t*)HW_FB_ADDR + (y * FB_XSIZE * 2) + x * 2) - -struct vga_struct -{ - long pclk; - int hr,hss,hse,hfl; - int vr,vss,vse,vfl; -}; - -#endif diff --git a/bsp/ls1cdev/rtconfig.h b/bsp/ls1cdev/rtconfig.h index 6c021a44dc..d6fed266e6 100644 --- a/bsp/ls1cdev/rtconfig.h +++ b/bsp/ls1cdev/rtconfig.h @@ -23,6 +23,8 @@ #define RT_USING_OVERFLOW_CHECK // #define RT_USING_INTERRUPT_INFO +// +#define IDLE_THREAD_STACK_SIZE 1024 // // @@ -91,15 +93,16 @@ #define FINSH_USING_DESCRIPTION // #define FINSH_THREAD_STACK_SIZE 4096 +// +#define FINSH_USING_MSH +// +#define FINSH_USING_MSH_DEFAULT // - //
#define RT_USING_LIBC -// -// #define RT_USING_NEWLIB // -// #define RT_USING_PTHREADS +#define RT_USING_PTHREADS //
//
-- GitLab