This source file includes following definitions.
- omap_detect_and_map_sram
- omap_sram_reprogram_clock
- omap_sram_init
1
2
3
4
5
6
7
8
9 #include <linux/module.h>
10 #include <linux/kernel.h>
11 #include <linux/init.h>
12 #include <linux/io.h>
13
14 #include <asm/fncpy.h>
15 #include <asm/tlb.h>
16 #include <asm/cacheflush.h>
17
18 #include <asm/mach/map.h>
19
20 #include "soc.h"
21 #include "sram.h"
22
23 #define OMAP1_SRAM_PA 0x20000000
24 #define SRAM_BOOTLOADER_SZ 0x80
25
26
27
28
29
30
31
32 static void __init omap_detect_and_map_sram(void)
33 {
34 unsigned long omap_sram_skip = SRAM_BOOTLOADER_SZ;
35 unsigned long omap_sram_start = OMAP1_SRAM_PA;
36 unsigned long omap_sram_size;
37
38 if (cpu_is_omap7xx())
39 omap_sram_size = 0x32000;
40 else if (cpu_is_omap15xx())
41 omap_sram_size = 0x30000;
42 else if (cpu_is_omap1610() || cpu_is_omap1611() ||
43 cpu_is_omap1621() || cpu_is_omap1710())
44 omap_sram_size = 0x4000;
45 else {
46 pr_err("Could not detect SRAM size\n");
47 omap_sram_size = 0x4000;
48 }
49
50 omap_map_sram(omap_sram_start, omap_sram_size,
51 omap_sram_skip, 1);
52 }
53
54 static void (*_omap_sram_reprogram_clock)(u32 dpllctl, u32 ckctl);
55
56 void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl)
57 {
58 BUG_ON(!_omap_sram_reprogram_clock);
59
60 if (cpu_is_omap7xx())
61 ckctl |= 0x2000;
62 _omap_sram_reprogram_clock(dpllctl, ckctl);
63 }
64
65 int __init omap_sram_init(void)
66 {
67 omap_detect_and_map_sram();
68 _omap_sram_reprogram_clock =
69 omap_sram_push(omap1_sram_reprogram_clock,
70 omap1_sram_reprogram_clock_sz);
71
72 return 0;
73 }