setup.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology
  3. * Author: Fuxin Zhang, zhangfx@lemote.com
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of the GNU General Public License as published by the
  7. * Free Software Foundation; either version 2 of the License, or (at your
  8. * option) any later version.
  9. */
  10. #include <linux/module.h>
  11. #include <asm/wbflush.h>
  12. #include <loongson.h>
  13. #ifdef CONFIG_VT
  14. #include <linux/console.h>
  15. #include <linux/screen_info.h>
  16. #endif
  17. void (*__wbflush)(void);
  18. EXPORT_SYMBOL(__wbflush);
  19. static void wbflush_loongson(void)
  20. {
  21. asm(".set\tpush\n\t"
  22. ".set\tnoreorder\n\t"
  23. ".set mips3\n\t"
  24. "sync\n\t"
  25. "nop\n\t"
  26. ".set\tpop\n\t"
  27. ".set mips0\n\t");
  28. }
  29. void __init plat_mem_setup(void)
  30. {
  31. __wbflush = wbflush_loongson;
  32. #ifdef CONFIG_VT
  33. #if defined(CONFIG_VGA_CONSOLE)
  34. conswitchp = &vga_con;
  35. screen_info = (struct screen_info) {
  36. .orig_x = 0,
  37. .orig_y = 25,
  38. .orig_video_cols = 80,
  39. .orig_video_lines = 25,
  40. .orig_video_isVGA = VIDEO_TYPE_VGAC,
  41. .orig_video_points = 16,
  42. };
  43. #elif defined(CONFIG_DUMMY_CONSOLE)
  44. conswitchp = &dummy_con;
  45. #endif
  46. #endif
  47. }