-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sh: add romImage MMCIF boot for sh7724 and Ecovec V2
This patch is V2 of the MMCIF romImage boot support for sh7724 and the Ecovec board. With this patch applied and CONFIG_ROMIMAGE_MMCIF selected the romImage kernel image can be written to a MMC card and booted directly by the sh7724 cpu. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
- Loading branch information
Magnus Damm
authored and
Paul Mundt
committed
May 31, 2010
1 parent
8a76895
commit 4705b2e
Showing
9 changed files
with
171 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* sh7724 MMCIF loader | ||
* | ||
* Copyright (C) 2010 Magnus Damm | ||
* | ||
* 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. | ||
*/ | ||
|
||
#include <linux/mmc/sh_mmcif.h> | ||
#include <mach/romimage.h> | ||
|
||
#define MMCIF_BASE (void __iomem *)0xa4ca0000 | ||
|
||
#define MSTPCR2 0xa4150038 | ||
#define PTWCR 0xa4050146 | ||
#define PTXCR 0xa4050148 | ||
#define PSELA 0xa405014e | ||
#define PSELE 0xa4050156 | ||
#define HIZCRC 0xa405015c | ||
#define DRVCRA 0xa405018a | ||
|
||
enum { MMCIF_PROGRESS_ENTER, MMCIF_PROGRESS_INIT, | ||
MMCIF_PROGRESS_LOAD, MMCIF_PROGRESS_DONE }; | ||
|
||
/* SH7724 specific MMCIF loader | ||
* | ||
* loads the romImage from an MMC card starting from block 512 | ||
* use the following line to write the romImage to an MMC card | ||
* # dd if=arch/sh/boot/romImage of=/dev/sdx bs=512 seek=512 | ||
*/ | ||
asmlinkage void mmcif_loader(unsigned char *buf, unsigned long no_bytes) | ||
{ | ||
mmcif_update_progress(MMCIF_PROGRESS_ENTER); | ||
|
||
/* enable clock to the MMCIF hardware block */ | ||
__raw_writel(__raw_readl(MSTPCR2) & ~0x20000000, MSTPCR2); | ||
|
||
/* setup pins D7-D0 */ | ||
__raw_writew(0x0000, PTWCR); | ||
|
||
/* setup pins MMC_CLK, MMC_CMD */ | ||
__raw_writew(__raw_readw(PTXCR) & ~0x000f, PTXCR); | ||
|
||
/* select D3-D0 pin function */ | ||
__raw_writew(__raw_readw(PSELA) & ~0x2000, PSELA); | ||
|
||
/* select D7-D4 pin function */ | ||
__raw_writew(__raw_readw(PSELE) & ~0x3000, PSELE); | ||
|
||
/* disable Hi-Z for the MMC pins */ | ||
__raw_writew(__raw_readw(HIZCRC) & ~0x0620, HIZCRC); | ||
|
||
/* high drive capability for MMC pins */ | ||
__raw_writew(__raw_readw(DRVCRA) | 0x3000, DRVCRA); | ||
|
||
mmcif_update_progress(MMCIF_PROGRESS_INIT); | ||
|
||
/* setup MMCIF hardware */ | ||
sh_mmcif_boot_init(MMCIF_BASE); | ||
|
||
mmcif_update_progress(MMCIF_PROGRESS_LOAD); | ||
|
||
/* load kernel via MMCIF interface */ | ||
sh_mmcif_boot_slurp(MMCIF_BASE, buf, no_bytes); | ||
|
||
/* disable clock to the MMCIF hardware block */ | ||
__raw_writel(__raw_readl(MSTPCR2) | 0x20000000, MSTPCR2); | ||
|
||
mmcif_update_progress(MMCIF_PROGRESS_DONE); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,6 @@ SECTIONS | |
.text : { | ||
zero_page_pos = .; | ||
*(.data) | ||
end_data = .; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,11 @@ | ||
#ifdef __ASSEMBLY__ | ||
|
||
/* do nothing here by default */ | ||
|
||
#else /* __ASSEMBLY__ */ | ||
|
||
extern inline void mmcif_update_progress(int nr) | ||
{ | ||
} | ||
|
||
#endif /* __ASSEMBLY__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters