]> Pileus Git - ~andy/linux/blob - arch/xtensa/platforms/iss/setup.c
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
[~andy/linux] / arch / xtensa / platforms / iss / setup.c
1 /*
2  *
3  * arch/xtensa/platform-iss/setup.c
4  *
5  * Platform specific initialization.
6  *
7  * Authors: Chris Zankel <chris@zankel.net>
8  *          Joe Taylor <joe@tensilica.com>
9  *
10  * Copyright 2001 - 2005 Tensilica Inc.
11  *
12  * This program is free software; you can redistribute  it and/or modify it
13  * under  the terms of  the GNU General  Public License as published by the
14  * Free Software Foundation;  either version 2 of the  License, or (at your
15  * option) any later version.
16  *
17  */
18 #include <linux/stddef.h>
19 #include <linux/kernel.h>
20 #include <linux/init.h>
21 #include <linux/errno.h>
22 #include <linux/reboot.h>
23 #include <linux/kdev_t.h>
24 #include <linux/types.h>
25 #include <linux/major.h>
26 #include <linux/blkdev.h>
27 #include <linux/console.h>
28 #include <linux/delay.h>
29 #include <linux/stringify.h>
30 #include <linux/notifier.h>
31
32 #include <asm/platform.h>
33 #include <asm/bootparam.h>
34
35
36 void __init platform_init(bp_tag_t* bootparam)
37 {
38
39 }
40
41 #ifdef CONFIG_PCI
42 void platform_pcibios_init(void)
43 {
44 }
45 #endif
46
47 void platform_halt(void)
48 {
49         pr_info(" ** Called platform_halt() **\n");
50         __asm__ __volatile__("movi a2, 1\nsimcall\n");
51 }
52
53 void platform_power_off(void)
54 {
55         pr_info(" ** Called platform_power_off() **\n");
56         __asm__ __volatile__("movi a2, 1\nsimcall\n");
57 }
58 void platform_restart(void)
59 {
60         /* Flush and reset the mmu, simulate a processor reset, and
61          * jump to the reset vector. */
62
63         __asm__ __volatile__("movi      a2, 15\n\t"
64                              "wsr       a2, " __stringify(ICOUNTLEVEL) "\n\t"
65                              "movi      a2, 0\n\t"
66                              "wsr       a2, " __stringify(ICOUNT) "\n\t"
67                              "wsr       a2, " __stringify(IBREAKENABLE) "\n\t"
68                              "wsr       a2, " __stringify(LCOUNT) "\n\t"
69                              "movi      a2, 0x1f\n\t"
70                              "wsr       a2, " __stringify(PS) "\n\t"
71                              "isync\n\t"
72                              "jx        %0\n\t"
73                              :
74                              : "a" (XCHAL_RESET_VECTOR_VADDR)
75                              : "a2");
76
77         /* control never gets here */
78 }
79
80 extern void iss_net_poll(void);
81
82 const char twirl[]="|/-\\|/-\\";
83
84 void platform_heartbeat(void)
85 {
86 #if 0
87         static int i = 0, j = 0;
88
89         if (--i < 0) {
90                 i = 99;
91                 printk("\r%c\r", twirl[j++]);
92                 if (j == 8)
93                         j = 0;
94         }
95 #endif
96 }
97
98
99
100 static int
101 iss_panic_event(struct notifier_block *this, unsigned long event, void *ptr)
102 {
103         __asm__ __volatile__("movi a2, -1; simcall\n");
104         return NOTIFY_DONE;
105 }
106
107 static struct notifier_block iss_panic_block = {
108         iss_panic_event,
109         NULL,
110         0
111 };
112
113 void __init platform_setup(char **p_cmdline)
114 {
115         atomic_notifier_chain_register(&panic_notifier_list, &iss_panic_block);
116 }