blob: bc2da4c140c4b391673eef166d1a7a073c20efc5 [file] [log] [blame]
David Brazdil0f672f62019-12-10 10:32:29 +00001// SPDX-License-Identifier: GPL-2.0-or-later
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00002/*
3 * Copyright (C) 2007 Lemote Inc. & Institute of Computing Technology
4 * Author: Fuxin Zhang, zhangfx@lemote.com
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00005 */
6#include <linux/export.h>
7#include <linux/init.h>
8
9#include <asm/wbflush.h>
10#include <asm/bootinfo.h>
11
12#include <loongson.h>
13
14#ifdef CONFIG_VT
15#include <linux/console.h>
16#include <linux/screen_info.h>
17#endif
18
19static 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
30void (*__wbflush)(void) = wbflush_loongson;
31EXPORT_SYMBOL(__wbflush);
32
33void __init plat_mem_setup(void)
34{
35#ifdef CONFIG_VT
36#if defined(CONFIG_VGA_CONSOLE)
37 conswitchp = &vga_con;
38
39 screen_info = (struct screen_info) {
40 .orig_x = 0,
41 .orig_y = 25,
42 .orig_video_cols = 80,
43 .orig_video_lines = 25,
44 .orig_video_isVGA = VIDEO_TYPE_VGAC,
45 .orig_video_points = 16,
46 };
47#elif defined(CONFIG_DUMMY_CONSOLE)
48 conswitchp = &dummy_con;
49#endif
50#endif
51}