OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [asm-armnommu/] [arch-rpc/] [uncompress.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1633 jcastillo
/*
2
 * linux/include/asm-arm/arch-a5k/uncompress.h
3
 *
4
 * Copyright (C) 1996 Russell King
5
 */
6
#define VIDMEM ((char *)SCREEN_START)
7
 
8
#include "../arch/arm/drivers/char/font.h"
9
#include <asm/hardware.h>
10
#include <asm/io.h>
11
 
12
int video_num_columns, video_num_lines, video_size_row;
13
int white, bytes_per_char_h;
14
extern unsigned long con_charconvtable[256];
15
 
16
struct param_struct {
17
        unsigned long page_size;
18
        unsigned long nr_pages;
19
        unsigned long ramdisk_size;
20
        unsigned long mountrootrdonly;
21
        unsigned long rootdev;
22
        unsigned long video_num_cols;
23
        unsigned long video_num_rows;
24
        unsigned long video_x;
25
        unsigned long video_y;
26
        unsigned long memc_control_reg;
27
        unsigned char sounddefault;
28
        unsigned char adfsdrives;
29
        unsigned char bytes_per_char_h;
30
        unsigned char bytes_per_char_v;
31
        unsigned long unused[256/4-11];
32
};
33
 
34
static const unsigned long palette_4[16] = {
35
        0x00000000,
36
        0x000000cc,
37
        0x0000cc00,             /* Green   */
38
        0x0000cccc,             /* Yellow  */
39
        0x00cc0000,             /* Blue    */
40
        0x00cc00cc,             /* Magenta */
41
        0x00cccc00,             /* Cyan    */
42
        0x00cccccc,             /* White   */
43
        0x00000000,
44
        0x000000ff,
45
        0x0000ff00,
46
        0x0000ffff,
47
        0x00ff0000,
48
        0x00ff00ff,
49
        0x00ffff00,
50
        0x00ffffff
51
};
52
 
53
#define palette_setpixel(p)     *(unsigned long *)(IO_START+0x00400000) = 0x10000000|((p) & 255)
54
#define palette_write(v)        *(unsigned long *)(IO_START+0x00400000) = 0x00000000|((v) & 0x00ffffff)
55
 
56
static struct param_struct * const params = (struct param_struct *)Z_PARAMS_BASE;
57
 
58
/*
59
 * This does not append a newline
60
 */
61
static void puts(const char *s)
62
{
63
        extern void ll_write_char(char *, unsigned long);
64
        int x,y;
65
        unsigned char c;
66
        char *ptr;
67
 
68
        x = params->video_x;
69
        y = params->video_y;
70
 
71
        while ( ( c = *(unsigned char *)s++ ) != '\0' ) {
72
                if ( c == '\n' ) {
73
                        x = 0;
74
                        if ( ++y >= video_num_lines ) {
75
                                y--;
76
                        }
77
                } else {
78
                        ptr = VIDMEM + ((y*video_num_columns*params->bytes_per_char_v+x)*bytes_per_char_h);
79
                        ll_write_char(ptr, c|(white<<8));
80
                        if ( ++x >= video_num_columns ) {
81
                                x = 0;
82
                                if ( ++y >= video_num_lines ) {
83
                                        y--;
84
                                }
85
                        }
86
                }
87
        }
88
 
89
        params->video_x = x;
90
        params->video_y = y;
91
}
92
 
93
static void error(char *x);
94
 
95
/*
96
 * Setup for decompression
97
 */
98
static void arch_decomp_setup(void)
99
{
100
        int i;
101
 
102
        video_num_lines = params->video_num_rows;
103
        video_num_columns = params->video_num_cols;
104
        bytes_per_char_h = params->bytes_per_char_h;
105
        video_size_row = video_num_columns * bytes_per_char_h;
106
        if (bytes_per_char_h == 4)
107
                for (i = 0; i < 256; i++)
108
                        con_charconvtable[i] =
109
                                (i & 128 ? 1 << 0  : 0) |
110
                                (i & 64  ? 1 << 4  : 0) |
111
                                (i & 32  ? 1 << 8  : 0) |
112
                                (i & 16  ? 1 << 12 : 0) |
113
                                (i & 8   ? 1 << 16 : 0) |
114
                                (i & 4   ? 1 << 20 : 0) |
115
                                (i & 2   ? 1 << 24 : 0) |
116
                                (i & 1   ? 1 << 28 : 0);
117
        else
118
                for (i = 0; i < 16; i++)
119
                        con_charconvtable[i] =
120
                                (i & 8   ? 1 << 0  : 0) |
121
                                (i & 4   ? 1 << 8  : 0) |
122
                                (i & 2   ? 1 << 16 : 0) |
123
                                (i & 1   ? 1 << 24 : 0);
124
 
125
 
126
        palette_setpixel(0);
127
        if (bytes_per_char_h == 1) {
128
                palette_write (0);
129
                palette_write (0x00ffffff);
130
                for (i = 2; i < 256; i++)
131
                        palette_write (0);
132
                white = 1;
133
        } else {
134
                for (i = 0; i < 256; i++)
135
                        palette_write (i < 16 ? palette_4[i] : 0);
136
                white = 7;
137
        }
138
 
139
        if (params->nr_pages * params->page_size < 4096*1024) error("<4M of mem\n");
140
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.