From: Gerhard Butscher Date: Wed, 26 Feb 2003 11:56:25 +0100 Subject: [U-Boot-Users] MPC850, read FLASH manufacturer ID, Mxu Board Message-ID: <3E5C9D59.2000808@esk.fhg.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello, We have an Infineon Switch Evaluation Board (MXU rev.B, MPC850), a Lauterbach Emulator. We started with the tqm850L configuration (u-boot 0.2.0). - Reading manufacturer ID of FLASH doesn't work. Using the VxWorks boot prompt commands it works to write the command sequence and then read the ID. We now managed to read the ID also with issuing FLASH writes/reads from Emulator. The VxWorks boot prompt command uses "sth" assembler command to write to flash and the u-boot flash_get_size() command uses "stw" assembler code. - Could someone explain why "sth" works and "stw" doesn't work in our case? Thanks, Gerhard I saw while stepping in assembler, the u-boot code uses following commands to write the command sequence (first using original long, then using short which works!): short i; ulong value; ulong base = (ulong)addr; 801F0008 lwz r0,0x8(r31) ; r0,8(r31 901F0018 stw r0,0x18(r31) ; r0,24(r31 unsigned short *flash_addr = (unsigned short *)addr 801F0008 lwz r0,0x8(r31) ; r0,8(r31 901F001C stw r0,0x1C(r31) ; r0,28(r31 /* Write auto select command: read Manufacturer ID */ addr[0x0] = 0xAAAAAAAA 813F0008 lwz r9,0x8(r31) ; r9,8(r31 3C00AAAA lis r0,-0x5556 ; r0,-21846 6000AAAA ori r0,r0,0xAAAA ; r0,r0,43690 90090000 stw r0,0x0(r9) ; r0,0(r9) addr[0x0] = 0x55555555; 813F0008 lwz r9,0x8(r31) ; r9,8(r31) 3C005555 lis r0,0x5555 ; r0,2184 60005555 ori r0,r0,0x5555 ; r0,r0,21845 90090000 stw r0,0x0(r9) ; r0,0(r9) addr[0x0] = 0x90909090; 813F0008 lwz r9,0x8(r31) ; r9,8(r31) 3C009090 lis r0,-0x6F70 ; r0,-28528 60009090 ori r0,r0,0x9090 ; r0,r0,37008 90090000 stw r0,0x0(r9) ; r0,0(r9 value = addr[0]; 813F0008 lwz r9,0x8(r31) ; r9,8(r31) 80090000 lwz r0,0x0(r9) ; r0,0(r9 901F0014 stw r0,0x14(r31) ; r0,20(r31 /* Write auto select command: read Manufacturer ID */ flash_addr[0x0] = 0xAAAA; 813F001C lwz r9,0x1C(r31) ; r9,28(r31 3800AAAA li r0,-0x5556 ; r0,-2184 B0090000 sth r0,0x0(r9) ; r0,0(r9) flash_addr[0x0] = 0x5555; 813F001C lwz r9,0x1C(r31) ; r9,28(r31) 38005555 li r0,0x5555 ; r0,21845 B0090000 sth r0,0x0(r9) ; r0,0(r9) flash_addr[0x0] = 0x9090; 813F001C lwz r9,0x1C(r31) ; r9,28(r31) 38009090 li r0,-0x6F70 ; r0,-28528 B0090000 sth r0,0x0(r9) ; r0,0(r9) value = addr[0]; 813F0008 lwz r9,0x8(r31) ; r9,8(r31) 80090000 lwz r0,0x0(r9) ; r0,0(r9) 901F0014 stw r0,0x14(r31) ; r0,20(r31)