Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3f50c067 authored by Jesper Nilsson's avatar Jesper Nilsson
Browse files

CRIS v32: Update boot/rescue/head.S code.

- Add ifdef for ETRAX_AXISFLASHMAP to avoid compiling file unless it is set.
- Use assembler macros for setting up clocks.
- Don't copy image, just jump to it (only works for NOR flash)
parent a5d204bf
Loading
Loading
Loading
Loading
+15 −27
Original line number Diff line number Diff line
/* $Id: head.S,v 1.4 2004/11/01 16:10:28 starvik Exp $
/*
 * Just get started by jumping to CONFIG_ETRAX_PTABLE_SECTOR to start
 * kernel decompressor.
 *
 * In practice, this only works for NOR flash (or some convoluted RAM boot)
 * and hence is not really useful for Artpec-3, so it's Etrax FS / NOR only.
 *
 * This used to be the rescue code but now that is handled by the
 * RedBoot based RFL instead. Nothing to see here, move along.
 */

#include <asm/arch/hwregs/reg_map_asm.h>
#include <asm/arch/hwregs/config_defs_asm.h>
#include <mach/startup.inc>

	.text
#ifdef CONFIG_ETRAX_AXISFLASHMAP

	;; Start clocks for used blocks.
	move.d REG_ADDR(config, regi_config, rw_clk_ctrl), $r1
	move.d [$r1], $r0
	or.d   REG_STATE(config, rw_clk_ctrl, cpu, yes) | \
	       REG_STATE(config, rw_clk_ctrl, bif, yes) | \
	       REG_STATE(config, rw_clk_ctrl, fix_io, yes), $r0
	move.d $r0, [$r1]
;; Code

	;; Copy 68KB NAND flash to Internal RAM (if NAND boot)
	move.d 0x38004000, $r10
	move.d 0x8000, $r11
	move.d 0x11000, $r12
	move.d copy_complete, $r13
	and.d  0x000fffff, $r13
	or.d   0x38000000, $r13
	.text
start:

#include "../../lib/nand_init.S"
	;; Start clocks for used blocks.
	START_CLOCKS

	;; No NAND found
	move.d	CONFIG_ETRAX_PTABLE_SECTOR, $r10
	jump	$r10 ; Jump to decompresser
	jump	$r10			; Jump to decompressor
	nop

copy_complete:
	move.d	0x38000000 + CONFIG_ETRAX_PTABLE_SECTOR, $r10
	jump	$r10 ; Jump to decompresser
	nop
#endif