Kuninori Morimoto | 9a4af11 | 2010-12-01 07:45:00 +0100 | [diff] [blame] | 1 | /* |
| 2 | * The head-file for SH-Mobile ARM platforms |
| 3 | * |
| 4 | * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> |
| 5 | * Simon Horman <horms@verge.net.au> |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; version 2 of the License. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 19 | */ |
| 20 | |
| 21 | #ifdef CONFIG_ZBOOT_ROM |
| 22 | |
| 23 | .section ".start", "ax" |
| 24 | |
| 25 | /* load board-specific initialization code */ |
| 26 | #include <mach/zboot.h> |
| 27 | |
Simon Horman | 090ab3f | 2011-04-26 06:29:53 +0100 | [diff] [blame] | 28 | #if defined(CONFIG_ZBOOT_ROM_MMCIF) || defined(CONFIG_ZBOOT_ROM_SH_MOBILE_SDHI) |
| 29 | /* Load image from MMC/SD */ |
| 30 | adr sp, __tmp_stack + 256 |
Simon Horman | f45b114 | 2011-01-11 04:01:08 +0100 | [diff] [blame] | 31 | ldr r0, __image_start |
| 32 | ldr r1, __image_end |
| 33 | subs r1, r1, r0 |
| 34 | ldr r0, __load_base |
Simon Horman | 090ab3f | 2011-04-26 06:29:53 +0100 | [diff] [blame] | 35 | bl mmc_loader |
Simon Horman | f45b114 | 2011-01-11 04:01:08 +0100 | [diff] [blame] | 36 | |
| 37 | /* Jump to loaded code */ |
| 38 | ldr r0, __loaded |
| 39 | ldr r1, __image_start |
| 40 | sub r0, r0, r1 |
| 41 | ldr r1, __load_base |
| 42 | add pc, r0, r1 |
| 43 | |
| 44 | __image_start: |
| 45 | .long _start |
| 46 | __image_end: |
| 47 | .long _got_end |
| 48 | __load_base: |
| 49 | .long CONFIG_MEMORY_START + 0x02000000 @ Load at 32Mb into SDRAM |
| 50 | __loaded: |
| 51 | .long __continue |
| 52 | .align |
| 53 | __tmp_stack: |
Simon Horman | 090ab3f | 2011-04-26 06:29:53 +0100 | [diff] [blame] | 54 | .space 256 |
Simon Horman | f45b114 | 2011-01-11 04:01:08 +0100 | [diff] [blame] | 55 | __continue: |
Simon Horman | 090ab3f | 2011-04-26 06:29:53 +0100 | [diff] [blame] | 56 | #endif /* CONFIG_ZBOOT_ROM_MMC || CONFIG_ZBOOT_ROM_SH_MOBILE_SDHI */ |
Simon Horman | f45b114 | 2011-01-11 04:01:08 +0100 | [diff] [blame] | 57 | |
Kuninori Morimoto | 9a4af11 | 2010-12-01 07:45:00 +0100 | [diff] [blame] | 58 | b 1f |
| 59 | __atags:@ tag #1 |
| 60 | .long 12 @ tag->hdr.size = tag_size(tag_core); |
| 61 | .long 0x54410001 @ tag->hdr.tag = ATAG_CORE; |
| 62 | .long 0 @ tag->u.core.flags = 0; |
| 63 | .long 0 @ tag->u.core.pagesize = 0; |
| 64 | .long 0 @ tag->u.core.rootdev = 0; |
| 65 | @ tag #2 |
| 66 | .long 8 @ tag->hdr.size = tag_size(tag_mem32); |
| 67 | .long 0x54410002 @ tag->hdr.tag = ATAG_MEM; |
| 68 | .long CONFIG_MEMORY_SIZE @ tag->u.mem.size = CONFIG_MEMORY_SIZE; |
| 69 | .long CONFIG_MEMORY_START @ @ tag->u.mem.start = CONFIG_MEMORY_START; |
| 70 | @ tag #3 |
| 71 | .long 0 @ tag->hdr.size = 0 |
| 72 | .long 0 @ tag->hdr.tag = ATAG_NONE; |
| 73 | 1: |
| 74 | |
| 75 | /* Set board ID necessary for boot */ |
| 76 | ldr r7, 1f @ Set machine type register |
| 77 | adr r8, __atags @ Set atag register |
| 78 | b 2f |
| 79 | |
| 80 | 1 : .long MACH_TYPE |
| 81 | 2 : |
| 82 | |
| 83 | #endif /* CONFIG_ZBOOT_ROM */ |