blob: e0dcbc201f32fe6fa34f6fbece7d92cd4cfa9903 [file] [log] [blame]
wdenk5c952cf2004-10-10 21:27:30 +00001/*
2 * (C) Copyright 2004, Psyent Corporation <www.psyent.com>
3 * Scott McNutt <smcnutt@psyent.com>
4 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
wdenk5c952cf2004-10-10 21:27:30 +00006 */
7
8#include <common.h>
9#include <nios2.h>
10#include <nios2-io.h>
Joachim Foersterf956ad92011-10-20 10:28:10 +020011#include <asm/cache.h>
wdenk5c952cf2004-10-10 21:27:30 +000012
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020013#if defined (CONFIG_SYS_NIOS_SYSID_BASE)
wdenk0c1c117c2005-03-30 23:28:18 +000014extern void display_sysid (void);
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020015#endif /* CONFIG_SYS_NIOS_SYSID_BASE */
wdenk5c952cf2004-10-10 21:27:30 +000016
17int checkcpu (void)
18{
19 printf ("CPU : Nios-II\n");
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020020#if !defined(CONFIG_SYS_NIOS_SYSID_BASE)
wdenk5c952cf2004-10-10 21:27:30 +000021 printf ("SYSID : <unknown>\n");
22#else
wdenk0c1c117c2005-03-30 23:28:18 +000023 display_sysid ();
wdenk5c952cf2004-10-10 21:27:30 +000024#endif
25 return (0);
26}
27
Mike Frysinger882b7d72010-10-20 03:41:17 -040028int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
wdenk5c952cf2004-10-10 21:27:30 +000029{
Thomas Chou7a6a7d12010-08-16 10:49:44 +080030 disable_interrupts();
31 /* indirect call to go beyond 256MB limitation of toolchain */
32 nios2_callr(CONFIG_SYS_RESET_ADDR);
33 return 0;
wdenk5c952cf2004-10-10 21:27:30 +000034}
Joachim Foersterf956ad92011-10-20 10:28:10 +020035
36int dcache_status(void)
37{
38 return 1;
39}
40
41void dcache_enable(void)
42{
43 flush_dcache(CONFIG_SYS_DCACHE_SIZE, CONFIG_SYS_DCACHELINE_SIZE);
44}
45
46void dcache_disable(void)
47{
48 flush_dcache(CONFIG_SYS_DCACHE_SIZE, CONFIG_SYS_DCACHELINE_SIZE);
49}