powerpc: mpc8xx: harmonise initialisation of the immap local pointer

In most places, immap local pointer is defined as
	immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;
In a few places, it is defined as
	immap_t __iomem *immap = (immap_t __iomem *)(immr & 0xFFFF0000);

This patch replaces the few of the latest form by the other one.

The two are fully equivalent since SPRN_IMMR is set with CONFIG_SYS_IMMR
very early in start.S

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
master
Christophe Leroy 7 years ago committed by Tom Rini
parent f110892f3d
commit 374a0e306e
  1. 5
      arch/powerpc/cpu/mpc8xx/cpu.c
  2. 3
      arch/powerpc/cpu/mpc8xx/speed.c

@ -36,7 +36,7 @@ DECLARE_GLOBAL_DATA_PTR;
static int check_CPU(long clock, uint pvr, uint immr) static int check_CPU(long clock, uint pvr, uint immr)
{ {
immap_t __iomem *immap = (immap_t __iomem *)(immr & 0xFFFF0000); immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;
uint k; uint k;
char buf[32]; char buf[32];
@ -237,8 +237,7 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
*/ */
unsigned long get_tbclk(void) unsigned long get_tbclk(void)
{ {
uint immr = get_immr(0); /* Return full IMMR contents */ immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;
immap_t __iomem *immap = (immap_t __iomem *)(immr & 0xFFFF0000);
ulong oscclk, factor, pll; ulong oscclk, factor, pll;
if (in_be32(&immap->im_clkrst.car_sccr) & SCCR_TBS) if (in_be32(&immap->im_clkrst.car_sccr) & SCCR_TBS)

@ -17,8 +17,7 @@ DECLARE_GLOBAL_DATA_PTR;
*/ */
int get_clocks(void) int get_clocks(void)
{ {
uint immr = get_immr(0); /* Return full IMMR contents */ immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;
immap_t __iomem *immap = (immap_t __iomem *)(immr & 0xFFFF0000);
uint sccr = in_be32(&immap->im_clkrst.car_sccr); uint sccr = in_be32(&immap->im_clkrst.car_sccr);
uint divider = 1 << (((sccr & SCCR_DFBRG11) >> 11) * 2); uint divider = 1 << (((sccr & SCCR_DFBRG11) >> 11) * 2);

Loading…
Cancel
Save