setup.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. 0, 25, /* orig-x, orig-y */
  37. 0, /* unused */
  38. 0, /* orig-video-page */
  39. 0, /* orig-video-mode */
  40. 80, /* orig-video-cols */
  41. 0, 0, 0, /* ega_ax, ega_bx, ega_cx */
  42. 25, /* orig-video-lines */
  43. VIDEO_TYPE_VGAC, /* orig-video-isVGA */
  44. 16 /* orig-video-points */
  45. };
  46. #elif defined(CONFIG_DUMMY_CONSOLE)
  47. conswitchp = &dummy_con;
  48. #endif
  49. #endif
  50. }