CPU performance measurement

2002-07-24 Thread Wolfgang Denk

Dear OtavioOtavio,

in message B7AC573479F05C438F232539B961A168095007 at 
CUR1006V.br002.siemens.net.br you wrote:

 You did mount the /proc filesystem, didn't you?
 I though /proc filesystem was mounted but it is not. My custom board is

Ummm.. I guess you have a login or any other way to access a shell on
your board? You can (and should) manually check which filesystems are
mounted, and mount anything that may be missing.

 running a 6MB ramdisk and I receive the following message when Linux
 goes up:

 EXT-f2 warning: mounting unchecked fs, running e2fsck is recommended

This is harmless - just an indication that  your  way  to  build  the
ramdisk image is more or less broken.

 VFS: Mounted root (ext2 filesystem)
 Freeing unused kernel memory: 60k init 4k openfirmware
 INIT; version 2.78 booting
 Checking all file systems...
 Parallelizing fsck version 1.19(13-jul-2000)
 Mounting local filesystems...
 Not mounted anuthing

To me this seems pretty much overkill for a ramdisk  of  an  embedded
system;  have  a  look  how  we  do this in our Simple Embedded Linux
Framework, see ftp://ftp.denx.de/pub/LinuxPPC/usr/src/SELF/

 I tried to run e2fsck but no success. Any idea what can I do to fix fs?

Fix the the build process for your ramdisk image.

Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
I used to be indecisive, now I'm not sure.

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





Execute Reset via CheckStop approach

2002-07-24 Thread Govindan

Here is something we found working:
-Govindan

#include asm/8xx_immap.h
#include asm/mpc8xx.h

#define IMAP_ADDR ((uint)0xff00)/* Internal memory map
address for our board. */
#define PLPRCR_CSR  0x0080  /* CheskStop Reset value */
int csreset (void)
{
  unsigned int msr,addr;

  ((volatile immap_t *)IMAP_ADDR)-im_clkrst.car_plprcr |= PLPRCR_CSR;
  /* Interrupts and MMU off */
  asm(mtspr 81,0);
  asm(mfmsr %0: =r(msr));
  msr = ~0x1030;
  asm (mtmsr %0 : /* no output */ : r (msr));

  addr = 0x1000;  // This should be a non-accessible memory
location.
  ((void (*)(void ))addr)();
return 0;
}

-Original Message-
From: [EMAIL PROTECTED]
[mailto:owner-linuxppc-embedded at lists.linuxppc.org]On Behalf Of Steven
Vacca
Sent: Tuesday, July 23, 2002 7:16 PM
To: LinuxEmbeddedMailList (E-mail); govindan at tejasnetworks.com
Subject: Execute Reset via CheckStop approach



I would like to execute an Internal Hard Reset on an MPC860T
bd. using the Checkstop Reset approach.

Does anyone have some code that I could utilize to implement
this?

Thanks,

ShutEye Thinkin
Valcom, Inc.


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





MDIO clock speed computation

2002-07-24 Thread Pavel Bartusek
Jean-Denis Boyer wrote:

Will this work for all cases? :

bd-bi_intfreq + 499) / 250) / 2 )  0x3F )  1;


I hope so ;-)

Because hoping is not enough, I wrote a little brute force program for testing 
(see attachment).
The algorithm above is OK :-) It produces MDIO frequencies from 1.875MHz to 2.5 
MHz.

BTW: Wolfgang, similar problem is in the PPCboot.

--
|  Pavel Bartusek|
||
| Sysgo RTS GmbH, phone: +49 (0) 6136 9948-722   |
| Am Pfaffenstein 14  fax:   +49 (0) 6136 9948-10|
| D-55270 Klein-Winternheim   email: pba at sysgo.de|
| Germany|
||
|   http://www.sysgo.de   http://www.elinos.com  |
||
--


-- next part --
An embedded and charset-unspecified text was scrubbed...
Name: fec_speed.test.c
Url: 
http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20020724/31bd97e1/attachment.txt
 


idle for m8xx

2002-07-24 Thread Michael Meriin

Hi there,

In all last kernels idle mode for m8xx is implemented as an endless loop.
Therefore the  idle modes of the m8xx family are not used.
Implementation of the internal Idle modes of the m8xx family will
significantly reduce
the power consumption in the embedded systems.
Does anybody know how to do this?

Best Regards,
 Michael Meriin


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





How to get rid of unused data in LKM

2002-07-24 Thread Matthias Fuchs

Hi,

I am writing a LKM that contains a huge constant array of data that is used
as firmware for a PCI card that is connected to the system where the LKM is 
loaded.

The module_init function writes the constant data array into the PCI card's RAM 
and triggers
a CPU on that card to jump to the firmware code. This works fine.

But after doing so, the firmware data is still wasting kernel memory on the 
host system
and is not used anymore.
How can I free that memory ? Is there a better way to handle that data ?
Currently I have a global variable in my module code:

unsigned char firmware[] = { ...,  , about 1.4 Meg, ...}

The firmware data (about 1.4 Meg) must be linked with the LKM.

Any idea ?

Matthias


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





Execute Reset via CheckStop approach

2002-07-24 Thread Wolfgang Denk

In message NEBBINFJMPEFJBMDGBGMAEOGFAAA.govindan at india.tejasnetworks.com 
you wrote:

 Here is something we found working:
...
   addr = 0x1000;  // This should be a non-accessible memory
 location.

The big disadvantage of this approach is that it works on one  board,
and fails on another - or even on the same board after you added some
more RAM, etc.

We solved this problem in our version (see the  CVS)  by  explicitely
invalidating the mapping in the memory controller:

/* Get base address mapped by BR0/OR0
 */
bad_addr = ((immap_t *)IMAP_ADDR)-im_memctl.memc_br0  0x8000;
cli();

/* Enable CheckStop Reset
 */
((immap_t *)IMAP_ADDR)-im_clkrst.car_rmr |= 0x0001;

/* Invalidate BR0 mapping
 */
((immap_t *)IMAP_ADDR)-im_memctl.memc_br0 = 0;

/* Set MSR and cause reset
 */
__asm__(mfmsr %0 : =r (msr) );
msr = ~0x1000;
__asm__(mtmsr %0 : =r (msr) );
dummy = * (unsigned char *) bad_addr;
printk(Restart failed\n);
while(1);


Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
Microsoft Compatibility:
 your old Windows 3.11 application crash exactly as the new ones.

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





How to get rid of unused data in LKM

2002-07-24 Thread John Tyner

  But after doing so, the firmware data is still wasting kernel memory on the 
  host system
  and is not used anymore.
  How can I free that memory ? Is there a better way to handle that data ?

 If you really think you must link the data with the  module:  Declare
 it using __initdata ?

I was under the impression that data like this is not thrown away when
compiled as a module... only when compiled directly into the kernel. Is
this not true?

I think Wolfgang's ioctl idea is a much better way to go in this case.


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





idle for m8xx

2002-07-24 Thread Matthew Locke

Michael Meriin wrote:

Hi there,

In all last kernels idle mode for m8xx is implemented as an endless loop.
Therefore the  idle modes of the m8xx family are not used.
Implementation of the internal Idle modes of the m8xx family will
significantly reduce
the power consumption in the embedded systems.
Does anybody know how to do this?

The ARM kernel does it quite well.  Basically, they have an abstraction
in the idle loop where you can plug in sub-arch/processor specific code
that puts the processor into the idle state.  4xx has idles states that
differ from the rest of the ppc family as well.  It would be nice to
move the power_save routine into the platform code allowing each
sub-arch/processor to define its own.   I have plans on doing exactly
that in the near future, but if you beat me to it


Best Regards,
 Michael Meriin





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





changes to /proc files

2002-07-24 Thread Hihn Jason

I'm writing a little GPL app that needs to monitor some data in /proc. I
seem to recall (possibly incorrectly) that there was some magic way for a
program to be notified when a file in /proc changes, rather than having to
poll. I can't seem to find anything in Google.

Can anyone point me in the right direction?
What is the overhead in polling and reading a small (~500b) /proc file?

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





Tigon3 driver, broadcom 5307, 440GP, working?

2002-07-24 Thread Stephen Cameron

I've been playing around with the tigon3 driver and a broadcom
5307 gigabit NIC in my IBM ebony... No luck so far.  The driver compiles
and even loads, I can run ifconfig(busybox really) to configure
the NIC,  and if I pull the network cable, the driver seems to
notice (get log messages about link is down, link is up) but so
far, I can't actually transmit or receive any packets.

Anyone had any luck with this combination?

-- steve


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





driver for 440GP

2002-07-24 Thread Khai Trinh

Hi folks,

I am trying to write a driver for the 440GP peripheral
device with physical memory map of 0x1 (total
of 36 bits) on the PLB address space.

When I get to do:

request_mem_region() and then
ioremap64()

Don't I need a 64 bit request_mem_region() call? Is
there such a kernel call before I call ioremap64()?

Thanks,
--Khai


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





Mount failures on custom 8245 H/W

2002-07-24 Thread Neil Horman

Hello-
I can't tell you much about the underlying cause of your errors I'm 
afraid, but
according to the Motorolla Programming Env. Manual, you got a Program Exception
Trap (0x700).  Page 6-29 of the book lists the various causes of this problem.
I would suggest running objdump with the disassemble option around the address
range specified by the NIP value of your first oops.  That should give you some
idea which of the listed reasons caused your problem, and which section of code
this problem occured in.  You will have to try it for yourself, but looking at
the list, I would put my money on either an explicit trap instruction in one the
offending driver, or in a misconfigured compiler generating instructions which
the 8245 does not support during the compilation of the misbehaving code in
question.

Hope that helps
Neil

James F Dougherty wrote:

 Hi,

 My h/w is an 8245 using internal UART, onboard BCM5701 Gig-E,
 dual DOC and 64MB PC100 SDRAM.

 I am running PPCBoot 1.1.4 and Linux 2.4.2 from MontaVista HHL20.
 I am using Denx ELDK for root-fs and toolchains.

 My Memory map is below:

 0x - 0x4000 - 64MB SDRAM SIMM
   (Unregistered PC-100 SDRAM DIMM Module)

 0xFF00 - 0xFF001FFF - M-Systems DiskOnChip (TM) 2000
   TSOP 16MB (MD2211-D16-V3)

 0x7000 - 0x70001FFF - M-Systems DiskOnChip (TM) 2000
   DIP32 (Socketed 16MB - 1GB ) *
   NOTE: this is not populated on all systems.

 0x7c00 - 0x7c00 - Reset Register
   (Write 0 to reset)

 0x7c01 - 0x7c01 - System LED
   (Clear Bit 7 to turn on, set to shut off)

 0x7c02 - 0x7c02 - M48T59 Watchdog IRQ3
   (Clear bit 7 to reset, set to assert IRQ3)

 0x7c03 - 0x7c03 - M48T59 Write-Protect Register
   (Clear bit 7 to make R/W, set to make R/O)

 0x7c002000 - 0x7c002003 - Infineon OSRAM DLR2416 4 Character
   5x7 Dot Matrix Alphanumeric Display
   (Each byte sets the appropriate character)

 0x7c004000 - 0x7c005FF0 - SGS-THOMSON M48T59Y 8K NVRAM/RTC
   NVRAM Memory Region

 0x7c005FF0 - 0x7c005FFF - SGS-THOMSON M48T59Y 8K NVRAM/RTC
   Realtime Clock Registers

 0xFFF0 - 0xFFF8 - 512K PLCC32 BootRom

 After reading through the documentation, I decided not to use any I/O
 devices from 0x7000-0x7FFF (MPC8245 EXTROM space) after having
 previously used ioremap() for all of my I/O spaces, including the
 MPC8245
 internal UART after the EUMBBAR gets remapped in mpc10x_common.c. At
 this
 point, I have a very basic system, without a TOD, and only UART and
 Ethernet
 (in other words, I'm only using CPU registers and the PCI Bus). I am
 fairly
 confident in my H/W and the memory initialization, primarily because
 VxWorks
 runs perfectly on the same platform with some very memory intensive
 applications.

 Anyhow, my system boots, and mounts root via NFS, however, when I try to
 mount proc, it crashes and gives me the errors below.

 Anyone have an idea what could be wrong? I wonder -- could a misbehaving
 driver with
 bogus procfs entries be causing this problem?


   Thanks,
   -James

 Notes:

 c0040520 T sys_mount
 c0003ffc T ret_from_syscall_1

 VFS: Mounted root (nfs filesystem).
 Freeing unused kernel memory: 72k init 4k openfirmware
 modprobe: modprobe: Can't open dependencies file
 /lib/modules/2.4.2_hhl20/modules.dep (No such file or directory)
 INIT: version 2.78 booting
 Welcome to DENX Embedded Linux Environment
 Press 'I' to enter interactive startup.
 Mounting proc filesystem:  Oops: Exception in kernel mode, sig: 4
 NIP: C0040520 XER:  LR: C0003FFC SP: C3C7FE80 REGS: c3c7fdd0
 TRAP: 0700
 MSR: 00089032 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 11
 TASK = c3c7e000[18] 'mount' Last syscall: 21
 last math c3c7e000 last altivec 
 GPR00: 0054 C3C7FE80 C3C7E000 10020040 10020050 10020060 C0ED
 
 GPR08: 10020061 C3C7FE90 C0040520 40442080 40442080 100262E8 
 100D0890
 GPR16: 7C9C 7C98 1002  9032 03C7FE80 
 C0004268
 GPR24: C0003FA0 10020020 7ECA  10020040  
 7CA8
 Call backtrace:
 C0003FFC  10002440 10002ED0 10003B5C 100048EC 0FEE5238
 
 [FAILED]
 Configuring kernel parameters:  [  OK  ]
 RTC_RD_TIME: Invalid argument
 ioctl() to /dev/rtc to read the time failed.
 Setting clock : Wed Dec 31 19:00:28 EST 1969 [  OK  ]
 Activating swap partitions:  [  OK  ]
 Setting hostname switch-2:  [  OK  ]
 grep: /proc/mounts: No such file or directory
 Checking root filesystem
 fsck: fsck.nfs: not found
 fsck: Error 2 while executing fsck.nfs for /dev/nfs
 [  OK  ]
 Checking filesystems
 Checking all file