blob: 332387678f3e5eada23b80ffc3750207a3f73959 [file] [log] [blame]
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00001/*
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
13#include <asm/wbflush.h>
14#include <asm/bootinfo.h>
15
16#include <loongson.h>
17
18#ifdef CONFIG_VT
19#include <linux/console.h>
20#include <linux/screen_info.h>
21#endif
22
23static void wbflush_loongson(void)
24{
25 asm(".set\tpush\n\t"
26 ".set\tnoreorder\n\t"
27 ".set mips3\n\t"
28 "sync\n\t"
29 "nop\n\t"
30 ".set\tpop\n\t"
31 ".set mips0\n\t");
32}
33
34void (*__wbflush)(void) = wbflush_loongson;
35EXPORT_SYMBOL(__wbflush);
36
37void __init plat_mem_setup(void)
38{
39#ifdef CONFIG_VT
40#if defined(CONFIG_VGA_CONSOLE)
41 conswitchp = &vga_con;
42
43 screen_info = (struct screen_info) {
44 .orig_x = 0,
45 .orig_y = 25,
46 .orig_video_cols = 80,
47 .orig_video_lines = 25,
48 .orig_video_isVGA = VIDEO_TYPE_VGAC,
49 .orig_video_points = 16,
50 };
51#elif defined(CONFIG_DUMMY_CONSOLE)
52 conswitchp = &dummy_con;
53#endif
54#endif
55}