Will Robertson | 383a32a | 2007-12-23 03:47:28 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
| 8 | * $Id$ |
| 9 | * |
| 10 | * Copyright (C) 2007 by Will Robertson |
| 11 | * |
Daniel Stenberg | 2acc0ac | 2008-06-28 18:10:04 +0000 | [diff] [blame^] | 12 | * This program is free software; you can redistribute it and/or |
| 13 | * modify it under the terms of the GNU General Public License |
| 14 | * as published by the Free Software Foundation; either version 2 |
| 15 | * of the License, or (at your option) any later version. |
Will Robertson | 383a32a | 2007-12-23 03:47:28 +0000 | [diff] [blame] | 16 | * |
| 17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 18 | * KIND, either express or implied. |
| 19 | * |
| 20 | ****************************************************************************/ |
Will Robertson | 590501c | 2007-09-21 15:51:53 +0000 | [diff] [blame] | 21 | #include "cpu.h" |
Will Robertson | 383a32a | 2007-12-23 03:47:28 +0000 | [diff] [blame] | 22 | #include "mmu-imx31.h" |
| 23 | #include "mmu-arm.h" |
Will Robertson | 590501c | 2007-09-21 15:51:53 +0000 | [diff] [blame] | 24 | |
| 25 | void memory_init(void) { |
Michael Sevakis | 1f021af | 2008-02-05 04:43:19 +0000 | [diff] [blame] | 26 | #if 0 |
Will Robertson | 383a32a | 2007-12-23 03:47:28 +0000 | [diff] [blame] | 27 | ttb_init(); |
Will Robertson | 590501c | 2007-09-21 15:51:53 +0000 | [diff] [blame] | 28 | set_page_tables(); |
| 29 | enable_mmu(); |
Michael Sevakis | 1f021af | 2008-02-05 04:43:19 +0000 | [diff] [blame] | 30 | #endif |
Will Robertson | 590501c | 2007-09-21 15:51:53 +0000 | [diff] [blame] | 31 | } |
| 32 | |
Will Robertson | 590501c | 2007-09-21 15:51:53 +0000 | [diff] [blame] | 33 | void set_page_tables() { |
Michael Sevakis | 1f021af | 2008-02-05 04:43:19 +0000 | [diff] [blame] | 34 | #if 0 |
Will Robertson | 590501c | 2007-09-21 15:51:53 +0000 | [diff] [blame] | 35 | map_section(0, 0, 0x1000, CACHE_NONE); /* map every memory region to itself */ |
Will Robertson | 383a32a | 2007-12-23 03:47:28 +0000 | [diff] [blame] | 36 | /*This pa *might* change*/ |
Will Robertson | 590501c | 2007-09-21 15:51:53 +0000 | [diff] [blame] | 37 | map_section(0x80000000, 0, 64, CACHE_ALL); /* map RAM to 0 and enable caching for it */ |
| 38 | map_section((int)FRAME1, (int)FRAME1, 1, BUFFERED); /* enable buffered writing for the framebuffer */ |
Will Robertson | 383a32a | 2007-12-23 03:47:28 +0000 | [diff] [blame] | 39 | map_section((int)FRAME2, (int)FRAME2, 1, BUFFERED); |
Michael Sevakis | 1f021af | 2008-02-05 04:43:19 +0000 | [diff] [blame] | 40 | #endif |
Will Robertson | 590501c | 2007-09-21 15:51:53 +0000 | [diff] [blame] | 41 | } |
| 42 | |