2 * arch/ubicom32/include/asm/vga.h
3 * Ubicom32 low level VGA/frame buffer definitions.
5 * (C) Copyright 2009, Ubicom, Inc.
6 * (c) 1998 Martin Mares <mj@ucw.cz>
8 * This file is part of the Ubicom32 Linux Kernel Port.
10 * The Ubicom32 Linux Kernel Port is free software: you can redistribute
11 * it and/or modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation, either version 2 of the
13 * License, or (at your option) any later version.
15 * The Ubicom32 Linux Kernel Port is distributed in the hope that it
16 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
17 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
18 * the GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with the Ubicom32 Linux Kernel Port. If not,
22 * see <http://www.gnu.org/licenses/>.
24 * Ubicom32 implementation derived from (with many thanks):
30 #ifndef _ASM_UBICOM32_VGA_H
31 #define _ASM_UBICOM32_VGA_H
33 #include <asm/byteorder.h>
36 * On the PC, we can just recalculate addresses and then
37 * access the videoram directly without any black magic.
40 #define VGA_MAP_MEM(x, s) (0xb0000000L + (unsigned long)(x))
42 #define vga_readb(x) (*(x))
43 #define vga_writeb(x, y) (*(y) = (x))
45 #define VT_BUF_HAVE_RW
47 * These are only needed for supporting VGA or MDA text mode, which use little
48 * endian byte ordering.
49 * In other cases, we can optimize by using native byte ordering and
50 * <linux/vt_buffer.h> has already done the right job for us.
56 static inline void scr_writew(u16 val
, volatile u16
*addr
)
58 *addr
= cpu_to_le16(val
);
61 static inline u16
scr_readw(volatile const u16
*addr
)
63 return le16_to_cpu(*addr
);
66 #define scr_memcpyw(d, s, c) memcpy(d, s, c)
67 #define scr_memmovew(d, s, c) memmove(d, s, c)
68 #define VT_BUF_HAVE_MEMCPYW
69 #define VT_BUF_HAVE_MEMMOVEW
71 #endif /* _ASM_UBICOM32_VGA_H */