blob: bb4ac922e47a900d91d6f3b8ba431b58ae4275cd [file] [log] [blame]
Wu Zhangjin85749d22009-07-02 23:26:45 +08001/*
2 * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology
3 * Author: Fuxin Zhang, zhangfx@lemote.com
4 *
Ralf Baechle70342282013-01-22 12:59:30 +01005 * 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
Wu Zhangjin85749d22009-07-02 23:26:45 +08008 * option) any later version.
9 */
10#include <linux/module.h>
11
12#include <asm/wbflush.h>
13
14#include <loongson.h>
15
16#ifdef CONFIG_VT
17#include <linux/console.h>
18#include <linux/screen_info.h>
19#endif
20
Wu Zhangjin85749d22009-07-02 23:26:45 +080021static void wbflush_loongson(void)
22{
23 asm(".set\tpush\n\t"
24 ".set\tnoreorder\n\t"
25 ".set mips3\n\t"
26 "sync\n\t"
27 "nop\n\t"
28 ".set\tpop\n\t"
29 ".set mips0\n\t");
30}
31
Huacai Chen300459d2014-03-21 18:44:08 +080032void (*__wbflush)(void) = wbflush_loongson;
33EXPORT_SYMBOL(__wbflush);
34
Wu Zhangjin85749d22009-07-02 23:26:45 +080035void __init plat_mem_setup(void)
36{
Wu Zhangjin85749d22009-07-02 23:26:45 +080037#ifdef CONFIG_VT
38#if defined(CONFIG_VGA_CONSOLE)
39 conswitchp = &vga_con;
40
41 screen_info = (struct screen_info) {
Sebastian Andrzej Siewiorb20947a2010-04-21 22:36:47 +020042 .orig_x = 0,
43 .orig_y = 25,
44 .orig_video_cols = 80,
45 .orig_video_lines = 25,
46 .orig_video_isVGA = VIDEO_TYPE_VGAC,
47 .orig_video_points = 16,
Wu Zhangjin85749d22009-07-02 23:26:45 +080048 };
49#elif defined(CONFIG_DUMMY_CONSOLE)
50 conswitchp = &dummy_con;
51#endif
52#endif
53}