Make Freescale local bus registers available for both 83xx and 85xx.
- Rename lbus83xx_t to fsl_lbus_t and move it to asm/fsl_lbc.h so that it can be shared by both 83xx and 85xx - Remove lbus83xx_t and replace it with fsl_lbus_t in all 83xx boards files which use lbus83xx_t. - Move FMR, FIR, FCR, FPAR, LTESR from mpc83xx.h to asm/fsl_lbc.h so that 85xx can share them. Signed-off-by: Jason Jin <Jason.Jin@freescale.com> Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
This commit is contained in:
@@ -75,7 +75,7 @@ struct fsl_elbc_ctrl {
|
||||
struct fsl_elbc_mtd *chips[MAX_BANKS];
|
||||
|
||||
/* device info */
|
||||
lbus83xx_t *regs;
|
||||
fsl_lbus_t *regs;
|
||||
u8 __iomem *addr; /* Address of assigned FCM buffer */
|
||||
unsigned int page; /* Last page written to / read from */
|
||||
unsigned int read_bytes; /* Number of bytes read during command */
|
||||
@@ -171,7 +171,7 @@ static void set_addr(struct mtd_info *mtd, int column, int page_addr, int oob)
|
||||
struct nand_chip *chip = mtd->priv;
|
||||
struct fsl_elbc_mtd *priv = chip->priv;
|
||||
struct fsl_elbc_ctrl *ctrl = priv->ctrl;
|
||||
lbus83xx_t *lbc = ctrl->regs;
|
||||
fsl_lbus_t *lbc = ctrl->regs;
|
||||
int buf_num;
|
||||
|
||||
ctrl->page = page_addr;
|
||||
@@ -211,7 +211,7 @@ static int fsl_elbc_run_command(struct mtd_info *mtd)
|
||||
struct nand_chip *chip = mtd->priv;
|
||||
struct fsl_elbc_mtd *priv = chip->priv;
|
||||
struct fsl_elbc_ctrl *ctrl = priv->ctrl;
|
||||
lbus83xx_t *lbc = ctrl->regs;
|
||||
fsl_lbus_t *lbc = ctrl->regs;
|
||||
long long end_tick;
|
||||
u32 ltesr;
|
||||
|
||||
@@ -261,7 +261,7 @@ static void fsl_elbc_do_read(struct nand_chip *chip, int oob)
|
||||
{
|
||||
struct fsl_elbc_mtd *priv = chip->priv;
|
||||
struct fsl_elbc_ctrl *ctrl = priv->ctrl;
|
||||
lbus83xx_t *lbc = ctrl->regs;
|
||||
fsl_lbus_t *lbc = ctrl->regs;
|
||||
|
||||
if (priv->page_size) {
|
||||
out_be32(&lbc->fir,
|
||||
@@ -295,7 +295,7 @@ static void fsl_elbc_cmdfunc(struct mtd_info *mtd, unsigned int command,
|
||||
struct nand_chip *chip = mtd->priv;
|
||||
struct fsl_elbc_mtd *priv = chip->priv;
|
||||
struct fsl_elbc_ctrl *ctrl = priv->ctrl;
|
||||
lbus83xx_t *lbc = ctrl->regs;
|
||||
fsl_lbus_t *lbc = ctrl->regs;
|
||||
|
||||
ctrl->use_mdr = 0;
|
||||
|
||||
@@ -633,7 +633,7 @@ static int fsl_elbc_wait(struct mtd_info *mtd, struct nand_chip *chip)
|
||||
{
|
||||
struct fsl_elbc_mtd *priv = chip->priv;
|
||||
struct fsl_elbc_ctrl *ctrl = priv->ctrl;
|
||||
lbus83xx_t *lbc = ctrl->regs;
|
||||
fsl_lbus_t *lbc = ctrl->regs;
|
||||
|
||||
if (ctrl->status != LTESR_CC)
|
||||
return NAND_STATUS_FAIL;
|
||||
@@ -693,13 +693,15 @@ static struct fsl_elbc_ctrl *elbc_ctrl;
|
||||
|
||||
static void fsl_elbc_ctrl_init(void)
|
||||
{
|
||||
immap_t *im = (immap_t *)CONFIG_SYS_IMMR;
|
||||
|
||||
elbc_ctrl = kzalloc(sizeof(*elbc_ctrl), GFP_KERNEL);
|
||||
if (!elbc_ctrl)
|
||||
return;
|
||||
|
||||
elbc_ctrl->regs = &im->lbus;
|
||||
#ifdef CONFIG_MPC85xx
|
||||
elbc_ctrl->regs = (void *)CONFIG_SYS_MPC85xx_LBC_ADDR;
|
||||
#else
|
||||
elbc_ctrl->regs = &((immap_t *)CONFIG_SYS_IMMR)->lbus;
|
||||
#endif
|
||||
|
||||
/* clear event registers */
|
||||
out_be32(&elbc_ctrl->regs->ltesr, LTESR_NAND_MASK);
|
||||
|
||||
Reference in New Issue
Block a user