This source file includes following definitions.
- mmcif_loader
1
2
3
4
5
6
7
8
9
10
11 #include <linux/mmc/sh_mmcif.h>
12 #include <mach/romimage.h>
13
14 #define MMCIF_BASE (void __iomem *)0xa4ca0000
15
16 #define MSTPCR2 0xa4150038
17 #define PTWCR 0xa4050146
18 #define PTXCR 0xa4050148
19 #define PSELA 0xa405014e
20 #define PSELE 0xa4050156
21 #define HIZCRC 0xa405015c
22 #define DRVCRA 0xa405018a
23
24 enum {
25 MMCIF_PROGRESS_ENTER,
26 MMCIF_PROGRESS_INIT,
27 MMCIF_PROGRESS_LOAD,
28 MMCIF_PROGRESS_DONE
29 };
30
31
32
33
34
35
36
37 asmlinkage void mmcif_loader(unsigned char *buf, unsigned long no_bytes)
38 {
39 mmcif_update_progress(MMCIF_PROGRESS_ENTER);
40
41
42 __raw_writel(__raw_readl(MSTPCR2) & ~0x20000000, MSTPCR2);
43
44
45 __raw_writew(0x0000, PTWCR);
46
47
48 __raw_writew(__raw_readw(PTXCR) & ~0x000f, PTXCR);
49
50
51 __raw_writew(__raw_readw(PSELA) & ~0x2000, PSELA);
52
53
54 __raw_writew(__raw_readw(PSELE) & ~0x3000, PSELE);
55
56
57 __raw_writew(__raw_readw(HIZCRC) & ~0x0620, HIZCRC);
58
59
60 __raw_writew(__raw_readw(DRVCRA) | 0x3000, DRVCRA);
61
62 mmcif_update_progress(MMCIF_PROGRESS_INIT);
63
64
65 sh_mmcif_boot_init(MMCIF_BASE);
66
67 mmcif_update_progress(MMCIF_PROGRESS_LOAD);
68
69
70 sh_mmcif_boot_do_read(MMCIF_BASE, 512,
71 (no_bytes + SH_MMCIF_BBS - 1) / SH_MMCIF_BBS,
72 buf);
73
74
75 __raw_writel(__raw_readl(MSTPCR2) | 0x20000000, MSTPCR2);
76
77 mmcif_update_progress(MMCIF_PROGRESS_DONE);
78 }