Sascha Hauer | 198016e | 2009-02-06 15:38:22 +0100 | [diff] [blame] | 1 | |
| 2 | #include <linux/module.h> |
Fabio Estevam | bb07d75 | 2012-02-29 10:28:08 -0300 | [diff] [blame] | 3 | #include <linux/io.h> |
Fabio Estevam | 059e58f | 2011-08-26 13:35:18 +0800 | [diff] [blame] | 4 | #include <mach/hardware.h> |
Sascha Hauer | 198016e | 2009-02-06 15:38:22 +0100 | [diff] [blame] | 5 | |
| 6 | unsigned int __mxc_cpu_type; |
| 7 | EXPORT_SYMBOL(__mxc_cpu_type); |
| 8 | |
| 9 | void mxc_set_cpu_type(unsigned int type) |
| 10 | { |
| 11 | __mxc_cpu_type = type; |
| 12 | } |
| 13 | |
Fabio Estevam | 059e58f | 2011-08-26 13:35:18 +0800 | [diff] [blame] | 14 | void imx_print_silicon_rev(const char *cpu, int srev) |
| 15 | { |
| 16 | if (srev == IMX_CHIP_REVISION_UNKNOWN) |
| 17 | pr_info("CPU identified as %s, unknown revision\n", cpu); |
| 18 | else |
| 19 | pr_info("CPU identified as %s, silicon rev %d.%d\n", |
| 20 | cpu, (srev >> 4) & 0xf, srev & 0xf); |
| 21 | } |
Fabio Estevam | bb07d75 | 2012-02-29 10:28:08 -0300 | [diff] [blame] | 22 | |
| 23 | void __init imx_set_aips(void __iomem *base) |
| 24 | { |
| 25 | unsigned int reg; |
| 26 | /* |
| 27 | * Set all MPROTx to be non-bufferable, trusted for R/W, |
| 28 | * not forced to user-mode. |
| 29 | */ |
| 30 | __raw_writel(0x77777777, base + 0x0); |
| 31 | __raw_writel(0x77777777, base + 0x4); |
| 32 | |
| 33 | /* |
| 34 | * Set all OPACRx to be non-bufferable, to not require |
| 35 | * supervisor privilege level for access, allow for |
| 36 | * write access and untrusted master access. |
| 37 | */ |
| 38 | __raw_writel(0x0, base + 0x40); |
| 39 | __raw_writel(0x0, base + 0x44); |
| 40 | __raw_writel(0x0, base + 0x48); |
| 41 | __raw_writel(0x0, base + 0x4C); |
| 42 | reg = __raw_readl(base + 0x50) & 0x00FFFFFF; |
| 43 | __raw_writel(reg, base + 0x50); |
| 44 | } |