1
0

display_controller.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * File : display_controller.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006-2012, RT-Thread Develop Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://www.rt-thread.org/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2011-08-08 lgnq first version for LS1B
  13. * 2015-07-06 chinesebear modified for loongson 1c
  14. * 2018-01-06 sundm75 modified for smartloong
  15. */
  16. #ifndef __DISPLAY_CONTROLLER_H__
  17. #define __DISPLAY_CONTROLLER_H__
  18. #include <rtthread.h>
  19. #include "ls1c.h"
  20. #define DC_BASE 0xBC301240 //Display Controller
  21. /* Frame Buffer registers */
  22. #define DC_FB_CONFIG __REG32(DC_BASE + 0x000)
  23. #define DC_FB_BUFFER_ADDR0 __REG32(DC_BASE + 0x020)
  24. #define DC_FB_BUFFER_STRIDE __REG32(DC_BASE + 0x040)
  25. #define DC_FB_BUFFER_ORIGIN __REG32(DC_BASE + 0x060)
  26. #define DC_DITHER_CONFIG __REG32(DC_BASE + 0x120)
  27. #define DC_DITHER_TABLE_LOW __REG32(DC_BASE + 0x140)
  28. #define DC_DITHER_TABLE_HIGH __REG32(DC_BASE + 0x160)
  29. #define DC_PANEL_CONFIG __REG32(DC_BASE + 0x180)
  30. #define DC_PANEL_TIMING __REG32(DC_BASE + 0x1A0)
  31. #define DC_HDISPLAY __REG32(DC_BASE + 0x1C0)
  32. #define DC_HSYNC __REG32(DC_BASE + 0x1E0)
  33. #define DC_VDISPLAY __REG32(DC_BASE + 0x240)
  34. #define DC_VSYNC __REG32(DC_BASE + 0x260)
  35. #define DC_FB_BUFFER_ADDR1 __REG32(DC_BASE + 0x340)
  36. /* Display Controller driver for 1024x768 16bit */
  37. #define FB_XSIZE 480
  38. #define FB_YSIZE 272
  39. #define CONFIG_VIDEO_16BPP
  40. #define OSC 24000000 /* Hz */
  41. #define K1BASE 0xA0000000
  42. #define KSEG1(addr) ((void *)(K1BASE | (rt_uint32_t)(addr)))
  43. #define HW_FB_ADDR KSEG1(_rt_framebuffer)
  44. struct vga_struct
  45. {
  46. long pclk;
  47. int hr,hss,hse,hfl;
  48. int vr,vss,vse,vfl;
  49. };
  50. #endif