--- In Jim Jackson <> wrote:
>
>
>
>
> On Wed, 24 Oct 2007, Gonzalo A. de la Vega wrote:
>
> > > I have tried your program and yes, it can change the clock rates
> > > just fine. However I get an I/O error when trying to turn the
> > > ethernet I/F on/off.
> >
> > The Ethernet module is enabled only down to a certain clock speed (I
> > can't remeber which), below which it doesn't work anymore.
Oh! I see, you clearly mean you can change processor speed, but not
switch off the eth. I understood you couldn't switch it off WHEN you
changed the CPU speed :-P
This is a piece of code I use to turn off the ethernet interface:
//CODE BEGINS HERE ---------------------------------------------
// Written by Gonzalo A. de la Vega <>
// based on original code by Technologic Systems - www.embeddedarm.com
// Turns off the eth module to save power
// Note: This is modified code from Technologic Systems with almost
// no original parts from me. Nothing essential anyway.
// compile with: arm-linux-gcc -o eth_off eth_off.c
//
#include<unistd.h>
#include<sys/types.h>
#include<sys/mman.h>
#include<stdio.h>
#include<fcntl.h>
#include<string.h>
int main(int argc, char **argv)
{
volatile unsigned int *PHDR, *PHDDR, *PHDR2, *PHDDR2, *GPIOBDB;
int i;
unsigned char state;
unsigned char *start;
int fd = open("/dev/mem", O_RDWR);
start = mmap(0, getpagesize(), PROT_READ|PROT_WRITE, MAP_SHARED,
fd, 0x80840000);
PHDR = (unsigned int *)(start + 0x40); // port e data
PHDDR = (unsigned int *)(start + 0x44);// port e direction register
*PHDDR |= 0x04; // all output (just 2 bits)
*PHDR &= 0xff-0x04;
close(fd);
return 0;
}
//CODE ENDS HERE ---------------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|