summaryrefslogtreecommitdiffstats
path: root/recipes/u-boot/u-boot-mkimage-openmoko-native/mmcinit-power-up.patch
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/u-boot/u-boot-mkimage-openmoko-native/mmcinit-power-up.patch
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
downloadopenembedded-709c4d66e0b107ca606941b988bad717c0b45d9b.tar.gz
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/u-boot/u-boot-mkimage-openmoko-native/mmcinit-power-up.patch')
-rw-r--r--recipes/u-boot/u-boot-mkimage-openmoko-native/mmcinit-power-up.patch73
1 files changed, 73 insertions, 0 deletions
diff --git a/recipes/u-boot/u-boot-mkimage-openmoko-native/mmcinit-power-up.patch b/recipes/u-boot/u-boot-mkimage-openmoko-native/mmcinit-power-up.patch
new file mode 100644
index 0000000000..fcf54b9fd1
--- /dev/null
+++ b/recipes/u-boot/u-boot-mkimage-openmoko-native/mmcinit-power-up.patch
@@ -0,0 +1,73 @@
+board/neo1973/neo1973.c (board_late_init): moved MMC power-up to separate
+ function
+cpu/arm920t/s3c24x0/mmc.c (mmc_init): call mmc_power_up and return -ENODEV
+ immediately if there is no card
+
+- Werner Almesberger <werner@openmoko.org>
+
+Index: u-boot/board/neo1973/neo1973.c
+===================================================================
+--- u-boot.orig/board/neo1973/neo1973.c
++++ u-boot/board/neo1973/neo1973.c
+@@ -223,6 +223,19 @@ int board_init (void)
+ return 0;
+ }
+
++int mmc_power_up(void)
++{
++#if defined(CONFIG_ARCH_GTA01B_v4)
++ S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO();
++
++ /* check if sd card is inserted, and power-up if it is */
++ if (gpio->GPFDAT & (1 << 5))
++ return 0;
++ gpio->GPBDAT &= ~(1 << 2);
++#endif /* !CONFIG_ARCH_GTA01B_v4 */
++ return 1;
++}
++
+ int board_late_init(void)
+ {
+ unsigned char tmp;
+@@ -289,14 +302,8 @@ continue_boot:
+ /* switch on the backlight */
+ neo1973_backlight(1);
+
+-#if defined(CONFIG_ARCH_GTA01B_v4)
+- {
+- /* check if sd card is inserted, and power-up if it is */
+- S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO();
+- if (!(gpio->GPFDAT & (1 << 5)))
+- gpio->GPBDAT &= ~(1 << 2);
+- }
+-#endif
++ /* check if sd card is inserted, and power-up if it is */
++ mmc_power_up();
+
+ return 0;
+ }
+Index: u-boot/cpu/arm920t/s3c24x0/mmc.c
+===================================================================
+--- u-boot.orig/cpu/arm920t/s3c24x0/mmc.c
++++ u-boot/cpu/arm920t/s3c24x0/mmc.c
+@@ -381,6 +381,11 @@ static void print_sd_cid(const struct sd
+ cid->crc >> 1, cid->crc & 1);
+ }
+
++int __attribute__((weak)) mmc_power_up(void)
++{
++ return 1;
++}
++
+ int mmc_init(int verbose)
+ {
+ int retries, rc = -ENODEV;
+@@ -393,6 +398,8 @@ int mmc_init(int verbose)
+ debug("mmc_init(PCLK=%u)\n", get_PCLK());
+
+ clk_power->CLKCON |= (1 << 9);
++ if (!mmc_power_up())
++ return -ENODEV;
+
+ /* S3C2410 has some bug that prevents reliable operation at higher speed */
+ //sdi->SDIPRE = 0x3e; /* SDCLK = PCLK/2 / (SDIPRE+1) = 396kHz */