Memory mapped hardware registers
From: Simon Paradis (see.end.of.message_at_globetotter.net)
Date: 01/23/05
- Next message: Michael Schnell: "Re: Memory mapped hardware registers"
- Previous message: Yugender Reddy: "HELP!!! Cannot open dev/console as a standard input"
- Next in thread: Michael Schnell: "Re: Memory mapped hardware registers"
- Reply: Michael Schnell: "Re: Memory mapped hardware registers"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 23 Jan 2005 16:03:29 GMT
Hi,
I'm developping board support code for an embedded m68k system. The actual
MCU is a MC68331 that has a CPU32 core (more or less a 68020). This MCU
define hardware registers at specific memory locations. My toolchain is
composed of GCC 3.4.3 and binutils 2.15.
It possible to define a variable that would be placed at specific location
using gcc or linker script hacks ? It would avoid using a pointer to access
a register. I don't care if this is non portable and/or gcc/binutils
specific.
For example, the CPU32 has the SIMCR 16-bits register placed at 0xFFFA00.
typedef unsigned short word;
/* SIMCR (0xYFFA00): SIM Configuration */
typedef struct _SIMCR {
word exoff : 1;
word frzsw : 1;
word frzbm : 1;
word _UNUSED_1 : 1;
word slven : 1;
word _UNUSED_2 : 1;
word shen : 2;
word supv : 1;
word mm : 1;
word _UNUSED_3 : 2;
word iarb : 4;
} SIMCR;
How can I place a single SIMCR structure at 0xFFFA00 ? I guess some linker
magic is involved ? Also, the actual variable must be left uninitialized;
you don't want init code to overwrite the register with zeros as this will
crash the MCU.
Thanks,
Simon Paradis
simon _dot_ paradis _at_ usherbrooke _dot_ ca
- Next message: Michael Schnell: "Re: Memory mapped hardware registers"
- Previous message: Yugender Reddy: "HELP!!! Cannot open dev/console as a standard input"
- Next in thread: Michael Schnell: "Re: Memory mapped hardware registers"
- Reply: Michael Schnell: "Re: Memory mapped hardware registers"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|