ppc4xx: Add mtcpr/mfcpr access macros

Signed-off-by: Stefan Roese <sr@denx.de>
This commit is contained in:
Stefan Roese 2007-05-11 12:01:49 +02:00
parent 343c48bd84
commit 61936667e8

View file

@ -1425,9 +1425,6 @@
/*----------------------------------------------------------------------------+
| Clock / Power-on-reset DCR's.
+----------------------------------------------------------------------------*/
#define CPR0_CFGADDR 0x00C
#define CPR0_CFGDATA 0x00D
#define CPR0_CLKUPD 0x20
#define CPR0_CLKUPD_BSY_MASK 0x80000000
#define CPR0_CLKUPD_BSY_COMPLETED 0x00000000
@ -3314,6 +3311,23 @@
#define mtsdr(reg, data) do { mtdcr(sdrcfga,reg);mtdcr(sdrcfgd,data); } while (0)
#define mfsdr(reg, data) do { mtdcr(sdrcfga,reg);data = mfdcr(sdrcfgd); } while (0)
/*
* All 44x except 440GP have CPR registers (indirect DCR)
*/
#if !defined(CONFIG_440GP)
#define CPR0_CFGADDR 0x00C
#define CPR0_CFGDATA 0x00D
#define mtcpr(reg, data) do { \
mtdcr(CPR0_CFGADDR, reg); \
mtdcr(CPR0_CFGDATA, data); \
} while (0)
#define mfcpr(reg, data) do { \
mtdcr(CPR0_CFGADDR, reg); \
data = mfdcr(CPR0_CFGDATA); \
} while (0)
#endif
#ifndef __ASSEMBLY__