setup.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright (C) 2007 Lemote Inc. & Institute 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 <asm/bootinfo.h>
  13. #include <loongson.h>
  14. #ifdef CONFIG_VT
  15. #include <linux/console.h>
  16. #include <linux/screen_info.h>
  17. #endif
  18. static void wbflush_loongson(void)
  19. {
  20. asm(".set\tpush\n\t"
  21. ".set\tnoreorder\n\t"
  22. ".set mips3\n\t"
  23. "sync\n\t"
  24. "nop\n\t"
  25. ".set\tpop\n\t"
  26. ".set mips0\n\t");
  27. }
  28. void (*__wbflush)(void) = wbflush_loongson;
  29. EXPORT_SYMBOL(__wbflush);
  30. void __init plat_mem_setup(void)
  31. {
  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. }