Wu Zhangjin | 85749d2 | 2009-07-02 23:26:45 +0800 | [diff] [blame] | 1 | /* |
Ralf Baechle | 0bb383a | 2015-07-07 20:56:04 +0200 | [diff] [blame] | 2 | * Copyright (C) 2007 Lemote Inc. & Institute of Computing Technology |
Wu Zhangjin | 85749d2 | 2009-07-02 23:26:45 +0800 | [diff] [blame] | 3 | * Author: Fuxin Zhang, zhangfx@lemote.com |
| 4 | * |
Ralf Baechle | 7034228 | 2013-01-22 12:59:30 +0100 | [diff] [blame] | 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 |
Wu Zhangjin | 85749d2 | 2009-07-02 23:26:45 +0800 | [diff] [blame] | 8 | * option) any later version. |
| 9 | */ |
| 10 | #include <linux/module.h> |
| 11 | |
| 12 | #include <asm/wbflush.h> |
Aaro Koskinen | 15dd8eb | 2014-11-19 23:52:47 +0200 | [diff] [blame] | 13 | #include <asm/bootinfo.h> |
Wu Zhangjin | 85749d2 | 2009-07-02 23:26:45 +0800 | [diff] [blame] | 14 | |
| 15 | #include <loongson.h> |
| 16 | |
| 17 | #ifdef CONFIG_VT |
| 18 | #include <linux/console.h> |
| 19 | #include <linux/screen_info.h> |
| 20 | #endif |
| 21 | |
Wu Zhangjin | 85749d2 | 2009-07-02 23:26:45 +0800 | [diff] [blame] | 22 | static void wbflush_loongson(void) |
| 23 | { |
| 24 | asm(".set\tpush\n\t" |
| 25 | ".set\tnoreorder\n\t" |
| 26 | ".set mips3\n\t" |
| 27 | "sync\n\t" |
| 28 | "nop\n\t" |
| 29 | ".set\tpop\n\t" |
| 30 | ".set mips0\n\t"); |
| 31 | } |
| 32 | |
Huacai Chen | 300459d | 2014-03-21 18:44:08 +0800 | [diff] [blame] | 33 | void (*__wbflush)(void) = wbflush_loongson; |
| 34 | EXPORT_SYMBOL(__wbflush); |
| 35 | |
Wu Zhangjin | 85749d2 | 2009-07-02 23:26:45 +0800 | [diff] [blame] | 36 | void __init plat_mem_setup(void) |
| 37 | { |
Wu Zhangjin | 85749d2 | 2009-07-02 23:26:45 +0800 | [diff] [blame] | 38 | #ifdef CONFIG_VT |
| 39 | #if defined(CONFIG_VGA_CONSOLE) |
| 40 | conswitchp = &vga_con; |
| 41 | |
| 42 | screen_info = (struct screen_info) { |
Sebastian Andrzej Siewior | b20947a | 2010-04-21 22:36:47 +0200 | [diff] [blame] | 43 | .orig_x = 0, |
| 44 | .orig_y = 25, |
| 45 | .orig_video_cols = 80, |
| 46 | .orig_video_lines = 25, |
| 47 | .orig_video_isVGA = VIDEO_TYPE_VGAC, |
| 48 | .orig_video_points = 16, |
Wu Zhangjin | 85749d2 | 2009-07-02 23:26:45 +0800 | [diff] [blame] | 49 | }; |
| 50 | #elif defined(CONFIG_DUMMY_CONSOLE) |
| 51 | conswitchp = &dummy_con; |
| 52 | #endif |
| 53 | #endif |
| 54 | } |