]> git.zerfleddert.de Git - ms2-kexec/blame - boot_usb.c
update offsets to new european GB kernel, set software booting from USB
[ms2-kexec] / boot_usb.c
CommitLineData
981f7356
MG
1/*
2 * Set software booting from USB
3 *
4 * From:
5 * http://www.droid-developers.org/wiki/How_to_load_mbmloader_from_SD_card
6 */
7
8#include <linux/module.h>
9#include <linux/gpio_mapping.h>
10#include <linux/gpio.h>
11#include <linux/platform_device.h>
12#include <linux/serial_reg.h>
13#include <linux/clk.h>
14
15#include <plat/board.h>
16#include <plat/control.h>
17#include <asm/mach/serial_omap.h>
18
19#include "prm.h"
20#include "prm-regbits-34xx.h"
21
22#define SCRATCH_MEM 0x48002910
23#define GLOBAL_REG_PRM 0x48307200
24
25static int __init boot_usb_init(void)
26{
27 void *scratch_mem, *global_reg_prm;
28
29 scratch_mem = ioremap(SCRATCH_MEM, 240);
30 global_reg_prm = ioremap(GLOBAL_REG_PRM, 256);
31
32 // Disable IRQ
33 local_irq_disable();
34 local_fiq_disable();
35
36 // Store address of booting configuration structure
37 __raw_writel(SCRATCH_MEM+0xA0, scratch_mem + 0);
38
39 // Header of booting config
40 __raw_writel(0xCF00AA01, scratch_mem + 0xA0);
41 // Size of booting config
42 __raw_writel(0xC, scratch_mem + 0xA4);
43 // First booting device is 0x11 (USB), Flags 0x00
44 __raw_writel(0x00110000, scratch_mem + 0xA8);
45 // Second is 0x11, third is 0x11
46 __raw_writel(0x00110011, scratch_mem + 0xAC);
47 // Fourth is 0x11
48 __raw_writel(0x00000011, scratch_mem + 0xB0);
49
50 // software reset
51 __raw_writel(0x04, global_reg_prm + 0x50);
52 return 0;
53}
54
55static void __exit boot_usb_exit(void)
56{
57 return;
58}
59
60
61module_init(boot_usb_init);
62module_exit(boot_usb_exit);
63
64MODULE_LICENSE("GPL");
65MODULE_AUTHOR("Michael Gernoth <michael@gernoth.net>");
Impressum, Datenschutz