Path: blob/master/arch/xtensa/platforms/iss/setup.c
15116 views
/*1*2* arch/xtensa/platform-iss/setup.c3*4* Platform specific initialization.5*6* Authors: Chris Zankel <[email protected]>7* Joe Taylor <[email protected]>8*9* Copyright 2001 - 2005 Tensilica Inc.10*11* This program is free software; you can redistribute it and/or modify it12* under the terms of the GNU General Public License as published by the13* Free Software Foundation; either version 2 of the License, or (at your14* option) any later version.15*16*/17#include <linux/stddef.h>18#include <linux/kernel.h>19#include <linux/init.h>20#include <linux/errno.h>21#include <linux/reboot.h>22#include <linux/kdev_t.h>23#include <linux/types.h>24#include <linux/major.h>25#include <linux/blkdev.h>26#include <linux/console.h>27#include <linux/delay.h>28#include <linux/stringify.h>29#include <linux/notifier.h>3031#include <asm/platform.h>32#include <asm/bootparam.h>333435void __init platform_init(bp_tag_t* bootparam)36{3738}3940void platform_halt(void)41{42printk (" ** Called platform_halt(), looping forever! **\n");43while (1);44}4546void platform_power_off(void)47{48printk (" ** Called platform_power_off(), looping forever! **\n");49while (1);50}51void platform_restart(void)52{53/* Flush and reset the mmu, simulate a processor reset, and54* jump to the reset vector. */5556__asm__ __volatile__("movi a2, 15\n\t"57"wsr a2, " __stringify(ICOUNTLEVEL) "\n\t"58"movi a2, 0\n\t"59"wsr a2, " __stringify(ICOUNT) "\n\t"60"wsr a2, " __stringify(IBREAKENABLE) "\n\t"61"wsr a2, " __stringify(LCOUNT) "\n\t"62"movi a2, 0x1f\n\t"63"wsr a2, " __stringify(PS) "\n\t"64"isync\n\t"65"jx %0\n\t"66:67: "a" (XCHAL_RESET_VECTOR_VADDR)68: "a2");6970/* control never gets here */71}7273extern void iss_net_poll(void);7475const char twirl[]="|/-\\|/-\\";7677void platform_heartbeat(void)78{79#if 080static int i = 0, j = 0;8182if (--i < 0) {83i = 99;84printk("\r%c\r", twirl[j++]);85if (j == 8)86j = 0;87}88#endif89}90919293static int94iss_panic_event(struct notifier_block *this, unsigned long event, void *ptr)95{96__asm__ __volatile__("movi a2, -1; simcall\n");97return NOTIFY_DONE;98}99100static struct notifier_block iss_panic_block = {101iss_panic_event,102NULL,1030104};105106void __init platform_setup(char **p_cmdline)107{108atomic_notifier_chain_register(&panic_notifier_list, &iss_panic_block);109}110111112