diff options
Diffstat (limited to 'meta/packages/uboot/u-boot-mkimage-openmoko-native/mmcinit-power-up.patch')
-rw-r--r-- | meta/packages/uboot/u-boot-mkimage-openmoko-native/mmcinit-power-up.patch | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/meta/packages/uboot/u-boot-mkimage-openmoko-native/mmcinit-power-up.patch b/meta/packages/uboot/u-boot-mkimage-openmoko-native/mmcinit-power-up.patch new file mode 100644 index 0000000000..fcf54b9fd1 --- /dev/null +++ b/meta/packages/uboot/u-boot-mkimage-openmoko-native/mmcinit-power-up.patch | |||
@@ -0,0 +1,73 @@ | |||
1 | board/neo1973/neo1973.c (board_late_init): moved MMC power-up to separate | ||
2 | function | ||
3 | cpu/arm920t/s3c24x0/mmc.c (mmc_init): call mmc_power_up and return -ENODEV | ||
4 | immediately if there is no card | ||
5 | |||
6 | - Werner Almesberger <werner@openmoko.org> | ||
7 | |||
8 | Index: u-boot/board/neo1973/neo1973.c | ||
9 | =================================================================== | ||
10 | --- u-boot.orig/board/neo1973/neo1973.c | ||
11 | +++ u-boot/board/neo1973/neo1973.c | ||
12 | @@ -223,6 +223,19 @@ int board_init (void) | ||
13 | return 0; | ||
14 | } | ||
15 | |||
16 | +int mmc_power_up(void) | ||
17 | +{ | ||
18 | +#if defined(CONFIG_ARCH_GTA01B_v4) | ||
19 | + S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO(); | ||
20 | + | ||
21 | + /* check if sd card is inserted, and power-up if it is */ | ||
22 | + if (gpio->GPFDAT & (1 << 5)) | ||
23 | + return 0; | ||
24 | + gpio->GPBDAT &= ~(1 << 2); | ||
25 | +#endif /* !CONFIG_ARCH_GTA01B_v4 */ | ||
26 | + return 1; | ||
27 | +} | ||
28 | + | ||
29 | int board_late_init(void) | ||
30 | { | ||
31 | unsigned char tmp; | ||
32 | @@ -289,14 +302,8 @@ continue_boot: | ||
33 | /* switch on the backlight */ | ||
34 | neo1973_backlight(1); | ||
35 | |||
36 | -#if defined(CONFIG_ARCH_GTA01B_v4) | ||
37 | - { | ||
38 | - /* check if sd card is inserted, and power-up if it is */ | ||
39 | - S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO(); | ||
40 | - if (!(gpio->GPFDAT & (1 << 5))) | ||
41 | - gpio->GPBDAT &= ~(1 << 2); | ||
42 | - } | ||
43 | -#endif | ||
44 | + /* check if sd card is inserted, and power-up if it is */ | ||
45 | + mmc_power_up(); | ||
46 | |||
47 | return 0; | ||
48 | } | ||
49 | Index: u-boot/cpu/arm920t/s3c24x0/mmc.c | ||
50 | =================================================================== | ||
51 | --- u-boot.orig/cpu/arm920t/s3c24x0/mmc.c | ||
52 | +++ u-boot/cpu/arm920t/s3c24x0/mmc.c | ||
53 | @@ -381,6 +381,11 @@ static void print_sd_cid(const struct sd | ||
54 | cid->crc >> 1, cid->crc & 1); | ||
55 | } | ||
56 | |||
57 | +int __attribute__((weak)) mmc_power_up(void) | ||
58 | +{ | ||
59 | + return 1; | ||
60 | +} | ||
61 | + | ||
62 | int mmc_init(int verbose) | ||
63 | { | ||
64 | int retries, rc = -ENODEV; | ||
65 | @@ -393,6 +398,8 @@ int mmc_init(int verbose) | ||
66 | debug("mmc_init(PCLK=%u)\n", get_PCLK()); | ||
67 | |||
68 | clk_power->CLKCON |= (1 << 9); | ||
69 | + if (!mmc_power_up()) | ||
70 | + return -ENODEV; | ||
71 | |||
72 | /* S3C2410 has some bug that prevents reliable operation at higher speed */ | ||
73 | //sdi->SDIPRE = 0x3e; /* SDCLK = PCLK/2 / (SDIPRE+1) = 396kHz */ | ||