setup.c 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * BRIEF MODULE DESCRIPTION
  3. * setup.c - board dependent boot routines
  4. *
  5. * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology
  6. * Author: Fuxin Zhang, zhangfx@lemote.com
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License as published by the
  10. * Free Software Foundation; either version 2 of the License, or (at your
  11. * option) any later version.
  12. *
  13. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  14. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  15. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  16. * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  17. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  18. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  20. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  21. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  22. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  23. *
  24. * You should have received a copy of the GNU General Public License along
  25. * with this program; if not, write to the Free Software Foundation, Inc.,
  26. * 675 Mass Ave, Cambridge, MA 02139, USA.
  27. *
  28. */
  29. #include <linux/init.h>
  30. #include <linux/module.h>
  31. #include <asm/wbflush.h>
  32. #ifdef CONFIG_VT
  33. #include <linux/console.h>
  34. #include <linux/screen_info.h>
  35. #endif
  36. void (*__wbflush)(void);
  37. EXPORT_SYMBOL(__wbflush);
  38. static void wbflush_loongson2e(void)
  39. {
  40. asm(".set\tpush\n\t"
  41. ".set\tnoreorder\n\t"
  42. ".set mips3\n\t"
  43. "sync\n\t"
  44. "nop\n\t"
  45. ".set\tpop\n\t"
  46. ".set mips0\n\t");
  47. }
  48. void __init plat_mem_setup(void)
  49. {
  50. __wbflush = wbflush_loongson2e;
  51. #ifdef CONFIG_VT
  52. #if defined(CONFIG_VGA_CONSOLE)
  53. conswitchp = &vga_con;
  54. screen_info = (struct screen_info) {
  55. 0, 25, /* orig-x, orig-y */
  56. 0, /* unused */
  57. 0, /* orig-video-page */
  58. 0, /* orig-video-mode */
  59. 80, /* orig-video-cols */
  60. 0, 0, 0, /* ega_ax, ega_bx, ega_cx */
  61. 25, /* orig-video-lines */
  62. VIDEO_TYPE_VGAC, /* orig-video-isVGA */
  63. 16 /* orig-video-points */
  64. };
  65. #elif defined(CONFIG_DUMMY_CONSOLE)
  66. conswitchp = &dummy_con;
  67. #endif
  68. #endif
  69. }