display_controller.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright (c) 2006-2022, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2011-08-08 lgnq first version for LS1B
  9. * 2015-07-06 chinesebear modified for loongson 1c
  10. * 2018-01-06 sundm75 modified for smartloong
  11. */
  12. #ifndef __DISPLAY_CONTROLLER_H__
  13. #define __DISPLAY_CONTROLLER_H__
  14. #include <rtthread.h>
  15. #include "ls1c.h"
  16. #define DC_BASE 0xBC301240 //Display Controller
  17. /* Frame Buffer registers */
  18. #define DC_FB_CONFIG __REG32(DC_BASE + 0x000)
  19. #define DC_FB_BUFFER_ADDR0 __REG32(DC_BASE + 0x020)
  20. #define DC_FB_BUFFER_STRIDE __REG32(DC_BASE + 0x040)
  21. #define DC_FB_BUFFER_ORIGIN __REG32(DC_BASE + 0x060)
  22. #define DC_DITHER_CONFIG __REG32(DC_BASE + 0x120)
  23. #define DC_DITHER_TABLE_LOW __REG32(DC_BASE + 0x140)
  24. #define DC_DITHER_TABLE_HIGH __REG32(DC_BASE + 0x160)
  25. #define DC_PANEL_CONFIG __REG32(DC_BASE + 0x180)
  26. #define DC_PANEL_TIMING __REG32(DC_BASE + 0x1A0)
  27. #define DC_HDISPLAY __REG32(DC_BASE + 0x1C0)
  28. #define DC_HSYNC __REG32(DC_BASE + 0x1E0)
  29. #define DC_VDISPLAY __REG32(DC_BASE + 0x240)
  30. #define DC_VSYNC __REG32(DC_BASE + 0x260)
  31. #define DC_FB_BUFFER_ADDR1 __REG32(DC_BASE + 0x340)
  32. /* Display Controller driver for 1024x768 16bit */
  33. #define FB_XSIZE 480
  34. #define FB_YSIZE 272
  35. #define CONFIG_VIDEO_16BPP
  36. #define OSC 24000000 /* Hz */
  37. #define K1BASE 0xA0000000
  38. #define KSEG1(addr) ((void *)(K1BASE | (rt_uint32_t)(addr)))
  39. #define HW_FB_ADDR KSEG1(_rt_framebuffer)
  40. struct vga_struct
  41. {
  42. long pclk;
  43. int hr,hss,hse,hfl;
  44. int vr,vss,vse,vfl;
  45. };
  46. #endif