linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Re: custom mpc8240 student project (long)
@ 2002-02-22  1:11 Dustin Byford
  0 siblings, 0 replies; 19+ messages in thread
From: Dustin Byford @ 2002-02-22  1:11 UTC (permalink / raw)
  To: Jim Thompson, Kerl, John; +Cc: 'linuxppc-embedded@lists.linuxppc.org'


On Thu, 21 Feb 2002 14:32:32 -0600
 Jim Thompson <jim@musenki.com> wrote:
>
> I can't begin to endorse just how true this is.  The top
>  of my
> keyboard/desk are littered with tiny dead flash parts.
>   Our (8245)
> boards have had the sockets re-soldered at least 3 times
>  each, due
> entirely to handling stress.
>
> Not mentioned is the fact that the pins eventually
>  oxidize.

Fortunately I found a little zif to pga socket that I can
 put in a wire wrap socket.  If the pins start oxidizing
 before this project is over I'm in trouble anyway.


     --Dustin

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 19+ messages in thread
* RE: custom mpc8240 student project (long)
@ 2002-02-22 18:33 Kerl, John
  2002-02-22 20:51 ` Wolfgang Denk
  0 siblings, 1 reply; 19+ messages in thread
From: Kerl, John @ 2002-02-22 18:33 UTC (permalink / raw)
  To: 'Geir Frode Raanes'
  Cc: 'linuxppc-embedded@lists.linuxppc.org'


> Now, the parallel port is as we all know parallel.
> JTAG is, as we all know, synchronous serial.

JTAG is a four-pin protocol -- test data in (TDI), test data out
(TDO), TMS (test mode select) and TCK (test clock).  TRESET
(asynchronous reset) is an optional fifth pin.  And of course you
need at least one ground pin; more for higher clock speeds.

What happens, in the software-only solution, is that those four
pins are connected to a ribbon cable which plugs into the PC's
parallel port.  Inside the software on the PC, you just set/clear
bits, reading and writing a few bits in the byte-wide LPT/parport
interface.  No auxiliary microcontroller is required (although I
suppose Corelis et al. probably have a micro on their expansion
card).

I guess you can call the parallel port "parallel" and the JTAG
pins "serial", but that's how it works -- in software you use
just a few pins on the parallel port, and bit-bang each of them
serially.

> To interface the former to the latter, one would normally
> place a shift register with clock control inbetween. But
> ...
> ...
> ...

You've lost me here; I lack the hardware background.  Are you
perhaps suggests ways to build a JTAG hardware device?

> What I would like to know is wether this BSDL file can be used
> to reversengineer the functionality of the internal TRAP logic.
> We really don't want to do boundary scan in the true meaning of
> the words, but rather we want to do what BDM4GDB does for us on
> the XPC8xx series CPUs - control the core. I do HW, not really
> SW.

I don't know what you mean by "trap" logic.  I know that JTAG
itself is an open standard, in the sense that you can get books
on it, and if you want the official protocol document, you can
get that from the IEEE at a nominal fee.  I don't think that the
JTAG standard can be considered closed.

As for the PPC debug logic (the kind of stuff a probe plugs
into), my experience is that that is documented in the Motorola
8xx manuals.  (On the other hand, I've never attempted to control
the debug header in software, so I don't know if the manuals are
complete.  Perhaps someone can correct me on this.)

> This is all about control - the manufactures should not be
> allowed to place a NDA on this information.

IMHO, I don't think it's the *information* that's so much being
held closed.  From my experience, I don't see JTAG being in an
NDA state.  The JTAG protocol is conceptually simple; BSDL files
are published; we've written bit-bang software to flash our
boards and it does work (of course the code is time-consuming to
write, and slow to run).

> Redirecting customers to 3'd
> party vendors of debug equipment effectively means customer
> filtration. "If your are to small to afford the contiousely
> astronomical cost of 3'd party tools, then you're also too
> small for us." Need I remind you that the same melody can
> be applied to GCC and LinuxPPC vs. 3'd party too...?

Agreed.  I don't think it's a closed-information problem, but I
do believe that the current state of the marketplace (again,
IMHO; I've been doing embedded stuff for just over a year, so I'm
no expert) is that there are a few vendors out there who build
these kinds of tools and get away with charging astronomical
prices -- not because of closed *specifications* (a` la Micro$oft
& their ilk) but because no one has come up with a cheaper,
viable alternative *implementation*.  The protocols are open, but
the source is closed.

Which raises the question:  Do JTAG-tool vendors' prices really
reflect their true cost?  If so, then I wouldn't want to even
*try* to compete with them.  If not (i.e. they're getting rich
off the rest of us), then yes, I would hope that someone,
someday, *could* open-source tools like these.  By "tools like
these" I, personally, mean (a) flash programming and (b) boundary
scan for hardware verification.  & by which Geir means (c) BDM
tools.  All three are important.

& I agree that these are precisely the same arguments made in the
software world:  For example, OS's were solid gold for software
vendors -- BSD was revolutionary for even *selling* you a license
to see their source.  Everyone else thought that operating
systems were far too precious intellectual property to give away,
or even give you the slightest peek at -- enter Torvalds, and of
course the rest is history.  & people like Stallman with GCC,
Wall with Perl, and so on.

Maybe the JTAG world is ready to be similarly shaken up.

The unique problem with JTAG is that the software-only solution
is, I believe, severely limited by parallel-port data rate.  If
someone were to write and open-source a very flexible, elegant,
general-purpose BSDL-and-netlist parser which would read in some
data files & start flash programming, all without the user having
to write a single line of code -- it would still be slow.
Efficiency (I believe) requires a hardware component.

The open-source community thrives on downloadable source.  But
how do you download an expansion card?  Either (a) you
open-source the schematics, BOM, Gerber files, etc. for your card
(leaving the non-trivial assembly step to the end user), or (b)
you build them in your garage & sell them on a mail-order basis
for a reasonable fee.

A third possibility is (c) maybe the efficiency isn't a problem
-- if all you want is to open-source a software-only, and slow,
solution which can flash a boot loader into a board, to the point
where TFTP can take over.  What I do at my job is to use a tool
like Corelis to store my debug monitor (~200KB) into flash.
(Again, we can afford only the flash-programming part of Corelis.)
Once the monitor is on a given board, I rarely need to do it again.
My debug monitor includes TFTP server code, and on-board flash
programming logic written in C.  So I can then TFTP up my
zvmlinux.initrd (> 2MB) in about 30-40 seconds and, if desired,
have my debug monitor store it into flash in about about 2
minutes.  Or TFTP up a new copy of my debug monitor itself, &
re-flash that, in even less time.  So, for me at least, a
Corelis-like tool is only needed for small programs, e.g. our
monitor, or PPCBoot.

So those are the two feasability issues: (1) Can the software &
hardware really be done more affordably that what's currently on
the market?  And (2) how do you open-source hardware?  Or do
you have to?

----------------------------------------------------------------

List members:

Please excuse my having gone on at some length on this subject,
if it's not your area of interest.  However, these issues drive
to the very heart of the deepest frustrations, the most
time-consuming problems and the biggest budget headaches I've run
into in my embedded career.  The issues Geir is bringing up,
I believe, are central.

I write software not for pre-verified boards such as RPX, but for
custom-built boards designed by my co-workers.  One of my tasks
is to *be* the guy who verifies the board, mainly using our
homegrown debug-and-test monitor software.  And I've found that
issues I encounter are as likely to be hardware bugs as software
bugs.  This is brand-new for me; when was the last time you
*expected* to encounter hardware bugs programming your PC?

I've found that peeky-pokey testing can reveal many outright
hardware problems, but flaky, intermittent or irreproducible
problems are outside my current ability to diagnose.  & if I tell
my hardware-designing co-workers that I have an intermittent
problem that I can't reproduce, typically what they do is go look
at their schematics and/or VHDL code for a half an hour, come
back, and shrug: "Looks OK to me."  This is precisely where we
need (but can't afford!) automated testing.  And I don't think
I'm the only embedded programmer out there having to work with
hardware which has not yet been verified.  Most importantly, what
if you think you have a problem with your OS port, or your device
driver -- what seems to be a software problem -- and really, it's
a hardware problem which you simply hadn't found?

Once a board is known to be solid, then (& only then) can one
start to port an OS, write applications, etc.  Boundary-scan
would be useful for the board-verification phase; BDM tools would
be nice for the application phase.  & flash programming is useful
in either case.

I've found that JTAG is a very powerful thing, which (I believe)
could have saved me a lot of headaches and weeks or months of
wasted time -- except for the prohibitive cost in terms of either
time or money.  And I suspect I'm not alone in that either.


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 19+ messages in thread
* Re: custom mpc8240 student project (long)
@ 2002-02-22  1:07 Dustin Byford
  0 siblings, 0 replies; 19+ messages in thread
From: Dustin Byford @ 2002-02-22  1:07 UTC (permalink / raw)
  To: Ron Bianco, linuxppc-embedded


Thank you all for the suggestions.  The BDI was simply too
 much for the school to spend on a small group of people.
  I did however contact Macraigor Systems and explain my
 situation.  They have donated a wiggler so it looks like
 I'm in business, thanks to Macraigor!

On Thu, 21 Feb 2002 14:40:05 -0800
 "Ron Bianco" <ronb@junction.net> wrote:
>
> My $.02:
>
> Why don't you just use a regular old EPROM to hold your
>  ppcboot monitor image.?

Haven't quite decided on the ROM exactly, still waiting on
 samples from AMD but a regular EPROM sounds like good idea
 for now.

> You're planning to run at a very low clock speed on your
>  wire-wrapped board.
> Ugh!
> Better check the 8240 datasheet, there may be lower
>  limits to what's allowed.

>From the hardware spec it looks like the PLL can be
 configured to 33Mhz/pci 33mhz/memory 100Mhz cpu.
  Hopefully the wirewrap can handle this.

>
> Good luck, Ron

It is starting to sound like I'm really going to need luck,
 so thanks.


     --Dustin

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 19+ messages in thread
* RE: custom mpc8240 student project (long)
@ 2002-02-21 20:12 Kerl, John
  2002-02-21 20:32 ` Jim Thompson
  2002-02-22  9:32 ` Geir Frode Raanes
  0 siblings, 2 replies; 19+ messages in thread
From: Kerl, John @ 2002-02-21 20:12 UTC (permalink / raw)
  To: 'linuxppc-embedded@lists.linuxppc.org'


I don't want to scare anyone off ... JTAG *is* slow, painful,
and fraught with hazards -- *if* you try to write your own
software to bit-bang the JTAG pins over, say, a parallel port.

#1, the software is complex because you have to know the
pin-outs of all the parts in the scan chain on your board. Also
you have to wiggle pins such as write-enable, etc. which
normally the CPU's memory controller would wiggle for you.  You
have to think about setup & hold times, etc.

#2, the bit rate out the parallel port is abysmal.  Another
poster on this list cited 40 KB in 12 minutes; our experience
is comparable.  As one of my co-workers said a few weeks ago,
"If it were any slower, it would be running backward."


However, if you get a tool such as Corelis (there are two other
major competitors whose names I can't remember), JTAG can
actually be very pleasant.

#1, you don't write any C code; you get the BSDL files from the
part vendors, and the board's netlist from the board vendor.
It normally takes our hardware guys a day or two to get it set
up for a new board, but from that point on we're good to go.

#2, Corelis (and I assume its competitors have similar
hardware) doesn't use the parallel port.  Instead, it has a
proprietary card in an expansion slot in the PC which can
wiggle the JTAG lines a lot faster than the parallel port can.
Still not breaking any speed records, but maybe 250 KB in 2
minutes, which is better.

#3, socketed flash tends to wear out -- we've had a lot of
frustration with metal fatigue on the flash pins and/or socket
pins.  When you use JTAG, you aren't wearing out your flash
pins by popping them in & out of sockets, in & out of the flash
programmer, dropping them, etc.

#4, board testers such as this don't just program flash -- they
can also do hardware verification, e.g. finding shorts, opens
etc.  This is invaluable with new hardware.

The downside is that Corelis is not at all cheap; also the
flash-programming and board-verification options are licensed
separately.  (My group finds that it can afford the
flash-programming option but can't afford the board-testing
option.)


So:  JTAG is very complex, & is best left to the vendors which
understand it.  & if you can afford the tools those vendors
build, it can make your life a lot easier.



-----Original Message-----
From: Jerry Van Baren [mailto:vanbaren_gerald@si.com]
Sent: Tuesday, February 19, 2002 4:41 AM
To: linuxppc-embedded@lists.linuxppc.org
Subject: Re: custom mpc8240 student project (long)



I agree, a socketed flash/EEPROM is your simplest method.

If you _really_ want to go JTAG, Mot has the 8240 BSDL available on their
web site:
   http://e-www.motorola.com/collateral/MPC8240R1EBSDL.txt
This is the boundary scan description: it shows how the pins of the chip
can be scanned via JTAG.  You can write to flash by repeatedly (and I mean
_repeatedly_!) scanning in the states of all the pins to wiggle the
address, data, and control signals (CS0*, write strobe, etc).  By wiggling
the proper pins to simulate write cycles, you can write to flash.

Disclaimers:
* This is slow and painful.

* I've seen this done successfully with an Intel 386EX processor.  That was
the only time someone I know was foolish enough to do this.

* Before it was done successfully with an Intel 386EX processor, I saw at
least two of them burned up.  If you do the JTAG wrong, you can define
input pins to be output pins, causing a driver conflict which quickly blows
the pin.

* The BSDL tends to change with processor revisions.  Make sure your BSDL
matches the processor revision!

* Flash works because there is typically no cycle-to-cycle timing
requirements to set up the write and the write itself.

* EEPROM can be a problem because it typically has a 100uSec max timing
requirement for the write sequence and you will find that hard to do via a
bit-bang parallel port.  In the 386EX case, we were able to write to EEPROM
if software write protect was OFF.  If it was ON, it required a hardware
JTAG accelerator card to unlock it because we could not do the whole
unprotect sequence fast enough.

* It takes three scans per write cycle: scan in the three sequences
<address, data, not write>, <address, data, write>, <address, data, not
write>.  (It seems like it should be do-able in two, but my coworker was
unable to do it in two on the 386EX -- YMMV.)  When you count how many bits
need to be shifted, you quickly realize how slow this is.

* Did I mention it is slow, painful, and fraught with hazards?

gvb
P.S. You are on your own if you go this route.  Enjoy learning BSDL :-).
P.P.S On the positive side, if you want to work for a JTAG tester company,
you will have a _really_ impressive resume'.


At 03:32 PM 2/18/2002 -0700, Dustin Byford wrote:

>I understand what you're saying about the COP so I need to evaluate my
>options.  We are all students working on this so I don't think my coleauges
>will spring for the BDI since we don't have one available to us at the
>University.  Is the BDI1000/2000 the least expensive way to use the
JTAG/COP?
>
>An alternate idea:  What if I jumper in a 32 pin PDIP 8-bit EEPROM
somewhere
>that I can boot from (RCS0/8-bit).  I can pull this part off of the board
and
>throw it in a programmer we have at the university.  Hopefully I'll be able
>to program it with something that will "simply" program itself onto the
TSOP
>AMD flash (which would then be jumpered to (32-bit/RCS1).  Remove the
jumpers
>and reset the board and maybe I would have a ROM that can downlaod stuff
>through the UART.  Not the quickest of development cycles but it is a
no-cost
>solution.
>
>Or: Leave the EEPROM on RCS0 all the time.  The AMD Flash on RCS1 all the
>time and find another place to put the UART.  Suggestions?
>
>Thanks
>
>                         --Dustin
>
>


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 19+ messages in thread
[parent not found: <7E8519F1A7C0D211B0D200A0C93AA60F08447D20@ntmail.iskratel.si>]
* custom mpc8240 student project (long)
@ 2002-02-18 10:33 Dustin Byford
  0 siblings, 0 replies; 19+ messages in thread
From: Dustin Byford @ 2002-02-18 10:33 UTC (permalink / raw)
  To: linuxppc-embedded


Hi,

For purely academic purposes I am building an IP router based on an mpc8240
in my "capstone" EE class at NMSU.  I was wondering if someone who may have
done something similar could tell me if I'm working in the right direction.
I've done some research with the list archives and I think I have decided on
a basic hardware layout.  I'm just wondering if my ideas are sane and I have
a couple of questions.

I will be wire-wrapping the entire design (sockets have been acquired) and
and plan to use:

MPC8240 (At ~30MHz bus)
National 16550 UART connected to RCS1, etc...
2 16-bit flash ROMs (8MByte total) (Am29LV320D x2) connected toRCS0, etc...
128MB SDRAM in 1 DIMM
PCI (wire wrap board attached to a backplane) with 2 FA310TX netgear cards
There is also a reset circuit, a power supply, and I'm guessing I need a
buffer between the UART and the CPU and a MAX232 for serial line driving.

I also planned to start out by programming the ROMs through the BDM/JTAG port
on the CPU.  I'll start with the GDB target for MPCs and attempt to load a
program into RAM to program the 2 flashes, with--ppcboot.  Hopefully this
will allow me to run the 2.4_devel version of the ppc kernel, busybox/uclibc
as a distro and iptables as the "router".

I'm expecting many frustrations (I mean learning experiences) along the way
and I suppose I'll begin with sandpoint code for ppcboot and the kernel.

So, what do you think.  Will it work?  Also, is there maybe a different
kernel I should start out with.  Anybody see any major pitfalls?

Also, in the chance that this works I would love to PCB it and fire it up at
200 MHz/100MHz Memory/66MHz PCI and then hang it on my wall because I have to
give the 8240 back to my professor.  I can design the PCB but what is the
cheapest way to get a 4-6 layer board done.

Thanks for any and all advice!

			--Dustin

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2002-02-27 11:46 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-22  1:11 custom mpc8240 student project (long) Dustin Byford
  -- strict thread matches above, loose matches on Subject: below --
2002-02-22 18:33 Kerl, John
2002-02-22 20:51 ` Wolfgang Denk
2002-02-22  1:07 Dustin Byford
2002-02-21 20:12 Kerl, John
2002-02-21 20:32 ` Jim Thompson
2002-02-21 22:40   ` Ron Bianco
2002-02-22  9:32 ` Geir Frode Raanes
2002-02-22 13:09   ` Jerry Van Baren
2002-02-23 19:16     ` Dan Malek
2002-02-25 12:18     ` Geir Frode Raanes
2002-02-27 11:46       ` Christian Pellegrin
     [not found] <7E8519F1A7C0D211B0D200A0C93AA60F08447D20@ntmail.iskratel.si>
2002-02-18 21:17 ` Dustin Byford
2002-02-18 21:44   ` Wolfgang Denk
     [not found]     ` <auto-000008693306@zipmail.com>
2002-02-18 22:32       ` Wolfgang Denk
2002-02-19 11:40       ` Jerry Van Baren
2002-02-19 16:53         ` Bob Piatek
2002-02-20  2:32       ` Greg Griffes
2002-02-18 10:33 Dustin Byford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).