setup.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. static void wbflush_loongson(void)
  18. {
  19. asm(".set\tpush\n\t"
  20. ".set\tnoreorder\n\t"
  21. ".set mips3\n\t"
  22. "sync\n\t"
  23. "nop\n\t"
  24. ".set\tpop\n\t"
  25. ".set mips0\n\t");
  26. }
  27. void (*__wbflush)(void) = wbflush_loongson;
  28. EXPORT_SYMBOL(__wbflush);
  29. void __init plat_mem_setup(void)
  30. {
  31. #ifdef CONFIG_VT
  32. #if defined(CONFIG_VGA_CONSOLE)
  33. conswitchp = &vga_con;
  34. screen_info = (struct screen_info) {
  35. .orig_x = 0,
  36. .orig_y = 25,
  37. .orig_video_cols = 80,
  38. .orig_video_lines = 25,
  39. .orig_video_isVGA = VIDEO_TYPE_VGAC,
  40. .orig_video_points = 16,
  41. };
  42. #elif defined(CONFIG_DUMMY_CONSOLE)
  43. conswitchp = &dummy_con;
  44. #endif
  45. #endif
  46. }