Skip to contentSkip to conversation

Access to registers of MPC823E

DISCUSSION David de Andrés Martínez 2 participants 2 messages Oct 17, 2001

lore
Share & tools
lore
#0 lore raw

Hello,

I'm trying to write a program to run in Linux 2.4.4 (booting from PPCBoot) on a TQM823L (MPC823E), but I'm having some problems.

I have the following definitions in the headers:
----------------
#define TCGR IMR_USHORT(0x0980)
#define IMR_USHORT(addr) V_USHORT(CFG_IMMR + addr) #define IMR_USHORT(addr) (addr)
#define V_USHORT(a) (*(volatile unsigned short *)(a)) #define CFG_IMMR 0xFFF00000
----------------

When my main program tries to access to TCGR to read or write it simply exits out of the program without a warning into the shell.
----------

Quoted 3 lines

./main
START....

----------

Just to check if something is wrong, I have tested this code:
-----------------
unsigned long immr;

asm( "mfspr %0,638": "=r"(immr) : );
printf("IMMR = %li\n", immr);
----------------

But it didn't printf anything, just gets out of the program as before.

Got any idea of what can be going on?

--
----------------------------------------------------------------------

| David de Andrés Martínez   | Fault Tolerant Systems research Group |
|                            |                                       |
| Computer Science Engineer  | Email: [email protected]          |
| Doctorate Student          | Phone: +34 96 387.75.74 Ext 75774     |
|                            | Fax: +34 96 387.75.79                 |
-------Address--------------------------------------------------------
|                 DISCA-EUI                                          |
|                 Universidad Politécnica de Valencia                |
|                 Campus de Vera #14                                 |
|                 Valencia E-46021                                   |
|                 Spain                                              |

----------------------------------------------------------------------

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

#1 lore raw
Quoted 3 lines · In message <[email protected]> you wrote:

I'm trying to write a program to run in Linux 2.4.4 (booting from PPCBoot) on a TQM823L (MPC823E), but I'm having some problems.

...

Quoted 1 line

#define CFG_IMMR 0xFFF00000

...

Quoted 2 lines

When my main program tries to access to TCGR to read or write it simply exits out of the program without a warning into the shell.

...

Quoted 2 lines

asm( "mfspr %0,638": "=r"(immr) : );
printf("IMMR = %li\n", immr);

...

Quoted 1 line

Got any idea of what can be going on?

In user space you cannot access hardware directly using physical addresses, nor execute any priviledged istructions.

The Linux kernel protects itself from malicious users who try to tamper with it's internals :-)

Wolfgang Denk

--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: [email protected] The Gates in my computer are AND, OR and NOT; they are not Bill.

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