AnsweredAssumed Answered

p2020 boot from sd card

Question asked by wei zhou on Jan 2, 2016
Latest reply on Jan 4, 2016 by wei zhou

hi all:

My CPU is P2020,I want to boot from sd card,I use the P1020_P2020RDB_20101101_ltib software package,but no success,no message come from uart,I sure the communication between CPU and sd card is correct,the sd_clk,sd_cmd and sd_dat0 has wave from oscillograph,the flowing is my operation record:

 

[root@localhost u-boot-2009.11-cloud]# fdisk /dev/sdd

 

 

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to

         switch off the mode (command 'c') and change display units to

         sectors (command 'u').

 

 

Command (m for help): p

 

 

Disk /dev/sdd: 16.0 GB, 16021192704 bytes

64 heads, 32 sectors/track, 15279 cylinders

Units = cylinders of 2048 * 512 = 1048576 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sdd1   *           1          51       52208   83  Linux

/dev/sdd2              52       15279    15593472   83  Linux

 

Command action

   a   toggle a bootable flag

   b   edit bsd disklabel

   c   toggle the dos compatibility flag

   d   delete a partition

   l   list known partition types

   m   print this menu

   n   add a new partition

   o   create a new empty DOS partition table

   p   print the partition table

   q   quit without saving changes

   s   create a new empty Sun disklabel

   t   change a partition's system id

   u   change display/entry units

   v   verify the partition table

   w   write table to disk and exit

   x   extra functionality (experts only)

 

 

Command (m for help): q

 

 

[root@localhost u-boot-2009.11-cloud]# mkfs.vfat /dev/sdd1

mkfs.vfat 3.0.9 (31 Jan 2010)

 

[root@localhost u-boot-2009.11-cloud]# ./boot_format config_sram_p2020rdb.dat u-boot.bin -sd /dev/sdd

It is a little endian machine.

 

Read MBR from SDCard:

 

 

0x0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0040: 42 4f 4f 54 00 00 00 00 00 0a 1e 00 00 00 00 00

0x0050: 02 f1 0c 00 00 00 00 00 f8 f8 00 00 00 00 00 00

0x0060: f8 f8 00 00 00 00 00 00 00 00 00 06 00 00 00 00

0x0070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0080: ff 72 01 00 f8 f8 00 00 ff 72 0e 44 00 00 00 0c

0x0090: ff 72 00 00 80 01 00 00 ff 72 e4 0c 00 00 00 40

0x00a0: 40 00 00 01 00 00 01 00 80 00 00 01 80 00 00 01

0x00b0: ff 70 21 0c 0f c0 88 db ff 70 21 14 24 40 10 00

0x00c0: ff 70 21 18 00 04 08 30 ff 70 21 24 08 20 01 00

0x00d0: ff 70 21 30 02 80 00 00 40 00 00 01 00 00 01 00

0x00e0: ff 70 21 28 de ad be ef ff 70 21 10 c7 0c 00 00

0x00f0: ff 70 0c 08 00 00 00 00 ff 70 0d 70 80 f0 00 1d

0x0100: ef ef ef ef 00 00 00 00 40 00 00 01 00 00 01 00

0x0110: ff 70 21 10 c7 0c 00 08 ff 70 0c 08 00 00 00 00

0x0120: ff 70 0c 10 80 f0 00 1d ef ef ef ef 00 00 00 00

0x0130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0170: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0190: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x01a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x01b0: 20 14 06 03 3d 00 00 00 00 00 00 00 00 00 80 01

0x01c0: 01 00 83 3f 20 32 20 00 00 00 e0 97 01 00 00 00

0x01d0: 01 33 83 3f e0 ff 00 98 01 00 00 e0 db 01 00 00

0x01e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x01f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa

 

 

 

 

================== MBR ==================

boot_ind                = 0x80

start_head      = 0x1

start_cylesec   = 0x1

part_type       = 0x83

end_head                = 0x3f

end_cylsec      = 0x3220

rel_sectors     = 0x20

total_sectors   = 0x197e0

=========================================

It is a valid MBR

Read DBR from SDCard:

 

 

0x0000: eb 3c 90 6d 6b 64 6f 73 66 73 00 00 02 04 04 00

0x0010: 02 00 02 00 00 f8 68 00 20 00 40 00 00 00 00 00

0x0020: e0 97 01 00 00 00 29 1a a7 c5 c5 20 20 20 20 20

0x0030: 20 20 20 20 20 20 46 41 54 31 36 20 20 20 0e 1f

0x0040: be 5b 7c ac 22 c0 74 0b 56 b4 0e bb 07 00 cd 10

0x0050: 5e eb f0 32 e4 cd 16 cd 19 eb fe 54 68 69 73 20

0x0060: 69 73 20 6e 6f 74 20 61 20 62 6f 6f 74 61 62 6c

0x0070: 65 20 64 69 73 6b 2e 20 20 50 6c 65 61 73 65 20

0x0080: 69 6e 73 65 72 74 20 61 20 62 6f 6f 74 61 62 6c

0x0090: 65 20 66 6c 6f 70 70 79 20 61 6e 64 0d 0a 70 72

0x00a0: 65 73 73 20 61 6e 79 20 6b 65 79 20 74 6f 20 74

0x00b0: 72 79 20 61 67 61 69 6e 20 2e 2e 2e 20 0d 0a 00

0x00c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x00d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x00e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x00f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0170: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0190: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x01a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x01b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x01c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x01d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x01e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x01f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa

 

 

 

 

================== DBR ==================

jmp_code[0]     = 0xeb

 

 

sector_size     = 0x200

root_entries    = 0x200

small_sector    = 0x0

sectors_p_fat   = 0x68

=========================================

 

 

Writing image to SDCard...

OK.

 

 

Writing config words to MBR's buffer first...OK.

 

 

Writing MBR to SDCard...

================== MBR ==================

boot_ind                = 0x80

start_head      = 0x1

start_cylesec   = 0x1

part_type       = 0x83

end_head                = 0x3f

end_cylsec      = 0x3220

rel_sectors     = 0x20

total_sectors   = 0x197e0

=========================================

 

 

0x0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0040: 42 4f 4f 54 00 00 00 00 00 08 00 00 00 00 00 00

0x0050: 03 20 00 00 00 00 00 00 f8 f8 00 00 00 00 00 00

0x0060: f8 f8 00 00 00 00 00 00 00 00 00 06 00 00 00 00

0x0070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0080: ff 72 01 00 f8 f8 00 00 ff 72 0e 44 00 00 00 0c

0x0090: ff 72 00 00 80 01 00 00 ff 72 e4 0c 00 00 00 40

0x00a0: 40 00 00 01 00 00 01 00 80 00 00 01 80 00 00 01

0x00b0: ff 70 21 0c 0f c0 88 db ff 70 21 14 24 40 10 00

0x00c0: ff 70 21 18 00 04 08 30 ff 70 21 24 08 20 01 00

0x00d0: ff 70 21 30 02 80 00 00 40 00 00 01 00 00 01 00

0x00e0: ff 70 21 28 de ad be ef ff 70 21 10 c7 0c 00 00

0x00f0: ff 70 0c 08 00 00 00 00 ff 70 0d 70 80 f0 00 1d

0x0100: ef ef ef ef 00 00 00 00 40 00 00 01 00 00 01 00

0x0110: ff 70 21 10 c7 0c 00 08 ff 70 0c 08 00 00 00 00

0x0120: ff 70 0c 10 80 f0 00 1d ef ef ef ef 00 00 00 00

0x0130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0170: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0190: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x01a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x01b0: 20 14 06 03 3d 00 00 00 00 00 00 00 00 00 80 01

0x01c0: 01 00 83 3f 20 32 20 00 00 00 e0 97 01 00 00 00

0x01d0: 01 33 83 3f e0 ff 00 98 01 00 00 e0 db 01 00 00

0x01e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x01f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa

 

 

OK.

 

 

Writing DBR to SDCard...

================== DBR ==================

jmp_code[0]     = 0xeb

 

 

sector_size     = 0x200

root_entries    = 0x200

small_sector    = 0x0

sectors_p_fat   = 0x68

=========================================

 

 

0x0000: eb 3c 90 6d 6b 64 6f 73 66 73 00 00 02 04 04 00

0x0010: 02 00 02 00 00 f8 68 00 20 00 40 00 00 00 00 00

0x0020: e0 97 01 00 00 00 29 1a a7 c5 c5 20 20 20 20 20

0x0030: 20 20 20 20 20 20 46 41 54 31 36 20 20 20 0e 1f

0x0040: be 5b 7c ac 22 c0 74 0b 56 b4 0e bb 07 00 cd 10

0x0050: 5e eb f0 32 e4 cd 16 cd 19 eb fe 54 68 69 73 20

0x0060: 69 73 20 6e 6f 74 20 61 20 62 6f 6f 74 61 62 6c

0x0070: 65 20 64 69 73 6b 2e 20 20 50 6c 65 61 73 65 20

0x0080: 69 6e 73 65 72 74 20 61 20 62 6f 6f 74 61 62 6c

0x0090: 65 20 66 6c 6f 70 70 79 20 61 6e 64 0d 0a 70 72

0x00a0: 65 73 73 20 61 6e 79 20 6b 65 79 20 74 6f 20 74

0x00b0: 72 79 20 61 67 61 69 6e 20 2e 2e 2e 20 0d 0a 00

0x00c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x00d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x00e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x00f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0170: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x0190: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x01a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x01b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x01c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x01d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x01e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x01f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa

 

 

OK.

Congratulations! It is done successfully.

 

 

the content of config_sram_p2020rdb.dat is flowing:

40:424f4f54

44:00000000

48:00010000

4c:00000000

50:00000008

54:00000000

58:f8f80000

5c:00000000

60:f8f80000

64:00000000

68:00000006

 

 

80:ff720100

84:f8f80000

88:ff720e44

8c:0000000c

90:ff720000

94:80010000

98:ff72e40c

9c:00000040

a0:40000001

a4:00000100

a8:80000001

ac:80000001

 

 

has  where improper operation?

 

It torments me two weeks!!!!

 

thank you!

thank you!

Outcomes