Subject: reading FLASH ROM contents on EBSA-285

From: "Paul Robertson" <[email-masked]>
Date: Thu, 18 Nov 1999 16:21:30 -0000

I have just got a linux kernel running on EBSA285
I wrote a small hexdump program to dump the contents of FLASH
I think that the FLASH on this board is at physical address 0x41000000 which maps to virtual address 0xd8000000.
My program causes a segmentation fault like this...

bash-2.01# flashdump 0x100000 0x100100

flashdump: permission fault on section, address=0xd8100000, code 3
flashdump: permission fault on section, address=0xd8100000, code 3
Segmentation fault
bash-2.01#

I thought that as root I would have access to system space.
What is the easiest way around the problem?

Thanks for your continued support,

Paul Robertson
LocSoft Limited
"The key to your embedded solutions"
www.locsoft.com
Phone +44 (0) 1793 432557 
Fax     +44 (0) 1793 432727

---

From: Russell King - ARM Linux Admin <[email-masked]>
Date: Thu, 18 Nov 1999 16:46:47 +0000 (GMT)

> I thought that as root I would have access to system space.

No one gets access to system space directly.

> What is the easiest way around the problem?

open /dev/mem and mmap() the physical address.
   _____
  |_____| ------------------------------------------------- ---+---+-
  |   |        Russell King       [email-masked]      --- ---
  | | | |  http://www.arm.linux.org.uk/~rmk/armlinux.html    /  /  |
  | +-+-+                                                     --- -+-
  /   |               THE developer of ARM Linux              |+| /|\
 /  | | |                                                     ---  |
    +-+-+ -------------------------------------------------  /\\\  |

unsubscribe: body of `unsubscribe linux-arm' to [email-masked]
++        Please use [email-masked] for           ++
++                        kernel-related discussions.                      ++

---

From: Philip Blundell <[email-masked]>
Date: Thu, 18 Nov 1999 17:05:24 +0000

>I think that the FLASH on this board is at physical address 0x41000000
>which maps to virtual address 0xd8000000.

Only in kernel mode.  User programs aren't allowed to poke the hardware 
directly.

>What is the easiest way around the problem?

Use mmap on /dev/mem, or the flash285 driver.

p.