]>
git.zerfleddert.de Git - ms2-kexec/blob - boot_usb.c
2 * Set software booting from USB
5 * http://www.droid-developers.org/wiki/How_to_load_mbmloader_from_SD_card
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>
15 #include <plat/board.h>
16 #include <plat/control.h>
17 #include <asm/mach/serial_omap.h>
20 #include "prm-regbits-34xx.h"
22 #define SCRATCH_MEM 0x48002910
23 #define GLOBAL_REG_PRM 0x48307200
25 static int __init
boot_usb_init(void)
27 void *scratch_mem
, *global_reg_prm
;
29 scratch_mem
= ioremap(SCRATCH_MEM
, 240);
30 global_reg_prm
= ioremap(GLOBAL_REG_PRM
, 256);
36 // Store address of booting configuration structure
37 __raw_writel(SCRATCH_MEM
+0xA0, scratch_mem
+ 0);
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);
48 __raw_writel(0x00000011, scratch_mem
+ 0xB0);
51 __raw_writel(0x04, global_reg_prm
+ 0x50);
55 static void __exit
boot_usb_exit(void)
61 module_init(boot_usb_init
);
62 module_exit(boot_usb_exit
);
64 MODULE_LICENSE("GPL");
65 MODULE_AUTHOR("Michael Gernoth <michael@gernoth.net>");