• Home
  • Help
  • Search
  • Login
  • Register
Pages: 1 [2] 3 4
Author Topic: MMC/SD support in u-boot  (Read 62145 times)
Benit0
Newbie
*

Karma: 0
Posts: 7


View Profile
« Reply #15 on: May 06, 2009, 09:47:28 AM »

Hi,

Trying your last steps I get:
Code:
make[1]: Leaving directory `/mnt/sda/SOURCES/srctrack/tmp/SheevaPlug_U-Boot/SheevaPlug_U-Boot/Sources/u-boot-3.4.16/common'
UNDEF_SYM=`arm-linux-gnueabi-objdump -x lib_generic/libgeneric.a board/mv_feroceon/config_kw/libconfig_kw.a cpu/arm926ejs/libarm926ejs.a lib_arm/libarm.a fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a net/libnet.a disk/libdisk.a rtc/librtc.a dtt/libdtt.a drivers/libdrivers.a drivers/nand/libnand.a drivers/usb/libusb.a drivers/sk98lin/libsk98lin.a post/libpost.a post/cpu/libcpu.a common/libcommon.a |sed  -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
                arm-linux-gnueabi-ld -Bstatic -T /home/zumbi/SOURCES/tmp/SheevaPlug_U-Boot/SheevaPlug_U-Boot/Sources/u-boot-3.4.16/board/mv_feroceon/config_kw/u-boot.lds -Ttext 0x00600000  $UNDEF_SYM cpu/arm926ejs/start.o \
                        --start-group lib_generic/libgeneric.a board/mv_feroceon/config_kw/libconfig_kw.a cpu/arm926ejs/libarm926ejs.a lib_arm/libarm.a fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a net/libnet.a disk/libdisk.a rtc/librtc.a dtt/libdtt.a drivers/libdrivers.a drivers/nand/libnand.a drivers/usb/libusb.a drivers/sk98lin/libsk98lin.a post/libpost.a post/cpu/libcpu.a common/libcommon.a --end-group -L /usr/lib/gcc/arm-linux-gnueabi/4.3.3 -lgcc \
                        -Map u-boot.map -o u-boot
common/libcommon.a(cmd_cache.o): In function `do_dcache':
/mnt/sda/SOURCES/srctrack/tmp/SheevaPlug_U-Boot/SheevaPlug_U-Boot/Sources/u-boot-3.4.16/common/cmd_cache.c:71: undefined reference to `dcache_enable'
make: *** [u-boot] Error 1
Logged

philipl
Newbie
*

Karma: 0
Posts: 22


View Profile
« Reply #16 on: May 06, 2009, 07:10:38 PM »

Did you use the Marvell toolchain? This build seems to be very sensitive to the particular toolchain you use. I tried with the codesourcery one and got all sorts of weird errors.

I notice you error says "arm-linux-gnueabi-objdump"

but if you were using the Marvell toolchain I'd expect to see "arm-none-linux-gnueabi-objdump"

Logged

kwonsk
Newbie
*

Karma: 0
Posts: 11


View Profile
« Reply #17 on: May 06, 2009, 08:04:10 PM »

"undefined reference dcache_enable" is expected result.  I've added cache control command in "mv_kw.h" for mmc test.
Just add following function in cpu/arm926ejs/cpu.c (I don't know why this funcion is missing).

void dcache_enable(void)
{
  u_long reg;
  reg = read_p15_c1();
  cp_delay();
  write_p15_c1(reg | C1_DC);
}

kwonsk.
Logged

theRealBigP
Newbie
*

Karma: 0
Posts: 22


View Profile
« Reply #18 on: May 07, 2009, 06:56:19 PM »

kwonsk, I tried following the directions in a previous post you made, but at step 8, I get the following error:

Code:
make[1]: Entering directory `/home/paragchandra/SheevaPlug/SheevaPlug_U-Boot/Sources/u-boot-3.4.16-modified/post'
arm-none-linux-gnueabi-gcc -Wa,-gstabs -D__ASSEMBLY__ -g  -Os   -fno-strict-aliasing  -fno-common -ffixed-r8 -msoft-float -D__KERNEL__ -DTEXT_BASE=0x00600000 -I/home/paragchandra/SheevaPlug/SheevaPlug_U-Boot/Sources/u-boot-3.4.16-modified/include -fno-builtin -ffreestanding -nostdinc -isystem /home/paragchandra/SheevaPlug/LinuxHost/gcc/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.1/include -pipe  -DCONFIG_ARM -D__ARM__ -march=armv5t -g  -Os   -fno-strict-aliasing  -fno-common -ffixed-r8 -msoft-float -D__KERNEL__ -DTEXT_BASE=0x00600000 -I/home/paragchandra/SheevaPlug/SheevaPlug_U-Boot/Sources/u-boot-3.4.16-modified/include -fno-builtin -ffreestanding -nostdinc -isystem /home/paragchandra/SheevaPlug/LinuxHost/gcc/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.1/include -pipe  -DCONFIG_ARM -D__ARM__ -march=armv5t -c -o cache_8xx.o cache_8xx.S
In file included from /home/paragchandra/SheevaPlug/SheevaPlug_U-Boot/Sources/u-boot-3.4.16-modified/include/configs/mv_kw.h:34,
                 from /home/paragchandra/SheevaPlug/SheevaPlug_U-Boot/Sources/u-boot-3.4.16-modified/include/config.h:2,
                 from cache_8xx.S:23:
/home/paragchandra/SheevaPlug/SheevaPlug_U-Boot/Sources/u-boot-3.4.16-modified/include/configs/../../board/mv_feroceon/mv_kw/mvSysHwConfig.h:306:2: error: #error "MV_BOOTSIZE undefined"

I'm not sure what to set this to; any ideas why it isn't defined in the first place? Thanks.
Logged

Gothnet
Newbie
*

Karma: 0
Posts: 33


View Profile
« Reply #19 on: May 09, 2009, 03:52:05 PM »

Hi,all
Recently I finished SD(SDHC) card support for SheevaDev u-boot (based on u-boot-3.4.16).
I could successfuly "mmcinit" and "fatls,fatload..." with my 4G SDHC, 1G SD cards. Performance is
really nice, load 3MB uImage within 2 seconds.
Attached files are sources for SD support (fat.h, fat.c must be updated, there was bugfixes. u-boo-1.1.4 is too old).
Well, you also enable MMC/FAT support in the include/configs/mv_kw.h file.
(I could'nt use file attachment option in firefox. submit post with file attachment shows some errors and post fails
 Is this know problem?).


Hi there,

I've just flashed your custom u-boot and I can get mmcinit working with one of my cards (Patriot 16GB class 6 SDHC). The other one (Kingston 2GB MMCmobile) doesn't seem to be detected.

So how do I use it?

What I'd really like is to get it to boot the kernel from an ext2 partition, but I'm not quite sure what boot arguments to use.

How did you get it to boot from fat?

Thanks.
Logged

Gothnet
Newbie
*

Karma: 0
Posts: 33


View Profile
« Reply #20 on: May 09, 2009, 05:01:11 PM »

I've got a little further now, though I still have problems.

Firstly, I'm attempting to use a debian image. The uImage and uInitrd are in the boot subdirectory and it seems that the uBoot ext2 functions can't read those properly. It didn't like symlinks to the real files either, so I had to copy them.

Next problem is that after the kernel's booted there's no sd* or mmcblk devices available, so I have no idea how I'm  going to get the root filesystem mounted either .... but I guess that's not a uboot problem.
Logged

kwonsk
Newbie
*

Karma: 0
Posts: 11


View Profile
« Reply #21 on: May 09, 2009, 09:54:19 PM »

Hi theRealBigP.
My guess is you missed step7.
7) make rd88f6281Sheevaplug_config NBOOT=1
Because your compile message didnot shows Sheevaplug related defines like -DMV88F6281. You might check
Makefile and search "Sheevaplug_config", then you could see compile time definisions for Sheevaplug like "-DMV_BOOTSIZE_16M".


Logged

Rabeeh Khoury
Administrator
Full Member
*****

Karma: 5
Posts: 218


View Profile
« Reply #22 on: May 10, 2009, 02:11:41 AM »

Just tried it on two SD cards -
Sandisk 128MB - works fine

Sandisk Extreme III 8GB SDHC card - doesn't detect the card -
Code:
Marvell>> mmcinit
Error! cmd : 8, err : 0201
Error! cmd : 1, err : 0201
Error! cmd : 1, err : 0201
Error! cmd : 1, err : 0201
Error! cmd : 1, err : 0201
Error! cmd : 1, err : 0201
Error! cmd : 1, err : 0201
Error! cmd : 1, err : 0201
Error! cmd : 1, err : 0201
Error! cmd : 1, err : 0201
Error! cmd : 1, err : 0201
No MMC card found
Logged

kwonsk
Newbie
*

Karma: 0
Posts: 11


View Profile
« Reply #23 on: May 11, 2009, 09:15:44 PM »

Sorry to hear that. But I could'nt buy all the SD cards you have.
You could make everybody happy (include me) if you could fix you problem and update mmc support codes.
I just read 88F6281 data sheet and codes in linux kernel and did some experiment with my cards in hands.
It just works for me, but I also admit there must be more test for robustness.
Thanks.
Logged

rc3
Newbie
*

Karma: 0
Posts: 36


View Profile
« Reply #24 on: May 12, 2009, 12:40:42 PM »

Hi kwonsk,
Newbie here. I'm trying to follow your instruction on compiling u-boot but I keep getting the following error
Quote
error: #error "MV_BOOTSIZE undefined"
I think that's because I'm missing step #6,
Quote
6) Copy attatched mv_kw.h to include/configs/mv_hw.h
. I've read through the whole discussion but just couldn't find mv_kw.h. Also you mentioned about your pre-built version of u-boot image. Would you please tell me where it's located? I wanted so much to boot my plug from a 2G SD card. Thank you in advance.

Edit: never mind. I found them now. I didn't know I had to login in order to get the download links.
« Last Edit: May 12, 2009, 01:49:49 PM by rc3 » Logged

Benit0
Newbie
*

Karma: 0
Posts: 7


View Profile
« Reply #25 on: May 12, 2009, 03:31:16 PM »

"undefined reference dcache_enable" is expected result.  I've added cache control command in "mv_kw.h" for mmc test.
Just add following function in cpu/arm926ejs/cpu.c (I don't know why this funcion is missing).

void dcache_enable(void)
{
  u_long reg;
  reg = read_p15_c1();
  cp_delay();
  write_p15_c1(reg | C1_DC);
}


Yes, this made it compiles fine Smiley
But when trying to flash new u-boot.bin image with bubt,

Code:

Marvell>> bubt
using default file "u-boot.bin"
Using egiga0 device
TFTP from server 192.168.0.20; our IP address is 192.168.0.35
Filename 'u-boot.bin'.
Load address: 0x2000000
Loading: #################################################################
         ###########################
done
Bytes transferred = 470404 (72d84 hex)
Error! invalid image header checksum

Thanks
« Last Edit: May 12, 2009, 03:57:10 PM by Benit0 » Logged

Benit0
Newbie
*

Karma: 0
Posts: 7


View Profile
« Reply #26 on: May 12, 2009, 03:34:41 PM »

Hi,
Did you use the Marvell toolchain? This build seems to be very sensitive to the particular toolchain you use. I tried with the codesourcery one and got all sorts of weird errors.

I am using emdebian.org prebuilt armel toolchain for lenny, i have to tweak the Makefile to set the compiler.

Finally, it works great atm
Logged

kwonsk
Newbie
*

Karma: 0
Posts: 11


View Profile
« Reply #27 on: May 13, 2009, 03:04:11 AM »

After u-boot build, final image for bubt is "u-boot-rd88f6281Sheevaplug_400db_nand.bin" not "u-boot.bin".
Copy u-boot-rd88f6281Sheevaplug_400db_nand.bin as "u-boot.bin" and try to use bubt.
Logged

Benit0
Newbie
*

Karma: 0
Posts: 7


View Profile
« Reply #28 on: May 13, 2009, 03:44:27 PM »

After u-boot build, final image for bubt is "u-boot-rd88f6281Sheevaplug_400db_nand.bin" not "u-boot.bin".
Copy u-boot-rd88f6281Sheevaplug_400db_nand.bin as "u-boot.bin" and try to use bubt.

Yes, that is the way :-)
Is there another thread for mmcinit related issues and fixes? Or should keep doing progress on this thread?
Thanks

P.S.- Edit to contribute back
I have attached a diff file that applies to u-boot-1.1.4 sources tarball. It includes, marvell u-boot-3.4.16, sd.tgz, all files and patches discussed here, plus it tweaks Makefile to use arm-linux-gnu- cross compiler.

So, instructions to compile are
1) tar jxvf u-boot-1.1.4.tar.bz2
2) gzip -d u-boot-1.1.4-diff.patch.gz
3) cd u-boot-1.1.4; patch -p1 < ../u-boot-1.1.4-diff.patch
4) make rd88f6281Sheevaplug_config NBOOT=1
5) make clean; make -s
6) cp u-boot-rd88f6281Sheevaplug_400db_nand.bin /tftpboot/u-boot.bin
(WARN: That you need to use u-boot-rd88f6281Sheevaplug_400db_nand.bin)

Thanks, credit and work goes to Marvell, Denk, Debian, openplug community and specially to kwonsk.

* u-boot-1.1.4-diff.patch.gz (1684.54 KB - downloaded 425 times.)
« Last Edit: May 13, 2009, 04:16:45 PM by Benit0 » Logged

theRealBigP
Newbie
*

Karma: 0
Posts: 22


View Profile
« Reply #29 on: May 17, 2009, 07:14:01 PM »

I'm still unable to compile u-boot from source. I have confirmed that include/config.mk was generated correctly, because all the #defines needed for SheevaPlug are listed in that file, and if I delete it, make will fail with 'System not configured - see README'. Is everyone using the supplied Marvell cross-compiler, or should I be using a different one? I basically just extracted the contents of the Linux host support package and prepended  its gcc/bin directory to my path, so I believe gcc is able to locate all the ARM-specific versions of the toolchain. Yet every time I run make, it gives me the same error that I listed earlier in this thread: MV_BOOTSIZE undefined. It's as if it's not properly reading the config.mk file that was generated by the earlier step and appending the options listed therein. Can anyone who has successfully compiled u-boot tell me how they setup their cross-compiler? Thanks.
Logged

Pages: 1 [2] 3 4
Print
Jump to: