This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Re: RedBoot "set MAC address" API?


Grant,
Ah yes, I switched mid stream from talking about MAC to IP address.
Sorry for sharing my confusion.

We too will have a form of Redboot stored in flash in the final product
though it won't have ethernet support.
We will have to make each MAC different though and I was expecting this to
be a process in the
manufacturing stage of loading the image.
Somehow each image will have to be modified to make its MAC different OR
somthing has to program the Ethernet chip duing production with the desired
unique MAC.
Our Ethernet chip's MAC registers are memory addressable so the later should
be easy for us.
Some part of the process has to be unique for each device - I guess the real
question will be which will be the most convenient?

			...Laurie:{)

-----Original Message-----
From: ecos-discuss-owner@ecos.sourceware.org
[mailto:ecos-discuss-owner@ecos.sourceware.org]On Behalf Of Grant
Edwards
Sent: Monday, 6 November 2006 1:41 PM
To: ecos-discuss@sources.redhat.com
Subject: [ECOS] Re: RedBoot "set MAC address" API?


On 2006-11-06, Laurie Gellatly <laurie.gellatly@netic.com> wrote:

>>> For Redboot you set the MAC in the config file. The Ethernet
>>> driver typically provides this as one of its CDL options. Is
>>> that what you're asking or have I not understood your
>>> question?
>>
>> That doesn't make any sense.  It would mean that you have to
>> do a separate config/build for every single unit you ship.
>
> Well it does make sense when you consider that Redboot is
> normally there just to get your application debugging done.

Our products ship with RedBoot installed in flash.

[Typically in the previous generations of products, RedBoot was
configured to run from RAM after being loaded from flash by a
low-level boot-loader, but I'm thinking about running RedBoot
directly from flash in the next generation to make things a bit
simpler.]

There is also a default application image in the FIS
file-system. Sometimes that default application image is loaded
and run by RedBoot, and sometimes a different application might
be downloaded by a supervisory computer and run.  [We've added
some proprietary protocol support to RedBoot to allow programs
to be downloaded and run using the same protocols that our
non-eCos+RedBoot based products used back in the last century.]

Some of our customers also write their own eCos apps and
replace the default application image in FIS.  In any case,
RedBoot is an integral part of the shipped product.

> Your application that 'works with a ROM monitor' can assign
> its own IP address and that can be done via the API.

It's the MAC address that I'm asking about, not the IP address.

Configuring the IP address is simple, you just install an
initialization routine that runs before net_init() does and
fills in the values of __local__ip_xxxx. The network init code
picks up the values during startup and Bob's your uncle.

There is no equivalent way to set the MAC address: none of the
drivers appear to look at __local_enet_addr or __local_enet_sc,
and there doesn't appear to be a way to pass a MAC address to
the "init" method of an Ethernet driver. Indeed, it appears
that the Ethernet drivers are supposed to know what the MAC
address is a-priori.  That's how I got it to work in previous
products, I poked the MAC address into the Ethernet chip before
the RedBoot network startup code was called, and the driver
read it from hardware and returned it to the network code.

My current kludge for the next generation of products is to
hard-wire a bogus MAC address (all 0's) in the Ethernet
driver's source and then have application code change the MAC
address to the proper value after the interface has been
initialized.  That seems to be working, but doesn't seem quite
right.

> In production, Redboot might not be there at all

It is.

> (your application moves to 'behave as a ROM monitor') or
> simply might not have ethernet support in Redboot and only
> your application has ethernet support.

We ship RedBoot with Ethernet support.  In previous
generations, we set the MAC address by poking it directly into
the Ethernet HW before the Ethernet driver was initialized.
That was ugly and non-portable: application code needed to be
aware of the underlying Ethernet controller chip.  That's why
I'm looking for a more portable method that would work for
multiple platforms. We build for multiple generations of
products from a single eCos repository, so platform-specific
code in applications like RedBoot is a bad thing.

> So, when you view it that way, having a fixed IP for debugging
> just rules out one more variable to chase.

I'm asking about the MAC address, not about the IP address.
There is sufficient means for configuring the IP address.

--
Grant



--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]