mirror of
https://github.com/linux-sunxi/u-boot-sunxi.git
synced 2024-02-12 11:16:03 +08:00
mpc83xx: streamline the 83xx immr head file
For better format and style, I streamlined the 83xx head files, including immap_83xx.h and mpc83xx.h. In the old head files, 1) duplicated macro definition appear in the both files; 2) the structure of QE immr is duplicated in the immap_83xx.h and immap_qe.h; 3) The macro definition put inside the each structure. So, I cleaned up the structure of QE immr from immap_83xx.h, deleted the duplicated stuff and moved the macro definition to mpc83xx.h, Just like MPC8260. CHANGELOG *streamline the 83xx immr head file Signed-off-by: Dave Liu <daveliu@freescale.com>
This commit is contained in:
@ -148,14 +148,14 @@ int checkboard (void)
|
|||||||
u32 w, f;
|
u32 w, f;
|
||||||
|
|
||||||
immr = (immap_t *)CFG_IMMR;
|
immr = (immap_t *)CFG_IMMR;
|
||||||
if (!(immr->reset.rcwh & RCWH_PCIHOST)) {
|
if (!(immr->reset.rcwh & HRCWH_PCI_HOST)) {
|
||||||
printf("PCI: NOT in host mode..?!\n");
|
printf("PCI: NOT in host mode..?!\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get bus width */
|
/* get bus width */
|
||||||
w = 32;
|
w = 32;
|
||||||
if (immr->reset.rcwh & RCWH_PCI64)
|
if (immr->reset.rcwh & HRCWH_64_BIT_PCI)
|
||||||
w = 64;
|
w = 64;
|
||||||
|
|
||||||
/* get clock */
|
/* get clock */
|
||||||
|
@ -202,12 +202,12 @@ void cpu_init_f (volatile immap_t * im)
|
|||||||
im->sysconf.lblaw[7].ar = CFG_LBLAWAR7_PRELIM;
|
im->sysconf.lblaw[7].ar = CFG_LBLAWAR7_PRELIM;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CFG_GPIO1_PRELIM
|
#ifdef CFG_GPIO1_PRELIM
|
||||||
im->pgio[0].dir = CFG_GPIO1_DIR;
|
im->gpio[0].dir = CFG_GPIO1_DIR;
|
||||||
im->pgio[0].dat = CFG_GPIO1_DAT;
|
im->gpio[0].dat = CFG_GPIO1_DAT;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CFG_GPIO2_PRELIM
|
#ifdef CFG_GPIO2_PRELIM
|
||||||
im->pgio[1].dir = CFG_GPIO2_DIR;
|
im->gpio[1].dir = CFG_GPIO2_DIR;
|
||||||
im->pgio[1].dat = CFG_GPIO2_DAT;
|
im->gpio[1].dat = CFG_GPIO2_DAT;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ void qe_config_iopin(u8 port, u8 pin, int dir, int open_drain, int assign)
|
|||||||
u32 pin_1bit_mask;
|
u32 pin_1bit_mask;
|
||||||
u32 tmp_val;
|
u32 tmp_val;
|
||||||
volatile immap_t *im = (volatile immap_t *)CFG_IMMR;
|
volatile immap_t *im = (volatile immap_t *)CFG_IMMR;
|
||||||
volatile gpio83xx_t *par_io =(volatile gpio83xx_t *)&im->gpio;
|
volatile qepio83xx_t *par_io = (volatile qepio83xx_t *)&im->qepio;
|
||||||
|
|
||||||
/* Caculate pin location and 2bit mask and dir */
|
/* Caculate pin location and 2bit mask and dir */
|
||||||
pin_2bit_mask = (u32)(0x3 << (NUM_OF_PINS-(pin%(NUM_OF_PINS/2)+1)*2));
|
pin_2bit_mask = (u32)(0x3 << (NUM_OF_PINS-(pin%(NUM_OF_PINS/2)+1)*2));
|
||||||
|
@ -139,7 +139,7 @@ int get_clocks(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
spmf = ((im->reset.rcwl & RCWL_SPMF) >> RCWL_SPMF_SHIFT);
|
spmf = ((im->reset.rcwl & HRCWL_SPMF) >> HRCWL_SPMF_SHIFT);
|
||||||
csb_clk = pci_sync_in * (1 + clkin_div) * spmf;
|
csb_clk = pci_sync_in * (1 + clkin_div) * spmf;
|
||||||
|
|
||||||
sccr = im->clk.sccr;
|
sccr = im->clk.sccr;
|
||||||
@ -251,7 +251,7 @@ int get_clocks(void)
|
|||||||
}
|
}
|
||||||
#if defined(CONFIG_MPC8349) || defined(CONFIG_MPC8360)
|
#if defined(CONFIG_MPC8349) || defined(CONFIG_MPC8360)
|
||||||
lbiu_clk = csb_clk *
|
lbiu_clk = csb_clk *
|
||||||
(1 + ((im->reset.rcwl & RCWL_LBIUCM) >> RCWL_LBIUCM_SHIFT));
|
(1 + ((im->reset.rcwl & HRCWL_LBIUCM) >> HRCWL_LBIUCM_SHIFT));
|
||||||
#else
|
#else
|
||||||
#error Unknown MPC83xx chip
|
#error Unknown MPC83xx chip
|
||||||
#endif
|
#endif
|
||||||
@ -268,11 +268,11 @@ int get_clocks(void)
|
|||||||
}
|
}
|
||||||
#if defined(CONFIG_MPC8349) || defined(CONFIG_MPC8360)
|
#if defined(CONFIG_MPC8349) || defined(CONFIG_MPC8360)
|
||||||
ddr_clk = csb_clk *
|
ddr_clk = csb_clk *
|
||||||
(1 + ((im->reset.rcwl & RCWL_DDRCM) >> RCWL_DDRCM_SHIFT));
|
(1 + ((im->reset.rcwl & HRCWL_DDRCM) >> HRCWL_DDRCM_SHIFT));
|
||||||
corepll = (im->reset.rcwl & RCWL_COREPLL) >> RCWL_COREPLL_SHIFT;
|
corepll = (im->reset.rcwl & HRCWL_COREPLL) >> HRCWL_COREPLL_SHIFT;
|
||||||
#if defined (CONFIG_MPC8360)
|
#if defined (CONFIG_MPC8360)
|
||||||
ddr_sec_clk = csb_clk * (1 +
|
ddr_sec_clk = csb_clk * (1 +
|
||||||
((im->reset.rcwl & RCWL_LBIUCM) >> RCWL_LBIUCM_SHIFT));
|
((im->reset.rcwl & HRCWL_LBIUCM) >> HRCWL_LBIUCM_SHIFT));
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#error Unknown MPC83xx chip
|
#error Unknown MPC83xx chip
|
||||||
@ -307,8 +307,8 @@ int get_clocks(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined (CONFIG_MPC8360)
|
#if defined (CONFIG_MPC8360)
|
||||||
qepmf = (im->reset.rcwl & RCWL_CEPMF) >> RCWL_CEPMF_SHIFT;
|
qepmf = (im->reset.rcwl & HRCWL_CEPMF) >> HRCWL_CEPMF_SHIFT;
|
||||||
qepdf = (im->reset.rcwl & RCWL_CEPDF) >> RCWL_CEPDF_SHIFT;
|
qepdf = (im->reset.rcwl & HRCWL_CEPDF) >> HRCWL_CEPDF_SHIFT;
|
||||||
qe_clk = (pci_sync_in * qepmf) / (1 + qepdf);
|
qe_clk = (pci_sync_in * qepmf) / (1 + qepdf);
|
||||||
brg_clk = qe_clk / 2;
|
brg_clk = qe_clk / 2;
|
||||||
#endif
|
#endif
|
||||||
|
File diff suppressed because it is too large
Load Diff
1281
include/mpc83xx.h
1281
include/mpc83xx.h
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user