Subversion Repositories shark

Rev

Rev 1513 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1498 mauro 1
 
2
/*
3
 * Project: S.Ha.R.K.
4
 *
5
 * Coordinators: Giorgio Buttazzo <giorgio@sssup.it>
6
 *
1513 giacomo 7
 * Authors     : Mauro Marinoni
8
 *               Giacomo Guidi    <giacomo@gandalf.sssup.it>
1498 mauro 9
 * (see authors.txt for full list of hartik's authors)
10
 *
11
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
12
 *
13
 * http://www.sssup.it
14
 * http://retis.sssup.it
15
 * http://shark.sssup.it
16
 */
17
 
18
/*
19
 * This program is free software; you can redistribute it and/or modify
20
 * it under the terms of the GNU General Public License as published by
21
 * the Free Software Foundation; either version 2 of the License, or
22
 * (at your option) any later version.
23
 *
24
 * This program is distributed in the hope that it will be useful,
25
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
27
 * GNU General Public License for more details.
28
 *
29
 * You should have received a copy of the GNU General Public License
30
 * along with this program; if not, write to the Free Software
31
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
32
 *
33
 */
34
 
35
#include <kernel/kern.h>
36
 
37
#include <drivers/shark_keyb26.h>
38
#include <drivers/shark_cpu26.h>
39
 
40
void endfunc(KEY_EVT *e)
41
{
1550 pj 42
  exit(0);
1498 mauro 43
}
44
 
45
int main(int argc, char **argv)
46
{
47
        int val, num;
1513 giacomo 48
        char buf[1000];
1498 mauro 49
 
50
        CPU26_showinfo();
51
 
52
        val = CPU26_get_min_frequency();
53
        cprintf("Min freq: %d\n", val);
54
 
55
        val = CPU26_get_max_frequency();
56
        cprintf("Max freq: %d\n", val);
57
 
58
        val = CPU26_get_cur_frequency();
59
        cprintf("Current freq: %d\n", val);
60
 
1513 giacomo 61
        num = CPU26_show_frequencies(buf);
1498 mauro 62
        if (num>0)
63
                cprintf("Allowed frequencys: %s\n", buf);
1513 giacomo 64
        num = CPU26_get_frequencies(cpu26_freqs);
1498 mauro 65
 
66
        if (num>0) {
67
                CPU26_set_frequency(cpu26_freqs[0], DVS_RELATION_L);
68
                val = CPU26_get_cur_frequency();
69
                cprintf("Actual freq: %d\n", val);
70
        }
71
 
72
        endfunc(NULL);
73
 
74
        return 0;
75
}