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/export.h>
  11. #include <linux/init.h>
  12. #include <asm/wbflush.h>
  13. #include <asm/bootinfo.h>
  14. #include <loongson.h>
  15. #ifdef CONFIG_VT
  16. #include <linux/console.h>
  17. #include <linux/screen_info.h>
  18. #endif
  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 (*__wbflush)(void) = wbflush_loongson;
  30. EXPORT_SYMBOL(__wbflush);
  31. void __init plat_mem_setup(void)
  32. {
  33. #ifdef CONFIG_VT
  34. #if defined(CONFIG_VGA_CONSOLE)
  35. conswitchp = &vga_con;
  36. screen_info = (struct screen_info) {
  37. .orig_x = 0,
  38. .orig_y = 25,
  39. .orig_video_cols = 80,
  40. .orig_video_lines = 25,
  41. .orig_video_isVGA = VIDEO_TYPE_VGAC,
  42. .orig_video_points = 16,
  43. };
  44. #elif defined(CONFIG_DUMMY_CONSOLE)
  45. conswitchp = &dummy_con;
  46. #endif
  47. #endif
  48. }