This is the mail archive of the ecos-patches@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]

at91rm9200 eth + spi


Hello John,

On 18-Oct-2006 John Eigelaar wrote:
> However another project for at91rm9200 popped up and I am continuing to
> work on the eth driver from that angle. Thus I am sort of working on
> both with the view as to cater for both parts with the driver. 
Good

BTW, how do you get your eth MAC addresses ? A simple way is [1].

> The goal of my at91rm9200 work is firstly to create a port for Redboot
> that will boot from SPI dataflash using the at91rm9200 internal boot
> mechanism.
I already boot my at91rm9200 redboot from SPI dataflash. But I do not boot
Redboot directly, but via atmel dataflash loader. What are you goint to do ?
Do you want to include atmel dataflash loader functionality to redboot
startup code ? Or do you even need dataflash access via redboot FIS ?

Bye,
Wolfgang


[1] Generating random, Locally Administered, Individual, MAC addresses:

#include <stdio.h>

int main()
  {
  unsigned char mac_adr[6]; // 48bits = 6bytes
  FILE *fp;
  int ret;

  printf("Generating random, Locally Administered, Individual, MAC"
    "address:\n");

  // get random
  fp=fopen("/dev/random","rb");
  if(!fp) {printf("ERROR: can not open /dev/random\n");return(1);}
  ret=fread(mac_adr,6,1,fp);
  if(ret<=0) {printf("ERROR: get random number\n");return(1);}
  fclose(fp); fp=0;

  // modifing mac_adr
  mac_adr[0]&=0xfe; // bit0.0=0: for Individual
  mac_adr[0]|=0x02; // bit0.1=1: for Locally Administered

  // printing mac_adr
  printf("MAC: %2.2x-%2.2x-%2.2x-%2.2x-%2.2x-%2.2x\n",
    mac_adr[0],mac_adr[1],mac_adr[2],mac_adr[3],mac_adr[4],mac_adr[5]);

  // printing mac_adr
  printf("ECOS MAC: \"0x%2.2x, 0x%2.2x, 0x%2.2x, 0x%2.2x, 0x%2.2x,"
    " 0x%2.2x\"\n",
    mac_adr[0],mac_adr[1],mac_adr[2],mac_adr[3],mac_adr[4],mac_adr[5]);

  return(0);
  }


http://standards.ieee.org/regauth/groupmac/tutorial.html
http://en.wikipedia.org/wiki/MAC_address
http://www.mynetwatchman.com/pckidiot/chap04.htm
http://enjambre.it.uc3m.es/~long/papers/draft-soto-mobileip-random-iids-00.txt



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