From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hugo Tyson To: guinan@bluebutton.com Cc: ecos-discuss@sourceware.cygnus.com Subject: Re: [ECOS] Support Web Page? (MBX issue) Date: Thu, 02 Sep 1999 03:59:00 -0000 Message-id: References: X-SW-Source: 1999-09/msg00003.html Jamie Guinan writes: > I have a brand-new MBX board, and I am unable to get the GDB stubrom > image to work. I tried both "powerpc-mbx/gdbload.bin" that came > with our supported distribution, and a "stubrom" image built according > to Jonathon Lamour's instructions, > > http://sourceware.cygnus.com/ml/ecos-discuss/1999-07/msg00023.html > > I tftp'd the binary images to the target system using the EPPCBug > monitor, then used PFLASH to burn them into the 32-bit flash memory > (4 soldered chips). EPPCBug is running from the 8-bit flash device > (1 socketed chip). > > Anyway, when I switch J4 to boot from the 32-bit flash memory, > I get nothing. I ran "powerpc-eabi-gdb -b 9600" and did a > "target remote /dev/ttyS0" but it failed to connect. Browsing > the sources I expected to see a "+" sign emitted at boot time > but I saw nothing through my terminal emulator. > > Any tricks to get the GDB stub to work on the MBX? > > I tried the above several times, and even burned a copy of the > EPPCBug monitor into the 32bit flash and that worked fine. Sanity check: whichever of "ROM" or flash is selected for boot lives at 0xfe000000 and the other lives at 0xfc000000 (where ROM means the socketed 8-bit flash or PROM device), so the booting code shouldn't know any difference between running from the 32-bit flash and the "ROM" - as demonstrated by the fact the PPCBug indeed runs thus. Right? However, all the testing we have done for ROM start was using the 8-bit device; we retained the copy of PPCBug in the 32-bit flash just-in-case. That's what (I believe) we document: that's what we support. So, to get started, acquire an AM29F040 (flash) or AM27F040 (PROM) and load it with the stubrom image using a PROM programmer, y'know, outside of the board. Plug it in, select that socket for booting and all should be well. Here's a guess at why it doesn't work: we program the UPMs during bootup to deal with an 8-bit device on CS0 and 32-bit flash on CS7 (mbx.S in the mbx component) - unconditionally. So if it's trying to boot from flash (ie. CS0 is the 32-bit device), the memory timing will be set up quite wrongly (as soon as MM is enabled). I guess there's some way to read the links through a status register and find out whether you're starting from 32-bit space and swap these setups - or some kludge involving just trying it - that must be in the PPCBug image. A quick scan through the MBX doc reveals no such register. ;-( If you want to try the experiment, and make a stubrom image that will ONLY run from 32-bit flash, try swapping the setups for the BOOT ROM and FLASH in the setup code in mbx.S: relevant fragments are below unchanged, so you can find them unambiguously. Ie. put the values for BOOT ROM in BR7,OR7 and the values for FLASH in BR0,OR0. Does that make sense? HTH, - Huge %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /* * Base Register initialization. */ /* BOOT ROM */ lwi r3,0xfe000401 # 8-bit, GPCM #ifdef __50MHZ lwi r5,0xff800960 /* for 120nS devices, else 0xff800940 */ #else lwi r5,0xff800930 #endif stw r3,BR0(r4) stw r5,OR0(r4) ..... /* FLASH */ lwi r3,0xfc000001 # 32-bit, GPCM #ifdef __50MHZ lwi r5,0xff800940 #else lwi r5,0xff800930 #endif stw r3,BR7(r4) stw r5,OR7(r4) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%