2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2005-07-28 15:08:46 +00:00
|
|
|
/*
|
2009-05-25 11:53:16 +00:00
|
|
|
* Copyright (C) 2004-2009 Freescale Semiconductor, Inc.
|
2005-07-28 15:08:46 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
2020-05-10 17:40:07 +00:00
|
|
|
#include <asm-offsets.h>
|
2005-07-28 15:08:46 +00:00
|
|
|
#include <mpc83xx.h>
|
|
|
|
#include <ioports.h>
|
2009-05-25 11:53:16 +00:00
|
|
|
#include <asm/io.h>
|
2017-03-28 16:27:27 +00:00
|
|
|
#include <asm/processor.h>
|
2009-09-25 23:19:44 +00:00
|
|
|
#ifdef CONFIG_USB_EHCI_FSL
|
2016-03-31 21:12:23 +00:00
|
|
|
#include <usb/ehci-ci.h>
|
2009-05-25 11:53:16 +00:00
|
|
|
#endif
|
2005-07-28 15:08:46 +00:00
|
|
|
|
2019-01-21 08:17:58 +00:00
|
|
|
#include "lblaw/lblaw.h"
|
2019-01-21 08:18:03 +00:00
|
|
|
#include "elbc/elbc.h"
|
2019-01-21 08:18:11 +00:00
|
|
|
#include "sysio/sysio.h"
|
2019-01-21 08:18:12 +00:00
|
|
|
#include "arbiter/arbiter.h"
|
2019-01-21 08:18:13 +00:00
|
|
|
#include "initreg/initreg.h"
|
2019-01-21 08:17:58 +00:00
|
|
|
|
2006-03-31 16:32:53 +00:00
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
|
2006-11-03 18:11:15 +00:00
|
|
|
#ifdef CONFIG_QE
|
|
|
|
extern qe_iop_conf_t qe_iop_conf_tab[];
|
|
|
|
extern void qe_config_iopin(u8 port, u8 pin, int dir,
|
|
|
|
int open_drain, int assign);
|
|
|
|
extern void qe_init(uint qe_base);
|
|
|
|
extern void qe_reset(void);
|
|
|
|
|
|
|
|
static void config_qe_ioports(void)
|
|
|
|
{
|
|
|
|
u8 port, pin;
|
|
|
|
int dir, open_drain, assign;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; qe_iop_conf_tab[i].assign != QE_IOP_TAB_END; i++) {
|
|
|
|
port = qe_iop_conf_tab[i].port;
|
|
|
|
pin = qe_iop_conf_tab[i].pin;
|
|
|
|
dir = qe_iop_conf_tab[i].dir;
|
|
|
|
open_drain = qe_iop_conf_tab[i].open_drain;
|
|
|
|
assign = qe_iop_conf_tab[i].assign;
|
|
|
|
qe_config_iopin(port, pin, dir, open_drain, assign);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2005-07-28 15:08:46 +00:00
|
|
|
/*
|
|
|
|
* Breathe some life into the CPU...
|
|
|
|
*
|
|
|
|
* Set up the memory map,
|
|
|
|
* initialize a bunch of registers,
|
|
|
|
* initialize the UPM's
|
|
|
|
*/
|
|
|
|
void cpu_init_f (volatile immap_t * im)
|
|
|
|
{
|
2009-09-25 23:19:44 +00:00
|
|
|
__be32 sccr_mask =
|
|
|
|
#ifdef CONFIG_SYS_SCCR_ENCCM /* Encryption clock mode */
|
2010-05-19 22:06:46 +00:00
|
|
|
SCCR_ENCCM |
|
2008-01-16 18:06:16 +00:00
|
|
|
#endif
|
2009-09-25 23:19:44 +00:00
|
|
|
#ifdef CONFIG_SYS_SCCR_PCICM /* PCI & DMA clock mode */
|
2010-05-19 22:06:46 +00:00
|
|
|
SCCR_PCICM |
|
2008-01-16 18:06:16 +00:00
|
|
|
#endif
|
2010-09-17 21:41:47 +00:00
|
|
|
#ifdef CONFIG_SYS_SCCR_PCIEXP1CM /* PCIE1 clock mode */
|
|
|
|
SCCR_PCIEXP1CM |
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_SYS_SCCR_PCIEXP2CM /* PCIE2 clock mode */
|
|
|
|
SCCR_PCIEXP2CM |
|
|
|
|
#endif
|
2009-09-25 23:19:44 +00:00
|
|
|
#ifdef CONFIG_SYS_SCCR_TSECCM /* all TSEC's clock mode */
|
2010-05-19 22:06:46 +00:00
|
|
|
SCCR_TSECCM |
|
2006-11-01 00:44:42 +00:00
|
|
|
#endif
|
2009-09-25 23:19:44 +00:00
|
|
|
#ifdef CONFIG_SYS_SCCR_TSEC1CM /* TSEC1 clock mode */
|
2010-05-19 22:06:46 +00:00
|
|
|
SCCR_TSEC1CM |
|
2006-11-01 00:44:42 +00:00
|
|
|
#endif
|
2009-09-25 23:19:44 +00:00
|
|
|
#ifdef CONFIG_SYS_SCCR_TSEC2CM /* TSEC2 clock mode */
|
2010-05-19 22:06:46 +00:00
|
|
|
SCCR_TSEC2CM |
|
2007-02-28 05:51:42 +00:00
|
|
|
#endif
|
2009-09-25 23:19:44 +00:00
|
|
|
#ifdef CONFIG_SYS_SCCR_TSEC1ON /* TSEC1 clock switch */
|
2010-05-19 22:06:46 +00:00
|
|
|
SCCR_TSEC1ON |
|
2007-07-03 18:04:34 +00:00
|
|
|
#endif
|
2009-09-25 23:19:44 +00:00
|
|
|
#ifdef CONFIG_SYS_SCCR_TSEC2ON /* TSEC2 clock switch */
|
2010-05-19 22:06:46 +00:00
|
|
|
SCCR_TSEC2ON |
|
2007-07-03 18:04:34 +00:00
|
|
|
#endif
|
2009-09-25 23:19:44 +00:00
|
|
|
#ifdef CONFIG_SYS_SCCR_USBMPHCM /* USB MPH clock mode */
|
2010-05-19 22:06:46 +00:00
|
|
|
SCCR_USBMPHCM |
|
2007-02-28 05:51:42 +00:00
|
|
|
#endif
|
2009-09-25 23:19:44 +00:00
|
|
|
#ifdef CONFIG_SYS_SCCR_USBDRCM /* USB DR clock mode */
|
2010-05-19 22:06:46 +00:00
|
|
|
SCCR_USBDRCM |
|
2007-02-28 05:51:42 +00:00
|
|
|
#endif
|
2009-09-25 23:19:44 +00:00
|
|
|
#ifdef CONFIG_SYS_SCCR_SATACM /* SATA controller clock mode */
|
2010-05-19 22:06:46 +00:00
|
|
|
SCCR_SATACM |
|
2009-09-25 23:19:44 +00:00
|
|
|
#endif
|
|
|
|
0;
|
|
|
|
__be32 sccr_val =
|
|
|
|
#ifdef CONFIG_SYS_SCCR_ENCCM /* Encryption clock mode */
|
|
|
|
(CONFIG_SYS_SCCR_ENCCM << SCCR_ENCCM_SHIFT) |
|
2006-11-01 00:44:42 +00:00
|
|
|
#endif
|
2009-09-25 23:19:44 +00:00
|
|
|
#ifdef CONFIG_SYS_SCCR_PCICM /* PCI & DMA clock mode */
|
|
|
|
(CONFIG_SYS_SCCR_PCICM << SCCR_PCICM_SHIFT) |
|
|
|
|
#endif
|
2010-09-17 21:41:47 +00:00
|
|
|
#ifdef CONFIG_SYS_SCCR_PCIEXP1CM /* PCIE1 clock mode */
|
|
|
|
(CONFIG_SYS_SCCR_PCIEXP1CM << SCCR_PCIEXP1CM_SHIFT) |
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_SYS_SCCR_PCIEXP2CM /* PCIE2 clock mode */
|
|
|
|
(CONFIG_SYS_SCCR_PCIEXP2CM << SCCR_PCIEXP2CM_SHIFT) |
|
|
|
|
#endif
|
2009-09-25 23:19:44 +00:00
|
|
|
#ifdef CONFIG_SYS_SCCR_TSECCM /* all TSEC's clock mode */
|
|
|
|
(CONFIG_SYS_SCCR_TSECCM << SCCR_TSECCM_SHIFT) |
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_SYS_SCCR_TSEC1CM /* TSEC1 clock mode */
|
|
|
|
(CONFIG_SYS_SCCR_TSEC1CM << SCCR_TSEC1CM_SHIFT) |
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_SYS_SCCR_TSEC2CM /* TSEC2 clock mode */
|
|
|
|
(CONFIG_SYS_SCCR_TSEC2CM << SCCR_TSEC2CM_SHIFT) |
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_SYS_SCCR_TSEC1ON /* TSEC1 clock switch */
|
|
|
|
(CONFIG_SYS_SCCR_TSEC1ON << SCCR_TSEC1ON_SHIFT) |
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_SYS_SCCR_TSEC2ON /* TSEC2 clock switch */
|
|
|
|
(CONFIG_SYS_SCCR_TSEC2ON << SCCR_TSEC2ON_SHIFT) |
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_SYS_SCCR_USBMPHCM /* USB MPH clock mode */
|
|
|
|
(CONFIG_SYS_SCCR_USBMPHCM << SCCR_USBMPHCM_SHIFT) |
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_SYS_SCCR_USBDRCM /* USB DR clock mode */
|
|
|
|
(CONFIG_SYS_SCCR_USBDRCM << SCCR_USBDRCM_SHIFT) |
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_SYS_SCCR_SATACM /* SATA controller clock mode */
|
|
|
|
(CONFIG_SYS_SCCR_SATACM << SCCR_SATACM_SHIFT) |
|
|
|
|
#endif
|
|
|
|
0;
|
|
|
|
|
|
|
|
/* Pointer is writable since we allocated a register for it */
|
|
|
|
gd = (gd_t *) (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET);
|
|
|
|
|
2017-01-17 07:33:48 +00:00
|
|
|
/* global data region was cleared in start.S */
|
2009-09-25 23:19:44 +00:00
|
|
|
|
|
|
|
/* system performance tweaking */
|
|
|
|
clrsetbits_be32(&im->arbiter.acr, acr_mask, acr_val);
|
|
|
|
|
|
|
|
clrsetbits_be32(&im->sysconf.spcr, spcr_mask, spcr_val);
|
|
|
|
|
|
|
|
clrsetbits_be32(&im->clk.sccr, sccr_mask, sccr_val);
|
2006-11-01 00:44:42 +00:00
|
|
|
|
2005-07-28 15:08:46 +00:00
|
|
|
/* RSR - Reset Status Register - clear all status (4.6.1.3) */
|
2012-12-13 20:48:56 +00:00
|
|
|
gd->arch.reset_status = __raw_readl(&im->reset.rsr);
|
2009-09-25 23:19:44 +00:00
|
|
|
__raw_writel(~(RSR_RES), &im->reset.rsr);
|
2005-07-28 15:08:46 +00:00
|
|
|
|
2008-08-28 21:09:19 +00:00
|
|
|
/* AER - Arbiter Event Register - store status */
|
2012-12-13 20:48:57 +00:00
|
|
|
gd->arch.arbiter_event_attributes = __raw_readl(&im->arbiter.aeatr);
|
|
|
|
gd->arch.arbiter_event_address = __raw_readl(&im->arbiter.aeadr);
|
2008-08-28 21:09:19 +00:00
|
|
|
|
2005-07-28 15:08:46 +00:00
|
|
|
/*
|
|
|
|
* RMR - Reset Mode Register
|
|
|
|
* contains checkstop reset enable (4.6.1.4)
|
|
|
|
*/
|
2009-09-25 23:19:44 +00:00
|
|
|
__raw_writel(RMR_CSRE & (1<<RMR_CSRE_SHIFT), &im->reset.rmr);
|
2005-07-28 15:08:46 +00:00
|
|
|
|
mpc83xx: boot time regression, move LCRR setup back to cpu_init_f
Commit c7190f02 (retain POR values of non-configured ACR, SPCR, SCCR,
and LCRR bitfields) moved the LCRR assignment to after relocation
to RAM because of the potential problem with changing the local bus
clock while executing from flash.
This change unfortunately adversely affects the boot time, as running
all code up to cpu_init_r can cause significant slowdown.
E.G. on a 8347 board a bootup time increase of ~600ms has been observed:
0.020 CPU: e300c1, MPC8347_PBGA_EA, Rev: 3.0 at 400 MHz, CSB: 266.667 MHz
0.168 RS: 232
0.172 I2C: ready
0.176 DRAM: 64 MB
1.236 FLASH: 32 MB
Versus:
0.016 CPU: e300c1, MPC8347_PBGA_EA, Rev: 3.0 at 400 MHz, CSB: 266.667 MHz
0.092 RS: 232
0.092 I2C: ready
0.096 DRAM: 64 MB
0.644 FLASH: 32 MB
So far no boards have needed the late LCRR setup, so simply revert it
for now - If it is needed at a later time, those boards can either do
their own final LCRR setup in board code (E.G. in board_early_init_r),
or we can introduce a CONFIG_SYS_LCRR_LATE config option to only do
the setup in cpu_init_r.
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
2009-12-08 21:20:34 +00:00
|
|
|
/* LCRR - Clock Ratio Register (10.3.1.16)
|
|
|
|
* write, read, and isync per MPC8379ERM rev.1 CLKDEV field description
|
|
|
|
*/
|
2010-06-17 16:37:20 +00:00
|
|
|
clrsetbits_be32(&im->im_lbc.lcrr, lcrr_mask, lcrr_val);
|
|
|
|
__raw_readl(&im->im_lbc.lcrr);
|
mpc83xx: boot time regression, move LCRR setup back to cpu_init_f
Commit c7190f02 (retain POR values of non-configured ACR, SPCR, SCCR,
and LCRR bitfields) moved the LCRR assignment to after relocation
to RAM because of the potential problem with changing the local bus
clock while executing from flash.
This change unfortunately adversely affects the boot time, as running
all code up to cpu_init_r can cause significant slowdown.
E.G. on a 8347 board a bootup time increase of ~600ms has been observed:
0.020 CPU: e300c1, MPC8347_PBGA_EA, Rev: 3.0 at 400 MHz, CSB: 266.667 MHz
0.168 RS: 232
0.172 I2C: ready
0.176 DRAM: 64 MB
1.236 FLASH: 32 MB
Versus:
0.016 CPU: e300c1, MPC8347_PBGA_EA, Rev: 3.0 at 400 MHz, CSB: 266.667 MHz
0.092 RS: 232
0.092 I2C: ready
0.096 DRAM: 64 MB
0.644 FLASH: 32 MB
So far no boards have needed the late LCRR setup, so simply revert it
for now - If it is needed at a later time, those boards can either do
their own final LCRR setup in board code (E.G. in board_early_init_r),
or we can introduce a CONFIG_SYS_LCRR_LATE config option to only do
the setup in cpu_init_r.
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
2009-12-08 21:20:34 +00:00
|
|
|
isync();
|
|
|
|
|
2009-09-25 23:19:44 +00:00
|
|
|
/* Enable Time Base & Decrementer ( so we will have udelay() )*/
|
|
|
|
setbits_be32(&im->sysconf.spcr, SPCR_TBEN);
|
2005-07-28 15:08:46 +00:00
|
|
|
|
|
|
|
/* System General Purpose Register */
|
2008-10-16 13:01:15 +00:00
|
|
|
#ifdef CONFIG_SYS_SICRH
|
2019-01-21 08:17:27 +00:00
|
|
|
#if defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_ARCH_MPC8313)
|
2008-06-23 09:40:56 +00:00
|
|
|
/* regarding to MPC34x manual rev.1 bits 28..29 must be preserved */
|
2009-09-25 23:19:44 +00:00
|
|
|
__raw_writel((im->sysconf.sicrh & 0x0000000C) | CONFIG_SYS_SICRH,
|
|
|
|
&im->sysconf.sicrh);
|
2008-06-23 09:40:56 +00:00
|
|
|
#else
|
2009-09-25 23:19:44 +00:00
|
|
|
__raw_writel(CONFIG_SYS_SICRH, &im->sysconf.sicrh);
|
2006-01-11 17:12:57 +00:00
|
|
|
#endif
|
2008-06-23 09:40:56 +00:00
|
|
|
#endif
|
2008-10-16 13:01:15 +00:00
|
|
|
#ifdef CONFIG_SYS_SICRL
|
2009-09-25 23:19:44 +00:00
|
|
|
__raw_writel(CONFIG_SYS_SICRL, &im->sysconf.sicrl);
|
2006-01-11 17:12:57 +00:00
|
|
|
#endif
|
2012-10-10 22:13:08 +00:00
|
|
|
#ifdef CONFIG_SYS_GPR1
|
|
|
|
__raw_writel(CONFIG_SYS_GPR1, &im->sysconf.gpr1);
|
|
|
|
#endif
|
2009-09-25 23:19:44 +00:00
|
|
|
#ifdef CONFIG_SYS_DDRCDR /* DDR control driver register */
|
|
|
|
__raw_writel(CONFIG_SYS_DDRCDR, &im->sysconf.ddrcdr);
|
2006-12-07 13:13:15 +00:00
|
|
|
#endif
|
2009-09-25 23:19:44 +00:00
|
|
|
#ifdef CONFIG_SYS_OBIR /* Output buffer impedance register */
|
|
|
|
__raw_writel(CONFIG_SYS_OBIR, &im->sysconf.obir);
|
2007-09-18 04:37:57 +00:00
|
|
|
#endif
|
2006-12-07 13:13:15 +00:00
|
|
|
|
2006-11-03 18:11:15 +00:00
|
|
|
#ifdef CONFIG_QE
|
|
|
|
/* Config QE ioports */
|
|
|
|
config_qe_ioports();
|
|
|
|
#endif
|
2010-06-17 16:37:20 +00:00
|
|
|
/* Set up preliminary BR/OR regs */
|
|
|
|
init_early_memctl_regs();
|
2005-07-28 15:08:46 +00:00
|
|
|
|
2010-06-17 16:37:20 +00:00
|
|
|
/* Local Access window setup */
|
|
|
|
#if defined(CONFIG_SYS_LBLAWBAR0_PRELIM) && defined(CONFIG_SYS_LBLAWAR0_PRELIM)
|
2008-10-16 13:01:15 +00:00
|
|
|
im->sysconf.lblaw[0].bar = CONFIG_SYS_LBLAWBAR0_PRELIM;
|
|
|
|
im->sysconf.lblaw[0].ar = CONFIG_SYS_LBLAWAR0_PRELIM;
|
2005-07-28 15:08:46 +00:00
|
|
|
#else
|
2010-06-17 16:37:20 +00:00
|
|
|
#error CONFIG_SYS_LBLAWBAR0_PRELIM & CONFIG_SYS_LBLAWAR0_PRELIM must be defined
|
2005-07-28 15:08:46 +00:00
|
|
|
#endif
|
|
|
|
|
2008-10-16 13:01:15 +00:00
|
|
|
#if defined(CONFIG_SYS_LBLAWBAR1_PRELIM) && defined(CONFIG_SYS_LBLAWAR1_PRELIM)
|
|
|
|
im->sysconf.lblaw[1].bar = CONFIG_SYS_LBLAWBAR1_PRELIM;
|
|
|
|
im->sysconf.lblaw[1].ar = CONFIG_SYS_LBLAWAR1_PRELIM;
|
2005-07-28 15:08:46 +00:00
|
|
|
#endif
|
2008-10-16 13:01:15 +00:00
|
|
|
#if defined(CONFIG_SYS_LBLAWBAR2_PRELIM) && defined(CONFIG_SYS_LBLAWAR2_PRELIM)
|
|
|
|
im->sysconf.lblaw[2].bar = CONFIG_SYS_LBLAWBAR2_PRELIM;
|
|
|
|
im->sysconf.lblaw[2].ar = CONFIG_SYS_LBLAWAR2_PRELIM;
|
2005-07-28 15:08:46 +00:00
|
|
|
#endif
|
2008-10-16 13:01:15 +00:00
|
|
|
#if defined(CONFIG_SYS_LBLAWBAR3_PRELIM) && defined(CONFIG_SYS_LBLAWAR3_PRELIM)
|
|
|
|
im->sysconf.lblaw[3].bar = CONFIG_SYS_LBLAWBAR3_PRELIM;
|
|
|
|
im->sysconf.lblaw[3].ar = CONFIG_SYS_LBLAWAR3_PRELIM;
|
2005-07-28 15:08:46 +00:00
|
|
|
#endif
|
2008-10-16 13:01:15 +00:00
|
|
|
#if defined(CONFIG_SYS_LBLAWBAR4_PRELIM) && defined(CONFIG_SYS_LBLAWAR4_PRELIM)
|
|
|
|
im->sysconf.lblaw[4].bar = CONFIG_SYS_LBLAWBAR4_PRELIM;
|
|
|
|
im->sysconf.lblaw[4].ar = CONFIG_SYS_LBLAWAR4_PRELIM;
|
2005-07-28 15:08:46 +00:00
|
|
|
#endif
|
2008-10-16 13:01:15 +00:00
|
|
|
#if defined(CONFIG_SYS_LBLAWBAR5_PRELIM) && defined(CONFIG_SYS_LBLAWAR5_PRELIM)
|
|
|
|
im->sysconf.lblaw[5].bar = CONFIG_SYS_LBLAWBAR5_PRELIM;
|
|
|
|
im->sysconf.lblaw[5].ar = CONFIG_SYS_LBLAWAR5_PRELIM;
|
2005-07-28 15:08:46 +00:00
|
|
|
#endif
|
2008-10-16 13:01:15 +00:00
|
|
|
#if defined(CONFIG_SYS_LBLAWBAR6_PRELIM) && defined(CONFIG_SYS_LBLAWAR6_PRELIM)
|
|
|
|
im->sysconf.lblaw[6].bar = CONFIG_SYS_LBLAWBAR6_PRELIM;
|
|
|
|
im->sysconf.lblaw[6].ar = CONFIG_SYS_LBLAWAR6_PRELIM;
|
2005-07-28 15:08:46 +00:00
|
|
|
#endif
|
2008-10-16 13:01:15 +00:00
|
|
|
#if defined(CONFIG_SYS_LBLAWBAR7_PRELIM) && defined(CONFIG_SYS_LBLAWAR7_PRELIM)
|
|
|
|
im->sysconf.lblaw[7].bar = CONFIG_SYS_LBLAWBAR7_PRELIM;
|
|
|
|
im->sysconf.lblaw[7].ar = CONFIG_SYS_LBLAWAR7_PRELIM;
|
2005-07-28 15:08:46 +00:00
|
|
|
#endif
|
2008-10-16 13:01:15 +00:00
|
|
|
#ifdef CONFIG_SYS_GPIO1_PRELIM
|
|
|
|
im->gpio[0].dat = CONFIG_SYS_GPIO1_DAT;
|
|
|
|
im->gpio[0].dir = CONFIG_SYS_GPIO1_DIR;
|
2006-01-11 17:21:14 +00:00
|
|
|
#endif
|
2008-10-16 13:01:15 +00:00
|
|
|
#ifdef CONFIG_SYS_GPIO2_PRELIM
|
|
|
|
im->gpio[1].dat = CONFIG_SYS_GPIO2_DAT;
|
|
|
|
im->gpio[1].dir = CONFIG_SYS_GPIO2_DIR;
|
2006-01-11 17:21:14 +00:00
|
|
|
#endif
|
2019-01-21 08:17:25 +00:00
|
|
|
#if defined(CONFIG_USB_EHCI_FSL) && defined(CONFIG_ARCH_MPC831X)
|
2009-05-25 11:53:16 +00:00
|
|
|
uint32_t temp;
|
2013-09-12 11:05:49 +00:00
|
|
|
struct usb_ehci *ehci = (struct usb_ehci *)CONFIG_SYS_FSL_USB1_ADDR;
|
2009-05-25 11:53:16 +00:00
|
|
|
|
|
|
|
/* Configure interface. */
|
2009-06-24 04:38:40 +00:00
|
|
|
setbits_be32(&ehci->control, REFSEL_16MHZ | UTMI_PHY_EN);
|
2009-05-25 11:53:16 +00:00
|
|
|
|
|
|
|
/* Wait for clock to stabilize */
|
|
|
|
do {
|
2009-09-25 23:19:44 +00:00
|
|
|
temp = __raw_readl(&ehci->control);
|
2009-05-25 11:53:16 +00:00
|
|
|
udelay(1000);
|
|
|
|
} while (!(temp & PHY_CLK_VALID));
|
|
|
|
#endif
|
2005-07-28 15:08:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int cpu_init_r (void)
|
|
|
|
{
|
2006-11-03 18:11:15 +00:00
|
|
|
#ifdef CONFIG_QE
|
2008-10-16 13:01:15 +00:00
|
|
|
uint qe_base = CONFIG_SYS_IMMR + 0x00100000; /* QE immr base */
|
2009-09-25 23:19:44 +00:00
|
|
|
|
2006-11-03 18:11:15 +00:00
|
|
|
qe_init(qe_base);
|
|
|
|
qe_reset();
|
|
|
|
#endif
|
2005-07-28 15:08:46 +00:00
|
|
|
return 0;
|
|
|
|
}
|
mpc83xx: Add support for the display of reset status
83xx processor family has many reset sources, such as
power on reset, software hard reset, software soft reset,
JTAG, bus monitor, software watchdog, check stop reset,
external hard reset, external software reset.
sometimes, to figure out the fault of system, we need to
know the cause of reset early before the prompt of
u-boot present.
Signed-off-by: Dave Liu <daveliu@freescale.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
2007-06-25 02:41:56 +00:00
|
|
|
|
2008-08-28 21:09:19 +00:00
|
|
|
/*
|
|
|
|
* Print out the bus arbiter event
|
|
|
|
*/
|
|
|
|
#if defined(CONFIG_DISPLAY_AER_FULL)
|
|
|
|
static int print_83xx_arb_event(int force)
|
|
|
|
{
|
|
|
|
static char* event[] = {
|
|
|
|
"Address Time Out",
|
|
|
|
"Data Time Out",
|
|
|
|
"Address Only Transfer Type",
|
|
|
|
"External Control Word Transfer Type",
|
|
|
|
"Reserved Transfer Type",
|
|
|
|
"Transfer Error",
|
|
|
|
"reserved",
|
|
|
|
"reserved"
|
|
|
|
};
|
|
|
|
static char* master[] = {
|
|
|
|
"e300 Core Data Transaction",
|
|
|
|
"reserved",
|
|
|
|
"e300 Core Instruction Fetch",
|
|
|
|
"reserved",
|
|
|
|
"TSEC1",
|
|
|
|
"TSEC2",
|
|
|
|
"USB MPH",
|
|
|
|
"USB DR",
|
|
|
|
"Encryption Core",
|
|
|
|
"I2C Boot Sequencer",
|
|
|
|
"JTAG",
|
|
|
|
"reserved",
|
|
|
|
"eSDHC",
|
|
|
|
"PCI1",
|
|
|
|
"PCI2",
|
|
|
|
"DMA",
|
|
|
|
"QUICC Engine 00",
|
|
|
|
"QUICC Engine 01",
|
|
|
|
"QUICC Engine 10",
|
|
|
|
"QUICC Engine 11",
|
|
|
|
"reserved",
|
|
|
|
"reserved",
|
|
|
|
"reserved",
|
|
|
|
"reserved",
|
|
|
|
"SATA1",
|
|
|
|
"SATA2",
|
|
|
|
"SATA3",
|
|
|
|
"SATA4",
|
|
|
|
"reserved",
|
|
|
|
"PCI Express 1",
|
|
|
|
"PCI Express 2",
|
|
|
|
"TDM-DMAC"
|
|
|
|
};
|
|
|
|
static char *transfer[] = {
|
|
|
|
"Address-only, Clean Block",
|
|
|
|
"Address-only, lwarx reservation set",
|
|
|
|
"Single-beat or Burst write",
|
|
|
|
"reserved",
|
|
|
|
"Address-only, Flush Block",
|
|
|
|
"reserved",
|
|
|
|
"Burst write",
|
|
|
|
"reserved",
|
|
|
|
"Address-only, sync",
|
|
|
|
"Address-only, tlbsync",
|
|
|
|
"Single-beat or Burst read",
|
|
|
|
"Single-beat or Burst read",
|
|
|
|
"Address-only, Kill Block",
|
|
|
|
"Address-only, icbi",
|
|
|
|
"Burst read",
|
|
|
|
"reserved",
|
|
|
|
"Address-only, eieio",
|
|
|
|
"reserved",
|
|
|
|
"Single-beat write",
|
|
|
|
"reserved",
|
|
|
|
"ecowx - Illegal single-beat write",
|
|
|
|
"reserved",
|
|
|
|
"reserved",
|
|
|
|
"reserved",
|
|
|
|
"Address-only, TLB Invalidate",
|
|
|
|
"reserved",
|
|
|
|
"Single-beat or Burst read",
|
|
|
|
"reserved",
|
|
|
|
"eciwx - Illegal single-beat read",
|
|
|
|
"reserved",
|
|
|
|
"Burst read",
|
|
|
|
"reserved"
|
|
|
|
};
|
|
|
|
|
2012-12-13 20:48:57 +00:00
|
|
|
int etype = (gd->arch.arbiter_event_attributes & AEATR_EVENT)
|
2013-10-04 15:43:24 +00:00
|
|
|
>> AEATR_EVENT_SHIFT;
|
2012-12-13 20:48:57 +00:00
|
|
|
int mstr_id = (gd->arch.arbiter_event_attributes & AEATR_MSTR_ID)
|
2013-10-04 15:43:24 +00:00
|
|
|
>> AEATR_MSTR_ID_SHIFT;
|
2012-12-13 20:48:57 +00:00
|
|
|
int tbst = (gd->arch.arbiter_event_attributes & AEATR_TBST)
|
2013-10-04 15:43:24 +00:00
|
|
|
>> AEATR_TBST_SHIFT;
|
2012-12-13 20:48:57 +00:00
|
|
|
int tsize = (gd->arch.arbiter_event_attributes & AEATR_TSIZE)
|
2013-10-04 15:43:24 +00:00
|
|
|
>> AEATR_TSIZE_SHIFT;
|
2012-12-13 20:48:57 +00:00
|
|
|
int ttype = (gd->arch.arbiter_event_attributes & AEATR_TTYPE)
|
2013-10-04 15:43:24 +00:00
|
|
|
>> AEATR_TTYPE_SHIFT;
|
2008-08-28 21:09:19 +00:00
|
|
|
|
2012-12-13 20:48:57 +00:00
|
|
|
if (!force && !gd->arch.arbiter_event_address)
|
2008-08-28 21:09:19 +00:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
puts("Arbiter Event Status:\n");
|
2012-12-13 20:48:57 +00:00
|
|
|
printf(" Event Address: 0x%08lX\n",
|
|
|
|
gd->arch.arbiter_event_address);
|
2008-08-28 21:09:19 +00:00
|
|
|
printf(" Event Type: 0x%1x = %s\n", etype, event[etype]);
|
|
|
|
printf(" Master ID: 0x%02x = %s\n", mstr_id, master[mstr_id]);
|
|
|
|
printf(" Transfer Size: 0x%1x = %d bytes\n", (tbst<<3) | tsize,
|
|
|
|
tbst ? (tsize ? tsize : 8) : 16 + 8 * tsize);
|
|
|
|
printf(" Transfer Type: 0x%02x = %s\n", ttype, transfer[ttype]);
|
|
|
|
|
2012-12-13 20:48:57 +00:00
|
|
|
return gd->arch.arbiter_event_address;
|
2008-08-28 21:09:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#elif defined(CONFIG_DISPLAY_AER_BRIEF)
|
|
|
|
|
|
|
|
static int print_83xx_arb_event(int force)
|
|
|
|
{
|
2012-12-13 20:48:57 +00:00
|
|
|
if (!force && !gd->arch.arbiter_event_address)
|
2008-08-28 21:09:19 +00:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
printf("Arbiter Event Status: AEATR=0x%08lX, AEADR=0x%08lX\n",
|
2012-12-13 20:48:57 +00:00
|
|
|
gd->arch.arbiter_event_attributes,
|
|
|
|
gd->arch.arbiter_event_address);
|
2008-08-28 21:09:19 +00:00
|
|
|
|
2012-12-13 20:48:57 +00:00
|
|
|
return gd->arch.arbiter_event_address;
|
2008-08-28 21:09:19 +00:00
|
|
|
}
|
|
|
|
#endif /* CONFIG_DISPLAY_AER_xxxx */
|
|
|
|
|
2018-08-06 08:23:45 +00:00
|
|
|
#ifndef CONFIG_CPU_MPC83XX
|
mpc83xx: Add support for the display of reset status
83xx processor family has many reset sources, such as
power on reset, software hard reset, software soft reset,
JTAG, bus monitor, software watchdog, check stop reset,
external hard reset, external software reset.
sometimes, to figure out the fault of system, we need to
know the cause of reset early before the prompt of
u-boot present.
Signed-off-by: Dave Liu <daveliu@freescale.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
2007-06-25 02:41:56 +00:00
|
|
|
/*
|
|
|
|
* Figure out the cause of the reset
|
|
|
|
*/
|
|
|
|
int prt_83xx_rsr(void)
|
|
|
|
{
|
|
|
|
static struct {
|
|
|
|
ulong mask;
|
|
|
|
char *desc;
|
|
|
|
} bits[] = {
|
|
|
|
{
|
|
|
|
RSR_SWSR, "Software Soft"}, {
|
|
|
|
RSR_SWHR, "Software Hard"}, {
|
|
|
|
RSR_JSRS, "JTAG Soft"}, {
|
|
|
|
RSR_CSHR, "Check Stop"}, {
|
|
|
|
RSR_SWRS, "Software Watchdog"}, {
|
|
|
|
RSR_BMRS, "Bus Monitor"}, {
|
|
|
|
RSR_SRS, "External/Internal Soft"}, {
|
|
|
|
RSR_HRS, "External/Internal Hard"}
|
|
|
|
};
|
2016-05-23 10:49:21 +00:00
|
|
|
static int n = ARRAY_SIZE(bits);
|
2012-12-13 20:48:56 +00:00
|
|
|
ulong rsr = gd->arch.reset_status;
|
mpc83xx: Add support for the display of reset status
83xx processor family has many reset sources, such as
power on reset, software hard reset, software soft reset,
JTAG, bus monitor, software watchdog, check stop reset,
external hard reset, external software reset.
sometimes, to figure out the fault of system, we need to
know the cause of reset early before the prompt of
u-boot present.
Signed-off-by: Dave Liu <daveliu@freescale.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
2007-06-25 02:41:56 +00:00
|
|
|
int i;
|
|
|
|
char *sep;
|
|
|
|
|
|
|
|
puts("Reset Status:");
|
|
|
|
|
|
|
|
sep = " ";
|
|
|
|
for (i = 0; i < n; i++)
|
|
|
|
if (rsr & bits[i].mask) {
|
|
|
|
printf("%s%s", sep, bits[i].desc);
|
|
|
|
sep = ", ";
|
|
|
|
}
|
2008-08-28 21:09:19 +00:00
|
|
|
puts("\n");
|
|
|
|
|
|
|
|
#if defined(CONFIG_DISPLAY_AER_FULL) || defined(CONFIG_DISPLAY_AER_BRIEF)
|
|
|
|
print_83xx_arb_event(rsr & RSR_BMRS);
|
|
|
|
#endif
|
|
|
|
puts("\n");
|
|
|
|
|
mpc83xx: Add support for the display of reset status
83xx processor family has many reset sources, such as
power on reset, software hard reset, software soft reset,
JTAG, bus monitor, software watchdog, check stop reset,
external hard reset, external software reset.
sometimes, to figure out the fault of system, we need to
know the cause of reset early before the prompt of
u-boot present.
Signed-off-by: Dave Liu <daveliu@freescale.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
2007-06-25 02:41:56 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2018-08-06 08:23:45 +00:00
|
|
|
#endif
|