mirror of
https://github.com/Stichting-MINIX-Research-Foundation/u-boot.git
synced 2025-09-09 12:13:00 -04:00
[MIPS] Introduce _machine_restart
Handles machine specific functions by using weak functions. Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
This commit is contained in:
parent
decaba6f5c
commit
b0c66af53e
@ -26,9 +26,15 @@
|
|||||||
#include <asm/addrspace.h>
|
#include <asm/addrspace.h>
|
||||||
#include <asm/inca-ip.h>
|
#include <asm/inca-ip.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
|
#include <asm/reboot.h>
|
||||||
|
|
||||||
extern uint incaip_get_cpuclk(void);
|
extern uint incaip_get_cpuclk(void);
|
||||||
|
|
||||||
|
void _machine_restart(void)
|
||||||
|
{
|
||||||
|
*INCA_IP_WDT_RST_REQ = 0x3f;
|
||||||
|
}
|
||||||
|
|
||||||
static ulong max_sdram_size(void)
|
static ulong max_sdram_size(void)
|
||||||
{
|
{
|
||||||
/* The only supported SDRAM data width is 16bit.
|
/* The only supported SDRAM data width is 16bit.
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
#include <asm/addrspace.h>
|
#include <asm/addrspace.h>
|
||||||
#include <asm/cacheops.h>
|
#include <asm/cacheops.h>
|
||||||
|
#include <asm/reboot.h>
|
||||||
|
|
||||||
#include "sconsole.h"
|
#include "sconsole.h"
|
||||||
|
|
||||||
@ -52,6 +53,13 @@ extern int asc_serial_getc (void);
|
|||||||
extern int asc_serial_tstc (void);
|
extern int asc_serial_tstc (void);
|
||||||
extern void asc_serial_setbrg (void);
|
extern void asc_serial_setbrg (void);
|
||||||
|
|
||||||
|
void _machine_restart(void)
|
||||||
|
{
|
||||||
|
void (*f)(void) = (void *) 0xbfc00000;
|
||||||
|
|
||||||
|
f();
|
||||||
|
}
|
||||||
|
|
||||||
static void sdram_timing_init (ulong size)
|
static void sdram_timing_init (ulong size)
|
||||||
{
|
{
|
||||||
register uint pass;
|
register uint pass;
|
||||||
|
@ -12,10 +12,17 @@
|
|||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <command.h>
|
#include <command.h>
|
||||||
#include <asm/addrspace.h>
|
#include <asm/addrspace.h>
|
||||||
#include <asm/inca-ip.h>
|
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
|
#include <asm/reboot.h>
|
||||||
#include <pci.h>
|
#include <pci.h>
|
||||||
|
|
||||||
|
void _machine_restart(void)
|
||||||
|
{
|
||||||
|
void (*f)(void) = (void *) 0xbfc00000;
|
||||||
|
|
||||||
|
f();
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_PCI)
|
#if defined(CONFIG_PCI)
|
||||||
static struct pci_controller hose;
|
static struct pci_controller hose;
|
||||||
|
|
||||||
|
@ -23,9 +23,9 @@
|
|||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <command.h>
|
#include <command.h>
|
||||||
#include <asm/inca-ip.h>
|
|
||||||
#include <asm/mipsregs.h>
|
#include <asm/mipsregs.h>
|
||||||
#include <asm/cacheops.h>
|
#include <asm/cacheops.h>
|
||||||
|
#include <asm/reboot.h>
|
||||||
|
|
||||||
#define cache_op(op,addr) \
|
#define cache_op(op,addr) \
|
||||||
__asm__ __volatile__( \
|
__asm__ __volatile__( \
|
||||||
@ -37,15 +37,14 @@
|
|||||||
: \
|
: \
|
||||||
: "i" (op), "R" (*(unsigned char *)(addr)))
|
: "i" (op), "R" (*(unsigned char *)(addr)))
|
||||||
|
|
||||||
|
void __attribute__((weak)) _machine_restart(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_INCA_IP)
|
_machine_restart();
|
||||||
*INCA_IP_WDT_RST_REQ = 0x3f;
|
|
||||||
#elif defined(CONFIG_PURPLE) || defined(CONFIG_TB0229)
|
|
||||||
void (*f)(void) = (void *) 0xbfc00000;
|
|
||||||
|
|
||||||
f();
|
|
||||||
#endif
|
|
||||||
fprintf(stderr, "*** reset failed ***\n");
|
fprintf(stderr, "*** reset failed ***\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
14
include/asm-mips/reboot.h
Normal file
14
include/asm-mips/reboot.h
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
/*
|
||||||
|
* This file is subject to the terms and conditions of the GNU General Public
|
||||||
|
* License. See the file "COPYING" in the main directory of this archive
|
||||||
|
* for more details.
|
||||||
|
*
|
||||||
|
* Copyright (C) 1997, 1999, 2001, 06 by Ralf Baechle
|
||||||
|
* Copyright (C) 2001 MIPS Technologies, Inc.
|
||||||
|
*/
|
||||||
|
#ifndef _ASM_REBOOT_H
|
||||||
|
#define _ASM_REBOOT_H
|
||||||
|
|
||||||
|
extern void _machine_restart(void);
|
||||||
|
|
||||||
|
#endif /* _ASM_REBOOT_H */
|
Loading…
x
Reference in New Issue
Block a user