mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 15:14:43 +00:00
powerpc: remove 4xx support
There was for long time no activity in the 4xx area. We need to go further and convert to Kconfig, but it turned out, nobody is interested anymore in 4xx, so remove it. Signed-off-by: Heiko Schocher <hs@denx.de>
This commit is contained in:
parent
d4db3b86a5
commit
98f705c9ce
471 changed files with 14 additions and 85191 deletions
7
README
7
README
|
@ -833,8 +833,6 @@ The following options need to be configured:
|
|||
CONFIG_SCSI * SCSI Support
|
||||
CONFIG_CMD_SDRAM * print SDRAM configuration information
|
||||
(requires CONFIG_CMD_I2C)
|
||||
CONFIG_CMD_SETGETDCR Support for DCR Register access
|
||||
(4xx only)
|
||||
CONFIG_CMD_SF * Read/write/erase SPI NOR flash
|
||||
CONFIG_CMD_SOFTSWITCH * Soft switch setting command for BF60x
|
||||
CONFIG_CMD_SOURCE "source" command Support
|
||||
|
@ -3951,7 +3949,6 @@ Low Level (hardware related) configuration options:
|
|||
sequences.
|
||||
|
||||
U-Boot uses the following memory types:
|
||||
- PPC4xx: data cache
|
||||
|
||||
- CONFIG_SYS_GBL_DATA_OFFSET:
|
||||
|
||||
|
@ -3990,10 +3987,6 @@ Low Level (hardware related) configuration options:
|
|||
CONFIG_SYS_OR3_PRELIM, CONFIG_SYS_BR3_PRELIM:
|
||||
Memory Controller Definitions: BR2/3 and OR2/3 (SDRAM)
|
||||
|
||||
- CONFIG_PCI_DISABLE_PCIE:
|
||||
Disable PCI-Express on systems where it is supported but not
|
||||
required.
|
||||
|
||||
- CONFIG_PCI_ENUM_ONLY
|
||||
Only scan through and get the devices on the buses.
|
||||
Don't do any setup work, presumably because someone or
|
||||
|
|
|
@ -29,16 +29,10 @@ config MPC86xx
|
|||
select SYS_FSL_DDR
|
||||
select SYS_FSL_DDR_BE
|
||||
|
||||
config 4xx
|
||||
bool "PPC4xx"
|
||||
select CREATE_ARCH_SYMLINK
|
||||
imply CMD_IRQ
|
||||
|
||||
endchoice
|
||||
|
||||
source "arch/powerpc/cpu/mpc83xx/Kconfig"
|
||||
source "arch/powerpc/cpu/mpc85xx/Kconfig"
|
||||
source "arch/powerpc/cpu/mpc86xx/Kconfig"
|
||||
source "arch/powerpc/cpu/ppc4xx/Kconfig"
|
||||
|
||||
endmenu
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
#
|
||||
|
||||
head-y := arch/powerpc/cpu/$(CPU)/start.o
|
||||
head-$(CONFIG_4xx) += arch/powerpc/cpu/ppc4xx/resetvec.o
|
||||
head-$(CONFIG_MPC85xx) += arch/powerpc/cpu/mpc85xx/resetvec.o
|
||||
|
||||
libs-y += arch/powerpc/cpu/$(CPU)/
|
||||
|
|
|
@ -1,444 +0,0 @@
|
|||
/*
|
||||
* arch/powerpc/cpu/ppc4xx/40x_spd_sdram.c
|
||||
* This SPD SDRAM detection code supports IBM/AMCC PPC44x cpu with a
|
||||
* SDRAM controller. Those are all current 405 PPC's.
|
||||
*
|
||||
* (C) Copyright 2001
|
||||
* Bill Hunter, Wave 7 Optics, williamhunter@attbi.com
|
||||
*
|
||||
* Based on code by:
|
||||
*
|
||||
* Kenneth Johansson ,Ericsson AB.
|
||||
* kenneth.johansson@etx.ericsson.se
|
||||
*
|
||||
* hacked up by bill hunter. fixed so we could run before
|
||||
* serial_init and console_init. previous version avoided this by
|
||||
* running out of cache memory during serial/console init, then running
|
||||
* this code later.
|
||||
*
|
||||
* (C) Copyright 2002
|
||||
* Jun Gu, Artesyn Technology, jung@artesyncp.com
|
||||
* Support for AMCC 440 based on OpenBIOS draminit.c from IBM.
|
||||
*
|
||||
* (C) Copyright 2005
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/processor.h>
|
||||
#include <i2c.h>
|
||||
#include <asm/ppc4xx.h>
|
||||
|
||||
#if defined(CONFIG_SPD_EEPROM) && !defined(CONFIG_440)
|
||||
|
||||
/*
|
||||
* Set default values
|
||||
*/
|
||||
#define ONE_BILLION 1000000000
|
||||
|
||||
#define SDRAM0_CFG_DCE 0x80000000
|
||||
#define SDRAM0_CFG_SRE 0x40000000
|
||||
#define SDRAM0_CFG_PME 0x20000000
|
||||
#define SDRAM0_CFG_MEMCHK 0x10000000
|
||||
#define SDRAM0_CFG_REGEN 0x08000000
|
||||
#define SDRAM0_CFG_ECCDD 0x00400000
|
||||
#define SDRAM0_CFG_EMDULR 0x00200000
|
||||
#define SDRAM0_CFG_DRW_SHIFT (31-6)
|
||||
#define SDRAM0_CFG_BRPF_SHIFT (31-8)
|
||||
|
||||
#define SDRAM0_TR_CASL_SHIFT (31-8)
|
||||
#define SDRAM0_TR_PTA_SHIFT (31-13)
|
||||
#define SDRAM0_TR_CTP_SHIFT (31-15)
|
||||
#define SDRAM0_TR_LDF_SHIFT (31-17)
|
||||
#define SDRAM0_TR_RFTA_SHIFT (31-29)
|
||||
#define SDRAM0_TR_RCD_SHIFT (31-31)
|
||||
|
||||
#define SDRAM0_RTR_SHIFT (31-15)
|
||||
#define SDRAM0_ECCCFG_SHIFT (31-11)
|
||||
|
||||
/* SDRAM0_CFG enable macro */
|
||||
#define SDRAM0_CFG_BRPF(x) ( ( x & 0x3)<< SDRAM0_CFG_BRPF_SHIFT )
|
||||
|
||||
#define SDRAM0_BXCR_SZ_MASK 0x000e0000
|
||||
#define SDRAM0_BXCR_AM_MASK 0x0000e000
|
||||
|
||||
#define SDRAM0_BXCR_SZ_SHIFT (31-14)
|
||||
#define SDRAM0_BXCR_AM_SHIFT (31-18)
|
||||
|
||||
#define SDRAM0_BXCR_SZ(x) ( (( x << SDRAM0_BXCR_SZ_SHIFT) & SDRAM0_BXCR_SZ_MASK) )
|
||||
#define SDRAM0_BXCR_AM(x) ( (( x << SDRAM0_BXCR_AM_SHIFT) & SDRAM0_BXCR_AM_MASK) )
|
||||
|
||||
#ifdef CONFIG_SPDDRAM_SILENT
|
||||
# define SPD_ERR(x) do { return 0; } while (0)
|
||||
#else
|
||||
# define SPD_ERR(x) do { printf(x); return(0); } while (0)
|
||||
#endif
|
||||
|
||||
#define sdram_HZ_to_ns(hertz) (1000000000/(hertz))
|
||||
|
||||
/* function prototypes */
|
||||
int spd_read(uint addr);
|
||||
|
||||
|
||||
/*
|
||||
* This function is reading data from the DIMM module EEPROM over the SPD bus
|
||||
* and uses that to program the sdram controller.
|
||||
*
|
||||
* This works on boards that has the same schematics that the AMCC walnut has.
|
||||
*
|
||||
* Input: null for default I2C spd functions or a pointer to a custom function
|
||||
* returning spd_data.
|
||||
*/
|
||||
|
||||
long int spd_sdram(int(read_spd)(uint addr))
|
||||
{
|
||||
int tmp,row,col;
|
||||
int total_size,bank_size,bank_code;
|
||||
int mode;
|
||||
int bank_cnt;
|
||||
|
||||
int sdram0_pmit=0x07c00000;
|
||||
int sdram0_b0cr;
|
||||
int sdram0_b1cr = 0;
|
||||
#ifndef CONFIG_405EP /* not on PPC405EP */
|
||||
int sdram0_b2cr = 0;
|
||||
int sdram0_b3cr = 0;
|
||||
int sdram0_besr0 = -1;
|
||||
int sdram0_besr1 = -1;
|
||||
int sdram0_eccesr = -1;
|
||||
int sdram0_ecccfg;
|
||||
int ecc_on;
|
||||
#endif
|
||||
|
||||
int sdram0_rtr=0;
|
||||
int sdram0_tr=0;
|
||||
|
||||
int sdram0_cfg=0;
|
||||
|
||||
int t_rp;
|
||||
int t_rcd;
|
||||
int t_ras;
|
||||
int t_rc;
|
||||
int min_cas;
|
||||
|
||||
PPC4xx_SYS_INFO sys_info;
|
||||
unsigned long bus_period_x_10;
|
||||
|
||||
/*
|
||||
* get the board info
|
||||
*/
|
||||
get_sys_info(&sys_info);
|
||||
bus_period_x_10 = ONE_BILLION / (sys_info.freqPLB / 10);
|
||||
|
||||
if (read_spd == 0){
|
||||
read_spd=spd_read;
|
||||
/*
|
||||
* Make sure I2C controller is initialized
|
||||
* before continuing.
|
||||
*/
|
||||
i2c_set_bus_num(CONFIG_SYS_SPD_BUS_NUM);
|
||||
}
|
||||
|
||||
/* Make shure we are using SDRAM */
|
||||
if (read_spd(2) != 0x04) {
|
||||
SPD_ERR("SDRAM - non SDRAM memory module found\n");
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------
|
||||
* configure memory timing register
|
||||
*
|
||||
* data from DIMM:
|
||||
* 27 IN Row Precharge Time ( t RP)
|
||||
* 29 MIN RAS to CAS Delay ( t RCD)
|
||||
* 127 Component and Clock Detail ,clk0-clk3, junction temp, CAS
|
||||
* -------------------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
* first figure out which cas latency mode to use
|
||||
* use the min supported mode
|
||||
*/
|
||||
|
||||
tmp = read_spd(127) & 0x6;
|
||||
if (tmp == 0x02) { /* only cas = 2 supported */
|
||||
min_cas = 2;
|
||||
/* t_ck = read_spd(9); */
|
||||
/* t_ac = read_spd(10); */
|
||||
} else if (tmp == 0x04) { /* only cas = 3 supported */
|
||||
min_cas = 3;
|
||||
/* t_ck = read_spd(9); */
|
||||
/* t_ac = read_spd(10); */
|
||||
} else if (tmp == 0x06) { /* 2,3 supported, so use 2 */
|
||||
min_cas = 2;
|
||||
/* t_ck = read_spd(23); */
|
||||
/* t_ac = read_spd(24); */
|
||||
} else {
|
||||
SPD_ERR("SDRAM - unsupported CAS latency \n");
|
||||
}
|
||||
|
||||
/* get some timing values, t_rp,t_rcd,t_ras,t_rc
|
||||
*/
|
||||
t_rp = read_spd(27);
|
||||
t_rcd = read_spd(29);
|
||||
t_ras = read_spd(30);
|
||||
t_rc = t_ras + t_rp;
|
||||
|
||||
/* The following timing calcs subtract 1 before deviding.
|
||||
* this has effect of using ceiling instead of floor rounding,
|
||||
* and also subtracting 1 to convert number to reg value
|
||||
*/
|
||||
/* set up CASL */
|
||||
sdram0_tr = (min_cas - 1) << SDRAM0_TR_CASL_SHIFT;
|
||||
/* set up PTA */
|
||||
sdram0_tr |= ((((t_rp - 1) * 10)/bus_period_x_10) & 0x3) << SDRAM0_TR_PTA_SHIFT;
|
||||
/* set up CTP */
|
||||
tmp = (((t_rc - t_rcd - t_rp -1) * 10) / bus_period_x_10) & 0x3;
|
||||
if (tmp < 1)
|
||||
tmp = 1;
|
||||
sdram0_tr |= tmp << SDRAM0_TR_CTP_SHIFT;
|
||||
/* set LDF = 2 cycles, reg value = 1 */
|
||||
sdram0_tr |= 1 << SDRAM0_TR_LDF_SHIFT;
|
||||
/* set RFTA = t_rfc/bus_period, use t_rfc = t_rc */
|
||||
tmp = (((t_rc - 1) * 10) / bus_period_x_10) - 3;
|
||||
if (tmp < 0)
|
||||
tmp = 0;
|
||||
if (tmp > 6)
|
||||
tmp = 6;
|
||||
sdram0_tr |= tmp << SDRAM0_TR_RFTA_SHIFT;
|
||||
/* set RCD = t_rcd/bus_period*/
|
||||
sdram0_tr |= ((((t_rcd - 1) * 10) / bus_period_x_10) &0x3) << SDRAM0_TR_RCD_SHIFT ;
|
||||
|
||||
|
||||
/*------------------------------------------------------------------
|
||||
* configure RTR register
|
||||
* -------------------------------------------------------------------*/
|
||||
row = read_spd(3);
|
||||
col = read_spd(4);
|
||||
tmp = read_spd(12) & 0x7f ; /* refresh type less self refresh bit */
|
||||
switch (tmp) {
|
||||
case 0x00:
|
||||
tmp = 15625;
|
||||
break;
|
||||
case 0x01:
|
||||
tmp = 15625 / 4;
|
||||
break;
|
||||
case 0x02:
|
||||
tmp = 15625 / 2;
|
||||
break;
|
||||
case 0x03:
|
||||
tmp = 15625 * 2;
|
||||
break;
|
||||
case 0x04:
|
||||
tmp = 15625 * 4;
|
||||
break;
|
||||
case 0x05:
|
||||
tmp = 15625 * 8;
|
||||
break;
|
||||
default:
|
||||
SPD_ERR("SDRAM - Bad refresh period \n");
|
||||
}
|
||||
/* convert from nsec to bus cycles */
|
||||
tmp = (tmp * 10) / bus_period_x_10;
|
||||
sdram0_rtr = (tmp & 0x3ff8) << SDRAM0_RTR_SHIFT;
|
||||
|
||||
/*------------------------------------------------------------------
|
||||
* determine the number of banks used
|
||||
* -------------------------------------------------------------------*/
|
||||
/* byte 7:6 is module data width */
|
||||
if (read_spd(7) != 0)
|
||||
SPD_ERR("SDRAM - unsupported module width\n");
|
||||
tmp = read_spd(6);
|
||||
if (tmp < 32)
|
||||
SPD_ERR("SDRAM - unsupported module width\n");
|
||||
else if (tmp < 64)
|
||||
bank_cnt = 1; /* one bank per sdram side */
|
||||
else if (tmp < 73)
|
||||
bank_cnt = 2; /* need two banks per side */
|
||||
else if (tmp < 161)
|
||||
bank_cnt = 4; /* need four banks per side */
|
||||
else
|
||||
SPD_ERR("SDRAM - unsupported module width\n");
|
||||
|
||||
/* byte 5 is the module row count (refered to as dimm "sides") */
|
||||
tmp = read_spd(5);
|
||||
if (tmp == 1)
|
||||
;
|
||||
else if (tmp==2)
|
||||
bank_cnt *= 2;
|
||||
else if (tmp==4)
|
||||
bank_cnt *= 4;
|
||||
else
|
||||
bank_cnt = 8; /* 8 is an error code */
|
||||
|
||||
if (bank_cnt > 4) /* we only have 4 banks to work with */
|
||||
SPD_ERR("SDRAM - unsupported module rows for this width\n");
|
||||
|
||||
#ifndef CONFIG_405EP /* not on PPC405EP */
|
||||
/* now check for ECC ability of module. We only support ECC
|
||||
* on 32 bit wide devices with 8 bit ECC.
|
||||
*/
|
||||
if ((read_spd(11)==2) && (read_spd(6)==40) && (read_spd(14)==8)) {
|
||||
sdram0_ecccfg = 0xf << SDRAM0_ECCCFG_SHIFT;
|
||||
ecc_on = 1;
|
||||
} else {
|
||||
sdram0_ecccfg = 0;
|
||||
ecc_on = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------
|
||||
* calculate total size
|
||||
* -------------------------------------------------------------------*/
|
||||
/* calculate total size and do sanity check */
|
||||
tmp = read_spd(31);
|
||||
total_size = 1 << 22; /* total_size = 4MB */
|
||||
/* now multiply 4M by the smallest device row density */
|
||||
/* note that we don't support asymetric rows */
|
||||
while (((tmp & 0x0001) == 0) && (tmp != 0)) {
|
||||
total_size = total_size << 1;
|
||||
tmp = tmp >> 1;
|
||||
}
|
||||
total_size *= read_spd(5); /* mult by module rows (dimm sides) */
|
||||
|
||||
/*------------------------------------------------------------------
|
||||
* map rows * cols * banks to a mode
|
||||
* -------------------------------------------------------------------*/
|
||||
|
||||
switch (row) {
|
||||
case 11:
|
||||
switch (col) {
|
||||
case 8:
|
||||
mode=4; /* mode 5 */
|
||||
break;
|
||||
case 9:
|
||||
case 10:
|
||||
mode=0; /* mode 1 */
|
||||
break;
|
||||
default:
|
||||
SPD_ERR("SDRAM - unsupported mode\n");
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
switch (col) {
|
||||
case 8:
|
||||
mode=3; /* mode 4 */
|
||||
break;
|
||||
case 9:
|
||||
case 10:
|
||||
mode=1; /* mode 2 */
|
||||
break;
|
||||
default:
|
||||
SPD_ERR("SDRAM - unsupported mode\n");
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
switch (col) {
|
||||
case 8:
|
||||
mode=5; /* mode 6 */
|
||||
break;
|
||||
case 9:
|
||||
case 10:
|
||||
if (read_spd(17) == 2)
|
||||
mode = 6; /* mode 7 */
|
||||
else
|
||||
mode = 2; /* mode 3 */
|
||||
break;
|
||||
case 11:
|
||||
mode = 2; /* mode 3 */
|
||||
break;
|
||||
default:
|
||||
SPD_ERR("SDRAM - unsupported mode\n");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
SPD_ERR("SDRAM - unsupported mode\n");
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------
|
||||
* using the calculated values, compute the bank
|
||||
* config register values.
|
||||
* -------------------------------------------------------------------*/
|
||||
|
||||
/* compute the size of each bank */
|
||||
bank_size = total_size / bank_cnt;
|
||||
/* convert bank size to bank size code for ppc4xx
|
||||
by takeing log2(bank_size) - 22 */
|
||||
tmp = bank_size; /* start with tmp = bank_size */
|
||||
bank_code = 0; /* and bank_code = 0 */
|
||||
while (tmp > 1) { /* this takes log2 of tmp */
|
||||
bank_code++; /* and stores result in bank_code */
|
||||
tmp = tmp >> 1;
|
||||
} /* bank_code is now log2(bank_size) */
|
||||
bank_code -= 22; /* subtract 22 to get the code */
|
||||
|
||||
tmp = SDRAM0_BXCR_SZ(bank_code) | SDRAM0_BXCR_AM(mode) | 1;
|
||||
sdram0_b0cr = (bank_size * 0) | tmp;
|
||||
#ifndef CONFIG_405EP /* not on PPC405EP */
|
||||
if (bank_cnt > 1)
|
||||
sdram0_b2cr = (bank_size * 1) | tmp;
|
||||
if (bank_cnt > 2)
|
||||
sdram0_b1cr = (bank_size * 2) | tmp;
|
||||
if (bank_cnt > 3)
|
||||
sdram0_b3cr = (bank_size * 3) | tmp;
|
||||
#else
|
||||
/* PPC405EP chip only supports two SDRAM banks */
|
||||
if (bank_cnt > 1)
|
||||
sdram0_b1cr = (bank_size * 1) | tmp;
|
||||
if (bank_cnt > 2)
|
||||
total_size = 2 * bank_size;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* enable sdram controller DCE=1
|
||||
* enable burst read prefetch to 32 bytes BRPF=2
|
||||
* leave other functions off
|
||||
*/
|
||||
|
||||
/*------------------------------------------------------------------
|
||||
* now that we've done our calculations, we are ready to
|
||||
* program all the registers.
|
||||
* -------------------------------------------------------------------*/
|
||||
|
||||
/* disable memcontroller so updates work */
|
||||
mtsdram(SDRAM0_CFG, 0);
|
||||
|
||||
#ifndef CONFIG_405EP /* not on PPC405EP */
|
||||
mtsdram(SDRAM0_BESR0, sdram0_besr0);
|
||||
mtsdram(SDRAM0_BESR1, sdram0_besr1);
|
||||
mtsdram(SDRAM0_ECCCFG, sdram0_ecccfg);
|
||||
mtsdram(SDRAM0_ECCESR, sdram0_eccesr);
|
||||
#endif
|
||||
mtsdram(SDRAM0_RTR, sdram0_rtr);
|
||||
mtsdram(SDRAM0_PMIT, sdram0_pmit);
|
||||
mtsdram(SDRAM0_B0CR, sdram0_b0cr);
|
||||
mtsdram(SDRAM0_B1CR, sdram0_b1cr);
|
||||
#ifndef CONFIG_405EP /* not on PPC405EP */
|
||||
mtsdram(SDRAM0_B2CR, sdram0_b2cr);
|
||||
mtsdram(SDRAM0_B3CR, sdram0_b3cr);
|
||||
#endif
|
||||
mtsdram(SDRAM0_TR, sdram0_tr);
|
||||
|
||||
/* SDRAM have a power on delay, 500 micro should do */
|
||||
udelay(500);
|
||||
sdram0_cfg = SDRAM0_CFG_DCE | SDRAM0_CFG_BRPF(1) | SDRAM0_CFG_ECCDD | SDRAM0_CFG_EMDULR;
|
||||
#ifndef CONFIG_405EP /* not on PPC405EP */
|
||||
if (ecc_on)
|
||||
sdram0_cfg |= SDRAM0_CFG_MEMCHK;
|
||||
#endif
|
||||
mtsdram(SDRAM0_CFG, sdram0_cfg);
|
||||
|
||||
return (total_size);
|
||||
}
|
||||
|
||||
int spd_read(uint addr)
|
||||
{
|
||||
uchar data[2];
|
||||
|
||||
if (i2c_read(SPD_EEPROM_ADDRESS, addr, 1, data, 1) == 0)
|
||||
return (int)data[0];
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_SPD_EEPROM */
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,863 +0,0 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: GPL-2.0 IBM-pibs
|
||||
*
|
||||
* File Name: 405gp_pci.c
|
||||
*
|
||||
* Function: Initialization code for the 405GP PCI Configuration regs.
|
||||
*
|
||||
* Author: Mark Game
|
||||
*
|
||||
* Change Activity-
|
||||
*
|
||||
* Date Description of Change BY
|
||||
* --------- --------------------- ---
|
||||
* 09-Sep-98 Created MCG
|
||||
* 02-Nov-98 Removed External arbiter selected message JWB
|
||||
* 27-Nov-98 Zero out PTMBAR2 and disable in PTM2MS JWB
|
||||
* 04-Jan-99 Zero out other unused PMM and PTM regs. Change bus scan MCG
|
||||
* from (0 to n) to (1 to n).
|
||||
* 17-May-99 Port to Walnut JWB
|
||||
* 17-Jun-99 Updated for VGA support JWB
|
||||
* 21-Jun-99 Updated to allow SRAM region to be a target from PCI bus JWB
|
||||
* 19-Jul-99 Updated for 405GP pass 1 errata #26 (Low PCI subsequent MCG
|
||||
* target latency timer values are not supported).
|
||||
* Should be fixed in pass 2.
|
||||
* 09-Sep-99 Removed use of PTM2 since the SRAM region no longer needs JWB
|
||||
* to be a PCI target. Zero out PTMBAR2 and disable in PTM2MS.
|
||||
* 10-Dec-99 Updated PCI_Write_CFG_Reg for pass2 errata #6 JWB
|
||||
* 11-Jan-00 Ensure PMMxMAs disabled before setting PMMxLAs. This is not
|
||||
* really required after a reset since PMMxMAs are already
|
||||
* disabled but is a good practice nonetheless. JWB
|
||||
* 12-Jun-01 stefan.roese@esd-electronics.com
|
||||
* - PCI host/adapter handling reworked
|
||||
* 09-Jul-01 stefan.roese@esd-electronics.com
|
||||
* - PCI host now configures from device 0 (not 1) to max_dev,
|
||||
* (host configures itself)
|
||||
* - On CPCI-405 pci base address and size is generated from
|
||||
* SDRAM and FLASH size (CFG regs not used anymore)
|
||||
* - Some minor changes for CPCI-405-A (adapter version)
|
||||
* 14-Sep-01 stefan.roese@esd-electronics.com
|
||||
* - CONFIG_PCI_SCAN_SHOW added to print pci devices upon startup
|
||||
* 28-Sep-01 stefan.roese@esd-electronics.com
|
||||
* - Changed pci master configuration for linux compatibility
|
||||
* (no need for bios_fixup() anymore)
|
||||
* 26-Feb-02 stefan.roese@esd-electronics.com
|
||||
* - Bug fixed in pci configuration (Andrew May)
|
||||
* - Removed pci class code init for CPCI405 board
|
||||
* 15-May-02 stefan.roese@esd-electronics.com
|
||||
* - New vga device handling
|
||||
* 29-May-02 stefan.roese@esd-electronics.com
|
||||
* - PCI class code init added (if defined)
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <asm/4xx_pci.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/io.h>
|
||||
#include <pci.h>
|
||||
#include <asm/ppc4xx.h>
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
#if defined(CONFIG_405GP) || defined(CONFIG_405EP)
|
||||
|
||||
/*#define DEBUG*/
|
||||
|
||||
/*
|
||||
* Board-specific pci initialization
|
||||
* Platform code can reimplement pci_pre_init() if needed
|
||||
*/
|
||||
int __pci_pre_init(struct pci_controller *hose)
|
||||
{
|
||||
#if defined(CONFIG_405EP)
|
||||
/*
|
||||
* Enable the internal PCI arbiter by default.
|
||||
*
|
||||
* On 405EP CPUs the internal arbiter can be controlled
|
||||
* by the I2C strapping EEPROM. If you want to do so
|
||||
* or if you want to disable the arbiter pci_pre_init()
|
||||
* must be reimplemented without enabling the arbiter.
|
||||
* The arbiter is enabled in this place because of
|
||||
* compatibility reasons.
|
||||
*/
|
||||
mtdcr(CPC0_PCI, mfdcr(CPC0_PCI) | CPC0_PCI_ARBIT_EN);
|
||||
#endif /* CONFIG_405EP */
|
||||
|
||||
return 1;
|
||||
}
|
||||
int pci_pre_init(struct pci_controller *hose)
|
||||
__attribute__((weak, alias("__pci_pre_init")));
|
||||
|
||||
int __is_pci_host(struct pci_controller *hose)
|
||||
{
|
||||
#if defined(CONFIG_405GP)
|
||||
if (mfdcr(CPC0_PSR) & PSR_PCI_ARBIT_EN)
|
||||
return 1;
|
||||
#elif defined (CONFIG_405EP)
|
||||
if (mfdcr(CPC0_PCI) & CPC0_PCI_ARBIT_EN)
|
||||
return 1;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
int is_pci_host(struct pci_controller *hose) __attribute__((weak, alias("__is_pci_host")));
|
||||
|
||||
/*-----------------------------------------------------------------------------+
|
||||
* pci_init. Initializes the 405GP PCI Configuration regs.
|
||||
*-----------------------------------------------------------------------------*/
|
||||
void pci_405gp_init(struct pci_controller *hose)
|
||||
{
|
||||
int i, reg_num = 0;
|
||||
bd_t *bd = gd->bd;
|
||||
|
||||
unsigned short temp_short;
|
||||
unsigned long ptmpcila[2] = {CONFIG_SYS_PCI_PTM1PCI, CONFIG_SYS_PCI_PTM2PCI};
|
||||
#if defined(CONFIG_PCI_4xx_PTM_OVERWRITE)
|
||||
char *ptmla_str, *ptmms_str;
|
||||
#endif
|
||||
unsigned long ptmla[2] = {CONFIG_SYS_PCI_PTM1LA, CONFIG_SYS_PCI_PTM2LA};
|
||||
unsigned long ptmms[2] = {CONFIG_SYS_PCI_PTM1MS, CONFIG_SYS_PCI_PTM2MS};
|
||||
#if defined(CONFIG_PIP405) || defined(CONFIG_TARGET_MIP405) \
|
||||
|| defined(CONFIG_TARGET_MIP405T)
|
||||
unsigned long pmmla[3] = {0x80000000, 0xA0000000, 0};
|
||||
unsigned long pmmma[3] = {0xE0000001, 0xE0000001, 0};
|
||||
unsigned long pmmpcila[3] = {0x80000000, 0x00000000, 0};
|
||||
unsigned long pmmpciha[3] = {0x00000000, 0x00000000, 0};
|
||||
#else
|
||||
unsigned long pmmla[3] = {0x80000000, 0,0};
|
||||
unsigned long pmmma[3] = {0xC0000001, 0,0};
|
||||
unsigned long pmmpcila[3] = {0x80000000, 0,0};
|
||||
unsigned long pmmpciha[3] = {0x00000000, 0,0};
|
||||
#endif
|
||||
#ifdef CONFIG_PCI_PNP
|
||||
#if (CONFIG_PCI_HOST == PCI_HOST_AUTO)
|
||||
char *s;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_PCI_4xx_PTM_OVERWRITE)
|
||||
ptmla_str = getenv("ptm1la");
|
||||
ptmms_str = getenv("ptm1ms");
|
||||
if(NULL != ptmla_str && NULL != ptmms_str ) {
|
||||
ptmla[0] = simple_strtoul (ptmla_str, NULL, 16);
|
||||
ptmms[0] = simple_strtoul (ptmms_str, NULL, 16);
|
||||
}
|
||||
|
||||
ptmla_str = getenv("ptm2la");
|
||||
ptmms_str = getenv("ptm2ms");
|
||||
if(NULL != ptmla_str && NULL != ptmms_str ) {
|
||||
ptmla[1] = simple_strtoul (ptmla_str, NULL, 16);
|
||||
ptmms[1] = simple_strtoul (ptmms_str, NULL, 16);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Register the hose
|
||||
*/
|
||||
hose->first_busno = 0;
|
||||
hose->last_busno = 0xff;
|
||||
|
||||
/* ISA/PCI I/O space */
|
||||
pci_set_region(hose->regions + reg_num++,
|
||||
MIN_PCI_PCI_IOADDR,
|
||||
MIN_PLB_PCI_IOADDR,
|
||||
0x10000,
|
||||
PCI_REGION_IO);
|
||||
|
||||
/* PCI I/O space */
|
||||
pci_set_region(hose->regions + reg_num++,
|
||||
0x00800000,
|
||||
0xe8800000,
|
||||
0x03800000,
|
||||
PCI_REGION_IO);
|
||||
|
||||
reg_num = 2;
|
||||
|
||||
/* Memory spaces */
|
||||
for (i=0; i<2; i++)
|
||||
if (ptmms[i] & 1)
|
||||
{
|
||||
if (!i) hose->pci_fb = hose->regions + reg_num;
|
||||
|
||||
pci_set_region(hose->regions + reg_num++,
|
||||
ptmpcila[i], ptmla[i],
|
||||
~(ptmms[i] & 0xfffff000) + 1,
|
||||
PCI_REGION_MEM |
|
||||
PCI_REGION_SYS_MEMORY);
|
||||
}
|
||||
|
||||
/* PCI memory spaces */
|
||||
for (i=0; i<3; i++)
|
||||
if (pmmma[i] & 1)
|
||||
{
|
||||
pci_set_region(hose->regions + reg_num++,
|
||||
pmmpcila[i], pmmla[i],
|
||||
~(pmmma[i] & 0xfffff000) + 1,
|
||||
PCI_REGION_MEM);
|
||||
}
|
||||
|
||||
hose->region_count = reg_num;
|
||||
|
||||
pci_setup_indirect(hose,
|
||||
PCICFGADR,
|
||||
PCICFGDATA);
|
||||
|
||||
if (hose->pci_fb)
|
||||
pciauto_region_init(hose->pci_fb);
|
||||
|
||||
/* Let board change/modify hose & do initial checks */
|
||||
if (pci_pre_init(hose) == 0) {
|
||||
printf("PCI: Board-specific initialization failed.\n");
|
||||
printf("PCI: Configuration aborted.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
pci_register_hose(hose);
|
||||
|
||||
/*--------------------------------------------------------------------------+
|
||||
* 405GP PCI Master configuration.
|
||||
* Map one 512 MB range of PLB/processor addresses to PCI memory space.
|
||||
* PLB address 0x80000000-0xBFFFFFFF ==> PCI address 0x80000000-0xBFFFFFFF
|
||||
* Use byte reversed out routines to handle endianess.
|
||||
*--------------------------------------------------------------------------*/
|
||||
out32r(PMM0MA, (pmmma[0]&~0x1)); /* disable, configure PMMxLA, PMMxPCILA first */
|
||||
out32r(PMM0LA, pmmla[0]);
|
||||
out32r(PMM0PCILA, pmmpcila[0]);
|
||||
out32r(PMM0PCIHA, pmmpciha[0]);
|
||||
out32r(PMM0MA, pmmma[0]);
|
||||
|
||||
/*--------------------------------------------------------------------------+
|
||||
* PMM1 is not used. Initialize them to zero.
|
||||
*--------------------------------------------------------------------------*/
|
||||
out32r(PMM1MA, (pmmma[1]&~0x1));
|
||||
out32r(PMM1LA, pmmla[1]);
|
||||
out32r(PMM1PCILA, pmmpcila[1]);
|
||||
out32r(PMM1PCIHA, pmmpciha[1]);
|
||||
out32r(PMM1MA, pmmma[1]);
|
||||
|
||||
/*--------------------------------------------------------------------------+
|
||||
* PMM2 is not used. Initialize them to zero.
|
||||
*--------------------------------------------------------------------------*/
|
||||
out32r(PMM2MA, (pmmma[2]&~0x1));
|
||||
out32r(PMM2LA, pmmla[2]);
|
||||
out32r(PMM2PCILA, pmmpcila[2]);
|
||||
out32r(PMM2PCIHA, pmmpciha[2]);
|
||||
out32r(PMM2MA, pmmma[2]);
|
||||
|
||||
/*--------------------------------------------------------------------------+
|
||||
* 405GP PCI Target configuration. (PTM1)
|
||||
* Note: PTM1MS is hardwire enabled but we set the enable bit anyway.
|
||||
*--------------------------------------------------------------------------*/
|
||||
out32r(PTM1LA, ptmla[0]); /* insert address */
|
||||
out32r(PTM1MS, ptmms[0]); /* insert size, enable bit is 1 */
|
||||
pci_write_config_dword(PCIDEVID_405GP, PCI_BASE_ADDRESS_1, ptmpcila[0]);
|
||||
|
||||
/*--------------------------------------------------------------------------+
|
||||
* 405GP PCI Target configuration. (PTM2)
|
||||
*--------------------------------------------------------------------------*/
|
||||
out32r(PTM2LA, ptmla[1]); /* insert address */
|
||||
pci_write_config_dword(PCIDEVID_405GP, PCI_BASE_ADDRESS_2, ptmpcila[1]);
|
||||
|
||||
if (ptmms[1] == 0)
|
||||
{
|
||||
out32r(PTM2MS, 0x00000001); /* set enable bit */
|
||||
pci_write_config_dword(PCIDEVID_405GP, PCI_BASE_ADDRESS_2, 0x00000000);
|
||||
out32r(PTM2MS, 0x00000000); /* disable */
|
||||
}
|
||||
else
|
||||
{
|
||||
out32r(PTM2MS, ptmms[1]); /* insert size, enable bit is 1 */
|
||||
}
|
||||
|
||||
/*
|
||||
* Insert Subsystem Vendor and Device ID
|
||||
*/
|
||||
pci_write_config_word(PCIDEVID_405GP, PCI_SUBSYSTEM_VENDOR_ID, CONFIG_SYS_PCI_SUBSYS_VENDORID);
|
||||
#ifdef CONFIG_CPCI405
|
||||
if (is_pci_host(hose))
|
||||
pci_write_config_word(PCIDEVID_405GP, PCI_SUBSYSTEM_ID, CONFIG_SYS_PCI_SUBSYS_DEVICEID);
|
||||
else
|
||||
pci_write_config_word(PCIDEVID_405GP, PCI_SUBSYSTEM_ID, CONFIG_SYS_PCI_SUBSYS_DEVICEID2);
|
||||
#else
|
||||
pci_write_config_word(PCIDEVID_405GP, PCI_SUBSYSTEM_ID, CONFIG_SYS_PCI_SUBSYS_DEVICEID);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Insert Class-code
|
||||
*/
|
||||
#ifdef CONFIG_SYS_PCI_CLASSCODE
|
||||
pci_write_config_word(PCIDEVID_405GP, PCI_CLASS_SUB_CODE, CONFIG_SYS_PCI_CLASSCODE);
|
||||
#endif /* CONFIG_SYS_PCI_CLASSCODE */
|
||||
|
||||
/*--------------------------------------------------------------------------+
|
||||
* If PCI speed = 66MHz, set 66MHz capable bit.
|
||||
*--------------------------------------------------------------------------*/
|
||||
if (bd->bi_pci_busfreq >= 66000000) {
|
||||
pci_read_config_word(PCIDEVID_405GP, PCI_STATUS, &temp_short);
|
||||
pci_write_config_word(PCIDEVID_405GP,PCI_STATUS,(temp_short|PCI_STATUS_66MHZ));
|
||||
}
|
||||
|
||||
#if (CONFIG_PCI_HOST != PCI_HOST_ADAPTER)
|
||||
#if (CONFIG_PCI_HOST == PCI_HOST_AUTO)
|
||||
if (is_pci_host(hose) ||
|
||||
(((s = getenv("pciscan")) != NULL) && (strcmp(s, "yes") == 0)))
|
||||
#endif
|
||||
{
|
||||
/*--------------------------------------------------------------------------+
|
||||
* Write the 405GP PCI Configuration regs.
|
||||
* Enable 405GP to be a master on the PCI bus (PMM).
|
||||
* Enable 405GP to act as a PCI memory target (PTM).
|
||||
*--------------------------------------------------------------------------*/
|
||||
pci_read_config_word(PCIDEVID_405GP, PCI_COMMAND, &temp_short);
|
||||
pci_write_config_word(PCIDEVID_405GP, PCI_COMMAND, temp_short |
|
||||
PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_405EP)
|
||||
/*
|
||||
* on ppc405ep vendor/device id is not set
|
||||
* The user manual says 0x1014 (IBM) / 0x0156 (405GP!)
|
||||
* are the correct values.
|
||||
*/
|
||||
pci_write_config_word(PCIDEVID_405GP, PCI_VENDOR_ID, PCI_VENDOR_ID_IBM);
|
||||
pci_write_config_word(PCIDEVID_405GP,
|
||||
PCI_DEVICE_ID, PCI_DEVICE_ID_IBM_405GP);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Set HCE bit (Host Configuration Enabled)
|
||||
*/
|
||||
pci_read_config_word(PCIDEVID_405GP, PCIBRDGOPT2, &temp_short);
|
||||
pci_write_config_word(PCIDEVID_405GP, PCIBRDGOPT2, (temp_short | 0x0001));
|
||||
|
||||
#ifdef CONFIG_PCI_PNP
|
||||
/*--------------------------------------------------------------------------+
|
||||
* Scan the PCI bus and configure devices found.
|
||||
*--------------------------------------------------------------------------*/
|
||||
#if (CONFIG_PCI_HOST == PCI_HOST_AUTO)
|
||||
if (is_pci_host(hose) ||
|
||||
(((s = getenv("pciscan")) != NULL) && (strcmp(s, "yes") == 0)))
|
||||
#endif
|
||||
{
|
||||
#ifdef CONFIG_PCI_SCAN_SHOW
|
||||
printf("PCI: Bus Dev VenId DevId Class Int\n");
|
||||
#endif
|
||||
hose->last_busno = pci_hose_scan(hose);
|
||||
}
|
||||
#endif /* CONFIG_PCI_PNP */
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* drivers/pci/pci.c skips every host bridge but the 405GP since it could
|
||||
* be set as an Adapter.
|
||||
*
|
||||
* I (Andrew May) don't know what we should do here, but I don't want
|
||||
* the auto setup of a PCI device disabling what is done pci_405gp_init
|
||||
* as has happened before.
|
||||
*/
|
||||
void pci_405gp_setup_bridge(struct pci_controller *hose, pci_dev_t dev,
|
||||
struct pci_config_table *entry)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
printf("405gp_setup_bridge\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
||||
void pci_405gp_fixup_irq(struct pci_controller *hose, pci_dev_t dev)
|
||||
{
|
||||
unsigned char int_line = 0xff;
|
||||
|
||||
/*
|
||||
* Write pci interrupt line register (cpci405 specific)
|
||||
*/
|
||||
switch (PCI_DEV(dev) & 0x03)
|
||||
{
|
||||
case 0:
|
||||
int_line = 27 + 2;
|
||||
break;
|
||||
case 1:
|
||||
int_line = 27 + 3;
|
||||
break;
|
||||
case 2:
|
||||
int_line = 27 + 0;
|
||||
break;
|
||||
case 3:
|
||||
int_line = 27 + 1;
|
||||
break;
|
||||
}
|
||||
|
||||
pci_hose_write_config_byte(hose, dev, PCI_INTERRUPT_LINE, int_line);
|
||||
}
|
||||
|
||||
void pci_405gp_setup_vga(struct pci_controller *hose, pci_dev_t dev,
|
||||
struct pci_config_table *entry)
|
||||
{
|
||||
unsigned int cmdstat = 0;
|
||||
|
||||
pciauto_setup_device(hose, dev, 6, hose->pci_mem, hose->pci_prefetch, hose->pci_io);
|
||||
|
||||
/* always enable io space on vga boards */
|
||||
pci_hose_read_config_dword(hose, dev, PCI_COMMAND, &cmdstat);
|
||||
cmdstat |= PCI_COMMAND_IO;
|
||||
pci_hose_write_config_dword(hose, dev, PCI_COMMAND, cmdstat);
|
||||
}
|
||||
|
||||
#if !(defined(CONFIG_PIP405) || defined(CONFIG_TARGET_MIP405) \
|
||||
|| defined(CONFIG_TARGET_MIP405T))
|
||||
|
||||
/*
|
||||
*As is these functs get called out of flash Not a horrible
|
||||
*thing, but something to keep in mind. (no statics?)
|
||||
*/
|
||||
static struct pci_config_table pci_405gp_config_table[] = {
|
||||
/*if VendID is 0 it terminates the table search (ie Walnut)*/
|
||||
#ifdef CONFIG_SYS_PCI_SUBSYS_VENDORID
|
||||
{CONFIG_SYS_PCI_SUBSYS_VENDORID, PCI_ANY_ID, PCI_CLASS_BRIDGE_HOST,
|
||||
PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, pci_405gp_setup_bridge},
|
||||
#endif
|
||||
{PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA,
|
||||
PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, pci_405gp_setup_vga},
|
||||
|
||||
{PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_NOT_DEFINED_VGA,
|
||||
PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, pci_405gp_setup_vga},
|
||||
|
||||
{ }
|
||||
};
|
||||
|
||||
static struct pci_controller hose = {
|
||||
fixup_irq: pci_405gp_fixup_irq,
|
||||
config_table: pci_405gp_config_table,
|
||||
};
|
||||
|
||||
void pci_init_board(void)
|
||||
{
|
||||
/*we want the ptrs to RAM not flash (ie don't use init list)*/
|
||||
hose.fixup_irq = pci_405gp_fixup_irq;
|
||||
hose.config_table = pci_405gp_config_table;
|
||||
pci_405gp_init(&hose);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_405GP */
|
||||
|
||||
/*-----------------------------------------------------------------------------+
|
||||
* CONFIG_440
|
||||
*-----------------------------------------------------------------------------*/
|
||||
#if defined(CONFIG_440)
|
||||
|
||||
#if defined(CONFIG_SYS_PCI_MASTER_INIT) || defined(CONFIG_SYS_PCI_TARGET_INIT)
|
||||
static struct pci_controller ppc440_hose = {0};
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This routine is called to determine if a pci scan should be
|
||||
* performed. With various hardware environments (especially cPCI and
|
||||
* PPMC) it's insufficient to depend on the state of the arbiter enable
|
||||
* bit in the strap register, or generic host/adapter assumptions.
|
||||
*
|
||||
* Rather than hard-code a bad assumption in the general 440 code, the
|
||||
* 440 pci code requires the board to decide at runtime.
|
||||
*
|
||||
* Return 0 for adapter mode, non-zero for host (monarch) mode.
|
||||
*
|
||||
* Weak default implementation: "Normal" boards implement the PCI
|
||||
* host functionality. This can be overridden for PCI adapter boards.
|
||||
*/
|
||||
int __is_pci_host(struct pci_controller *hose)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
int is_pci_host(struct pci_controller *hose)
|
||||
__attribute__((weak, alias("__is_pci_host")));
|
||||
|
||||
#if defined(CONFIG_440EP) || defined(CONFIG_440EPX) || \
|
||||
defined(CONFIG_440GR) || defined(CONFIG_440GRX)
|
||||
|
||||
#if defined(CONFIG_SYS_PCI_TARGET_INIT)
|
||||
/*
|
||||
* pci_target_init
|
||||
*
|
||||
* The bootstrap configuration provides default settings for the pci
|
||||
* inbound map (PIM). But the bootstrap config choices are limited and
|
||||
* may not be sufficient for a given board.
|
||||
*/
|
||||
void __pci_target_init(struct pci_controller *hose)
|
||||
{
|
||||
/*
|
||||
* Set up Direct MMIO registers
|
||||
*/
|
||||
|
||||
/*
|
||||
* PowerPC440 EP PCI Master configuration.
|
||||
* Map one 1Gig range of PLB/processor addresses to PCI memory space.
|
||||
* PLB address 0xA0000000-0xDFFFFFFF ==> PCI address 0xA0000000-0xDFFFFFFF
|
||||
* Use byte reversed out routines to handle endianess.
|
||||
* Make this region non-prefetchable.
|
||||
*/
|
||||
/* PMM0 Mask/Attribute - disabled b4 setting */
|
||||
out_le32((void *)PCIL0_PMM0MA, 0x00000000);
|
||||
/* PMM0 Local Address */
|
||||
out_le32((void *)PCIL0_PMM0LA, CONFIG_SYS_PCI_MEMBASE);
|
||||
/* PMM0 PCI Low Address */
|
||||
out_le32((void *)PCIL0_PMM0PCILA, CONFIG_SYS_PCI_MEMBASE);
|
||||
/* PMM0 PCI High Address */
|
||||
out_le32((void *)PCIL0_PMM0PCIHA, 0x00000000);
|
||||
/* 512M + No prefetching, and enable region */
|
||||
out_le32((void *)PCIL0_PMM0MA, 0xE0000001);
|
||||
|
||||
/* PMM1 Mask/Attribute - disabled b4 setting */
|
||||
out_le32((void *)PCIL0_PMM1MA, 0x00000000);
|
||||
/* PMM1 Local Address */
|
||||
out_le32((void *)PCIL0_PMM1LA, CONFIG_SYS_PCI_MEMBASE2);
|
||||
/* PMM1 PCI Low Address */
|
||||
out_le32((void *)PCIL0_PMM1PCILA, CONFIG_SYS_PCI_MEMBASE2);
|
||||
/* PMM1 PCI High Address */
|
||||
out_le32((void *)PCIL0_PMM1PCIHA, 0x00000000);
|
||||
/* 512M + No prefetching, and enable region */
|
||||
out_le32((void *)PCIL0_PMM1MA, 0xE0000001);
|
||||
|
||||
out_le32((void *)PCIL0_PTM1MS, 0x00000001); /* Memory Size/Attribute */
|
||||
out_le32((void *)PCIL0_PTM1LA, 0); /* Local Addr. Reg */
|
||||
out_le32((void *)PCIL0_PTM2MS, 0); /* Memory Size/Attribute */
|
||||
out_le32((void *)PCIL0_PTM2LA, 0); /* Local Addr. Reg */
|
||||
|
||||
/*
|
||||
* Set up Configuration registers
|
||||
*/
|
||||
|
||||
/* Program the board's subsystem id/vendor id */
|
||||
pci_write_config_word(0, PCI_SUBSYSTEM_VENDOR_ID,
|
||||
CONFIG_SYS_PCI_SUBSYS_VENDORID);
|
||||
pci_write_config_word(0, PCI_SUBSYSTEM_ID, CONFIG_SYS_PCI_SUBSYS_ID);
|
||||
|
||||
/* Configure command register as bus master */
|
||||
pci_write_config_word(0, PCI_COMMAND, PCI_COMMAND_MASTER);
|
||||
|
||||
/* 240nS PCI clock */
|
||||
pci_write_config_word(0, PCI_LATENCY_TIMER, 1);
|
||||
|
||||
/* No error reporting */
|
||||
pci_write_config_word(0, PCI_ERREN, 0);
|
||||
|
||||
pci_write_config_dword(0, PCI_BRDGOPT2, 0x00000101);
|
||||
}
|
||||
#endif /* CONFIG_SYS_PCI_TARGET_INIT */
|
||||
|
||||
/*
|
||||
* pci_pre_init
|
||||
*
|
||||
* This routine is called just prior to registering the hose and gives
|
||||
* the board the opportunity to check things. Returning a value of zero
|
||||
* indicates that things are bad & PCI initialization should be aborted.
|
||||
*
|
||||
* Different boards may wish to customize the pci controller structure
|
||||
* (add regions, override default access routines, etc) or perform
|
||||
* certain pre-initialization actions.
|
||||
*
|
||||
*/
|
||||
int __pci_pre_init(struct pci_controller *hose)
|
||||
{
|
||||
u32 reg;
|
||||
|
||||
/*
|
||||
* Set priority for all PLB3 devices to 0.
|
||||
* Set PLB3 arbiter to fair mode.
|
||||
*/
|
||||
mfsdr(SDR0_AMP1, reg);
|
||||
mtsdr(SDR0_AMP1, (reg & 0x000000FF) | 0x0000FF00);
|
||||
reg = mfdcr(PLB3A0_ACR);
|
||||
mtdcr(PLB3A0_ACR, reg | 0x80000000);
|
||||
|
||||
/*
|
||||
* Set priority for all PLB4 devices to 0.
|
||||
*/
|
||||
mfsdr(SDR0_AMP0, reg);
|
||||
mtsdr(SDR0_AMP0, (reg & 0x000000FF) | 0x0000FF00);
|
||||
reg = mfdcr(PLB4A0_ACR) | 0xa0000000;
|
||||
mtdcr(PLB4A0_ACR, reg);
|
||||
|
||||
/*
|
||||
* Set Nebula PLB4 arbiter to fair mode.
|
||||
*/
|
||||
/* Segment0 */
|
||||
reg = (mfdcr(PLB4A0_ACR) & ~PLB4Ax_ACR_PPM_MASK) | PLB4Ax_ACR_PPM_FAIR;
|
||||
reg = (reg & ~PLB4Ax_ACR_HBU_MASK) | PLB4Ax_ACR_HBU_ENABLED;
|
||||
reg = (reg & ~PLB4Ax_ACR_RDP_MASK) | PLB4Ax_ACR_RDP_4DEEP;
|
||||
reg = (reg & ~PLB4Ax_ACR_WRP_MASK) | PLB4Ax_ACR_WRP_2DEEP;
|
||||
mtdcr(PLB4A0_ACR, reg);
|
||||
|
||||
/* Segment1 */
|
||||
reg = (mfdcr(PLB4A1_ACR) & ~PLB4Ax_ACR_PPM_MASK) | PLB4Ax_ACR_PPM_FAIR;
|
||||
reg = (reg & ~PLB4Ax_ACR_HBU_MASK) | PLB4Ax_ACR_HBU_ENABLED;
|
||||
reg = (reg & ~PLB4Ax_ACR_RDP_MASK) | PLB4Ax_ACR_RDP_4DEEP;
|
||||
reg = (reg & ~PLB4Ax_ACR_WRP_MASK) | PLB4Ax_ACR_WRP_2DEEP;
|
||||
mtdcr(PLB4A1_ACR, reg);
|
||||
|
||||
#if defined(CONFIG_SYS_PCI_BOARD_FIXUP_IRQ)
|
||||
hose->fixup_irq = board_pci_fixup_irq;
|
||||
#endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#else /* defined(CONFIG_440EP) ... */
|
||||
|
||||
#if defined(CONFIG_SYS_PCI_TARGET_INIT)
|
||||
void __pci_target_init(struct pci_controller * hose)
|
||||
{
|
||||
/*
|
||||
* Disable everything
|
||||
*/
|
||||
out_le32((void *)PCIL0_PIM0SA, 0); /* disable */
|
||||
out_le32((void *)PCIL0_PIM1SA, 0); /* disable */
|
||||
out_le32((void *)PCIL0_PIM2SA, 0); /* disable */
|
||||
out_le32((void *)PCIL0_EROMBA, 0); /* disable expansion rom */
|
||||
|
||||
/*
|
||||
* Map all of SDRAM to PCI address 0x0000_0000. Note that the 440
|
||||
* strapping options do not support sizes such as 128/256 MB.
|
||||
*/
|
||||
out_le32((void *)PCIL0_PIM0LAL, CONFIG_SYS_SDRAM_BASE);
|
||||
out_le32((void *)PCIL0_PIM0LAH, 0);
|
||||
out_le32((void *)PCIL0_PIM0SA, ~(gd->ram_size - 1) | 1);
|
||||
out_le32((void *)PCIL0_BAR0, 0);
|
||||
|
||||
/*
|
||||
* Program the board's subsystem id/vendor id
|
||||
*/
|
||||
out_le16((void *)PCIL0_SBSYSVID, CONFIG_SYS_PCI_SUBSYS_VENDORID);
|
||||
out_le16((void *)PCIL0_SBSYSID, CONFIG_SYS_PCI_SUBSYS_DEVICEID);
|
||||
|
||||
out_le16((void *)PCIL0_CMD, in_le16((void *)PCIL0_CMD) |
|
||||
PCI_COMMAND_MEMORY);
|
||||
}
|
||||
#endif /* CONFIG_SYS_PCI_TARGET_INIT */
|
||||
|
||||
int __pci_pre_init(struct pci_controller *hose)
|
||||
{
|
||||
/*
|
||||
* This board is always configured as the host & requires the
|
||||
* PCI arbiter to be enabled.
|
||||
*/
|
||||
if (!pci_arbiter_enabled()) {
|
||||
printf("PCI: PCI Arbiter disabled!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif /* defined(CONFIG_440EP) ... */
|
||||
|
||||
#if defined(CONFIG_SYS_PCI_TARGET_INIT)
|
||||
void pci_target_init(struct pci_controller * hose)
|
||||
__attribute__((weak, alias("__pci_target_init")));
|
||||
#endif /* CONFIG_SYS_PCI_TARGET_INIT */
|
||||
|
||||
int pci_pre_init(struct pci_controller *hose)
|
||||
__attribute__((weak, alias("__pci_pre_init")));
|
||||
|
||||
#if defined(CONFIG_SYS_PCI_MASTER_INIT)
|
||||
void __pci_master_init(struct pci_controller *hose)
|
||||
{
|
||||
u16 reg;
|
||||
|
||||
/*
|
||||
* Write the PowerPC440 EP PCI Configuration regs.
|
||||
* Enable PowerPC440 EP to be a master on the PCI bus (PMM).
|
||||
* Enable PowerPC440 EP to act as a PCI memory target (PTM).
|
||||
*/
|
||||
pci_read_config_word(0, PCI_COMMAND, ®);
|
||||
pci_write_config_word(0, PCI_COMMAND, reg |
|
||||
PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY);
|
||||
}
|
||||
void pci_master_init(struct pci_controller *hose)
|
||||
__attribute__((weak, alias("__pci_master_init")));
|
||||
#endif /* CONFIG_SYS_PCI_MASTER_INIT */
|
||||
|
||||
#if defined(CONFIG_SYS_PCI_MASTER_INIT) || defined(CONFIG_SYS_PCI_TARGET_INIT)
|
||||
static int pci_440_init (struct pci_controller *hose)
|
||||
{
|
||||
int reg_num = 0;
|
||||
|
||||
#ifndef CONFIG_DISABLE_PISE_TEST
|
||||
/*--------------------------------------------------------------------------+
|
||||
* The PCI initialization sequence enable bit must be set ... if not abort
|
||||
* pci setup since updating the bit requires chip reset.
|
||||
*--------------------------------------------------------------------------*/
|
||||
#if defined(CONFIG_440GX) || defined(CONFIG_440SP) || defined(CONFIG_440SPE)
|
||||
unsigned long strap;
|
||||
|
||||
mfsdr(SDR0_SDSTP1,strap);
|
||||
if ((strap & SDR0_SDSTP1_PISE_MASK) == 0) {
|
||||
printf("PCI: SDR0_STRP1[PISE] not set.\n");
|
||||
printf("PCI: Configuration aborted.\n");
|
||||
return -1;
|
||||
}
|
||||
#elif defined(CONFIG_440GP)
|
||||
unsigned long strap;
|
||||
|
||||
strap = mfdcr(CPC0_STRP1);
|
||||
if ((strap & CPC0_STRP1_PISE_MASK) == 0) {
|
||||
printf("PCI: CPC0_STRP1[PISE] not set.\n");
|
||||
printf("PCI: Configuration aborted.\n");
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
#endif /* CONFIG_DISABLE_PISE_TEST */
|
||||
|
||||
/*--------------------------------------------------------------------------+
|
||||
* PCI controller init
|
||||
*--------------------------------------------------------------------------*/
|
||||
hose->first_busno = 0;
|
||||
hose->last_busno = 0;
|
||||
|
||||
/* PCI I/O space */
|
||||
pci_set_region(hose->regions + reg_num++,
|
||||
0x00000000,
|
||||
PCIL0_IOBASE,
|
||||
0x10000,
|
||||
PCI_REGION_IO);
|
||||
|
||||
/* PCI memory space */
|
||||
pci_set_region(hose->regions + reg_num++,
|
||||
CONFIG_SYS_PCI_TARGBASE,
|
||||
CONFIG_SYS_PCI_MEMBASE,
|
||||
#ifdef CONFIG_SYS_PCI_MEMSIZE
|
||||
CONFIG_SYS_PCI_MEMSIZE,
|
||||
#else
|
||||
0x10000000,
|
||||
#endif
|
||||
PCI_REGION_MEM );
|
||||
|
||||
#if defined(CONFIG_PCI_SYS_MEM_BUS) && defined(CONFIG_PCI_SYS_MEM_PHYS) && \
|
||||
defined(CONFIG_PCI_SYS_MEM_SIZE)
|
||||
/* System memory space */
|
||||
pci_set_region(hose->regions + reg_num++,
|
||||
CONFIG_PCI_SYS_MEM_BUS,
|
||||
CONFIG_PCI_SYS_MEM_PHYS,
|
||||
CONFIG_PCI_SYS_MEM_SIZE,
|
||||
PCI_REGION_MEM | PCI_REGION_SYS_MEMORY );
|
||||
#endif
|
||||
|
||||
hose->region_count = reg_num;
|
||||
|
||||
pci_setup_indirect(hose, PCIL0_CFGADR, PCIL0_CFGDATA);
|
||||
|
||||
/* Let board change/modify hose & do initial checks */
|
||||
if (pci_pre_init(hose) == 0) {
|
||||
printf("PCI: Board-specific initialization failed.\n");
|
||||
printf("PCI: Configuration aborted.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
pci_register_hose( hose );
|
||||
|
||||
/*--------------------------------------------------------------------------+
|
||||
* PCI target init
|
||||
*--------------------------------------------------------------------------*/
|
||||
#if defined(CONFIG_SYS_PCI_TARGET_INIT)
|
||||
pci_target_init(hose); /* Let board setup pci target */
|
||||
#else
|
||||
out16r( PCIL0_SBSYSVID, CONFIG_SYS_PCI_SUBSYS_VENDORID );
|
||||
out16r( PCIL0_SBSYSID, CONFIG_SYS_PCI_SUBSYS_ID );
|
||||
out16r( PCIL0_CLS, 0x00060000 ); /* Bridge, host bridge */
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_440GX) || defined(CONFIG_440SPE) || \
|
||||
defined(CONFIG_460EX) || defined(CONFIG_460GT)
|
||||
out32r( PCIL0_BRDGOPT1, 0x04000060 ); /* PLB Rq pri highest */
|
||||
out32r( PCIL0_BRDGOPT2, in32(PCIL0_BRDGOPT2) | 0x83 ); /* Enable host config, clear Timeout, ensure int src1 */
|
||||
#elif defined(PCIL0_BRDGOPT1)
|
||||
out32r( PCIL0_BRDGOPT1, 0x10000060 ); /* PLB Rq pri highest */
|
||||
out32r( PCIL0_BRDGOPT2, in32(PCIL0_BRDGOPT2) | 1 ); /* Enable host config */
|
||||
#endif
|
||||
|
||||
/*--------------------------------------------------------------------------+
|
||||
* PCI master init: default is one 256MB region for PCI memory:
|
||||
* 0x3_00000000 - 0x3_0FFFFFFF ==> CONFIG_SYS_PCI_MEMBASE
|
||||
*--------------------------------------------------------------------------*/
|
||||
#if defined(CONFIG_SYS_PCI_MASTER_INIT)
|
||||
pci_master_init(hose); /* Let board setup pci master */
|
||||
#else
|
||||
out32r( PCIL0_POM0SA, 0 ); /* disable */
|
||||
out32r( PCIL0_POM1SA, 0 ); /* disable */
|
||||
out32r( PCIL0_POM2SA, 0 ); /* disable */
|
||||
#if defined(CONFIG_440SPE)
|
||||
out32r( PCIL0_POM0LAL, 0x10000000 );
|
||||
out32r( PCIL0_POM0LAH, 0x0000000c );
|
||||
#elif defined(CONFIG_460EX) || defined(CONFIG_460GT)
|
||||
out32r( PCIL0_POM0LAL, 0x20000000 );
|
||||
out32r( PCIL0_POM0LAH, 0x0000000c );
|
||||
#else
|
||||
out32r( PCIL0_POM0LAL, 0x00000000 );
|
||||
out32r( PCIL0_POM0LAH, 0x00000003 );
|
||||
#endif
|
||||
out32r( PCIL0_POM0PCIAL, CONFIG_SYS_PCI_MEMBASE );
|
||||
out32r( PCIL0_POM0PCIAH, 0x00000000 );
|
||||
out32r( PCIL0_POM0SA, 0xf0000001 ); /* 256MB, enabled */
|
||||
out32r( PCIL0_STS, in32r( PCIL0_STS ) & ~0x0000fff8 );
|
||||
#endif
|
||||
|
||||
/*--------------------------------------------------------------------------+
|
||||
* PCI host configuration -- we don't make any assumptions here ... the
|
||||
* _board_must_indicate_ what to do -- there's just too many runtime
|
||||
* scenarios in environments like cPCI, PPMC, etc. to make a determination
|
||||
* based on hard-coded values or state of arbiter enable.
|
||||
*--------------------------------------------------------------------------*/
|
||||
if (is_pci_host(hose)) {
|
||||
#ifdef CONFIG_PCI_SCAN_SHOW
|
||||
printf("PCI: Bus Dev VenId DevId Class Int\n");
|
||||
#endif
|
||||
#if !defined(CONFIG_440EP) && !defined(CONFIG_440GR) && \
|
||||
!defined(CONFIG_440EPX) && !defined(CONFIG_440GRX)
|
||||
out16r( PCIL0_CMD, in16r( PCIL0_CMD ) | PCI_COMMAND_MASTER);
|
||||
#endif
|
||||
hose->last_busno = pci_hose_scan(hose);
|
||||
}
|
||||
return hose->last_busno;
|
||||
}
|
||||
#endif
|
||||
|
||||
void pci_init_board(void)
|
||||
{
|
||||
int busno = 0;
|
||||
|
||||
/*
|
||||
* Only init PCI when either master or target functionality
|
||||
* is selected.
|
||||
*/
|
||||
#if defined(CONFIG_SYS_PCI_MASTER_INIT) || defined(CONFIG_SYS_PCI_TARGET_INIT)
|
||||
busno = pci_440_init(&ppc440_hose);
|
||||
if (busno < 0)
|
||||
return;
|
||||
#endif
|
||||
#if (defined(CONFIG_440SPE) || \
|
||||
defined(CONFIG_460EX) || defined(CONFIG_460GT)) && \
|
||||
!defined(CONFIG_PCI_DISABLE_PCIE)
|
||||
pcie_setup_hoses(busno + 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* CONFIG_440 */
|
||||
|
||||
#if defined(CONFIG_405EX)
|
||||
void pci_init_board(void)
|
||||
{
|
||||
#ifdef CONFIG_PCI_SCAN_SHOW
|
||||
printf("PCI: Bus Dev VenId DevId Class Int\n");
|
||||
#endif
|
||||
pcie_setup_hoses(0);
|
||||
}
|
||||
#endif /* CONFIG_405EX */
|
||||
|
||||
#endif /* CONFIG_PCI */
|
File diff suppressed because it is too large
Load diff
|
@ -1,267 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2000-2006
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* (C) Copyright 2010
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0 IBM-pibs
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/io.h>
|
||||
#include <watchdog.h>
|
||||
#include <asm/ppc4xx.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
#if defined(CONFIG_405GP) || \
|
||||
defined(CONFIG_405EP) || defined(CONFIG_405EZ) || \
|
||||
defined(CONFIG_405EX) || defined(CONFIG_440)
|
||||
|
||||
#if defined(CONFIG_440)
|
||||
|
||||
#if defined(CONFIG_440GP)
|
||||
#define CR0_MASK 0x3fff0000
|
||||
#define CR0_EXTCLK_ENA 0x00600000
|
||||
#define CR0_UDIV_POS 16
|
||||
#define UDIV_SUBTRACT 1
|
||||
#define UART0_SDR CPC0_CR0
|
||||
#define MFREG(a, d) d = mfdcr(a)
|
||||
#define MTREG(a, d) mtdcr(a, d)
|
||||
#else /* #if defined(CONFIG_440GP) */
|
||||
/* all other 440 PPC's access clock divider via sdr register */
|
||||
#define CR0_MASK 0xdfffffff
|
||||
#define CR0_EXTCLK_ENA 0x00800000
|
||||
#define CR0_UDIV_POS 0
|
||||
#define UDIV_SUBTRACT 0
|
||||
#define UART0_SDR SDR0_UART0
|
||||
#define UART1_SDR SDR0_UART1
|
||||
#if defined(CONFIG_440EP) || defined(CONFIG_440EPX) || \
|
||||
defined(CONFIG_440GR) || defined(CONFIG_440GRX) || \
|
||||
defined(CONFIG_440SP) || defined(CONFIG_440SPE) || \
|
||||
defined(CONFIG_460EX) || defined(CONFIG_460GT)
|
||||
#define UART2_SDR SDR0_UART2
|
||||
#endif
|
||||
#if defined(CONFIG_440EP) || defined(CONFIG_440EPX) || \
|
||||
defined(CONFIG_440GR) || defined(CONFIG_440GRX) || \
|
||||
defined(CONFIG_460EX) || defined(CONFIG_460GT)
|
||||
#define UART3_SDR SDR0_UART3
|
||||
#endif
|
||||
#define MFREG(a, d) mfsdr(a, d)
|
||||
#define MTREG(a, d) mtsdr(a, d)
|
||||
#endif /* #if defined(CONFIG_440GP) */
|
||||
#elif defined(CONFIG_405EP) || defined(CONFIG_405EZ)
|
||||
#define UCR0_MASK 0x0000007f
|
||||
#define UCR1_MASK 0x00007f00
|
||||
#define UCR0_UDIV_POS 0
|
||||
#define UCR1_UDIV_POS 8
|
||||
#define UDIV_MAX 127
|
||||
#elif defined(CONFIG_405EX)
|
||||
#define MFREG(a, d) mfsdr(a, d)
|
||||
#define MTREG(a, d) mtsdr(a, d)
|
||||
#define CR0_MASK 0x000000ff
|
||||
#define CR0_EXTCLK_ENA 0x00800000
|
||||
#define CR0_UDIV_POS 0
|
||||
#define UDIV_SUBTRACT 0
|
||||
#define UART0_SDR SDR0_UART0
|
||||
#define UART1_SDR SDR0_UART1
|
||||
#else /* CONFIG_405GP */
|
||||
#define CR0_MASK 0x00001fff
|
||||
#define CR0_EXTCLK_ENA 0x000000c0
|
||||
#define CR0_UDIV_POS 1
|
||||
#define UDIV_MAX 32
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_405EP) && defined(CONFIG_SYS_EXT_SERIAL_CLOCK)
|
||||
#error "External serial clock not supported on AMCC PPC405EP!"
|
||||
#endif
|
||||
|
||||
#if (defined(CONFIG_405EX) || defined(CONFIG_405EZ) || \
|
||||
defined(CONFIG_440)) && !defined(CONFIG_SYS_EXT_SERIAL_CLOCK)
|
||||
/*
|
||||
* For some SoC's, the cpu clock is on divider chain A, UART on
|
||||
* divider chain B ... so cpu clock is irrelevant. Get the
|
||||
* "optimized" values that are subject to the 1/2 opb clock
|
||||
* constraint.
|
||||
*/
|
||||
static u16 serial_bdiv(int baudrate, u32 *udiv)
|
||||
{
|
||||
sys_info_t sysinfo;
|
||||
u32 div; /* total divisor udiv * bdiv */
|
||||
u32 umin; /* minimum udiv */
|
||||
u16 diff; /* smallest diff */
|
||||
u16 idiff; /* current diff */
|
||||
u16 ibdiv; /* current bdiv */
|
||||
u32 i;
|
||||
u32 est; /* current estimate */
|
||||
u32 max;
|
||||
#if defined(CONFIG_405EZ)
|
||||
u32 cpr_pllc;
|
||||
u32 plloutb;
|
||||
u32 reg;
|
||||
#endif
|
||||
|
||||
get_sys_info(&sysinfo);
|
||||
|
||||
#if defined(CONFIG_405EZ)
|
||||
/* check the pll feedback source */
|
||||
mfcpr(CPR0_PLLC, cpr_pllc);
|
||||
plloutb = ((CONFIG_SYS_CLK_FREQ * ((cpr_pllc & PLLC_SRC_MASK) ?
|
||||
sysinfo.pllFwdDivB : sysinfo.pllFwdDiv) *
|
||||
sysinfo.pllFbkDiv) / sysinfo.pllFwdDivB);
|
||||
div = plloutb / (16 * baudrate); /* total divisor */
|
||||
umin = (plloutb / get_OPB_freq()) << 1; /* 2 x OPB divisor */
|
||||
max = 256; /* highest possible */
|
||||
#else /* 405EZ */
|
||||
div = sysinfo.freqPLB / (16 * baudrate); /* total divisor */
|
||||
umin = sysinfo.pllOpbDiv << 1; /* 2 x OPB divisor */
|
||||
max = 32; /* highest possible */
|
||||
#endif /* 405EZ */
|
||||
|
||||
*udiv = diff = max;
|
||||
|
||||
/*
|
||||
* i is the test udiv value -- start with the largest
|
||||
* possible (max) to minimize serial clock and constrain
|
||||
* search to umin.
|
||||
*/
|
||||
for (i = max; i > umin; i--) {
|
||||
ibdiv = div / i;
|
||||
est = i * ibdiv;
|
||||
idiff = (est > div) ? (est - div) : (div - est);
|
||||
if (idiff == 0) {
|
||||
*udiv = i;
|
||||
break; /* can't do better */
|
||||
} else if (idiff < diff) {
|
||||
*udiv = i; /* best so far */
|
||||
diff = idiff; /* update lowest diff*/
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(CONFIG_405EZ)
|
||||
mfcpr(CPR0_PERD0, reg);
|
||||
reg &= ~0x0000ffff;
|
||||
reg |= ((*udiv - 0) << 8) | (*udiv - 0);
|
||||
mtcpr(CPR0_PERD0, reg);
|
||||
#endif
|
||||
|
||||
return div / *udiv;
|
||||
}
|
||||
#endif /* #if (defined(CONFIG_405EP) ... */
|
||||
|
||||
/*
|
||||
* This function returns the UART clock used by the common
|
||||
* NS16550 driver. Additionally the SoC internal divisors for
|
||||
* optimal UART baudrate are configured.
|
||||
*/
|
||||
int get_serial_clock(void)
|
||||
{
|
||||
u32 clk;
|
||||
u32 udiv;
|
||||
#if !defined(CONFIG_405EZ)
|
||||
u32 reg;
|
||||
#endif
|
||||
#if !defined(CONFIG_SYS_EXT_SERIAL_CLOCK)
|
||||
PPC4xx_SYS_INFO sys_info;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Programming of the internal divisors is SoC specific.
|
||||
* Let's handle this in some #ifdef's for the SoC's.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_405GP)
|
||||
reg = mfdcr(CPC0_CR0) & ~CR0_MASK;
|
||||
#ifdef CONFIG_SYS_EXT_SERIAL_CLOCK
|
||||
clk = CONFIG_SYS_EXT_SERIAL_CLOCK;
|
||||
udiv = 1;
|
||||
reg |= CR0_EXTCLK_ENA;
|
||||
#else /* CONFIG_SYS_EXT_SERIAL_CLOCK */
|
||||
clk = gd->cpu_clk;
|
||||
#ifdef CONFIG_SYS_405_UART_ERRATA_59
|
||||
udiv = 31; /* Errata 59: stuck at 31 */
|
||||
#else /* CONFIG_SYS_405_UART_ERRATA_59 */
|
||||
{
|
||||
u32 tmp = CONFIG_SYS_BASE_BAUD * 16;
|
||||
|
||||
udiv = (clk + tmp / 2) / tmp;
|
||||
}
|
||||
if (udiv > UDIV_MAX) /* max. n bits for udiv */
|
||||
udiv = UDIV_MAX;
|
||||
#endif /* CONFIG_SYS_405_UART_ERRATA_59 */
|
||||
#endif /* CONFIG_SYS_EXT_SERIAL_CLOCK */
|
||||
reg |= (udiv - 1) << CR0_UDIV_POS; /* set the UART divisor */
|
||||
mtdcr (CPC0_CR0, reg);
|
||||
#ifdef CONFIG_SYS_EXT_SERIAL_CLOCK
|
||||
clk = CONFIG_SYS_EXT_SERIAL_CLOCK;
|
||||
#else
|
||||
clk = CONFIG_SYS_BASE_BAUD * 16;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_405EP)
|
||||
{
|
||||
u32 tmp = CONFIG_SYS_BASE_BAUD * 16;
|
||||
|
||||
reg = mfdcr(CPC0_UCR) & ~(UCR0_MASK | UCR1_MASK);
|
||||
clk = gd->cpu_clk;
|
||||
udiv = (clk + tmp / 2) / tmp;
|
||||
if (udiv > UDIV_MAX) /* max. n bits for udiv */
|
||||
udiv = UDIV_MAX;
|
||||
}
|
||||
reg |= udiv << UCR0_UDIV_POS; /* set the UART divisor */
|
||||
reg |= udiv << UCR1_UDIV_POS; /* set the UART divisor */
|
||||
mtdcr(CPC0_UCR, reg);
|
||||
clk = CONFIG_SYS_BASE_BAUD * 16;
|
||||
#endif /* CONFIG_405EP */
|
||||
|
||||
#if defined(CONFIG_405EX) || defined(CONFIG_440)
|
||||
MFREG(UART0_SDR, reg);
|
||||
reg &= ~CR0_MASK;
|
||||
|
||||
#ifdef CONFIG_SYS_EXT_SERIAL_CLOCK
|
||||
reg |= CR0_EXTCLK_ENA;
|
||||
udiv = 1;
|
||||
clk = CONFIG_SYS_EXT_SERIAL_CLOCK;
|
||||
#else /* CONFIG_SYS_EXT_SERIAL_CLOCK */
|
||||
clk = gd->baudrate * serial_bdiv(gd->baudrate, &udiv) * 16;
|
||||
#endif /* CONFIG_SYS_EXT_SERIAL_CLOCK */
|
||||
|
||||
reg |= (udiv - UDIV_SUBTRACT) << CR0_UDIV_POS; /* set the UART divisor */
|
||||
|
||||
/*
|
||||
* Configure input clock to baudrate generator for all
|
||||
* available serial ports here
|
||||
*/
|
||||
MTREG(UART0_SDR, reg);
|
||||
#if defined(UART1_SDR)
|
||||
MTREG(UART1_SDR, reg);
|
||||
#endif
|
||||
#if defined(UART2_SDR)
|
||||
MTREG(UART2_SDR, reg);
|
||||
#endif
|
||||
#if defined(UART3_SDR)
|
||||
MTREG(UART3_SDR, reg);
|
||||
#endif
|
||||
#endif /* CONFIG_405EX ... */
|
||||
|
||||
#if defined(CONFIG_405EZ)
|
||||
clk = gd->baudrate * serial_bdiv(gd->baudrate, &udiv) * 16;
|
||||
#endif /* CONFIG_405EZ */
|
||||
|
||||
/*
|
||||
* Correct UART frequency in bd-info struct now that
|
||||
* the UART divisor is available
|
||||
*/
|
||||
#ifdef CONFIG_SYS_EXT_SERIAL_CLOCK
|
||||
gd->arch.uart_clk = CONFIG_SYS_EXT_SERIAL_CLOCK;
|
||||
#else
|
||||
get_sys_info(&sys_info);
|
||||
gd->arch.uart_clk = sys_info.freqUART / udiv;
|
||||
#endif
|
||||
|
||||
return clk;
|
||||
}
|
||||
#endif /* CONFIG_405GP */
|
|
@ -1,179 +0,0 @@
|
|||
menu "ppc4xx CPU"
|
||||
depends on 4xx
|
||||
|
||||
config SYS_CPU
|
||||
default "ppc4xx"
|
||||
|
||||
choice
|
||||
prompt "Target select"
|
||||
optional
|
||||
|
||||
config TARGET_LWMON5
|
||||
bool "Support lwmon5"
|
||||
|
||||
config TARGET_T3CORP
|
||||
bool "Support t3corp"
|
||||
|
||||
config TARGET_ACADIA
|
||||
bool "Support acadia"
|
||||
|
||||
config TARGET_BAMBOO
|
||||
bool "Support bamboo"
|
||||
|
||||
config TARGET_BUBINGA
|
||||
bool "Support bubinga"
|
||||
|
||||
config TARGET_CANYONLANDS
|
||||
bool "Support canyonlands"
|
||||
select DM
|
||||
select DM_SERIAL
|
||||
|
||||
config TARGET_KATMAI
|
||||
bool "Support katmai"
|
||||
select PHYS_64BIT
|
||||
|
||||
config TARGET_KILAUEA
|
||||
bool "Support kilauea"
|
||||
|
||||
config TARGET_LUAN
|
||||
bool "Support luan"
|
||||
|
||||
config TARGET_MAKALU
|
||||
bool "Support makalu"
|
||||
|
||||
config TARGET_REDWOOD
|
||||
bool "Support redwood"
|
||||
|
||||
config TARGET_SEQUOIA
|
||||
bool "Support sequoia"
|
||||
|
||||
config TARGET_WALNUT
|
||||
bool "Support walnut"
|
||||
|
||||
config TARGET_YOSEMITE
|
||||
bool "Support yosemite"
|
||||
|
||||
config TARGET_YUCCA
|
||||
bool "Support yucca"
|
||||
|
||||
config TARGET_CPCI2DP
|
||||
bool "Support CPCI2DP"
|
||||
|
||||
config TARGET_CPCI4052
|
||||
bool "Support CPCI4052"
|
||||
|
||||
config TARGET_PLU405
|
||||
bool "Support PLU405"
|
||||
|
||||
config TARGET_PMC405DE
|
||||
bool "Support PMC405DE"
|
||||
|
||||
config TARGET_PMC440
|
||||
bool "Support PMC440"
|
||||
|
||||
config TARGET_VOM405
|
||||
bool "Support VOM405"
|
||||
|
||||
config TARGET_DLVISION_10G
|
||||
bool "Support dlvision-10g"
|
||||
|
||||
config TARGET_IO
|
||||
bool "Support io"
|
||||
|
||||
config TARGET_IOCON
|
||||
bool "Support iocon"
|
||||
|
||||
config TARGET_NEO
|
||||
bool "Support neo"
|
||||
|
||||
config TARGET_IO64
|
||||
bool "Support io64"
|
||||
|
||||
config TARGET_DLVISION
|
||||
bool "Support dlvision"
|
||||
|
||||
config TARGET_GDPPC440ETX
|
||||
bool "Support gdppc440etx"
|
||||
|
||||
config TARGET_INTIP
|
||||
bool "Support intip"
|
||||
|
||||
config TARGET_ICON
|
||||
bool "Support icon"
|
||||
|
||||
config TARGET_MIP405
|
||||
bool "Support MIP405"
|
||||
|
||||
config TARGET_MIP405T
|
||||
bool "Support MIP405T"
|
||||
|
||||
config TARGET_PIP405
|
||||
bool "Support PIP405"
|
||||
|
||||
config TARGET_XPEDITE1000
|
||||
bool "Support xpedite1000"
|
||||
|
||||
config TARGET_XILINX_PPC405_GENERIC
|
||||
bool "Support xilinx-ppc405-generic"
|
||||
select SUPPORT_SPL
|
||||
select OF_CONTROL
|
||||
select DM
|
||||
select DM_SERIAL
|
||||
|
||||
config TARGET_XILINX_PPC440_GENERIC
|
||||
bool "Support xilinx-ppc440-generic"
|
||||
select SUPPORT_SPL
|
||||
select OF_CONTROL
|
||||
select DM
|
||||
select DM_SERIAL
|
||||
|
||||
endchoice
|
||||
|
||||
config CMD_CHIP_CONFIG
|
||||
bool "Enable the 'chip_config' command"
|
||||
help
|
||||
This command programs the I2C bootstrap EEPROM or shows a list of
|
||||
possible configurations. The configurations are board-specific
|
||||
and control the CPU and peripehrals clocks. The programmed
|
||||
configuration is then used when the board boots.
|
||||
|
||||
config CMD_ECCTEST
|
||||
bool "Enable the 'ecctest' command"
|
||||
help
|
||||
This command tests memory ECC by single and double error bit
|
||||
injection.
|
||||
|
||||
source "board/amcc/acadia/Kconfig"
|
||||
source "board/amcc/bamboo/Kconfig"
|
||||
source "board/amcc/bubinga/Kconfig"
|
||||
source "board/amcc/canyonlands/Kconfig"
|
||||
source "board/amcc/katmai/Kconfig"
|
||||
source "board/amcc/kilauea/Kconfig"
|
||||
source "board/amcc/luan/Kconfig"
|
||||
source "board/amcc/makalu/Kconfig"
|
||||
source "board/amcc/redwood/Kconfig"
|
||||
source "board/amcc/sequoia/Kconfig"
|
||||
source "board/amcc/walnut/Kconfig"
|
||||
source "board/amcc/yosemite/Kconfig"
|
||||
source "board/amcc/yucca/Kconfig"
|
||||
source "board/esd/cpci2dp/Kconfig"
|
||||
source "board/esd/cpci405/Kconfig"
|
||||
source "board/esd/plu405/Kconfig"
|
||||
source "board/esd/pmc405de/Kconfig"
|
||||
source "board/esd/pmc440/Kconfig"
|
||||
source "board/esd/vom405/Kconfig"
|
||||
source "board/gdsys/405ep/Kconfig"
|
||||
source "board/gdsys/405ex/Kconfig"
|
||||
source "board/gdsys/dlvision/Kconfig"
|
||||
source "board/gdsys/gdppc440etx/Kconfig"
|
||||
source "board/gdsys/intip/Kconfig"
|
||||
source "board/liebherr/lwmon5/Kconfig"
|
||||
source "board/mosaixtech/icon/Kconfig"
|
||||
source "board/mpl/mip405/Kconfig"
|
||||
source "board/mpl/pip405/Kconfig"
|
||||
source "board/t3corp/Kconfig"
|
||||
source "board/xes/xpedite1000/Kconfig"
|
||||
source "board/xilinx/ppc405-generic/Kconfig"
|
||||
source "board/xilinx/ppc440-generic/Kconfig"
|
||||
|
||||
endmenu
|
|
@ -1,49 +0,0 @@
|
|||
#
|
||||
# (C) Copyright 2000-2006
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
extra-y := resetvec.o
|
||||
extra-y += start.o
|
||||
|
||||
obj-y := cache.o
|
||||
obj-y += dcr.o
|
||||
obj-y += kgdb.o
|
||||
|
||||
obj-y += 40x_spd_sdram.o
|
||||
|
||||
obj-y += 44x_spd_ddr.o
|
||||
obj-$(CONFIG_SDRAM_PPC4xx_IBM_DDR2) += 44x_spd_ddr2.o
|
||||
obj-$(CONFIG_PPC4xx_DDR_AUTOCALIBRATION) += 4xx_ibm_ddr2_autocalib.o
|
||||
obj-y += 4xx_pci.o
|
||||
obj-y += 4xx_pcie.o
|
||||
obj-y += bedbug_405.o
|
||||
obj-$(CONFIG_CMD_CHIP_CONFIG) += cmd_chip_config.o
|
||||
obj-y += cpu.o
|
||||
obj-y += cpu_init.o
|
||||
obj-y += denali_data_eye.o
|
||||
obj-y += denali_spd_ddr2.o
|
||||
obj-y += ecc.o
|
||||
obj-$(CONFIG_CMD_ECCTEST) += cmd_ecctest.o
|
||||
obj-y += fdt.o
|
||||
obj-y += interrupts.o
|
||||
obj-$(CONFIG_CMD_REGINFO) += reginfo.o
|
||||
obj-y += sdram.o
|
||||
obj-y += speed.o
|
||||
obj-y += tlb.o
|
||||
obj-y += traps.o
|
||||
obj-y += usb.o
|
||||
obj-y += usb_ohci.o
|
||||
obj-$(CONFIG_XILINX_440) += xilinx_irq.o
|
||||
ifndef CONFIG_XILINX_440
|
||||
obj-y += 4xx_uart.o
|
||||
obj-y += gpio.o
|
||||
obj-y += miiphy.o
|
||||
obj-y += uic.o
|
||||
endif
|
||||
|
||||
ifdef CONFIG_SPL_BUILD
|
||||
obj-y += spl_boot.o
|
||||
endif
|
|
@ -1,308 +0,0 @@
|
|||
/*
|
||||
* Bedbug Functions specific to the PPC405 chip
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <linux/ctype.h>
|
||||
#include <bedbug/type.h>
|
||||
#include <bedbug/bedbug.h>
|
||||
#include <bedbug/regs.h>
|
||||
#include <bedbug/ppc.h>
|
||||
|
||||
#if defined(CONFIG_CMD_BEDBUG) && defined(CONFIG_4xx)
|
||||
|
||||
#define MAX_BREAK_POINTS 4
|
||||
|
||||
extern CPU_DEBUG_CTX bug_ctx;
|
||||
|
||||
void bedbug405_init __P ((void));
|
||||
void bedbug405_do_break __P ((cmd_tbl_t *, int, int, char * const []));
|
||||
void bedbug405_break_isr __P ((struct pt_regs *));
|
||||
int bedbug405_find_empty __P ((void));
|
||||
int bedbug405_set __P ((int, unsigned long));
|
||||
int bedbug405_clear __P ((int));
|
||||
|
||||
|
||||
/* ======================================================================
|
||||
* Initialize the global bug_ctx structure for the AMCC PPC405. Clear all
|
||||
* of the breakpoints.
|
||||
* ====================================================================== */
|
||||
|
||||
void bedbug405_init (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* -------------------------------------------------- */
|
||||
|
||||
bug_ctx.hw_debug_enabled = 0;
|
||||
bug_ctx.stopped = 0;
|
||||
bug_ctx.current_bp = 0;
|
||||
bug_ctx.regs = NULL;
|
||||
|
||||
bug_ctx.do_break = bedbug405_do_break;
|
||||
bug_ctx.break_isr = bedbug405_break_isr;
|
||||
bug_ctx.find_empty = bedbug405_find_empty;
|
||||
bug_ctx.set = bedbug405_set;
|
||||
bug_ctx.clear = bedbug405_clear;
|
||||
|
||||
for (i = 1; i <= MAX_BREAK_POINTS; ++i)
|
||||
(*bug_ctx.clear) (i);
|
||||
|
||||
puts ("BEDBUG:ready\n");
|
||||
return;
|
||||
} /* bedbug_init_breakpoints */
|
||||
|
||||
|
||||
|
||||
/* ======================================================================
|
||||
* Set/clear/show one of the hardware breakpoints for the 405. The "off"
|
||||
* string will disable a specific breakpoint. The "show" string will
|
||||
* display the current breakpoints. Otherwise an address will set a
|
||||
* breakpoint at that address. Setting a breakpoint uses the CPU-specific
|
||||
* set routine which will assign a breakpoint number.
|
||||
* ====================================================================== */
|
||||
|
||||
void bedbug405_do_break (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
|
||||
{
|
||||
long addr = 0; /* Address to break at */
|
||||
int which_bp; /* Breakpoint number */
|
||||
|
||||
/* -------------------------------------------------- */
|
||||
|
||||
if (argc < 2) {
|
||||
cmd_usage(cmdtp);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Turn off a breakpoint */
|
||||
|
||||
if (strcmp (argv[1], "off") == 0) {
|
||||
if (bug_ctx.hw_debug_enabled == 0) {
|
||||
printf ("No breakpoints enabled\n");
|
||||
return;
|
||||
}
|
||||
|
||||
which_bp = simple_strtoul (argv[2], NULL, 10);
|
||||
|
||||
if (bug_ctx.clear)
|
||||
(*bug_ctx.clear) (which_bp);
|
||||
|
||||
printf ("Breakpoint %d removed\n", which_bp);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Show a list of breakpoints */
|
||||
|
||||
if (strcmp (argv[1], "show") == 0) {
|
||||
for (which_bp = 1; which_bp <= MAX_BREAK_POINTS; ++which_bp) {
|
||||
|
||||
switch (which_bp) {
|
||||
case 1:
|
||||
addr = GET_IAC1 ();
|
||||
break;
|
||||
case 2:
|
||||
addr = GET_IAC2 ();
|
||||
break;
|
||||
case 3:
|
||||
addr = GET_IAC3 ();
|
||||
break;
|
||||
case 4:
|
||||
addr = GET_IAC4 ();
|
||||
break;
|
||||
}
|
||||
|
||||
printf ("Breakpoint [%d]: ", which_bp);
|
||||
if (addr == 0)
|
||||
printf ("NOT SET\n");
|
||||
else
|
||||
disppc ((unsigned char *) addr, 0, 1, bedbug_puts,
|
||||
F_RADHEX);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* Set a breakpoint at the address */
|
||||
|
||||
if (!isdigit (argv[1][0])) {
|
||||
cmd_usage(cmdtp);
|
||||
return;
|
||||
}
|
||||
|
||||
addr = simple_strtoul (argv[1], NULL, 16) & 0xfffffffc;
|
||||
|
||||
if ((bug_ctx.set) && (which_bp = (*bug_ctx.set) (0, addr)) > 0) {
|
||||
printf ("Breakpoint [%d]: ", which_bp);
|
||||
disppc ((unsigned char *) addr, 0, 1, bedbug_puts, F_RADHEX);
|
||||
}
|
||||
|
||||
return;
|
||||
} /* bedbug405_do_break */
|
||||
|
||||
|
||||
|
||||
/* ======================================================================
|
||||
* Handle a breakpoint. First determine which breakpoint was hit by
|
||||
* looking at the DeBug Status Register (DBSR), clear the breakpoint
|
||||
* and enter a mini main loop. Stay in the loop until the stopped flag
|
||||
* in the debug context is cleared.
|
||||
* ====================================================================== */
|
||||
|
||||
void bedbug405_break_isr (struct pt_regs *regs)
|
||||
{
|
||||
unsigned long dbsr_val; /* Value of the DBSR */
|
||||
unsigned long addr = 0; /* Address stopped at */
|
||||
|
||||
/* -------------------------------------------------- */
|
||||
|
||||
dbsr_val = GET_DBSR ();
|
||||
|
||||
if (dbsr_val & DBSR_IA1) {
|
||||
bug_ctx.current_bp = 1;
|
||||
addr = GET_IAC1 ();
|
||||
SET_DBSR (DBSR_IA1); /* Write a 1 to clear */
|
||||
} else if (dbsr_val & DBSR_IA2) {
|
||||
bug_ctx.current_bp = 2;
|
||||
addr = GET_IAC2 ();
|
||||
SET_DBSR (DBSR_IA2); /* Write a 1 to clear */
|
||||
} else if (dbsr_val & DBSR_IA3) {
|
||||
bug_ctx.current_bp = 3;
|
||||
addr = GET_IAC3 ();
|
||||
SET_DBSR (DBSR_IA3); /* Write a 1 to clear */
|
||||
} else if (dbsr_val & DBSR_IA4) {
|
||||
bug_ctx.current_bp = 4;
|
||||
addr = GET_IAC4 ();
|
||||
SET_DBSR (DBSR_IA4); /* Write a 1 to clear */
|
||||
}
|
||||
|
||||
bedbug_main_loop (addr, regs);
|
||||
return;
|
||||
} /* bedbug405_break_isr */
|
||||
|
||||
|
||||
|
||||
/* ======================================================================
|
||||
* Look through all of the hardware breakpoints available to see if one
|
||||
* is unused.
|
||||
* ====================================================================== */
|
||||
|
||||
int bedbug405_find_empty (void)
|
||||
{
|
||||
/* -------------------------------------------------- */
|
||||
|
||||
if (GET_IAC1 () == 0)
|
||||
return 1;
|
||||
|
||||
if (GET_IAC2 () == 0)
|
||||
return 2;
|
||||
|
||||
if (GET_IAC3 () == 0)
|
||||
return 3;
|
||||
|
||||
if (GET_IAC4 () == 0)
|
||||
return 4;
|
||||
|
||||
return 0;
|
||||
} /* bedbug405_find_empty */
|
||||
|
||||
|
||||
|
||||
/* ======================================================================
|
||||
* Set a breakpoint. If 'which_bp' is zero then find an unused breakpoint
|
||||
* number, otherwise reassign the given breakpoint. If hardware debugging
|
||||
* is not enabled, then turn it on via the MSR and DBCR0. Set the break
|
||||
* address in the appropriate IACx register and enable proper address
|
||||
* beakpoint in DBCR0.
|
||||
* ====================================================================== */
|
||||
|
||||
int bedbug405_set (int which_bp, unsigned long addr)
|
||||
{
|
||||
/* -------------------------------------------------- */
|
||||
|
||||
/* Only look if which_bp == 0, else use which_bp */
|
||||
if ((bug_ctx.find_empty) && (!which_bp) &&
|
||||
(which_bp = (*bug_ctx.find_empty) ()) == 0) {
|
||||
printf ("All breakpoints in use\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (which_bp < 1 || which_bp > MAX_BREAK_POINTS) {
|
||||
printf ("Invalid break point # %d\n", which_bp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!bug_ctx.hw_debug_enabled) {
|
||||
SET_MSR (GET_MSR () | 0x200); /* set MSR[ DE ] */
|
||||
SET_DBCR0 (GET_DBCR0 () | DBCR0_IDM);
|
||||
bug_ctx.hw_debug_enabled = 1;
|
||||
}
|
||||
|
||||
switch (which_bp) {
|
||||
case 1:
|
||||
SET_IAC1 (addr);
|
||||
SET_DBCR0 (GET_DBCR0 () | DBCR0_IA1);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
SET_IAC2 (addr);
|
||||
SET_DBCR0 (GET_DBCR0 () | DBCR0_IA2);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
SET_IAC3 (addr);
|
||||
SET_DBCR0 (GET_DBCR0 () | DBCR0_IA3);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
SET_IAC4 (addr);
|
||||
SET_DBCR0 (GET_DBCR0 () | DBCR0_IA4);
|
||||
break;
|
||||
}
|
||||
|
||||
return which_bp;
|
||||
} /* bedbug405_set */
|
||||
|
||||
|
||||
|
||||
/* ======================================================================
|
||||
* Disable a specific breakoint by setting the appropriate IACx register
|
||||
* to zero and claring the instruction address breakpoint in DBCR0.
|
||||
* ====================================================================== */
|
||||
|
||||
int bedbug405_clear (int which_bp)
|
||||
{
|
||||
/* -------------------------------------------------- */
|
||||
|
||||
if (which_bp < 1 || which_bp > MAX_BREAK_POINTS) {
|
||||
printf ("Invalid break point # (%d)\n", which_bp);
|
||||
return -1;
|
||||
}
|
||||
|
||||
switch (which_bp) {
|
||||
case 1:
|
||||
SET_IAC1 (0);
|
||||
SET_DBCR0 (GET_DBCR0 () & ~DBCR0_IA1);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
SET_IAC2 (0);
|
||||
SET_DBCR0 (GET_DBCR0 () & ~DBCR0_IA2);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
SET_IAC3 (0);
|
||||
SET_DBCR0 (GET_DBCR0 () & ~DBCR0_IA3);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
SET_IAC4 (0);
|
||||
SET_DBCR0 (GET_DBCR0 () & ~DBCR0_IA4);
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
} /* bedbug405_clear */
|
||||
|
||||
|
||||
/* ====================================================================== */
|
||||
#endif
|
|
@ -1,188 +0,0 @@
|
|||
/*
|
||||
* This file contains miscellaneous low-level functions.
|
||||
* Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
|
||||
*
|
||||
* Largely rewritten by Cort Dougan (cort@cs.nmt.edu)
|
||||
* and Paul Mackerras.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <config.h>
|
||||
#include <asm/ppc4xx.h>
|
||||
#include <ppc_asm.tmpl>
|
||||
#include <ppc_defs.h>
|
||||
#include <asm/cache.h>
|
||||
#include <asm/mmu.h>
|
||||
|
||||
/*
|
||||
* Flush instruction cache.
|
||||
*/
|
||||
_GLOBAL(invalidate_icache)
|
||||
iccci r0,r0
|
||||
isync
|
||||
blr
|
||||
|
||||
/*
|
||||
* Write any modified data cache blocks out to memory
|
||||
* and invalidate the corresponding instruction cache blocks.
|
||||
*
|
||||
* flush_icache_range(unsigned long start, unsigned long stop)
|
||||
*/
|
||||
_GLOBAL(flush_icache_range)
|
||||
li r5,L1_CACHE_BYTES-1
|
||||
andc r3,r3,r5
|
||||
subf r4,r3,r4
|
||||
add r4,r4,r5
|
||||
srwi. r4,r4,L1_CACHE_SHIFT
|
||||
beqlr
|
||||
mtctr r4
|
||||
mr r6,r3
|
||||
1: dcbst 0,r3
|
||||
addi r3,r3,L1_CACHE_BYTES
|
||||
bdnz 1b
|
||||
sync /* wait for dcbst's to get to ram */
|
||||
mtctr r4
|
||||
2: icbi 0,r6
|
||||
addi r6,r6,L1_CACHE_BYTES
|
||||
bdnz 2b
|
||||
sync /* additional sync needed on g4 */
|
||||
isync
|
||||
blr
|
||||
|
||||
/*
|
||||
* Write any modified data cache blocks out to memory.
|
||||
* Does not invalidate the corresponding cache lines (especially for
|
||||
* any corresponding instruction cache).
|
||||
*
|
||||
* clean_dcache_range(unsigned long start, unsigned long stop)
|
||||
*/
|
||||
_GLOBAL(clean_dcache_range)
|
||||
li r5,L1_CACHE_BYTES-1
|
||||
andc r3,r3,r5
|
||||
subf r4,r3,r4
|
||||
add r4,r4,r5
|
||||
srwi. r4,r4,L1_CACHE_SHIFT
|
||||
beqlr
|
||||
mtctr r4
|
||||
|
||||
1: dcbst 0,r3
|
||||
addi r3,r3,L1_CACHE_BYTES
|
||||
bdnz 1b
|
||||
sync /* wait for dcbst's to get to ram */
|
||||
blr
|
||||
|
||||
/*
|
||||
* 40x cores have 8K or 16K dcache and 32 byte line size.
|
||||
* 44x has a 32K dcache and 32 byte line size.
|
||||
* 8xx has 1, 2, 4, 8K variants.
|
||||
* For now, cover the worst case of the 44x.
|
||||
* Must be called with external interrupts disabled.
|
||||
*/
|
||||
#define CACHE_NWAYS 64
|
||||
#define CACHE_NLINES 32
|
||||
|
||||
_GLOBAL(flush_dcache)
|
||||
li r4,(2 * CACHE_NWAYS * CACHE_NLINES)
|
||||
mtctr r4
|
||||
lis r5,0
|
||||
1: lwz r3,0(r5) /* Load one word from every line */
|
||||
addi r5,r5,L1_CACHE_BYTES
|
||||
bdnz 1b
|
||||
sync
|
||||
blr
|
||||
|
||||
_GLOBAL(invalidate_dcache)
|
||||
addi r6,0,0x0000 /* clear GPR 6 */
|
||||
/* Do loop for # of dcache congruence classes. */
|
||||
lis r7,(CONFIG_SYS_DCACHE_SIZE / L1_CACHE_BYTES / 2)@ha /* TBS for large sized cache */
|
||||
ori r7,r7,(CONFIG_SYS_DCACHE_SIZE / L1_CACHE_BYTES / 2)@l
|
||||
/* NOTE: dccci invalidates both */
|
||||
mtctr r7 /* ways in the D cache */
|
||||
..dcloop:
|
||||
dccci 0,r6 /* invalidate line */
|
||||
addi r6,r6,L1_CACHE_BYTES /* bump to next line */
|
||||
bdnz ..dcloop
|
||||
sync
|
||||
blr
|
||||
|
||||
/*
|
||||
* Cache functions.
|
||||
*
|
||||
* NOTE: currently the 440s run with dcache _disabled_ once relocated to DRAM,
|
||||
* although for some cache-ralated calls stubs have to be provided to satisfy
|
||||
* symbols resolution.
|
||||
* Icache-related functions are used in POST framework.
|
||||
*
|
||||
*/
|
||||
#ifdef CONFIG_440
|
||||
|
||||
.globl dcache_disable
|
||||
.globl dcache_enable
|
||||
.globl icache_disable
|
||||
.globl icache_enable
|
||||
dcache_disable:
|
||||
dcache_enable:
|
||||
icache_disable:
|
||||
icache_enable:
|
||||
blr
|
||||
|
||||
.globl dcache_status
|
||||
.globl icache_status
|
||||
dcache_status:
|
||||
icache_status:
|
||||
mr r3, 0
|
||||
blr
|
||||
|
||||
#else /* CONFIG_440 */
|
||||
|
||||
.globl icache_enable
|
||||
icache_enable:
|
||||
mflr r8
|
||||
bl invalidate_icache
|
||||
mtlr r8
|
||||
isync
|
||||
addis r3,r0, 0xc000 /* set bit 0 */
|
||||
mticcr r3
|
||||
blr
|
||||
|
||||
.globl icache_disable
|
||||
icache_disable:
|
||||
addis r3,r0, 0x0000 /* clear bit 0 */
|
||||
mticcr r3
|
||||
isync
|
||||
blr
|
||||
|
||||
.globl icache_status
|
||||
icache_status:
|
||||
mficcr r3
|
||||
srwi r3, r3, 31 /* >>31 => select bit 0 */
|
||||
blr
|
||||
|
||||
.globl dcache_enable
|
||||
dcache_enable:
|
||||
mflr r8
|
||||
bl invalidate_dcache
|
||||
mtlr r8
|
||||
isync
|
||||
addis r3,r0, 0x8000 /* set bit 0 */
|
||||
mtdccr r3
|
||||
blr
|
||||
|
||||
.globl dcache_disable
|
||||
dcache_disable:
|
||||
mflr r8
|
||||
bl flush_dcache
|
||||
mtlr r8
|
||||
addis r3,r0, 0x0000 /* clear bit 0 */
|
||||
mtdccr r3
|
||||
blr
|
||||
|
||||
.globl dcache_status
|
||||
dcache_status:
|
||||
mfdccr r3
|
||||
srwi r3, r3, 31 /* >>31 => select bit 0 */
|
||||
blr
|
||||
|
||||
#endif /* CONFIG_440 */
|
|
@ -1,131 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2008-2009
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* (C) Copyright 2009
|
||||
* Dirk Eibach, Guntermann & Drunck GmbH, eibach@gdsys.de
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <i2c.h>
|
||||
#include <asm/ppc4xx_config.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
static void print_configs(int cur_config_nr)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ppc4xx_config_count; i++) {
|
||||
printf("%-16s - %s", ppc4xx_config_val[i].label,
|
||||
ppc4xx_config_val[i].description);
|
||||
if (i == cur_config_nr)
|
||||
printf(" ***");
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static int do_chip_config(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
{
|
||||
int i;
|
||||
int ret;
|
||||
int cur_config_nr = -1;
|
||||
u8 cur_config[CONFIG_4xx_CONFIG_BLOCKSIZE];
|
||||
|
||||
/*
|
||||
* First switch to correct I2C bus. This is I2C bus 0
|
||||
* for all currently available 4xx derivats.
|
||||
*/
|
||||
i2c_set_bus_num(0);
|
||||
|
||||
#ifdef CONFIG_CMD_EEPROM
|
||||
ret = eeprom_read(CONFIG_4xx_CONFIG_I2C_EEPROM_ADDR,
|
||||
CONFIG_4xx_CONFIG_I2C_EEPROM_OFFSET,
|
||||
cur_config, CONFIG_4xx_CONFIG_BLOCKSIZE);
|
||||
#else
|
||||
ret = i2c_read(CONFIG_4xx_CONFIG_I2C_EEPROM_ADDR,
|
||||
CONFIG_4xx_CONFIG_I2C_EEPROM_OFFSET,
|
||||
1, cur_config, CONFIG_4xx_CONFIG_BLOCKSIZE);
|
||||
#endif
|
||||
if (ret) {
|
||||
printf("Error reading EEPROM at addr 0x%x\n",
|
||||
CONFIG_4xx_CONFIG_I2C_EEPROM_ADDR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Search the current configuration
|
||||
*/
|
||||
for (i = 0; i < ppc4xx_config_count; i++) {
|
||||
if (memcmp(cur_config, ppc4xx_config_val[i].val,
|
||||
CONFIG_4xx_CONFIG_BLOCKSIZE) == 0)
|
||||
cur_config_nr = i;
|
||||
}
|
||||
|
||||
if (cur_config_nr == -1) {
|
||||
printf("Warning: The I2C bootstrap values don't match any"
|
||||
" of the available options!\n");
|
||||
printf("I2C bootstrap EEPROM values are (I2C address 0x%02x):\n",
|
||||
CONFIG_4xx_CONFIG_I2C_EEPROM_ADDR);
|
||||
for (i = 0; i < CONFIG_4xx_CONFIG_BLOCKSIZE; i++) {
|
||||
printf("%02x ", cur_config[i]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
if (argc < 2) {
|
||||
printf("Available configurations (I2C address 0x%02x):\n",
|
||||
CONFIG_4xx_CONFIG_I2C_EEPROM_ADDR);
|
||||
print_configs(cur_config_nr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < ppc4xx_config_count; i++) {
|
||||
/*
|
||||
* Search for configuration name/label
|
||||
*/
|
||||
if (strcmp(argv[1], ppc4xx_config_val[i].label) == 0) {
|
||||
printf("Using configuration:\n%-16s - %s\n",
|
||||
ppc4xx_config_val[i].label,
|
||||
ppc4xx_config_val[i].description);
|
||||
|
||||
#ifdef CONFIG_CMD_EEPROM
|
||||
ret = eeprom_write(CONFIG_4xx_CONFIG_I2C_EEPROM_ADDR,
|
||||
CONFIG_4xx_CONFIG_I2C_EEPROM_OFFSET,
|
||||
ppc4xx_config_val[i].val,
|
||||
CONFIG_4xx_CONFIG_BLOCKSIZE);
|
||||
#else
|
||||
ret = i2c_write(CONFIG_4xx_CONFIG_I2C_EEPROM_ADDR,
|
||||
CONFIG_4xx_CONFIG_I2C_EEPROM_OFFSET,
|
||||
1, ppc4xx_config_val[i].val,
|
||||
CONFIG_4xx_CONFIG_BLOCKSIZE);
|
||||
#endif
|
||||
udelay(CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS * 1000);
|
||||
if (ret) {
|
||||
printf("Error updating EEPROM at addr 0x%x\n",
|
||||
CONFIG_4xx_CONFIG_I2C_EEPROM_ADDR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("done (dump via 'i2c md %x 0.1 %x')\n",
|
||||
CONFIG_4xx_CONFIG_I2C_EEPROM_ADDR,
|
||||
CONFIG_4xx_CONFIG_BLOCKSIZE);
|
||||
printf("Reset the board for the changes to"
|
||||
" take effect\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
printf("Configuration %s not found!\n", argv[1]);
|
||||
print_configs(cur_config_nr);
|
||||
return -1;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
chip_config, 2, 0, do_chip_config,
|
||||
"program the I2C bootstrap EEPROM",
|
||||
"[config-label]"
|
||||
);
|
|
@ -1,262 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2010
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/ppc4xx.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/cache.h>
|
||||
|
||||
#if defined(CONFIG_SDRAM_PPC4xx_IBM_DDR) || \
|
||||
defined(CONFIG_SDRAM_PPC4xx_IBM_DDR2)
|
||||
#if defined(CONFIG_DDR_ECC) || defined(CONFIG_SDRAM_ECC)
|
||||
|
||||
#if defined(CONFIG_405EX)
|
||||
/*
|
||||
* Currently only 405EX uses 16bit data bus width as an alternative
|
||||
* option to 32bit data width (SDRAM0_MCOPT1_WDTH)
|
||||
*/
|
||||
#define SDRAM_DATA_ALT_WIDTH 2
|
||||
#else
|
||||
#define SDRAM_DATA_ALT_WIDTH 8
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_SYS_OCM_BASE)
|
||||
#define CONFIG_FUNC_ISRAM_ADDR CONFIG_SYS_OCM_BASE
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_SYS_ISRAM_BASE)
|
||||
#define CONFIG_FUNC_ISRAM_ADDR CONFIG_SYS_ISRAM_BASE
|
||||
#endif
|
||||
|
||||
#if !defined(CONFIG_FUNC_ISRAM_ADDR)
|
||||
#error "No internal SRAM/OCM provided!"
|
||||
#endif
|
||||
|
||||
#define force_inline inline __attribute__ ((always_inline))
|
||||
|
||||
static inline void machine_check_disable(void)
|
||||
{
|
||||
mtmsr(mfmsr() & ~MSR_ME);
|
||||
}
|
||||
|
||||
static inline void machine_check_enable(void)
|
||||
{
|
||||
mtmsr(mfmsr() | MSR_ME);
|
||||
}
|
||||
|
||||
/*
|
||||
* These helper functions need to be inlined, since they
|
||||
* are called from the functions running from internal SRAM.
|
||||
* SDRAM operation is forbidden at that time, so calling
|
||||
* functions in SDRAM has to be avoided.
|
||||
*/
|
||||
static force_inline void wait_ddr_idle(void)
|
||||
{
|
||||
u32 val;
|
||||
|
||||
do {
|
||||
mfsdram(SDRAM_MCSTAT, val);
|
||||
} while ((val & SDRAM_MCSTAT_IDLE_MASK) == SDRAM_MCSTAT_IDLE_NOT);
|
||||
}
|
||||
|
||||
static force_inline void recalibrate_ddr(void)
|
||||
{
|
||||
u32 val;
|
||||
|
||||
/*
|
||||
* Rewrite RQDC & RFDC to calibrate again. If this is not
|
||||
* done, the SDRAM controller is working correctly after
|
||||
* changing the MCOPT1_MCHK bits.
|
||||
*/
|
||||
mfsdram(SDRAM_RQDC, val);
|
||||
mtsdram(SDRAM_RQDC, val);
|
||||
mfsdram(SDRAM_RFDC, val);
|
||||
mtsdram(SDRAM_RFDC, val);
|
||||
}
|
||||
|
||||
static force_inline void set_mcopt1_mchk(u32 bits)
|
||||
{
|
||||
u32 val;
|
||||
|
||||
wait_ddr_idle();
|
||||
mfsdram(SDRAM_MCOPT1, val);
|
||||
mtsdram(SDRAM_MCOPT1, (val & ~SDRAM_MCOPT1_MCHK_MASK) | bits);
|
||||
recalibrate_ddr();
|
||||
}
|
||||
|
||||
/*
|
||||
* The next 2 functions are copied to internal SRAM/OCM and run
|
||||
* there. No function calls allowed here. No SDRAM acitivity should
|
||||
* be done here.
|
||||
*/
|
||||
static void inject_ecc_error(void *ptr, int par)
|
||||
{
|
||||
/*
|
||||
* Taken from PPC460EX/EXr/GT users manual (Rev 1.21)
|
||||
* 22.2.17.13 ECC Diagnostics
|
||||
*
|
||||
* Items 1 ... 5 are already done by now, running from RAM
|
||||
* with ECC enabled
|
||||
*/
|
||||
|
||||
out_be32(ptr, 0x00000000);
|
||||
in_be32(ptr);
|
||||
|
||||
/* 6. Set memory controller to no error checking */
|
||||
set_mcopt1_mchk(SDRAM_MCOPT1_MCHK_NON);
|
||||
|
||||
/* 7. Modify one or two bits for error simulation */
|
||||
if (par == 1)
|
||||
out_be32(ptr, in_be32(ptr) ^ 0x00000001);
|
||||
else
|
||||
out_be32(ptr, in_be32(ptr) ^ 0x00000003);
|
||||
|
||||
/* 8. Wait for SDRAM idle */
|
||||
in_be32(ptr);
|
||||
set_mcopt1_mchk(SDRAM_MCOPT1_MCHK_CHK_REP);
|
||||
|
||||
/* Wait for SDRAM idle */
|
||||
wait_ddr_idle();
|
||||
|
||||
/* Continue with 9. in calling function... */
|
||||
}
|
||||
|
||||
static void rewrite_ecc_parity(void *ptr, int par)
|
||||
{
|
||||
u32 current_address = (u32)ptr;
|
||||
u32 end_address;
|
||||
u32 address_increment;
|
||||
u32 mcopt1;
|
||||
|
||||
/*
|
||||
* Fill ECC parity byte again. Otherwise further accesses to
|
||||
* the failure address will result in exceptions.
|
||||
*/
|
||||
|
||||
/* Wait for SDRAM idle */
|
||||
in_be32(0x00000000);
|
||||
set_mcopt1_mchk(SDRAM_MCOPT1_MCHK_GEN);
|
||||
|
||||
/* ECC bit set method for non-cached memory */
|
||||
mfsdram(SDRAM_MCOPT1, mcopt1);
|
||||
if ((mcopt1 & SDRAM_MCOPT1_DMWD_MASK) == SDRAM_MCOPT1_DMWD_32)
|
||||
address_increment = 4;
|
||||
else
|
||||
address_increment = SDRAM_DATA_ALT_WIDTH;
|
||||
end_address = current_address + CONFIG_SYS_CACHELINE_SIZE;
|
||||
|
||||
while (current_address < end_address) {
|
||||
*((unsigned long *)current_address) = 0;
|
||||
current_address += address_increment;
|
||||
}
|
||||
|
||||
set_mcopt1_mchk(SDRAM_MCOPT1_MCHK_CHK_REP);
|
||||
|
||||
/* Wait for SDRAM idle */
|
||||
wait_ddr_idle();
|
||||
}
|
||||
|
||||
static int do_ecctest(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
{
|
||||
u32 old_val;
|
||||
u32 val;
|
||||
u32 *ptr;
|
||||
void (*sram_func)(u32 *, int);
|
||||
int error;
|
||||
|
||||
if (argc < 3) {
|
||||
return cmd_usage(cmdtp);
|
||||
}
|
||||
|
||||
ptr = (u32 *)simple_strtoul(argv[1], NULL, 16);
|
||||
error = simple_strtoul(argv[2], NULL, 16);
|
||||
if ((error < 1) || (error > 2)) {
|
||||
return cmd_usage(cmdtp);
|
||||
}
|
||||
|
||||
printf("Using address %p for %d bit ECC error injection\n",
|
||||
ptr, error);
|
||||
|
||||
/*
|
||||
* Save value to restore it later on
|
||||
*/
|
||||
old_val = in_be32(ptr);
|
||||
|
||||
/*
|
||||
* Copy ECC injection function into internal SRAM/OCM
|
||||
*/
|
||||
sram_func = (void *)CONFIG_FUNC_ISRAM_ADDR;
|
||||
memcpy((void *)CONFIG_FUNC_ISRAM_ADDR, inject_ecc_error, 0x10000);
|
||||
|
||||
/*
|
||||
* Disable interrupts and exceptions before calling this
|
||||
* function in internal SRAM/OCM
|
||||
*/
|
||||
disable_interrupts();
|
||||
machine_check_disable();
|
||||
eieio();
|
||||
|
||||
/*
|
||||
* Jump to ECC simulation function in internal SRAM/OCM
|
||||
*/
|
||||
(*sram_func)(ptr, error);
|
||||
|
||||
/* 10. Read the corresponding address */
|
||||
val = in_be32(ptr);
|
||||
|
||||
/*
|
||||
* Read and print ECC status register/info:
|
||||
* The faulting address is only known upon uncorrectable ECC
|
||||
* errors.
|
||||
*/
|
||||
mfsdram(SDRAM_ECCES, val);
|
||||
if (val & SDRAM_ECCES_CE)
|
||||
printf("ECC: Correctable error\n");
|
||||
if (val & SDRAM_ECCES_UE) {
|
||||
printf("ECC: Uncorrectable error at 0x%02x%08x\n",
|
||||
mfdcr(SDRAM_ERRADDULL), mfdcr(SDRAM_ERRADDLLL));
|
||||
}
|
||||
|
||||
/*
|
||||
* Clear pending interrupts/exceptions
|
||||
*/
|
||||
mtsdram(SDRAM_ECCES, 0xffffffff);
|
||||
mtdcr(SDRAM_ERRSTATLL, 0xff000000);
|
||||
set_mcsr(get_mcsr());
|
||||
|
||||
/* Now enable interrupts and exceptions again */
|
||||
eieio();
|
||||
machine_check_enable();
|
||||
enable_interrupts();
|
||||
|
||||
/*
|
||||
* The ECC parity byte need to be re-written for the
|
||||
* corresponding address. Otherwise future accesses to it
|
||||
* will result in exceptions.
|
||||
*
|
||||
* Jump to ECC parity generation function
|
||||
*/
|
||||
memcpy((void *)CONFIG_FUNC_ISRAM_ADDR, rewrite_ecc_parity, 0x10000);
|
||||
(*sram_func)(ptr, 0);
|
||||
|
||||
/*
|
||||
* Restore value in corresponding address
|
||||
*/
|
||||
out_be32(ptr, old_val);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
ecctest, 3, 0, do_ecctest,
|
||||
"Test ECC by single and double error bit injection",
|
||||
"address 1/2"
|
||||
);
|
||||
|
||||
#endif /* defined(CONFIG_DDR_ECC) || defined(CONFIG_SDRAM_ECC) */
|
||||
#endif /* defined(CONFIG_SDRAM_PPC4xx_IBM_DDR)... */
|
|
@ -1,14 +0,0 @@
|
|||
#
|
||||
# (C) Copyright 2000-2010
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
PLATFORM_CPPFLAGS += -mstring -msoft-float
|
||||
|
||||
ifneq (,$(CONFIG_440))
|
||||
PLATFORM_CPPFLAGS += -Wa,-m440 -mcpu=440
|
||||
else
|
||||
PLATFORM_CPPFLAGS += -Wa,-m405 -mcpu=405
|
||||
endif
|
|
@ -1,702 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2000-2007
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
/*
|
||||
* CPU specific code
|
||||
*
|
||||
* written or collected and sometimes rewritten by
|
||||
* Magnus Damm <damm@bitsmart.com>
|
||||
*
|
||||
* minor modifications by
|
||||
* Wolfgang Denk <wd@denx.de>
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <watchdog.h>
|
||||
#include <command.h>
|
||||
#include <asm/cache.h>
|
||||
#include <asm/ppc4xx.h>
|
||||
#include <netdev.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
void board_reset(void);
|
||||
|
||||
/*
|
||||
* To provide an interface to detect CPU number for boards that support
|
||||
* more then one CPU, we implement the "weak" default functions here.
|
||||
*
|
||||
* Returns CPU number
|
||||
*/
|
||||
int __get_cpu_num(void)
|
||||
{
|
||||
return NA_OR_UNKNOWN_CPU;
|
||||
}
|
||||
int get_cpu_num(void) __attribute__((weak, alias("__get_cpu_num")));
|
||||
|
||||
#if defined(CONFIG_PCI)
|
||||
#if defined(CONFIG_405GP) || \
|
||||
defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
|
||||
defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
|
||||
|
||||
#define PCI_ASYNC
|
||||
|
||||
static int pci_async_enabled(void)
|
||||
{
|
||||
#if defined(CONFIG_405GP)
|
||||
return (mfdcr(CPC0_PSR) & PSR_PCI_ASYNC_EN);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
|
||||
defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
|
||||
defined(CONFIG_460EX) || defined(CONFIG_460GT)
|
||||
unsigned long val;
|
||||
|
||||
mfsdr(SDR0_SDSTP1, val);
|
||||
return (val & SDR0_SDSTP1_PAME_MASK);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
#endif /* CONFIG_PCI */
|
||||
|
||||
#if defined(CONFIG_PCI) && \
|
||||
!defined(CONFIG_405) && !defined(CONFIG_405EX)
|
||||
int pci_arbiter_enabled(void)
|
||||
{
|
||||
#if defined(CONFIG_405GP)
|
||||
return (mfdcr(CPC0_PSR) & PSR_PCI_ARBIT_EN);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_405EP)
|
||||
return (mfdcr(CPC0_PCI) & CPC0_PCI_ARBIT_EN);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_440GP)
|
||||
return (mfdcr(CPC0_STRP1) & CPC0_STRP1_PAE_MASK);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_440GX) || defined(CONFIG_440SP) || defined(CONFIG_440SPE)
|
||||
unsigned long val;
|
||||
|
||||
mfsdr(SDR0_XCR0, val);
|
||||
return (val & SDR0_XCR0_PAE_MASK);
|
||||
#endif
|
||||
#if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
|
||||
defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
|
||||
defined(CONFIG_460EX) || defined(CONFIG_460GT)
|
||||
unsigned long val;
|
||||
|
||||
mfsdr(SDR0_PCI0, val);
|
||||
return (val & SDR0_PCI0_PAE_MASK);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_405EP)
|
||||
#define I2C_BOOTROM
|
||||
|
||||
static int i2c_bootrom_enabled(void)
|
||||
{
|
||||
#if defined(CONFIG_405EP)
|
||||
return (mfdcr(CPC0_BOOT) & CPC0_BOOT_SEP);
|
||||
#else
|
||||
unsigned long val;
|
||||
|
||||
mfsdr(SDR0_SDCS0, val);
|
||||
return (val & SDR0_SDCS_SDD);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_440GX)
|
||||
#define SDR0_PINSTP_SHIFT 29
|
||||
static char *bootstrap_str[] = {
|
||||
"EBC (16 bits)",
|
||||
"EBC (8 bits)",
|
||||
"EBC (32 bits)",
|
||||
"EBC (8 bits)",
|
||||
"PCI",
|
||||
"I2C (Addr 0x54)",
|
||||
"Reserved",
|
||||
"I2C (Addr 0x50)",
|
||||
};
|
||||
static char bootstrap_char[] = { 'A', 'B', 'C', 'B', 'D', 'E', 'x', 'F' };
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_440SP) || defined(CONFIG_440SPE)
|
||||
#define SDR0_PINSTP_SHIFT 30
|
||||
static char *bootstrap_str[] = {
|
||||
"EBC (8 bits)",
|
||||
"PCI",
|
||||
"I2C (Addr 0x54)",
|
||||
"I2C (Addr 0x50)",
|
||||
};
|
||||
static char bootstrap_char[] = { 'A', 'B', 'C', 'D'};
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_440EP) || defined(CONFIG_440GR)
|
||||
#define SDR0_PINSTP_SHIFT 29
|
||||
static char *bootstrap_str[] = {
|
||||
"EBC (8 bits)",
|
||||
"PCI",
|
||||
"NAND (8 bits)",
|
||||
"EBC (16 bits)",
|
||||
"EBC (16 bits)",
|
||||
"I2C (Addr 0x54)",
|
||||
"PCI",
|
||||
"I2C (Addr 0x52)",
|
||||
};
|
||||
static char bootstrap_char[] = { 'A', 'B', 'C', 'D', 'E', 'G', 'F', 'H' };
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
|
||||
#define SDR0_PINSTP_SHIFT 29
|
||||
static char *bootstrap_str[] = {
|
||||
"EBC (8 bits)",
|
||||
"EBC (16 bits)",
|
||||
"EBC (16 bits)",
|
||||
"NAND (8 bits)",
|
||||
"PCI",
|
||||
"I2C (Addr 0x54)",
|
||||
"PCI",
|
||||
"I2C (Addr 0x52)",
|
||||
};
|
||||
static char bootstrap_char[] = { 'A', 'B', 'C', 'D', 'E', 'G', 'F', 'H' };
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_460EX) || defined(CONFIG_460GT)
|
||||
#define SDR0_PINSTP_SHIFT 29
|
||||
static char *bootstrap_str[] = {
|
||||
"EBC (8 bits)",
|
||||
"EBC (16 bits)",
|
||||
"PCI",
|
||||
"PCI",
|
||||
"EBC (16 bits)",
|
||||
"NAND (8 bits)",
|
||||
"I2C (Addr 0x54)", /* A8 */
|
||||
"I2C (Addr 0x52)", /* A4 */
|
||||
};
|
||||
static char bootstrap_char[] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H' };
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_460SX)
|
||||
#define SDR0_PINSTP_SHIFT 29
|
||||
static char *bootstrap_str[] = {
|
||||
"EBC (8 bits)",
|
||||
"EBC (16 bits)",
|
||||
"EBC (32 bits)",
|
||||
"NAND (8 bits)",
|
||||
"I2C (Addr 0x54)", /* A8 */
|
||||
"I2C (Addr 0x52)", /* A4 */
|
||||
};
|
||||
static char bootstrap_char[] = { 'A', 'B', 'C', 'D', 'E', 'G' };
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_405EZ)
|
||||
#define SDR0_PINSTP_SHIFT 28
|
||||
static char *bootstrap_str[] = {
|
||||
"EBC (8 bits)",
|
||||
"SPI (fast)",
|
||||
"NAND (512 page, 4 addr cycle)",
|
||||
"I2C (Addr 0x50)",
|
||||
"EBC (32 bits)",
|
||||
"I2C (Addr 0x50)",
|
||||
"NAND (2K page, 5 addr cycle)",
|
||||
"I2C (Addr 0x50)",
|
||||
"EBC (16 bits)",
|
||||
"Reserved",
|
||||
"NAND (2K page, 4 addr cycle)",
|
||||
"I2C (Addr 0x50)",
|
||||
"NAND (512 page, 3 addr cycle)",
|
||||
"I2C (Addr 0x50)",
|
||||
"SPI (slow)",
|
||||
"I2C (Addr 0x50)",
|
||||
};
|
||||
static char bootstrap_char[] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', \
|
||||
'I', 'x', 'K', 'L', 'M', 'N', 'O', 'P' };
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_405EX)
|
||||
#define SDR0_PINSTP_SHIFT 29
|
||||
static char *bootstrap_str[] = {
|
||||
"EBC (8 bits)",
|
||||
"EBC (16 bits)",
|
||||
"EBC (16 bits)",
|
||||
"NAND (8 bits)",
|
||||
"NAND (8 bits)",
|
||||
"I2C (Addr 0x54)",
|
||||
"EBC (8 bits)",
|
||||
"I2C (Addr 0x52)",
|
||||
};
|
||||
static char bootstrap_char[] = { 'A', 'B', 'C', 'D', 'E', 'G', 'F', 'H' };
|
||||
#endif
|
||||
|
||||
#if defined(SDR0_PINSTP_SHIFT)
|
||||
static int bootstrap_option(void)
|
||||
{
|
||||
unsigned long val;
|
||||
|
||||
mfsdr(SDR0_PINSTP, val);
|
||||
return ((val & 0xf0000000) >> SDR0_PINSTP_SHIFT);
|
||||
}
|
||||
#endif /* SDR0_PINSTP_SHIFT */
|
||||
|
||||
|
||||
#if defined(CONFIG_440GP)
|
||||
static int do_chip_reset (unsigned long sys0, unsigned long sys1)
|
||||
{
|
||||
/* Changes to CPC0_SYS0 and CPC0_SYS1 require chip
|
||||
* reset.
|
||||
*/
|
||||
mtdcr (CPC0_CR0, mfdcr (CPC0_CR0) | 0x80000000); /* Set SWE */
|
||||
mtdcr (CPC0_SYS0, sys0);
|
||||
mtdcr (CPC0_SYS1, sys1);
|
||||
mtdcr (CPC0_CR0, mfdcr (CPC0_CR0) & ~0x80000000); /* Clr SWE */
|
||||
mtspr (SPRN_DBCR0, 0x20000000); /* Reset the chip */
|
||||
|
||||
return 1;
|
||||
}
|
||||
#endif /* CONFIG_440GP */
|
||||
|
||||
|
||||
int checkcpu (void)
|
||||
{
|
||||
#if !defined(CONFIG_405) /* not used on Xilinx 405 FPGA implementations */
|
||||
uint pvr = get_pvr();
|
||||
ulong clock = gd->cpu_clk;
|
||||
char buf[32];
|
||||
#if defined(CONFIG_460EX) || defined(CONFIG_460GT)
|
||||
u32 reg;
|
||||
#endif
|
||||
|
||||
char addstr[64] = "";
|
||||
sys_info_t sys_info;
|
||||
int cpu_num;
|
||||
|
||||
cpu_num = get_cpu_num();
|
||||
if (cpu_num >= 0)
|
||||
printf("CPU%d: ", cpu_num);
|
||||
else
|
||||
puts("CPU: ");
|
||||
|
||||
get_sys_info(&sys_info);
|
||||
|
||||
#if defined(CONFIG_XILINX_440)
|
||||
puts("IBM PowerPC ");
|
||||
#else
|
||||
puts("AMCC PowerPC ");
|
||||
#endif
|
||||
|
||||
switch (pvr) {
|
||||
|
||||
#if !defined(CONFIG_440)
|
||||
case PVR_405GP_RB:
|
||||
puts("405GP Rev. B");
|
||||
break;
|
||||
|
||||
case PVR_405GP_RC:
|
||||
puts("405GP Rev. C");
|
||||
break;
|
||||
|
||||
case PVR_405GP_RD:
|
||||
puts("405GP Rev. D");
|
||||
break;
|
||||
|
||||
case PVR_405GP_RE:
|
||||
puts("405GP Rev. E");
|
||||
break;
|
||||
|
||||
case PVR_405GPR_RB:
|
||||
puts("405GPr Rev. B");
|
||||
break;
|
||||
|
||||
case PVR_405EP_RB:
|
||||
puts("405EP Rev. B");
|
||||
break;
|
||||
|
||||
case PVR_405EZ_RA:
|
||||
puts("405EZ Rev. A");
|
||||
break;
|
||||
|
||||
case PVR_405EX1_RA:
|
||||
puts("405EX Rev. A");
|
||||
strcpy(addstr, "Security support");
|
||||
break;
|
||||
|
||||
case PVR_405EXR2_RA:
|
||||
puts("405EXr Rev. A");
|
||||
strcpy(addstr, "No Security support");
|
||||
break;
|
||||
|
||||
case PVR_405EX1_RC:
|
||||
puts("405EX Rev. C");
|
||||
strcpy(addstr, "Security support");
|
||||
break;
|
||||
|
||||
case PVR_405EX2_RC:
|
||||
puts("405EX Rev. C");
|
||||
strcpy(addstr, "No Security support");
|
||||
break;
|
||||
|
||||
case PVR_405EXR1_RC:
|
||||
puts("405EXr Rev. C");
|
||||
strcpy(addstr, "Security support");
|
||||
break;
|
||||
|
||||
case PVR_405EXR2_RC:
|
||||
puts("405EXr Rev. C");
|
||||
strcpy(addstr, "No Security support");
|
||||
break;
|
||||
|
||||
case PVR_405EX1_RD:
|
||||
puts("405EX Rev. D");
|
||||
strcpy(addstr, "Security support");
|
||||
break;
|
||||
|
||||
case PVR_405EX2_RD:
|
||||
puts("405EX Rev. D");
|
||||
strcpy(addstr, "No Security support");
|
||||
break;
|
||||
|
||||
case PVR_405EXR1_RD:
|
||||
puts("405EXr Rev. D");
|
||||
strcpy(addstr, "Security support");
|
||||
break;
|
||||
|
||||
case PVR_405EXR2_RD:
|
||||
puts("405EXr Rev. D");
|
||||
strcpy(addstr, "No Security support");
|
||||
break;
|
||||
|
||||
#else /* CONFIG_440 */
|
||||
|
||||
#if defined(CONFIG_440GP)
|
||||
case PVR_440GP_RB:
|
||||
puts("440GP Rev. B");
|
||||
/* See errata 1.12: CHIP_4 */
|
||||
if ((mfdcr(CPC0_SYS0) != mfdcr(CPC0_STRP0)) ||
|
||||
(mfdcr(CPC0_SYS1) != mfdcr(CPC0_STRP1)) ){
|
||||
puts ( "\n\t CPC0_SYSx DCRs corrupted. "
|
||||
"Resetting chip ...\n");
|
||||
udelay( 1000 * 1000 ); /* Give time for serial buf to clear */
|
||||
do_chip_reset ( mfdcr(CPC0_STRP0),
|
||||
mfdcr(CPC0_STRP1) );
|
||||
}
|
||||
break;
|
||||
|
||||
case PVR_440GP_RC:
|
||||
puts("440GP Rev. C");
|
||||
break;
|
||||
#endif /* CONFIG_440GP */
|
||||
|
||||
case PVR_440GX_RA:
|
||||
puts("440GX Rev. A");
|
||||
break;
|
||||
|
||||
case PVR_440GX_RB:
|
||||
puts("440GX Rev. B");
|
||||
break;
|
||||
|
||||
case PVR_440GX_RC:
|
||||
puts("440GX Rev. C");
|
||||
break;
|
||||
|
||||
case PVR_440GX_RF:
|
||||
puts("440GX Rev. F");
|
||||
break;
|
||||
|
||||
case PVR_440EP_RA:
|
||||
puts("440EP Rev. A");
|
||||
break;
|
||||
|
||||
#ifdef CONFIG_440EP
|
||||
case PVR_440EP_RB: /* 440EP rev B and 440GR rev A have same PVR */
|
||||
puts("440EP Rev. B");
|
||||
break;
|
||||
|
||||
case PVR_440EP_RC: /* 440EP rev C and 440GR rev B have same PVR */
|
||||
puts("440EP Rev. C");
|
||||
break;
|
||||
#endif /* CONFIG_440EP */
|
||||
|
||||
#ifdef CONFIG_440GR
|
||||
case PVR_440GR_RA: /* 440EP rev B and 440GR rev A have same PVR */
|
||||
puts("440GR Rev. A");
|
||||
break;
|
||||
|
||||
case PVR_440GR_RB: /* 440EP rev C and 440GR rev B have same PVR */
|
||||
puts("440GR Rev. B");
|
||||
break;
|
||||
#endif /* CONFIG_440GR */
|
||||
|
||||
#ifdef CONFIG_440EPX
|
||||
case PVR_440EPX1_RA: /* 440EPx rev A and 440GRx rev A have same PVR */
|
||||
puts("440EPx Rev. A");
|
||||
strcpy(addstr, "Security/Kasumi support");
|
||||
break;
|
||||
|
||||
case PVR_440EPX2_RA: /* 440EPx rev A and 440GRx rev A have same PVR */
|
||||
puts("440EPx Rev. A");
|
||||
strcpy(addstr, "No Security/Kasumi support");
|
||||
break;
|
||||
#endif /* CONFIG_440EPX */
|
||||
|
||||
#ifdef CONFIG_440GRX
|
||||
case PVR_440GRX1_RA: /* 440EPx rev A and 440GRx rev A have same PVR */
|
||||
puts("440GRx Rev. A");
|
||||
strcpy(addstr, "Security/Kasumi support");
|
||||
break;
|
||||
|
||||
case PVR_440GRX2_RA: /* 440EPx rev A and 440GRx rev A have same PVR */
|
||||
puts("440GRx Rev. A");
|
||||
strcpy(addstr, "No Security/Kasumi support");
|
||||
break;
|
||||
#endif /* CONFIG_440GRX */
|
||||
|
||||
case PVR_440SP_6_RAB:
|
||||
puts("440SP Rev. A/B");
|
||||
strcpy(addstr, "RAID 6 support");
|
||||
break;
|
||||
|
||||
case PVR_440SP_RAB:
|
||||
puts("440SP Rev. A/B");
|
||||
strcpy(addstr, "No RAID 6 support");
|
||||
break;
|
||||
|
||||
case PVR_440SP_6_RC:
|
||||
puts("440SP Rev. C");
|
||||
strcpy(addstr, "RAID 6 support");
|
||||
break;
|
||||
|
||||
case PVR_440SP_RC:
|
||||
puts("440SP Rev. C");
|
||||
strcpy(addstr, "No RAID 6 support");
|
||||
break;
|
||||
|
||||
case PVR_440SPe_6_RA:
|
||||
puts("440SPe Rev. A");
|
||||
strcpy(addstr, "RAID 6 support");
|
||||
break;
|
||||
|
||||
case PVR_440SPe_RA:
|
||||
puts("440SPe Rev. A");
|
||||
strcpy(addstr, "No RAID 6 support");
|
||||
break;
|
||||
|
||||
case PVR_440SPe_6_RB:
|
||||
puts("440SPe Rev. B");
|
||||
strcpy(addstr, "RAID 6 support");
|
||||
break;
|
||||
|
||||
case PVR_440SPe_RB:
|
||||
puts("440SPe Rev. B");
|
||||
strcpy(addstr, "No RAID 6 support");
|
||||
break;
|
||||
|
||||
#if defined(CONFIG_460EX) || defined(CONFIG_460GT)
|
||||
case PVR_460EX_RA:
|
||||
puts("460EX Rev. A");
|
||||
strcpy(addstr, "No Security/Kasumi support");
|
||||
break;
|
||||
|
||||
case PVR_460EX_SE_RA:
|
||||
puts("460EX Rev. A");
|
||||
strcpy(addstr, "Security/Kasumi support");
|
||||
break;
|
||||
|
||||
case PVR_460EX_RB:
|
||||
puts("460EX Rev. B");
|
||||
mfsdr(SDR0_ECID3, reg);
|
||||
if (reg & 0x00100000)
|
||||
strcpy(addstr, "No Security/Kasumi support");
|
||||
else
|
||||
strcpy(addstr, "Security/Kasumi support");
|
||||
break;
|
||||
|
||||
case PVR_460GT_RA:
|
||||
puts("460GT Rev. A");
|
||||
strcpy(addstr, "No Security/Kasumi support");
|
||||
break;
|
||||
|
||||
case PVR_460GT_SE_RA:
|
||||
puts("460GT Rev. A");
|
||||
strcpy(addstr, "Security/Kasumi support");
|
||||
break;
|
||||
|
||||
case PVR_460GT_RB:
|
||||
puts("460GT Rev. B");
|
||||
mfsdr(SDR0_ECID3, reg);
|
||||
if (reg & 0x00100000)
|
||||
strcpy(addstr, "No Security/Kasumi support");
|
||||
else
|
||||
strcpy(addstr, "Security/Kasumi support");
|
||||
break;
|
||||
#endif
|
||||
|
||||
case PVR_460SX_RA:
|
||||
puts("460SX Rev. A");
|
||||
strcpy(addstr, "Security support");
|
||||
break;
|
||||
|
||||
case PVR_460SX_RA_V1:
|
||||
puts("460SX Rev. A");
|
||||
strcpy(addstr, "No Security support");
|
||||
break;
|
||||
|
||||
case PVR_460GX_RA:
|
||||
puts("460GX Rev. A");
|
||||
strcpy(addstr, "Security support");
|
||||
break;
|
||||
|
||||
case PVR_460GX_RA_V1:
|
||||
puts("460GX Rev. A");
|
||||
strcpy(addstr, "No Security support");
|
||||
break;
|
||||
|
||||
case PVR_APM821XX_RA:
|
||||
puts("APM821XX Rev. A");
|
||||
strcpy(addstr, "Security support");
|
||||
break;
|
||||
|
||||
case PVR_VIRTEX5:
|
||||
puts("440x5 VIRTEX5");
|
||||
break;
|
||||
#endif /* CONFIG_440 */
|
||||
|
||||
default:
|
||||
printf (" UNKNOWN (PVR=%08x)", pvr);
|
||||
break;
|
||||
}
|
||||
|
||||
printf (" at %s MHz (PLB=%lu OPB=%lu EBC=%lu",
|
||||
strmhz(buf, clock),
|
||||
sys_info.freqPLB / 1000000,
|
||||
get_OPB_freq() / 1000000,
|
||||
sys_info.freqEBC / 1000000);
|
||||
#if defined(CONFIG_PCI) && \
|
||||
(defined(CONFIG_440EP) || defined(CONFIG_440EPX) || \
|
||||
defined(CONFIG_440GR) || defined(CONFIG_440GRX))
|
||||
printf(" PCI=%lu MHz", sys_info.freqPCI / 1000000);
|
||||
#endif
|
||||
printf(")\n");
|
||||
|
||||
if (addstr[0] != 0)
|
||||
printf(" %s\n", addstr);
|
||||
|
||||
#if defined(I2C_BOOTROM)
|
||||
printf (" I2C boot EEPROM %sabled\n", i2c_bootrom_enabled() ? "en" : "dis");
|
||||
#endif /* I2C_BOOTROM */
|
||||
#if defined(SDR0_PINSTP_SHIFT)
|
||||
printf (" Bootstrap Option %c - ", bootstrap_char[bootstrap_option()]);
|
||||
printf ("Boot ROM Location %s", bootstrap_str[bootstrap_option()]);
|
||||
putc('\n');
|
||||
#endif /* SDR0_PINSTP_SHIFT */
|
||||
|
||||
#if defined(CONFIG_PCI) && !defined(CONFIG_405EX)
|
||||
printf (" Internal PCI arbiter %sabled", pci_arbiter_enabled() ? "en" : "dis");
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_PCI) && defined(PCI_ASYNC)
|
||||
if (pci_async_enabled()) {
|
||||
printf (", PCI async ext clock used");
|
||||
} else {
|
||||
printf (", PCI sync clock at %lu MHz",
|
||||
sys_info.freqPLB / sys_info.pllPciDiv / 1000000);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_PCI) && !defined(CONFIG_405EX)
|
||||
putc('\n');
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_405EP) || defined(CONFIG_405EZ) || defined(CONFIG_405EX)
|
||||
printf(" 16 KiB I-Cache 16 KiB D-Cache");
|
||||
#elif defined(CONFIG_440)
|
||||
printf(" 32 KiB I-Cache 32 KiB D-Cache");
|
||||
#else
|
||||
printf(" 16 KiB I-Cache %d KiB D-Cache",
|
||||
((pvr | 0x00000001) == PVR_405GPR_RB) ? 16 : 8);
|
||||
#endif
|
||||
|
||||
#endif /* !defined(CONFIG_405) */
|
||||
|
||||
putc ('\n');
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ppc440spe_revB() {
|
||||
unsigned int pvr;
|
||||
|
||||
pvr = get_pvr();
|
||||
if ((pvr == PVR_440SPe_6_RB) || (pvr == PVR_440SPe_RB))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
{
|
||||
#if defined(CONFIG_BOARD_RESET)
|
||||
board_reset();
|
||||
#else
|
||||
#if defined(CONFIG_SYS_4xx_RESET_TYPE)
|
||||
mtspr(SPRN_DBCR0, CONFIG_SYS_4xx_RESET_TYPE << 28);
|
||||
#else
|
||||
/*
|
||||
* Initiate system reset in debug control register DBCR
|
||||
*/
|
||||
mtspr(SPRN_DBCR0, 0x30000000);
|
||||
#endif /* defined(CONFIG_SYS_4xx_RESET_TYPE) */
|
||||
#endif /* defined(CONFIG_BOARD_RESET) */
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get timebase clock frequency
|
||||
*/
|
||||
unsigned long get_tbclk (void)
|
||||
{
|
||||
sys_info_t sys_info;
|
||||
|
||||
get_sys_info(&sys_info);
|
||||
return (sys_info.freqProcessor);
|
||||
}
|
||||
|
||||
|
||||
#if defined(CONFIG_WATCHDOG)
|
||||
void watchdog_reset(void)
|
||||
{
|
||||
int re_enable = disable_interrupts();
|
||||
reset_4xx_watchdog();
|
||||
if (re_enable) enable_interrupts();
|
||||
}
|
||||
|
||||
void reset_4xx_watchdog(void)
|
||||
{
|
||||
/*
|
||||
* Clear TSR(WIS) bit
|
||||
*/
|
||||
mtspr(SPRN_TSR, 0x40000000);
|
||||
}
|
||||
#endif /* CONFIG_WATCHDOG */
|
||||
|
||||
/*
|
||||
* Initializes on-chip ethernet controllers.
|
||||
* to override, implement board_eth_init()
|
||||
*/
|
||||
int cpu_eth_init(bd_t *bis)
|
||||
{
|
||||
#if defined(CONFIG_PPC4xx_EMAC)
|
||||
ppc_4xx_eth_initialize(bis);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
|
@ -1,541 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2000-2007
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <watchdog.h>
|
||||
#include <asm/ppc4xx-emac.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/ppc4xx-gpio.h>
|
||||
#include <asm/ppc4xx.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
#ifndef CONFIG_SYS_PLL_RECONFIG
|
||||
#define CONFIG_SYS_PLL_RECONFIG 0
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_440EPX) || \
|
||||
defined(CONFIG_460EX) || defined(CONFIG_460GT)
|
||||
static void reset_with_rli(void)
|
||||
{
|
||||
u32 reg;
|
||||
|
||||
/*
|
||||
* Set reload inhibit so configuration will persist across
|
||||
* processor resets
|
||||
*/
|
||||
mfcpr(CPR0_ICFG, reg);
|
||||
reg |= CPR0_ICFG_RLI_MASK;
|
||||
mtcpr(CPR0_ICFG, reg);
|
||||
|
||||
/* Reset processor if configuration changed */
|
||||
__asm__ __volatile__ ("sync; isync");
|
||||
mtspr(SPRN_DBCR0, 0x20000000);
|
||||
}
|
||||
#endif
|
||||
|
||||
void reconfigure_pll(u32 new_cpu_freq)
|
||||
{
|
||||
#if defined(CONFIG_440EPX)
|
||||
int reset_needed = 0;
|
||||
u32 reg, temp;
|
||||
u32 prbdv0, target_prbdv0, /* CLK_PRIMBD */
|
||||
fwdva, target_fwdva, fwdvb, target_fwdvb, /* CLK_PLLD */
|
||||
fbdv, target_fbdv, lfbdv, target_lfbdv,
|
||||
perdv0, target_perdv0, /* CLK_PERD */
|
||||
spcid0, target_spcid0; /* CLK_SPCID */
|
||||
|
||||
/* Reconfigure clocks if necessary.
|
||||
* See PPC440EPx User's Manual, sections 8.2 and 14 */
|
||||
if (new_cpu_freq == 667) {
|
||||
target_prbdv0 = 2;
|
||||
target_fwdva = 2;
|
||||
target_fwdvb = 4;
|
||||
target_fbdv = 20;
|
||||
target_lfbdv = 1;
|
||||
target_perdv0 = 4;
|
||||
target_spcid0 = 4;
|
||||
|
||||
mfcpr(CPR0_PRIMBD0, reg);
|
||||
temp = (reg & PRBDV_MASK) >> 24;
|
||||
prbdv0 = temp ? temp : 8;
|
||||
if (prbdv0 != target_prbdv0) {
|
||||
reg &= ~PRBDV_MASK;
|
||||
reg |= ((target_prbdv0 == 8 ? 0 : target_prbdv0) << 24);
|
||||
mtcpr(CPR0_PRIMBD0, reg);
|
||||
reset_needed = 1;
|
||||
}
|
||||
|
||||
mfcpr(CPR0_PLLD, reg);
|
||||
|
||||
temp = (reg & PLLD_FWDVA_MASK) >> 16;
|
||||
fwdva = temp ? temp : 16;
|
||||
|
||||
temp = (reg & PLLD_FWDVB_MASK) >> 8;
|
||||
fwdvb = temp ? temp : 8;
|
||||
|
||||
temp = (reg & PLLD_FBDV_MASK) >> 24;
|
||||
fbdv = temp ? temp : 32;
|
||||
|
||||
temp = (reg & PLLD_LFBDV_MASK);
|
||||
lfbdv = temp ? temp : 64;
|
||||
|
||||
if (fwdva != target_fwdva || fbdv != target_fbdv || lfbdv != target_lfbdv) {
|
||||
reg &= ~(PLLD_FWDVA_MASK | PLLD_FWDVB_MASK |
|
||||
PLLD_FBDV_MASK | PLLD_LFBDV_MASK);
|
||||
reg |= ((target_fwdva == 16 ? 0 : target_fwdva) << 16) |
|
||||
((target_fwdvb == 8 ? 0 : target_fwdvb) << 8) |
|
||||
((target_fbdv == 32 ? 0 : target_fbdv) << 24) |
|
||||
(target_lfbdv == 64 ? 0 : target_lfbdv);
|
||||
mtcpr(CPR0_PLLD, reg);
|
||||
reset_needed = 1;
|
||||
}
|
||||
|
||||
mfcpr(CPR0_PERD, reg);
|
||||
perdv0 = (reg & CPR0_PERD_PERDV0_MASK) >> 24;
|
||||
if (perdv0 != target_perdv0) {
|
||||
reg &= ~CPR0_PERD_PERDV0_MASK;
|
||||
reg |= (target_perdv0 << 24);
|
||||
mtcpr(CPR0_PERD, reg);
|
||||
reset_needed = 1;
|
||||
}
|
||||
|
||||
mfcpr(CPR0_SPCID, reg);
|
||||
temp = (reg & CPR0_SPCID_SPCIDV0_MASK) >> 24;
|
||||
spcid0 = temp ? temp : 4;
|
||||
if (spcid0 != target_spcid0) {
|
||||
reg &= ~CPR0_SPCID_SPCIDV0_MASK;
|
||||
reg |= ((target_spcid0 == 4 ? 0 : target_spcid0) << 24);
|
||||
mtcpr(CPR0_SPCID, reg);
|
||||
reset_needed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Get current value of FWDVA.*/
|
||||
mfcpr(CPR0_PLLD, reg);
|
||||
temp = (reg & PLLD_FWDVA_MASK) >> 16;
|
||||
|
||||
/*
|
||||
* Check to see if FWDVA has been set to value of 1. if it has we must
|
||||
* modify it.
|
||||
*/
|
||||
if (temp == 1) {
|
||||
/*
|
||||
* Load register that contains current boot strapping option.
|
||||
*/
|
||||
mfcpr(CPR0_ICFG, reg);
|
||||
/*
|
||||
* Strapping option bits (ICS) are already in correct position,
|
||||
* only masking needed.
|
||||
*/
|
||||
reg &= CPR0_ICFG_ICS_MASK;
|
||||
|
||||
if ((reg == BOOT_STRAP_OPTION_A) || (reg == BOOT_STRAP_OPTION_B) ||
|
||||
(reg == BOOT_STRAP_OPTION_D) || (reg == BOOT_STRAP_OPTION_E)) {
|
||||
mfcpr(CPR0_PLLD, reg);
|
||||
|
||||
/* Get current value of fbdv. */
|
||||
temp = (reg & PLLD_FBDV_MASK) >> 24;
|
||||
fbdv = temp ? temp : 32;
|
||||
|
||||
/* Get current value of lfbdv. */
|
||||
temp = (reg & PLLD_LFBDV_MASK);
|
||||
lfbdv = temp ? temp : 64;
|
||||
|
||||
/*
|
||||
* Get current value of FWDVA. Assign current FWDVA to
|
||||
* new FWDVB.
|
||||
*/
|
||||
mfcpr(CPR0_PLLD, reg);
|
||||
target_fwdvb = (reg & PLLD_FWDVA_MASK) >> 16;
|
||||
fwdvb = target_fwdvb ? target_fwdvb : 8;
|
||||
|
||||
/*
|
||||
* Get current value of FWDVB. Assign current FWDVB to
|
||||
* new FWDVA.
|
||||
*/
|
||||
target_fwdva = (reg & PLLD_FWDVB_MASK) >> 8;
|
||||
fwdva = target_fwdva ? target_fwdva : 16;
|
||||
|
||||
/*
|
||||
* Update CPR0_PLLD with switched FWDVA and FWDVB.
|
||||
*/
|
||||
reg &= ~(PLLD_FWDVA_MASK | PLLD_FWDVB_MASK |
|
||||
PLLD_FBDV_MASK | PLLD_LFBDV_MASK);
|
||||
reg |= ((fwdva == 16 ? 0 : fwdva) << 16) |
|
||||
((fwdvb == 8 ? 0 : fwdvb) << 8) |
|
||||
((fbdv == 32 ? 0 : fbdv) << 24) |
|
||||
(lfbdv == 64 ? 0 : lfbdv);
|
||||
mtcpr(CPR0_PLLD, reg);
|
||||
|
||||
/* Acknowledge that a reset is required. */
|
||||
reset_needed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Now reset the CPU if needed */
|
||||
if (reset_needed)
|
||||
reset_with_rli();
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_460EX) || defined(CONFIG_460GT)
|
||||
u32 reg;
|
||||
|
||||
/*
|
||||
* See "9.2.1.1 Booting with Option E" in the 460EX/GT
|
||||
* users manual
|
||||
*/
|
||||
mfcpr(CPR0_PLLC, reg);
|
||||
if ((reg & (CPR0_PLLC_RST | CPR0_PLLC_ENG)) == CPR0_PLLC_RST) {
|
||||
/*
|
||||
* Set engage bit
|
||||
*/
|
||||
reg = (reg & ~CPR0_PLLC_RST) | CPR0_PLLC_ENG;
|
||||
mtcpr(CPR0_PLLC, reg);
|
||||
|
||||
/* Now reset the CPU */
|
||||
reset_with_rli();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SYS_4xx_CHIP_21_ERRATA
|
||||
void
|
||||
chip_21_errata(void)
|
||||
{
|
||||
/*
|
||||
* See rev 1.09 of the 405EX/405EXr errata. CHIP_21 says that
|
||||
* sometimes reading the PVR and/or SDR0_ECID results in incorrect
|
||||
* values. Since the rev-D chip uses the SDR0_ECID bits to control
|
||||
* internal features, that means the second PCIe or ethernet of an EX
|
||||
* variant could fail to work. Also, security features of both EX and
|
||||
* EXr might be incorrectly disabled.
|
||||
*
|
||||
* The suggested workaround is as follows (covering rev-C and rev-D):
|
||||
*
|
||||
* 1.Read the PVR and SDR0_ECID3.
|
||||
*
|
||||
* 2.If the PVR matches an expected Revision C PVR value AND if
|
||||
* SDR0_ECID3[12:15] is different from PVR[28:31], then processor is
|
||||
* Revision C: continue executing the initialization code (no reset
|
||||
* required). else go to step 3.
|
||||
*
|
||||
* 3.If the PVR matches an expected Revision D PVR value AND if
|
||||
* SDR0_ECID3[10:11] matches its expected value, then continue
|
||||
* executing initialization code, no reset required. else write
|
||||
* DBCR0[RST] = 0b11 to generate a SysReset.
|
||||
*/
|
||||
|
||||
u32 pvr;
|
||||
u32 pvr_28_31;
|
||||
u32 ecid3;
|
||||
u32 ecid3_10_11;
|
||||
u32 ecid3_12_15;
|
||||
|
||||
/* Step 1: */
|
||||
pvr = get_pvr();
|
||||
mfsdr(SDR0_ECID3, ecid3);
|
||||
|
||||
/* Step 2: */
|
||||
pvr_28_31 = pvr & 0xf;
|
||||
ecid3_10_11 = (ecid3 >> 20) & 0x3;
|
||||
ecid3_12_15 = (ecid3 >> 16) & 0xf;
|
||||
if ((pvr == CONFIG_405EX_CHIP21_PVR_REV_C) &&
|
||||
(pvr_28_31 != ecid3_12_15)) {
|
||||
/* No reset required. */
|
||||
return;
|
||||
}
|
||||
|
||||
/* Step 3: */
|
||||
if ((pvr == CONFIG_405EX_CHIP21_PVR_REV_D) &&
|
||||
(ecid3_10_11 == CONFIG_405EX_CHIP21_ECID3_REV_D)) {
|
||||
/* No reset required. */
|
||||
return;
|
||||
}
|
||||
|
||||
/* Reset required. */
|
||||
__asm__ __volatile__ ("sync; isync");
|
||||
mtspr(SPRN_DBCR0, 0x30000000);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Breath some life into the CPU...
|
||||
*
|
||||
* Reconfigure PLL if necessary,
|
||||
* set up the memory map,
|
||||
* initialize a bunch of registers
|
||||
*/
|
||||
void
|
||||
cpu_init_f (void)
|
||||
{
|
||||
#if defined(CONFIG_WATCHDOG) || defined(CONFIG_440GX) || defined(CONFIG_460EX)
|
||||
u32 val;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYS_4xx_CHIP_21_ERRATA
|
||||
chip_21_errata();
|
||||
#endif
|
||||
|
||||
reconfigure_pll(CONFIG_SYS_PLL_RECONFIG);
|
||||
|
||||
#if (defined(CONFIG_405EP) || defined (CONFIG_405EX)) && \
|
||||
!defined(CONFIG_SYS_4xx_GPIO_TABLE)
|
||||
/*
|
||||
* GPIO0 setup (select GPIO or alternate function)
|
||||
*/
|
||||
#if defined(CONFIG_SYS_GPIO0_OR)
|
||||
out32(GPIO0_OR, CONFIG_SYS_GPIO0_OR); /* set initial state of output pins */
|
||||
#endif
|
||||
#if defined(CONFIG_SYS_GPIO0_ODR)
|
||||
out32(GPIO0_ODR, CONFIG_SYS_GPIO0_ODR); /* open-drain select */
|
||||
#endif
|
||||
out32(GPIO0_OSRH, CONFIG_SYS_GPIO0_OSRH); /* output select */
|
||||
out32(GPIO0_OSRL, CONFIG_SYS_GPIO0_OSRL);
|
||||
out32(GPIO0_ISR1H, CONFIG_SYS_GPIO0_ISR1H); /* input select */
|
||||
out32(GPIO0_ISR1L, CONFIG_SYS_GPIO0_ISR1L);
|
||||
out32(GPIO0_TSRH, CONFIG_SYS_GPIO0_TSRH); /* three-state select */
|
||||
out32(GPIO0_TSRL, CONFIG_SYS_GPIO0_TSRL);
|
||||
#if defined(CONFIG_SYS_GPIO0_ISR2H)
|
||||
out32(GPIO0_ISR2H, CONFIG_SYS_GPIO0_ISR2H);
|
||||
out32(GPIO0_ISR2L, CONFIG_SYS_GPIO0_ISR2L);
|
||||
#endif
|
||||
#if defined (CONFIG_SYS_GPIO0_TCR)
|
||||
out32(GPIO0_TCR, CONFIG_SYS_GPIO0_TCR); /* enable output driver for outputs */
|
||||
#endif
|
||||
#endif /* CONFIG_405EP ... && !CONFIG_SYS_4xx_GPIO_TABLE */
|
||||
|
||||
#if defined (CONFIG_405EP)
|
||||
/*
|
||||
* Set EMAC noise filter bits
|
||||
*/
|
||||
mtdcr(CPC0_EPCTL, CPC0_EPCTL_E0NFE | CPC0_EPCTL_E1NFE);
|
||||
#endif /* CONFIG_405EP */
|
||||
|
||||
#if defined(CONFIG_SYS_4xx_GPIO_TABLE)
|
||||
gpio_set_chip_configuration();
|
||||
#endif /* CONFIG_SYS_4xx_GPIO_TABLE */
|
||||
|
||||
/*
|
||||
* External Bus Controller (EBC) Setup
|
||||
*/
|
||||
#if (defined(CONFIG_SYS_EBC_PB0AP) && defined(CONFIG_SYS_EBC_PB0CR))
|
||||
#if (defined(CONFIG_405GP) || \
|
||||
defined(CONFIG_405EP) || defined(CONFIG_405EZ) || \
|
||||
defined(CONFIG_405EX) || defined(CONFIG_405))
|
||||
/*
|
||||
* Move the next instructions into icache, since these modify the flash
|
||||
* we are running from!
|
||||
*/
|
||||
asm volatile(" bl 0f" ::: "lr");
|
||||
asm volatile("0: mflr 3" ::: "r3");
|
||||
asm volatile(" addi 4, 0, 14" ::: "r4");
|
||||
asm volatile(" mtctr 4" ::: "ctr");
|
||||
asm volatile("1: icbt 0, 3");
|
||||
asm volatile(" addi 3, 3, 32" ::: "r3");
|
||||
asm volatile(" bdnz 1b" ::: "ctr", "cr0");
|
||||
asm volatile(" addis 3, 0, 0x0" ::: "r3");
|
||||
asm volatile(" ori 3, 3, 0xA000" ::: "r3");
|
||||
asm volatile(" mtctr 3" ::: "ctr");
|
||||
asm volatile("2: bdnz 2b" ::: "ctr", "cr0");
|
||||
#endif
|
||||
|
||||
mtebc(PB0AP, CONFIG_SYS_EBC_PB0AP);
|
||||
mtebc(PB0CR, CONFIG_SYS_EBC_PB0CR);
|
||||
#endif
|
||||
|
||||
#if (defined(CONFIG_SYS_EBC_PB1AP) && defined(CONFIG_SYS_EBC_PB1CR) && !(CONFIG_SYS_INIT_DCACHE_CS == 1))
|
||||
mtebc(PB1AP, CONFIG_SYS_EBC_PB1AP);
|
||||
mtebc(PB1CR, CONFIG_SYS_EBC_PB1CR);
|
||||
#endif
|
||||
|
||||
#if (defined(CONFIG_SYS_EBC_PB2AP) && defined(CONFIG_SYS_EBC_PB2CR) && !(CONFIG_SYS_INIT_DCACHE_CS == 2))
|
||||
mtebc(PB2AP, CONFIG_SYS_EBC_PB2AP);
|
||||
mtebc(PB2CR, CONFIG_SYS_EBC_PB2CR);
|
||||
#endif
|
||||
|
||||
#if (defined(CONFIG_SYS_EBC_PB3AP) && defined(CONFIG_SYS_EBC_PB3CR) && !(CONFIG_SYS_INIT_DCACHE_CS == 3))
|
||||
mtebc(PB3AP, CONFIG_SYS_EBC_PB3AP);
|
||||
mtebc(PB3CR, CONFIG_SYS_EBC_PB3CR);
|
||||
#endif
|
||||
|
||||
#if (defined(CONFIG_SYS_EBC_PB4AP) && defined(CONFIG_SYS_EBC_PB4CR) && !(CONFIG_SYS_INIT_DCACHE_CS == 4))
|
||||
mtebc(PB4AP, CONFIG_SYS_EBC_PB4AP);
|
||||
mtebc(PB4CR, CONFIG_SYS_EBC_PB4CR);
|
||||
#endif
|
||||
|
||||
#if (defined(CONFIG_SYS_EBC_PB5AP) && defined(CONFIG_SYS_EBC_PB5CR) && !(CONFIG_SYS_INIT_DCACHE_CS == 5))
|
||||
mtebc(PB5AP, CONFIG_SYS_EBC_PB5AP);
|
||||
mtebc(PB5CR, CONFIG_SYS_EBC_PB5CR);
|
||||
#endif
|
||||
|
||||
#if (defined(CONFIG_SYS_EBC_PB6AP) && defined(CONFIG_SYS_EBC_PB6CR) && !(CONFIG_SYS_INIT_DCACHE_CS == 6))
|
||||
mtebc(PB6AP, CONFIG_SYS_EBC_PB6AP);
|
||||
mtebc(PB6CR, CONFIG_SYS_EBC_PB6CR);
|
||||
#endif
|
||||
|
||||
#if (defined(CONFIG_SYS_EBC_PB7AP) && defined(CONFIG_SYS_EBC_PB7CR) && !(CONFIG_SYS_INIT_DCACHE_CS == 7))
|
||||
mtebc(PB7AP, CONFIG_SYS_EBC_PB7AP);
|
||||
mtebc(PB7CR, CONFIG_SYS_EBC_PB7CR);
|
||||
#endif
|
||||
|
||||
#if defined (CONFIG_SYS_EBC_CFG)
|
||||
mtebc(EBC0_CFG, CONFIG_SYS_EBC_CFG);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_WATCHDOG)
|
||||
val = mfspr(SPRN_TCR);
|
||||
#if defined(CONFIG_440EP) || defined(CONFIG_440GR)
|
||||
val |= 0xb8000000; /* generate system reset after 1.34 seconds */
|
||||
#elif defined(CONFIG_440EPX)
|
||||
val |= 0xb0000000; /* generate system reset after 1.34 seconds */
|
||||
#else
|
||||
val |= 0xf0000000; /* generate system reset after 2.684 seconds */
|
||||
#endif
|
||||
#if defined(CONFIG_SYS_4xx_RESET_TYPE)
|
||||
val &= ~0x30000000; /* clear WRC bits */
|
||||
val |= CONFIG_SYS_4xx_RESET_TYPE << 28; /* set board specific WRC type */
|
||||
#endif
|
||||
mtspr(SPRN_TCR, val);
|
||||
|
||||
val = mfspr(SPRN_TSR);
|
||||
val |= 0x80000000; /* enable watchdog timer */
|
||||
mtspr(SPRN_TSR, val);
|
||||
|
||||
reset_4xx_watchdog();
|
||||
#endif /* CONFIG_WATCHDOG */
|
||||
|
||||
#if defined(CONFIG_440GX)
|
||||
/* Take the GX out of compatibility mode
|
||||
* Travis Sawyer, 9 Mar 2004
|
||||
* NOTE: 440gx user manual inconsistency here
|
||||
* Compatibility mode and Ethernet Clock select are not
|
||||
* correct in the manual
|
||||
*/
|
||||
mfsdr(SDR0_MFR, val);
|
||||
val &= ~0x10000000;
|
||||
mtsdr(SDR0_MFR,val);
|
||||
#endif /* CONFIG_440GX */
|
||||
|
||||
#if defined(CONFIG_460EX)
|
||||
/*
|
||||
* Set SDR0_AHB_CFG[A2P_INCR4] (bit 24) and
|
||||
* clear SDR0_AHB_CFG[A2P_PROT2] (bit 25) for a new 460EX errata
|
||||
* regarding concurrent use of AHB USB OTG, USB 2.0 host and SATA
|
||||
*/
|
||||
mfsdr(SDR0_AHB_CFG, val);
|
||||
val |= 0x80;
|
||||
val &= ~0x40;
|
||||
mtsdr(SDR0_AHB_CFG, val);
|
||||
mfsdr(SDR0_USB2HOST_CFG, val);
|
||||
val &= ~0xf00;
|
||||
val |= 0x400;
|
||||
mtsdr(SDR0_USB2HOST_CFG, val);
|
||||
#endif /* CONFIG_460EX */
|
||||
|
||||
#if defined(CONFIG_405EX) || \
|
||||
defined(CONFIG_440SP) || defined(CONFIG_440SPE) || \
|
||||
defined(CONFIG_460EX) || defined(CONFIG_460GT) || \
|
||||
defined(CONFIG_460SX)
|
||||
/*
|
||||
* Set PLB4 arbiter (Segment 0 and 1) to 4 deep pipeline read
|
||||
*/
|
||||
mtdcr(PLB4A0_ACR, (mfdcr(PLB4A0_ACR) & ~PLB4Ax_ACR_RDP_MASK) |
|
||||
PLB4Ax_ACR_RDP_4DEEP);
|
||||
mtdcr(PLB4A1_ACR, (mfdcr(PLB4A1_ACR) & ~PLB4Ax_ACR_RDP_MASK) |
|
||||
PLB4Ax_ACR_RDP_4DEEP);
|
||||
#endif /* CONFIG_440SP/SPE || CONFIG_460EX/GT || CONFIG_405EX */
|
||||
}
|
||||
|
||||
/*
|
||||
* initialize higher level parts of CPU like time base and timers
|
||||
*/
|
||||
int cpu_init_r (void)
|
||||
{
|
||||
#if defined(CONFIG_405GP)
|
||||
uint pvr = get_pvr();
|
||||
|
||||
/*
|
||||
* Set edge conditioning circuitry on PPC405GPr
|
||||
* for compatibility to existing PPC405GP designs.
|
||||
*/
|
||||
if ((pvr & 0xfffffff0) == (PVR_405GPR_RB & 0xfffffff0)) {
|
||||
mtdcr(CPC0_ECR, 0x60606000);
|
||||
}
|
||||
#endif /* defined(CONFIG_405GP) */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_PCI) && \
|
||||
(defined(CONFIG_440EP) || defined(CONFIG_440EPX) || \
|
||||
defined(CONFIG_440GR) || defined(CONFIG_440GRX))
|
||||
/*
|
||||
* 440EP(x)/GR(x) PCI async/sync clocking restriction:
|
||||
*
|
||||
* In asynchronous PCI mode, the synchronous PCI clock must meet
|
||||
* certain requirements. The following equation describes the
|
||||
* relationship that must be maintained between the asynchronous PCI
|
||||
* clock and synchronous PCI clock. Select an appropriate PCI:PLB
|
||||
* ratio to maintain the relationship:
|
||||
*
|
||||
* AsyncPCIClk - 1MHz <= SyncPCIclock <= (2 * AsyncPCIClk) - 1MHz
|
||||
*/
|
||||
static int ppc4xx_pci_sync_clock_ok(u32 sync, u32 async)
|
||||
{
|
||||
if (((async - 1000000) > sync) || (sync > ((2 * async) - 1000000)))
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
int ppc4xx_pci_sync_clock_config(u32 async)
|
||||
{
|
||||
sys_info_t sys_info;
|
||||
u32 sync;
|
||||
int div;
|
||||
u32 reg;
|
||||
u32 spcid_val[] = {
|
||||
CPR0_SPCID_SPCIDV0_DIV1, CPR0_SPCID_SPCIDV0_DIV2,
|
||||
CPR0_SPCID_SPCIDV0_DIV3, CPR0_SPCID_SPCIDV0_DIV4 };
|
||||
|
||||
get_sys_info(&sys_info);
|
||||
sync = sys_info.freqPCI;
|
||||
|
||||
/*
|
||||
* First check if the equation above is met
|
||||
*/
|
||||
if (!ppc4xx_pci_sync_clock_ok(sync, async)) {
|
||||
/*
|
||||
* Reconfigure PCI sync clock to meet the equation.
|
||||
* Start with highest possible PCI sync frequency
|
||||
* (divider 1).
|
||||
*/
|
||||
for (div = 1; div <= 4; div++) {
|
||||
sync = sys_info.freqPLB / div;
|
||||
if (ppc4xx_pci_sync_clock_ok(sync, async))
|
||||
break;
|
||||
}
|
||||
|
||||
if (div <= 4) {
|
||||
mtcpr(CPR0_SPCID, spcid_val[div]);
|
||||
|
||||
mfcpr(CPR0_ICFG, reg);
|
||||
reg |= CPR0_ICFG_RLI_MASK;
|
||||
mtcpr(CPR0_ICFG, reg);
|
||||
|
||||
/* do chip reset */
|
||||
mtspr(SPRN_DBCR0, 0x20000000);
|
||||
} else {
|
||||
/* Impossible to configure the PCI sync clock */
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
|
@ -1,180 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2001
|
||||
* Erik Theisen, Wave 7 Optics, etheisen@mindspring.com
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
#include <config.h>
|
||||
|
||||
#if defined(CONFIG_4xx) && defined(CONFIG_CMD_SETGETDCR)
|
||||
|
||||
#include <asm/ppc4xx.h>
|
||||
|
||||
#include <ppc_asm.tmpl>
|
||||
#include <ppc_defs.h>
|
||||
|
||||
#include <asm/cache.h>
|
||||
#include <asm/mmu.h>
|
||||
|
||||
#define _ASMLANGUAGE
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* XXX - DANGER
|
||||
* These routines make use of self modifying code. DO NOT CALL THEM
|
||||
* UNTIL THEY ARE RELOCATED TO RAM. Additionally, I do not
|
||||
* recommend them for use in anything other than an interactive
|
||||
* debugging environment. This is mainly due to performance reasons.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* static void _create_MFDCR(unsigned short dcrn)
|
||||
*
|
||||
* Builds a 'mfdcr' instruction for get_dcr
|
||||
* function.
|
||||
*/
|
||||
.section ".text"
|
||||
.align 2
|
||||
.type _create_MFDCR,@function
|
||||
_create_MFDCR:
|
||||
/*
|
||||
* Build up a 'mfdcr' instruction formatted as follows:
|
||||
*
|
||||
* OPCD | RT | DCRF | XO | CR |
|
||||
* ---------------|--------------|--------------|----|
|
||||
* 0 5 | 6 10 | 11 20 | 21 30 | 31 |
|
||||
* | | DCRN | | |
|
||||
* 31 | %r3 | (5..9|0..4) | 323 | 0 |
|
||||
*
|
||||
* Where:
|
||||
* OPCD = opcode - 31
|
||||
* RT = destination register - %r3 return register
|
||||
* DCRF = DCRN # with upper and lower halves swapped
|
||||
* XO = extended opcode - 323
|
||||
* CR = CR[CR0] NOT undefined - 0
|
||||
*/
|
||||
rlwinm r0, r3, 27, 27, 31 /* OPCD = 31 */
|
||||
rlwinm r3, r3, 5, 22, 26
|
||||
or r3, r3, r0
|
||||
slwi r3, r3, 10
|
||||
oris r3, r3, 0x3e30 /* RT = %r3 */
|
||||
ori r3, r3, 323 /* XO = 323 */
|
||||
slwi r3, r3, 1 /* CR = 0 */
|
||||
|
||||
mflr r4
|
||||
stw r3, 0(r4) /* Store instr in get_dcr() */
|
||||
dcbst r0, r4 /* Make sure val is written out */
|
||||
sync /* Wait for write to complete */
|
||||
icbi r0, r4 /* Make sure old instr is dumped */
|
||||
isync /* Wait for icbi to complete */
|
||||
|
||||
blr
|
||||
.Lfe1: .size _create_MFDCR,.Lfe1-_create_MFDCR
|
||||
/* end _create_MFDCR() */
|
||||
|
||||
/*
|
||||
* static void _create_MTDCR(unsigned short dcrn, unsigned long value)
|
||||
*
|
||||
* Builds a 'mtdcr' instruction for set_dcr
|
||||
* function.
|
||||
*/
|
||||
.section ".text"
|
||||
.align 2
|
||||
.type _create_MTDCR,@function
|
||||
_create_MTDCR:
|
||||
/*
|
||||
* Build up a 'mtdcr' instruction formatted as follows:
|
||||
*
|
||||
* OPCD | RS | DCRF | XO | CR |
|
||||
* ---------------|--------------|--------------|----|
|
||||
* 0 5 | 6 10 | 11 20 | 21 30 | 31 |
|
||||
* | | DCRN | | |
|
||||
* 31 | %r3 | (5..9|0..4) | 451 | 0 |
|
||||
*
|
||||
* Where:
|
||||
* OPCD = opcode - 31
|
||||
* RS = source register - %r4
|
||||
* DCRF = dest. DCRN # with upper and lower halves swapped
|
||||
* XO = extended opcode - 451
|
||||
* CR = CR[CR0] NOT undefined - 0
|
||||
*/
|
||||
rlwinm r0, r3, 27, 27, 31 /* OPCD = 31 */
|
||||
rlwinm r3, r3, 5, 22, 26
|
||||
or r3, r3, r0
|
||||
slwi r3, r3, 10
|
||||
oris r3, r3, 0x3e40 /* RS = %r4 */
|
||||
ori r3, r3, 451 /* XO = 451 */
|
||||
slwi r3, r3, 1 /* CR = 0 */
|
||||
|
||||
mflr r5
|
||||
stw r3, 0(r5) /* Store instr in set_dcr() */
|
||||
dcbst r0, r5 /* Make sure val is written out */
|
||||
sync /* Wait for write to complete */
|
||||
icbi r0, r5 /* Make sure old instr is dumped */
|
||||
isync /* Wait for icbi to complete */
|
||||
|
||||
blr
|
||||
.Lfe2: .size _create_MTDCR,.Lfe2-_create_MTDCR
|
||||
/* end _create_MTDCR() */
|
||||
|
||||
|
||||
/*
|
||||
* unsigned long get_dcr(unsigned short dcrn)
|
||||
*
|
||||
* Return a given DCR's value.
|
||||
*/
|
||||
/* */
|
||||
/* XXX - This is self modifying code, hence */
|
||||
/* it is in the data section. */
|
||||
/* */
|
||||
.section ".data"
|
||||
.align 2
|
||||
.globl get_dcr
|
||||
.type get_dcr,@function
|
||||
get_dcr:
|
||||
mflr r0 /* Get link register */
|
||||
stwu r1, -32(r1) /* Save back chain and move SP */
|
||||
stw r0, +36(r1) /* Save link register */
|
||||
|
||||
bl _create_MFDCR /* Build following instruction */
|
||||
/* XXX - we build this instuction up on the fly. */
|
||||
.long 0 /* Get DCR's value */
|
||||
|
||||
lwz r0, +36(r1) /* Get saved link register */
|
||||
mtlr r0 /* Restore link register */
|
||||
addi r1, r1, +32 /* Remove frame from stack */
|
||||
blr /* Return to calling function */
|
||||
.Lfe3: .size get_dcr,.Lfe3-get_dcr
|
||||
/* end get_dcr() */
|
||||
|
||||
|
||||
/*
|
||||
* unsigned void set_dcr(unsigned short dcrn, unsigned long value)
|
||||
*
|
||||
* Return a given DCR's value.
|
||||
*/
|
||||
/*
|
||||
* XXX - This is self modifying code, hence
|
||||
* it is in the data section.
|
||||
*/
|
||||
.section ".data"
|
||||
.align 2
|
||||
.globl set_dcr
|
||||
.type set_dcr,@function
|
||||
set_dcr:
|
||||
mflr r0 /* Get link register */
|
||||
stwu r1, -32(r1) /* Save back chain and move SP */
|
||||
stw r0, +36(r1) /* Save link register */
|
||||
|
||||
bl _create_MTDCR /* Build following instruction */
|
||||
/* XXX - we build this instuction up on the fly. */
|
||||
.long 0 /* Set DCR's value */
|
||||
|
||||
lwz r0, +36(r1) /* Get saved link register */
|
||||
mtlr r0 /* Restore link register */
|
||||
addi r1, r1, +32 /* Remove frame from stack */
|
||||
blr /* Return to calling function */
|
||||
.Lfe4: .size set_dcr,.Lfe4-set_dcr
|
||||
/* end set_dcr() */
|
||||
#endif
|
|
@ -1,376 +0,0 @@
|
|||
/*
|
||||
* arch/powerpc/cpu/ppc4xx/denali_data_eye.c
|
||||
* Extracted from board/amcc/sequoia/sdram.c by Larry Johnson <lrj@acm.org>.
|
||||
*
|
||||
* (C) Copyright 2006
|
||||
* Sylvie Gohl, AMCC/IBM, gohl.sylvie@fr.ibm.com
|
||||
* Jacqueline Pira-Ferriol, AMCC/IBM, jpira-ferriol@fr.ibm.com
|
||||
* Thierry Roman, AMCC/IBM, thierry_roman@fr.ibm.com
|
||||
* Alain Saurel, AMCC/IBM, alain.saurel@fr.ibm.com
|
||||
* Robert Snyder, AMCC/IBM, rob.snyder@fr.ibm.com
|
||||
*
|
||||
* (C) Copyright 2006-2007
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
/* define DEBUG for debugging output (obviously ;-)) */
|
||||
#if 0
|
||||
#define DEBUG
|
||||
#endif
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/ppc4xx.h>
|
||||
|
||||
#if defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
|
||||
/*-----------------------------------------------------------------------------+
|
||||
* denali_wait_for_dlllock.
|
||||
+----------------------------------------------------------------------------*/
|
||||
int denali_wait_for_dlllock(void)
|
||||
{
|
||||
u32 val;
|
||||
int wait;
|
||||
|
||||
/* -----------------------------------------------------------+
|
||||
* Wait for the DCC master delay line to finish calibration
|
||||
* ----------------------------------------------------------*/
|
||||
for (wait = 0; wait != 0xffff; ++wait) {
|
||||
mfsdram(DDR0_17, val);
|
||||
if (DDR0_17_DLLLOCKREG_DECODE(val)) {
|
||||
/* dlllockreg bit on */
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
debug("0x%04x: DDR0_17 Value (dlllockreg bit): 0x%08x\n", wait, val);
|
||||
debug("Waiting for dlllockreg bit to raise\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_DDR_DATA_EYE)
|
||||
#define DDR_DCR_BASE 0x10
|
||||
#define ddrcfga (DDR_DCR_BASE+0x0) /* DDR configuration address reg */
|
||||
#define ddrcfgd (DDR_DCR_BASE+0x1) /* DDR configuration data reg */
|
||||
|
||||
/*-----------------------------------------------------------------------------+
|
||||
* wait_for_dram_init_complete.
|
||||
+----------------------------------------------------------------------------*/
|
||||
static int wait_for_dram_init_complete(void)
|
||||
{
|
||||
unsigned long val;
|
||||
int wait = 0;
|
||||
|
||||
/* --------------------------------------------------------------+
|
||||
* Wait for 'DRAM initialization complete' bit in status register
|
||||
* -------------------------------------------------------------*/
|
||||
mtdcr(ddrcfga, DDR0_00);
|
||||
|
||||
while (wait != 0xffff) {
|
||||
val = mfdcr(ddrcfgd);
|
||||
if ((val & DDR0_00_INT_STATUS_BIT6) == DDR0_00_INT_STATUS_BIT6)
|
||||
/* 'DRAM initialization complete' bit */
|
||||
return 0;
|
||||
else
|
||||
wait++;
|
||||
}
|
||||
debug("DRAM initialization complete bit in status register did not "
|
||||
"rise\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
#define NUM_TRIES 64
|
||||
#define NUM_READS 10
|
||||
|
||||
/*-----------------------------------------------------------------------------+
|
||||
* denali_core_search_data_eye.
|
||||
+----------------------------------------------------------------------------*/
|
||||
void denali_core_search_data_eye(void)
|
||||
{
|
||||
int k, j;
|
||||
u32 val;
|
||||
u32 wr_dqs_shift, dqs_out_shift, dll_dqs_delay_X;
|
||||
u32 max_passing_cases = 0, wr_dqs_shift_with_max_passing_cases = 0;
|
||||
u32 passing_cases = 0, dll_dqs_delay_X_sw_val = 0;
|
||||
u32 dll_dqs_delay_X_start_window = 0, dll_dqs_delay_X_end_window = 0;
|
||||
volatile u32 *ram_pointer;
|
||||
u32 test[NUM_TRIES] = {
|
||||
0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF,
|
||||
0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF,
|
||||
0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x00000000,
|
||||
0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x00000000,
|
||||
0xAAAAAAAA, 0xAAAAAAAA, 0x55555555, 0x55555555,
|
||||
0xAAAAAAAA, 0xAAAAAAAA, 0x55555555, 0x55555555,
|
||||
0x55555555, 0x55555555, 0xAAAAAAAA, 0xAAAAAAAA,
|
||||
0x55555555, 0x55555555, 0xAAAAAAAA, 0xAAAAAAAA,
|
||||
0xA5A5A5A5, 0xA5A5A5A5, 0x5A5A5A5A, 0x5A5A5A5A,
|
||||
0xA5A5A5A5, 0xA5A5A5A5, 0x5A5A5A5A, 0x5A5A5A5A,
|
||||
0x5A5A5A5A, 0x5A5A5A5A, 0xA5A5A5A5, 0xA5A5A5A5,
|
||||
0x5A5A5A5A, 0x5A5A5A5A, 0xA5A5A5A5, 0xA5A5A5A5,
|
||||
0xAA55AA55, 0xAA55AA55, 0x55AA55AA, 0x55AA55AA,
|
||||
0xAA55AA55, 0xAA55AA55, 0x55AA55AA, 0x55AA55AA,
|
||||
0x55AA55AA, 0x55AA55AA, 0xAA55AA55, 0xAA55AA55,
|
||||
0x55AA55AA, 0x55AA55AA, 0xAA55AA55, 0xAA55AA55
|
||||
};
|
||||
|
||||
ram_pointer = (volatile u32 *)(CONFIG_SYS_SDRAM_BASE);
|
||||
|
||||
for (wr_dqs_shift = 64; wr_dqs_shift < 96; wr_dqs_shift++) {
|
||||
/* for (wr_dqs_shift=1; wr_dqs_shift<96; wr_dqs_shift++) { */
|
||||
|
||||
/* -----------------------------------------------------------+
|
||||
* De-assert 'start' parameter.
|
||||
* ----------------------------------------------------------*/
|
||||
mtdcr(ddrcfga, DDR0_02);
|
||||
val = (mfdcr(ddrcfgd) & ~DDR0_02_START_MASK) |
|
||||
DDR0_02_START_OFF;
|
||||
mtdcr(ddrcfgd, val);
|
||||
|
||||
/* -----------------------------------------------------------+
|
||||
* Set 'wr_dqs_shift'
|
||||
* ----------------------------------------------------------*/
|
||||
mtdcr(ddrcfga, DDR0_09);
|
||||
val = (mfdcr(ddrcfgd) & ~DDR0_09_WR_DQS_SHIFT_MASK) |
|
||||
DDR0_09_WR_DQS_SHIFT_ENCODE(wr_dqs_shift);
|
||||
mtdcr(ddrcfgd, val);
|
||||
|
||||
/* -----------------------------------------------------------+
|
||||
* Set 'dqs_out_shift' = wr_dqs_shift + 32
|
||||
* ----------------------------------------------------------*/
|
||||
dqs_out_shift = wr_dqs_shift + 32;
|
||||
mtdcr(ddrcfga, DDR0_22);
|
||||
val = (mfdcr(ddrcfgd) & ~DDR0_22_DQS_OUT_SHIFT_MASK) |
|
||||
DDR0_22_DQS_OUT_SHIFT_ENCODE(dqs_out_shift);
|
||||
mtdcr(ddrcfgd, val);
|
||||
|
||||
passing_cases = 0;
|
||||
|
||||
for (dll_dqs_delay_X = 1; dll_dqs_delay_X < 64;
|
||||
dll_dqs_delay_X++) {
|
||||
/* for (dll_dqs_delay_X=1; dll_dqs_delay_X<128;
|
||||
dll_dqs_delay_X++) { */
|
||||
/* -----------------------------------------------------------+
|
||||
* Set 'dll_dqs_delay_X'.
|
||||
* ----------------------------------------------------------*/
|
||||
/* dll_dqs_delay_0 */
|
||||
mtdcr(ddrcfga, DDR0_17);
|
||||
val = (mfdcr(ddrcfgd) & ~DDR0_17_DLL_DQS_DELAY_0_MASK)
|
||||
| DDR0_17_DLL_DQS_DELAY_0_ENCODE(dll_dqs_delay_X);
|
||||
mtdcr(ddrcfgd, val);
|
||||
/* dll_dqs_delay_1 to dll_dqs_delay_4 */
|
||||
mtdcr(ddrcfga, DDR0_18);
|
||||
val = (mfdcr(ddrcfgd) & ~DDR0_18_DLL_DQS_DELAY_X_MASK)
|
||||
| DDR0_18_DLL_DQS_DELAY_4_ENCODE(dll_dqs_delay_X)
|
||||
| DDR0_18_DLL_DQS_DELAY_3_ENCODE(dll_dqs_delay_X)
|
||||
| DDR0_18_DLL_DQS_DELAY_2_ENCODE(dll_dqs_delay_X)
|
||||
| DDR0_18_DLL_DQS_DELAY_1_ENCODE(dll_dqs_delay_X);
|
||||
mtdcr(ddrcfgd, val);
|
||||
/* dll_dqs_delay_5 to dll_dqs_delay_8 */
|
||||
mtdcr(ddrcfga, DDR0_19);
|
||||
val = (mfdcr(ddrcfgd) & ~DDR0_19_DLL_DQS_DELAY_X_MASK)
|
||||
| DDR0_19_DLL_DQS_DELAY_8_ENCODE(dll_dqs_delay_X)
|
||||
| DDR0_19_DLL_DQS_DELAY_7_ENCODE(dll_dqs_delay_X)
|
||||
| DDR0_19_DLL_DQS_DELAY_6_ENCODE(dll_dqs_delay_X)
|
||||
| DDR0_19_DLL_DQS_DELAY_5_ENCODE(dll_dqs_delay_X);
|
||||
mtdcr(ddrcfgd, val);
|
||||
/* clear any ECC errors */
|
||||
mtdcr(ddrcfga, DDR0_00);
|
||||
mtdcr(ddrcfgd,
|
||||
mfdcr(ddrcfgd) | DDR0_00_INT_ACK_ENCODE(0x3C));
|
||||
|
||||
sync();
|
||||
eieio();
|
||||
|
||||
/* -----------------------------------------------------------+
|
||||
* Assert 'start' parameter.
|
||||
* ----------------------------------------------------------*/
|
||||
mtdcr(ddrcfga, DDR0_02);
|
||||
val = (mfdcr(ddrcfgd) & ~DDR0_02_START_MASK) |
|
||||
DDR0_02_START_ON;
|
||||
mtdcr(ddrcfgd, val);
|
||||
|
||||
sync();
|
||||
eieio();
|
||||
|
||||
/* -----------------------------------------------------------+
|
||||
* Wait for the DCC master delay line to finish calibration
|
||||
* ----------------------------------------------------------*/
|
||||
if (denali_wait_for_dlllock() != 0) {
|
||||
printf("dll lock did not occur !!!\n");
|
||||
printf("denali_core_search_data_eye!!!\n");
|
||||
printf("wr_dqs_shift = %d - dll_dqs_delay_X = "
|
||||
"%d\n", wr_dqs_shift, dll_dqs_delay_X);
|
||||
hang();
|
||||
}
|
||||
sync();
|
||||
eieio();
|
||||
|
||||
if (wait_for_dram_init_complete() != 0) {
|
||||
printf("dram init complete did not occur!!!\n");
|
||||
printf("denali_core_search_data_eye!!!\n");
|
||||
printf("wr_dqs_shift = %d - dll_dqs_delay_X = "
|
||||
"%d\n", wr_dqs_shift, dll_dqs_delay_X);
|
||||
hang();
|
||||
}
|
||||
udelay(100); /* wait 100us to ensure init is really completed !!! */
|
||||
|
||||
/* write values */
|
||||
for (j = 0; j < NUM_TRIES; j++) {
|
||||
ram_pointer[j] = test[j];
|
||||
|
||||
/* clear any cache at ram location */
|
||||
__asm__("dcbf 0,%0": :"r"(&ram_pointer[j]));
|
||||
}
|
||||
|
||||
/* read values back */
|
||||
for (j = 0; j < NUM_TRIES; j++) {
|
||||
for (k = 0; k < NUM_READS; k++) {
|
||||
/* clear any cache at ram location */
|
||||
__asm__("dcbf 0,%0": :"r"(&ram_pointer
|
||||
[j]));
|
||||
|
||||
if (ram_pointer[j] != test[j])
|
||||
break;
|
||||
}
|
||||
|
||||
/* read error */
|
||||
if (k != NUM_READS)
|
||||
break;
|
||||
}
|
||||
|
||||
/* See if the dll_dqs_delay_X value passed. */
|
||||
mtdcr(ddrcfga, DDR0_00);
|
||||
if (j < NUM_TRIES
|
||||
|| (DDR0_00_INT_STATUS_DECODE(mfdcr(ddrcfgd)) &
|
||||
0x3F)) {
|
||||
/* Failed */
|
||||
passing_cases = 0;
|
||||
/* break; */
|
||||
} else {
|
||||
/* Passed */
|
||||
if (passing_cases == 0)
|
||||
dll_dqs_delay_X_sw_val =
|
||||
dll_dqs_delay_X;
|
||||
passing_cases++;
|
||||
if (passing_cases >= max_passing_cases) {
|
||||
max_passing_cases = passing_cases;
|
||||
wr_dqs_shift_with_max_passing_cases =
|
||||
wr_dqs_shift;
|
||||
dll_dqs_delay_X_start_window =
|
||||
dll_dqs_delay_X_sw_val;
|
||||
dll_dqs_delay_X_end_window =
|
||||
dll_dqs_delay_X;
|
||||
}
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------+
|
||||
* De-assert 'start' parameter.
|
||||
* ----------------------------------------------------------*/
|
||||
mtdcr(ddrcfga, DDR0_02);
|
||||
val = (mfdcr(ddrcfgd) & ~DDR0_02_START_MASK) |
|
||||
DDR0_02_START_OFF;
|
||||
mtdcr(ddrcfgd, val);
|
||||
} /* for (dll_dqs_delay_X=0; dll_dqs_delay_X<128; dll_dqs_delay_X++) */
|
||||
} /* for (wr_dqs_shift=0; wr_dqs_shift<96; wr_dqs_shift++) */
|
||||
|
||||
/* -----------------------------------------------------------+
|
||||
* Largest passing window is now detected.
|
||||
* ----------------------------------------------------------*/
|
||||
|
||||
/* Compute dll_dqs_delay_X value */
|
||||
dll_dqs_delay_X = (dll_dqs_delay_X_end_window +
|
||||
dll_dqs_delay_X_start_window) / 2;
|
||||
wr_dqs_shift = wr_dqs_shift_with_max_passing_cases;
|
||||
|
||||
debug("DQS calibration - Window detected:\n");
|
||||
debug("max_passing_cases = %d\n", max_passing_cases);
|
||||
debug("wr_dqs_shift = %d\n", wr_dqs_shift);
|
||||
debug("dll_dqs_delay_X = %d\n", dll_dqs_delay_X);
|
||||
debug("dll_dqs_delay_X window = %d - %d\n",
|
||||
dll_dqs_delay_X_start_window, dll_dqs_delay_X_end_window);
|
||||
|
||||
/* -----------------------------------------------------------+
|
||||
* De-assert 'start' parameter.
|
||||
* ----------------------------------------------------------*/
|
||||
mtdcr(ddrcfga, DDR0_02);
|
||||
val = (mfdcr(ddrcfgd) & ~DDR0_02_START_MASK) | DDR0_02_START_OFF;
|
||||
mtdcr(ddrcfgd, val);
|
||||
|
||||
/* -----------------------------------------------------------+
|
||||
* Set 'wr_dqs_shift'
|
||||
* ----------------------------------------------------------*/
|
||||
mtdcr(ddrcfga, DDR0_09);
|
||||
val = (mfdcr(ddrcfgd) & ~DDR0_09_WR_DQS_SHIFT_MASK)
|
||||
| DDR0_09_WR_DQS_SHIFT_ENCODE(wr_dqs_shift);
|
||||
mtdcr(ddrcfgd, val);
|
||||
debug("DDR0_09=0x%08x\n", val);
|
||||
|
||||
/* -----------------------------------------------------------+
|
||||
* Set 'dqs_out_shift' = wr_dqs_shift + 32
|
||||
* ----------------------------------------------------------*/
|
||||
dqs_out_shift = wr_dqs_shift + 32;
|
||||
mtdcr(ddrcfga, DDR0_22);
|
||||
val = (mfdcr(ddrcfgd) & ~DDR0_22_DQS_OUT_SHIFT_MASK)
|
||||
| DDR0_22_DQS_OUT_SHIFT_ENCODE(dqs_out_shift);
|
||||
mtdcr(ddrcfgd, val);
|
||||
debug("DDR0_22=0x%08x\n", val);
|
||||
|
||||
/* -----------------------------------------------------------+
|
||||
* Set 'dll_dqs_delay_X'.
|
||||
* ----------------------------------------------------------*/
|
||||
/* dll_dqs_delay_0 */
|
||||
mtdcr(ddrcfga, DDR0_17);
|
||||
val = (mfdcr(ddrcfgd) & ~DDR0_17_DLL_DQS_DELAY_0_MASK)
|
||||
| DDR0_17_DLL_DQS_DELAY_0_ENCODE(dll_dqs_delay_X);
|
||||
mtdcr(ddrcfgd, val);
|
||||
debug("DDR0_17=0x%08x\n", val);
|
||||
|
||||
/* dll_dqs_delay_1 to dll_dqs_delay_4 */
|
||||
mtdcr(ddrcfga, DDR0_18);
|
||||
val = (mfdcr(ddrcfgd) & ~DDR0_18_DLL_DQS_DELAY_X_MASK)
|
||||
| DDR0_18_DLL_DQS_DELAY_4_ENCODE(dll_dqs_delay_X)
|
||||
| DDR0_18_DLL_DQS_DELAY_3_ENCODE(dll_dqs_delay_X)
|
||||
| DDR0_18_DLL_DQS_DELAY_2_ENCODE(dll_dqs_delay_X)
|
||||
| DDR0_18_DLL_DQS_DELAY_1_ENCODE(dll_dqs_delay_X);
|
||||
mtdcr(ddrcfgd, val);
|
||||
debug("DDR0_18=0x%08x\n", val);
|
||||
|
||||
/* dll_dqs_delay_5 to dll_dqs_delay_8 */
|
||||
mtdcr(ddrcfga, DDR0_19);
|
||||
val = (mfdcr(ddrcfgd) & ~DDR0_19_DLL_DQS_DELAY_X_MASK)
|
||||
| DDR0_19_DLL_DQS_DELAY_8_ENCODE(dll_dqs_delay_X)
|
||||
| DDR0_19_DLL_DQS_DELAY_7_ENCODE(dll_dqs_delay_X)
|
||||
| DDR0_19_DLL_DQS_DELAY_6_ENCODE(dll_dqs_delay_X)
|
||||
| DDR0_19_DLL_DQS_DELAY_5_ENCODE(dll_dqs_delay_X);
|
||||
mtdcr(ddrcfgd, val);
|
||||
debug("DDR0_19=0x%08x\n", val);
|
||||
|
||||
/* -----------------------------------------------------------+
|
||||
* Assert 'start' parameter.
|
||||
* ----------------------------------------------------------*/
|
||||
mtdcr(ddrcfga, DDR0_02);
|
||||
val = (mfdcr(ddrcfgd) & ~DDR0_02_START_MASK) | DDR0_02_START_ON;
|
||||
mtdcr(ddrcfgd, val);
|
||||
|
||||
sync();
|
||||
eieio();
|
||||
|
||||
/* -----------------------------------------------------------+
|
||||
* Wait for the DCC master delay line to finish calibration
|
||||
* ----------------------------------------------------------*/
|
||||
if (denali_wait_for_dlllock() != 0) {
|
||||
printf("dll lock did not occur !!!\n");
|
||||
hang();
|
||||
}
|
||||
sync();
|
||||
eieio();
|
||||
|
||||
if (wait_for_dram_init_complete() != 0) {
|
||||
printf("dram init complete did not occur !!!\n");
|
||||
hang();
|
||||
}
|
||||
udelay(100); /* wait 100us to ensure init is really completed !!! */
|
||||
}
|
||||
#endif /* defined(CONFIG_DDR_DATA_EYE) */
|
||||
#endif /* defined(CONFIG_440EPX) || defined(CONFIG_440GRX) */
|
File diff suppressed because it is too large
Load diff
|
@ -1,188 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2008 Nuovation System Designs, LLC
|
||||
* Grant Erickson <gerickson@nuovations.com>
|
||||
*
|
||||
* (C) Copyright 2005-2009
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* (C) Copyright 2002
|
||||
* Jun Gu, Artesyn Technology, jung@artesyncp.com
|
||||
*
|
||||
* (C) Copyright 2001
|
||||
* Bill Hunter, Wave 7 Optics, williamhunter@attbi.com
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*
|
||||
* Description:
|
||||
* This file implements generic DRAM ECC initialization for
|
||||
* PowerPC processors using a SDRAM DDR/DDR2 controller,
|
||||
* including the 405EX(r), 440GP/GX/EP/GR, 440SP(E), and
|
||||
* 460EX/GT.
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/ppc4xx.h>
|
||||
#include <ppc_asm.tmpl>
|
||||
#include <ppc_defs.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/mmu.h>
|
||||
#include <asm/cache.h>
|
||||
|
||||
#include "ecc.h"
|
||||
|
||||
#if defined(CONFIG_SDRAM_PPC4xx_IBM_DDR) || \
|
||||
defined(CONFIG_SDRAM_PPC4xx_IBM_DDR2)
|
||||
#if defined(CONFIG_DDR_ECC) || defined(CONFIG_SDRAM_ECC)
|
||||
|
||||
#if defined(CONFIG_405EX)
|
||||
/*
|
||||
* Currently only 405EX uses 16bit data bus width as an alternative
|
||||
* option to 32bit data width (SDRAM0_MCOPT1_WDTH)
|
||||
*/
|
||||
#define SDRAM_DATA_ALT_WIDTH 2
|
||||
#else
|
||||
#define SDRAM_DATA_ALT_WIDTH 8
|
||||
#endif
|
||||
|
||||
static void wait_ddr_idle(void)
|
||||
{
|
||||
u32 val;
|
||||
|
||||
do {
|
||||
mfsdram(SDRAM_MCSTAT, val);
|
||||
} while ((val & SDRAM_MCSTAT_IDLE_MASK) == SDRAM_MCSTAT_IDLE_NOT);
|
||||
}
|
||||
|
||||
static void program_ecc_addr(unsigned long start_address,
|
||||
unsigned long num_bytes,
|
||||
unsigned long tlb_word2_i_value)
|
||||
{
|
||||
unsigned long current_address;
|
||||
unsigned long end_address;
|
||||
unsigned long address_increment;
|
||||
unsigned long mcopt1;
|
||||
char str[] = "ECC generation -";
|
||||
char slash[] = "\\|/-\\|/-";
|
||||
int loop = 0;
|
||||
int loopi = 0;
|
||||
|
||||
current_address = start_address;
|
||||
mfsdram(SDRAM_MCOPT1, mcopt1);
|
||||
if ((mcopt1 & SDRAM_MCOPT1_MCHK_MASK) != SDRAM_MCOPT1_MCHK_NON) {
|
||||
mtsdram(SDRAM_MCOPT1,
|
||||
(mcopt1 & ~SDRAM_MCOPT1_MCHK_MASK) | SDRAM_MCOPT1_MCHK_GEN);
|
||||
sync();
|
||||
eieio();
|
||||
wait_ddr_idle();
|
||||
|
||||
puts(str);
|
||||
|
||||
#ifdef CONFIG_440
|
||||
if (tlb_word2_i_value == TLB_WORD2_I_ENABLE) {
|
||||
#endif
|
||||
/* ECC bit set method for non-cached memory */
|
||||
if ((mcopt1 & SDRAM_MCOPT1_DMWD_MASK) == SDRAM_MCOPT1_DMWD_32)
|
||||
address_increment = 4;
|
||||
else
|
||||
address_increment = SDRAM_DATA_ALT_WIDTH;
|
||||
end_address = current_address + num_bytes;
|
||||
|
||||
while (current_address < end_address) {
|
||||
*((unsigned long *)current_address) = 0;
|
||||
current_address += address_increment;
|
||||
|
||||
if ((loop++ % (2 << 20)) == 0) {
|
||||
putc('\b');
|
||||
putc(slash[loopi++ % 8]);
|
||||
}
|
||||
}
|
||||
#ifdef CONFIG_440
|
||||
} else {
|
||||
/* ECC bit set method for cached memory */
|
||||
dcbz_area(start_address, num_bytes);
|
||||
/* Write modified dcache lines back to memory */
|
||||
clean_dcache_range(start_address, start_address + num_bytes);
|
||||
}
|
||||
#endif /* CONFIG_440 */
|
||||
|
||||
blank_string(strlen(str));
|
||||
|
||||
sync();
|
||||
eieio();
|
||||
wait_ddr_idle();
|
||||
|
||||
/* clear ECC error repoting registers */
|
||||
mtsdram(SDRAM_ECCES, 0xffffffff);
|
||||
#if defined(CONFIG_SDRAM_PPC4xx_IBM_DDR)
|
||||
/*
|
||||
* IBM DDR(1) core (440GX):
|
||||
* Clear Mx bits in SDRAM0_BESR0/1
|
||||
*/
|
||||
mtsdram(SDRAM0_BESR0, 0xffffffff);
|
||||
mtsdram(SDRAM0_BESR1, 0xffffffff);
|
||||
#elif defined(CONFIG_440)
|
||||
/*
|
||||
* 440/460 DDR2 core:
|
||||
* Clear EMID (Error PLB Master ID) in MQ0_ESL
|
||||
*/
|
||||
mtdcr(SDRAM_ERRSTATLL, 0xfff00000);
|
||||
#else
|
||||
/*
|
||||
* 405EX(r) DDR2 core:
|
||||
* Clear M0ID (Error PLB Master ID) in SDRAM_BESR
|
||||
*/
|
||||
mtsdram(SDRAM_BESR, 0xf0000000);
|
||||
#endif
|
||||
|
||||
mtsdram(SDRAM_MCOPT1,
|
||||
(mcopt1 & ~SDRAM_MCOPT1_MCHK_MASK) | SDRAM_MCOPT1_MCHK_CHK_REP);
|
||||
sync();
|
||||
eieio();
|
||||
wait_ddr_idle();
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(CONFIG_SDRAM_PPC4xx_IBM_DDR)
|
||||
void ecc_init(unsigned long * const start, unsigned long size)
|
||||
{
|
||||
/*
|
||||
* Init ECC with cache disabled (on PPC's with IBM DDR
|
||||
* controller (non DDR2), not tested with cache enabled yet
|
||||
*/
|
||||
program_ecc_addr((u32)start, size, TLB_WORD2_I_ENABLE);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_SDRAM_PPC4xx_IBM_DDR2)
|
||||
void do_program_ecc(unsigned long tlb_word2_i_value)
|
||||
{
|
||||
unsigned long mcopt1;
|
||||
unsigned long mcopt2;
|
||||
unsigned long mcstat;
|
||||
phys_size_t memsize = sdram_memsize();
|
||||
|
||||
if (memsize > CONFIG_MAX_MEM_MAPPED) {
|
||||
printf("\nWarning: Can't enable ECC on systems with more than 2GB of SDRAM!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
mfsdram(SDRAM_MCOPT1, mcopt1);
|
||||
mfsdram(SDRAM_MCOPT2, mcopt2);
|
||||
|
||||
if ((mcopt1 & SDRAM_MCOPT1_MCHK_MASK) != SDRAM_MCOPT1_MCHK_NON) {
|
||||
/* DDR controller must be enabled and not in self-refresh. */
|
||||
mfsdram(SDRAM_MCSTAT, mcstat);
|
||||
if (((mcopt2 & SDRAM_MCOPT2_DCEN_MASK) == SDRAM_MCOPT2_DCEN_ENABLE)
|
||||
&& ((mcopt2 & SDRAM_MCOPT2_SREN_MASK) == SDRAM_MCOPT2_SREN_EXIT)
|
||||
&& ((mcstat & (SDRAM_MCSTAT_MIC_MASK | SDRAM_MCSTAT_SRMS_MASK))
|
||||
== (SDRAM_MCSTAT_MIC_COMP | SDRAM_MCSTAT_SRMS_NOT_SF))) {
|
||||
|
||||
program_ecc_addr(0, memsize, tlb_word2_i_value);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* defined(CONFIG_DDR_ECC) || defined(CONFIG_SDRAM_ECC) */
|
||||
#endif /* defined(CONFIG_SDRAM_PPC4xx_IBM_DDR)... */
|
|
@ -1,58 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2008 Nuovation System Designs, LLC
|
||||
* Grant Erickson <gerickson@nuovations.com>
|
||||
*
|
||||
* Copyright (c) 2007-2009 DENX Software Engineering, GmbH
|
||||
* Stefan Roese <sr@denx.de>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*
|
||||
* Description:
|
||||
* This file implements ECC initialization for PowerPC processors
|
||||
* using the IBM SDRAM DDR1 & DDR2 controller.
|
||||
*/
|
||||
|
||||
#ifndef _ECC_H_
|
||||
#define _ECC_H_
|
||||
|
||||
/*
|
||||
* Since the IBM DDR controller used on 440GP/GX/EP/GR is not register
|
||||
* compatible to the IBM DDR/2 controller used on 405EX/440SP/SPe/460EX/GT
|
||||
* we need to make some processor dependant defines used later on by the
|
||||
* driver.
|
||||
*/
|
||||
|
||||
/* For 440GP/GX/EP/GR */
|
||||
#if defined(CONFIG_SDRAM_PPC4xx_IBM_DDR)
|
||||
#define SDRAM_MCOPT1 SDRAM_CFG0
|
||||
#define SDRAM_MCOPT1_MCHK_MASK SDRAM_CFG0_MCHK_MASK
|
||||
#define SDRAM_MCOPT1_MCHK_NON SDRAM_CFG0_MCHK_NON
|
||||
#define SDRAM_MCOPT1_MCHK_GEN SDRAM_CFG0_MCHK_GEN
|
||||
#define SDRAM_MCOPT1_MCHK_CHK SDRAM_CFG0_MCHK_CHK
|
||||
#define SDRAM_MCOPT1_MCHK_CHK_REP SDRAM_CFG0_MCHK_CHK
|
||||
#define SDRAM_MCOPT1_DMWD_MASK SDRAM_CFG0_DMWD_MASK
|
||||
#define SDRAM_MCOPT1_DMWD_32 SDRAM_CFG0_DMWD_32
|
||||
|
||||
#define SDRAM_MCSTAT SDRAM0_MCSTS
|
||||
#define SDRAM_MCSTAT_IDLE_MASK SDRAM_MCSTS_CIS
|
||||
#define SDRAM_MCSTAT_IDLE_NOT SDRAM_MCSTS_IDLE_NOT
|
||||
|
||||
#define SDRAM_ECCES SDRAM0_ECCESR
|
||||
#endif
|
||||
|
||||
void ecc_init(unsigned long * const start, unsigned long size);
|
||||
void do_program_ecc(unsigned long tlb_word2_i_value);
|
||||
|
||||
static void inline blank_string(int size)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < size; i++)
|
||||
putc('\b');
|
||||
for (i = 0; i < size; i++)
|
||||
putc(' ');
|
||||
for (i = 0; i < size; i++)
|
||||
putc('\b');
|
||||
}
|
||||
|
||||
#endif /* _ECC_H_ */
|
|
@ -1,157 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2007-2008
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <watchdog.h>
|
||||
#include <command.h>
|
||||
#include <asm/cache.h>
|
||||
#include <asm/ppc4xx.h>
|
||||
|
||||
#ifdef CONFIG_OF_BOARD_SETUP
|
||||
#include <libfdt.h>
|
||||
#include <fdt_support.h>
|
||||
#include <asm/4xx_pcie.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
int __ft_board_setup(void *blob, bd_t *bd)
|
||||
{
|
||||
int rc;
|
||||
int i;
|
||||
u32 bxcr;
|
||||
u32 ranges[EBC_NUM_BANKS * 4];
|
||||
u32 *p = ranges;
|
||||
char ebc_path[] = "/plb/opb/ebc";
|
||||
|
||||
ft_cpu_setup(blob, bd);
|
||||
|
||||
/*
|
||||
* Read 4xx EBC bus bridge registers to get mappings of the
|
||||
* peripheral banks into the OPB/PLB address space
|
||||
*/
|
||||
for (i = 0; i < EBC_NUM_BANKS; i++) {
|
||||
mtdcr(EBC0_CFGADDR, EBC_BXCR(i));
|
||||
bxcr = mfdcr(EBC0_CFGDATA);
|
||||
|
||||
if ((bxcr & EBC_BXCR_BU_MASK) != EBC_BXCR_BU_NONE) {
|
||||
*p++ = i;
|
||||
*p++ = 0;
|
||||
*p++ = bxcr & EBC_BXCR_BAS_MASK;
|
||||
*p++ = EBC_BXCR_BANK_SIZE(bxcr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_FDT_FIXUP_NOR_FLASH_SIZE
|
||||
/* Update reg property in all nor flash nodes too */
|
||||
fdt_fixup_nor_flash_size(blob);
|
||||
#endif
|
||||
|
||||
/* Some 405 PPC's have EBC as direct PLB child in the dts */
|
||||
if (fdt_path_offset(blob, ebc_path) < 0)
|
||||
strcpy(ebc_path, "/plb/ebc");
|
||||
rc = fdt_find_and_setprop(blob, ebc_path, "ranges", ranges,
|
||||
(p - ranges) * sizeof(u32), 1);
|
||||
if (rc) {
|
||||
printf("Unable to update property EBC mappings, err=%s\n",
|
||||
fdt_strerror(rc));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
int ft_board_setup(void *blob, bd_t *bd)
|
||||
__attribute__((weak, alias("__ft_board_setup")));
|
||||
|
||||
/*
|
||||
* Fixup all PCIe nodes by setting the device_type property
|
||||
* to "pci-endpoint" instead is "pci" for endpoint ports.
|
||||
* This property will get checked later by the Linux driver
|
||||
* to properly configure the PCIe port in Linux (again).
|
||||
*/
|
||||
void fdt_pcie_setup(void *blob)
|
||||
{
|
||||
const char *compat = "ibm,plb-pciex";
|
||||
const char *prop = "device_type";
|
||||
const char *prop_val = "pci-endpoint";
|
||||
const u32 *port;
|
||||
int no;
|
||||
int rc;
|
||||
|
||||
/* Search first PCIe node */
|
||||
no = fdt_node_offset_by_compatible(blob, -1, compat);
|
||||
while (no != -FDT_ERR_NOTFOUND) {
|
||||
port = fdt_getprop(blob, no, "port", NULL);
|
||||
if (port == NULL) {
|
||||
printf("WARNING: could not find port property\n");
|
||||
} else {
|
||||
if (is_end_point(*port)) {
|
||||
rc = fdt_setprop(blob, no, prop, prop_val,
|
||||
strlen(prop_val) + 1);
|
||||
if (rc < 0)
|
||||
printf("WARNING: could not set %s for %s: %s.\n",
|
||||
prop, compat, fdt_strerror(rc));
|
||||
}
|
||||
}
|
||||
|
||||
/* Jump to next PCIe node */
|
||||
no = fdt_node_offset_by_compatible(blob, no, compat);
|
||||
}
|
||||
}
|
||||
|
||||
void ft_cpu_setup(void *blob, bd_t *bd)
|
||||
{
|
||||
sys_info_t sys_info;
|
||||
int off, ndepth = 0;
|
||||
|
||||
get_sys_info(&sys_info);
|
||||
|
||||
do_fixup_by_prop_u32(blob, "device_type", "cpu", 4, "timebase-frequency",
|
||||
bd->bi_intfreq, 1);
|
||||
do_fixup_by_prop_u32(blob, "device_type", "cpu", 4, "clock-frequency",
|
||||
bd->bi_intfreq, 1);
|
||||
do_fixup_by_path_u32(blob, "/plb", "clock-frequency", sys_info.freqPLB, 1);
|
||||
do_fixup_by_path_u32(blob, "/plb/opb", "clock-frequency", sys_info.freqOPB, 1);
|
||||
|
||||
if (fdt_path_offset(blob, "/plb/opb/ebc") >= 0)
|
||||
do_fixup_by_path_u32(blob, "/plb/opb/ebc", "clock-frequency",
|
||||
sys_info.freqEBC, 1);
|
||||
else
|
||||
do_fixup_by_path_u32(blob, "/plb/ebc", "clock-frequency",
|
||||
sys_info.freqEBC, 1);
|
||||
|
||||
fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
|
||||
|
||||
/*
|
||||
* Fixup all UART clocks for CPU internal UARTs
|
||||
* (only these UARTs are definitely clocked by gd->arch.uart_clk)
|
||||
*
|
||||
* These UARTs are direct childs of /plb/opb. This code
|
||||
* does not touch any UARTs that are connected to the ebc.
|
||||
*/
|
||||
off = fdt_path_offset(blob, "/plb/opb");
|
||||
while ((off = fdt_next_node(blob, off, &ndepth)) >= 0) {
|
||||
/*
|
||||
* process all sub nodes and stop when we are back
|
||||
* at the starting depth
|
||||
*/
|
||||
if (ndepth <= 0)
|
||||
break;
|
||||
|
||||
/* only update direct childs */
|
||||
if ((ndepth == 1) &&
|
||||
(fdt_node_check_compatible(blob, off, "ns16550") == 0))
|
||||
fdt_setprop(blob, off,
|
||||
"clock-frequency",
|
||||
(void *)&gd->arch.uart_clk, 4);
|
||||
}
|
||||
|
||||
/*
|
||||
* Fixup all available PCIe nodes by setting the device_type property
|
||||
*/
|
||||
fdt_pcie_setup(blob);
|
||||
}
|
||||
#endif /* CONFIG_OF_BOARD_SETUP */
|
|
@ -1,244 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2007-2008
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/ppc4xx-gpio.h>
|
||||
|
||||
/* Only compile this file for boards with GPIO support */
|
||||
#if defined(GPIO0_BASE)
|
||||
|
||||
#if defined(CONFIG_SYS_4xx_GPIO_TABLE)
|
||||
gpio_param_s const gpio_tab[GPIO_GROUP_MAX][GPIO_MAX] = CONFIG_SYS_4xx_GPIO_TABLE;
|
||||
#endif
|
||||
|
||||
#if defined(GPIO0_OSRL)
|
||||
/* Only some 4xx variants support alternate funtions on the GPIO's */
|
||||
void gpio_config(int pin, int in_out, int gpio_alt, int out_val)
|
||||
{
|
||||
u32 mask;
|
||||
u32 mask2;
|
||||
u32 val;
|
||||
u32 offs = 0;
|
||||
u32 offs2 = 0;
|
||||
int pin2 = pin << 1;
|
||||
|
||||
if (pin >= GPIO_MAX) {
|
||||
offs = 0x100;
|
||||
pin -= GPIO_MAX;
|
||||
}
|
||||
|
||||
if (pin >= GPIO_MAX/2) {
|
||||
offs2 = 0x4;
|
||||
pin2 = (pin - GPIO_MAX/2) << 1;
|
||||
}
|
||||
|
||||
mask = 0x80000000 >> pin;
|
||||
mask2 = 0xc0000000 >> pin2;
|
||||
|
||||
/* first set TCR to 0 */
|
||||
out_be32((void *)GPIO0_TCR + offs, in_be32((void *)GPIO0_TCR + offs) & ~mask);
|
||||
|
||||
if (in_out == GPIO_OUT) {
|
||||
val = in_be32((void *)GPIO0_OSRL + offs + offs2) & ~mask2;
|
||||
switch (gpio_alt) {
|
||||
case GPIO_ALT1:
|
||||
val |= GPIO_ALT1_SEL >> pin2;
|
||||
break;
|
||||
case GPIO_ALT2:
|
||||
val |= GPIO_ALT2_SEL >> pin2;
|
||||
break;
|
||||
case GPIO_ALT3:
|
||||
val |= GPIO_ALT3_SEL >> pin2;
|
||||
break;
|
||||
}
|
||||
out_be32((void *)GPIO0_OSRL + offs + offs2, val);
|
||||
|
||||
/* setup requested output value */
|
||||
if (out_val == GPIO_OUT_0)
|
||||
out_be32((void *)GPIO0_OR + offs,
|
||||
in_be32((void *)GPIO0_OR + offs) & ~mask);
|
||||
else if (out_val == GPIO_OUT_1)
|
||||
out_be32((void *)GPIO0_OR + offs,
|
||||
in_be32((void *)GPIO0_OR + offs) | mask);
|
||||
|
||||
/* now configure TCR to drive output if selected */
|
||||
out_be32((void *)GPIO0_TCR + offs,
|
||||
in_be32((void *)GPIO0_TCR + offs) | mask);
|
||||
} else {
|
||||
val = in_be32((void *)GPIO0_ISR1L + offs + offs2) & ~mask2;
|
||||
val |= GPIO_IN_SEL >> pin2;
|
||||
out_be32((void *)GPIO0_ISR1L + offs + offs2, val);
|
||||
}
|
||||
}
|
||||
#endif /* GPIO_OSRL */
|
||||
|
||||
void gpio_write_bit(int pin, int val)
|
||||
{
|
||||
u32 offs = 0;
|
||||
|
||||
if (pin >= GPIO_MAX) {
|
||||
offs = 0x100;
|
||||
pin -= GPIO_MAX;
|
||||
}
|
||||
|
||||
if (val)
|
||||
out_be32((void *)GPIO0_OR + offs,
|
||||
in_be32((void *)GPIO0_OR + offs) | GPIO_VAL(pin));
|
||||
else
|
||||
out_be32((void *)GPIO0_OR + offs,
|
||||
in_be32((void *)GPIO0_OR + offs) & ~GPIO_VAL(pin));
|
||||
}
|
||||
|
||||
int gpio_read_out_bit(int pin)
|
||||
{
|
||||
u32 offs = 0;
|
||||
|
||||
if (pin >= GPIO_MAX) {
|
||||
offs = 0x100;
|
||||
pin -= GPIO_MAX;
|
||||
}
|
||||
|
||||
return (in_be32((void *)GPIO0_OR + offs) & GPIO_VAL(pin) ? 1 : 0);
|
||||
}
|
||||
|
||||
int gpio_read_in_bit(int pin)
|
||||
{
|
||||
u32 offs = 0;
|
||||
|
||||
if (pin >= GPIO_MAX) {
|
||||
offs = 0x100;
|
||||
pin -= GPIO_MAX;
|
||||
}
|
||||
|
||||
return (in_be32((void *)GPIO0_IR + offs) & GPIO_VAL(pin) ? 1 : 0);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_SYS_4xx_GPIO_TABLE)
|
||||
void gpio_set_chip_configuration(void)
|
||||
{
|
||||
unsigned char i=0, j=0, offs=0, gpio_core;
|
||||
unsigned long reg, core_add;
|
||||
|
||||
for (gpio_core=0; gpio_core<GPIO_GROUP_MAX; gpio_core++) {
|
||||
j = 0;
|
||||
offs = 0;
|
||||
/* GPIO config of the GPIOs 0 to 31 */
|
||||
for (i=0; i<GPIO_MAX; i++, j++) {
|
||||
if (i == GPIO_MAX/2) {
|
||||
offs = 4;
|
||||
j = i-16;
|
||||
}
|
||||
|
||||
core_add = gpio_tab[gpio_core][i].add;
|
||||
|
||||
if ((gpio_tab[gpio_core][i].in_out == GPIO_IN) ||
|
||||
(gpio_tab[gpio_core][i].in_out == GPIO_BI)) {
|
||||
|
||||
switch (gpio_tab[gpio_core][i].alt_nb) {
|
||||
case GPIO_SEL:
|
||||
break;
|
||||
|
||||
case GPIO_ALT1:
|
||||
reg = in_be32((void *)GPIO_IS1(core_add+offs))
|
||||
& ~(GPIO_MASK >> (j*2));
|
||||
reg = reg | (GPIO_IN_SEL >> (j*2));
|
||||
out_be32((void *)GPIO_IS1(core_add+offs), reg);
|
||||
break;
|
||||
|
||||
case GPIO_ALT2:
|
||||
reg = in_be32((void *)GPIO_IS2(core_add+offs))
|
||||
& ~(GPIO_MASK >> (j*2));
|
||||
reg = reg | (GPIO_IN_SEL >> (j*2));
|
||||
out_be32((void *)GPIO_IS2(core_add+offs), reg);
|
||||
break;
|
||||
|
||||
case GPIO_ALT3:
|
||||
reg = in_be32((void *)GPIO_IS3(core_add+offs))
|
||||
& ~(GPIO_MASK >> (j*2));
|
||||
reg = reg | (GPIO_IN_SEL >> (j*2));
|
||||
out_be32((void *)GPIO_IS3(core_add+offs), reg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ((gpio_tab[gpio_core][i].in_out == GPIO_OUT) ||
|
||||
(gpio_tab[gpio_core][i].in_out == GPIO_BI)) {
|
||||
|
||||
u32 gpio_alt_sel = 0;
|
||||
|
||||
switch (gpio_tab[gpio_core][i].alt_nb) {
|
||||
case GPIO_SEL:
|
||||
/*
|
||||
* Setup output value
|
||||
* 1 -> high level
|
||||
* 0 -> low level
|
||||
* else -> don't touch
|
||||
*/
|
||||
reg = in_be32((void *)GPIO_OR(core_add));
|
||||
if (gpio_tab[gpio_core][i].out_val == GPIO_OUT_1)
|
||||
reg |= (0x80000000 >> (i));
|
||||
else if (gpio_tab[gpio_core][i].out_val == GPIO_OUT_0)
|
||||
reg &= ~(0x80000000 >> (i));
|
||||
out_be32((void *)GPIO_OR(core_add), reg);
|
||||
|
||||
reg = in_be32((void *)GPIO_TCR(core_add)) |
|
||||
(0x80000000 >> (i));
|
||||
out_be32((void *)GPIO_TCR(core_add), reg);
|
||||
|
||||
reg = in_be32((void *)GPIO_OS(core_add+offs))
|
||||
& ~(GPIO_MASK >> (j*2));
|
||||
out_be32((void *)GPIO_OS(core_add+offs), reg);
|
||||
reg = in_be32((void *)GPIO_TS(core_add+offs))
|
||||
& ~(GPIO_MASK >> (j*2));
|
||||
out_be32((void *)GPIO_TS(core_add+offs), reg);
|
||||
break;
|
||||
|
||||
case GPIO_ALT1:
|
||||
gpio_alt_sel = GPIO_ALT1_SEL;
|
||||
break;
|
||||
|
||||
case GPIO_ALT2:
|
||||
gpio_alt_sel = GPIO_ALT2_SEL;
|
||||
break;
|
||||
|
||||
case GPIO_ALT3:
|
||||
gpio_alt_sel = GPIO_ALT3_SEL;
|
||||
break;
|
||||
}
|
||||
|
||||
if (0 != gpio_alt_sel) {
|
||||
reg = in_be32((void *)GPIO_OS(core_add+offs))
|
||||
& ~(GPIO_MASK >> (j*2));
|
||||
reg = reg | (gpio_alt_sel >> (j*2));
|
||||
out_be32((void *)GPIO_OS(core_add+offs), reg);
|
||||
|
||||
if (gpio_tab[gpio_core][i].out_val == GPIO_OUT_1) {
|
||||
reg = in_be32((void *)GPIO_TCR(core_add))
|
||||
| (0x80000000 >> (i));
|
||||
out_be32((void *)GPIO_TCR(core_add), reg);
|
||||
reg = in_be32((void *)GPIO_TS(core_add+offs))
|
||||
& ~(GPIO_MASK >> (j*2));
|
||||
out_be32((void *)GPIO_TS(core_add+offs), reg);
|
||||
} else {
|
||||
reg = in_be32((void *)GPIO_TCR(core_add))
|
||||
& ~(0x80000000 >> (i));
|
||||
out_be32((void *)GPIO_TCR(core_add), reg);
|
||||
reg = in_be32((void *)GPIO_TS(core_add+offs))
|
||||
& ~(GPIO_MASK >> (j*2));
|
||||
reg = reg | (gpio_alt_sel >> (j*2));
|
||||
out_be32((void *)GPIO_TS(core_add+offs), reg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* GPIO0_BASE */
|
||||
#endif /* CONFIG_SYS_4xx_GPIO_TABLE */
|
|
@ -1,192 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2000-2002
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* (C) Copyright 2002 (440 port)
|
||||
* Scott McNutt, Artesyn Communication Producs, smcnutt@artsyncp.com
|
||||
*
|
||||
* (C) Copyright 2003 (440GX port)
|
||||
* Travis B. Sawyer, Sandburst Corporation, tsawyer@sandburst.com
|
||||
*
|
||||
* (C) Copyright 2008 (PPC440X05 port for Virtex 5 FX)
|
||||
* Ricardo Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda@gmail.com
|
||||
* Work supported by Qtechnology (htpp://qtec.com)
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <watchdog.h>
|
||||
#include <command.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/interrupt.h>
|
||||
#include <asm/ppc4xx.h>
|
||||
#include <ppc_asm.tmpl>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
/*
|
||||
* CPM interrupt vector functions.
|
||||
*/
|
||||
struct irq_action {
|
||||
interrupt_handler_t *handler;
|
||||
void *arg;
|
||||
int count;
|
||||
};
|
||||
static struct irq_action irq_vecs[IRQ_MAX];
|
||||
|
||||
#if defined(CONFIG_440)
|
||||
|
||||
/* SPRN changed in 440 */
|
||||
static __inline__ void set_evpr(unsigned long val)
|
||||
{
|
||||
asm volatile("mtspr 0x03f,%0" : : "r" (val));
|
||||
}
|
||||
|
||||
#else /* !defined(CONFIG_440) */
|
||||
|
||||
static __inline__ void set_pit(unsigned long val)
|
||||
{
|
||||
asm volatile("mtpit %0" : : "r" (val));
|
||||
}
|
||||
|
||||
static __inline__ void set_evpr(unsigned long val)
|
||||
{
|
||||
asm volatile("mtevpr %0" : : "r" (val));
|
||||
}
|
||||
#endif /* defined(CONFIG_440 */
|
||||
|
||||
int interrupt_init_cpu (unsigned *decrementer_count)
|
||||
{
|
||||
int vec;
|
||||
unsigned long val;
|
||||
|
||||
/* decrementer is automatically reloaded */
|
||||
*decrementer_count = 0;
|
||||
|
||||
/*
|
||||
* Mark all irqs as free
|
||||
*/
|
||||
for (vec = 0; vec < IRQ_MAX; vec++) {
|
||||
irq_vecs[vec].handler = NULL;
|
||||
irq_vecs[vec].arg = NULL;
|
||||
irq_vecs[vec].count = 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_4xx
|
||||
/*
|
||||
* Init PIT
|
||||
*/
|
||||
#if defined(CONFIG_440)
|
||||
val = mfspr( SPRN_TCR );
|
||||
val &= (~0x04400000); /* clear DIS & ARE */
|
||||
mtspr( SPRN_TCR, val );
|
||||
mtspr( SPRN_DEC, 0 ); /* Prevent exception after TSR clear*/
|
||||
mtspr( SPRN_DECAR, 0 ); /* clear reload */
|
||||
mtspr( SPRN_TSR, 0x08000000 ); /* clear DEC status */
|
||||
val = gd->bd->bi_intfreq/1000; /* 1 msec */
|
||||
mtspr( SPRN_DECAR, val ); /* Set auto-reload value */
|
||||
mtspr( SPRN_DEC, val ); /* Set inital val */
|
||||
#else
|
||||
set_pit(gd->bd->bi_intfreq / 1000);
|
||||
#endif
|
||||
#endif /* CONFIG_4xx */
|
||||
|
||||
#ifdef CONFIG_ADCIOP
|
||||
/*
|
||||
* Init PIT
|
||||
*/
|
||||
set_pit(66000);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Enable PIT
|
||||
*/
|
||||
val = mfspr(SPRN_TCR);
|
||||
val |= 0x04400000;
|
||||
mtspr(SPRN_TCR, val);
|
||||
|
||||
/*
|
||||
* Set EVPR to 0
|
||||
*/
|
||||
set_evpr(0x00000000);
|
||||
|
||||
/*
|
||||
* Call uic or xilinx_irq pic_enable
|
||||
*/
|
||||
pic_enable();
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
void timer_interrupt_cpu(struct pt_regs *regs)
|
||||
{
|
||||
/* nothing to do here */
|
||||
return;
|
||||
}
|
||||
|
||||
void interrupt_run_handler(int vec)
|
||||
{
|
||||
irq_vecs[vec].count++;
|
||||
|
||||
if (irq_vecs[vec].handler != NULL) {
|
||||
/* call isr */
|
||||
(*irq_vecs[vec].handler) (irq_vecs[vec].arg);
|
||||
} else {
|
||||
pic_irq_disable(vec);
|
||||
printf("Masking bogus interrupt vector %d\n", vec);
|
||||
}
|
||||
|
||||
pic_irq_ack(vec);
|
||||
return;
|
||||
}
|
||||
|
||||
void irq_install_handler(int vec, interrupt_handler_t * handler, void *arg)
|
||||
{
|
||||
/*
|
||||
* Print warning when replacing with a different irq vector
|
||||
*/
|
||||
if ((irq_vecs[vec].handler != NULL) && (irq_vecs[vec].handler != handler)) {
|
||||
printf("Interrupt vector %d: handler 0x%x replacing 0x%x\n",
|
||||
vec, (uint) handler, (uint) irq_vecs[vec].handler);
|
||||
}
|
||||
irq_vecs[vec].handler = handler;
|
||||
irq_vecs[vec].arg = arg;
|
||||
|
||||
pic_irq_enable(vec);
|
||||
return;
|
||||
}
|
||||
|
||||
void irq_free_handler(int vec)
|
||||
{
|
||||
debug("Free interrupt for vector %d ==> %p\n",
|
||||
vec, irq_vecs[vec].handler);
|
||||
|
||||
pic_irq_disable(vec);
|
||||
|
||||
irq_vecs[vec].handler = NULL;
|
||||
irq_vecs[vec].arg = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_CMD_IRQ)
|
||||
int do_irqinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
{
|
||||
int vec;
|
||||
|
||||
printf ("Interrupt-Information:\n");
|
||||
printf ("Nr Routine Arg Count\n");
|
||||
|
||||
for (vec = 0; vec < IRQ_MAX; vec++) {
|
||||
if (irq_vecs[vec].handler != NULL) {
|
||||
printf ("%02d %08lx %08lx %d\n",
|
||||
vec,
|
||||
(ulong)irq_vecs[vec].handler,
|
||||
(ulong)irq_vecs[vec].arg,
|
||||
irq_vecs[vec].count);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
|
@ -1,60 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2000 Murray Jensen <Murray.Jensen@cmst.csiro.au>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <command.h>
|
||||
#include <asm/ppc4xx.h>
|
||||
|
||||
#define CONFIG_405GP 1 /* needed for Linux kernel header files */
|
||||
|
||||
#include <ppc_asm.tmpl>
|
||||
#include <ppc_defs.h>
|
||||
|
||||
#include <asm/cache.h>
|
||||
#include <asm/mmu.h>
|
||||
|
||||
#if defined(CONFIG_CMD_KGDB)
|
||||
/*
|
||||
* cache flushing routines for kgdb
|
||||
*/
|
||||
|
||||
.globl kgdb_flush_cache_all
|
||||
kgdb_flush_cache_all:
|
||||
/* icache */
|
||||
iccci r0,r0 /* iccci invalidates the entire I cache */
|
||||
/* dcache */
|
||||
addi r6,0,0x0000 /* clear GPR 6 */
|
||||
addi r7,r0, 128 /* do loop for # of dcache lines */
|
||||
/* NOTE: dccci invalidates both */
|
||||
mtctr r7 /* ways in the D cache */
|
||||
..dcloop:
|
||||
dccci 0,r6 /* invalidate line */
|
||||
addi r6,r6, 32 /* bump to next line */
|
||||
bdnz ..dcloop
|
||||
blr
|
||||
|
||||
.globl kgdb_flush_cache_range
|
||||
kgdb_flush_cache_range:
|
||||
li r5,L1_CACHE_BYTES-1
|
||||
andc r3,r3,r5
|
||||
subf r4,r3,r4
|
||||
add r4,r4,r5
|
||||
srwi. r4,r4,L1_CACHE_SHIFT
|
||||
beqlr
|
||||
mtctr r4
|
||||
mr r6,r3
|
||||
1: dcbst 0,r3
|
||||
addi r3,r3,L1_CACHE_BYTES
|
||||
bdnz 1b
|
||||
sync /* wait for dcbst's to get to ram */
|
||||
mtctr r4
|
||||
2: icbi 0,r6
|
||||
addi r6,r6,L1_CACHE_BYTES
|
||||
bdnz 2b
|
||||
SYNC
|
||||
blr
|
||||
|
||||
#endif
|
|
@ -1,343 +0,0 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: GPL-2.0 IBM-pibs
|
||||
*/
|
||||
/*-----------------------------------------------------------------------------+
|
||||
|
|
||||
| File Name: miiphy.c
|
||||
|
|
||||
| Function: This module has utilities for accessing the MII PHY through
|
||||
| the EMAC3 macro.
|
||||
|
|
||||
| Author: Mark Wisner
|
||||
|
|
||||
+-----------------------------------------------------------------------------*/
|
||||
|
||||
/* define DEBUG for debugging output (obviously ;-)) */
|
||||
#if 0
|
||||
#define DEBUG
|
||||
#endif
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/io.h>
|
||||
#include <ppc_asm.tmpl>
|
||||
#include <asm/ppc4xx.h>
|
||||
#include <asm/ppc4xx-emac.h>
|
||||
#include <asm/ppc4xx-mal.h>
|
||||
#include <miiphy.h>
|
||||
|
||||
#if !defined(CONFIG_PHY_CLK_FREQ)
|
||||
#define CONFIG_PHY_CLK_FREQ 0
|
||||
#endif
|
||||
|
||||
/***********************************************************/
|
||||
/* Dump out to the screen PHY regs */
|
||||
/***********************************************************/
|
||||
|
||||
void miiphy_dump (char *devname, unsigned char addr)
|
||||
{
|
||||
unsigned long i;
|
||||
unsigned short data;
|
||||
|
||||
for (i = 0; i < 0x1A; i++) {
|
||||
if (miiphy_read (devname, addr, i, &data)) {
|
||||
printf ("read error for reg %lx\n", i);
|
||||
return;
|
||||
}
|
||||
printf ("Phy reg %lx ==> %4x\n", i, data);
|
||||
|
||||
/* jump to the next set of regs */
|
||||
if (i == 0x07)
|
||||
i = 0x0f;
|
||||
|
||||
} /* end for loop */
|
||||
} /* end dump */
|
||||
|
||||
/***********************************************************/
|
||||
/* (Re)start autonegotiation */
|
||||
/***********************************************************/
|
||||
int phy_setup_aneg (char *devname, unsigned char addr)
|
||||
{
|
||||
u16 bmcr;
|
||||
|
||||
#if defined(CONFIG_PHY_DYNAMIC_ANEG)
|
||||
/*
|
||||
* Set up advertisement based on capablilities reported by the PHY.
|
||||
* This should work for both copper and fiber.
|
||||
*/
|
||||
u16 bmsr;
|
||||
#if defined(CONFIG_PHY_GIGE)
|
||||
u16 exsr = 0x0000;
|
||||
#endif
|
||||
|
||||
miiphy_read (devname, addr, MII_BMSR, &bmsr);
|
||||
|
||||
#if defined(CONFIG_PHY_GIGE)
|
||||
if (bmsr & BMSR_ESTATEN)
|
||||
miiphy_read (devname, addr, MII_ESTATUS, &exsr);
|
||||
|
||||
if (exsr & (ESTATUS_1000XF | ESTATUS_1000XH)) {
|
||||
/* 1000BASE-X */
|
||||
u16 anar = 0x0000;
|
||||
|
||||
if (exsr & ESTATUS_1000XF)
|
||||
anar |= ADVERTISE_1000XFULL;
|
||||
|
||||
if (exsr & ESTATUS_1000XH)
|
||||
anar |= ADVERTISE_1000XHALF;
|
||||
|
||||
miiphy_write (devname, addr, MII_ADVERTISE, anar);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
u16 anar, btcr;
|
||||
|
||||
miiphy_read (devname, addr, MII_ADVERTISE, &anar);
|
||||
anar &= ~(0x5000 | LPA_100BASE4 | LPA_100FULL |
|
||||
LPA_100HALF | LPA_10FULL | LPA_10HALF);
|
||||
|
||||
miiphy_read (devname, addr, MII_CTRL1000, &btcr);
|
||||
btcr &= ~(0x00FF | PHY_1000BTCR_1000FD | PHY_1000BTCR_1000HD);
|
||||
|
||||
if (bmsr & BMSR_100BASE4)
|
||||
anar |= LPA_100BASE4;
|
||||
|
||||
if (bmsr & BMSR_100FULL)
|
||||
anar |= LPA_100FULL;
|
||||
|
||||
if (bmsr & BMSR_100HALF)
|
||||
anar |= LPA_100HALF;
|
||||
|
||||
if (bmsr & BMSR_10FULL)
|
||||
anar |= LPA_10FULL;
|
||||
|
||||
if (bmsr & BMSR_10HALF)
|
||||
anar |= LPA_10HALF;
|
||||
|
||||
miiphy_write (devname, addr, MII_ADVERTISE, anar);
|
||||
|
||||
#if defined(CONFIG_PHY_GIGE)
|
||||
if (exsr & ESTATUS_1000_TFULL)
|
||||
btcr |= PHY_1000BTCR_1000FD;
|
||||
|
||||
if (exsr & ESTATUS_1000_THALF)
|
||||
btcr |= PHY_1000BTCR_1000HD;
|
||||
|
||||
miiphy_write (devname, addr, MII_CTRL1000, btcr);
|
||||
#endif
|
||||
}
|
||||
|
||||
#else /* defined(CONFIG_PHY_DYNAMIC_ANEG) */
|
||||
/*
|
||||
* Set up standard advertisement
|
||||
*/
|
||||
u16 adv;
|
||||
|
||||
miiphy_read (devname, addr, MII_ADVERTISE, &adv);
|
||||
adv |= (LPA_LPACK | LPA_100FULL | LPA_100HALF |
|
||||
LPA_10FULL | LPA_10HALF);
|
||||
miiphy_write (devname, addr, MII_ADVERTISE, adv);
|
||||
|
||||
miiphy_read (devname, addr, MII_CTRL1000, &adv);
|
||||
adv |= (0x0300);
|
||||
miiphy_write (devname, addr, MII_CTRL1000, adv);
|
||||
|
||||
#endif /* defined(CONFIG_PHY_DYNAMIC_ANEG) */
|
||||
|
||||
/* Start/Restart aneg */
|
||||
miiphy_read (devname, addr, MII_BMCR, &bmcr);
|
||||
bmcr |= (BMCR_ANENABLE | BMCR_ANRESTART);
|
||||
miiphy_write (devname, addr, MII_BMCR, bmcr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/***********************************************************/
|
||||
/* read a phy reg and return the value with a rc */
|
||||
/***********************************************************/
|
||||
/* AMCC_TODO:
|
||||
* Find out of the choice for the emac for MDIO is from the bridges,
|
||||
* i.e. ZMII or RGMII as approporiate. If the bridges are not used
|
||||
* to determine the emac for MDIO, then is the SDR0_ETH_CFG[MDIO_SEL]
|
||||
* used? If so, then this routine below does not apply to the 460EX/GT.
|
||||
*
|
||||
* sr: Currently on 460EX only EMAC0 works with MDIO, so we always
|
||||
* return EMAC0 offset here
|
||||
* vg: For 460EX/460GT if internal GPCS PHY address is specified
|
||||
* return appropriate EMAC offset
|
||||
*/
|
||||
unsigned int miiphy_getemac_offset(u8 addr)
|
||||
{
|
||||
#if defined(CONFIG_440) && \
|
||||
!defined(CONFIG_440SP) && !defined(CONFIG_440SPE) && \
|
||||
!defined(CONFIG_460EX) && !defined(CONFIG_460GT)
|
||||
unsigned long zmii;
|
||||
unsigned long eoffset;
|
||||
|
||||
/* Need to find out which mdi port we're using */
|
||||
zmii = in_be32((void *)ZMII0_FER);
|
||||
|
||||
if (zmii & (ZMII_FER_MDI << ZMII_FER_V (0)))
|
||||
/* using port 0 */
|
||||
eoffset = 0;
|
||||
|
||||
else if (zmii & (ZMII_FER_MDI << ZMII_FER_V (1)))
|
||||
/* using port 1 */
|
||||
eoffset = 0x100;
|
||||
|
||||
else if (zmii & (ZMII_FER_MDI << ZMII_FER_V (2)))
|
||||
/* using port 2 */
|
||||
eoffset = 0x400;
|
||||
|
||||
else if (zmii & (ZMII_FER_MDI << ZMII_FER_V (3)))
|
||||
/* using port 3 */
|
||||
eoffset = 0x600;
|
||||
|
||||
else {
|
||||
/* None of the mdi ports are enabled! */
|
||||
/* enable port 0 */
|
||||
zmii |= ZMII_FER_MDI << ZMII_FER_V (0);
|
||||
out_be32((void *)ZMII0_FER, zmii);
|
||||
eoffset = 0;
|
||||
/* need to soft reset port 0 */
|
||||
zmii = in_be32((void *)EMAC0_MR0);
|
||||
zmii |= EMAC_MR0_SRST;
|
||||
out_be32((void *)EMAC0_MR0, zmii);
|
||||
}
|
||||
|
||||
return (eoffset);
|
||||
#else
|
||||
|
||||
#if defined(CONFIG_405EX)
|
||||
unsigned long rgmii;
|
||||
int devnum = 1;
|
||||
|
||||
rgmii = in_be32((void *)RGMII_FER);
|
||||
if (rgmii & (1 << (19 - devnum)))
|
||||
return 0x100;
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_460EX) || defined(CONFIG_460GT)
|
||||
u32 eoffset = 0;
|
||||
|
||||
switch (addr) {
|
||||
#if defined(CONFIG_HAS_ETH1) && defined(CONFIG_GPCS_PHY1_ADDR)
|
||||
case CONFIG_GPCS_PHY1_ADDR:
|
||||
if (addr == EMAC_MR1_IPPA_GET(in_be32((void *)EMAC0_MR1 + 0x100)))
|
||||
eoffset = 0x100;
|
||||
break;
|
||||
#endif
|
||||
#if defined(CONFIG_HAS_ETH2) && defined(CONFIG_GPCS_PHY2_ADDR)
|
||||
case CONFIG_GPCS_PHY2_ADDR:
|
||||
if (addr == EMAC_MR1_IPPA_GET(in_be32((void *)EMAC0_MR1 + 0x300)))
|
||||
eoffset = 0x300;
|
||||
break;
|
||||
#endif
|
||||
#if defined(CONFIG_HAS_ETH3) && defined(CONFIG_GPCS_PHY3_ADDR)
|
||||
case CONFIG_GPCS_PHY3_ADDR:
|
||||
if (addr == EMAC_MR1_IPPA_GET(in_be32((void *)EMAC0_MR1 + 0x400)))
|
||||
eoffset = 0x400;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
eoffset = 0;
|
||||
break;
|
||||
}
|
||||
return eoffset;
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
static int emac_miiphy_wait(u32 emac_reg)
|
||||
{
|
||||
u32 sta_reg;
|
||||
int i;
|
||||
|
||||
/* wait for completion */
|
||||
i = 0;
|
||||
do {
|
||||
sta_reg = in_be32((void *)EMAC0_STACR + emac_reg);
|
||||
if (i++ > 5) {
|
||||
debug("%s [%d]: Timeout! EMAC0_STACR=0x%0x\n", __func__,
|
||||
__LINE__, sta_reg);
|
||||
return -1;
|
||||
}
|
||||
udelay(10);
|
||||
} while ((sta_reg & EMAC_STACR_OC) == EMAC_STACR_OC_MASK);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int emac_miiphy_command(u8 addr, u8 reg, int cmd, u16 value)
|
||||
{
|
||||
u32 emac_reg;
|
||||
u32 sta_reg;
|
||||
|
||||
emac_reg = miiphy_getemac_offset(addr);
|
||||
|
||||
/* wait for completion */
|
||||
if (emac_miiphy_wait(emac_reg) != 0)
|
||||
return -1;
|
||||
|
||||
sta_reg = reg; /* reg address */
|
||||
|
||||
/* set clock (50MHz) and read flags */
|
||||
#if defined(CONFIG_440GX) || defined(CONFIG_440SPE) || \
|
||||
defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
|
||||
defined(CONFIG_460EX) || defined(CONFIG_460GT) || \
|
||||
defined(CONFIG_405EX)
|
||||
#if defined(CONFIG_IBM_EMAC4_V4) /* EMAC4 V4 changed bit setting */
|
||||
sta_reg = (sta_reg & ~EMAC_STACR_OP_MASK) | cmd;
|
||||
#else
|
||||
sta_reg |= cmd;
|
||||
#endif
|
||||
#else
|
||||
sta_reg = (sta_reg | cmd) & ~EMAC_STACR_CLK_100MHZ;
|
||||
#endif
|
||||
|
||||
/* Some boards (mainly 405EP based) define the PHY clock freqency fixed */
|
||||
sta_reg = sta_reg | CONFIG_PHY_CLK_FREQ;
|
||||
sta_reg = sta_reg | ((u32)addr << 5); /* Phy address */
|
||||
sta_reg = sta_reg | EMAC_STACR_OC_MASK; /* new IBM emac v4 */
|
||||
if (cmd == EMAC_STACR_WRITE)
|
||||
memcpy(&sta_reg, &value, 2); /* put in data */
|
||||
|
||||
out_be32((void *)EMAC0_STACR + emac_reg, sta_reg);
|
||||
debug("%s [%d]: sta_reg=%08x\n", __func__, __LINE__, sta_reg);
|
||||
|
||||
/* wait for completion */
|
||||
if (emac_miiphy_wait(emac_reg) != 0)
|
||||
return -1;
|
||||
|
||||
debug("%s [%d]: sta_reg=%08x\n", __func__, __LINE__, sta_reg);
|
||||
if ((sta_reg & EMAC_STACR_PHYE) != 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int emac4xx_miiphy_read(struct mii_dev *bus, int addr, int devad, int reg)
|
||||
{
|
||||
unsigned long sta_reg;
|
||||
unsigned long emac_reg;
|
||||
|
||||
emac_reg = miiphy_getemac_offset(addr);
|
||||
|
||||
if (emac_miiphy_command(addr, reg, EMAC_STACR_READ, 0) != 0)
|
||||
return -1;
|
||||
|
||||
sta_reg = in_be32((void *)EMAC0_STACR + emac_reg);
|
||||
return sta_reg >> 16;
|
||||
}
|
||||
|
||||
/***********************************************************/
|
||||
/* write a phy reg and return the value with a rc */
|
||||
/***********************************************************/
|
||||
|
||||
int emac4xx_miiphy_write(struct mii_dev *bus, int addr, int devad, int reg,
|
||||
u16 value)
|
||||
{
|
||||
return emac_miiphy_command(addr, reg, EMAC_STACR_WRITE, value);
|
||||
}
|
|
@ -1,358 +0,0 @@
|
|||
/*
|
||||
*(C) Copyright 2005-2009 Netstal Maschinen AG
|
||||
* Bruno Hars (Bruno.Hars@netstal.com)
|
||||
* Niklaus Giger (Niklaus.Giger@netstal.com)
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
/*
|
||||
* reginfo.c - register dump of HW-configuratin register for PPC4xx based board
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/ppc4xx.h>
|
||||
#include <asm/ppc4xx-uic.h>
|
||||
#include <asm/ppc4xx-emac.h>
|
||||
|
||||
enum REGISTER_TYPE {
|
||||
IDCR1, /* Indirectly Accessed DCR via SDRAM0_CFGADDR/SDRAM0_CFGDATA */
|
||||
IDCR2, /* Indirectly Accessed DCR via EBC0_CFGADDR/EBC0_CFGDATA */
|
||||
IDCR3, /* Indirectly Accessed DCR via EBM0_CFGADDR/EBM0_CFGDATA */
|
||||
IDCR4, /* Indirectly Accessed DCR via PPM0_CFGADDR/PPM0_CFGDATA */
|
||||
IDCR5, /* Indirectly Accessed DCR via CPR0_CFGADDR/CPR0_CFGDATA */
|
||||
IDCR6, /* Indirectly Accessed DCR via SDR0_CFGADDR/SDR0_CFGDATA */
|
||||
MM /* Directly Accessed MMIO Register */
|
||||
};
|
||||
|
||||
struct cpu_register {
|
||||
char *name;
|
||||
enum REGISTER_TYPE type;
|
||||
u32 address;
|
||||
};
|
||||
|
||||
/*
|
||||
* PPC440EPx registers ordered for output
|
||||
* name type addr size
|
||||
* -------------------------------------------
|
||||
*/
|
||||
|
||||
const struct cpu_register ppc4xx_reg[] = {
|
||||
{"PB0CR", IDCR2, PB0CR},
|
||||
{"PB0AP", IDCR2, PB0AP},
|
||||
{"PB1CR", IDCR2, PB1CR},
|
||||
{"PB1AP", IDCR2, PB1AP},
|
||||
{"PB2CR", IDCR2, PB2CR},
|
||||
{"PB2AP", IDCR2, PB2AP},
|
||||
{"PB3CR", IDCR2, PB3CR},
|
||||
{"PB3AP", IDCR2, PB3AP},
|
||||
|
||||
{"PB4CR", IDCR2, PB4CR},
|
||||
{"PB4AP", IDCR2, PB4AP},
|
||||
#if !defined(CONFIG_405EP)
|
||||
{"PB5CR", IDCR2, PB5CR},
|
||||
{"PB5AP", IDCR2, PB5AP},
|
||||
{"PB6CR", IDCR2, PB6CR},
|
||||
{"PB6AP", IDCR2, PB6AP},
|
||||
{"PB7CR", IDCR2, PB7CR},
|
||||
{"PB7AP", IDCR2, PB7AP},
|
||||
#endif
|
||||
|
||||
{"PBEAR", IDCR2, PBEAR},
|
||||
#if defined(CONFIG_405EP) || defined (CONFIG_405GP)
|
||||
{"PBESR0", IDCR2, PBESR0},
|
||||
{"PBESR1", IDCR2, PBESR1},
|
||||
#endif
|
||||
{"EBC0_CFG", IDCR2, EBC0_CFG},
|
||||
|
||||
#ifdef CONFIG_405GP
|
||||
{"SDRAM0_BESR0", IDCR1, SDRAM0_BESR0},
|
||||
{"SDRAM0_BESRS0", IDCR1, SDRAM0_BESRS0},
|
||||
{"SDRAM0_BESR1", IDCR1, SDRAM0_BESR1},
|
||||
{"SDRAM0_BESRS1", IDCR1, SDRAM0_BESRS1},
|
||||
{"SDRAM0_BEAR", IDCR1, SDRAM0_BEAR},
|
||||
{"SDRAM0_CFG", IDCR1, SDRAM0_CFG},
|
||||
{"SDRAM0_RTR", IDCR1, SDRAM0_RTR},
|
||||
{"SDRAM0_PMIT", IDCR1, SDRAM0_PMIT},
|
||||
|
||||
{"SDRAM0_B0CR", IDCR1, SDRAM0_B0CR},
|
||||
{"SDRAM0_B1CR", IDCR1, SDRAM0_B1CR},
|
||||
{"SDRAM0_B2CR", IDCR1, SDRAM0_B2CR},
|
||||
{"SDRAM0_B3CR", IDCR1, SDRAM0_B1CR},
|
||||
{"SDRAM0_TR", IDCR1, SDRAM0_TR},
|
||||
{"SDRAM0_ECCCFG", IDCR1, SDRAM0_B1CR},
|
||||
{"SDRAM0_ECCESR", IDCR1, SDRAM0_ECCESR},
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_440EPX
|
||||
{"SDR0_SDSTP0", IDCR6, SDR0_SDSTP0},
|
||||
{"SDR0_SDSTP1", IDCR6, SDR0_SDSTP1},
|
||||
{"SDR0_SDSTP2", IDCR6, SDR0_SDSTP2},
|
||||
{"SDR0_SDSTP3", IDCR6, SDR0_SDSTP3},
|
||||
{"SDR0_CUST0", IDCR6, SDR0_CUST0},
|
||||
{"SDR0_CUST1", IDCR6, SDR0_CUST1},
|
||||
{"SDR0_EBC", IDCR6, SDR0_EBC},
|
||||
{"SDR0_AMP0", IDCR6, SDR0_AMP0},
|
||||
{"SDR0_AMP1", IDCR6, SDR0_AMP1},
|
||||
{"SDR0_CP440", IDCR6, SDR0_CP440},
|
||||
{"SDR0_CRYP0", IDCR6, SDR0_CRYP0},
|
||||
{"SDR0_DDRCFG", IDCR6, SDR0_DDRCFG},
|
||||
{"SDR0_EMAC0RXST", IDCR6, SDR0_EMAC0RXST},
|
||||
{"SDR0_EMAC0TXST", IDCR6, SDR0_EMAC0TXST},
|
||||
{"SDR0_MFR", IDCR6, SDR0_MFR},
|
||||
{"SDR0_PCI0", IDCR6, SDR0_PCI0},
|
||||
{"SDR0_PFC0", IDCR6, SDR0_PFC0},
|
||||
{"SDR0_PFC1", IDCR6, SDR0_PFC1},
|
||||
{"SDR0_PFC2", IDCR6, SDR0_PFC2},
|
||||
{"SDR0_PFC4", IDCR6, SDR0_PFC4},
|
||||
{"SDR0_UART0", IDCR6, SDR0_UART0},
|
||||
{"SDR0_UART1", IDCR6, SDR0_UART1},
|
||||
{"SDR0_UART2", IDCR6, SDR0_UART2},
|
||||
{"SDR0_UART3", IDCR6, SDR0_UART3},
|
||||
{"DDR0_02", IDCR1, DDR0_02},
|
||||
{"DDR0_00", IDCR1, DDR0_00},
|
||||
{"DDR0_01", IDCR1, DDR0_01},
|
||||
{"DDR0_03", IDCR1, DDR0_03},
|
||||
{"DDR0_04", IDCR1, DDR0_04},
|
||||
{"DDR0_05", IDCR1, DDR0_05},
|
||||
{"DDR0_06", IDCR1, DDR0_06},
|
||||
{"DDR0_07", IDCR1, DDR0_07},
|
||||
{"DDR0_08", IDCR1, DDR0_08},
|
||||
{"DDR0_09", IDCR1, DDR0_09},
|
||||
{"DDR0_10", IDCR1, DDR0_10},
|
||||
{"DDR0_11", IDCR1, DDR0_11},
|
||||
{"DDR0_12", IDCR1, DDR0_12},
|
||||
{"DDR0_14", IDCR1, DDR0_14},
|
||||
{"DDR0_17", IDCR1, DDR0_17},
|
||||
{"DDR0_18", IDCR1, DDR0_18},
|
||||
{"DDR0_19", IDCR1, DDR0_19},
|
||||
{"DDR0_20", IDCR1, DDR0_20},
|
||||
{"DDR0_21", IDCR1, DDR0_21},
|
||||
{"DDR0_22", IDCR1, DDR0_22},
|
||||
{"DDR0_23", IDCR1, DDR0_23},
|
||||
{"DDR0_24", IDCR1, DDR0_24},
|
||||
{"DDR0_25", IDCR1, DDR0_25},
|
||||
{"DDR0_26", IDCR1, DDR0_26},
|
||||
{"DDR0_27", IDCR1, DDR0_27},
|
||||
{"DDR0_28", IDCR1, DDR0_28},
|
||||
{"DDR0_31", IDCR1, DDR0_31},
|
||||
{"DDR0_32", IDCR1, DDR0_32},
|
||||
{"DDR0_33", IDCR1, DDR0_33},
|
||||
{"DDR0_34", IDCR1, DDR0_34},
|
||||
{"DDR0_35", IDCR1, DDR0_35},
|
||||
{"DDR0_36", IDCR1, DDR0_36},
|
||||
{"DDR0_37", IDCR1, DDR0_37},
|
||||
{"DDR0_38", IDCR1, DDR0_38},
|
||||
{"DDR0_39", IDCR1, DDR0_39},
|
||||
{"DDR0_40", IDCR1, DDR0_40},
|
||||
{"DDR0_41", IDCR1, DDR0_41},
|
||||
{"DDR0_42", IDCR1, DDR0_42},
|
||||
{"DDR0_43", IDCR1, DDR0_43},
|
||||
{"DDR0_44", IDCR1, DDR0_44},
|
||||
{"CPR0_ICFG", IDCR5, CPR0_ICFG},
|
||||
{"CPR0_MALD", IDCR5, CPR0_MALD},
|
||||
{"CPR0_OPBD00", IDCR5, CPR0_OPBD0},
|
||||
{"CPR0_PERD0", IDCR5, CPR0_PERD},
|
||||
{"CPR0_PLLC0", IDCR5, CPR0_PLLC},
|
||||
{"CPR0_PLLD0", IDCR5, CPR0_PLLD},
|
||||
{"CPR0_PRIMAD0", IDCR5, CPR0_PRIMAD0},
|
||||
{"CPR0_PRIMBD0", IDCR5, CPR0_PRIMBD0},
|
||||
{"CPR0_SPCID", IDCR5, CPR0_SPCID},
|
||||
{"SPI0_MODE", MM, SPI0_MODE},
|
||||
{"IIC0_CLKDIV", MM, PCIL0_PMM1MA},
|
||||
{"PCIL0_PMM0MA", MM, PCIL0_PMM0MA},
|
||||
{"PCIL0_PMM1MA", MM, PCIL0_PMM1MA},
|
||||
{"PCIL0_PTM1LA", MM, PCIL0_PMM1MA},
|
||||
{"PCIL0_PTM1MS", MM, PCIL0_PTM1MS},
|
||||
{"PCIL0_PTM2LA", MM, PCIL0_PMM1MA},
|
||||
{"PCIL0_PTM2MS", MM, PCIL0_PTM2MS},
|
||||
{"ZMII0_FER", MM, ZMII0_FER},
|
||||
{"ZMII0_SSR", MM, ZMII0_SSR},
|
||||
{"EMAC0_IPGVR", MM, EMAC0_IPGVR},
|
||||
{"EMAC0_MR1", MM, EMAC0_MR1},
|
||||
{"EMAC0_PTR", MM, EMAC0_PTR},
|
||||
{"EMAC0_RWMR", MM, EMAC0_RWMR},
|
||||
{"EMAC0_STACR", MM, EMAC0_STACR},
|
||||
{"EMAC0_TMR0", MM, EMAC0_TMR0},
|
||||
{"EMAC0_TMR1", MM, EMAC0_TMR1},
|
||||
{"EMAC0_TRTR", MM, EMAC0_TRTR},
|
||||
{"EMAC1_MR1", MM, EMAC1_MR1},
|
||||
{"GPIO0_OR", MM, GPIO0_OR},
|
||||
{"GPIO1_OR", MM, GPIO1_OR},
|
||||
{"GPIO0_TCR", MM, GPIO0_TCR},
|
||||
{"GPIO1_TCR", MM, GPIO1_TCR},
|
||||
{"GPIO0_ODR", MM, GPIO0_ODR},
|
||||
{"GPIO1_ODR", MM, GPIO1_ODR},
|
||||
{"GPIO0_OSRL", MM, GPIO0_OSRL},
|
||||
{"GPIO0_OSRH", MM, GPIO0_OSRH},
|
||||
{"GPIO1_OSRL", MM, GPIO1_OSRL},
|
||||
{"GPIO1_OSRH", MM, GPIO1_OSRH},
|
||||
{"GPIO0_TSRL", MM, GPIO0_TSRL},
|
||||
{"GPIO0_TSRH", MM, GPIO0_TSRH},
|
||||
{"GPIO1_TSRL", MM, GPIO1_TSRL},
|
||||
{"GPIO1_TSRH", MM, GPIO1_TSRH},
|
||||
{"GPIO0_IR", MM, GPIO0_IR},
|
||||
{"GPIO1_IR", MM, GPIO1_IR},
|
||||
{"GPIO0_ISR1L", MM, GPIO0_ISR1L},
|
||||
{"GPIO0_ISR1H", MM, GPIO0_ISR1H},
|
||||
{"GPIO1_ISR1L", MM, GPIO1_ISR1L},
|
||||
{"GPIO1_ISR1H", MM, GPIO1_ISR1H},
|
||||
{"GPIO0_ISR2L", MM, GPIO0_ISR2L},
|
||||
{"GPIO0_ISR2H", MM, GPIO0_ISR2H},
|
||||
{"GPIO1_ISR2L", MM, GPIO1_ISR2L},
|
||||
{"GPIO1_ISR2H", MM, GPIO1_ISR2H},
|
||||
{"GPIO0_ISR3L", MM, GPIO0_ISR3L},
|
||||
{"GPIO0_ISR3H", MM, GPIO0_ISR3H},
|
||||
{"GPIO1_ISR3L", MM, GPIO1_ISR3L},
|
||||
{"GPIO1_ISR3H", MM, GPIO1_ISR3H},
|
||||
{"SDR0_USB2PHY0CR", IDCR6, SDR0_USB2PHY0CR},
|
||||
{"SDR0_USB2H0CR", IDCR6, SDR0_USB2H0CR},
|
||||
{"SDR0_USB2D0CR", IDCR6, SDR0_USB2D0CR},
|
||||
#endif
|
||||
};
|
||||
|
||||
/*
|
||||
* CPU Register dump of PPC4xx HW configuration registers
|
||||
* Output: first all DCR-registers, then in order of struct ppc4xx_reg
|
||||
*/
|
||||
#define PRINT_DCR(dcr) printf("0x%08x %-16s: 0x%08x\n", dcr,#dcr, mfdcr(dcr));
|
||||
|
||||
void ppc4xx_reginfo(void)
|
||||
{
|
||||
unsigned int i;
|
||||
unsigned int n;
|
||||
u32 value;
|
||||
enum REGISTER_TYPE type;
|
||||
#if defined (CONFIG_405EP)
|
||||
printf("Dump PPC405EP HW configuration registers\n\n");
|
||||
#elif CONFIG_405GP
|
||||
printf ("Dump 405GP HW configuration registers\n\n");
|
||||
#elif CONFIG_440EPX
|
||||
printf("Dump PPC440EPx HW configuration registers\n\n");
|
||||
#endif
|
||||
printf("MSR: 0x%08x\n", mfmsr());
|
||||
|
||||
printf ("\nUniversal Interrupt Controller Regs\n");
|
||||
PRINT_DCR(UIC0SR);
|
||||
PRINT_DCR(UIC0ER);
|
||||
PRINT_DCR(UIC0CR);
|
||||
PRINT_DCR(UIC0PR);
|
||||
PRINT_DCR(UIC0TR);
|
||||
PRINT_DCR(UIC0MSR);
|
||||
PRINT_DCR(UIC0VR);
|
||||
PRINT_DCR(UIC0VCR);
|
||||
|
||||
#if (UIC_MAX > 1)
|
||||
PRINT_DCR(UIC2SR);
|
||||
PRINT_DCR(UIC2ER);
|
||||
PRINT_DCR(UIC2CR);
|
||||
PRINT_DCR(UIC2PR);
|
||||
PRINT_DCR(UIC2TR);
|
||||
PRINT_DCR(UIC2MSR);
|
||||
PRINT_DCR(UIC2VR);
|
||||
PRINT_DCR(UIC2VCR);
|
||||
#endif
|
||||
|
||||
#if (UIC_MAX > 2)
|
||||
PRINT_DCR(UIC2SR);
|
||||
PRINT_DCR(UIC2ER);
|
||||
PRINT_DCR(UIC2CR);
|
||||
PRINT_DCR(UIC2PR);
|
||||
PRINT_DCR(UIC2TR);
|
||||
PRINT_DCR(UIC2MSR);
|
||||
PRINT_DCR(UIC2VR);
|
||||
PRINT_DCR(UIC2VCR);
|
||||
#endif
|
||||
|
||||
#if (UIC_MAX > 3)
|
||||
PRINT_DCR(UIC3SR);
|
||||
PRINT_DCR(UIC3ER);
|
||||
PRINT_DCR(UIC3CR);
|
||||
PRINT_DCR(UIC3PR);
|
||||
PRINT_DCR(UIC3TR);
|
||||
PRINT_DCR(UIC3MSR);
|
||||
PRINT_DCR(UIC3VR);
|
||||
PRINT_DCR(UIC3VCR);
|
||||
#endif
|
||||
|
||||
#if defined (CONFIG_405EP) || defined (CONFIG_405GP)
|
||||
printf ("\n\nDMA Channels\n");
|
||||
PRINT_DCR(DMASR);
|
||||
PRINT_DCR(DMASGC);
|
||||
PRINT_DCR(DMAADR);
|
||||
|
||||
PRINT_DCR(DMACR0);
|
||||
PRINT_DCR(DMACT0);
|
||||
PRINT_DCR(DMADA0);
|
||||
PRINT_DCR(DMASA0);
|
||||
PRINT_DCR(DMASB0);
|
||||
|
||||
PRINT_DCR(DMACR1);
|
||||
PRINT_DCR(DMACT1);
|
||||
PRINT_DCR(DMADA1);
|
||||
PRINT_DCR(DMASA1);
|
||||
PRINT_DCR(DMASB1);
|
||||
|
||||
PRINT_DCR(DMACR2);
|
||||
PRINT_DCR(DMACT2);
|
||||
PRINT_DCR(DMADA2);
|
||||
PRINT_DCR(DMASA2);
|
||||
PRINT_DCR(DMASB2);
|
||||
|
||||
PRINT_DCR(DMACR3);
|
||||
PRINT_DCR(DMACT3);
|
||||
PRINT_DCR(DMADA3);
|
||||
PRINT_DCR(DMASA3);
|
||||
PRINT_DCR(DMASB3);
|
||||
#endif
|
||||
|
||||
printf ("\n\nVarious HW-Configuration registers\n");
|
||||
#if defined (CONFIG_440EPX)
|
||||
PRINT_DCR(MAL0_CFG);
|
||||
PRINT_DCR(CPM0_ER);
|
||||
PRINT_DCR(CPM1_ER);
|
||||
PRINT_DCR(PLB4A0_ACR);
|
||||
PRINT_DCR(PLB4A1_ACR);
|
||||
PRINT_DCR(PLB3A0_ACR);
|
||||
PRINT_DCR(OPB2PLB40_BCTRL);
|
||||
PRINT_DCR(P4P3BO0_CFG);
|
||||
#endif
|
||||
n = ARRAY_SIZE(ppc4xx_reg);
|
||||
for (i = 0; i < n; i++) {
|
||||
value = 0;
|
||||
type = ppc4xx_reg[i].type;
|
||||
switch (type) {
|
||||
case IDCR1: /* Indirect via SDRAM0_CFGADDR/DDR0_CFGDATA */
|
||||
mtdcr(SDRAM0_CFGADDR, ppc4xx_reg[i].address);
|
||||
value = mfdcr(SDRAM0_CFGDATA);
|
||||
break;
|
||||
case IDCR2: /* Indirect via EBC0_CFGADDR/EBC0_CFGDATA */
|
||||
mtdcr(EBC0_CFGADDR, ppc4xx_reg[i].address);
|
||||
value = mfdcr(EBC0_CFGDATA);
|
||||
break;
|
||||
case IDCR5: /* Indirect via CPR0_CFGADDR/CPR0_CFGDATA */
|
||||
mtdcr(CPR0_CFGADDR, ppc4xx_reg[i].address);
|
||||
value = mfdcr(CPR0_CFGDATA);
|
||||
break;
|
||||
case IDCR6: /* Indirect via SDR0_CFGADDR/SDR0_CFGDATA */
|
||||
mtdcr(SDR0_CFGADDR, ppc4xx_reg[i].address);
|
||||
value = mfdcr(SDR0_CFGDATA);
|
||||
break;
|
||||
case MM: /* Directly Accessed MMIO Register */
|
||||
value = in_be32((const volatile unsigned __iomem *)
|
||||
ppc4xx_reg[i].address);
|
||||
break;
|
||||
default:
|
||||
printf("\nERROR: struct entry %d: unknown register"
|
||||
"type\n", i);
|
||||
break;
|
||||
}
|
||||
printf("0x%08x %-16s: 0x%08x\n",ppc4xx_reg[i].address,
|
||||
ppc4xx_reg[i].name, value);
|
||||
}
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
/* Copyright MontaVista Software Incorporated, 2000 */
|
||||
#include <config.h>
|
||||
.section .resetvec,"ax"
|
||||
#if defined(CONFIG_440)
|
||||
b _start_440
|
||||
#else
|
||||
#if defined(CONFIG_BOOT_PCI) && (defined(CONFIG_TARGET_MIP405) \
|
||||
|| defined(CONFIG_TARGET_MIP405T))
|
||||
b _start_pci
|
||||
#else
|
||||
b _start
|
||||
#endif
|
||||
#endif
|
|
@ -1,458 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2005-2007
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* (C) Copyright 2006
|
||||
* DAVE Srl <www.dave-tech.it>
|
||||
*
|
||||
* (C) Copyright 2002-2004
|
||||
* Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.com
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/ppc4xx.h>
|
||||
#include <asm/processor.h>
|
||||
#include "sdram.h"
|
||||
#include "ecc.h"
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
#ifdef CONFIG_SDRAM_BANK0
|
||||
|
||||
#ifndef CONFIG_440
|
||||
|
||||
#ifndef CONFIG_SYS_SDRAM_TABLE
|
||||
sdram_conf_t mb0cf[] = {
|
||||
{(128 << 20), 13, 0x000A4001}, /* (0-128MB) Address Mode 3, 13x10(4) */
|
||||
{(64 << 20), 13, 0x00084001}, /* (0-64MB) Address Mode 3, 13x9(4) */
|
||||
{(32 << 20), 12, 0x00062001}, /* (0-32MB) Address Mode 2, 12x9(4) */
|
||||
{(16 << 20), 12, 0x00046001}, /* (0-16MB) Address Mode 4, 12x8(4) */
|
||||
{(4 << 20), 11, 0x00008001}, /* (0-4MB) Address Mode 5, 11x8(2) */
|
||||
};
|
||||
#else
|
||||
sdram_conf_t mb0cf[] = CONFIG_SYS_SDRAM_TABLE;
|
||||
#endif
|
||||
|
||||
#define N_MB0CF (ARRAY_SIZE(mb0cf))
|
||||
|
||||
#ifdef CONFIG_SYS_SDRAM_CASL
|
||||
static ulong ns2clks(ulong ns)
|
||||
{
|
||||
ulong bus_period_x_10 = ONE_BILLION / (get_bus_freq(0) / 10);
|
||||
|
||||
return ((ns * 10) + bus_period_x_10) / bus_period_x_10;
|
||||
}
|
||||
#endif /* CONFIG_SYS_SDRAM_CASL */
|
||||
|
||||
static ulong compute_sdtr1(ulong speed)
|
||||
{
|
||||
#ifdef CONFIG_SYS_SDRAM_CASL
|
||||
ulong tmp;
|
||||
ulong sdtr1 = 0;
|
||||
|
||||
/* CASL */
|
||||
if (CONFIG_SYS_SDRAM_CASL < 2)
|
||||
sdtr1 |= (1 << SDRAM0_TR_CASL);
|
||||
else
|
||||
if (CONFIG_SYS_SDRAM_CASL > 4)
|
||||
sdtr1 |= (3 << SDRAM0_TR_CASL);
|
||||
else
|
||||
sdtr1 |= ((CONFIG_SYS_SDRAM_CASL-1) << SDRAM0_TR_CASL);
|
||||
|
||||
/* PTA */
|
||||
tmp = ns2clks(CONFIG_SYS_SDRAM_PTA);
|
||||
if ((tmp >= 2) && (tmp <= 4))
|
||||
sdtr1 |= ((tmp-1) << SDRAM0_TR_PTA);
|
||||
else
|
||||
sdtr1 |= ((4-1) << SDRAM0_TR_PTA);
|
||||
|
||||
/* CTP */
|
||||
tmp = ns2clks(CONFIG_SYS_SDRAM_CTP);
|
||||
if ((tmp >= 2) && (tmp <= 4))
|
||||
sdtr1 |= ((tmp-1) << SDRAM0_TR_CTP);
|
||||
else
|
||||
sdtr1 |= ((4-1) << SDRAM0_TR_CTP);
|
||||
|
||||
/* LDF */
|
||||
tmp = ns2clks(CONFIG_SYS_SDRAM_LDF);
|
||||
if ((tmp >= 2) && (tmp <= 4))
|
||||
sdtr1 |= ((tmp-1) << SDRAM0_TR_LDF);
|
||||
else
|
||||
sdtr1 |= ((2-1) << SDRAM0_TR_LDF);
|
||||
|
||||
/* RFTA */
|
||||
tmp = ns2clks(CONFIG_SYS_SDRAM_RFTA);
|
||||
if ((tmp >= 4) && (tmp <= 10))
|
||||
sdtr1 |= ((tmp-4) << SDRAM0_TR_RFTA);
|
||||
else
|
||||
sdtr1 |= ((10-4) << SDRAM0_TR_RFTA);
|
||||
|
||||
/* RCD */
|
||||
tmp = ns2clks(CONFIG_SYS_SDRAM_RCD);
|
||||
if ((tmp >= 2) && (tmp <= 4))
|
||||
sdtr1 |= ((tmp-1) << SDRAM0_TR_RCD);
|
||||
else
|
||||
sdtr1 |= ((4-1) << SDRAM0_TR_RCD);
|
||||
|
||||
return sdtr1;
|
||||
#else /* CONFIG_SYS_SDRAM_CASL */
|
||||
/*
|
||||
* If no values are configured in the board config file
|
||||
* use the default values, which seem to be ok for most
|
||||
* boards.
|
||||
*
|
||||
* REMARK:
|
||||
* For new board ports we strongly recommend to define the
|
||||
* correct values for the used SDRAM chips in your board
|
||||
* config file (see PPChameleonEVB.h)
|
||||
*/
|
||||
if (speed > 100000000) {
|
||||
/*
|
||||
* 133 MHz SDRAM
|
||||
*/
|
||||
return 0x01074015;
|
||||
} else {
|
||||
/*
|
||||
* default: 100 MHz SDRAM
|
||||
*/
|
||||
return 0x0086400d;
|
||||
}
|
||||
#endif /* CONFIG_SYS_SDRAM_CASL */
|
||||
}
|
||||
|
||||
/* refresh is expressed in ms */
|
||||
static ulong compute_rtr(ulong speed, ulong rows, ulong refresh)
|
||||
{
|
||||
#ifdef CONFIG_SYS_SDRAM_CASL
|
||||
ulong tmp;
|
||||
|
||||
tmp = ((refresh*1000*1000) / (1 << rows)) * (speed / 1000);
|
||||
tmp /= 1000000;
|
||||
|
||||
return ((tmp & 0x00003FF8) << 16);
|
||||
#else /* CONFIG_SYS_SDRAM_CASL */
|
||||
if (speed > 100000000) {
|
||||
/*
|
||||
* 133 MHz SDRAM
|
||||
*/
|
||||
return 0x07f00000;
|
||||
} else {
|
||||
/*
|
||||
* default: 100 MHz SDRAM
|
||||
*/
|
||||
return 0x05f00000;
|
||||
}
|
||||
#endif /* CONFIG_SYS_SDRAM_CASL */
|
||||
}
|
||||
|
||||
/*
|
||||
* Autodetect onboard SDRAM on 405 platforms
|
||||
*/
|
||||
int dram_init(void)
|
||||
{
|
||||
ulong speed;
|
||||
ulong sdtr1;
|
||||
int i;
|
||||
|
||||
/*
|
||||
* Determine SDRAM speed
|
||||
*/
|
||||
speed = get_bus_freq(0); /* parameter not used on ppc4xx */
|
||||
|
||||
/*
|
||||
* sdtr1 (register SDRAM0_TR) must take into account timings listed
|
||||
* in SDRAM chip datasheet. rtr (register SDRAM0_RTR) must take into
|
||||
* account actual SDRAM size. So we can set up sdtr1 according to what
|
||||
* is specified in board configuration file while rtr dependds on SDRAM
|
||||
* size we are assuming before detection.
|
||||
*/
|
||||
sdtr1 = compute_sdtr1(speed);
|
||||
|
||||
for (i=0; i<N_MB0CF; i++) {
|
||||
/*
|
||||
* Disable memory controller.
|
||||
*/
|
||||
mtsdram(SDRAM0_CFG, 0x00000000);
|
||||
|
||||
/*
|
||||
* Set MB0CF for bank 0.
|
||||
*/
|
||||
mtsdram(SDRAM0_B0CR, mb0cf[i].reg);
|
||||
mtsdram(SDRAM0_TR, sdtr1);
|
||||
mtsdram(SDRAM0_RTR, compute_rtr(speed, mb0cf[i].rows, 64));
|
||||
|
||||
udelay(200);
|
||||
|
||||
/*
|
||||
* Set memory controller options reg, MCOPT1.
|
||||
* Set DC_EN to '1' and BRD_PRF to '01' for 16 byte PLB Burst
|
||||
* read/prefetch.
|
||||
*/
|
||||
mtsdram(SDRAM0_CFG, 0x80800000);
|
||||
|
||||
udelay(10000);
|
||||
|
||||
if (get_ram_size(0, mb0cf[i].size) == mb0cf[i].size) {
|
||||
phys_size_t size = mb0cf[i].size;
|
||||
|
||||
/*
|
||||
* OK, size detected. Enable second bank if
|
||||
* defined (assumes same type as bank 0)
|
||||
*/
|
||||
#ifdef CONFIG_SDRAM_BANK1
|
||||
mtsdram(SDRAM0_CFG, 0x00000000);
|
||||
mtsdram(SDRAM0_B1CR, mb0cf[i].size | mb0cf[i].reg);
|
||||
mtsdram(SDRAM0_CFG, 0x80800000);
|
||||
udelay(10000);
|
||||
|
||||
/*
|
||||
* Check if 2nd bank is really available.
|
||||
* If the size not equal to the size of the first
|
||||
* bank, then disable the 2nd bank completely.
|
||||
*/
|
||||
if (get_ram_size((long *)mb0cf[i].size, mb0cf[i].size) !=
|
||||
mb0cf[i].size) {
|
||||
mtsdram(SDRAM0_B1CR, 0);
|
||||
mtsdram(SDRAM0_CFG, 0);
|
||||
} else {
|
||||
/*
|
||||
* We have two identical banks, so the size
|
||||
* is twice the bank size
|
||||
*/
|
||||
size = 2 * size;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* OK, size detected -> all done
|
||||
*/
|
||||
gd->ram_size = size;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
#else /* CONFIG_440 */
|
||||
|
||||
/*
|
||||
* Define some default values. Those can be overwritten in the
|
||||
* board config file.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_SYS_SDRAM_TABLE
|
||||
sdram_conf_t mb0cf[] = {
|
||||
{(256 << 20), 13, 0x000C4001}, /* 256MB mode 3, 13x10(4) */
|
||||
{(128 << 20), 13, 0x000A4001}, /* 128MB mode 3, 13x10(4) */
|
||||
{(64 << 20), 12, 0x00082001} /* 64MB mode 2, 12x9(4) */
|
||||
};
|
||||
#else
|
||||
sdram_conf_t mb0cf[] = CONFIG_SYS_SDRAM_TABLE;
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_SYS_SDRAM0_TR0
|
||||
#define CONFIG_SYS_SDRAM0_TR0 0x41094012
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_SYS_SDRAM0_WDDCTR
|
||||
#define CONFIG_SYS_SDRAM0_WDDCTR 0x00000000 /* wrcp=0 dcd=0 */
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_SYS_SDRAM0_RTR
|
||||
#define CONFIG_SYS_SDRAM0_RTR 0x04100000 /* 7.8us @ 133MHz PLB */
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_SYS_SDRAM0_CFG0
|
||||
#define CONFIG_SYS_SDRAM0_CFG0 0x82000000 /* DCEN=1, PMUD=0, 64-bit */
|
||||
#endif
|
||||
|
||||
#define N_MB0CF (ARRAY_SIZE(mb0cf))
|
||||
|
||||
#define NUM_TRIES 64
|
||||
#define NUM_READS 10
|
||||
|
||||
static void sdram_tr1_set(int ram_address, int* tr1_value)
|
||||
{
|
||||
int i;
|
||||
int j, k;
|
||||
volatile unsigned int* ram_pointer = (unsigned int *)ram_address;
|
||||
int first_good = -1, last_bad = 0x1ff;
|
||||
|
||||
unsigned long test[NUM_TRIES] = {
|
||||
0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF,
|
||||
0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF,
|
||||
0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x00000000,
|
||||
0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x00000000,
|
||||
0xAAAAAAAA, 0xAAAAAAAA, 0x55555555, 0x55555555,
|
||||
0xAAAAAAAA, 0xAAAAAAAA, 0x55555555, 0x55555555,
|
||||
0x55555555, 0x55555555, 0xAAAAAAAA, 0xAAAAAAAA,
|
||||
0x55555555, 0x55555555, 0xAAAAAAAA, 0xAAAAAAAA,
|
||||
0xA5A5A5A5, 0xA5A5A5A5, 0x5A5A5A5A, 0x5A5A5A5A,
|
||||
0xA5A5A5A5, 0xA5A5A5A5, 0x5A5A5A5A, 0x5A5A5A5A,
|
||||
0x5A5A5A5A, 0x5A5A5A5A, 0xA5A5A5A5, 0xA5A5A5A5,
|
||||
0x5A5A5A5A, 0x5A5A5A5A, 0xA5A5A5A5, 0xA5A5A5A5,
|
||||
0xAA55AA55, 0xAA55AA55, 0x55AA55AA, 0x55AA55AA,
|
||||
0xAA55AA55, 0xAA55AA55, 0x55AA55AA, 0x55AA55AA,
|
||||
0x55AA55AA, 0x55AA55AA, 0xAA55AA55, 0xAA55AA55,
|
||||
0x55AA55AA, 0x55AA55AA, 0xAA55AA55, 0xAA55AA55 };
|
||||
|
||||
/* go through all possible SDRAM0_TR1[RDCT] values */
|
||||
for (i=0; i<=0x1ff; i++) {
|
||||
/* set the current value for TR1 */
|
||||
mtsdram(SDRAM0_TR1, (0x80800800 | i));
|
||||
|
||||
/* write values */
|
||||
for (j=0; j<NUM_TRIES; j++) {
|
||||
ram_pointer[j] = test[j];
|
||||
|
||||
/* clear any cache at ram location */
|
||||
__asm__("dcbf 0,%0": :"r" (&ram_pointer[j]));
|
||||
}
|
||||
|
||||
/* read values back */
|
||||
for (j=0; j<NUM_TRIES; j++) {
|
||||
for (k=0; k<NUM_READS; k++) {
|
||||
/* clear any cache at ram location */
|
||||
__asm__("dcbf 0,%0": :"r" (&ram_pointer[j]));
|
||||
|
||||
if (ram_pointer[j] != test[j])
|
||||
break;
|
||||
}
|
||||
|
||||
/* read error */
|
||||
if (k != NUM_READS)
|
||||
break;
|
||||
}
|
||||
|
||||
/* we have a SDRAM0_TR1[RDCT] that is part of the window */
|
||||
if (j == NUM_TRIES) {
|
||||
if (first_good == -1)
|
||||
first_good = i; /* found beginning of window */
|
||||
} else { /* bad read */
|
||||
/* if we have not had a good read then don't care */
|
||||
if (first_good != -1) {
|
||||
/* first failure after a good read */
|
||||
last_bad = i-1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* return the current value for TR1 */
|
||||
*tr1_value = (first_good + last_bad) / 2;
|
||||
}
|
||||
|
||||
/*
|
||||
* Autodetect onboard DDR SDRAM on 440 platforms
|
||||
*
|
||||
* NOTE: Some of the hardcoded values are hardware dependant,
|
||||
* so this should be extended for other future boards
|
||||
* using this routine!
|
||||
*/
|
||||
int dram_init(void)
|
||||
{
|
||||
int i;
|
||||
int tr1_bank1;
|
||||
|
||||
#if defined(CONFIG_440GX) || defined(CONFIG_440EP) || \
|
||||
defined(CONFIG_440GR) || defined(CONFIG_440SP)
|
||||
/*
|
||||
* Soft-reset SDRAM controller.
|
||||
*/
|
||||
mtsdr(SDR0_SRST, SDR0_SRST_DMC);
|
||||
mtsdr(SDR0_SRST, 0x00000000);
|
||||
#endif
|
||||
|
||||
for (i=0; i<N_MB0CF; i++) {
|
||||
/*
|
||||
* Disable memory controller.
|
||||
*/
|
||||
mtsdram(SDRAM0_CFG0, 0x00000000);
|
||||
|
||||
/*
|
||||
* Setup some default
|
||||
*/
|
||||
mtsdram(SDRAM0_UABBA, 0x00000000); /* ubba=0 (default) */
|
||||
mtsdram(SDRAM0_SLIO, 0x00000000); /* rdre=0 wrre=0 rarw=0 */
|
||||
mtsdram(SDRAM0_DEVOPT, 0x00000000); /* dll=0 ds=0 (normal) */
|
||||
mtsdram(SDRAM0_WDDCTR, CONFIG_SYS_SDRAM0_WDDCTR);
|
||||
mtsdram(SDRAM0_CLKTR, 0x40000000); /* clkp=1 (90 deg wr) dcdt=0 */
|
||||
|
||||
/*
|
||||
* Following for CAS Latency = 2.5 @ 133 MHz PLB
|
||||
*/
|
||||
mtsdram(SDRAM0_B0CR, mb0cf[i].reg);
|
||||
mtsdram(SDRAM0_TR0, CONFIG_SYS_SDRAM0_TR0);
|
||||
mtsdram(SDRAM0_TR1, 0x80800800); /* SS=T2 SL=STAGE 3 CD=1 CT=0x00*/
|
||||
mtsdram(SDRAM0_RTR, CONFIG_SYS_SDRAM0_RTR);
|
||||
mtsdram(SDRAM0_CFG1, 0x00000000); /* Self-refresh exit, disable PM*/
|
||||
udelay(400); /* Delay 200 usecs (min) */
|
||||
|
||||
/*
|
||||
* Enable the controller, then wait for DCEN to complete
|
||||
*/
|
||||
mtsdram(SDRAM0_CFG0, CONFIG_SYS_SDRAM0_CFG0);
|
||||
udelay(10000);
|
||||
|
||||
if (get_ram_size(0, mb0cf[i].size) == mb0cf[i].size) {
|
||||
phys_size_t size = mb0cf[i].size;
|
||||
/*
|
||||
* Optimize TR1 to current hardware environment
|
||||
*/
|
||||
sdram_tr1_set(0x00000000, &tr1_bank1);
|
||||
mtsdram(SDRAM0_TR1, (tr1_bank1 | 0x80800800));
|
||||
|
||||
|
||||
/*
|
||||
* OK, size detected. Enable second bank if
|
||||
* defined (assumes same type as bank 0)
|
||||
*/
|
||||
#ifdef CONFIG_SDRAM_BANK1
|
||||
mtsdram(SDRAM0_CFG0, 0);
|
||||
mtsdram(SDRAM0_B1CR, mb0cf[i].size | mb0cf[i].reg);
|
||||
mtsdram(SDRAM0_CFG0, CONFIG_SYS_SDRAM0_CFG0);
|
||||
udelay(10000);
|
||||
|
||||
/*
|
||||
* Check if 2nd bank is really available.
|
||||
* If the size not equal to the size of the first
|
||||
* bank, then disable the 2nd bank completely.
|
||||
*/
|
||||
if (get_ram_size((long *)mb0cf[i].size, mb0cf[i].size)
|
||||
!= mb0cf[i].size) {
|
||||
mtsdram(SDRAM0_CFG0, 0);
|
||||
mtsdram(SDRAM0_B1CR, 0);
|
||||
mtsdram(SDRAM0_CFG0, CONFIG_SYS_SDRAM0_CFG0);
|
||||
udelay(10000);
|
||||
} else {
|
||||
/*
|
||||
* We have two identical banks, so the size
|
||||
* is twice the bank size
|
||||
*/
|
||||
size = 2 * size;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SDRAM_ECC
|
||||
ecc_init(0, size);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* OK, size detected -> all done
|
||||
*/
|
||||
gd->ram_size = size;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return -ENXIO; /* nothing found ! */
|
||||
}
|
||||
|
||||
#endif /* CONFIG_440 */
|
||||
|
||||
#endif /* CONFIG_SDRAM_BANK0 */
|
|
@ -1,60 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2006
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* (C) Copyright 2006
|
||||
* DAVE Srl <www.dave-tech.it>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef _SDRAM_H_
|
||||
#define _SDRAM_H_
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#define ONE_BILLION 1000000000
|
||||
|
||||
struct sdram_conf_s {
|
||||
unsigned long size;
|
||||
int rows;
|
||||
unsigned long reg;
|
||||
};
|
||||
|
||||
typedef struct sdram_conf_s sdram_conf_t;
|
||||
|
||||
/* Bitfields offsets */
|
||||
#define SDRAM0_TR_CASL (31 - 8)
|
||||
#define SDRAM0_TR_PTA (31 - 13)
|
||||
#define SDRAM0_TR_CTP (31 - 15)
|
||||
#define SDRAM0_TR_LDF (31 - 17)
|
||||
#define SDRAM0_TR_RFTA (31 - 29)
|
||||
#define SDRAM0_TR_RCD (31 - 31)
|
||||
|
||||
#ifdef CONFIG_SYS_SDRAM_CL
|
||||
/* SDRAM timings [ns] according to AMCC/IBM names (see SDRAM_faq.doc) */
|
||||
#define CONFIG_SYS_SDRAM_CASL CONFIG_SYS_SDRAM_CL
|
||||
#define CONFIG_SYS_SDRAM_PTA CONFIG_SYS_SDRAM_tRP
|
||||
#define CONFIG_SYS_SDRAM_CTP (CONFIG_SYS_SDRAM_tRC - CONFIG_SYS_SDRAM_tRCD - CONFIG_SYS_SDRAM_tRP)
|
||||
#define CONFIG_SYS_SDRAM_LDF 0
|
||||
#ifdef CONFIG_SYS_SDRAM_tRFC
|
||||
#define CONFIG_SYS_SDRAM_RFTA CONFIG_SYS_SDRAM_tRFC
|
||||
#else
|
||||
#define CONFIG_SYS_SDRAM_RFTA CONFIG_SYS_SDRAM_tRC
|
||||
#endif
|
||||
#define CONFIG_SYS_SDRAM_RCD CONFIG_SYS_SDRAM_tRCD
|
||||
#endif /* #ifdef CONFIG_SYS_SDRAM_CL */
|
||||
|
||||
/*
|
||||
* Some defines for the 440 DDR controller
|
||||
*/
|
||||
#define SDRAM_CFG0_DC_EN 0x80000000 /* SDRAM Controller Enable */
|
||||
#define SDRAM_CFG0_MEMCHK 0x30000000 /* Memory data error checking mask*/
|
||||
#define SDRAM_CFG0_MEMCHK_NON 0x00000000 /* No ECC generation */
|
||||
#define SDRAM_CFG0_MEMCHK_GEN 0x20000000 /* ECC generation */
|
||||
#define SDRAM_CFG0_MEMCHK_CHK 0x30000000 /* ECC generation and checking */
|
||||
#define SDRAM_CFG0_DRAMWDTH 0x02000000 /* DRAM width mask */
|
||||
#define SDRAM_CFG0_DRAMWDTH_32 0x00000000 /* 32 bits */
|
||||
#define SDRAM_CFG0_DRAMWDTH_64 0x02000000 /* 64 bits */
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load diff
|
@ -1,61 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2013 Stefan Roese <sr@denx.de>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <spl.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
/*
|
||||
* Return selected boot device. On PPC4xx its only NOR flash right now.
|
||||
*/
|
||||
u32 spl_boot_device(void)
|
||||
{
|
||||
return BOOT_DEVICE_NOR;
|
||||
}
|
||||
|
||||
/*
|
||||
* SPL version of board_init_f()
|
||||
*/
|
||||
void board_init_f(ulong bootflag)
|
||||
{
|
||||
/*
|
||||
* First we need to initialize the SDRAM, so that the real
|
||||
* U-Boot or the OS (Linux) can be loaded
|
||||
*/
|
||||
dram_init();
|
||||
|
||||
/* Clear bss */
|
||||
memset(__bss_start, '\0', __bss_end - __bss_start);
|
||||
|
||||
/*
|
||||
* Init global_data pointer. Has to be done before calling
|
||||
* get_clocks(), as it stores some clock values into gd needed
|
||||
* later on in the serial driver.
|
||||
*/
|
||||
/* Pointer is writable since we allocated a register for it */
|
||||
gd = (gd_t *)(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET);
|
||||
/* Clear initial global data */
|
||||
memset((void *)gd, 0, sizeof(gd_t));
|
||||
|
||||
/*
|
||||
* get_clocks() needs to be called so that the serial driver
|
||||
* works correctly
|
||||
*/
|
||||
get_clocks();
|
||||
|
||||
/*
|
||||
* Do rudimental console / serial setup
|
||||
*/
|
||||
preloader_console_init();
|
||||
|
||||
/*
|
||||
* Call board_init_r() (SPL framework version) to load and boot
|
||||
* real U-Boot or OS
|
||||
*/
|
||||
board_init_r(NULL, 0);
|
||||
/* Does not return!!! */
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,336 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2007
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
|
||||
#if defined(CONFIG_440)
|
||||
|
||||
#include <asm/ppc440.h>
|
||||
#include <asm/cache.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/mmu.h>
|
||||
|
||||
typedef struct region {
|
||||
u64 base;
|
||||
u32 size;
|
||||
u32 tlb_word2_i_value;
|
||||
} region_t;
|
||||
|
||||
void remove_tlb(u32 vaddr, u32 size)
|
||||
{
|
||||
int i;
|
||||
u32 tlb_word0_value;
|
||||
u32 tlb_vaddr;
|
||||
u32 tlb_size = 0;
|
||||
|
||||
for (i=0; i<PPC4XX_TLB_SIZE; i++) {
|
||||
tlb_word0_value = mftlb1(i);
|
||||
tlb_vaddr = TLB_WORD0_EPN_DECODE(tlb_word0_value);
|
||||
if (((tlb_word0_value & TLB_WORD0_V_MASK) == TLB_WORD0_V_ENABLE) &&
|
||||
(tlb_vaddr >= vaddr)) {
|
||||
/*
|
||||
* TLB is enabled and start address is lower or equal
|
||||
* than the area we are looking for. Now we only have
|
||||
* to check the size/end address for a match.
|
||||
*/
|
||||
switch (tlb_word0_value & TLB_WORD0_SIZE_MASK) {
|
||||
case TLB_WORD0_SIZE_1KB:
|
||||
tlb_size = 1 << 10;
|
||||
break;
|
||||
case TLB_WORD0_SIZE_4KB:
|
||||
tlb_size = 4 << 10;
|
||||
break;
|
||||
case TLB_WORD0_SIZE_16KB:
|
||||
tlb_size = 16 << 10;
|
||||
break;
|
||||
case TLB_WORD0_SIZE_64KB:
|
||||
tlb_size = 64 << 10;
|
||||
break;
|
||||
case TLB_WORD0_SIZE_256KB:
|
||||
tlb_size = 256 << 10;
|
||||
break;
|
||||
case TLB_WORD0_SIZE_1MB:
|
||||
tlb_size = 1 << 20;
|
||||
break;
|
||||
case TLB_WORD0_SIZE_16MB:
|
||||
tlb_size = 16 << 20;
|
||||
break;
|
||||
case TLB_WORD0_SIZE_256MB:
|
||||
tlb_size = 256 << 20;
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Now check the end-address if it's in the range
|
||||
*/
|
||||
if ((tlb_vaddr + tlb_size - 1) <= (vaddr + size - 1))
|
||||
/*
|
||||
* Found a TLB in the range.
|
||||
* Disable it by writing 0 to tlb0 word.
|
||||
*/
|
||||
mttlb1(i, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/* Execute an ISYNC instruction so that the new TLB entry takes effect */
|
||||
asm("isync");
|
||||
}
|
||||
|
||||
/*
|
||||
* Change the I attribute (cache inhibited) of a TLB or multiple TLB's.
|
||||
* This function is used to either turn cache on or off in a specific
|
||||
* memory area.
|
||||
*/
|
||||
void change_tlb(u32 vaddr, u32 size, u32 tlb_word2_i_value)
|
||||
{
|
||||
int i;
|
||||
u32 tlb_word0_value;
|
||||
u32 tlb_word2_value;
|
||||
u32 tlb_vaddr;
|
||||
u32 tlb_size = 0;
|
||||
|
||||
for (i=0; i<PPC4XX_TLB_SIZE; i++) {
|
||||
tlb_word0_value = mftlb1(i);
|
||||
tlb_vaddr = TLB_WORD0_EPN_DECODE(tlb_word0_value);
|
||||
if (((tlb_word0_value & TLB_WORD0_V_MASK) == TLB_WORD0_V_ENABLE) &&
|
||||
(tlb_vaddr >= vaddr)) {
|
||||
/*
|
||||
* TLB is enabled and start address is lower or equal
|
||||
* than the area we are looking for. Now we only have
|
||||
* to check the size/end address for a match.
|
||||
*/
|
||||
switch (tlb_word0_value & TLB_WORD0_SIZE_MASK) {
|
||||
case TLB_WORD0_SIZE_1KB:
|
||||
tlb_size = 1 << 10;
|
||||
break;
|
||||
case TLB_WORD0_SIZE_4KB:
|
||||
tlb_size = 4 << 10;
|
||||
break;
|
||||
case TLB_WORD0_SIZE_16KB:
|
||||
tlb_size = 16 << 10;
|
||||
break;
|
||||
case TLB_WORD0_SIZE_64KB:
|
||||
tlb_size = 64 << 10;
|
||||
break;
|
||||
case TLB_WORD0_SIZE_256KB:
|
||||
tlb_size = 256 << 10;
|
||||
break;
|
||||
case TLB_WORD0_SIZE_1MB:
|
||||
tlb_size = 1 << 20;
|
||||
break;
|
||||
case TLB_WORD0_SIZE_16MB:
|
||||
tlb_size = 16 << 20;
|
||||
break;
|
||||
case TLB_WORD0_SIZE_256MB:
|
||||
tlb_size = 256 << 20;
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Now check the end-address if it's in the range
|
||||
*/
|
||||
if (((tlb_vaddr + tlb_size - 1) <= (vaddr + size - 1)) ||
|
||||
((tlb_vaddr < (vaddr + size - 1)) &&
|
||||
((tlb_vaddr + tlb_size - 1) > (vaddr + size - 1)))) {
|
||||
/*
|
||||
* Found a TLB in the range.
|
||||
* Change cache attribute in tlb2 word.
|
||||
*/
|
||||
tlb_word2_value =
|
||||
TLB_WORD2_U0_DISABLE | TLB_WORD2_U1_DISABLE |
|
||||
TLB_WORD2_U2_DISABLE | TLB_WORD2_U3_DISABLE |
|
||||
TLB_WORD2_W_DISABLE | tlb_word2_i_value |
|
||||
TLB_WORD2_M_DISABLE | TLB_WORD2_G_DISABLE |
|
||||
TLB_WORD2_E_DISABLE | TLB_WORD2_UX_ENABLE |
|
||||
TLB_WORD2_UW_ENABLE | TLB_WORD2_UR_ENABLE |
|
||||
TLB_WORD2_SX_ENABLE | TLB_WORD2_SW_ENABLE |
|
||||
TLB_WORD2_SR_ENABLE;
|
||||
|
||||
/*
|
||||
* Now either flush or invalidate the dcache
|
||||
*/
|
||||
if (tlb_word2_i_value)
|
||||
flush_dcache();
|
||||
else
|
||||
invalidate_dcache();
|
||||
|
||||
mttlb3(i, tlb_word2_value);
|
||||
asm("iccci 0,0");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Execute an ISYNC instruction so that the new TLB entry takes effect */
|
||||
asm("isync");
|
||||
}
|
||||
|
||||
static int add_tlb_entry(u64 phys_addr,
|
||||
u32 virt_addr,
|
||||
u32 tlb_word0_size_value,
|
||||
u32 tlb_word2_i_value)
|
||||
{
|
||||
int i;
|
||||
unsigned long tlb_word0_value;
|
||||
unsigned long tlb_word1_value;
|
||||
unsigned long tlb_word2_value;
|
||||
|
||||
/* First, find the index of a TLB entry not being used */
|
||||
for (i=0; i<PPC4XX_TLB_SIZE; i++) {
|
||||
tlb_word0_value = mftlb1(i);
|
||||
if ((tlb_word0_value & TLB_WORD0_V_MASK) == TLB_WORD0_V_DISABLE)
|
||||
break;
|
||||
}
|
||||
if (i >= PPC4XX_TLB_SIZE)
|
||||
return -1;
|
||||
|
||||
/* Second, create the TLB entry */
|
||||
tlb_word0_value = TLB_WORD0_EPN_ENCODE(virt_addr) | TLB_WORD0_V_ENABLE |
|
||||
TLB_WORD0_TS_0 | tlb_word0_size_value;
|
||||
tlb_word1_value = TLB_WORD1_RPN_ENCODE((u32)phys_addr) |
|
||||
TLB_WORD1_ERPN_ENCODE(phys_addr >> 32);
|
||||
tlb_word2_value = TLB_WORD2_U0_DISABLE | TLB_WORD2_U1_DISABLE |
|
||||
TLB_WORD2_U2_DISABLE | TLB_WORD2_U3_DISABLE |
|
||||
TLB_WORD2_W_DISABLE | tlb_word2_i_value |
|
||||
TLB_WORD2_M_DISABLE | TLB_WORD2_G_DISABLE |
|
||||
TLB_WORD2_E_DISABLE | TLB_WORD2_UX_ENABLE |
|
||||
TLB_WORD2_UW_ENABLE | TLB_WORD2_UR_ENABLE |
|
||||
TLB_WORD2_SX_ENABLE | TLB_WORD2_SW_ENABLE |
|
||||
TLB_WORD2_SR_ENABLE;
|
||||
|
||||
/* Wait for all memory accesses to complete */
|
||||
sync();
|
||||
|
||||
/* Third, add the TLB entries */
|
||||
mttlb1(i, tlb_word0_value);
|
||||
mttlb2(i, tlb_word1_value);
|
||||
mttlb3(i, tlb_word2_value);
|
||||
|
||||
/* Execute an ISYNC instruction so that the new TLB entry takes effect */
|
||||
asm("isync");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void program_tlb_addr(u64 phys_addr,
|
||||
u32 virt_addr,
|
||||
u32 mem_size,
|
||||
u32 tlb_word2_i_value)
|
||||
{
|
||||
int rc;
|
||||
int tlb_i;
|
||||
|
||||
tlb_i = tlb_word2_i_value;
|
||||
while (mem_size != 0) {
|
||||
rc = 0;
|
||||
/* Add the TLB entries in to map the region. */
|
||||
if (((phys_addr & TLB_256MB_ALIGN_MASK) == phys_addr) &&
|
||||
(mem_size >= TLB_256MB_SIZE)) {
|
||||
/* Add a 256MB TLB entry */
|
||||
if ((rc = add_tlb_entry(phys_addr, virt_addr,
|
||||
TLB_WORD0_SIZE_256MB, tlb_i)) == 0) {
|
||||
mem_size -= TLB_256MB_SIZE;
|
||||
phys_addr += TLB_256MB_SIZE;
|
||||
virt_addr += TLB_256MB_SIZE;
|
||||
}
|
||||
} else if (((phys_addr & TLB_16MB_ALIGN_MASK) == phys_addr) &&
|
||||
(mem_size >= TLB_16MB_SIZE)) {
|
||||
/* Add a 16MB TLB entry */
|
||||
if ((rc = add_tlb_entry(phys_addr, virt_addr,
|
||||
TLB_WORD0_SIZE_16MB, tlb_i)) == 0) {
|
||||
mem_size -= TLB_16MB_SIZE;
|
||||
phys_addr += TLB_16MB_SIZE;
|
||||
virt_addr += TLB_16MB_SIZE;
|
||||
}
|
||||
} else if (((phys_addr & TLB_1MB_ALIGN_MASK) == phys_addr) &&
|
||||
(mem_size >= TLB_1MB_SIZE)) {
|
||||
/* Add a 1MB TLB entry */
|
||||
if ((rc = add_tlb_entry(phys_addr, virt_addr,
|
||||
TLB_WORD0_SIZE_1MB, tlb_i)) == 0) {
|
||||
mem_size -= TLB_1MB_SIZE;
|
||||
phys_addr += TLB_1MB_SIZE;
|
||||
virt_addr += TLB_1MB_SIZE;
|
||||
}
|
||||
} else if (((phys_addr & TLB_256KB_ALIGN_MASK) == phys_addr) &&
|
||||
(mem_size >= TLB_256KB_SIZE)) {
|
||||
/* Add a 256KB TLB entry */
|
||||
if ((rc = add_tlb_entry(phys_addr, virt_addr,
|
||||
TLB_WORD0_SIZE_256KB, tlb_i)) == 0) {
|
||||
mem_size -= TLB_256KB_SIZE;
|
||||
phys_addr += TLB_256KB_SIZE;
|
||||
virt_addr += TLB_256KB_SIZE;
|
||||
}
|
||||
} else if (((phys_addr & TLB_64KB_ALIGN_MASK) == phys_addr) &&
|
||||
(mem_size >= TLB_64KB_SIZE)) {
|
||||
/* Add a 64KB TLB entry */
|
||||
if ((rc = add_tlb_entry(phys_addr, virt_addr,
|
||||
TLB_WORD0_SIZE_64KB, tlb_i)) == 0) {
|
||||
mem_size -= TLB_64KB_SIZE;
|
||||
phys_addr += TLB_64KB_SIZE;
|
||||
virt_addr += TLB_64KB_SIZE;
|
||||
}
|
||||
} else if (((phys_addr & TLB_16KB_ALIGN_MASK) == phys_addr) &&
|
||||
(mem_size >= TLB_16KB_SIZE)) {
|
||||
/* Add a 16KB TLB entry */
|
||||
if ((rc = add_tlb_entry(phys_addr, virt_addr,
|
||||
TLB_WORD0_SIZE_16KB, tlb_i)) == 0) {
|
||||
mem_size -= TLB_16KB_SIZE;
|
||||
phys_addr += TLB_16KB_SIZE;
|
||||
virt_addr += TLB_16KB_SIZE;
|
||||
}
|
||||
} else if (((phys_addr & TLB_4KB_ALIGN_MASK) == phys_addr) &&
|
||||
(mem_size >= TLB_4KB_SIZE)) {
|
||||
/* Add a 4KB TLB entry */
|
||||
if ((rc = add_tlb_entry(phys_addr, virt_addr,
|
||||
TLB_WORD0_SIZE_4KB, tlb_i)) == 0) {
|
||||
mem_size -= TLB_4KB_SIZE;
|
||||
phys_addr += TLB_4KB_SIZE;
|
||||
virt_addr += TLB_4KB_SIZE;
|
||||
}
|
||||
} else if (((phys_addr & TLB_1KB_ALIGN_MASK) == phys_addr) &&
|
||||
(mem_size >= TLB_1KB_SIZE)) {
|
||||
/* Add a 1KB TLB entry */
|
||||
if ((rc = add_tlb_entry(phys_addr, virt_addr,
|
||||
TLB_WORD0_SIZE_1KB, tlb_i)) == 0) {
|
||||
mem_size -= TLB_1KB_SIZE;
|
||||
phys_addr += TLB_1KB_SIZE;
|
||||
virt_addr += TLB_1KB_SIZE;
|
||||
}
|
||||
} else {
|
||||
printf("ERROR: no TLB size exists for the base address 0x%llx.\n",
|
||||
phys_addr);
|
||||
}
|
||||
|
||||
if (rc != 0)
|
||||
printf("ERROR: no TLB entries available for the base addr 0x%llx.\n",
|
||||
phys_addr);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Program one (or multiple) TLB entries for one memory region
|
||||
*
|
||||
* Common usage for boards with SDRAM DIMM modules to dynamically
|
||||
* configure the TLB's for the SDRAM
|
||||
*/
|
||||
void program_tlb(u64 phys_addr, u32 virt_addr, u32 size, u32 tlb_word2_i_value)
|
||||
{
|
||||
region_t region_array;
|
||||
|
||||
region_array.base = phys_addr;
|
||||
region_array.size = size;
|
||||
region_array.tlb_word2_i_value = tlb_word2_i_value; /* en-/disable cache */
|
||||
|
||||
/* Call the routine to add in the tlb entries for the memory regions */
|
||||
program_tlb_addr(region_array.base, virt_addr, region_array.size,
|
||||
region_array.tlb_word2_i_value);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_440 */
|
|
@ -1,392 +0,0 @@
|
|||
/*
|
||||
* linux/arch/powerpc/kernel/traps.c
|
||||
*
|
||||
* Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
|
||||
*
|
||||
* Modified by Cort Dougan (cort@cs.nmt.edu)
|
||||
* and Paul Mackerras (paulus@cs.anu.edu.au)
|
||||
*
|
||||
* (C) Copyright 2000
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file handles the architecture-dependent parts of hardware exceptions
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <kgdb.h>
|
||||
#include <asm/processor.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
/* Returns 0 if exception not found and fixup otherwise. */
|
||||
extern unsigned long search_exception_table(unsigned long);
|
||||
|
||||
/* THIS NEEDS CHANGING to use the board info structure.
|
||||
*/
|
||||
#define END_OF_MEM (gd->bd->bi_memstart + gd->bd->bi_memsize)
|
||||
|
||||
static __inline__ unsigned long get_esr(void)
|
||||
{
|
||||
unsigned long val;
|
||||
|
||||
#if defined(CONFIG_440)
|
||||
asm volatile("mfspr %0, 0x03e" : "=r" (val) :);
|
||||
#else
|
||||
asm volatile("mfesr %0" : "=r" (val) :);
|
||||
#endif
|
||||
return val;
|
||||
}
|
||||
|
||||
#define ESR_MCI 0x80000000
|
||||
#define ESR_PIL 0x08000000
|
||||
#define ESR_PPR 0x04000000
|
||||
#define ESR_PTR 0x02000000
|
||||
#define ESR_DST 0x00800000
|
||||
#define ESR_DIZ 0x00400000
|
||||
#define ESR_U0F 0x00008000
|
||||
|
||||
#if defined(CONFIG_CMD_BEDBUG)
|
||||
extern void do_bedbug_breakpoint(struct pt_regs *);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Trap & Exception support
|
||||
*/
|
||||
|
||||
static void print_backtrace(unsigned long *sp)
|
||||
{
|
||||
int cnt = 0;
|
||||
unsigned long i;
|
||||
|
||||
printf("Call backtrace: ");
|
||||
while (sp) {
|
||||
if ((uint)sp > END_OF_MEM)
|
||||
break;
|
||||
|
||||
i = sp[1];
|
||||
if (cnt++ % 7 == 0)
|
||||
printf("\n");
|
||||
printf("%08lX ", i);
|
||||
if (cnt > 32) break;
|
||||
sp = (unsigned long *)*sp;
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
void show_regs(struct pt_regs *regs)
|
||||
{
|
||||
int i;
|
||||
|
||||
printf("NIP: %08lX XER: %08lX LR: %08lX REGS: %p TRAP: %04lx DEAR: %08lX\n",
|
||||
regs->nip, regs->xer, regs->link, regs, regs->trap, regs->dar);
|
||||
printf("MSR: %08lx EE: %01x PR: %01x FP: %01x ME: %01x IR/DR: %01x%01x\n",
|
||||
regs->msr, regs->msr&MSR_EE ? 1 : 0, regs->msr&MSR_PR ? 1 : 0,
|
||||
regs->msr & MSR_FP ? 1 : 0,regs->msr&MSR_ME ? 1 : 0,
|
||||
regs->msr&MSR_IR ? 1 : 0,
|
||||
regs->msr&MSR_DR ? 1 : 0);
|
||||
|
||||
printf("\n");
|
||||
for (i = 0; i < 32; i++) {
|
||||
if ((i % 8) == 0) {
|
||||
printf("GPR%02d: ", i);
|
||||
}
|
||||
|
||||
printf("%08lX ", regs->gpr[i]);
|
||||
if ((i % 8) == 7) {
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void _exception(int signr, struct pt_regs *regs)
|
||||
{
|
||||
show_regs(regs);
|
||||
print_backtrace((unsigned long *)regs->gpr[1]);
|
||||
panic("Exception");
|
||||
}
|
||||
|
||||
void MachineCheckException(struct pt_regs *regs)
|
||||
{
|
||||
unsigned long fixup, val;
|
||||
#if defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
|
||||
u32 value2;
|
||||
int corr_ecc = 0;
|
||||
int uncorr_ecc = 0;
|
||||
#endif
|
||||
|
||||
if ((fixup = search_exception_table(regs->nip)) != 0) {
|
||||
regs->nip = fixup;
|
||||
val = mfspr(MCSR);
|
||||
/* Clear MCSR */
|
||||
mtspr(SPRN_MCSR, val);
|
||||
return;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_CMD_KGDB)
|
||||
if (debugger_exception_handler && (*debugger_exception_handler)(regs))
|
||||
return;
|
||||
#endif
|
||||
|
||||
printf("Machine Check Exception.\n");
|
||||
printf("Caused by (from msr): ");
|
||||
printf("regs %p ", regs);
|
||||
|
||||
val = get_esr();
|
||||
|
||||
#if !defined(CONFIG_440) && !defined(CONFIG_405EX)
|
||||
if (val& ESR_IMCP) {
|
||||
printf("Instruction");
|
||||
mtspr(ESR, val & ~ESR_IMCP);
|
||||
} else {
|
||||
printf("Data");
|
||||
}
|
||||
printf(" machine check.\n");
|
||||
|
||||
#elif defined(CONFIG_440) || defined(CONFIG_405EX)
|
||||
if (val& ESR_IMCP){
|
||||
printf("Instruction Synchronous Machine Check exception\n");
|
||||
mtspr(SPRN_ESR, val & ~ESR_IMCP);
|
||||
} else {
|
||||
val = mfspr(MCSR);
|
||||
if (val & MCSR_IB)
|
||||
printf("Instruction Read PLB Error\n");
|
||||
#if defined(CONFIG_440)
|
||||
if (val & MCSR_DRB)
|
||||
printf("Data Read PLB Error\n");
|
||||
if (val & MCSR_DWB)
|
||||
printf("Data Write PLB Error\n");
|
||||
#else
|
||||
if (val & MCSR_DB)
|
||||
printf("Data PLB Error\n");
|
||||
#endif
|
||||
if (val & MCSR_TLBP)
|
||||
printf("TLB Parity Error\n");
|
||||
if (val & MCSR_ICP){
|
||||
/*flush_instruction_cache(); */
|
||||
printf("I-Cache Parity Error\n");
|
||||
}
|
||||
if (val & MCSR_DCSP)
|
||||
printf("D-Cache Search Parity Error\n");
|
||||
if (val & MCSR_DCFP)
|
||||
printf("D-Cache Flush Parity Error\n");
|
||||
if (val & MCSR_IMPE)
|
||||
printf("Machine Check exception is imprecise\n");
|
||||
|
||||
/* Clear MCSR */
|
||||
mtspr(SPRN_MCSR, val);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_DDR_ECC) && defined(CONFIG_SDRAM_PPC4xx_IBM_DDR2)
|
||||
/*
|
||||
* Read and print ECC status register/info:
|
||||
* The faulting address is only known upon uncorrectable ECC
|
||||
* errors.
|
||||
*/
|
||||
mfsdram(SDRAM_ECCES, val);
|
||||
if (val & SDRAM_ECCES_CE)
|
||||
printf("ECC: Correctable error\n");
|
||||
if (val & SDRAM_ECCES_UE) {
|
||||
printf("ECC: Uncorrectable error at 0x%02x%08x\n",
|
||||
mfdcr(SDRAM_ERRADDULL), mfdcr(SDRAM_ERRADDLLL));
|
||||
}
|
||||
#endif /* CONFIG_DDR_ECC ... */
|
||||
|
||||
#if defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
|
||||
mfsdram(DDR0_00, val) ;
|
||||
printf("DDR0: DDR0_00 %lx\n", val);
|
||||
val = (val >> 16) & 0xff;
|
||||
if (val & 0x80)
|
||||
printf("DDR0: At least one interrupt active\n");
|
||||
if (val & 0x40)
|
||||
printf("DDR0: DRAM initialization complete.\n");
|
||||
if (val & 0x20) {
|
||||
printf("DDR0: Multiple uncorrectable ECC events.\n");
|
||||
uncorr_ecc = 1;
|
||||
}
|
||||
if (val & 0x10) {
|
||||
printf("DDR0: Single uncorrectable ECC event.\n");
|
||||
uncorr_ecc = 1;
|
||||
}
|
||||
if (val & 0x08) {
|
||||
printf("DDR0: Multiple correctable ECC events.\n");
|
||||
corr_ecc = 1;
|
||||
}
|
||||
if (val & 0x04) {
|
||||
printf("DDR0: Single correctable ECC event.\n");
|
||||
corr_ecc = 1;
|
||||
}
|
||||
if (val & 0x02)
|
||||
printf("Multiple accesses outside the defined"
|
||||
" physical memory space detected\n");
|
||||
if (val & 0x01)
|
||||
printf("DDR0: Single access outside the defined"
|
||||
" physical memory space detected.\n");
|
||||
|
||||
mfsdram(DDR0_01, val);
|
||||
val = (val >> 8) & 0x7;
|
||||
switch (val ) {
|
||||
case 0:
|
||||
printf("DDR0: Write Out-of-Range command\n");
|
||||
break;
|
||||
case 1:
|
||||
printf("DDR0: Read Out-of-Range command\n");
|
||||
break;
|
||||
case 2:
|
||||
printf("DDR0: Masked write Out-of-Range command\n");
|
||||
break;
|
||||
case 4:
|
||||
printf("DDR0: Wrap write Out-of-Range command\n");
|
||||
break;
|
||||
case 5:
|
||||
printf("DDR0: Wrap read Out-of-Range command\n");
|
||||
break;
|
||||
default:
|
||||
mfsdram(DDR0_01, value2);
|
||||
printf("DDR0: No DDR0 error know 0x%lx %x\n", val, value2);
|
||||
}
|
||||
mfsdram(DDR0_23, val);
|
||||
if (((val >> 16) & 0xff) && corr_ecc)
|
||||
printf("DDR0: Syndrome for correctable ECC event 0x%lx\n",
|
||||
(val >> 16) & 0xff);
|
||||
mfsdram(DDR0_23, val);
|
||||
if (((val >> 8) & 0xff) && uncorr_ecc)
|
||||
printf("DDR0: Syndrome for uncorrectable ECC event 0x%lx\n",
|
||||
(val >> 8) & 0xff);
|
||||
mfsdram(DDR0_33, val);
|
||||
if (val)
|
||||
printf("DDR0: Address of command that caused an "
|
||||
"Out-of-Range interrupt %lx\n", val);
|
||||
mfsdram(DDR0_34, val);
|
||||
if (val && uncorr_ecc)
|
||||
printf("DDR0: Address of uncorrectable ECC event %lx\n", val);
|
||||
mfsdram(DDR0_35, val);
|
||||
if (val && uncorr_ecc)
|
||||
printf("DDR0: Address of uncorrectable ECC event %lx\n", val);
|
||||
mfsdram(DDR0_36, val);
|
||||
if (val && uncorr_ecc)
|
||||
printf("DDR0: Data of uncorrectable ECC event 0x%08lx\n", val);
|
||||
mfsdram(DDR0_37, val);
|
||||
if (val && uncorr_ecc)
|
||||
printf("DDR0: Data of uncorrectable ECC event 0x%08lx\n", val);
|
||||
mfsdram(DDR0_38, val);
|
||||
if (val && corr_ecc)
|
||||
printf("DDR0: Address of correctable ECC event %lx\n", val);
|
||||
mfsdram(DDR0_39, val);
|
||||
if (val && corr_ecc)
|
||||
printf("DDR0: Address of correctable ECC event %lx\n", val);
|
||||
mfsdram(DDR0_40, val);
|
||||
if (val && corr_ecc)
|
||||
printf("DDR0: Data of correctable ECC event 0x%08lx\n", val);
|
||||
mfsdram(DDR0_41, val);
|
||||
if (val && corr_ecc)
|
||||
printf("DDR0: Data of correctable ECC event 0x%08lx\n", val);
|
||||
#endif /* CONFIG_440EPX */
|
||||
#endif /* CONFIG_440 */
|
||||
show_regs(regs);
|
||||
print_backtrace((unsigned long *)regs->gpr[1]);
|
||||
panic("machine check");
|
||||
}
|
||||
|
||||
void AlignmentException(struct pt_regs *regs)
|
||||
{
|
||||
#if defined(CONFIG_CMD_KGDB)
|
||||
if (debugger_exception_handler && (*debugger_exception_handler)(regs))
|
||||
return;
|
||||
#endif
|
||||
|
||||
show_regs(regs);
|
||||
print_backtrace((unsigned long *)regs->gpr[1]);
|
||||
panic("Alignment Exception");
|
||||
}
|
||||
|
||||
void ProgramCheckException(struct pt_regs *regs)
|
||||
{
|
||||
long esr_val;
|
||||
|
||||
#if defined(CONFIG_CMD_KGDB)
|
||||
if (debugger_exception_handler && (*debugger_exception_handler)(regs))
|
||||
return;
|
||||
#endif
|
||||
|
||||
show_regs(regs);
|
||||
|
||||
esr_val = get_esr();
|
||||
if( esr_val & ESR_PIL )
|
||||
printf( "** Illegal Instruction **\n" );
|
||||
else if( esr_val & ESR_PPR )
|
||||
printf( "** Privileged Instruction **\n" );
|
||||
else if( esr_val & ESR_PTR )
|
||||
printf( "** Trap Instruction **\n" );
|
||||
|
||||
print_backtrace((unsigned long *)regs->gpr[1]);
|
||||
panic("Program Check Exception");
|
||||
}
|
||||
|
||||
void DecrementerPITException(struct pt_regs *regs)
|
||||
{
|
||||
/*
|
||||
* Reset PIT interrupt
|
||||
*/
|
||||
mtspr(SPRN_TSR, 0x08000000);
|
||||
|
||||
/*
|
||||
* Call timer_interrupt routine in interrupts.c
|
||||
*/
|
||||
timer_interrupt(NULL);
|
||||
}
|
||||
|
||||
|
||||
void UnknownException(struct pt_regs *regs)
|
||||
{
|
||||
#if defined(CONFIG_CMD_KGDB)
|
||||
if (debugger_exception_handler && (*debugger_exception_handler)(regs))
|
||||
return;
|
||||
#endif
|
||||
|
||||
printf("Bad trap at PC: %lx, SR: %lx, vector=%lx\n",
|
||||
regs->nip, regs->msr, regs->trap);
|
||||
_exception(0, regs);
|
||||
}
|
||||
|
||||
void DebugException(struct pt_regs *regs)
|
||||
{
|
||||
printf("Debugger trap at @ %lx\n", regs->nip );
|
||||
show_regs(regs);
|
||||
#if defined(CONFIG_CMD_BEDBUG)
|
||||
do_bedbug_breakpoint( regs );
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Probe an address by reading. If not present, return -1, otherwise
|
||||
* return 0.
|
||||
*/
|
||||
int
|
||||
addr_probe(uint *addr)
|
||||
{
|
||||
#if 0
|
||||
int retval;
|
||||
|
||||
__asm__ __volatile__( \
|
||||
"1: lwz %0,0(%1)\n" \
|
||||
" eieio\n" \
|
||||
" li %0,0\n" \
|
||||
"2:\n" \
|
||||
".section .fixup,\"ax\"\n" \
|
||||
"3: li %0,-1\n" \
|
||||
" b 2b\n" \
|
||||
".section __ex_table,\"a\"\n" \
|
||||
" .align 2\n" \
|
||||
" .long 1b,3b\n" \
|
||||
".text" \
|
||||
: "=r" (retval) : "r"(addr));
|
||||
|
||||
return (retval);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
/*
|
||||
* Copyright 2012-2013 Stefan Roese <sr@denx.de>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
MEMORY
|
||||
{
|
||||
sdram : ORIGIN = CONFIG_SPL_BSS_START_ADDR,
|
||||
LENGTH = CONFIG_SPL_BSS_MAX_SIZE
|
||||
flash : ORIGIN = CONFIG_SPL_TEXT_BASE,
|
||||
LENGTH = CONFIG_SYS_SPL_MAX_LEN
|
||||
}
|
||||
|
||||
OUTPUT_ARCH(powerpc)
|
||||
ENTRY(_start)
|
||||
SECTIONS
|
||||
{
|
||||
#ifdef CONFIG_440
|
||||
.bootpg 0xfffff000 :
|
||||
{
|
||||
arch/powerpc/cpu/ppc4xx/start.o (.bootpg)
|
||||
|
||||
/*
|
||||
* PPC440 board need a board specific object with the
|
||||
* TLB definitions. This needs to get included right after
|
||||
* start.o, since the first shadow TLB only covers 4k
|
||||
* of address space.
|
||||
*/
|
||||
CONFIG_BOARDDIR/init.o (.bootpg)
|
||||
} > flash
|
||||
#endif
|
||||
|
||||
.resetvec 0xFFFFFFFC :
|
||||
{
|
||||
KEEP(*(.resetvec))
|
||||
} > flash
|
||||
|
||||
.text :
|
||||
{
|
||||
__start = .;
|
||||
arch/powerpc/cpu/ppc4xx/start.o (.text)
|
||||
CONFIG_BOARDDIR/init.o (.text)
|
||||
*(.text*)
|
||||
} > flash
|
||||
|
||||
. = ALIGN(4);
|
||||
.data : { *(SORT_BY_ALIGNMENT(.data*)) } > flash
|
||||
|
||||
. = ALIGN(4);
|
||||
.rodata : { *(SORT_BY_ALIGNMENT(.rodata*)) } > flash
|
||||
|
||||
.bss :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__bss_start = .;
|
||||
*(.bss*)
|
||||
. = ALIGN(4);
|
||||
__bss_end = .;
|
||||
} > sdram
|
||||
}
|
|
@ -1,136 +0,0 @@
|
|||
/*
|
||||
* Copyright 2007-2009 Freescale Semiconductor, Inc.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include "config.h" /* CONFIG_BOARDDIR */
|
||||
|
||||
#ifndef RESET_VECTOR_ADDRESS
|
||||
#ifdef CONFIG_RESET_VECTOR_ADDRESS
|
||||
#define RESET_VECTOR_ADDRESS CONFIG_RESET_VECTOR_ADDRESS
|
||||
#else
|
||||
#define RESET_VECTOR_ADDRESS 0xfffffffc
|
||||
#endif
|
||||
#endif
|
||||
|
||||
OUTPUT_ARCH(powerpc)
|
||||
|
||||
PHDRS
|
||||
{
|
||||
text PT_LOAD;
|
||||
bss PT_LOAD;
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
/* Read-only sections, merged into text segment: */
|
||||
. = + SIZEOF_HEADERS;
|
||||
.text :
|
||||
{
|
||||
*(.text*)
|
||||
} :text
|
||||
_etext = .;
|
||||
PROVIDE (etext = .);
|
||||
.rodata :
|
||||
{
|
||||
*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
|
||||
} :text
|
||||
|
||||
/* Read-write section, merged into data segment: */
|
||||
. = (. + 0x00FF) & 0xFFFFFF00;
|
||||
_erotext = .;
|
||||
PROVIDE (erotext = .);
|
||||
.reloc :
|
||||
{
|
||||
_GOT2_TABLE_ = .;
|
||||
KEEP(*(.got2))
|
||||
KEEP(*(.got))
|
||||
_FIXUP_TABLE_ = .;
|
||||
KEEP(*(.fixup))
|
||||
}
|
||||
__got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
|
||||
__fixup_entries = (. - _FIXUP_TABLE_) >> 2;
|
||||
|
||||
.data :
|
||||
{
|
||||
*(.data*)
|
||||
*(.sdata*)
|
||||
}
|
||||
_edata = .;
|
||||
PROVIDE (edata = .);
|
||||
|
||||
. = .;
|
||||
|
||||
. = ALIGN(4);
|
||||
.u_boot_list : {
|
||||
KEEP(*(SORT(.u_boot_list*)));
|
||||
}
|
||||
|
||||
. = .;
|
||||
__start___ex_table = .;
|
||||
__ex_table : { *(__ex_table) }
|
||||
__stop___ex_table = .;
|
||||
|
||||
. = ALIGN(256);
|
||||
__init_begin = .;
|
||||
.text.init : { *(.text.init) }
|
||||
.data.init : {
|
||||
*(.data.init)
|
||||
. = ALIGN(256);
|
||||
LONG(0) LONG(0) /* Extend u-boot.bin to here */
|
||||
}
|
||||
__init_end = .;
|
||||
_end = .;
|
||||
|
||||
#ifndef CONFIG_SPL
|
||||
#ifdef CONFIG_440
|
||||
.bootpg RESET_VECTOR_ADDRESS - 0xffc :
|
||||
{
|
||||
arch/powerpc/cpu/ppc4xx/start.o (.bootpg)
|
||||
|
||||
/*
|
||||
* PPC440 board need a board specific object with the
|
||||
* TLB definitions. This needs to get included right after
|
||||
* start.o, since the first shadow TLB only covers 4k
|
||||
* of address space.
|
||||
*/
|
||||
#ifdef CONFIG_INIT_TLB
|
||||
CONFIG_INIT_TLB (.bootpg)
|
||||
#else
|
||||
CONFIG_BOARDDIR/init.o (.bootpg)
|
||||
#endif
|
||||
} :text = 0xffff
|
||||
#endif
|
||||
|
||||
.resetvec RESET_VECTOR_ADDRESS :
|
||||
{
|
||||
KEEP(*(.resetvec))
|
||||
} :text = 0xffff
|
||||
|
||||
. = RESET_VECTOR_ADDRESS + 0x4;
|
||||
|
||||
/*
|
||||
* Make sure that the bss segment isn't linked at 0x0, otherwise its
|
||||
* address won't be updated during relocation fixups. Note that
|
||||
* this is a temporary fix. Code to dynamically the fixup the bss
|
||||
* location will be added in the future. When the bss relocation
|
||||
* fixup code is present this workaround should be removed.
|
||||
*/
|
||||
#if (RESET_VECTOR_ADDRESS == 0xfffffffc)
|
||||
. |= 0x10;
|
||||
#endif
|
||||
#endif /* CONFIG_SPL */
|
||||
|
||||
__bss_start = .;
|
||||
.bss (NOLOAD) :
|
||||
{
|
||||
*(.bss*)
|
||||
*(.sbss*)
|
||||
*(COMMON)
|
||||
} :bss
|
||||
|
||||
. = ALIGN(4);
|
||||
__bss_end = . ;
|
||||
PROVIDE (end = .);
|
||||
}
|
|
@ -1,163 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2000-2002
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* (C) Copyright 2002 (440 port)
|
||||
* Scott McNutt, Artesyn Communication Producs, smcnutt@artsyncp.com
|
||||
*
|
||||
* (C) Copyright 2003 (440GX port)
|
||||
* Travis B. Sawyer, Sandburst Corporation, tsawyer@sandburst.com
|
||||
*
|
||||
* (C) Copyright 2008 (PPC440X05 port for Virtex 5 FX)
|
||||
* Ricardo Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda@gmail.com
|
||||
* Work supported by Qtechnology (htpp://qtec.com)
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <watchdog.h>
|
||||
#include <command.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/interrupt.h>
|
||||
#include <asm/ppc4xx.h>
|
||||
#include <ppc_asm.tmpl>
|
||||
|
||||
#if (UIC_MAX > 3)
|
||||
#define UICB0_ALL (UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI) | \
|
||||
UIC_MASK(VECNUM_UIC2CI) | UIC_MASK(VECNUM_UIC2NCI) | \
|
||||
UIC_MASK(VECNUM_UIC3CI) | UIC_MASK(VECNUM_UIC3NCI))
|
||||
#elif (UIC_MAX > 2)
|
||||
#define UICB0_ALL (UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI) | \
|
||||
UIC_MASK(VECNUM_UIC2CI) | UIC_MASK(VECNUM_UIC2NCI))
|
||||
#elif (UIC_MAX > 1)
|
||||
#define UICB0_ALL (UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI))
|
||||
#else
|
||||
#define UICB0_ALL 0
|
||||
#endif
|
||||
|
||||
u32 get_dcr(u16);
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
void pic_enable(void)
|
||||
{
|
||||
#if (UIC_MAX > 1)
|
||||
/* Install the UIC1 handlers */
|
||||
irq_install_handler(VECNUM_UIC1NCI, (void *)(void *)external_interrupt, 0);
|
||||
irq_install_handler(VECNUM_UIC1CI, (void *)(void *)external_interrupt, 0);
|
||||
#endif
|
||||
#if (UIC_MAX > 2)
|
||||
irq_install_handler(VECNUM_UIC2NCI, (void *)(void *)external_interrupt, 0);
|
||||
irq_install_handler(VECNUM_UIC2CI, (void *)(void *)external_interrupt, 0);
|
||||
#endif
|
||||
#if (UIC_MAX > 3)
|
||||
irq_install_handler(VECNUM_UIC3NCI, (void *)(void *)external_interrupt, 0);
|
||||
irq_install_handler(VECNUM_UIC3CI, (void *)(void *)external_interrupt, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Handler for UIC interrupt */
|
||||
static void uic_interrupt(u32 uic_base, int vec_base)
|
||||
{
|
||||
u32 uic_msr;
|
||||
u32 msr_shift;
|
||||
int vec;
|
||||
|
||||
/*
|
||||
* Read masked interrupt status register to determine interrupt source
|
||||
*/
|
||||
uic_msr = get_dcr(uic_base + UIC_MSR);
|
||||
msr_shift = uic_msr;
|
||||
vec = vec_base;
|
||||
|
||||
while (msr_shift != 0) {
|
||||
if (msr_shift & 0x80000000)
|
||||
interrupt_run_handler(vec);
|
||||
/*
|
||||
* Shift msr to next position and increment vector
|
||||
*/
|
||||
msr_shift <<= 1;
|
||||
vec++;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle external interrupts
|
||||
*/
|
||||
void external_interrupt(struct pt_regs *regs)
|
||||
{
|
||||
u32 uic_msr;
|
||||
|
||||
/*
|
||||
* Read masked interrupt status register to determine interrupt source
|
||||
*/
|
||||
uic_msr = mfdcr(UIC0MSR);
|
||||
|
||||
#if (UIC_MAX > 1)
|
||||
if ((UIC_MASK(VECNUM_UIC1CI) & uic_msr) ||
|
||||
(UIC_MASK(VECNUM_UIC1NCI) & uic_msr))
|
||||
uic_interrupt(UIC1_DCR_BASE, 32);
|
||||
#endif
|
||||
|
||||
#if (UIC_MAX > 2)
|
||||
if ((UIC_MASK(VECNUM_UIC2CI) & uic_msr) ||
|
||||
(UIC_MASK(VECNUM_UIC2NCI) & uic_msr))
|
||||
uic_interrupt(UIC2_DCR_BASE, 64);
|
||||
#endif
|
||||
|
||||
#if (UIC_MAX > 3)
|
||||
if ((UIC_MASK(VECNUM_UIC3CI) & uic_msr) ||
|
||||
(UIC_MASK(VECNUM_UIC3NCI) & uic_msr))
|
||||
uic_interrupt(UIC3_DCR_BASE, 96);
|
||||
#endif
|
||||
|
||||
mtdcr(UIC0SR, (uic_msr & UICB0_ALL));
|
||||
|
||||
if (uic_msr & ~(UICB0_ALL))
|
||||
uic_interrupt(UIC0_DCR_BASE, 0);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void pic_irq_ack(unsigned int vec)
|
||||
{
|
||||
if ((vec >= 0) && (vec < 32))
|
||||
mtdcr(UIC0SR, UIC_MASK(vec));
|
||||
else if ((vec >= 32) && (vec < 64))
|
||||
mtdcr(UIC1SR, UIC_MASK(vec));
|
||||
else if ((vec >= 64) && (vec < 96))
|
||||
mtdcr(UIC2SR, UIC_MASK(vec));
|
||||
else if (vec >= 96)
|
||||
mtdcr(UIC3SR, UIC_MASK(vec));
|
||||
}
|
||||
|
||||
/*
|
||||
* Install and free a interrupt handler.
|
||||
*/
|
||||
void pic_irq_enable(unsigned int vec)
|
||||
{
|
||||
|
||||
if ((vec >= 0) && (vec < 32))
|
||||
mtdcr(UIC0ER, mfdcr(UIC0ER) | UIC_MASK(vec));
|
||||
else if ((vec >= 32) && (vec < 64))
|
||||
mtdcr(UIC1ER, mfdcr(UIC1ER) | UIC_MASK(vec));
|
||||
else if ((vec >= 64) && (vec < 96))
|
||||
mtdcr(UIC2ER, mfdcr(UIC2ER) | UIC_MASK(vec));
|
||||
else if (vec >= 96)
|
||||
mtdcr(UIC3ER, mfdcr(UIC3ER) | UIC_MASK(vec));
|
||||
|
||||
debug("Install interrupt vector %d\n", vec);
|
||||
}
|
||||
|
||||
void pic_irq_disable(unsigned int vec)
|
||||
{
|
||||
if ((vec >= 0) && (vec < 32))
|
||||
mtdcr(UIC0ER, mfdcr(UIC0ER) & ~UIC_MASK(vec));
|
||||
else if ((vec >= 32) && (vec < 64))
|
||||
mtdcr(UIC1ER, mfdcr(UIC1ER) & ~UIC_MASK(vec));
|
||||
else if ((vec >= 64) && (vec < 96))
|
||||
mtdcr(UIC2ER, mfdcr(UIC2ER) & ~UIC_MASK(vec));
|
||||
else if (vec >= 96)
|
||||
mtdcr(UIC3ER, mfdcr(UIC3ER) & ~UIC_MASK(vec));
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2007
|
||||
* Markus Klotzbuecher, DENX Software Engineering <mk@denx.de>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
|
||||
#if defined(CONFIG_USB_OHCI_NEW) && defined(CONFIG_SYS_USB_OHCI_CPU_INIT)
|
||||
|
||||
#ifdef CONFIG_4xx_DCACHE
|
||||
#include <asm/mmu.h>
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
#endif
|
||||
|
||||
int usb_cpu_init(void)
|
||||
{
|
||||
#ifdef CONFIG_4xx_DCACHE
|
||||
/* disable cache */
|
||||
change_tlb(gd->bd->bi_memstart, gd->bd->bi_memsize, TLB_WORD2_I_ENABLE);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int usb_cpu_stop(void)
|
||||
{
|
||||
#ifdef CONFIG_4xx_DCACHE
|
||||
/* enable cache */
|
||||
change_tlb(gd->bd->bi_memstart, gd->bd->bi_memsize, 0);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
int usb_cpu_init_fail(void)
|
||||
{
|
||||
#ifdef CONFIG_4xx_DCACHE
|
||||
/* enable cache */
|
||||
change_tlb(gd->bd->bi_memstart, gd->bd->bi_memsize, 0);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* defined(CONFIG_USB_OHCI) && defined(CONFIG_SYS_USB_OHCI_CPU_INIT) */
|
File diff suppressed because it is too large
Load diff
|
@ -1,405 +0,0 @@
|
|||
/*
|
||||
* URB OHCI HCD (Host Controller Driver) for USB.
|
||||
*
|
||||
* (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at>
|
||||
* (C) Copyright 2000-2001 David Brownell <dbrownell@users.sourceforge.net>
|
||||
*
|
||||
* usb-ohci.h
|
||||
*/
|
||||
|
||||
static int cc_to_error[16] = {
|
||||
|
||||
/* mapping of the OHCI CC status to error codes */
|
||||
/* No Error */ 0,
|
||||
/* CRC Error */ USB_ST_CRC_ERR,
|
||||
/* Bit Stuff */ USB_ST_BIT_ERR,
|
||||
/* Data Togg */ USB_ST_CRC_ERR,
|
||||
/* Stall */ USB_ST_STALLED,
|
||||
/* DevNotResp */ -1,
|
||||
/* PIDCheck */ USB_ST_BIT_ERR,
|
||||
/* UnExpPID */ USB_ST_BIT_ERR,
|
||||
/* DataOver */ USB_ST_BUF_ERR,
|
||||
/* DataUnder */ USB_ST_BUF_ERR,
|
||||
/* reservd */ -1,
|
||||
/* reservd */ -1,
|
||||
/* BufferOver */ USB_ST_BUF_ERR,
|
||||
/* BuffUnder */ USB_ST_BUF_ERR,
|
||||
/* Not Access */ -1,
|
||||
/* Not Access */ -1
|
||||
};
|
||||
|
||||
/* ED States */
|
||||
|
||||
#define ED_NEW 0x00
|
||||
#define ED_UNLINK 0x01
|
||||
#define ED_OPER 0x02
|
||||
#define ED_DEL 0x04
|
||||
#define ED_URB_DEL 0x08
|
||||
|
||||
/* usb_ohci_ed */
|
||||
struct ed {
|
||||
__u32 hwINFO;
|
||||
__u32 hwTailP;
|
||||
__u32 hwHeadP;
|
||||
__u32 hwNextED;
|
||||
|
||||
struct ed *ed_prev;
|
||||
__u8 int_period;
|
||||
__u8 int_branch;
|
||||
__u8 int_load;
|
||||
__u8 int_interval;
|
||||
__u8 state;
|
||||
__u8 type;
|
||||
__u16 last_iso;
|
||||
struct ed *ed_rm_list;
|
||||
|
||||
struct usb_device *usb_dev;
|
||||
__u32 unused[3];
|
||||
} __attribute__((aligned(16)));
|
||||
typedef struct ed ed_t;
|
||||
|
||||
/* TD info field */
|
||||
#define TD_CC 0xf0000000
|
||||
#define TD_CC_GET(td_p) ((td_p >>28) & 0x0f)
|
||||
#define TD_CC_SET(td_p, cc) (td_p) = ((td_p) & 0x0fffffff) | (((cc) & 0x0f) << 28)
|
||||
#define TD_EC 0x0C000000
|
||||
#define TD_T 0x03000000
|
||||
#define TD_T_DATA0 0x02000000
|
||||
#define TD_T_DATA1 0x03000000
|
||||
#define TD_T_TOGGLE 0x00000000
|
||||
#define TD_R 0x00040000
|
||||
#define TD_DI 0x00E00000
|
||||
#define TD_DI_SET(X) (((X) & 0x07)<< 21)
|
||||
#define TD_DP 0x00180000
|
||||
#define TD_DP_SETUP 0x00000000
|
||||
#define TD_DP_IN 0x00100000
|
||||
#define TD_DP_OUT 0x00080000
|
||||
|
||||
#define TD_ISO 0x00010000
|
||||
#define TD_DEL 0x00020000
|
||||
|
||||
/* CC Codes */
|
||||
#define TD_CC_NOERROR 0x00
|
||||
#define TD_CC_CRC 0x01
|
||||
#define TD_CC_BITSTUFFING 0x02
|
||||
#define TD_CC_DATATOGGLEM 0x03
|
||||
#define TD_CC_STALL 0x04
|
||||
#define TD_DEVNOTRESP 0x05
|
||||
#define TD_PIDCHECKFAIL 0x06
|
||||
#define TD_UNEXPECTEDPID 0x07
|
||||
#define TD_DATAOVERRUN 0x08
|
||||
#define TD_DATAUNDERRUN 0x09
|
||||
#define TD_BUFFEROVERRUN 0x0C
|
||||
#define TD_BUFFERUNDERRUN 0x0D
|
||||
#define TD_NOTACCESSED 0x0F
|
||||
|
||||
#define MAXPSW 1
|
||||
|
||||
struct td {
|
||||
__u32 hwINFO;
|
||||
__u32 hwCBP; /* Current Buffer Pointer */
|
||||
__u32 hwNextTD; /* Next TD Pointer */
|
||||
__u32 hwBE; /* Memory Buffer End Pointer */
|
||||
|
||||
__u16 hwPSW[MAXPSW];
|
||||
__u8 unused;
|
||||
__u8 index;
|
||||
struct ed *ed;
|
||||
struct td *next_dl_td;
|
||||
struct usb_device *usb_dev;
|
||||
int transfer_len;
|
||||
__u32 data;
|
||||
|
||||
__u32 unused2[2];
|
||||
} __attribute__((aligned(32)));
|
||||
typedef struct td td_t;
|
||||
|
||||
#define OHCI_ED_SKIP (1 << 14)
|
||||
|
||||
/*
|
||||
* The HCCA (Host Controller Communications Area) is a 256 byte
|
||||
* structure defined in the OHCI spec. that the host controller is
|
||||
* told the base address of. It must be 256-byte aligned.
|
||||
*/
|
||||
|
||||
#define NUM_INTS 32 /* part of the OHCI standard */
|
||||
struct ohci_hcca {
|
||||
__u32 int_table[NUM_INTS]; /* Interrupt ED table */
|
||||
__u16 frame_no; /* current frame number */
|
||||
__u16 pad1; /* set to 0 on each frame_no change */
|
||||
__u32 done_head; /* info returned for an interrupt */
|
||||
u8 reserved_for_hc[116];
|
||||
} __attribute__((aligned(256)));
|
||||
|
||||
/*
|
||||
* Maximum number of root hub ports.
|
||||
*/
|
||||
#define MAX_ROOT_PORTS 15 /* maximum OHCI root hub ports */
|
||||
|
||||
/*
|
||||
* This is the structure of the OHCI controller's memory mapped I/O
|
||||
* region. This is Memory Mapped I/O. You must use the readl() and
|
||||
* writel() macros defined in asm/io.h to access these!!
|
||||
*/
|
||||
struct ohci_regs {
|
||||
/* control and status registers */
|
||||
__u32 revision;
|
||||
__u32 control;
|
||||
__u32 cmdstatus;
|
||||
__u32 intrstatus;
|
||||
__u32 intrenable;
|
||||
__u32 intrdisable;
|
||||
/* memory pointers */
|
||||
__u32 hcca;
|
||||
__u32 ed_periodcurrent;
|
||||
__u32 ed_controlhead;
|
||||
__u32 ed_controlcurrent;
|
||||
__u32 ed_bulkhead;
|
||||
__u32 ed_bulkcurrent;
|
||||
__u32 donehead;
|
||||
/* frame counters */
|
||||
__u32 fminterval;
|
||||
__u32 fmremaining;
|
||||
__u32 fmnumber;
|
||||
__u32 periodicstart;
|
||||
__u32 lsthresh;
|
||||
/* Root hub ports */
|
||||
struct ohci_roothub_regs {
|
||||
__u32 a;
|
||||
__u32 b;
|
||||
__u32 status;
|
||||
__u32 portstatus[MAX_ROOT_PORTS];
|
||||
} roothub;
|
||||
} __attribute__((aligned(32)));
|
||||
|
||||
/* OHCI CONTROL AND STATUS REGISTER MASKS */
|
||||
|
||||
/*
|
||||
* HcControl (control) register masks
|
||||
*/
|
||||
#define OHCI_CTRL_CBSR (3 << 0) /* control/bulk service ratio */
|
||||
#define OHCI_CTRL_PLE (1 << 2) /* periodic list enable */
|
||||
#define OHCI_CTRL_IE (1 << 3) /* isochronous enable */
|
||||
#define OHCI_CTRL_CLE (1 << 4) /* control list enable */
|
||||
#define OHCI_CTRL_BLE (1 << 5) /* bulk list enable */
|
||||
#define OHCI_CTRL_HCFS (3 << 6) /* host controller functional state */
|
||||
#define OHCI_CTRL_IR (1 << 8) /* interrupt routing */
|
||||
#define OHCI_CTRL_RWC (1 << 9) /* remote wakeup connected */
|
||||
#define OHCI_CTRL_RWE (1 << 10) /* remote wakeup enable */
|
||||
|
||||
/* pre-shifted values for HCFS */
|
||||
# define OHCI_USB_RESET (0 << 6)
|
||||
# define OHCI_USB_RESUME (1 << 6)
|
||||
# define OHCI_USB_OPER (2 << 6)
|
||||
# define OHCI_USB_SUSPEND (3 << 6)
|
||||
|
||||
/*
|
||||
* HcCommandStatus (cmdstatus) register masks
|
||||
*/
|
||||
#define OHCI_HCR (1 << 0) /* host controller reset */
|
||||
#define OHCI_CLF (1 << 1) /* control list filled */
|
||||
#define OHCI_BLF (1 << 2) /* bulk list filled */
|
||||
#define OHCI_OCR (1 << 3) /* ownership change request */
|
||||
#define OHCI_SOC (3 << 16) /* scheduling overrun count */
|
||||
|
||||
/*
|
||||
* masks used with interrupt registers:
|
||||
* HcInterruptStatus (intrstatus)
|
||||
* HcInterruptEnable (intrenable)
|
||||
* HcInterruptDisable (intrdisable)
|
||||
*/
|
||||
#define OHCI_INTR_SO (1 << 0) /* scheduling overrun */
|
||||
#define OHCI_INTR_WDH (1 << 1) /* writeback of done_head */
|
||||
#define OHCI_INTR_SF (1 << 2) /* start frame */
|
||||
#define OHCI_INTR_RD (1 << 3) /* resume detect */
|
||||
#define OHCI_INTR_UE (1 << 4) /* unrecoverable error */
|
||||
#define OHCI_INTR_FNO (1 << 5) /* frame number overflow */
|
||||
#define OHCI_INTR_RHSC (1 << 6) /* root hub status change */
|
||||
#define OHCI_INTR_OC (1 << 30) /* ownership change */
|
||||
#define OHCI_INTR_MIE (1 << 31) /* master interrupt enable */
|
||||
|
||||
/* Virtual Root HUB */
|
||||
struct virt_root_hub {
|
||||
int devnum; /* Address of Root Hub endpoint */
|
||||
void *dev; /* was urb */
|
||||
void *int_addr;
|
||||
int send;
|
||||
int interval;
|
||||
};
|
||||
|
||||
/* USB HUB CONSTANTS (not OHCI-specific; see hub.h) */
|
||||
|
||||
/* destination of request */
|
||||
#define RH_INTERFACE 0x01
|
||||
#define RH_ENDPOINT 0x02
|
||||
#define RH_OTHER 0x03
|
||||
|
||||
#define RH_CLASS 0x20
|
||||
#define RH_VENDOR 0x40
|
||||
|
||||
/* Requests: bRequest << 8 | bmRequestType */
|
||||
#define RH_GET_STATUS 0x0080
|
||||
#define RH_CLEAR_FEATURE 0x0100
|
||||
#define RH_SET_FEATURE 0x0300
|
||||
#define RH_SET_ADDRESS 0x0500
|
||||
#define RH_GET_DESCRIPTOR 0x0680
|
||||
#define RH_SET_DESCRIPTOR 0x0700
|
||||
#define RH_GET_CONFIGURATION 0x0880
|
||||
#define RH_SET_CONFIGURATION 0x0900
|
||||
#define RH_GET_STATE 0x0280
|
||||
#define RH_GET_INTERFACE 0x0A80
|
||||
#define RH_SET_INTERFACE 0x0B00
|
||||
#define RH_SYNC_FRAME 0x0C80
|
||||
/* Our Vendor Specific Request */
|
||||
#define RH_SET_EP 0x2000
|
||||
|
||||
/* Hub port features */
|
||||
#define RH_PORT_CONNECTION 0x00
|
||||
#define RH_PORT_ENABLE 0x01
|
||||
#define RH_PORT_SUSPEND 0x02
|
||||
#define RH_PORT_OVER_CURRENT 0x03
|
||||
#define RH_PORT_RESET 0x04
|
||||
#define RH_PORT_POWER 0x08
|
||||
#define RH_PORT_LOW_SPEED 0x09
|
||||
|
||||
#define RH_C_PORT_CONNECTION 0x10
|
||||
#define RH_C_PORT_ENABLE 0x11
|
||||
#define RH_C_PORT_SUSPEND 0x12
|
||||
#define RH_C_PORT_OVER_CURRENT 0x13
|
||||
#define RH_C_PORT_RESET 0x14
|
||||
|
||||
/* Hub features */
|
||||
#define RH_C_HUB_LOCAL_POWER 0x00
|
||||
#define RH_C_HUB_OVER_CURRENT 0x01
|
||||
|
||||
#define RH_DEVICE_REMOTE_WAKEUP 0x00
|
||||
#define RH_ENDPOINT_STALL 0x01
|
||||
|
||||
#define RH_ACK 0x01
|
||||
#define RH_REQ_ERR -1
|
||||
#define RH_NACK 0x00
|
||||
|
||||
/* OHCI ROOT HUB REGISTER MASKS */
|
||||
|
||||
/* roothub.portstatus [i] bits */
|
||||
#define RH_PS_CCS 0x00000001 /* current connect status */
|
||||
#define RH_PS_PES 0x00000002 /* port enable status */
|
||||
#define RH_PS_PSS 0x00000004 /* port suspend status */
|
||||
#define RH_PS_POCI 0x00000008 /* port over current indicator */
|
||||
#define RH_PS_PRS 0x00000010 /* port reset status */
|
||||
#define RH_PS_PPS 0x00000100 /* port power status */
|
||||
#define RH_PS_LSDA 0x00000200 /* low speed device attached */
|
||||
#define RH_PS_CSC 0x00010000 /* connect status change */
|
||||
#define RH_PS_PESC 0x00020000 /* port enable status change */
|
||||
#define RH_PS_PSSC 0x00040000 /* port suspend status change */
|
||||
#define RH_PS_OCIC 0x00080000 /* over current indicator change */
|
||||
#define RH_PS_PRSC 0x00100000 /* port reset status change */
|
||||
|
||||
/* roothub.status bits */
|
||||
#define RH_HS_LPS 0x00000001 /* local power status */
|
||||
#define RH_HS_OCI 0x00000002 /* over current indicator */
|
||||
#define RH_HS_DRWE 0x00008000 /* device remote wakeup enable */
|
||||
#define RH_HS_LPSC 0x00010000 /* local power status change */
|
||||
#define RH_HS_OCIC 0x00020000 /* over current indicator change */
|
||||
#define RH_HS_CRWE 0x80000000 /* clear remote wakeup enable */
|
||||
|
||||
/* roothub.b masks */
|
||||
#define RH_B_DR 0x0000ffff /* device removable flags */
|
||||
#define RH_B_PPCM 0xffff0000 /* port power control mask */
|
||||
|
||||
/* roothub.a masks */
|
||||
#define RH_A_NDP (0xff << 0) /* number of downstream ports */
|
||||
#define RH_A_PSM (1 << 8) /* power switching mode */
|
||||
#define RH_A_NPS (1 << 9) /* no power switching */
|
||||
#define RH_A_DT (1 << 10) /* device type (mbz) */
|
||||
#define RH_A_OCPM (1 << 11) /* over current protection mode */
|
||||
#define RH_A_NOCP (1 << 12) /* no over current protection */
|
||||
#define RH_A_POTPGT (0xff << 24) /* power on to power good time */
|
||||
|
||||
/* urb */
|
||||
#define N_URB_TD 48
|
||||
typedef struct {
|
||||
ed_t *ed;
|
||||
__u16 length; /* number of tds associated with this request */
|
||||
__u16 td_cnt; /* number of tds already serviced */
|
||||
int state;
|
||||
unsigned long pipe;
|
||||
int actual_length;
|
||||
td_t *td[N_URB_TD]; /* list pointer to all corresponding TDs associated with this request */
|
||||
} urb_priv_t;
|
||||
#define URB_DEL 1
|
||||
|
||||
/*
|
||||
* This is the full ohci controller description
|
||||
*
|
||||
* Note how the "proper" USB information is just
|
||||
* a subset of what the full implementation needs. (Linus)
|
||||
*/
|
||||
|
||||
typedef struct ohci {
|
||||
struct ohci_hcca *hcca; /* hcca */
|
||||
/*dma_addr_t hcca_dma; */
|
||||
|
||||
int irq;
|
||||
int disabled; /* e.g. got a UE, we're hung */
|
||||
int sleeping;
|
||||
unsigned long flags; /* for HC bugs */
|
||||
|
||||
struct ohci_regs *regs; /* OHCI controller's memory */
|
||||
|
||||
ed_t *ed_rm_list[2]; /* lists of all endpoints to be removed */
|
||||
ed_t *ed_bulktail; /* last endpoint of bulk list */
|
||||
ed_t *ed_controltail; /* last endpoint of control list */
|
||||
int intrstatus;
|
||||
__u32 hc_control; /* copy of the hc control reg */
|
||||
struct usb_device *dev[32];
|
||||
struct virt_root_hub rh;
|
||||
|
||||
const char *slot_name;
|
||||
} ohci_t;
|
||||
|
||||
#define NUM_EDS 8 /* num of preallocated endpoint descriptors */
|
||||
|
||||
struct ohci_device {
|
||||
ed_t ed[NUM_EDS];
|
||||
int ed_cnt;
|
||||
};
|
||||
|
||||
/* hcd */
|
||||
/* endpoint */
|
||||
static int ep_link(ohci_t * ohci, ed_t * ed);
|
||||
static int ep_unlink(ohci_t * ohci, ed_t * ed);
|
||||
static ed_t *ep_add_ed(struct usb_device *usb_dev, unsigned long pipe);
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
/* we need more TDs than EDs */
|
||||
#define NUM_TD 64
|
||||
|
||||
/* +1 so we can align the storage */
|
||||
td_t gtd[NUM_TD + 1];
|
||||
/* pointers to aligned storage */
|
||||
td_t *ptd;
|
||||
|
||||
/* TDs ... */
|
||||
static inline struct td *td_alloc(struct usb_device *usb_dev)
|
||||
{
|
||||
int i;
|
||||
struct td *td;
|
||||
|
||||
td = NULL;
|
||||
for (i = 0; i < NUM_TD; i++) {
|
||||
if (ptd[i].usb_dev == NULL) {
|
||||
td = &ptd[i];
|
||||
td->usb_dev = usb_dev;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return td;
|
||||
}
|
||||
|
||||
static inline void ed_free(struct ed *ed)
|
||||
{
|
||||
ed->usb_dev = NULL;
|
||||
}
|
|
@ -1,88 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2008
|
||||
* Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda@gmail.com
|
||||
* This work has been supported by: QTechnology http://qtec.com/
|
||||
* Based on interrupts.c Wolfgang Denk-DENX Software Engineering-wd@denx.de
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
#include <common.h>
|
||||
#include <watchdog.h>
|
||||
#include <command.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/interrupt.h>
|
||||
#include <asm/ppc4xx.h>
|
||||
#include <ppc_asm.tmpl>
|
||||
#include <asm/io.h>
|
||||
#include <asm/xilinx_irq.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
void pic_enable(void)
|
||||
{
|
||||
debug("Xilinx PIC at 0x%8x\n", intc);
|
||||
|
||||
/*
|
||||
* Disable all external interrupts until they are
|
||||
* explicitly requested.
|
||||
*/
|
||||
out_be32((u32 *) IER, 0);
|
||||
|
||||
/* Acknowledge any pending interrupts just in case. */
|
||||
out_be32((u32 *) IAR, 0xffffffff);
|
||||
|
||||
/* Turn on the Master Enable. */
|
||||
out_be32((u32 *) MER, 0x3UL);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
int xilinx_pic_irq_get(void)
|
||||
{
|
||||
u32 irq;
|
||||
irq = in_be32((u32 *) IVR);
|
||||
|
||||
/* If no interrupt is pending then all bits of the IVR are set to 1. As
|
||||
* the IVR is as many bits wide as numbers of inputs are available.
|
||||
* Therefore, if all bits of the IVR are set to one, its content will
|
||||
* be bigger than XPAR_INTC_MAX_NUM_INTR_INPUTS.
|
||||
*/
|
||||
if (irq >= XPAR_INTC_MAX_NUM_INTR_INPUTS)
|
||||
irq = -1; /* report no pending interrupt. */
|
||||
|
||||
debug("get_irq: %d\n", irq);
|
||||
return (irq);
|
||||
}
|
||||
|
||||
void pic_irq_enable(unsigned int irq)
|
||||
{
|
||||
u32 mask = IRQ_MASK(irq);
|
||||
debug("enable: %d\n", irq);
|
||||
out_be32((u32 *) SIE, mask);
|
||||
}
|
||||
|
||||
void pic_irq_disable(unsigned int irq)
|
||||
{
|
||||
u32 mask = IRQ_MASK(irq);
|
||||
debug("disable: %d\n", irq);
|
||||
out_be32((u32 *) CIE, mask);
|
||||
}
|
||||
|
||||
void pic_irq_ack(unsigned int irq)
|
||||
{
|
||||
u32 mask = IRQ_MASK(irq);
|
||||
debug("ack: %d\n", irq);
|
||||
out_be32((u32 *) IAR, mask);
|
||||
}
|
||||
|
||||
void external_interrupt(struct pt_regs *regs)
|
||||
{
|
||||
int irq;
|
||||
|
||||
irq = xilinx_pic_irq_get();
|
||||
if (irq < 0)
|
||||
return;
|
||||
|
||||
interrupt_run_handler(irq);
|
||||
|
||||
return;
|
||||
}
|
1
arch/powerpc/dts/.gitignore
vendored
1
arch/powerpc/dts/.gitignore
vendored
|
@ -1 +0,0 @@
|
|||
*.dtb
|
|
@ -1,17 +0,0 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
dtb-$(CONFIG_TARGET_CANYONLANDS) += arches.dtb canyonlands.dtb glacier.dtb
|
||||
dtb-$(CONFIG_TARGET_XILINX_PPC440_GENERIC) += xilinx-ppc440-generic.dtb
|
||||
dtb-$(CONFIG_TARGET_XILINX_PPC405_GENERIC) += xilinx-ppc405-generic.dtb
|
||||
|
||||
targets += $(dtb-y)
|
||||
|
||||
DTC_FLAGS += -R 4 -p 0x1000
|
||||
|
||||
PHONY += dtbs
|
||||
dtbs: $(addprefix $(obj)/, $(dtb-y))
|
||||
@:
|
||||
|
||||
clean-files := *.dtb
|
|
@ -1,339 +0,0 @@
|
|||
/*
|
||||
* Device Tree Source for AMCC Arches (dual 460GT board)
|
||||
*
|
||||
* (C) Copyright 2008 Applied Micro Circuits Corporation
|
||||
* Victor Gallardo <vgallardo@amcc.com>
|
||||
* Adam Graham <agraham@amcc.com>
|
||||
*
|
||||
* Based on the glacier.dts file
|
||||
* Stefan Roese <sr@denx.de>
|
||||
* Copyright 2008 DENX Software Engineering
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
/ {
|
||||
#address-cells = <2>;
|
||||
#size-cells = <1>;
|
||||
model = "amcc,arches";
|
||||
compatible = "amcc,arches";
|
||||
dcr-parent = <&{/cpus/cpu@0}>;
|
||||
|
||||
aliases {
|
||||
ethernet0 = &EMAC0;
|
||||
ethernet1 = &EMAC1;
|
||||
ethernet2 = &EMAC2;
|
||||
serial0 = &UART0;
|
||||
};
|
||||
|
||||
cpus {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
cpu@0 {
|
||||
device_type = "cpu";
|
||||
model = "PowerPC,460GT";
|
||||
reg = <0x00000000>;
|
||||
clock-frequency = <0>; /* Filled in by U-Boot */
|
||||
timebase-frequency = <0>; /* Filled in by U-Boot */
|
||||
i-cache-line-size = <32>;
|
||||
d-cache-line-size = <32>;
|
||||
i-cache-size = <32768>;
|
||||
d-cache-size = <32768>;
|
||||
dcr-controller;
|
||||
dcr-access-method = "native";
|
||||
next-level-cache = <&L2C0>;
|
||||
};
|
||||
};
|
||||
|
||||
memory {
|
||||
device_type = "memory";
|
||||
reg = <0x00000000 0x00000000 0x00000000>; /* Filled in by U-Boot */
|
||||
};
|
||||
|
||||
UIC0: interrupt-controller0 {
|
||||
compatible = "ibm,uic-460gt","ibm,uic";
|
||||
interrupt-controller;
|
||||
cell-index = <0>;
|
||||
dcr-reg = <0x0c0 0x009>;
|
||||
#address-cells = <0>;
|
||||
#size-cells = <0>;
|
||||
#interrupt-cells = <2>;
|
||||
};
|
||||
|
||||
UIC1: interrupt-controller1 {
|
||||
compatible = "ibm,uic-460gt","ibm,uic";
|
||||
interrupt-controller;
|
||||
cell-index = <1>;
|
||||
dcr-reg = <0x0d0 0x009>;
|
||||
#address-cells = <0>;
|
||||
#size-cells = <0>;
|
||||
#interrupt-cells = <2>;
|
||||
interrupts = <0x1e 0x4 0x1f 0x4>; /* cascade */
|
||||
interrupt-parent = <&UIC0>;
|
||||
};
|
||||
|
||||
UIC2: interrupt-controller2 {
|
||||
compatible = "ibm,uic-460gt","ibm,uic";
|
||||
interrupt-controller;
|
||||
cell-index = <2>;
|
||||
dcr-reg = <0x0e0 0x009>;
|
||||
#address-cells = <0>;
|
||||
#size-cells = <0>;
|
||||
#interrupt-cells = <2>;
|
||||
interrupts = <0xa 0x4 0xb 0x4>; /* cascade */
|
||||
interrupt-parent = <&UIC0>;
|
||||
};
|
||||
|
||||
UIC3: interrupt-controller3 {
|
||||
compatible = "ibm,uic-460gt","ibm,uic";
|
||||
interrupt-controller;
|
||||
cell-index = <3>;
|
||||
dcr-reg = <0x0f0 0x009>;
|
||||
#address-cells = <0>;
|
||||
#size-cells = <0>;
|
||||
#interrupt-cells = <2>;
|
||||
interrupts = <0x10 0x4 0x11 0x4>; /* cascade */
|
||||
interrupt-parent = <&UIC0>;
|
||||
};
|
||||
|
||||
SDR0: sdr {
|
||||
compatible = "ibm,sdr-460gt";
|
||||
dcr-reg = <0x00e 0x002>;
|
||||
};
|
||||
|
||||
CPR0: cpr {
|
||||
compatible = "ibm,cpr-460gt";
|
||||
dcr-reg = <0x00c 0x002>;
|
||||
};
|
||||
|
||||
L2C0: l2c {
|
||||
compatible = "ibm,l2-cache-460gt", "ibm,l2-cache";
|
||||
dcr-reg = <0x020 0x008 /* Internal SRAM DCR's */
|
||||
0x030 0x008>; /* L2 cache DCR's */
|
||||
cache-line-size = <32>; /* 32 bytes */
|
||||
cache-size = <262144>; /* L2, 256K */
|
||||
interrupt-parent = <&UIC1>;
|
||||
interrupts = <11 1>;
|
||||
};
|
||||
|
||||
plb {
|
||||
compatible = "ibm,plb-460gt", "ibm,plb4";
|
||||
#address-cells = <2>;
|
||||
#size-cells = <1>;
|
||||
ranges;
|
||||
clock-frequency = <0>; /* Filled in by U-Boot */
|
||||
|
||||
SDRAM0: sdram {
|
||||
compatible = "ibm,sdram-460gt", "ibm,sdram-405gp";
|
||||
dcr-reg = <0x010 0x002>;
|
||||
};
|
||||
|
||||
CRYPTO: crypto@180000 {
|
||||
compatible = "amcc,ppc460gt-crypto", "amcc,ppc4xx-crypto";
|
||||
reg = <4 0x00180000 0x80400>;
|
||||
interrupt-parent = <&UIC0>;
|
||||
interrupts = <0x1d 0x4>;
|
||||
};
|
||||
|
||||
MAL0: mcmal {
|
||||
compatible = "ibm,mcmal-460gt", "ibm,mcmal2";
|
||||
dcr-reg = <0x180 0x062>;
|
||||
num-tx-chans = <3>;
|
||||
num-rx-chans = <24>;
|
||||
#address-cells = <0>;
|
||||
#size-cells = <0>;
|
||||
interrupt-parent = <&UIC2>;
|
||||
interrupts = < /*TXEOB*/ 0x6 0x4
|
||||
/*RXEOB*/ 0x7 0x4
|
||||
/*SERR*/ 0x3 0x4
|
||||
/*TXDE*/ 0x4 0x4
|
||||
/*RXDE*/ 0x5 0x4>;
|
||||
desc-base-addr-high = <0x8>;
|
||||
};
|
||||
|
||||
POB0: opb {
|
||||
compatible = "ibm,opb-460gt", "ibm,opb";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges = <0xb0000000 0x00000004 0xb0000000 0x50000000>;
|
||||
clock-frequency = <0>; /* Filled in by U-Boot */
|
||||
|
||||
EBC0: ebc {
|
||||
compatible = "ibm,ebc-460gt", "ibm,ebc";
|
||||
dcr-reg = <0x012 0x002>;
|
||||
#address-cells = <2>;
|
||||
#size-cells = <1>;
|
||||
clock-frequency = <0>; /* Filled in by U-Boot */
|
||||
/* ranges property is supplied by U-Boot */
|
||||
interrupts = <0x6 0x4>;
|
||||
interrupt-parent = <&UIC1>;
|
||||
|
||||
nor_flash@0,0 {
|
||||
compatible = "amd,s29gl256n", "cfi-flash";
|
||||
bank-width = <2>;
|
||||
reg = <0x00000000 0x00000000 0x02000000>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
partition@0 {
|
||||
label = "kernel";
|
||||
reg = <0x00000000 0x001e0000>;
|
||||
};
|
||||
partition@1e0000 {
|
||||
label = "dtb";
|
||||
reg = <0x001e0000 0x00020000>;
|
||||
};
|
||||
partition@200000 {
|
||||
label = "root";
|
||||
reg = <0x00200000 0x00200000>;
|
||||
};
|
||||
partition@400000 {
|
||||
label = "user";
|
||||
reg = <0x00400000 0x01b60000>;
|
||||
};
|
||||
partition@1f60000 {
|
||||
label = "env";
|
||||
reg = <0x01f60000 0x00040000>;
|
||||
};
|
||||
partition@1fa0000 {
|
||||
label = "u-boot";
|
||||
reg = <0x01fa0000 0x00060000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
UART0: serial@ef600300 {
|
||||
device_type = "serial";
|
||||
compatible = "ns16550";
|
||||
reg = <0xef600300 0x00000008>;
|
||||
virtual-reg = <0xef600300>;
|
||||
clock-frequency = <0>; /* Filled in by U-Boot */
|
||||
current-speed = <0>; /* Filled in by U-Boot */
|
||||
interrupt-parent = <&UIC1>;
|
||||
interrupts = <0x1 0x4>;
|
||||
};
|
||||
|
||||
IIC0: i2c@ef600700 {
|
||||
compatible = "ibm,iic-460gt", "ibm,iic";
|
||||
reg = <0xef600700 0x00000014>;
|
||||
interrupt-parent = <&UIC0>;
|
||||
interrupts = <0x2 0x4>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
sttm@4a {
|
||||
compatible = "ad,ad7414";
|
||||
reg = <0x4a>;
|
||||
interrupt-parent = <&UIC1>;
|
||||
interrupts = <0x0 0x8>;
|
||||
};
|
||||
};
|
||||
|
||||
IIC1: i2c@ef600800 {
|
||||
compatible = "ibm,iic-460gt", "ibm,iic";
|
||||
reg = <0xef600800 0x00000014>;
|
||||
interrupt-parent = <&UIC0>;
|
||||
interrupts = <0x3 0x4>;
|
||||
};
|
||||
|
||||
TAH0: emac-tah@ef601350 {
|
||||
compatible = "ibm,tah-460gt", "ibm,tah";
|
||||
reg = <0xef601350 0x00000030>;
|
||||
};
|
||||
|
||||
TAH1: emac-tah@ef601450 {
|
||||
compatible = "ibm,tah-460gt", "ibm,tah";
|
||||
reg = <0xef601450 0x00000030>;
|
||||
};
|
||||
|
||||
EMAC0: ethernet@ef600e00 {
|
||||
device_type = "network";
|
||||
compatible = "ibm,emac-460gt", "ibm,emac4sync";
|
||||
interrupt-parent = <&EMAC0>;
|
||||
interrupts = <0x0 0x1>;
|
||||
#interrupt-cells = <1>;
|
||||
#address-cells = <0>;
|
||||
#size-cells = <0>;
|
||||
interrupt-map = </*Status*/ 0x0 &UIC2 0x10 0x4
|
||||
/*Wake*/ 0x1 &UIC2 0x14 0x4>;
|
||||
reg = <0xef600e00 0x000000c4>;
|
||||
local-mac-address = [000000000000]; /* Filled in by U-Boot */
|
||||
mal-device = <&MAL0>;
|
||||
mal-tx-channel = <0>;
|
||||
mal-rx-channel = <0>;
|
||||
cell-index = <0>;
|
||||
max-frame-size = <9000>;
|
||||
rx-fifo-size = <4096>;
|
||||
tx-fifo-size = <2048>;
|
||||
rx-fifo-size-gige = <16384>;
|
||||
phy-mode = "sgmii";
|
||||
phy-map = <0xffffffff>;
|
||||
gpcs-address = <0x0000000a>;
|
||||
tah-device = <&TAH0>;
|
||||
tah-channel = <0>;
|
||||
has-inverted-stacr-oc;
|
||||
has-new-stacr-staopc;
|
||||
};
|
||||
|
||||
EMAC1: ethernet@ef600f00 {
|
||||
device_type = "network";
|
||||
compatible = "ibm,emac-460gt", "ibm,emac4sync";
|
||||
interrupt-parent = <&EMAC1>;
|
||||
interrupts = <0x0 0x1>;
|
||||
#interrupt-cells = <1>;
|
||||
#address-cells = <0>;
|
||||
#size-cells = <0>;
|
||||
interrupt-map = </*Status*/ 0x0 &UIC2 0x11 0x4
|
||||
/*Wake*/ 0x1 &UIC2 0x15 0x4>;
|
||||
reg = <0xef600f00 0x000000c4>;
|
||||
local-mac-address = [000000000000]; /* Filled in by U-Boot */
|
||||
mal-device = <&MAL0>;
|
||||
mal-tx-channel = <1>;
|
||||
mal-rx-channel = <8>;
|
||||
cell-index = <1>;
|
||||
max-frame-size = <9000>;
|
||||
rx-fifo-size = <4096>;
|
||||
tx-fifo-size = <2048>;
|
||||
rx-fifo-size-gige = <16384>;
|
||||
phy-mode = "sgmii";
|
||||
phy-map = <0x00000000>;
|
||||
gpcs-address = <0x0000000b>;
|
||||
tah-device = <&TAH1>;
|
||||
tah-channel = <1>;
|
||||
has-inverted-stacr-oc;
|
||||
has-new-stacr-staopc;
|
||||
mdio-device = <&EMAC0>;
|
||||
};
|
||||
|
||||
EMAC2: ethernet@ef601100 {
|
||||
device_type = "network";
|
||||
compatible = "ibm,emac-460gt", "ibm,emac4sync";
|
||||
interrupt-parent = <&EMAC2>;
|
||||
interrupts = <0x0 0x1>;
|
||||
#interrupt-cells = <1>;
|
||||
#address-cells = <0>;
|
||||
#size-cells = <0>;
|
||||
interrupt-map = </*Status*/ 0x0 &UIC2 0x12 0x4
|
||||
/*Wake*/ 0x1 &UIC2 0x16 0x4>;
|
||||
reg = <0xef601100 0x000000c4>;
|
||||
local-mac-address = [000000000000]; /* Filled in by U-Boot */
|
||||
mal-device = <&MAL0>;
|
||||
mal-tx-channel = <2>;
|
||||
mal-rx-channel = <16>;
|
||||
cell-index = <2>;
|
||||
max-frame-size = <9000>;
|
||||
rx-fifo-size = <4096>;
|
||||
tx-fifo-size = <2048>;
|
||||
rx-fifo-size-gige = <16384>;
|
||||
tx-fifo-size-gige = <16384>; /* emac2&3 only */
|
||||
phy-mode = "sgmii";
|
||||
phy-map = <0x00000001>;
|
||||
gpcs-address = <0x0000000C>;
|
||||
has-inverted-stacr-oc;
|
||||
has-new-stacr-staopc;
|
||||
mdio-device = <&EMAC0>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
|
@ -1,561 +0,0 @@
|
|||
/*
|
||||
* Device Tree Source for AMCC Canyonlands (460EX)
|
||||
*
|
||||
* Copyright 2008-2009 DENX Software Engineering, Stefan Roese <sr@denx.de>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
/ {
|
||||
#address-cells = <2>;
|
||||
#size-cells = <1>;
|
||||
model = "amcc,canyonlands";
|
||||
compatible = "amcc,canyonlands";
|
||||
dcr-parent = <&{/cpus/cpu@0}>;
|
||||
|
||||
aliases {
|
||||
ethernet0 = &EMAC0;
|
||||
ethernet1 = &EMAC1;
|
||||
serial0 = &UART0;
|
||||
serial1 = &UART1;
|
||||
};
|
||||
|
||||
chosen {
|
||||
stdout-path = &UART0;
|
||||
};
|
||||
|
||||
cpus {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
cpu@0 {
|
||||
device_type = "cpu";
|
||||
model = "PowerPC,460EX";
|
||||
reg = <0x00000000>;
|
||||
clock-frequency = <0>; /* Filled in by U-Boot */
|
||||
timebase-frequency = <0>; /* Filled in by U-Boot */
|
||||
i-cache-line-size = <32>;
|
||||
d-cache-line-size = <32>;
|
||||
i-cache-size = <32768>;
|
||||
d-cache-size = <32768>;
|
||||
dcr-controller;
|
||||
dcr-access-method = "native";
|
||||
next-level-cache = <&L2C0>;
|
||||
};
|
||||
};
|
||||
|
||||
memory {
|
||||
device_type = "memory";
|
||||
reg = <0x00000000 0x00000000 0x00000000>; /* Filled in by U-Boot */
|
||||
};
|
||||
|
||||
UIC0: interrupt-controller0 {
|
||||
compatible = "ibm,uic-460ex","ibm,uic";
|
||||
interrupt-controller;
|
||||
cell-index = <0>;
|
||||
dcr-reg = <0x0c0 0x009>;
|
||||
#address-cells = <0>;
|
||||
#size-cells = <0>;
|
||||
#interrupt-cells = <2>;
|
||||
};
|
||||
|
||||
UIC1: interrupt-controller1 {
|
||||
compatible = "ibm,uic-460ex","ibm,uic";
|
||||
interrupt-controller;
|
||||
cell-index = <1>;
|
||||
dcr-reg = <0x0d0 0x009>;
|
||||
#address-cells = <0>;
|
||||
#size-cells = <0>;
|
||||
#interrupt-cells = <2>;
|
||||
interrupts = <0x1e 0x4 0x1f 0x4>; /* cascade */
|
||||
interrupt-parent = <&UIC0>;
|
||||
};
|
||||
|
||||
UIC2: interrupt-controller2 {
|
||||
compatible = "ibm,uic-460ex","ibm,uic";
|
||||
interrupt-controller;
|
||||
cell-index = <2>;
|
||||
dcr-reg = <0x0e0 0x009>;
|
||||
#address-cells = <0>;
|
||||
#size-cells = <0>;
|
||||
#interrupt-cells = <2>;
|
||||
interrupts = <0xa 0x4 0xb 0x4>; /* cascade */
|
||||
interrupt-parent = <&UIC0>;
|
||||
};
|
||||
|
||||
UIC3: interrupt-controller3 {
|
||||
compatible = "ibm,uic-460ex","ibm,uic";
|
||||
interrupt-controller;
|
||||
cell-index = <3>;
|
||||
dcr-reg = <0x0f0 0x009>;
|
||||
#address-cells = <0>;
|
||||
#size-cells = <0>;
|
||||
#interrupt-cells = <2>;
|
||||
interrupts = <0x10 0x4 0x11 0x4>; /* cascade */
|
||||
interrupt-parent = <&UIC0>;
|
||||
};
|
||||
|
||||
SDR0: sdr {
|
||||
compatible = "ibm,sdr-460ex";
|
||||
dcr-reg = <0x00e 0x002>;
|
||||
};
|
||||
|
||||
CPR0: cpr {
|
||||
compatible = "ibm,cpr-460ex";
|
||||
dcr-reg = <0x00c 0x002>;
|
||||
};
|
||||
|
||||
CPM0: cpm {
|
||||
compatible = "ibm,cpm";
|
||||
dcr-access-method = "native";
|
||||
dcr-reg = <0x160 0x003>;
|
||||
unused-units = <0x00000100>;
|
||||
idle-doze = <0x02000000>;
|
||||
standby = <0xfeff791d>;
|
||||
};
|
||||
|
||||
L2C0: l2c {
|
||||
compatible = "ibm,l2-cache-460ex", "ibm,l2-cache";
|
||||
dcr-reg = <0x020 0x008 /* Internal SRAM DCR's */
|
||||
0x030 0x008>; /* L2 cache DCR's */
|
||||
cache-line-size = <32>; /* 32 bytes */
|
||||
cache-size = <262144>; /* L2, 256K */
|
||||
interrupt-parent = <&UIC1>;
|
||||
interrupts = <11 1>;
|
||||
};
|
||||
|
||||
plb {
|
||||
compatible = "ibm,plb-460ex", "ibm,plb4";
|
||||
#address-cells = <2>;
|
||||
#size-cells = <1>;
|
||||
ranges;
|
||||
clock-frequency = <0>; /* Filled in by U-Boot */
|
||||
|
||||
SDRAM0: sdram {
|
||||
compatible = "ibm,sdram-460ex", "ibm,sdram-405gp";
|
||||
dcr-reg = <0x010 0x002>;
|
||||
};
|
||||
|
||||
CRYPTO: crypto@180000 {
|
||||
compatible = "amcc,ppc460ex-crypto", "amcc,ppc4xx-crypto";
|
||||
reg = <4 0x00180000 0x80400>;
|
||||
interrupt-parent = <&UIC0>;
|
||||
interrupts = <0x1d 0x4>;
|
||||
};
|
||||
|
||||
HWRNG: hwrng@110000 {
|
||||
compatible = "amcc,ppc460ex-rng", "ppc4xx-rng";
|
||||
reg = <4 0x00110000 0x50>;
|
||||
};
|
||||
|
||||
MAL0: mcmal {
|
||||
compatible = "ibm,mcmal-460ex", "ibm,mcmal2";
|
||||
dcr-reg = <0x180 0x062>;
|
||||
num-tx-chans = <2>;
|
||||
num-rx-chans = <16>;
|
||||
#address-cells = <0>;
|
||||
#size-cells = <0>;
|
||||
interrupt-parent = <&UIC2>;
|
||||
interrupts = < /*TXEOB*/ 0x6 0x4
|
||||
/*RXEOB*/ 0x7 0x4
|
||||
/*SERR*/ 0x3 0x4
|
||||
/*TXDE*/ 0x4 0x4
|
||||
/*RXDE*/ 0x5 0x4>;
|
||||
};
|
||||
|
||||
USB0: ehci@bffd0400 {
|
||||
compatible = "ibm,usb-ehci-460ex", "usb-ehci";
|
||||
interrupt-parent = <&UIC2>;
|
||||
interrupts = <0x1d 4>;
|
||||
reg = <4 0xbffd0400 0x90 4 0xbffd0490 0x70>;
|
||||
};
|
||||
|
||||
USB1: usb@bffd0000 {
|
||||
compatible = "ohci-le";
|
||||
reg = <4 0xbffd0000 0x60>;
|
||||
interrupt-parent = <&UIC2>;
|
||||
interrupts = <0x1e 4>;
|
||||
};
|
||||
|
||||
USBOTG0: usbotg@bff80000 {
|
||||
compatible = "amcc,dwc-otg";
|
||||
reg = <0x4 0xbff80000 0x10000>;
|
||||
interrupt-parent = <&USBOTG0>;
|
||||
#interrupt-cells = <1>;
|
||||
#address-cells = <0>;
|
||||
#size-cells = <0>;
|
||||
interrupts = <0x0 0x1 0x2>;
|
||||
interrupt-map = </* USB-OTG */ 0x0 &UIC2 0x1c 0x4
|
||||
/* HIGH-POWER */ 0x1 &UIC1 0x1a 0x8
|
||||
/* DMA */ 0x2 &UIC0 0xc 0x4>;
|
||||
};
|
||||
|
||||
SATA0: sata@bffd1000 {
|
||||
compatible = "amcc,sata-460ex";
|
||||
reg = <4 0xbffd1000 0x800 4 0xbffd0800 0x400>;
|
||||
interrupt-parent = <&UIC3>;
|
||||
interrupts = <0x0 0x4 /* SATA */
|
||||
0x5 0x4>; /* AHBDMA */
|
||||
};
|
||||
|
||||
POB0: opb {
|
||||
compatible = "ibm,opb-460ex", "ibm,opb";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges = <0xb0000000 0x00000004 0xb0000000 0x50000000>;
|
||||
clock-frequency = <0>; /* Filled in by U-Boot */
|
||||
|
||||
EBC0: ebc {
|
||||
compatible = "ibm,ebc-460ex", "ibm,ebc";
|
||||
dcr-reg = <0x012 0x002>;
|
||||
#address-cells = <2>;
|
||||
#size-cells = <1>;
|
||||
clock-frequency = <0>; /* Filled in by U-Boot */
|
||||
/* ranges property is supplied by U-Boot */
|
||||
interrupts = <0x6 0x4>;
|
||||
interrupt-parent = <&UIC1>;
|
||||
|
||||
nor_flash@0,0 {
|
||||
compatible = "amd,s29gl512n", "cfi-flash";
|
||||
bank-width = <2>;
|
||||
reg = <0x00000000 0x00000000 0x04000000>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
partition@0 {
|
||||
label = "kernel";
|
||||
reg = <0x00000000 0x001e0000>;
|
||||
};
|
||||
partition@1e0000 {
|
||||
label = "dtb";
|
||||
reg = <0x001e0000 0x00020000>;
|
||||
};
|
||||
partition@200000 {
|
||||
label = "ramdisk";
|
||||
reg = <0x00200000 0x01400000>;
|
||||
};
|
||||
partition@1600000 {
|
||||
label = "jffs2";
|
||||
reg = <0x01600000 0x00400000>;
|
||||
};
|
||||
partition@1a00000 {
|
||||
label = "user";
|
||||
reg = <0x01a00000 0x02560000>;
|
||||
};
|
||||
partition@3f60000 {
|
||||
label = "env";
|
||||
reg = <0x03f60000 0x00040000>;
|
||||
};
|
||||
partition@3fa0000 {
|
||||
label = "u-boot";
|
||||
reg = <0x03fa0000 0x00060000>;
|
||||
};
|
||||
};
|
||||
|
||||
cpld@2,0 {
|
||||
compatible = "amcc,ppc460ex-bcsr";
|
||||
reg = <2 0x0 0x9>;
|
||||
};
|
||||
|
||||
ndfc@3,0 {
|
||||
compatible = "ibm,ndfc";
|
||||
reg = <0x00000003 0x00000000 0x00002000>;
|
||||
ccr = <0x00001000>;
|
||||
bank-settings = <0x80002222>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
nand {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "u-boot";
|
||||
reg = <0x00000000 0x00100000>;
|
||||
};
|
||||
partition@100000 {
|
||||
label = "user";
|
||||
reg = <0x00000000 0x03f00000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
UART0: serial@ef600300 {
|
||||
device_type = "serial";
|
||||
reg-shift = <0>;
|
||||
compatible = "ns16550";
|
||||
reg = <0xef600300 0x00000008>;
|
||||
virtual-reg = <0xef600300>;
|
||||
clock-frequency = <0>; /* Filled in by U-Boot */
|
||||
current-speed = <0>; /* Filled in by U-Boot */
|
||||
interrupt-parent = <&UIC1>;
|
||||
interrupts = <0x1 0x4>;
|
||||
};
|
||||
|
||||
UART1: serial@ef600400 {
|
||||
device_type = "serial";
|
||||
reg-shift = <0>;
|
||||
compatible = "ns16550";
|
||||
reg = <0xef600400 0x00000008>;
|
||||
virtual-reg = <0xef600400>;
|
||||
clock-frequency = <0>; /* Filled in by U-Boot */
|
||||
current-speed = <0>; /* Filled in by U-Boot */
|
||||
interrupt-parent = <&UIC0>;
|
||||
interrupts = <0x1 0x4>;
|
||||
};
|
||||
|
||||
IIC0: i2c@ef600700 {
|
||||
compatible = "ibm,iic-460ex", "ibm,iic";
|
||||
reg = <0xef600700 0x00000014>;
|
||||
interrupt-parent = <&UIC0>;
|
||||
interrupts = <0x2 0x4>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
rtc@68 {
|
||||
compatible = "stm,m41t80";
|
||||
reg = <0x68>;
|
||||
interrupt-parent = <&UIC2>;
|
||||
interrupts = <0x19 0x8>;
|
||||
};
|
||||
sttm@48 {
|
||||
compatible = "ad,ad7414";
|
||||
reg = <0x48>;
|
||||
interrupt-parent = <&UIC1>;
|
||||
interrupts = <0x14 0x8>;
|
||||
};
|
||||
};
|
||||
|
||||
IIC1: i2c@ef600800 {
|
||||
compatible = "ibm,iic-460ex", "ibm,iic";
|
||||
reg = <0xef600800 0x00000014>;
|
||||
interrupt-parent = <&UIC0>;
|
||||
interrupts = <0x3 0x4>;
|
||||
};
|
||||
|
||||
GPIO0: gpio@ef600b00 {
|
||||
compatible = "ibm,ppc4xx-gpio";
|
||||
reg = <0xef600b00 0x00000048>;
|
||||
gpio-controller;
|
||||
};
|
||||
|
||||
ZMII0: emac-zmii@ef600d00 {
|
||||
compatible = "ibm,zmii-460ex", "ibm,zmii";
|
||||
reg = <0xef600d00 0x0000000c>;
|
||||
};
|
||||
|
||||
RGMII0: emac-rgmii@ef601500 {
|
||||
compatible = "ibm,rgmii-460ex", "ibm,rgmii";
|
||||
reg = <0xef601500 0x00000008>;
|
||||
has-mdio;
|
||||
};
|
||||
|
||||
TAH0: emac-tah@ef601350 {
|
||||
compatible = "ibm,tah-460ex", "ibm,tah";
|
||||
reg = <0xef601350 0x00000030>;
|
||||
};
|
||||
|
||||
TAH1: emac-tah@ef601450 {
|
||||
compatible = "ibm,tah-460ex", "ibm,tah";
|
||||
reg = <0xef601450 0x00000030>;
|
||||
};
|
||||
|
||||
EMAC0: ethernet@ef600e00 {
|
||||
device_type = "network";
|
||||
compatible = "ibm,emac-460ex", "ibm,emac4sync";
|
||||
interrupt-parent = <&EMAC0>;
|
||||
interrupts = <0x0 0x1>;
|
||||
#interrupt-cells = <1>;
|
||||
#address-cells = <0>;
|
||||
#size-cells = <0>;
|
||||
interrupt-map = </*Status*/ 0x0 &UIC2 0x10 0x4
|
||||
/*Wake*/ 0x1 &UIC2 0x14 0x4>;
|
||||
reg = <0xef600e00 0x000000c4>;
|
||||
local-mac-address = [000000000000]; /* Filled in by U-Boot */
|
||||
mal-device = <&MAL0>;
|
||||
mal-tx-channel = <0>;
|
||||
mal-rx-channel = <0>;
|
||||
cell-index = <0>;
|
||||
max-frame-size = <9000>;
|
||||
rx-fifo-size = <4096>;
|
||||
tx-fifo-size = <2048>;
|
||||
rx-fifo-size-gige = <16384>;
|
||||
phy-mode = "rgmii";
|
||||
phy-map = <0x00000000>;
|
||||
rgmii-device = <&RGMII0>;
|
||||
rgmii-channel = <0>;
|
||||
tah-device = <&TAH0>;
|
||||
tah-channel = <0>;
|
||||
has-inverted-stacr-oc;
|
||||
has-new-stacr-staopc;
|
||||
};
|
||||
|
||||
EMAC1: ethernet@ef600f00 {
|
||||
device_type = "network";
|
||||
compatible = "ibm,emac-460ex", "ibm,emac4sync";
|
||||
interrupt-parent = <&EMAC1>;
|
||||
interrupts = <0x0 0x1>;
|
||||
#interrupt-cells = <1>;
|
||||
#address-cells = <0>;
|
||||
#size-cells = <0>;
|
||||
interrupt-map = </*Status*/ 0x0 &UIC2 0x11 0x4
|
||||
/*Wake*/ 0x1 &UIC2 0x15 0x4>;
|
||||
reg = <0xef600f00 0x000000c4>;
|
||||
local-mac-address = [000000000000]; /* Filled in by U-Boot */
|
||||
mal-device = <&MAL0>;
|
||||
mal-tx-channel = <1>;
|
||||
mal-rx-channel = <8>;
|
||||
cell-index = <1>;
|
||||
max-frame-size = <9000>;
|
||||
rx-fifo-size = <4096>;
|
||||
tx-fifo-size = <2048>;
|
||||
rx-fifo-size-gige = <16384>;
|
||||
phy-mode = "rgmii";
|
||||
phy-map = <0x00000000>;
|
||||
rgmii-device = <&RGMII0>;
|
||||
rgmii-channel = <1>;
|
||||
tah-device = <&TAH1>;
|
||||
tah-channel = <1>;
|
||||
has-inverted-stacr-oc;
|
||||
has-new-stacr-staopc;
|
||||
mdio-device = <&EMAC0>;
|
||||
};
|
||||
};
|
||||
|
||||
PCIX0: pci@c0ec00000 {
|
||||
device_type = "pci";
|
||||
#interrupt-cells = <1>;
|
||||
#size-cells = <2>;
|
||||
#address-cells = <3>;
|
||||
compatible = "ibm,plb-pcix-460ex", "ibm,plb-pcix";
|
||||
primary;
|
||||
large-inbound-windows;
|
||||
enable-msi-hole;
|
||||
reg = <0x0000000c 0x0ec00000 0x00000008 /* Config space access */
|
||||
0x00000000 0x00000000 0x00000000 /* no IACK cycles */
|
||||
0x0000000c 0x0ed00000 0x00000004 /* Special cycles */
|
||||
0x0000000c 0x0ec80000 0x00000100 /* Internal registers */
|
||||
0x0000000c 0x0ec80100 0x000000fc>; /* Internal messaging registers */
|
||||
|
||||
/* Outbound ranges, one memory and one IO,
|
||||
* later cannot be changed
|
||||
*/
|
||||
ranges = <0x02000000 0x00000000 0x80000000 0x0000000d 0x80000000 0x00000000 0x80000000
|
||||
0x02000000 0x00000000 0x00000000 0x0000000c 0x0ee00000 0x00000000 0x00100000
|
||||
0x01000000 0x00000000 0x00000000 0x0000000c 0x08000000 0x00000000 0x00010000>;
|
||||
|
||||
/* Inbound 2GB range starting at 0 */
|
||||
dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x80000000>;
|
||||
|
||||
/* This drives busses 0 to 0x3f */
|
||||
bus-range = <0x0 0x3f>;
|
||||
|
||||
/* All PCI interrupts are routed to ext IRQ 2 -> UIC1-0 */
|
||||
interrupt-map-mask = <0x0 0x0 0x0 0x0>;
|
||||
interrupt-map = < 0x0 0x0 0x0 0x0 &UIC1 0x0 0x8 >;
|
||||
};
|
||||
|
||||
PCIE0: pciex@d00000000 {
|
||||
device_type = "pci";
|
||||
#interrupt-cells = <1>;
|
||||
#size-cells = <2>;
|
||||
#address-cells = <3>;
|
||||
compatible = "ibm,plb-pciex-460ex", "ibm,plb-pciex";
|
||||
primary;
|
||||
port = <0x0>; /* port number */
|
||||
reg = <0x0000000d 0x00000000 0x20000000 /* Config space access */
|
||||
0x0000000c 0x08010000 0x00001000>; /* Registers */
|
||||
dcr-reg = <0x100 0x020>;
|
||||
sdr-base = <0x300>;
|
||||
|
||||
/* Outbound ranges, one memory and one IO,
|
||||
* later cannot be changed
|
||||
*/
|
||||
ranges = <0x02000000 0x00000000 0x80000000 0x0000000e 0x00000000 0x00000000 0x80000000
|
||||
0x02000000 0x00000000 0x00000000 0x0000000f 0x00000000 0x00000000 0x00100000
|
||||
0x01000000 0x00000000 0x00000000 0x0000000f 0x80000000 0x00000000 0x00010000>;
|
||||
|
||||
/* Inbound 2GB range starting at 0 */
|
||||
dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x80000000>;
|
||||
|
||||
/* This drives busses 40 to 0x7f */
|
||||
bus-range = <0x40 0x7f>;
|
||||
|
||||
/* Legacy interrupts (note the weird polarity, the bridge seems
|
||||
* to invert PCIe legacy interrupts).
|
||||
* We are de-swizzling here because the numbers are actually for
|
||||
* port of the root complex virtual P2P bridge. But I want
|
||||
* to avoid putting a node for it in the tree, so the numbers
|
||||
* below are basically de-swizzled numbers.
|
||||
* The real slot is on idsel 0, so the swizzling is 1:1
|
||||
*/
|
||||
interrupt-map-mask = <0x0 0x0 0x0 0x7>;
|
||||
interrupt-map = <
|
||||
0x0 0x0 0x0 0x1 &UIC3 0xc 0x4 /* swizzled int A */
|
||||
0x0 0x0 0x0 0x2 &UIC3 0xd 0x4 /* swizzled int B */
|
||||
0x0 0x0 0x0 0x3 &UIC3 0xe 0x4 /* swizzled int C */
|
||||
0x0 0x0 0x0 0x4 &UIC3 0xf 0x4 /* swizzled int D */>;
|
||||
};
|
||||
|
||||
PCIE1: pciex@d20000000 {
|
||||
device_type = "pci";
|
||||
#interrupt-cells = <1>;
|
||||
#size-cells = <2>;
|
||||
#address-cells = <3>;
|
||||
compatible = "ibm,plb-pciex-460ex", "ibm,plb-pciex";
|
||||
primary;
|
||||
port = <0x1>; /* port number */
|
||||
reg = <0x0000000d 0x20000000 0x20000000 /* Config space access */
|
||||
0x0000000c 0x08011000 0x00001000>; /* Registers */
|
||||
dcr-reg = <0x120 0x020>;
|
||||
sdr-base = <0x340>;
|
||||
|
||||
/* Outbound ranges, one memory and one IO,
|
||||
* later cannot be changed
|
||||
*/
|
||||
ranges = <0x02000000 0x00000000 0x80000000 0x0000000e 0x80000000 0x00000000 0x80000000
|
||||
0x02000000 0x00000000 0x00000000 0x0000000f 0x00100000 0x00000000 0x00100000
|
||||
0x01000000 0x00000000 0x00000000 0x0000000f 0x80010000 0x00000000 0x00010000>;
|
||||
|
||||
/* Inbound 2GB range starting at 0 */
|
||||
dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x80000000>;
|
||||
|
||||
/* This drives busses 80 to 0xbf */
|
||||
bus-range = <0x80 0xbf>;
|
||||
|
||||
/* Legacy interrupts (note the weird polarity, the bridge seems
|
||||
* to invert PCIe legacy interrupts).
|
||||
* We are de-swizzling here because the numbers are actually for
|
||||
* port of the root complex virtual P2P bridge. But I want
|
||||
* to avoid putting a node for it in the tree, so the numbers
|
||||
* below are basically de-swizzled numbers.
|
||||
* The real slot is on idsel 0, so the swizzling is 1:1
|
||||
*/
|
||||
interrupt-map-mask = <0x0 0x0 0x0 0x7>;
|
||||
interrupt-map = <
|
||||
0x0 0x0 0x0 0x1 &UIC3 0x10 0x4 /* swizzled int A */
|
||||
0x0 0x0 0x0 0x2 &UIC3 0x11 0x4 /* swizzled int B */
|
||||
0x0 0x0 0x0 0x3 &UIC3 0x12 0x4 /* swizzled int C */
|
||||
0x0 0x0 0x0 0x4 &UIC3 0x13 0x4 /* swizzled int D */>;
|
||||
};
|
||||
|
||||
MSI: ppc4xx-msi@C10000000 {
|
||||
compatible = "amcc,ppc4xx-msi", "ppc4xx-msi";
|
||||
reg = < 0xC 0x10000000 0x100>;
|
||||
sdr-base = <0x36C>;
|
||||
msi-data = <0x00000000>;
|
||||
msi-mask = <0x44440000>;
|
||||
interrupt-count = <3>;
|
||||
interrupts = <0 1 2 3>;
|
||||
interrupt-parent = <&UIC3>;
|
||||
#interrupt-cells = <1>;
|
||||
#address-cells = <0>;
|
||||
#size-cells = <0>;
|
||||
interrupt-map = <0 &UIC3 0x18 1
|
||||
1 &UIC3 0x19 1
|
||||
2 &UIC3 0x1A 1
|
||||
3 &UIC3 0x1B 1>;
|
||||
};
|
||||
};
|
||||
};
|
|
@ -1,582 +0,0 @@
|
|||
/*
|
||||
* Device Tree Source for AMCC Glacier (460GT)
|
||||
*
|
||||
* Copyright 2008-2010 DENX Software Engineering, Stefan Roese <sr@denx.de>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
/ {
|
||||
#address-cells = <2>;
|
||||
#size-cells = <1>;
|
||||
model = "amcc,glacier";
|
||||
compatible = "amcc,glacier";
|
||||
dcr-parent = <&{/cpus/cpu@0}>;
|
||||
|
||||
aliases {
|
||||
ethernet0 = &EMAC0;
|
||||
ethernet1 = &EMAC1;
|
||||
ethernet2 = &EMAC2;
|
||||
ethernet3 = &EMAC3;
|
||||
serial0 = &UART0;
|
||||
serial1 = &UART1;
|
||||
};
|
||||
|
||||
chosen {
|
||||
stdout-path = &UART0;
|
||||
};
|
||||
|
||||
cpus {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
cpu@0 {
|
||||
device_type = "cpu";
|
||||
model = "PowerPC,460GT";
|
||||
reg = <0x00000000>;
|
||||
clock-frequency = <0>; /* Filled in by U-Boot */
|
||||
timebase-frequency = <0>; /* Filled in by U-Boot */
|
||||
i-cache-line-size = <32>;
|
||||
d-cache-line-size = <32>;
|
||||
i-cache-size = <32768>;
|
||||
d-cache-size = <32768>;
|
||||
dcr-controller;
|
||||
dcr-access-method = "native";
|
||||
next-level-cache = <&L2C0>;
|
||||
};
|
||||
};
|
||||
|
||||
memory {
|
||||
device_type = "memory";
|
||||
reg = <0x00000000 0x00000000 0x00000000>; /* Filled in by U-Boot */
|
||||
};
|
||||
|
||||
UIC0: interrupt-controller0 {
|
||||
compatible = "ibm,uic-460gt","ibm,uic";
|
||||
interrupt-controller;
|
||||
cell-index = <0>;
|
||||
dcr-reg = <0x0c0 0x009>;
|
||||
#address-cells = <0>;
|
||||
#size-cells = <0>;
|
||||
#interrupt-cells = <2>;
|
||||
};
|
||||
|
||||
UIC1: interrupt-controller1 {
|
||||
compatible = "ibm,uic-460gt","ibm,uic";
|
||||
interrupt-controller;
|
||||
cell-index = <1>;
|
||||
dcr-reg = <0x0d0 0x009>;
|
||||
#address-cells = <0>;
|
||||
#size-cells = <0>;
|
||||
#interrupt-cells = <2>;
|
||||
interrupts = <0x1e 0x4 0x1f 0x4>; /* cascade */
|
||||
interrupt-parent = <&UIC0>;
|
||||
};
|
||||
|
||||
UIC2: interrupt-controller2 {
|
||||
compatible = "ibm,uic-460gt","ibm,uic";
|
||||
interrupt-controller;
|
||||
cell-index = <2>;
|
||||
dcr-reg = <0x0e0 0x009>;
|
||||
#address-cells = <0>;
|
||||
#size-cells = <0>;
|
||||
#interrupt-cells = <2>;
|
||||
interrupts = <0xa 0x4 0xb 0x4>; /* cascade */
|
||||
interrupt-parent = <&UIC0>;
|
||||
};
|
||||
|
||||
UIC3: interrupt-controller3 {
|
||||
compatible = "ibm,uic-460gt","ibm,uic";
|
||||
interrupt-controller;
|
||||
cell-index = <3>;
|
||||
dcr-reg = <0x0f0 0x009>;
|
||||
#address-cells = <0>;
|
||||
#size-cells = <0>;
|
||||
#interrupt-cells = <2>;
|
||||
interrupts = <0x10 0x4 0x11 0x4>; /* cascade */
|
||||
interrupt-parent = <&UIC0>;
|
||||
};
|
||||
|
||||
SDR0: sdr {
|
||||
compatible = "ibm,sdr-460gt";
|
||||
dcr-reg = <0x00e 0x002>;
|
||||
};
|
||||
|
||||
CPR0: cpr {
|
||||
compatible = "ibm,cpr-460gt";
|
||||
dcr-reg = <0x00c 0x002>;
|
||||
};
|
||||
|
||||
L2C0: l2c {
|
||||
compatible = "ibm,l2-cache-460gt", "ibm,l2-cache";
|
||||
dcr-reg = <0x020 0x008 /* Internal SRAM DCR's */
|
||||
0x030 0x008>; /* L2 cache DCR's */
|
||||
cache-line-size = <32>; /* 32 bytes */
|
||||
cache-size = <262144>; /* L2, 256K */
|
||||
interrupt-parent = <&UIC1>;
|
||||
interrupts = <11 1>;
|
||||
};
|
||||
|
||||
plb {
|
||||
compatible = "ibm,plb-460gt", "ibm,plb4";
|
||||
#address-cells = <2>;
|
||||
#size-cells = <1>;
|
||||
ranges;
|
||||
clock-frequency = <0>; /* Filled in by U-Boot */
|
||||
|
||||
SDRAM0: sdram {
|
||||
compatible = "ibm,sdram-460gt", "ibm,sdram-405gp";
|
||||
dcr-reg = <0x010 0x002>;
|
||||
};
|
||||
|
||||
CRYPTO: crypto@180000 {
|
||||
compatible = "amcc,ppc460gt-crypto", "amcc,ppc460ex-crypto",
|
||||
"amcc,ppc4xx-crypto";
|
||||
reg = <4 0x00180000 0x80400>;
|
||||
interrupt-parent = <&UIC0>;
|
||||
interrupts = <0x1d 0x4>;
|
||||
};
|
||||
|
||||
HWRNG: hwrng@110000 {
|
||||
compatible = "amcc,ppc460ex-rng", "ppc4xx-rng";
|
||||
reg = <4 0x00110000 0x50>;
|
||||
};
|
||||
|
||||
MAL0: mcmal {
|
||||
compatible = "ibm,mcmal-460gt", "ibm,mcmal2";
|
||||
dcr-reg = <0x180 0x062>;
|
||||
num-tx-chans = <4>;
|
||||
num-rx-chans = <32>;
|
||||
#address-cells = <0>;
|
||||
#size-cells = <0>;
|
||||
interrupt-parent = <&UIC2>;
|
||||
interrupts = < /*TXEOB*/ 0x6 0x4
|
||||
/*RXEOB*/ 0x7 0x4
|
||||
/*SERR*/ 0x3 0x4
|
||||
/*TXDE*/ 0x4 0x4
|
||||
/*RXDE*/ 0x5 0x4>;
|
||||
desc-base-addr-high = <0x8>;
|
||||
};
|
||||
|
||||
POB0: opb {
|
||||
compatible = "ibm,opb-460gt", "ibm,opb";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges = <0xb0000000 0x00000004 0xb0000000 0x50000000>;
|
||||
clock-frequency = <0>; /* Filled in by U-Boot */
|
||||
|
||||
EBC0: ebc {
|
||||
compatible = "ibm,ebc-460gt", "ibm,ebc";
|
||||
dcr-reg = <0x012 0x002>;
|
||||
#address-cells = <2>;
|
||||
#size-cells = <1>;
|
||||
clock-frequency = <0>; /* Filled in by U-Boot */
|
||||
/* ranges property is supplied by U-Boot */
|
||||
interrupts = <0x6 0x4>;
|
||||
interrupt-parent = <&UIC1>;
|
||||
|
||||
nor_flash@0,0 {
|
||||
compatible = "amd,s29gl512n", "cfi-flash";
|
||||
bank-width = <2>;
|
||||
reg = <0x00000000 0x00000000 0x04000000>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
partition@0 {
|
||||
label = "kernel";
|
||||
reg = <0x00000000 0x001e0000>;
|
||||
};
|
||||
partition@1e0000 {
|
||||
label = "dtb";
|
||||
reg = <0x001e0000 0x00020000>;
|
||||
};
|
||||
partition@200000 {
|
||||
label = "ramdisk";
|
||||
reg = <0x00200000 0x01400000>;
|
||||
};
|
||||
partition@1600000 {
|
||||
label = "jffs2";
|
||||
reg = <0x01600000 0x00400000>;
|
||||
};
|
||||
partition@1a00000 {
|
||||
label = "user";
|
||||
reg = <0x01a00000 0x02560000>;
|
||||
};
|
||||
partition@3f60000 {
|
||||
label = "env";
|
||||
reg = <0x03f60000 0x00040000>;
|
||||
};
|
||||
partition@3fa0000 {
|
||||
label = "u-boot";
|
||||
reg = <0x03fa0000 0x00060000>;
|
||||
};
|
||||
};
|
||||
|
||||
ndfc@3,0 {
|
||||
compatible = "ibm,ndfc";
|
||||
reg = <0x00000003 0x00000000 0x00002000>;
|
||||
ccr = <0x00001000>;
|
||||
bank-settings = <0x80002222>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
nand {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "u-boot";
|
||||
reg = <0x00000000 0x00100000>;
|
||||
};
|
||||
partition@100000 {
|
||||
label = "user";
|
||||
reg = <0x00000000 0x03f00000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
UART0: serial@ef600300 {
|
||||
device_type = "serial";
|
||||
reg-shift = <0>;
|
||||
compatible = "ns16550";
|
||||
reg = <0xef600300 0x00000008>;
|
||||
virtual-reg = <0xef600300>;
|
||||
clock-frequency = <0>; /* Filled in by U-Boot */
|
||||
current-speed = <0>; /* Filled in by U-Boot */
|
||||
interrupt-parent = <&UIC1>;
|
||||
interrupts = <0x1 0x4>;
|
||||
};
|
||||
|
||||
UART1: serial@ef600400 {
|
||||
device_type = "serial";
|
||||
reg-shift = <0>;
|
||||
compatible = "ns16550";
|
||||
reg = <0xef600400 0x00000008>;
|
||||
virtual-reg = <0xef600400>;
|
||||
clock-frequency = <0>; /* Filled in by U-Boot */
|
||||
current-speed = <0>; /* Filled in by U-Boot */
|
||||
interrupt-parent = <&UIC0>;
|
||||
interrupts = <0x1 0x4>;
|
||||
};
|
||||
|
||||
UART2: serial@ef600500 {
|
||||
device_type = "serial";
|
||||
reg-shift = <0>;
|
||||
compatible = "ns16550";
|
||||
reg = <0xef600500 0x00000008>;
|
||||
virtual-reg = <0xef600500>;
|
||||
clock-frequency = <0>; /* Filled in by U-Boot */
|
||||
current-speed = <0>; /* Filled in by U-Boot */
|
||||
interrupt-parent = <&UIC1>;
|
||||
interrupts = <28 0x4>;
|
||||
};
|
||||
|
||||
UART3: serial@ef600600 {
|
||||
device_type = "serial";
|
||||
reg-shift = <0>;
|
||||
compatible = "ns16550";
|
||||
reg = <0xef600600 0x00000008>;
|
||||
virtual-reg = <0xef600600>;
|
||||
clock-frequency = <0>; /* Filled in by U-Boot */
|
||||
current-speed = <0>; /* Filled in by U-Boot */
|
||||
interrupt-parent = <&UIC1>;
|
||||
interrupts = <29 0x4>;
|
||||
};
|
||||
|
||||
IIC0: i2c@ef600700 {
|
||||
compatible = "ibm,iic-460gt", "ibm,iic";
|
||||
reg = <0xef600700 0x00000014>;
|
||||
interrupt-parent = <&UIC0>;
|
||||
interrupts = <0x2 0x4>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
rtc@68 {
|
||||
compatible = "stm,m41t80";
|
||||
reg = <0x68>;
|
||||
interrupt-parent = <&UIC2>;
|
||||
interrupts = <0x19 0x8>;
|
||||
};
|
||||
sttm@48 {
|
||||
compatible = "ad,ad7414";
|
||||
reg = <0x48>;
|
||||
interrupt-parent = <&UIC1>;
|
||||
interrupts = <0x14 0x8>;
|
||||
};
|
||||
};
|
||||
|
||||
IIC1: i2c@ef600800 {
|
||||
compatible = "ibm,iic-460gt", "ibm,iic";
|
||||
reg = <0xef600800 0x00000014>;
|
||||
interrupt-parent = <&UIC0>;
|
||||
interrupts = <0x3 0x4>;
|
||||
};
|
||||
|
||||
ZMII0: emac-zmii@ef600d00 {
|
||||
compatible = "ibm,zmii-460gt", "ibm,zmii";
|
||||
reg = <0xef600d00 0x0000000c>;
|
||||
};
|
||||
|
||||
RGMII0: emac-rgmii@ef601500 {
|
||||
compatible = "ibm,rgmii-460gt", "ibm,rgmii";
|
||||
reg = <0xef601500 0x00000008>;
|
||||
has-mdio;
|
||||
};
|
||||
|
||||
RGMII1: emac-rgmii@ef601600 {
|
||||
compatible = "ibm,rgmii-460gt", "ibm,rgmii";
|
||||
reg = <0xef601600 0x00000008>;
|
||||
has-mdio;
|
||||
};
|
||||
|
||||
TAH0: emac-tah@ef601350 {
|
||||
compatible = "ibm,tah-460gt", "ibm,tah";
|
||||
reg = <0xef601350 0x00000030>;
|
||||
};
|
||||
|
||||
TAH1: emac-tah@ef601450 {
|
||||
compatible = "ibm,tah-460gt", "ibm,tah";
|
||||
reg = <0xef601450 0x00000030>;
|
||||
};
|
||||
|
||||
EMAC0: ethernet@ef600e00 {
|
||||
device_type = "network";
|
||||
compatible = "ibm,emac-460gt", "ibm,emac4sync";
|
||||
interrupt-parent = <&EMAC0>;
|
||||
interrupts = <0x0 0x1>;
|
||||
#interrupt-cells = <1>;
|
||||
#address-cells = <0>;
|
||||
#size-cells = <0>;
|
||||
interrupt-map = </*Status*/ 0x0 &UIC2 0x10 0x4
|
||||
/*Wake*/ 0x1 &UIC2 0x14 0x4>;
|
||||
reg = <0xef600e00 0x000000c4>;
|
||||
local-mac-address = [000000000000]; /* Filled in by U-Boot */
|
||||
mal-device = <&MAL0>;
|
||||
mal-tx-channel = <0>;
|
||||
mal-rx-channel = <0>;
|
||||
cell-index = <0>;
|
||||
max-frame-size = <9000>;
|
||||
rx-fifo-size = <4096>;
|
||||
tx-fifo-size = <2048>;
|
||||
rx-fifo-size-gige = <16384>;
|
||||
phy-mode = "rgmii";
|
||||
phy-map = <0x00000000>;
|
||||
rgmii-device = <&RGMII0>;
|
||||
rgmii-channel = <0>;
|
||||
tah-device = <&TAH0>;
|
||||
tah-channel = <0>;
|
||||
has-inverted-stacr-oc;
|
||||
has-new-stacr-staopc;
|
||||
};
|
||||
|
||||
EMAC1: ethernet@ef600f00 {
|
||||
device_type = "network";
|
||||
compatible = "ibm,emac-460gt", "ibm,emac4sync";
|
||||
interrupt-parent = <&EMAC1>;
|
||||
interrupts = <0x0 0x1>;
|
||||
#interrupt-cells = <1>;
|
||||
#address-cells = <0>;
|
||||
#size-cells = <0>;
|
||||
interrupt-map = </*Status*/ 0x0 &UIC2 0x11 0x4
|
||||
/*Wake*/ 0x1 &UIC2 0x15 0x4>;
|
||||
reg = <0xef600f00 0x000000c4>;
|
||||
local-mac-address = [000000000000]; /* Filled in by U-Boot */
|
||||
mal-device = <&MAL0>;
|
||||
mal-tx-channel = <1>;
|
||||
mal-rx-channel = <8>;
|
||||
cell-index = <1>;
|
||||
max-frame-size = <9000>;
|
||||
rx-fifo-size = <4096>;
|
||||
tx-fifo-size = <2048>;
|
||||
rx-fifo-size-gige = <16384>;
|
||||
phy-mode = "rgmii";
|
||||
phy-map = <0x00000000>;
|
||||
rgmii-device = <&RGMII0>;
|
||||
rgmii-channel = <1>;
|
||||
tah-device = <&TAH1>;
|
||||
tah-channel = <1>;
|
||||
has-inverted-stacr-oc;
|
||||
has-new-stacr-staopc;
|
||||
mdio-device = <&EMAC0>;
|
||||
};
|
||||
|
||||
EMAC2: ethernet@ef601100 {
|
||||
device_type = "network";
|
||||
compatible = "ibm,emac-460gt", "ibm,emac4sync";
|
||||
interrupt-parent = <&EMAC2>;
|
||||
interrupts = <0x0 0x1>;
|
||||
#interrupt-cells = <1>;
|
||||
#address-cells = <0>;
|
||||
#size-cells = <0>;
|
||||
interrupt-map = </*Status*/ 0x0 &UIC2 0x12 0x4
|
||||
/*Wake*/ 0x1 &UIC2 0x16 0x4>;
|
||||
reg = <0xef601100 0x000000c4>;
|
||||
local-mac-address = [000000000000]; /* Filled in by U-Boot */
|
||||
mal-device = <&MAL0>;
|
||||
mal-tx-channel = <2>;
|
||||
mal-rx-channel = <16>;
|
||||
cell-index = <2>;
|
||||
max-frame-size = <9000>;
|
||||
rx-fifo-size = <4096>;
|
||||
tx-fifo-size = <2048>;
|
||||
rx-fifo-size-gige = <16384>;
|
||||
tx-fifo-size-gige = <16384>; /* emac2&3 only */
|
||||
phy-mode = "rgmii";
|
||||
phy-map = <0x00000000>;
|
||||
rgmii-device = <&RGMII1>;
|
||||
rgmii-channel = <0>;
|
||||
has-inverted-stacr-oc;
|
||||
has-new-stacr-staopc;
|
||||
mdio-device = <&EMAC0>;
|
||||
};
|
||||
|
||||
EMAC3: ethernet@ef601200 {
|
||||
device_type = "network";
|
||||
compatible = "ibm,emac-460gt", "ibm,emac4sync";
|
||||
interrupt-parent = <&EMAC3>;
|
||||
interrupts = <0x0 0x1>;
|
||||
#interrupt-cells = <1>;
|
||||
#address-cells = <0>;
|
||||
#size-cells = <0>;
|
||||
interrupt-map = </*Status*/ 0x0 &UIC2 0x13 0x4
|
||||
/*Wake*/ 0x1 &UIC2 0x17 0x4>;
|
||||
reg = <0xef601200 0x000000c4>;
|
||||
local-mac-address = [000000000000]; /* Filled in by U-Boot */
|
||||
mal-device = <&MAL0>;
|
||||
mal-tx-channel = <3>;
|
||||
mal-rx-channel = <24>;
|
||||
cell-index = <3>;
|
||||
max-frame-size = <9000>;
|
||||
rx-fifo-size = <4096>;
|
||||
tx-fifo-size = <2048>;
|
||||
rx-fifo-size-gige = <16384>;
|
||||
tx-fifo-size-gige = <16384>; /* emac2&3 only */
|
||||
phy-mode = "rgmii";
|
||||
phy-map = <0x00000000>;
|
||||
rgmii-device = <&RGMII1>;
|
||||
rgmii-channel = <1>;
|
||||
has-inverted-stacr-oc;
|
||||
has-new-stacr-staopc;
|
||||
mdio-device = <&EMAC0>;
|
||||
};
|
||||
};
|
||||
|
||||
PCIX0: pci@c0ec00000 {
|
||||
device_type = "pci";
|
||||
#interrupt-cells = <1>;
|
||||
#size-cells = <2>;
|
||||
#address-cells = <3>;
|
||||
compatible = "ibm,plb-pcix-460gt", "ibm,plb-pcix";
|
||||
primary;
|
||||
large-inbound-windows;
|
||||
enable-msi-hole;
|
||||
reg = <0x0000000c 0x0ec00000 0x00000008 /* Config space access */
|
||||
0x00000000 0x00000000 0x00000000 /* no IACK cycles */
|
||||
0x0000000c 0x0ed00000 0x00000004 /* Special cycles */
|
||||
0x0000000c 0x0ec80000 0x00000100 /* Internal registers */
|
||||
0x0000000c 0x0ec80100 0x000000fc>; /* Internal messaging registers */
|
||||
|
||||
/* Outbound ranges, one memory and one IO,
|
||||
* later cannot be changed
|
||||
*/
|
||||
ranges = <0x02000000 0x00000000 0x80000000 0x0000000d 0x80000000 0x00000000 0x80000000
|
||||
0x02000000 0x00000000 0x00000000 0x0000000c 0x0ee00000 0x00000000 0x00100000
|
||||
0x01000000 0x00000000 0x00000000 0x0000000c 0x08000000 0x00000000 0x00010000>;
|
||||
|
||||
/* Inbound 2GB range starting at 0 */
|
||||
dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x80000000>;
|
||||
|
||||
/* This drives busses 0 to 0x3f */
|
||||
bus-range = <0x0 0x3f>;
|
||||
|
||||
/* All PCI interrupts are routed to ext IRQ 2 -> UIC1-0 */
|
||||
interrupt-map-mask = <0x0 0x0 0x0 0x0>;
|
||||
interrupt-map = < 0x0 0x0 0x0 0x0 &UIC1 0x0 0x8 >;
|
||||
};
|
||||
|
||||
PCIE0: pciex@d00000000 {
|
||||
device_type = "pci";
|
||||
#interrupt-cells = <1>;
|
||||
#size-cells = <2>;
|
||||
#address-cells = <3>;
|
||||
compatible = "ibm,plb-pciex-460ex", "ibm,plb-pciex";
|
||||
primary;
|
||||
port = <0x0>; /* port number */
|
||||
reg = <0x0000000d 0x00000000 0x20000000 /* Config space access */
|
||||
0x0000000c 0x08010000 0x00001000>; /* Registers */
|
||||
dcr-reg = <0x100 0x020>;
|
||||
sdr-base = <0x300>;
|
||||
|
||||
/* Outbound ranges, one memory and one IO,
|
||||
* later cannot be changed
|
||||
*/
|
||||
ranges = <0x02000000 0x00000000 0x80000000 0x0000000e 0x00000000 0x00000000 0x80000000
|
||||
0x02000000 0x00000000 0x00000000 0x0000000f 0x00000000 0x00000000 0x00100000
|
||||
0x01000000 0x00000000 0x00000000 0x0000000f 0x80000000 0x00000000 0x00010000>;
|
||||
|
||||
/* Inbound 2GB range starting at 0 */
|
||||
dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x80000000>;
|
||||
|
||||
/* This drives busses 40 to 0x7f */
|
||||
bus-range = <0x40 0x7f>;
|
||||
|
||||
/* Legacy interrupts (note the weird polarity, the bridge seems
|
||||
* to invert PCIe legacy interrupts).
|
||||
* We are de-swizzling here because the numbers are actually for
|
||||
* port of the root complex virtual P2P bridge. But I want
|
||||
* to avoid putting a node for it in the tree, so the numbers
|
||||
* below are basically de-swizzled numbers.
|
||||
* The real slot is on idsel 0, so the swizzling is 1:1
|
||||
*/
|
||||
interrupt-map-mask = <0x0 0x0 0x0 0x7>;
|
||||
interrupt-map = <
|
||||
0x0 0x0 0x0 0x1 &UIC3 0xc 0x4 /* swizzled int A */
|
||||
0x0 0x0 0x0 0x2 &UIC3 0xd 0x4 /* swizzled int B */
|
||||
0x0 0x0 0x0 0x3 &UIC3 0xe 0x4 /* swizzled int C */
|
||||
0x0 0x0 0x0 0x4 &UIC3 0xf 0x4 /* swizzled int D */>;
|
||||
};
|
||||
|
||||
PCIE1: pciex@d20000000 {
|
||||
device_type = "pci";
|
||||
#interrupt-cells = <1>;
|
||||
#size-cells = <2>;
|
||||
#address-cells = <3>;
|
||||
compatible = "ibm,plb-pciex-460ex", "ibm,plb-pciex";
|
||||
primary;
|
||||
port = <0x1>; /* port number */
|
||||
reg = <0x0000000d 0x20000000 0x20000000 /* Config space access */
|
||||
0x0000000c 0x08011000 0x00001000>; /* Registers */
|
||||
dcr-reg = <0x120 0x020>;
|
||||
sdr-base = <0x340>;
|
||||
|
||||
/* Outbound ranges, one memory and one IO,
|
||||
* later cannot be changed
|
||||
*/
|
||||
ranges = <0x02000000 0x00000000 0x80000000 0x0000000e 0x80000000 0x00000000 0x80000000
|
||||
0x02000000 0x00000000 0x00000000 0x0000000f 0x00100000 0x00000000 0x00100000
|
||||
0x01000000 0x00000000 0x00000000 0x0000000f 0x80010000 0x00000000 0x00010000>;
|
||||
|
||||
/* Inbound 2GB range starting at 0 */
|
||||
dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x80000000>;
|
||||
|
||||
/* This drives busses 80 to 0xbf */
|
||||
bus-range = <0x80 0xbf>;
|
||||
|
||||
/* Legacy interrupts (note the weird polarity, the bridge seems
|
||||
* to invert PCIe legacy interrupts).
|
||||
* We are de-swizzling here because the numbers are actually for
|
||||
* port of the root complex virtual P2P bridge. But I want
|
||||
* to avoid putting a node for it in the tree, so the numbers
|
||||
* below are basically de-swizzled numbers.
|
||||
* The real slot is on idsel 0, so the swizzling is 1:1
|
||||
*/
|
||||
interrupt-map-mask = <0x0 0x0 0x0 0x7>;
|
||||
interrupt-map = <
|
||||
0x0 0x0 0x0 0x1 &UIC3 0x10 0x4 /* swizzled int A */
|
||||
0x0 0x0 0x0 0x2 &UIC3 0x11 0x4 /* swizzled int B */
|
||||
0x0 0x0 0x0 0x3 &UIC3 0x12 0x4 /* swizzled int C */
|
||||
0x0 0x0 0x0 0x4 &UIC3 0x13 0x4 /* swizzled int D */>;
|
||||
};
|
||||
};
|
||||
};
|
|
@ -1,15 +0,0 @@
|
|||
/dts-v1/;
|
||||
/ {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
aliases {
|
||||
console = &uart0;
|
||||
};
|
||||
|
||||
uart0: serial@84000000 {
|
||||
compatible = "xlnx,xps-uartlite-1.00.a";
|
||||
interrupts = <0 0>;
|
||||
reg = <0x84000000 0x10000>;
|
||||
};
|
||||
} ;
|
|
@ -1,15 +0,0 @@
|
|||
/dts-v1/;
|
||||
/ {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
aliases {
|
||||
console = &uart0;
|
||||
};
|
||||
|
||||
uart0: serial@8b000000 {
|
||||
compatible = "xlnx,xps-uartlite-1.00.a";
|
||||
interrupts = <0 0>;
|
||||
reg = <0x8b000000 0x10000>;
|
||||
};
|
||||
} ;
|
|
@ -1,62 +0,0 @@
|
|||
#ifndef _405GP_PCI_H
|
||||
#define _405GP_PCI_H
|
||||
|
||||
#include <pci.h>
|
||||
|
||||
/*----------------------------------------------------------------------------+
|
||||
| 405GP PCI core memory map defines.
|
||||
+----------------------------------------------------------------------------*/
|
||||
#define MIN_PCI_MEMADDR1 0x80000000
|
||||
#define MIN_PCI_MEMADDR2 0x00000000
|
||||
#define MIN_PLB_PCI_IOADDR 0xE8000000 /* PLB side of PCI I/O address space */
|
||||
#define MIN_PCI_PCI_IOADDR 0x00000000 /* PCI side of PCI I/O address space */
|
||||
#define MAX_PCI_DEVICES 32
|
||||
|
||||
/*----------------------------------------------------------------------------+
|
||||
| Defines for the 405GP PCI Config address and data registers followed by
|
||||
| defines for the standard PCI device configuration header.
|
||||
+----------------------------------------------------------------------------*/
|
||||
#define PCICFGADR 0xEEC00000
|
||||
#define PCICFGDATA 0xEEC00004
|
||||
|
||||
#define PCIBUSNUM 0x40 /* 405GP specific parameters */
|
||||
#define PCISUBBUSNUM 0x41
|
||||
#define PCIDISCOUNT 0x42
|
||||
#define PCIBRDGOPT1 0x4A
|
||||
#define PCIBRDGOPT2 0x60
|
||||
|
||||
/*----------------------------------------------------------------------------+
|
||||
| Defines for 405GP PCI Master local configuration regs.
|
||||
+----------------------------------------------------------------------------*/
|
||||
#define PMM0LA 0xEF400000
|
||||
#define PMM0MA 0xEF400004
|
||||
#define PMM0PCILA 0xEF400008
|
||||
#define PMM0PCIHA 0xEF40000C
|
||||
#define PMM1LA 0xEF400010
|
||||
#define PMM1MA 0xEF400014
|
||||
#define PMM1PCILA 0xEF400018
|
||||
#define PMM1PCIHA 0xEF40001C
|
||||
#define PMM2LA 0xEF400020
|
||||
#define PMM2MA 0xEF400024
|
||||
#define PMM2PCILA 0xEF400028
|
||||
#define PMM2PCIHA 0xEF40002C
|
||||
|
||||
/*----------------------------------------------------------------------------+
|
||||
| Defines for 405GP PCI Target local configuration regs.
|
||||
+----------------------------------------------------------------------------*/
|
||||
#define PTM1MS 0xEF400030
|
||||
#define PTM1LA 0xEF400034
|
||||
#define PTM2MS 0xEF400038
|
||||
#define PTM2LA 0xEF40003C
|
||||
|
||||
#define PCIDEVID_405GP 0x0
|
||||
|
||||
void board_pci_fixup_irq(struct pci_controller *hose, pci_dev_t dev);
|
||||
int pci_arbiter_enabled(void);
|
||||
int __pci_pre_init(struct pci_controller *hose);
|
||||
void __pci_target_init(struct pci_controller *hose);
|
||||
void __pci_master_init(struct pci_controller *hose);
|
||||
void pci_target_init(struct pci_controller *);
|
||||
void pcie_setup_hoses(int busno);
|
||||
|
||||
#endif
|
|
@ -1,406 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2005 Cisco Systems. All rights reserved.
|
||||
* Roland Dreier <rolandd@cisco.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef __4XX_PCIE_H
|
||||
#define __4XX_PCIE_H
|
||||
|
||||
#include <asm/ppc4xx.h>
|
||||
#include <pci.h>
|
||||
|
||||
#define DCRN_SDR0_CFGADDR 0x00e
|
||||
#define DCRN_SDR0_CFGDATA 0x00f
|
||||
|
||||
#if defined(CONFIG_440SPE)
|
||||
#define CONFIG_SYS_PCIE_NR_PORTS 3
|
||||
|
||||
#define CONFIG_SYS_PCIE_ADDR_HIGH 0x0000000d
|
||||
|
||||
#define DCRN_PCIE0_BASE 0x100
|
||||
#define DCRN_PCIE1_BASE 0x120
|
||||
#define DCRN_PCIE2_BASE 0x140
|
||||
|
||||
#define PCIE0_SDR 0x300
|
||||
#define PCIE1_SDR 0x340
|
||||
#define PCIE2_SDR 0x370
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_460EX) || defined(CONFIG_460GT)
|
||||
#define CONFIG_SYS_PCIE_NR_PORTS 2
|
||||
|
||||
#define CONFIG_SYS_PCIE_ADDR_HIGH 0x0000000d
|
||||
|
||||
#define DCRN_PCIE0_BASE 0x100
|
||||
#define DCRN_PCIE1_BASE 0x120
|
||||
|
||||
#define PCIE0_SDR 0x300
|
||||
#define PCIE1_SDR 0x340
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_405EX)
|
||||
#define CONFIG_SYS_PCIE_NR_PORTS 2
|
||||
|
||||
#define CONFIG_SYS_PCIE_ADDR_HIGH 0x00000000
|
||||
|
||||
#define DCRN_PCIE0_BASE 0x040
|
||||
#define DCRN_PCIE1_BASE 0x060
|
||||
|
||||
#define PCIE0_SDR 0x400
|
||||
#define PCIE1_SDR 0x440
|
||||
#endif
|
||||
|
||||
#define PCIE0 DCRN_PCIE0_BASE
|
||||
#define PCIE1 DCRN_PCIE1_BASE
|
||||
#define PCIE2 DCRN_PCIE2_BASE
|
||||
|
||||
#define DCRN_PEGPL_CFGBAH(base) (base + 0x00)
|
||||
#define DCRN_PEGPL_CFGBAL(base) (base + 0x01)
|
||||
#define DCRN_PEGPL_CFGMSK(base) (base + 0x02)
|
||||
#define DCRN_PEGPL_MSGBAH(base) (base + 0x03)
|
||||
#define DCRN_PEGPL_MSGBAL(base) (base + 0x04)
|
||||
#define DCRN_PEGPL_MSGMSK(base) (base + 0x05)
|
||||
#define DCRN_PEGPL_OMR1BAH(base) (base + 0x06)
|
||||
#define DCRN_PEGPL_OMR1BAL(base) (base + 0x07)
|
||||
#define DCRN_PEGPL_OMR1MSKH(base) (base + 0x08)
|
||||
#define DCRN_PEGPL_OMR1MSKL(base) (base + 0x09)
|
||||
#define DCRN_PEGPL_REGBAH(base) (base + 0x12)
|
||||
#define DCRN_PEGPL_REGBAL(base) (base + 0x13)
|
||||
#define DCRN_PEGPL_REGMSK(base) (base + 0x14)
|
||||
#define DCRN_PEGPL_SPECIAL(base) (base + 0x15)
|
||||
#define DCRN_PEGPL_CFG(base) (base + 0x16)
|
||||
|
||||
/*
|
||||
* System DCRs (SDRs)
|
||||
*/
|
||||
#define PESDR0_PLLLCT1 0x03a0
|
||||
#define PESDR0_PLLLCT2 0x03a1
|
||||
#define PESDR0_PLLLCT3 0x03a2
|
||||
|
||||
/* common regs, at for all 4xx with PCIe core */
|
||||
#define SDRN_PESDR_UTLSET1(n) (sdr_base(n) + 0x00)
|
||||
#define SDRN_PESDR_UTLSET2(n) (sdr_base(n) + 0x01)
|
||||
#define SDRN_PESDR_DLPSET(n) (sdr_base(n) + 0x02)
|
||||
#define SDRN_PESDR_LOOP(n) (sdr_base(n) + 0x03)
|
||||
#define SDRN_PESDR_RCSSET(n) (sdr_base(n) + 0x04)
|
||||
#define SDRN_PESDR_RCSSTS(n) (sdr_base(n) + 0x05)
|
||||
|
||||
#if defined(CONFIG_440SPE)
|
||||
#define SDRN_PESDR_HSSL0SET1(n) (sdr_base(n) + 0x06)
|
||||
#define SDRN_PESDR_HSSL0SET2(n) (sdr_base(n) + 0x07)
|
||||
#define SDRN_PESDR_HSSL0STS(n) (sdr_base(n) + 0x08)
|
||||
#define SDRN_PESDR_HSSL1SET1(n) (sdr_base(n) + 0x09)
|
||||
#define SDRN_PESDR_HSSL1SET2(n) (sdr_base(n) + 0x0a)
|
||||
#define SDRN_PESDR_HSSL1STS(n) (sdr_base(n) + 0x0b)
|
||||
#define SDRN_PESDR_HSSL2SET1(n) (sdr_base(n) + 0x0c)
|
||||
#define SDRN_PESDR_HSSL2SET2(n) (sdr_base(n) + 0x0d)
|
||||
#define SDRN_PESDR_HSSL2STS(n) (sdr_base(n) + 0x0e)
|
||||
#define SDRN_PESDR_HSSL3SET1(n) (sdr_base(n) + 0x0f)
|
||||
#define SDRN_PESDR_HSSL3SET2(n) (sdr_base(n) + 0x10)
|
||||
#define SDRN_PESDR_HSSL3STS(n) (sdr_base(n) + 0x11)
|
||||
|
||||
#define PESDR0_UTLSET1 0x0300
|
||||
#define PESDR0_UTLSET2 0x0301
|
||||
#define PESDR0_DLPSET 0x0302
|
||||
#define PESDR0_LOOP 0x0303
|
||||
#define PESDR0_RCSSET 0x0304
|
||||
#define PESDR0_RCSSTS 0x0305
|
||||
#define PESDR0_HSSL0SET1 0x0306
|
||||
#define PESDR0_HSSL0SET2 0x0307
|
||||
#define PESDR0_HSSL0STS 0x0308
|
||||
#define PESDR0_HSSL1SET1 0x0309
|
||||
#define PESDR0_HSSL1SET2 0x030a
|
||||
#define PESDR0_HSSL1STS 0x030b
|
||||
#define PESDR0_HSSL2SET1 0x030c
|
||||
#define PESDR0_HSSL2SET2 0x030d
|
||||
#define PESDR0_HSSL2STS 0x030e
|
||||
#define PESDR0_HSSL3SET1 0x030f
|
||||
#define PESDR0_HSSL3SET2 0x0310
|
||||
#define PESDR0_HSSL3STS 0x0311
|
||||
#define PESDR0_HSSL4SET1 0x0312
|
||||
#define PESDR0_HSSL4SET2 0x0313
|
||||
#define PESDR0_HSSL4STS 0x0314
|
||||
#define PESDR0_HSSL5SET1 0x0315
|
||||
#define PESDR0_HSSL5SET2 0x0316
|
||||
#define PESDR0_HSSL5STS 0x0317
|
||||
#define PESDR0_HSSL6SET1 0x0318
|
||||
#define PESDR0_HSSL6SET2 0x0319
|
||||
#define PESDR0_HSSL6STS 0x031a
|
||||
#define PESDR0_HSSL7SET1 0x031b
|
||||
#define PESDR0_HSSL7SET2 0x031c
|
||||
#define PESDR0_HSSL7STS 0x031d
|
||||
#define PESDR0_HSSCTLSET 0x031e
|
||||
#define PESDR0_LANE_ABCD 0x031f
|
||||
#define PESDR0_LANE_EFGH 0x0320
|
||||
|
||||
#define PESDR1_UTLSET1 0x0340
|
||||
#define PESDR1_UTLSET2 0x0341
|
||||
#define PESDR1_DLPSET 0x0342
|
||||
#define PESDR1_LOOP 0x0343
|
||||
#define PESDR1_RCSSET 0x0344
|
||||
#define PESDR1_RCSSTS 0x0345
|
||||
#define PESDR1_HSSL0SET1 0x0346
|
||||
#define PESDR1_HSSL0SET2 0x0347
|
||||
#define PESDR1_HSSL0STS 0x0348
|
||||
#define PESDR1_HSSL1SET1 0x0349
|
||||
#define PESDR1_HSSL1SET2 0x034a
|
||||
#define PESDR1_HSSL1STS 0x034b
|
||||
#define PESDR1_HSSL2SET1 0x034c
|
||||
#define PESDR1_HSSL2SET2 0x034d
|
||||
#define PESDR1_HSSL2STS 0x034e
|
||||
#define PESDR1_HSSL3SET1 0x034f
|
||||
#define PESDR1_HSSL3SET2 0x0350
|
||||
#define PESDR1_HSSL3STS 0x0351
|
||||
#define PESDR1_HSSCTLSET 0x0352
|
||||
#define PESDR1_LANE_ABCD 0x0353
|
||||
|
||||
#define PESDR2_UTLSET1 0x0370
|
||||
#define PESDR2_UTLSET2 0x0371
|
||||
#define PESDR2_DLPSET 0x0372
|
||||
#define PESDR2_LOOP 0x0373
|
||||
#define PESDR2_RCSSET 0x0374
|
||||
#define PESDR2_RCSSTS 0x0375
|
||||
#define PESDR2_HSSL0SET1 0x0376
|
||||
#define PESDR2_HSSL0SET2 0x0377
|
||||
#define PESDR2_HSSL0STS 0x0378
|
||||
#define PESDR2_HSSL1SET1 0x0379
|
||||
#define PESDR2_HSSL1SET2 0x037a
|
||||
#define PESDR2_HSSL1STS 0x037b
|
||||
#define PESDR2_HSSL2SET1 0x037c
|
||||
#define PESDR2_HSSL2SET2 0x037d
|
||||
#define PESDR2_HSSL2STS 0x037e
|
||||
#define PESDR2_HSSL3SET1 0x037f
|
||||
#define PESDR2_HSSL3SET2 0x0380
|
||||
#define PESDR2_HSSL3STS 0x0381
|
||||
#define PESDR2_HSSCTLSET 0x0382
|
||||
#define PESDR2_LANE_ABCD 0x0383
|
||||
|
||||
#elif defined(CONFIG_405EX)
|
||||
|
||||
#define SDRN_PESDR_PHYSET1(n) (sdr_base(n) + 0x06)
|
||||
#define SDRN_PESDR_PHYSET2(n) (sdr_base(n) + 0x07)
|
||||
#define SDRN_PESDR_BIST(n) (sdr_base(n) + 0x08)
|
||||
#define SDRN_PESDR_LPB(n) (sdr_base(n) + 0x0b)
|
||||
#define SDRN_PESDR_PHYSTA(n) (sdr_base(n) + 0x0c)
|
||||
|
||||
#define PESDR0_UTLSET1 0x0400
|
||||
#define PESDR0_UTLSET2 0x0401
|
||||
#define PESDR0_DLPSET 0x0402
|
||||
#define PESDR0_LOOP 0x0403
|
||||
#define PESDR0_RCSSET 0x0404
|
||||
#define PESDR0_RCSSTS 0x0405
|
||||
#define PESDR0_PHYSET1 0x0406
|
||||
#define PESDR0_PHYSET2 0x0407
|
||||
#define PESDR0_BIST 0x0408
|
||||
#define PESDR0_LPB 0x040B
|
||||
#define PESDR0_PHYSTA 0x040C
|
||||
|
||||
#define PESDR1_UTLSET1 0x0440
|
||||
#define PESDR1_UTLSET2 0x0441
|
||||
#define PESDR1_DLPSET 0x0442
|
||||
#define PESDR1_LOOP 0x0443
|
||||
#define PESDR1_RCSSET 0x0444
|
||||
#define PESDR1_RCSSTS 0x0445
|
||||
#define PESDR1_PHYSET1 0x0446
|
||||
#define PESDR1_PHYSET2 0x0447
|
||||
#define PESDR1_BIST 0x0448
|
||||
#define PESDR1_LPB 0x044B
|
||||
#define PESDR1_PHYSTA 0x044C
|
||||
|
||||
#elif defined(CONFIG_460EX) || defined(CONFIG_460GT)
|
||||
|
||||
#define PESDR0_L0BIST 0x0308 /* PE0 L0 built in self test */
|
||||
#define PESDR0_L0BISTSTS 0x0309 /* PE0 L0 built in self test status */
|
||||
#define PESDR0_L0CDRCTL 0x030A /* PE0 L0 CDR control */
|
||||
#define PESDR0_L0DRV 0x030B /* PE0 L0 drive */
|
||||
#define PESDR0_L0REC 0x030C /* PE0 L0 receiver */
|
||||
#define PESDR0_L0LPB 0x030D /* PE0 L0 loopback */
|
||||
#define PESDR0_L0CLK 0x030E /* PE0 L0 clocking */
|
||||
#define PESDR0_PHY_CTL_RST 0x030F /* PE0 PHY control reset */
|
||||
#define PESDR0_RSTSTA 0x0310 /* PE0 reset status */
|
||||
#define PESDR0_OBS 0x0311 /* PE0 observation register */
|
||||
#define PESDR0_L0ERRC 0x0320 /* PE0 L0 error counter */
|
||||
|
||||
#define PESDR1_L0BIST 0x0348 /* PE1 L0 built in self test */
|
||||
#define PESDR1_L1BIST 0x0349 /* PE1 L1 built in self test */
|
||||
#define PESDR1_L2BIST 0x034A /* PE1 L2 built in self test */
|
||||
#define PESDR1_L3BIST 0x034B /* PE1 L3 built in self test */
|
||||
#define PESDR1_L0BISTSTS 0x034C /* PE1 L0 built in self test status */
|
||||
#define PESDR1_L1BISTSTS 0x034D /* PE1 L1 built in self test status */
|
||||
#define PESDR1_L2BISTSTS 0x034E /* PE1 L2 built in self test status */
|
||||
#define PESDR1_L3BISTSTS 0x034F /* PE1 L3 built in self test status */
|
||||
#define PESDR1_L0CDRCTL 0x0350 /* PE1 L0 CDR control */
|
||||
#define PESDR1_L1CDRCTL 0x0351 /* PE1 L1 CDR control */
|
||||
#define PESDR1_L2CDRCTL 0x0352 /* PE1 L2 CDR control */
|
||||
#define PESDR1_L3CDRCTL 0x0353 /* PE1 L3 CDR control */
|
||||
#define PESDR1_L0DRV 0x0354 /* PE1 L0 drive */
|
||||
#define PESDR1_L1DRV 0x0355 /* PE1 L1 drive */
|
||||
#define PESDR1_L2DRV 0x0356 /* PE1 L2 drive */
|
||||
#define PESDR1_L3DRV 0x0357 /* PE1 L3 drive */
|
||||
#define PESDR1_L0REC 0x0358 /* PE1 L0 receiver */
|
||||
#define PESDR1_L1REC 0x0359 /* PE1 L1 receiver */
|
||||
#define PESDR1_L2REC 0x035A /* PE1 L2 receiver */
|
||||
#define PESDR1_L3REC 0x035B /* PE1 L3 receiver */
|
||||
#define PESDR1_L0LPB 0x035C /* PE1 L0 loopback */
|
||||
#define PESDR1_L1LPB 0x035D /* PE1 L1 loopback */
|
||||
#define PESDR1_L2LPB 0x035E /* PE1 L2 loopback */
|
||||
#define PESDR1_L3LPB 0x035F /* PE1 L3 loopback */
|
||||
#define PESDR1_L0CLK 0x0360 /* PE1 L0 clocking */
|
||||
#define PESDR1_L1CLK 0x0361 /* PE1 L1 clocking */
|
||||
#define PESDR1_L2CLK 0x0362 /* PE1 L2 clocking */
|
||||
#define PESDR1_L3CLK 0x0363 /* PE1 L3 clocking */
|
||||
#define PESDR1_PHY_CTL_RST 0x0364 /* PE1 PHY control reset */
|
||||
#define PESDR1_RSTSTA 0x0365 /* PE1 reset status */
|
||||
#define PESDR1_OBS 0x0366 /* PE1 observation register */
|
||||
#define PESDR1_L0ERRC 0x0368 /* PE1 L0 error counter */
|
||||
#define PESDR1_L1ERRC 0x0369 /* PE1 L1 error counter */
|
||||
#define PESDR1_L2ERRC 0x036A /* PE1 L2 error counter */
|
||||
#define PESDR1_L3ERRC 0x036B /* PE1 L3 error counter */
|
||||
#define PESDR0_IHS1 0x036C /* PE interrupt handler interfact setting 1 */
|
||||
#define PESDR0_IHS2 0x036D /* PE interrupt handler interfact setting 2 */
|
||||
|
||||
#endif
|
||||
|
||||
/* SDR Bit Mappings */
|
||||
#define PESDRx_RCSSET_HLDPLB 0x10000000
|
||||
#define PESDRx_RCSSET_RSTGU 0x01000000
|
||||
#define PESDRx_RCSSET_RDY 0x00100000
|
||||
#define PESDRx_RCSSET_RSTDL 0x00010000
|
||||
#define PESDRx_RCSSET_RSTPYN 0x00001000
|
||||
|
||||
#define PESDRx_RCSSTS_PLBIDL 0x10000000
|
||||
#define PESDRx_RCSSTS_HRSTRQ 0x01000000
|
||||
#define PESDRx_RCSSTS_PGRST 0x00100000
|
||||
#define PESDRx_RCSSTS_VC0ACT 0x00010000
|
||||
#define PESDRx_RCSSTS_BMEN 0x00000100
|
||||
|
||||
/*
|
||||
* UTL register offsets
|
||||
*/
|
||||
#define PEUTL_PBCTL 0x00
|
||||
#define PEUTL_PBBSZ 0x20
|
||||
#define PEUTL_OPDBSZ 0x68
|
||||
#define PEUTL_IPHBSZ 0x70
|
||||
#define PEUTL_IPDBSZ 0x78
|
||||
#define PEUTL_OUTTR 0x90
|
||||
#define PEUTL_INTR 0x98
|
||||
#define PEUTL_PCTL 0xa0
|
||||
#define PEUTL_RCSTA 0xb0
|
||||
#define PEUTL_RCIRQEN 0xb8
|
||||
|
||||
/*
|
||||
* Config space register offsets
|
||||
*/
|
||||
#define PECFG_BAR0LMPA 0x210
|
||||
#define PECFG_BAR0HMPA 0x214
|
||||
#define PECFG_BAR1MPA 0x218
|
||||
#define PECFG_BAR2LMPA 0x220
|
||||
#define PECFG_BAR2HMPA 0x224
|
||||
|
||||
#define PECFG_PIMEN 0x33c
|
||||
#define PECFG_PIM0LAL 0x340
|
||||
#define PECFG_PIM0LAH 0x344
|
||||
#define PECFG_PIM1LAL 0x348
|
||||
#define PECFG_PIM1LAH 0x34c
|
||||
#define PECFG_PIM01SAL 0x350
|
||||
#define PECFG_PIM01SAH 0x354
|
||||
|
||||
#define PECFG_POM0LAL 0x380
|
||||
#define PECFG_POM0LAH 0x384
|
||||
|
||||
#define SDR_READ(offset) ({\
|
||||
mtdcr(DCRN_SDR0_CFGADDR, offset); \
|
||||
mfdcr(DCRN_SDR0_CFGDATA);})
|
||||
|
||||
#define SDR_WRITE(offset, data) ({\
|
||||
mtdcr(DCRN_SDR0_CFGADDR, offset); \
|
||||
mtdcr(DCRN_SDR0_CFGDATA,data);})
|
||||
|
||||
#define GPL_DMER_MASK_DISA 0x02000000
|
||||
|
||||
#define U64_TO_U32_LOW(val) ((u32)((val) & 0x00000000ffffffffULL))
|
||||
#define U64_TO_U32_HIGH(val) ((u32)((val) >> 32))
|
||||
|
||||
/*
|
||||
* Prototypes
|
||||
*/
|
||||
int ppc4xx_init_pcie(void);
|
||||
int ppc4xx_init_pcie_rootport(int port);
|
||||
int ppc4xx_init_pcie_endport(int port);
|
||||
void ppc4xx_setup_pcie_rootpoint(struct pci_controller *hose, int port);
|
||||
int ppc4xx_setup_pcie_endpoint(struct pci_controller *hose, int port);
|
||||
int pcie_hose_scan(struct pci_controller *hose, int bus);
|
||||
|
||||
/*
|
||||
* Function to determine root port or endport from env variable.
|
||||
*/
|
||||
static inline int is_end_point(int port)
|
||||
{
|
||||
char s[10], *tk;
|
||||
char *pcie_mode = getenv("pcie_mode");
|
||||
|
||||
if (pcie_mode == NULL)
|
||||
return 0;
|
||||
|
||||
strcpy(s, pcie_mode);
|
||||
tk = strtok(s, ":");
|
||||
|
||||
switch (port) {
|
||||
case 0:
|
||||
if (tk != NULL) {
|
||||
if (!(strcmp(tk, "ep") && strcmp(tk, "EP")))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
|
||||
case 1:
|
||||
tk = strtok(NULL, ":");
|
||||
if (tk != NULL) {
|
||||
if (!(strcmp(tk, "ep") && strcmp(tk, "EP")))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
|
||||
case 2:
|
||||
tk = strtok(NULL, ":");
|
||||
if (tk != NULL)
|
||||
tk = strtok(NULL, ":");
|
||||
if (tk != NULL) {
|
||||
if (!(strcmp(tk, "ep") && strcmp(tk, "EP")))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(PCIE0_SDR)
|
||||
static inline u32 sdr_base(int port)
|
||||
{
|
||||
switch (port) {
|
||||
default: /* to satisfy compiler */
|
||||
case 0:
|
||||
return PCIE0_SDR;
|
||||
case 1:
|
||||
return PCIE1_SDR;
|
||||
#if CONFIG_SYS_PCIE_NR_PORTS > 2
|
||||
case 2:
|
||||
return PCIE2_SDR;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif /* defined(PCIE0_SDR) */
|
||||
|
||||
#endif /* __4XX_PCIE_H */
|
|
@ -35,8 +35,7 @@
|
|||
#define CONFIG_SYS_BOOT_GET_KBD
|
||||
|
||||
#ifndef CONFIG_MAX_MEM_MAPPED
|
||||
#if defined(CONFIG_4xx) || \
|
||||
defined(CONFIG_E500) || \
|
||||
#if defined(CONFIG_E500) || \
|
||||
defined(CONFIG_MPC86xx) || \
|
||||
defined(CONFIG_E300)
|
||||
#define CONFIG_MAX_MEM_MAPPED ((phys_size_t)2 << 30)
|
||||
|
|
|
@ -90,9 +90,6 @@ struct arch_global_data {
|
|||
unsigned int dp_alloc_base;
|
||||
unsigned int dp_alloc_top;
|
||||
#endif
|
||||
#if defined(CONFIG_4xx)
|
||||
u32 uart_clk;
|
||||
#endif /* CONFIG_4xx */
|
||||
#ifdef CONFIG_SYS_FPGA_COUNT
|
||||
unsigned fpga_state[CONFIG_SYS_FPGA_COUNT];
|
||||
#endif
|
||||
|
|
|
@ -9,17 +9,6 @@
|
|||
#ifndef INTERRUPT_H
|
||||
#define INTERRUPT_H
|
||||
|
||||
#if defined(CONFIG_XILINX_440)
|
||||
#include <asm/xilinx_irq.h>
|
||||
#else
|
||||
#include <asm/ppc4xx-uic.h>
|
||||
#endif
|
||||
|
||||
void pic_enable(void);
|
||||
void pic_irq_enable(unsigned int irq);
|
||||
void pic_irq_disable(unsigned int irq);
|
||||
void pic_irq_ack(unsigned int irq);
|
||||
void external_interrupt(struct pt_regs *regs);
|
||||
void interrupt_run_handler(int vec);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -585,213 +585,4 @@ extern int num_tlb_entries;
|
|||
#define LAWAR_SIZE_32G (LAWAR_SIZE_BASE+24)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_440
|
||||
/* General */
|
||||
#define TLB_VALID 0x00000200
|
||||
|
||||
/* Supported page sizes */
|
||||
|
||||
#define SZ_1K 0x00000000
|
||||
#define SZ_4K 0x00000010
|
||||
#define SZ_16K 0x00000020
|
||||
#define SZ_64K 0x00000030
|
||||
#define SZ_256K 0x00000040
|
||||
#define SZ_1M 0x00000050
|
||||
#define SZ_16M 0x00000070
|
||||
#define SZ_256M 0x00000090
|
||||
|
||||
/* Storage attributes */
|
||||
#define SA_W 0x00000800 /* Write-through */
|
||||
#define SA_I 0x00000400 /* Caching inhibited */
|
||||
#define SA_M 0x00000200 /* Memory coherence */
|
||||
#define SA_G 0x00000100 /* Guarded */
|
||||
#define SA_E 0x00000080 /* Endian */
|
||||
/* Some additional macros for combinations often used */
|
||||
#define SA_IG (SA_I | SA_G)
|
||||
|
||||
/* Access control */
|
||||
#define AC_X 0x00000024 /* Execute */
|
||||
#define AC_W 0x00000012 /* Write */
|
||||
#define AC_R 0x00000009 /* Read */
|
||||
/* Some additional macros for combinations often used */
|
||||
#define AC_RW (AC_R | AC_W)
|
||||
#define AC_RWX (AC_R | AC_W | AC_X)
|
||||
|
||||
/* Some handy macros */
|
||||
|
||||
#define EPN(e) ((e) & 0xfffffc00)
|
||||
#define TLB0(epn,sz) ((EPN((epn)) | (sz) | TLB_VALID ))
|
||||
#define TLB1(rpn,erpn) (((rpn) & 0xfffffc00) | (erpn))
|
||||
#define TLB2(a) ((a) & 0x00000fbf)
|
||||
|
||||
#define tlbtab_start\
|
||||
mflr r1 ;\
|
||||
bl 0f ;
|
||||
|
||||
#define tlbtab_end\
|
||||
.long 0, 0, 0 ;\
|
||||
0: mflr r0 ;\
|
||||
mtlr r1 ;\
|
||||
blr ;
|
||||
|
||||
#define tlbentry(epn,sz,rpn,erpn,attr)\
|
||||
.long TLB0(epn,sz),TLB1(rpn,erpn),TLB2(attr)
|
||||
|
||||
/*----------------------------------------------------------------------------+
|
||||
| TLB specific defines.
|
||||
+----------------------------------------------------------------------------*/
|
||||
#define TLB_256MB_ALIGN_MASK 0xFF0000000ULL
|
||||
#define TLB_16MB_ALIGN_MASK 0xFFF000000ULL
|
||||
#define TLB_1MB_ALIGN_MASK 0xFFFF00000ULL
|
||||
#define TLB_256KB_ALIGN_MASK 0xFFFFC0000ULL
|
||||
#define TLB_64KB_ALIGN_MASK 0xFFFFF0000ULL
|
||||
#define TLB_16KB_ALIGN_MASK 0xFFFFFC000ULL
|
||||
#define TLB_4KB_ALIGN_MASK 0xFFFFFF000ULL
|
||||
#define TLB_1KB_ALIGN_MASK 0xFFFFFFC00ULL
|
||||
#define TLB_256MB_SIZE 0x10000000
|
||||
#define TLB_16MB_SIZE 0x01000000
|
||||
#define TLB_1MB_SIZE 0x00100000
|
||||
#define TLB_256KB_SIZE 0x00040000
|
||||
#define TLB_64KB_SIZE 0x00010000
|
||||
#define TLB_16KB_SIZE 0x00004000
|
||||
#define TLB_4KB_SIZE 0x00001000
|
||||
#define TLB_1KB_SIZE 0x00000400
|
||||
|
||||
#define TLB_WORD0_EPN_MASK 0xFFFFFC00
|
||||
#define TLB_WORD0_EPN_ENCODE(n) (((unsigned long)(n))&0xFFFFFC00)
|
||||
#define TLB_WORD0_EPN_DECODE(n) (((unsigned long)(n))&0xFFFFFC00)
|
||||
#define TLB_WORD0_V_MASK 0x00000200
|
||||
#define TLB_WORD0_V_ENABLE 0x00000200
|
||||
#define TLB_WORD0_V_DISABLE 0x00000000
|
||||
#define TLB_WORD0_TS_MASK 0x00000100
|
||||
#define TLB_WORD0_TS_1 0x00000100
|
||||
#define TLB_WORD0_TS_0 0x00000000
|
||||
#define TLB_WORD0_SIZE_MASK 0x000000F0
|
||||
#define TLB_WORD0_SIZE_1KB 0x00000000
|
||||
#define TLB_WORD0_SIZE_4KB 0x00000010
|
||||
#define TLB_WORD0_SIZE_16KB 0x00000020
|
||||
#define TLB_WORD0_SIZE_64KB 0x00000030
|
||||
#define TLB_WORD0_SIZE_256KB 0x00000040
|
||||
#define TLB_WORD0_SIZE_1MB 0x00000050
|
||||
#define TLB_WORD0_SIZE_16MB 0x00000070
|
||||
#define TLB_WORD0_SIZE_256MB 0x00000090
|
||||
#define TLB_WORD0_TPAR_MASK 0x0000000F
|
||||
#define TLB_WORD0_TPAR_ENCODE(n) ((((unsigned long)(n))&0x0F)<<0)
|
||||
#define TLB_WORD0_TPAR_DECODE(n) ((((unsigned long)(n))>>0)&0x0F)
|
||||
|
||||
#define TLB_WORD1_RPN_MASK 0xFFFFFC00
|
||||
#define TLB_WORD1_RPN_ENCODE(n) (((unsigned long)(n))&0xFFFFFC00)
|
||||
#define TLB_WORD1_RPN_DECODE(n) (((unsigned long)(n))&0xFFFFFC00)
|
||||
#define TLB_WORD1_PAR1_MASK 0x00000300
|
||||
#define TLB_WORD1_PAR1_ENCODE(n) ((((unsigned long)(n))&0x03)<<8)
|
||||
#define TLB_WORD1_PAR1_DECODE(n) ((((unsigned long)(n))>>8)&0x03)
|
||||
#define TLB_WORD1_PAR1_0 0x00000000
|
||||
#define TLB_WORD1_PAR1_1 0x00000100
|
||||
#define TLB_WORD1_PAR1_2 0x00000200
|
||||
#define TLB_WORD1_PAR1_3 0x00000300
|
||||
#define TLB_WORD1_ERPN_MASK 0x0000000F
|
||||
#define TLB_WORD1_ERPN_ENCODE(n) ((((unsigned long)(n))&0x0F)<<0)
|
||||
#define TLB_WORD1_ERPN_DECODE(n) ((((unsigned long)(n))>>0)&0x0F)
|
||||
|
||||
#define TLB_WORD2_PAR2_MASK 0xC0000000
|
||||
#define TLB_WORD2_PAR2_ENCODE(n) ((((unsigned long)(n))&0x03)<<30)
|
||||
#define TLB_WORD2_PAR2_DECODE(n) ((((unsigned long)(n))>>30)&0x03)
|
||||
#define TLB_WORD2_PAR2_0 0x00000000
|
||||
#define TLB_WORD2_PAR2_1 0x40000000
|
||||
#define TLB_WORD2_PAR2_2 0x80000000
|
||||
#define TLB_WORD2_PAR2_3 0xC0000000
|
||||
#define TLB_WORD2_U0_MASK 0x00008000
|
||||
#define TLB_WORD2_U0_ENABLE 0x00008000
|
||||
#define TLB_WORD2_U0_DISABLE 0x00000000
|
||||
#define TLB_WORD2_U1_MASK 0x00004000
|
||||
#define TLB_WORD2_U1_ENABLE 0x00004000
|
||||
#define TLB_WORD2_U1_DISABLE 0x00000000
|
||||
#define TLB_WORD2_U2_MASK 0x00002000
|
||||
#define TLB_WORD2_U2_ENABLE 0x00002000
|
||||
#define TLB_WORD2_U2_DISABLE 0x00000000
|
||||
#define TLB_WORD2_U3_MASK 0x00001000
|
||||
#define TLB_WORD2_U3_ENABLE 0x00001000
|
||||
#define TLB_WORD2_U3_DISABLE 0x00000000
|
||||
#define TLB_WORD2_W_MASK 0x00000800
|
||||
#define TLB_WORD2_W_ENABLE 0x00000800
|
||||
#define TLB_WORD2_W_DISABLE 0x00000000
|
||||
#define TLB_WORD2_I_MASK 0x00000400
|
||||
#define TLB_WORD2_I_ENABLE 0x00000400
|
||||
#define TLB_WORD2_I_DISABLE 0x00000000
|
||||
#define TLB_WORD2_M_MASK 0x00000200
|
||||
#define TLB_WORD2_M_ENABLE 0x00000200
|
||||
#define TLB_WORD2_M_DISABLE 0x00000000
|
||||
#define TLB_WORD2_G_MASK 0x00000100
|
||||
#define TLB_WORD2_G_ENABLE 0x00000100
|
||||
#define TLB_WORD2_G_DISABLE 0x00000000
|
||||
#define TLB_WORD2_E_MASK 0x00000080
|
||||
#define TLB_WORD2_E_ENABLE 0x00000080
|
||||
#define TLB_WORD2_E_DISABLE 0x00000000
|
||||
#define TLB_WORD2_UX_MASK 0x00000020
|
||||
#define TLB_WORD2_UX_ENABLE 0x00000020
|
||||
#define TLB_WORD2_UX_DISABLE 0x00000000
|
||||
#define TLB_WORD2_UW_MASK 0x00000010
|
||||
#define TLB_WORD2_UW_ENABLE 0x00000010
|
||||
#define TLB_WORD2_UW_DISABLE 0x00000000
|
||||
#define TLB_WORD2_UR_MASK 0x00000008
|
||||
#define TLB_WORD2_UR_ENABLE 0x00000008
|
||||
#define TLB_WORD2_UR_DISABLE 0x00000000
|
||||
#define TLB_WORD2_SX_MASK 0x00000004
|
||||
#define TLB_WORD2_SX_ENABLE 0x00000004
|
||||
#define TLB_WORD2_SX_DISABLE 0x00000000
|
||||
#define TLB_WORD2_SW_MASK 0x00000002
|
||||
#define TLB_WORD2_SW_ENABLE 0x00000002
|
||||
#define TLB_WORD2_SW_DISABLE 0x00000000
|
||||
#define TLB_WORD2_SR_MASK 0x00000001
|
||||
#define TLB_WORD2_SR_ENABLE 0x00000001
|
||||
#define TLB_WORD2_SR_DISABLE 0x00000000
|
||||
|
||||
/*----------------------------------------------------------------------------+
|
||||
| Following instructions are not available in Book E mode of the GNU assembler.
|
||||
+----------------------------------------------------------------------------*/
|
||||
#define DCCCI(ra,rb) .long 0x7c000000|\
|
||||
(ra<<16)|(rb<<11)|(454<<1)
|
||||
|
||||
#define ICCCI(ra,rb) .long 0x7c000000|\
|
||||
(ra<<16)|(rb<<11)|(966<<1)
|
||||
|
||||
#define DCREAD(rt,ra,rb) .long 0x7c000000|\
|
||||
(rt<<21)|(ra<<16)|(rb<<11)|(486<<1)
|
||||
|
||||
#define ICREAD(ra,rb) .long 0x7c000000|\
|
||||
(ra<<16)|(rb<<11)|(998<<1)
|
||||
|
||||
#define TLBSX(rt,ra,rb) .long 0x7c000000|\
|
||||
(rt<<21)|(ra<<16)|(rb<<11)|(914<<1)
|
||||
|
||||
#define TLBWE(rs,ra,ws) .long 0x7c000000|\
|
||||
(rs<<21)|(ra<<16)|(ws<<11)|(978<<1)
|
||||
|
||||
#define TLBRE(rt,ra,ws) .long 0x7c000000|\
|
||||
(rt<<21)|(ra<<16)|(ws<<11)|(946<<1)
|
||||
|
||||
#define TLBSXDOT(rt,ra,rb) .long 0x7c000001|\
|
||||
(rt<<21)|(ra<<16)|(rb<<11)|(914<<1)
|
||||
|
||||
#define MSYNC .long 0x7c000000|\
|
||||
(598<<1)
|
||||
|
||||
#define MBAR_INST .long 0x7c000000|\
|
||||
(854<<1)
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
/* Prototypes */
|
||||
void mttlb1(unsigned long index, unsigned long value);
|
||||
void mttlb2(unsigned long index, unsigned long value);
|
||||
void mttlb3(unsigned long index, unsigned long value);
|
||||
unsigned long mftlb1(unsigned long index);
|
||||
unsigned long mftlb2(unsigned long index);
|
||||
unsigned long mftlb3(unsigned long index);
|
||||
|
||||
void program_tlb(u64 phys_addr, u32 virt_addr, u32 size, u32 tlb_word2_i_value);
|
||||
void remove_tlb(u32 vaddr, u32 size);
|
||||
void change_tlb(u32 vaddr, u32 size, u32 tlb_word2_i_value);
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#endif /* CONFIG_440 */
|
||||
#endif /* _PPC_MMU_H_ */
|
||||
|
|
|
@ -25,9 +25,6 @@
|
|||
#include <mpc83xx.h>
|
||||
#include <asm/immap_83xx.h>
|
||||
#endif
|
||||
#ifdef CONFIG_4xx
|
||||
#include <asm/ppc4xx.h>
|
||||
#endif
|
||||
#ifdef CONFIG_SOC_DA8XX
|
||||
#include <asm/arch/hardware.h>
|
||||
#endif
|
||||
|
@ -47,8 +44,7 @@ uint rd_dc_cst(void);
|
|||
void wr_dc_cst(uint);
|
||||
void wr_dc_adr(uint);
|
||||
|
||||
#if defined(CONFIG_4xx) || \
|
||||
defined(CONFIG_MPC85xx) || \
|
||||
#if defined(CONFIG_MPC85xx) || \
|
||||
defined(CONFIG_MPC86xx) || \
|
||||
defined(CONFIG_MPC83xx)
|
||||
unsigned char in8(unsigned int);
|
||||
|
|
|
@ -1,57 +0,0 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: GPL-2.0 IBM-pibs
|
||||
*/
|
||||
|
||||
#ifndef __PPC405_H__
|
||||
#define __PPC405_H__
|
||||
|
||||
/* Define bits and masks for real-mode storage attribute control registers */
|
||||
#define PPC_128MB_SACR_BIT(addr) ((addr) >> 27)
|
||||
#define PPC_128MB_SACR_VALUE(addr) PPC_REG_VAL(PPC_128MB_SACR_BIT(addr),1)
|
||||
|
||||
#define CONFIG_SYS_DCACHE_SIZE (16 << 10) /* For AMCC 405 CPUs */
|
||||
|
||||
/* DCR registers */
|
||||
#define PLB0_ACR 0x0087
|
||||
|
||||
/* SDR registers */
|
||||
#define SDR0_PINSTP 0x0040
|
||||
|
||||
/* CPR registers */
|
||||
#define CPR0_CLKUPD 0x0020
|
||||
#define CPR0_PLLC 0x0040
|
||||
#define CPR0_PLLD 0x0060
|
||||
#define CPR0_CPUD 0x0080
|
||||
#define CPR0_PLBD 0x00a0
|
||||
#define CPR0_OPBD0 0x00c0
|
||||
#define CPR0_PERD 0x00e0
|
||||
|
||||
/*
|
||||
* DMA
|
||||
*/
|
||||
#define DMA_DCR_BASE 0x0100
|
||||
#define DMACR0 (DMA_DCR_BASE + 0x00) /* DMA channel control reg 0 */
|
||||
#define DMACT0 (DMA_DCR_BASE + 0x01) /* DMA count reg 0 */
|
||||
#define DMADA0 (DMA_DCR_BASE + 0x02) /* DMA destination address reg 0 */
|
||||
#define DMASA0 (DMA_DCR_BASE + 0x03) /* DMA source address reg 0 */
|
||||
#define DMASB0 (DMA_DCR_BASE + 0x04) /* DMA sg descriptor addr 0 */
|
||||
#define DMACR1 (DMA_DCR_BASE + 0x08) /* DMA channel control reg 1 */
|
||||
#define DMACT1 (DMA_DCR_BASE + 0x09) /* DMA count reg 1 */
|
||||
#define DMADA1 (DMA_DCR_BASE + 0x0a) /* DMA destination address reg 1 */
|
||||
#define DMASA1 (DMA_DCR_BASE + 0x0b) /* DMA source address reg 1 */
|
||||
#define DMASB1 (DMA_DCR_BASE + 0x0c) /* DMA sg descriptor addr 1 */
|
||||
#define DMACR2 (DMA_DCR_BASE + 0x10) /* DMA channel control reg 2 */
|
||||
#define DMACT2 (DMA_DCR_BASE + 0x11) /* DMA count reg 2 */
|
||||
#define DMADA2 (DMA_DCR_BASE + 0x12) /* DMA destination address reg 2 */
|
||||
#define DMASA2 (DMA_DCR_BASE + 0x13) /* DMA source address reg 2 */
|
||||
#define DMASB2 (DMA_DCR_BASE + 0x14) /* DMA sg descriptor addr 2 */
|
||||
#define DMACR3 (DMA_DCR_BASE + 0x18) /* DMA channel control reg 3 */
|
||||
#define DMACT3 (DMA_DCR_BASE + 0x19) /* DMA count reg 3 */
|
||||
#define DMADA3 (DMA_DCR_BASE + 0x1a) /* DMA destination address reg 3 */
|
||||
#define DMASA3 (DMA_DCR_BASE + 0x1b) /* DMA source address reg 3 */
|
||||
#define DMASB3 (DMA_DCR_BASE + 0x1c) /* DMA sg descriptor addr 3 */
|
||||
#define DMASR (DMA_DCR_BASE + 0x20) /* DMA status reg */
|
||||
#define DMASGC (DMA_DCR_BASE + 0x23) /* DMA scatter/gather command reg*/
|
||||
#define DMAADR (DMA_DCR_BASE + 0x24) /* DMA address decode reg */
|
||||
|
||||
#endif /* __PPC405_H__ */
|
|
@ -1,239 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2010
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef _PPC405EP_H_
|
||||
#define _PPC405EP_H_
|
||||
|
||||
#define CONFIG_SDRAM_PPC4xx_IBM_SDRAM /* IBM SDRAM controller */
|
||||
|
||||
/* Memory mapped register */
|
||||
#define CONFIG_SYS_PERIPHERAL_BASE 0xef600000 /* Internal Peripherals */
|
||||
|
||||
#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_PERIPHERAL_BASE + 0x0300)
|
||||
#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_PERIPHERAL_BASE + 0x0400)
|
||||
|
||||
#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0700)
|
||||
|
||||
/* DCR */
|
||||
#define OCM0_ISCNTL 0x0019 /* OCM I-side control reg */
|
||||
#define OCM0_DSARC 0x001a /* OCM D-side address compare */
|
||||
#define OCM0_DSCNTL 0x001b /* OCM D-side control */
|
||||
#define CPC0_PLLMR0 0x00f0 /* PLL mode register 0 */
|
||||
#define CPC0_BOOT 0x00f1 /* Clock status register */
|
||||
#define CPC0_CR1 0x00f2 /* Chip Control 1 register */
|
||||
#define CPC0_EPCTL 0x00f3 /* EMAC to PHY control register */
|
||||
#define CPC0_PLLMR1 0x00f4 /* PLL mode register 1 */
|
||||
#define CPC0_UCR 0x00f5 /* UART control register */
|
||||
#define CPC0_SRR 0x00f6 /* Soft Reset register */
|
||||
#define CPC0_PCI 0x00f9 /* PCI control register */
|
||||
|
||||
/* Defines for CPC0_EPCTL register */
|
||||
#define CPC0_EPCTL_E0NFE 0x80000000
|
||||
#define CPC0_EPCTL_E1NFE 0x40000000
|
||||
|
||||
/* Defines for CPC0_PCI Register */
|
||||
#define CPC0_PCI_SPE 0x00000010 /* PCIINT/WE select */
|
||||
#define CPC0_PCI_HOST_CFG_EN 0x00000008 /* PCI host config Enable */
|
||||
#define CPC0_PCI_ARBIT_EN 0x00000001 /* PCI Internal Arb Enabled */
|
||||
|
||||
/* Defines for CPC0_BOOR Register */
|
||||
#define CPC0_BOOT_SEP 0x00000002 /* serial EEPROM present */
|
||||
|
||||
/* Bit definitions */
|
||||
#define PLLMR0_CPU_DIV_MASK 0x00300000 /* CPU clock divider */
|
||||
#define PLLMR0_CPU_DIV_BYPASS 0x00000000
|
||||
#define PLLMR0_CPU_DIV_2 0x00100000
|
||||
#define PLLMR0_CPU_DIV_3 0x00200000
|
||||
#define PLLMR0_CPU_DIV_4 0x00300000
|
||||
|
||||
#define PLLMR0_CPU_TO_PLB_MASK 0x00030000 /* CPU:PLB Frequency Divisor */
|
||||
#define PLLMR0_CPU_PLB_DIV_1 0x00000000
|
||||
#define PLLMR0_CPU_PLB_DIV_2 0x00010000
|
||||
#define PLLMR0_CPU_PLB_DIV_3 0x00020000
|
||||
#define PLLMR0_CPU_PLB_DIV_4 0x00030000
|
||||
|
||||
#define PLLMR0_OPB_TO_PLB_MASK 0x00003000 /* OPB:PLB Frequency Divisor */
|
||||
#define PLLMR0_OPB_PLB_DIV_1 0x00000000
|
||||
#define PLLMR0_OPB_PLB_DIV_2 0x00001000
|
||||
#define PLLMR0_OPB_PLB_DIV_3 0x00002000
|
||||
#define PLLMR0_OPB_PLB_DIV_4 0x00003000
|
||||
|
||||
#define PLLMR0_EXB_TO_PLB_MASK 0x00000300 /* External Bus:PLB Divisor */
|
||||
#define PLLMR0_EXB_PLB_DIV_2 0x00000000
|
||||
#define PLLMR0_EXB_PLB_DIV_3 0x00000100
|
||||
#define PLLMR0_EXB_PLB_DIV_4 0x00000200
|
||||
#define PLLMR0_EXB_PLB_DIV_5 0x00000300
|
||||
|
||||
#define PLLMR0_MAL_TO_PLB_MASK 0x00000030 /* MAL:PLB Divisor */
|
||||
#define PLLMR0_MAL_PLB_DIV_1 0x00000000
|
||||
#define PLLMR0_MAL_PLB_DIV_2 0x00000010
|
||||
#define PLLMR0_MAL_PLB_DIV_3 0x00000020
|
||||
#define PLLMR0_MAL_PLB_DIV_4 0x00000030
|
||||
|
||||
#define PLLMR0_PCI_TO_PLB_MASK 0x00000003 /* PCI:PLB Frequency Divisor */
|
||||
#define PLLMR0_PCI_PLB_DIV_1 0x00000000
|
||||
#define PLLMR0_PCI_PLB_DIV_2 0x00000001
|
||||
#define PLLMR0_PCI_PLB_DIV_3 0x00000002
|
||||
#define PLLMR0_PCI_PLB_DIV_4 0x00000003
|
||||
|
||||
#define PLLMR1_SSCS_MASK 0x80000000 /* Select system clock source */
|
||||
#define PLLMR1_PLLR_MASK 0x40000000 /* PLL reset */
|
||||
#define PLLMR1_FBMUL_MASK 0x00F00000 /* PLL feedback multiplier value */
|
||||
|
||||
#define PLLMR1_FWDVA_MASK 0x00070000 /* PLL forward divider A value */
|
||||
#define PLLMR1_FWDVB_MASK 0x00007000 /* PLL forward divider B value */
|
||||
#define PLLMR1_TUNING_MASK 0x000003FF /* PLL tune bits */
|
||||
|
||||
/* Defines for CPC0_PLLMR1 Register fields */
|
||||
#define PLL_ACTIVE 0x80000000
|
||||
#define CPC0_PLLMR1_SSCS 0x80000000
|
||||
#define PLL_RESET 0x40000000
|
||||
#define CPC0_PLLMR1_PLLR 0x40000000
|
||||
/* Feedback multiplier */
|
||||
#define PLL_FBKDIV 0x00F00000
|
||||
#define CPC0_PLLMR1_FBDV 0x00F00000
|
||||
#define PLL_FBKDIV_16 0x00000000
|
||||
#define PLL_FBKDIV_1 0x00100000
|
||||
#define PLL_FBKDIV_2 0x00200000
|
||||
#define PLL_FBKDIV_3 0x00300000
|
||||
#define PLL_FBKDIV_4 0x00400000
|
||||
#define PLL_FBKDIV_5 0x00500000
|
||||
#define PLL_FBKDIV_6 0x00600000
|
||||
#define PLL_FBKDIV_7 0x00700000
|
||||
#define PLL_FBKDIV_8 0x00800000
|
||||
#define PLL_FBKDIV_9 0x00900000
|
||||
#define PLL_FBKDIV_10 0x00A00000
|
||||
#define PLL_FBKDIV_11 0x00B00000
|
||||
#define PLL_FBKDIV_12 0x00C00000
|
||||
#define PLL_FBKDIV_13 0x00D00000
|
||||
#define PLL_FBKDIV_14 0x00E00000
|
||||
#define PLL_FBKDIV_15 0x00F00000
|
||||
/* Forward A divisor */
|
||||
#define PLL_FWDDIVA 0x00070000
|
||||
#define CPC0_PLLMR1_FWDVA 0x00070000
|
||||
#define PLL_FWDDIVA_8 0x00000000
|
||||
#define PLL_FWDDIVA_7 0x00010000
|
||||
#define PLL_FWDDIVA_6 0x00020000
|
||||
#define PLL_FWDDIVA_5 0x00030000
|
||||
#define PLL_FWDDIVA_4 0x00040000
|
||||
#define PLL_FWDDIVA_3 0x00050000
|
||||
#define PLL_FWDDIVA_2 0x00060000
|
||||
#define PLL_FWDDIVA_1 0x00070000
|
||||
/* Forward B divisor */
|
||||
#define PLL_FWDDIVB 0x00007000
|
||||
#define CPC0_PLLMR1_FWDVB 0x00007000
|
||||
#define PLL_FWDDIVB_8 0x00000000
|
||||
#define PLL_FWDDIVB_7 0x00001000
|
||||
#define PLL_FWDDIVB_6 0x00002000
|
||||
#define PLL_FWDDIVB_5 0x00003000
|
||||
#define PLL_FWDDIVB_4 0x00004000
|
||||
#define PLL_FWDDIVB_3 0x00005000
|
||||
#define PLL_FWDDIVB_2 0x00006000
|
||||
#define PLL_FWDDIVB_1 0x00007000
|
||||
/* PLL tune bits */
|
||||
#define PLL_TUNE_MASK 0x000003FF
|
||||
#define PLL_TUNE_2_M_3 0x00000133 /* 2 <= M <= 3 */
|
||||
#define PLL_TUNE_4_M_6 0x00000134 /* 3 < M <= 6 */
|
||||
#define PLL_TUNE_7_M_10 0x00000138 /* 6 < M <= 10 */
|
||||
#define PLL_TUNE_11_M_14 0x0000013C /* 10 < M <= 14 */
|
||||
#define PLL_TUNE_15_M_40 0x0000023E /* 14 < M <= 40 */
|
||||
#define PLL_TUNE_VCO_LOW 0x00000000 /* 500MHz <= VCO <= 800MHz */
|
||||
#define PLL_TUNE_VCO_HI 0x00000080 /* 800MHz < VCO <= 1000MHz */
|
||||
|
||||
/* Defines for CPC0_PLLMR0 Register fields */
|
||||
/* CPU divisor */
|
||||
#define PLL_CPUDIV 0x00300000
|
||||
#define CPC0_PLLMR0_CCDV 0x00300000
|
||||
#define PLL_CPUDIV_1 0x00000000
|
||||
#define PLL_CPUDIV_2 0x00100000
|
||||
#define PLL_CPUDIV_3 0x00200000
|
||||
#define PLL_CPUDIV_4 0x00300000
|
||||
/* PLB divisor */
|
||||
#define PLL_PLBDIV 0x00030000
|
||||
#define CPC0_PLLMR0_CBDV 0x00030000
|
||||
#define PLL_PLBDIV_1 0x00000000
|
||||
#define PLL_PLBDIV_2 0x00010000
|
||||
#define PLL_PLBDIV_3 0x00020000
|
||||
#define PLL_PLBDIV_4 0x00030000
|
||||
/* OPB divisor */
|
||||
#define PLL_OPBDIV 0x00003000
|
||||
#define CPC0_PLLMR0_OPDV 0x00003000
|
||||
#define PLL_OPBDIV_1 0x00000000
|
||||
#define PLL_OPBDIV_2 0x00001000
|
||||
#define PLL_OPBDIV_3 0x00002000
|
||||
#define PLL_OPBDIV_4 0x00003000
|
||||
/* EBC divisor */
|
||||
#define PLL_EXTBUSDIV 0x00000300
|
||||
#define CPC0_PLLMR0_EPDV 0x00000300
|
||||
#define PLL_EXTBUSDIV_2 0x00000000
|
||||
#define PLL_EXTBUSDIV_3 0x00000100
|
||||
#define PLL_EXTBUSDIV_4 0x00000200
|
||||
#define PLL_EXTBUSDIV_5 0x00000300
|
||||
/* MAL divisor */
|
||||
#define PLL_MALDIV 0x00000030
|
||||
#define CPC0_PLLMR0_MPDV 0x00000030
|
||||
#define PLL_MALDIV_1 0x00000000
|
||||
#define PLL_MALDIV_2 0x00000010
|
||||
#define PLL_MALDIV_3 0x00000020
|
||||
#define PLL_MALDIV_4 0x00000030
|
||||
/* PCI divisor */
|
||||
#define PLL_PCIDIV 0x00000003
|
||||
#define CPC0_PLLMR0_PPFD 0x00000003
|
||||
#define PLL_PCIDIV_1 0x00000000
|
||||
#define PLL_PCIDIV_2 0x00000001
|
||||
#define PLL_PCIDIV_3 0x00000002
|
||||
#define PLL_PCIDIV_4 0x00000003
|
||||
|
||||
/*
|
||||
* PLL settings for 266MHz CPU, 133MHz PLB/SDRAM, 66MHz EBC, 33MHz PCI,
|
||||
* assuming a 33.3MHz input clock to the 405EP.
|
||||
*/
|
||||
#define PLLMR0_266_133_66 (PLL_CPUDIV_1 | PLL_PLBDIV_2 | \
|
||||
PLL_OPBDIV_2 | PLL_EXTBUSDIV_2 | \
|
||||
PLL_MALDIV_1 | PLL_PCIDIV_4)
|
||||
#define PLLMR1_266_133_66 (PLL_FBKDIV_8 | \
|
||||
PLL_FWDDIVA_3 | PLL_FWDDIVB_3 | \
|
||||
PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
|
||||
|
||||
#define PLLMR0_133_66_66_33 (PLL_CPUDIV_1 | PLL_PLBDIV_1 | \
|
||||
PLL_OPBDIV_2 | PLL_EXTBUSDIV_4 | \
|
||||
PLL_MALDIV_1 | PLL_PCIDIV_4)
|
||||
#define PLLMR1_133_66_66_33 (PLL_FBKDIV_4 | \
|
||||
PLL_FWDDIVA_6 | PLL_FWDDIVB_6 | \
|
||||
PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
|
||||
#define PLLMR0_200_100_50_33 (PLL_CPUDIV_1 | PLL_PLBDIV_2 | \
|
||||
PLL_OPBDIV_2 | PLL_EXTBUSDIV_3 | \
|
||||
PLL_MALDIV_1 | PLL_PCIDIV_4)
|
||||
#define PLLMR1_200_100_50_33 (PLL_FBKDIV_6 | \
|
||||
PLL_FWDDIVA_4 | PLL_FWDDIVB_4 | \
|
||||
PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
|
||||
#define PLLMR0_266_133_66_33 (PLL_CPUDIV_1 | PLL_PLBDIV_2 | \
|
||||
PLL_OPBDIV_2 | PLL_EXTBUSDIV_4 | \
|
||||
PLL_MALDIV_1 | PLL_PCIDIV_4)
|
||||
#define PLLMR1_266_133_66_33 (PLL_FBKDIV_8 | \
|
||||
PLL_FWDDIVA_3 | PLL_FWDDIVB_3 | \
|
||||
PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
|
||||
#define PLLMR0_266_66_33_33 (PLL_CPUDIV_1 | PLL_PLBDIV_4 | \
|
||||
PLL_OPBDIV_2 | PLL_EXTBUSDIV_2 | \
|
||||
PLL_MALDIV_1 | PLL_PCIDIV_2)
|
||||
#define PLLMR1_266_66_33_33 (PLL_FBKDIV_8 | \
|
||||
PLL_FWDDIVA_3 | PLL_FWDDIVB_3 | \
|
||||
PLL_TUNE_15_M_40 | PLL_TUNE_VCO_LOW)
|
||||
#define PLLMR0_333_111_55_37 (PLL_CPUDIV_1 | PLL_PLBDIV_3 | \
|
||||
PLL_OPBDIV_2 | PLL_EXTBUSDIV_2 | \
|
||||
PLL_MALDIV_1 | PLL_PCIDIV_3)
|
||||
#define PLLMR1_333_111_55_37 (PLL_FBKDIV_10 | \
|
||||
PLL_FWDDIVA_3 | PLL_FWDDIVB_3 | \
|
||||
PLL_TUNE_15_M_40 | PLL_TUNE_VCO_HI)
|
||||
#define PLLMR0_333_111_55_111 (PLL_CPUDIV_1 | PLL_PLBDIV_3 | \
|
||||
PLL_OPBDIV_2 | PLL_EXTBUSDIV_2 | \
|
||||
PLL_MALDIV_1 | PLL_PCIDIV_1)
|
||||
#define PLLMR1_333_111_55_111 (PLL_FBKDIV_10 | \
|
||||
PLL_FWDDIVA_3 | PLL_FWDDIVB_3 | \
|
||||
PLL_TUNE_15_M_40 | PLL_TUNE_VCO_HI)
|
||||
|
||||
#endif /* _PPC405EP_H_ */
|
|
@ -1,82 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2010
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef _PPC405EX_H_
|
||||
#define _PPC405EX_H_
|
||||
|
||||
#define CONFIG_SDRAM_PPC4xx_IBM_DDR2 /* IBM DDR(2) controller */
|
||||
|
||||
#define CONFIG_NAND_NDFC
|
||||
|
||||
/* Memory mapped register */
|
||||
#define CONFIG_SYS_PERIPHERAL_BASE 0xef600000 /* Internal Peripherals */
|
||||
|
||||
#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_PERIPHERAL_BASE + 0x0200)
|
||||
#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_PERIPHERAL_BASE + 0x0300)
|
||||
|
||||
#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0800)
|
||||
|
||||
/* SDR */
|
||||
#define SDR0_SDCS0 0x0060
|
||||
#define SDR0_UART0 0x0120 /* UART0 Config */
|
||||
#define SDR0_UART1 0x0121 /* UART1 Config */
|
||||
#define SDR0_SRST 0x0200
|
||||
#define SDR0_CUST0 0x4000
|
||||
#define SDR0_PFC0 0x4100
|
||||
#define SDR0_PFC1 0x4101
|
||||
#define SDR0_MFR 0x4300 /* SDR0_MFR reg */
|
||||
|
||||
#define SDR0_ECID0 0x0080
|
||||
#define SDR0_ECID1 0x0081
|
||||
#define SDR0_ECID2 0x0082
|
||||
#define SDR0_ECID3 0x0083
|
||||
|
||||
#define SDR0_SDCS_SDD (0x80000000 >> 31)
|
||||
|
||||
#define SDR0_SRST_DMC (0x80000000 >> 10)
|
||||
|
||||
#define SDR0_CUST0_MUX_E_N_G_MASK 0xC0000000 /* Mux_Emac_NDFC_GPIO */
|
||||
#define SDR0_CUST0_MUX_EMAC_SEL 0x40000000 /* Emac Selection */
|
||||
#define SDR0_CUST0_MUX_NDFC_SEL 0x80000000 /* NDFC Selection */
|
||||
#define SDR0_CUST0_MUX_GPIO_SEL 0xC0000000 /* GPIO Selection */
|
||||
|
||||
#define SDR0_CUST0_NDFC_EN_MASK 0x20000000 /* NDFC Enable Mask */
|
||||
#define SDR0_CUST0_NDFC_ENABLE 0x20000000 /* NDFC Enable */
|
||||
#define SDR0_CUST0_NDFC_DISABLE 0x00000000 /* NDFC Disable */
|
||||
|
||||
#define SDR0_CUST0_NDFC_BW_MASK 0x10000000 /* NDFC Boot Width */
|
||||
#define SDR0_CUST0_NDFC_BW_16_BIT 0x10000000 /* NDFC Boot Width= 16 Bit */
|
||||
#define SDR0_CUST0_NDFC_BW_8_BIT 0x00000000 /* NDFC Boot Width= 8 Bit */
|
||||
|
||||
#define SDR0_CUST0_NDFC_BP_MASK 0x0F000000 /* NDFC Boot Page */
|
||||
#define SDR0_CUST0_NDFC_BP_ENCODE(n) ((((u32)(n)) & 0xF) << 24)
|
||||
#define SDR0_CUST0_NDFC_BP_DECODE(n) ((((u32)(n)) >> 24) & 0xF)
|
||||
|
||||
#define SDR0_CUST0_NDFC_BAC_MASK 0x00C00000 /* NDFC Boot Address Cycle */
|
||||
#define SDR0_CUST0_NDFC_BAC_ENCODE(n) ((((u32)(n)) & 0x3) << 22)
|
||||
#define SDR0_CUST0_NDFC_BAC_DECODE(n) ((((u32)(n)) >> 22) & 0x3)
|
||||
|
||||
#define SDR0_CUST0_NDFC_ARE_MASK 0x00200000 /* NDFC Auto Read Enable */
|
||||
#define SDR0_CUST0_NDFC_ARE_ENABLE 0x00200000 /* NDFC Auto Read Enable */
|
||||
#define SDR0_CUST0_NDFC_ARE_DISABLE 0x00000000 /* NDFC Auto Read Disable */
|
||||
|
||||
#define SDR0_CUST0_NRB_MASK 0x00100000 /* NDFC Ready / Busy */
|
||||
#define SDR0_CUST0_NRB_BUSY 0x00100000 /* Busy */
|
||||
#define SDR0_CUST0_NRB_READY 0x00000000 /* Ready */
|
||||
|
||||
#define SDR0_PFC1_U1ME 0x02000000
|
||||
#define SDR0_PFC1_U0ME 0x00080000
|
||||
#define SDR0_PFC1_U0IM 0x00040000
|
||||
#define SDR0_PFC1_SIS 0x00020000
|
||||
#define SDR0_PFC1_DMAAEN 0x00010000
|
||||
#define SDR0_PFC1_DMADEN 0x00008000
|
||||
#define SDR0_PFC1_USBEN 0x00004000
|
||||
#define SDR0_PFC1_AHBSWAP 0x00000020
|
||||
#define SDR0_PFC1_USBBIGEN 0x00000010
|
||||
#define SDR0_PFC1_GPT_FREQ 0x0000000f
|
||||
|
||||
#endif /* _PPC405EX_H_ */
|
|
@ -1,89 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2010
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef _PPC405EZ_H_
|
||||
#define _PPC405EZ_H_
|
||||
|
||||
#define CONFIG_NAND_NDFC
|
||||
|
||||
/* Memory mapped register */
|
||||
#define CONFIG_SYS_PERIPHERAL_BASE 0xef600000 /* Internal Peripherals */
|
||||
|
||||
#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_PERIPHERAL_BASE + 0x0300)
|
||||
#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_PERIPHERAL_BASE + 0x0400)
|
||||
|
||||
#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0700)
|
||||
#define GPIO1_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0800)
|
||||
|
||||
/* DCR register */
|
||||
#define OCM0_PLBCR1 0x0020 /* OCM PLB3 Bank 1 Config */
|
||||
#define OCM0_PLBCR2 0x0021 /* OCM PLB3 Bank 2 Config */
|
||||
#define OCM0_PLBBEAR 0x0022 /* OCM PLB3 Bus Error Add */
|
||||
#define OCM0_DSRC1 0x0028 /* OCM D-side Bank 1 Config */
|
||||
#define OCM0_DSRC2 0x0029 /* OCM D-side Bank 2 Config */
|
||||
#define OCM0_ISRC1 0x002A /* OCM I-side Bank 1Config */
|
||||
#define OCM0_ISRC2 0x002B /* OCM I-side Bank 2 Config */
|
||||
#define OCM0_DISDPC 0x002C /* OCM D-/I-side Data Par Chk */
|
||||
|
||||
/* SDR register */
|
||||
#define SDR0_NAND0 0x4000
|
||||
#define SDR0_ULTRA0 0x4040
|
||||
#define SDR0_ULTRA1 0x4050
|
||||
#define SDR0_ICINTSTAT 0x4510
|
||||
|
||||
/* CPR register */
|
||||
#define CPR0_PRIMAD 0x0080
|
||||
#define CPR0_PERD0 0x00e0
|
||||
#define CPR0_PERD1 0x00e1
|
||||
#define CPR0_PERC0 0x0180
|
||||
|
||||
#define MAL_DCR_BASE 0x380
|
||||
|
||||
#define SDR_NAND0_NDEN 0x80000000
|
||||
#define SDR_NAND0_NDBTEN 0x40000000
|
||||
#define SDR_NAND0_NDBADR_MASK 0x30000000
|
||||
#define SDR_NAND0_NDBPG_MASK 0x0f000000
|
||||
#define SDR_NAND0_NDAREN 0x00800000
|
||||
#define SDR_NAND0_NDRBEN 0x00400000
|
||||
|
||||
#define SDR_ULTRA0_NDGPIOBP 0x80000000
|
||||
#define SDR_ULTRA0_CSN_MASK 0x78000000
|
||||
#define SDR_ULTRA0_CSNSEL0 0x40000000
|
||||
#define SDR_ULTRA0_CSNSEL1 0x20000000
|
||||
#define SDR_ULTRA0_CSNSEL2 0x10000000
|
||||
#define SDR_ULTRA0_CSNSEL3 0x08000000
|
||||
#define SDR_ULTRA0_EBCRDYEN 0x04000000
|
||||
#define SDR_ULTRA0_SPISSINEN 0x02000000
|
||||
#define SDR_ULTRA0_NFSRSTEN 0x01000000
|
||||
|
||||
#define SDR_ULTRA1_LEDNENABLE 0x40000000
|
||||
|
||||
#define SDR_ICRX_STAT 0x80000000
|
||||
#define SDR_ICTX0_STAT 0x40000000
|
||||
#define SDR_ICTX1_STAT 0x20000000
|
||||
|
||||
#define CPR_CLKUPD_ENPLLCH_EN 0x40000000 /* Enable CPR PLL Changes */
|
||||
#define CPR_CLKUPD_ENDVCH_EN 0x20000000 /* Enable CPR Sys. Div. Changes */
|
||||
#define CPR_PERD0_SPIDV_MASK 0x000F0000 /* SPI Clock Divider */
|
||||
|
||||
#define PLLC_SRC_MASK 0x20000000 /* PLL feedback source */
|
||||
|
||||
#define PLLD_FBDV_MASK 0x1F000000 /* PLL feedback divider value */
|
||||
#define PLLD_FWDVA_MASK 0x000F0000 /* PLL forward divider A value */
|
||||
#define PLLD_FWDVB_MASK 0x00000700 /* PLL forward divider B value */
|
||||
|
||||
#define PRIMAD_CPUDV_MASK 0x0F000000 /* CPU Clock Divisor Mask */
|
||||
#define PRIMAD_PLBDV_MASK 0x000F0000 /* PLB Clock Divisor Mask */
|
||||
#define PRIMAD_OPBDV_MASK 0x00000F00 /* OPB Clock Divisor Mask */
|
||||
#define PRIMAD_EBCDV_MASK 0x0000000F /* EBC Clock Divisor Mask */
|
||||
|
||||
#define PERD0_PWMDV_MASK 0xFF000000 /* PWM Divider Mask */
|
||||
#define PERD0_SPIDV_MASK 0x000F0000 /* SPI Divider Mask */
|
||||
#define PERD0_U0DV_MASK 0x0000FF00 /* UART 0 Divider Mask */
|
||||
#define PERD0_U1DV_MASK 0x000000FF /* UART 1 Divider Mask */
|
||||
|
||||
#endif /* _PPC405EZ_H_ */
|
|
@ -1,95 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2010
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef _PPC405GP_H_
|
||||
#define _PPC405GP_H_
|
||||
|
||||
#define CONFIG_SDRAM_PPC4xx_IBM_SDRAM /* IBM SDRAM controller */
|
||||
|
||||
/* Memory mapped register */
|
||||
#define CONFIG_SYS_PERIPHERAL_BASE 0xef600000 /* Internal Peripherals */
|
||||
|
||||
#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_PERIPHERAL_BASE + 0x0300)
|
||||
#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_PERIPHERAL_BASE + 0x0400)
|
||||
|
||||
#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0700)
|
||||
|
||||
/* DCR's */
|
||||
#define DCP0_CFGADDR 0x0014 /* Decompression controller addr reg */
|
||||
#define DCP0_CFGDATA 0x0015 /* Decompression controller data reg */
|
||||
#define OCM0_ISCNTL 0x0019 /* OCM I-side control reg */
|
||||
#define OCM0_DSARC 0x001a /* OCM D-side address compare */
|
||||
#define OCM0_DSCNTL 0x001b /* OCM D-side control */
|
||||
#define CPC0_PLLMR 0x00b0 /* PLL mode register */
|
||||
#define CPC0_CR0 0x00b1 /* chip control register 0 */
|
||||
#define CPC0_CR1 0x00b2 /* chip control register 1 */
|
||||
#define CPC0_PSR 0x00b4 /* chip pin strapping reg */
|
||||
#define CPC0_EIRR 0x00b6 /* ext interrupt routing reg */
|
||||
#define CPC0_SR 0x00b8 /* Power management status */
|
||||
#define CPC0_ER 0x00b9 /* Power management enable */
|
||||
#define CPC0_FR 0x00ba /* Power management force */
|
||||
#define CPC0_ECR 0x00aa /* edge conditioner register */
|
||||
|
||||
/* values for kiar register - indirect addressing of these regs */
|
||||
#define KCONF 0x40 /* decompression core config register */
|
||||
|
||||
#define PLLMR_FWD_DIV_MASK 0xE0000000 /* Forward Divisor */
|
||||
#define PLLMR_FWD_DIV_BYPASS 0xE0000000
|
||||
#define PLLMR_FWD_DIV_3 0xA0000000
|
||||
#define PLLMR_FWD_DIV_4 0x80000000
|
||||
#define PLLMR_FWD_DIV_6 0x40000000
|
||||
|
||||
#define PLLMR_FB_DIV_MASK 0x1E000000 /* Feedback Divisor */
|
||||
#define PLLMR_FB_DIV_1 0x02000000
|
||||
#define PLLMR_FB_DIV_2 0x04000000
|
||||
#define PLLMR_FB_DIV_3 0x06000000
|
||||
#define PLLMR_FB_DIV_4 0x08000000
|
||||
|
||||
#define PLLMR_TUNING_MASK 0x01F80000
|
||||
|
||||
#define PLLMR_CPU_TO_PLB_MASK 0x00060000 /* CPU:PLB Frequency Divisor */
|
||||
#define PLLMR_CPU_PLB_DIV_1 0x00000000
|
||||
#define PLLMR_CPU_PLB_DIV_2 0x00020000
|
||||
#define PLLMR_CPU_PLB_DIV_3 0x00040000
|
||||
#define PLLMR_CPU_PLB_DIV_4 0x00060000
|
||||
|
||||
#define PLLMR_OPB_TO_PLB_MASK 0x00018000 /* OPB:PLB Frequency Divisor */
|
||||
#define PLLMR_OPB_PLB_DIV_1 0x00000000
|
||||
#define PLLMR_OPB_PLB_DIV_2 0x00008000
|
||||
#define PLLMR_OPB_PLB_DIV_3 0x00010000
|
||||
#define PLLMR_OPB_PLB_DIV_4 0x00018000
|
||||
|
||||
#define PLLMR_PCI_TO_PLB_MASK 0x00006000 /* PCI:PLB Frequency Divisor */
|
||||
#define PLLMR_PCI_PLB_DIV_1 0x00000000
|
||||
#define PLLMR_PCI_PLB_DIV_2 0x00002000
|
||||
#define PLLMR_PCI_PLB_DIV_3 0x00004000
|
||||
#define PLLMR_PCI_PLB_DIV_4 0x00006000
|
||||
|
||||
#define PLLMR_EXB_TO_PLB_MASK 0x00001800 /* External Bus:PLB Divisor */
|
||||
#define PLLMR_EXB_PLB_DIV_2 0x00000000
|
||||
#define PLLMR_EXB_PLB_DIV_3 0x00000800
|
||||
#define PLLMR_EXB_PLB_DIV_4 0x00001000
|
||||
#define PLLMR_EXB_PLB_DIV_5 0x00001800
|
||||
|
||||
/* definitions for PPC405GPr (new mode strapping) */
|
||||
#define PLLMR_FWDB_DIV_MASK 0x00000007 /* Forward Divisor B */
|
||||
|
||||
#define PSR_PLL_FWD_MASK 0xC0000000
|
||||
#define PSR_PLL_FDBACK_MASK 0x30000000
|
||||
#define PSR_PLL_TUNING_MASK 0x0E000000
|
||||
#define PSR_PLB_CPU_MASK 0x01800000
|
||||
#define PSR_OPB_PLB_MASK 0x00600000
|
||||
#define PSR_PCI_PLB_MASK 0x00180000
|
||||
#define PSR_EB_PLB_MASK 0x00060000
|
||||
#define PSR_ROM_WIDTH_MASK 0x00018000
|
||||
#define PSR_ROM_LOC 0x00004000
|
||||
#define PSR_PCI_ASYNC_EN 0x00001000
|
||||
#define PSR_PERCLK_SYNC_MODE_EN 0x00000800 /* PPC405GPr only */
|
||||
#define PSR_PCI_ARBIT_EN 0x00000400
|
||||
#define PSR_NEW_MODE_EN 0x00000020 /* PPC405GPr only */
|
||||
|
||||
#endif /* _PPC405GP_H_ */
|
|
@ -1,154 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2006
|
||||
* Sylvie Gohl, AMCC/IBM, gohl.sylvie@fr.ibm.com
|
||||
* Jacqueline Pira-Ferriol, AMCC/IBM, jpira-ferriol@fr.ibm.com
|
||||
* Thierry Roman, AMCC/IBM, thierry_roman@fr.ibm.com
|
||||
* Alain Saurel, AMCC/IBM, alain.saurel@fr.ibm.com
|
||||
* Robert Snyder, AMCC/IBM, rob.snyder@fr.ibm.com
|
||||
*
|
||||
* (C) Copyright 2010
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0 IBM-pibs
|
||||
*/
|
||||
|
||||
#ifndef __PPC440_H__
|
||||
#define __PPC440_H__
|
||||
|
||||
#define CONFIG_SYS_DCACHE_SIZE (32 << 10) /* For AMCC 440 CPUs */
|
||||
|
||||
/*
|
||||
* DCRs & Related
|
||||
*/
|
||||
|
||||
/* Memory mapped registers */
|
||||
#define PCIL0_CFGADR (CONFIG_SYS_PCI_BASE + 0x0ec00000)
|
||||
#define PCIL0_CFGDATA (CONFIG_SYS_PCI_BASE + 0x0ec00004)
|
||||
#define PCIL0_CFGBASE (CONFIG_SYS_PCI_BASE + 0x0ec80000)
|
||||
#define PCIL0_IOBASE (CONFIG_SYS_PCI_BASE + 0x08000000)
|
||||
|
||||
/* DCR registers */
|
||||
|
||||
/* CPR register declarations */
|
||||
#define CPR0_PLLC 0x0040
|
||||
#define CPR0_PLLD 0x0060
|
||||
#define CPR0_PRIMAD0 0x0080
|
||||
#define CPR0_PRIMBD0 0x00a0
|
||||
#define CPR0_OPBD0 0x00c0
|
||||
#define CPR0_PERD 0x00e0
|
||||
#define CPR0_MALD 0x0100
|
||||
#define CPR0_SPCID 0x0120
|
||||
#define CPR0_ICFG 0x0140
|
||||
|
||||
/* SDR register definations */
|
||||
#define SDR0_SDSTP0 0x0020
|
||||
#define SDR0_SDSTP1 0x0021
|
||||
#define SDR0_PINSTP 0x0040
|
||||
#define SDR0_SDCS0 0x0060
|
||||
#define SDR0_ECID0 0x0080
|
||||
#define SDR0_ECID1 0x0081
|
||||
#define SDR0_ECID2 0x0082
|
||||
#define SDR0_ECID3 0x0083
|
||||
#define SDR0_DDR0 0x00e1
|
||||
#define SDR0_EBC 0x0100
|
||||
#define SDR0_UART0 0x0120
|
||||
#define SDR0_UART1 0x0121
|
||||
#define SDR0_UART2 0x0122
|
||||
#define SDR0_UART3 0x0123
|
||||
#define SDR0_CP440 0x0180
|
||||
#define SDR0_XCR 0x01c0
|
||||
#define SDR0_XCR0 0x01c0
|
||||
#define SDR0_XPLLC 0x01c1
|
||||
#define SDR0_XPLLD 0x01c2
|
||||
#define SDR0_SRST 0x0200
|
||||
#define SDR0_SRST0 SDR0_SRST
|
||||
#define SDR0_SRST1 0x0201
|
||||
#define SDR0_AMP0 0x0240
|
||||
#define SDR0_AMP1 0x0241
|
||||
#define SDR0_USB0 0x0320
|
||||
#define SDR0_CUST0 0x4000
|
||||
#define SDR0_CUST1 0x4002
|
||||
#define SDR0_CUST2 0x4004
|
||||
#define SDR0_CUST3 0x4006
|
||||
#define SDR0_PFC0 0x4100
|
||||
#define SDR0_PFC1 0x4101
|
||||
#define SDR0_PFC2 0x4102
|
||||
#define SDR0_PFC4 0x4104
|
||||
#define SDR0_MFR 0x4300
|
||||
|
||||
#define SDR0_DDR0_DDRM_DECODE(n) ((((u32)(n)) >> 29) & 0x03)
|
||||
|
||||
#define SDR0_PCI0_PAE_MASK (0x80000000 >> 0)
|
||||
#define SDR0_XCR0_PAE_MASK (0x80000000 >> 0)
|
||||
|
||||
#define SDR0_PFC0_GEIE_MASK 0x00003e00
|
||||
#define SDR0_PFC0_GEIE_TRE 0x00003e00
|
||||
#define SDR0_PFC0_GEIE_NOTRE 0x00000000
|
||||
#define SDR0_PFC0_TRE_MASK (0x80000000 >> 23)
|
||||
#define SDR0_PFC0_TRE_DISABLE 0x00000000
|
||||
#define SDR0_PFC0_TRE_ENABLE (0x80000000 >> 23)
|
||||
|
||||
/*
|
||||
* Core Configuration/MMU configuration for 440
|
||||
*/
|
||||
#define CCR0_DAPUIB 0x00100000
|
||||
#define CCR0_DTB 0x00008000
|
||||
|
||||
#define SDR0_SDCS_SDD (0x80000000 >> 31)
|
||||
|
||||
/* todo: move this code from macro offsets to struct */
|
||||
#define PCIL0_VENDID (PCIL0_CFGBASE + PCI_VENDOR_ID )
|
||||
#define PCIL0_DEVID (PCIL0_CFGBASE + PCI_DEVICE_ID )
|
||||
#define PCIL0_CMD (PCIL0_CFGBASE + PCI_COMMAND )
|
||||
#define PCIL0_STATUS (PCIL0_CFGBASE + PCI_STATUS )
|
||||
#define PCIL0_REVID (PCIL0_CFGBASE + PCI_REVISION_ID )
|
||||
#define PCIL0_CLS (PCIL0_CFGBASE + PCI_CLASS_CODE)
|
||||
#define PCIL0_CACHELS (PCIL0_CFGBASE + PCI_CACHE_LINE_SIZE )
|
||||
#define PCIL0_LATTIM (PCIL0_CFGBASE + PCI_LATENCY_TIMER )
|
||||
#define PCIL0_HDTYPE (PCIL0_CFGBASE + PCI_HEADER_TYPE )
|
||||
#define PCIL0_BIST (PCIL0_CFGBASE + PCI_BIST )
|
||||
#define PCIL0_BAR0 (PCIL0_CFGBASE + PCI_BASE_ADDRESS_0 )
|
||||
#define PCIL0_BAR1 (PCIL0_CFGBASE + PCI_BASE_ADDRESS_1 )
|
||||
#define PCIL0_BAR2 (PCIL0_CFGBASE + PCI_BASE_ADDRESS_2 )
|
||||
#define PCIL0_BAR3 (PCIL0_CFGBASE + PCI_BASE_ADDRESS_3 )
|
||||
#define PCIL0_BAR4 (PCIL0_CFGBASE + PCI_BASE_ADDRESS_4 )
|
||||
#define PCIL0_BAR5 (PCIL0_CFGBASE + PCI_BASE_ADDRESS_5 )
|
||||
#define PCIL0_CISPTR (PCIL0_CFGBASE + PCI_CARDBUS_CIS )
|
||||
#define PCIL0_SBSYSVID (PCIL0_CFGBASE + PCI_SUBSYSTEM_VENDOR_ID )
|
||||
#define PCIL0_SBSYSID (PCIL0_CFGBASE + PCI_SUBSYSTEM_ID )
|
||||
#define PCIL0_EROMBA (PCIL0_CFGBASE + PCI_ROM_ADDRESS )
|
||||
#define PCIL0_CAP (PCIL0_CFGBASE + PCI_CAPABILITY_LIST )
|
||||
#define PCIL0_RES0 (PCIL0_CFGBASE + 0x0035 )
|
||||
#define PCIL0_RES1 (PCIL0_CFGBASE + 0x0036 )
|
||||
#define PCIL0_RES2 (PCIL0_CFGBASE + 0x0038 )
|
||||
#define PCIL0_INTLN (PCIL0_CFGBASE + PCI_INTERRUPT_LINE )
|
||||
#define PCIL0_INTPN (PCIL0_CFGBASE + PCI_INTERRUPT_PIN )
|
||||
|
||||
#define PCIL0_MINGNT (PCIL0_CFGBASE + PCI_MIN_GNT )
|
||||
#define PCIL0_MAXLTNCY (PCIL0_CFGBASE + PCI_MAX_LAT )
|
||||
|
||||
#define PCIL0_POM0LAL (PCIL0_CFGBASE + 0x0068)
|
||||
#define PCIL0_POM0LAH (PCIL0_CFGBASE + 0x006c)
|
||||
#define PCIL0_POM0SA (PCIL0_CFGBASE + 0x0070)
|
||||
#define PCIL0_POM0PCIAL (PCIL0_CFGBASE + 0x0074)
|
||||
#define PCIL0_POM0PCIAH (PCIL0_CFGBASE + 0x0078)
|
||||
#define PCIL0_POM1LAL (PCIL0_CFGBASE + 0x007c)
|
||||
#define PCIL0_POM1LAH (PCIL0_CFGBASE + 0x0080)
|
||||
#define PCIL0_POM1SA (PCIL0_CFGBASE + 0x0084)
|
||||
#define PCIL0_POM1PCIAL (PCIL0_CFGBASE + 0x0088)
|
||||
#define PCIL0_POM1PCIAH (PCIL0_CFGBASE + 0x008c)
|
||||
#define PCIL0_POM2SA (PCIL0_CFGBASE + 0x0090)
|
||||
|
||||
#define PCIL0_PIM0SA (PCIL0_CFGBASE + 0x0098)
|
||||
#define PCIL0_PIM0LAL (PCIL0_CFGBASE + 0x009c)
|
||||
#define PCIL0_PIM0LAH (PCIL0_CFGBASE + 0x00a0)
|
||||
#define PCIL0_PIM1SA (PCIL0_CFGBASE + 0x00a4)
|
||||
#define PCIL0_PIM1LAL (PCIL0_CFGBASE + 0x00a8)
|
||||
#define PCIL0_PIM1LAH (PCIL0_CFGBASE + 0x00ac)
|
||||
#define PCIL0_PIM2SA (PCIL0_CFGBASE + 0x00b0)
|
||||
#define PCIL0_PIM2LAL (PCIL0_CFGBASE + 0x00b4)
|
||||
#define PCIL0_PIM2LAH (PCIL0_CFGBASE + 0x00b8)
|
||||
|
||||
#define PCIL0_STS (PCIL0_CFGBASE + 0x00e0)
|
||||
|
||||
#endif /* __PPC440_H__ */
|
|
@ -1,231 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2010
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef _PPC440EP_GR_H_
|
||||
#define _PPC440EP_GR_H_
|
||||
|
||||
#define CONFIG_SDRAM_PPC4xx_IBM_DDR /* IBM DDR controller */
|
||||
|
||||
#define CONFIG_NAND_NDFC
|
||||
|
||||
/*
|
||||
* Some SoC specific registers (not common for all 440 SoC's)
|
||||
*/
|
||||
|
||||
/* Memory mapped registers */
|
||||
#define CONFIG_SYS_PERIPHERAL_BASE 0xef600000 /* Internal Peripherals */
|
||||
|
||||
#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_PERIPHERAL_BASE + 0x0300)
|
||||
#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_PERIPHERAL_BASE + 0x0400)
|
||||
#define CONFIG_SYS_NS16550_COM3 (CONFIG_SYS_PERIPHERAL_BASE + 0x0500)
|
||||
#define CONFIG_SYS_NS16550_COM4 (CONFIG_SYS_PERIPHERAL_BASE + 0x0600)
|
||||
|
||||
#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0b00)
|
||||
#define GPIO1_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0c00)
|
||||
|
||||
/* SDR's */
|
||||
#define SDR0_PCI0 0x0300
|
||||
#define SDR0_SDSTP2 0x4001
|
||||
#define SDR0_SDSTP3 0x4003
|
||||
|
||||
#define SDR0_SDSTP1_PAE_MASK (0x80000000 >> 21)
|
||||
#define SDR0_SDSTP1_PAME_MASK (0x80000000 >> 27)
|
||||
|
||||
/* Pin Function Control Register 1 */
|
||||
#define SDR0_PFC1_U1ME_MASK 0x02000000 /* UART1 Mode Enable */
|
||||
#define SDR0_PFC1_U1ME_DSR_DTR 0x00000000 /* UART1 in DSR/DTR Mode */
|
||||
#define SDR0_PFC1_U1ME_CTS_RTS 0x02000000 /* UART1 in CTS/RTS Mode */
|
||||
#define SDR0_PFC1_U0ME_MASK 0x00080000 /* UART0 Mode Enable */
|
||||
#define SDR0_PFC1_U0ME_DSR_DTR 0x00000000 /* UART0 in DSR/DTR Mode */
|
||||
#define SDR0_PFC1_U0ME_CTS_RTS 0x00080000 /* UART0 in CTS/RTS Mode */
|
||||
#define SDR0_PFC1_U0IM_MASK 0x00040000 /* UART0 Interface Mode */
|
||||
#define SDR0_PFC1_U0IM_8PINS 0x00000000 /* UART0 Interface Mode 8 pins */
|
||||
#define SDR0_PFC1_U0IM_4PINS 0x00040000 /* UART0 Interface Mode 4 pins */
|
||||
#define SDR0_PFC1_SIS_MASK 0x00020000 /* SCP or IIC1 Selection */
|
||||
#define SDR0_PFC1_SIS_SCP_SEL 0x00000000 /* SCP Selected */
|
||||
#define SDR0_PFC1_SIS_IIC1_SEL 0x00020000 /* IIC1 Selected */
|
||||
#define SDR0_PFC1_UES_MASK 0x00010000 /* USB2D_RX_Active / EBC_Hold
|
||||
Req Selection */
|
||||
#define SDR0_PFC1_UES_USB2D_SEL 0x00000000 /* USB2D_RX_Active Selected */
|
||||
#define SDR0_PFC1_UES_EBCHR_SEL 0x00010000 /* EBC_Hold Req Selected */
|
||||
#define SDR0_PFC1_DIS_MASK 0x00008000 /* DMA_Req(1) / UIC_IRQ(5)
|
||||
Selection */
|
||||
#define SDR0_PFC1_DIS_DMAR_SEL 0x00000000 /* DMA_Req(1) Selected */
|
||||
#define SDR0_PFC1_DIS_UICIRQ5_SEL 0x00008000 /* UIC_IRQ(5) Selected */
|
||||
#define SDR0_PFC1_ERE_MASK 0x00004000 /* EBC Mast.Ext.Req.En./GPIO0(27)
|
||||
Selection */
|
||||
#define SDR0_PFC1_ERE_EXTR_SEL 0x00000000 /* EBC Mast.Ext.Req.En.
|
||||
Selected */
|
||||
#define SDR0_PFC1_ERE_GPIO0_27_SEL 0x00004000 /* GPIO0(27) Selected */
|
||||
#define SDR0_PFC1_UPR_MASK 0x00002000 /* USB2 Device Packet Reject
|
||||
Selection */
|
||||
#define SDR0_PFC1_UPR_DISABLE 0x00000000 /* USB2 Device Packet Reject
|
||||
Disable */
|
||||
#define SDR0_PFC1_UPR_ENABLE 0x00002000 /* USB2 Device Packet Reject
|
||||
Enable */
|
||||
#define SDR0_PFC1_PLB_PME_MASK 0x00001000 /* PLB3/PLB4 Perf. Monitor Enable
|
||||
Selection */
|
||||
#define SDR0_PFC1_PLB_PME_PLB3_SEL 0x00000000 /* PLB3 Performance Monitor
|
||||
Enable */
|
||||
#define SDR0_PFC1_PLB_PME_PLB4_SEL 0x00001000 /* PLB3 Performance Monitor
|
||||
Enable */
|
||||
#define SDR0_PFC1_GFGGI_MASK 0x0000000F /* GPT Frequency Generation
|
||||
Gated In */
|
||||
|
||||
/* USB Control Register */
|
||||
#define SDR0_USB0_USB_DEVSEL_MASK 0x00000002 /* USB Device Selection */
|
||||
#define SDR0_USB0_USB20D_DEVSEL 0x00000000 /* USB2.0 Device Selected */
|
||||
#define SDR0_USB0_USB11D_DEVSEL 0x00000002 /* USB1.1 Device Selected */
|
||||
#define SDR0_USB0_LEEN_MASK 0x00000001 /* Little Endian selection */
|
||||
#define SDR0_USB0_LEEN_DISABLE 0x00000000 /* Little Endian Disable */
|
||||
#define SDR0_USB0_LEEN_ENABLE 0x00000001 /* Little Endian Enable */
|
||||
|
||||
/* Miscealleneaous Function Reg. */
|
||||
#define SDR0_MFR_ETH0_CLK_SEL_MASK 0x08000000 /* Ethernet0 Clock Select */
|
||||
#define SDR0_MFR_ETH0_CLK_SEL_EXT 0x00000000
|
||||
#define SDR0_MFR_ETH1_CLK_SEL_MASK 0x04000000 /* Ethernet1 Clock Select */
|
||||
#define SDR0_MFR_ETH1_CLK_SEL_EXT 0x00000000
|
||||
#define SDR0_MFR_ZMII_MODE_MASK 0x03000000 /* ZMII Mode Mask */
|
||||
#define SDR0_MFR_ZMII_MODE_MII 0x00000000 /* ZMII Mode MII */
|
||||
#define SDR0_MFR_ZMII_MODE_SMII 0x01000000 /* ZMII Mode SMII */
|
||||
#define SDR0_MFR_ZMII_MODE_RMII_10M 0x02000000 /* ZMII Mode RMII - 10 Mbs */
|
||||
#define SDR0_MFR_ZMII_MODE_RMII_100M 0x03000000 /* ZMII Mode RMII - 100 Mbs */
|
||||
#define SDR0_MFR_ZMII_MODE_BIT0 0x02000000 /* ZMII Mode Bit0 */
|
||||
#define SDR0_MFR_ZMII_MODE_BIT1 0x01000000 /* ZMII Mode Bit1 */
|
||||
#define SDR0_MFR_ZM_ENCODE(n) ((((u32)(n)) & 0x3) << 24)
|
||||
#define SDR0_MFR_ZM_DECODE(n) ((((u32)(n)) << 24) & 0x3)
|
||||
|
||||
#define SDR0_MFR_ERRATA3_EN0 0x00800000
|
||||
#define SDR0_MFR_ERRATA3_EN1 0x00400000
|
||||
#define SDR0_MFR_PKT_REJ_MASK 0x00180000 /* Pkt Rej. Enable Mask */
|
||||
#define SDR0_MFR_PKT_REJ_EN 0x00180000 /* Pkt Rej. Ena. on both EMAC3 0-1 */
|
||||
#define SDR0_MFR_PKT_REJ_EN0 0x00100000 /* Pkt Rej. Enable on EMAC3(0) */
|
||||
#define SDR0_MFR_PKT_REJ_EN1 0x00080000 /* Pkt Rej. Enable on EMAC3(1) */
|
||||
#define SDR0_MFR_PKT_REJ_POL 0x00200000 /* Packet Reject Polarity */
|
||||
|
||||
/* CUST0 Customer Configuration Register0 */
|
||||
#define SDR0_CUST0_MUX_E_N_G_MASK 0xC0000000 /* Mux_Emac_NDFC_GPIO */
|
||||
#define SDR0_CUST0_MUX_EMAC_SEL 0x40000000 /* Emac Selection */
|
||||
#define SDR0_CUST0_MUX_NDFC_SEL 0x80000000 /* NDFC Selection */
|
||||
#define SDR0_CUST0_MUX_GPIO_SEL 0xC0000000 /* GPIO Selection */
|
||||
|
||||
#define SDR0_CUST0_NDFC_EN_MASK 0x20000000 /* NDFC Enable Mask */
|
||||
#define SDR0_CUST0_NDFC_ENABLE 0x20000000 /* NDFC Enable */
|
||||
#define SDR0_CUST0_NDFC_DISABLE 0x00000000 /* NDFC Disable */
|
||||
|
||||
#define SDR0_CUST0_NDFC_BW_MASK 0x10000000 /* NDFC Boot Width */
|
||||
#define SDR0_CUST0_NDFC_BW_16_BIT 0x10000000 /* NDFC Boot Width = 16 Bit */
|
||||
#define SDR0_CUST0_NDFC_BW_8_BIT 0x00000000 /* NDFC Boot Width = 8 Bit */
|
||||
|
||||
#define SDR0_CUST0_NDFC_BP_MASK 0x0F000000 /* NDFC Boot Page */
|
||||
#define SDR0_CUST0_NDFC_BP_ENCODE(n) ((((u32)(n)) & 0xF) << 24)
|
||||
#define SDR0_CUST0_NDFC_BP_DECODE(n) ((((u32)(n)) >> 24) & 0xF)
|
||||
|
||||
#define SDR0_CUST0_NDFC_BAC_MASK 0x00C00000 /* NDFC Boot Address Cycle */
|
||||
#define SDR0_CUST0_NDFC_BAC_ENCODE(n) ((((u32)(n)) & 0x3) << 22)
|
||||
#define SDR0_CUST0_NDFC_BAC_DECODE(n) ((((u32)(n)) >> 22) & 0x3)
|
||||
|
||||
#define SDR0_CUST0_NDFC_ARE_MASK 0x00200000 /* NDFC Auto Read Enable */
|
||||
#define SDR0_CUST0_NDFC_ARE_ENABLE 0x00200000 /* NDFC Auto Read Enable */
|
||||
#define SDR0_CUST0_NDFC_ARE_DISABLE 0x00000000 /* NDFC Auto Read Disable */
|
||||
|
||||
#define SDR0_CUST0_NRB_MASK 0x00100000 /* NDFC Ready / Busy */
|
||||
#define SDR0_CUST0_NRB_BUSY 0x00100000 /* Busy */
|
||||
#define SDR0_CUST0_NRB_READY 0x00000000 /* Ready */
|
||||
|
||||
#define SDR0_CUST0_NDRSC_MASK 0x0000FFF0 /* NDFC Device Reset Count Mask */
|
||||
#define SDR0_CUST0_NDRSC_ENCODE(n) ((((u32)(n)) & 0xFFF) << 4)
|
||||
#define SDR0_CUST0_NDRSC_DECODE(n) ((((u32)(n)) >> 4) & 0xFFF)
|
||||
|
||||
#define SDR0_CUST0_CHIPSELGAT_MASK 0x0000000F /* Chip Select Gating Mask */
|
||||
#define SDR0_CUST0_CHIPSELGAT_DIS 0x00000000 /* Chip Select Gating Disable */
|
||||
#define SDR0_CUST0_CHIPSELGAT_ENALL 0x0000000F /*All Chip Select Gating Enable*/
|
||||
#define SDR0_CUST0_CHIPSELGAT_EN0 0x00000008 /* Chip Select0 Gating Enable */
|
||||
#define SDR0_CUST0_CHIPSELGAT_EN1 0x00000004 /* Chip Select1 Gating Enable */
|
||||
#define SDR0_CUST0_CHIPSELGAT_EN2 0x00000002 /* Chip Select2 Gating Enable */
|
||||
#define SDR0_CUST0_CHIPSELGAT_EN3 0x00000001 /* Chip Select3 Gating Enable */
|
||||
|
||||
#define SDR0_SRST_DMC 0x00200000
|
||||
|
||||
#define PLLSYS0_ENG_MASK 0x80000000 /* 0 = SysClk, 1 = PLL VCO */
|
||||
#define PLLSYS0_SRC_MASK 0x40000000 /* 0 = PLL A, 1 = PLL B */
|
||||
#define PLLSYS0_SEL_MASK 0x38000000 /* 0 = PLL, 1 = CPU, 5 = PerClk */
|
||||
#define PLLSYS0_TUNE_MASK 0x07fe0000 /* PLL Tune bits */
|
||||
#define PLLSYS0_FB_DIV_MASK 0x0001f000 /* Feedback divisor */
|
||||
#define PLLSYS0_FWD_DIV_A_MASK 0x00000f00 /* Fwd Div A */
|
||||
#define PLLSYS0_FWD_DIV_B_MASK 0x000000e0 /* Fwd Div B */
|
||||
#define PLLSYS0_PRI_DIV_B_MASK 0x0000001c /* PLL Primary Divisor B */
|
||||
#define PLLSYS0_OPB_DIV_MASK 0x00000003 /* OPB Divisor */
|
||||
|
||||
#define PLLC_ENG_MASK 0x20000000 /* PLL primary forward divisor source */
|
||||
#define PLLC_SRC_MASK 0x20000000 /* PLL feedback source */
|
||||
#define PLLD_FBDV_MASK 0x1f000000 /* PLL Feedback Divisor */
|
||||
#define PLLD_FWDVA_MASK 0x000f0000 /* PLL Forward Divisor A */
|
||||
#define PLLD_FWDVB_MASK 0x00000700 /* PLL Forward Divisor B */
|
||||
#define PLLD_LFBDV_MASK 0x0000003f /* PLL Local Feedback Divisor */
|
||||
|
||||
#define OPBDDV_MASK 0x03000000 /* OPB Clock Divisor Register */
|
||||
#define PERDV_MASK 0x07000000 /* Peripheral Clock Divisor */
|
||||
#define PRADV_MASK 0x07000000 /* Primary Divisor A */
|
||||
#define PRBDV_MASK 0x07000000 /* Primary Divisor B */
|
||||
#define SPCID_MASK 0x03000000 /* Sync PCI Divisor */
|
||||
|
||||
/* Strap 1 Register */
|
||||
#define PLLSYS1_LF_DIV_MASK 0xfc000000 /* PLL Local Feedback Divisor */
|
||||
#define PLLSYS1_PERCLK_DIV_MASK 0x03000000 /* Peripheral Clk Divisor */
|
||||
#define PLLSYS1_MAL_DIV_MASK 0x00c00000 /* MAL Clk Divisor */
|
||||
#define PLLSYS1_RW_MASK 0x00300000 /* ROM width */
|
||||
#define PLLSYS1_EAR_MASK 0x00080000 /* ERAP Address reset vector */
|
||||
#define PLLSYS1_PAE_MASK 0x00040000 /* PCI arbitor enable */
|
||||
#define PLLSYS1_PCHE_MASK 0x00020000 /* PCI host config enable */
|
||||
#define PLLSYS1_PISE_MASK 0x00010000 /* PCI init seq. enable */
|
||||
#define PLLSYS1_PCWE_MASK 0x00008000 /* PCI local cpu wait enable */
|
||||
#define PLLSYS1_PPIM_MASK 0x00007800 /* PCI inbound map */
|
||||
#define PLLSYS1_PR64E_MASK 0x00000400 /* PCI init Req64 enable */
|
||||
#define PLLSYS1_PXFS_MASK 0x00000300 /* PCI-X Freq Sel */
|
||||
#define PLLSYS1_RSVD_MASK 0x00000080 /* RSVD */
|
||||
#define PLLSYS1_PDM_MASK 0x00000040 /* PCI-X Driver Mode */
|
||||
#define PLLSYS1_EPS_MASK 0x00000038 /* Ethernet Pin Select */
|
||||
#define PLLSYS1_RMII_MASK 0x00000004 /* RMII Mode */
|
||||
#define PLLSYS1_TRE_MASK 0x00000002 /* GPIO Trace Enable */
|
||||
#define PLLSYS1_NTO1_MASK 0x00000001 /* CPU:PLB N-to-1 ratio */
|
||||
|
||||
#define CPR0_ICFG_RLI_MASK 0x80000000
|
||||
#define CPR0_ICFG_ICS_MASK 0x00000007
|
||||
#define CPR0_SPCID_SPCIDV0_MASK 0x03000000
|
||||
#define CPR0_SPCID_SPCIDV0_DIV1 0x01000000
|
||||
#define CPR0_SPCID_SPCIDV0_DIV2 0x02000000
|
||||
#define CPR0_SPCID_SPCIDV0_DIV3 0x03000000
|
||||
#define CPR0_SPCID_SPCIDV0_DIV4 0x00000000
|
||||
#define CPR0_PERD_PERDV0_MASK 0x07000000
|
||||
|
||||
#define PCI_MMIO_LCR_BASE (CONFIG_SYS_PCI_BASE + 0x0f400000) /* Real =>
|
||||
0x0EF400000 */
|
||||
|
||||
/* PCI Master Local Configuration Registers */
|
||||
#define PCIL0_PMM0LA (PCI_MMIO_LCR_BASE + 0x00) /* PMM0 Local Address */
|
||||
#define PCIL0_PMM0MA (PCI_MMIO_LCR_BASE + 0x04) /* PMM0 Mask/Attribute */
|
||||
#define PCIL0_PMM0PCILA (PCI_MMIO_LCR_BASE + 0x08) /* PMM0 PCI Low Address */
|
||||
#define PCIL0_PMM0PCIHA (PCI_MMIO_LCR_BASE + 0x0C) /* PMM0 PCI High Address */
|
||||
#define PCIL0_PMM1LA (PCI_MMIO_LCR_BASE + 0x10) /* PMM1 Local Address */
|
||||
#define PCIL0_PMM1MA (PCI_MMIO_LCR_BASE + 0x14) /* PMM1 Mask/Attribute */
|
||||
#define PCIL0_PMM1PCILA (PCI_MMIO_LCR_BASE + 0x18) /* PMM1 PCI Low Address */
|
||||
#define PCIL0_PMM1PCIHA (PCI_MMIO_LCR_BASE + 0x1C) /* PMM1 PCI High Address */
|
||||
#define PCIL0_PMM2LA (PCI_MMIO_LCR_BASE + 0x20) /* PMM2 Local Address */
|
||||
#define PCIL0_PMM2MA (PCI_MMIO_LCR_BASE + 0x24) /* PMM2 Mask/Attribute */
|
||||
#define PCIL0_PMM2PCILA (PCI_MMIO_LCR_BASE + 0x28) /* PMM2 PCI Low Address */
|
||||
#define PCIL0_PMM2PCIHA (PCI_MMIO_LCR_BASE + 0x2C) /* PMM2 PCI High Address */
|
||||
|
||||
/* PCI Target Local Configuration Registers */
|
||||
#define PCIL0_PTM1MS (PCI_MMIO_LCR_BASE + 0x30) /* PTM1 Memory Size/
|
||||
Attribute */
|
||||
#define PCIL0_PTM1LA (PCI_MMIO_LCR_BASE + 0x34) /* PTM1 Local Addr. Reg */
|
||||
#define PCIL0_PTM2MS (PCI_MMIO_LCR_BASE + 0x38) /* PTM2 Memory Size/
|
||||
Attribute */
|
||||
#define PCIL0_PTM2LA (PCI_MMIO_LCR_BASE + 0x3C) /* PTM2 Local Addr. Reg */
|
||||
|
||||
#endif /* _PPC440EP_GR_H_ */
|
|
@ -1,453 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2010
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef _PPC440EPX_GRX_H_
|
||||
#define _PPC440EPX_GRX_H_
|
||||
|
||||
#define CONFIG_SDRAM_PPC4xx_DENALI_DDR2 /* Denali DDR(2) controller */
|
||||
|
||||
#define CONFIG_NAND_NDFC
|
||||
|
||||
/*
|
||||
* Some SoC specific registers (not common for all 440 SoC's)
|
||||
*/
|
||||
|
||||
/* Memory mapped registers */
|
||||
#define CONFIG_SYS_PERIPHERAL_BASE 0xef600000 /* Internal Peripherals */
|
||||
|
||||
#define SPI0_MODE (CONFIG_SYS_PERIPHERAL_BASE + 0x0090)
|
||||
|
||||
#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_PERIPHERAL_BASE + 0x0300)
|
||||
#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_PERIPHERAL_BASE + 0x0400)
|
||||
#define CONFIG_SYS_NS16550_COM3 (CONFIG_SYS_PERIPHERAL_BASE + 0x0500)
|
||||
#define CONFIG_SYS_NS16550_COM4 (CONFIG_SYS_PERIPHERAL_BASE + 0x0600)
|
||||
|
||||
#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0b00)
|
||||
#define GPIO1_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0c00)
|
||||
|
||||
/* DCR */
|
||||
#define CPM0_ER 0x00b0
|
||||
#define CPM1_ER 0x00f0
|
||||
#define PLB3A0_ACR 0x0077
|
||||
#define PLB4A0_ACR 0x0081
|
||||
#define PLB4A1_ACR 0x0089
|
||||
#define OPB2PLB40_BCTRL 0x0350
|
||||
#define P4P3BO0_CFG 0x0026
|
||||
|
||||
/* SDR */
|
||||
#define SDR0_DDRCFG 0x00e0
|
||||
#define SDR0_PCI0 0x0300
|
||||
#define SDR0_SDSTP2 0x4001
|
||||
#define SDR0_SDSTP3 0x4003
|
||||
#define SDR0_EMAC0RXST 0x4301
|
||||
#define SDR0_EMAC0TXST 0x4302
|
||||
#define SDR0_CRYP0 0x4500
|
||||
|
||||
#define SDR0_SDSTP1_PAE_MASK (0x80000000 >> 21)
|
||||
#define SDR0_SDSTP1_PAME_MASK (0x80000000 >> 27)
|
||||
|
||||
/* Pin Function Control Register 1 */
|
||||
#define SDR0_PFC1_U1ME_MASK 0x02000000 /* UART1 Mode Enable */
|
||||
#define SDR0_PFC1_U1ME_DSR_DTR 0x00000000 /* UART1 in DSR/DTR Mode */
|
||||
#define SDR0_PFC1_U1ME_CTS_RTS 0x02000000 /* UART1 in CTS/RTS Mode */
|
||||
#define SDR0_PFC1_SELECT_MASK 0x01C00000 /* Ethernet Pin Select
|
||||
EMAC 0 */
|
||||
#define SDR0_PFC1_SELECT_CONFIG_1_1 0x00C00000 /* 1xMII using RGMII
|
||||
bridge */
|
||||
#define SDR0_PFC1_SELECT_CONFIG_1_2 0x00000000 /* 1xMII using ZMII
|
||||
bridge */
|
||||
#define SDR0_PFC1_SELECT_CONFIG_2 0x00C00000 /* 1xGMII using RGMII
|
||||
bridge */
|
||||
#define SDR0_PFC1_SELECT_CONFIG_3 0x01000000 /* 1xTBI using RGMII
|
||||
bridge */
|
||||
#define SDR0_PFC1_SELECT_CONFIG_4 0x01400000 /* 2xRGMII using RGMII
|
||||
bridge */
|
||||
#define SDR0_PFC1_SELECT_CONFIG_5 0x01800000 /* 2xRTBI using RGMII
|
||||
bridge */
|
||||
#define SDR0_PFC1_SELECT_CONFIG_6 0x00800000 /* 2xSMII using ZMII
|
||||
bridge */
|
||||
#define SDR0_PFC1_U0ME_MASK 0x00080000 /* UART0 Mode Enable */
|
||||
#define SDR0_PFC1_U0ME_DSR_DTR 0x00000000 /* UART0 in DSR/DTR Mode */
|
||||
#define SDR0_PFC1_U0ME_CTS_RTS 0x00080000 /* UART0 in CTS/RTS Mode */
|
||||
#define SDR0_PFC1_U0IM_MASK 0x00040000 /* UART0 Interface Mode */
|
||||
#define SDR0_PFC1_U0IM_8PINS 0x00000000 /* UART0 Interface Mode 8 pins */
|
||||
#define SDR0_PFC1_U0IM_4PINS 0x00040000 /* UART0 Interface Mode 4 pins */
|
||||
#define SDR0_PFC1_SIS_MASK 0x00020000 /* SCP or IIC1 Selection */
|
||||
#define SDR0_PFC1_SIS_SCP_SEL 0x00000000 /* SCP Selected */
|
||||
#define SDR0_PFC1_SIS_IIC1_SEL 0x00020000 /* IIC1 Selected */
|
||||
#define SDR0_PFC1_UES_MASK 0x00010000 /* USB2D_RX_Active / EBC_Hold
|
||||
Req Selection */
|
||||
#define SDR0_PFC1_UES_USB2D_SEL 0x00000000 /* USB2D_RX_Active Selected */
|
||||
#define SDR0_PFC1_UES_EBCHR_SEL 0x00010000 /* EBC_Hold Req Selected */
|
||||
#define SDR0_PFC1_DIS_MASK 0x00008000 /* DMA_Req(1) / UIC_IRQ(5)
|
||||
Selection */
|
||||
#define SDR0_PFC1_DIS_DMAR_SEL 0x00000000 /* DMA_Req(1) Selected */
|
||||
#define SDR0_PFC1_DIS_UICIRQ5_SEL 0x00008000 /* UIC_IRQ(5) Selected */
|
||||
#define SDR0_PFC1_ERE_MASK 0x00004000 /* EBC Mast.Ext.Req.En./GPIO0(27)
|
||||
Selection */
|
||||
#define SDR0_PFC1_ERE_EXTR_SEL 0x00000000 /* EBC Mast.Ext.Req.En.
|
||||
Selected */
|
||||
#define SDR0_PFC1_ERE_GPIO0_27_SEL 0x00004000 /* GPIO0(27) Selected */
|
||||
#define SDR0_PFC1_UPR_MASK 0x00002000 /* USB2 Device Packet Reject
|
||||
Selection */
|
||||
#define SDR0_PFC1_UPR_DISABLE 0x00000000 /* USB2 Device Packet Reject
|
||||
Disable */
|
||||
#define SDR0_PFC1_UPR_ENABLE 0x00002000 /* USB2 Device Packet Reject
|
||||
Enable */
|
||||
#define SDR0_PFC1_PLB_PME_MASK 0x00001000 /* PLB3/PLB4 Perf. Monitor Enable
|
||||
Selection */
|
||||
#define SDR0_PFC1_PLB_PME_PLB3_SEL 0x00000000 /* PLB3 Performance Monitor
|
||||
Enable */
|
||||
#define SDR0_PFC1_PLB_PME_PLB4_SEL 0x00001000 /* PLB3 Performance Monitor
|
||||
Enable */
|
||||
#define SDR0_PFC1_GFGGI_MASK 0x0000000F /* GPT Frequency Generation
|
||||
Gated In */
|
||||
|
||||
#define SDR0_PFC2_SELECT_MASK 0xe0000000 /* Ethernet Pin select EMAC1 */
|
||||
#define SDR0_PFC2_SELECT_CONFIG_1_1 0x60000000 /* 1xMII using RGMII bridge */
|
||||
#define SDR0_PFC2_SELECT_CONFIG_1_2 0x00000000 /* 1xMII using ZMII bridge */
|
||||
#define SDR0_PFC2_SELECT_CONFIG_2 0x60000000 /* 1xGMII using RGMII bridge */
|
||||
#define SDR0_PFC2_SELECT_CONFIG_3 0x80000000 /* 1xTBI using RGMII bridge */
|
||||
#define SDR0_PFC2_SELECT_CONFIG_4 0xa0000000 /* 2xRGMII using RGMII bridge */
|
||||
#define SDR0_PFC2_SELECT_CONFIG_5 0xc0000000 /* 2xRTBI using RGMII bridge */
|
||||
#define SDR0_PFC2_SELECT_CONFIG_6 0x40000000 /* 2xSMII using ZMII bridge */
|
||||
|
||||
#define SDR0_USB2D0CR 0x0320
|
||||
#define SDR0_USB2D0CR_USB2DEV_EBC_SEL_MASK 0x00000004 /* USB 2.0 Device/EBC
|
||||
Master Selection */
|
||||
#define SDR0_USB2D0CR_USB2DEV_SELECTION 0x00000004 /* USB 2.0 Device Selection*/
|
||||
#define SDR0_USB2D0CR_EBC_SELECTION 0x00000000 /* EBC Selection */
|
||||
|
||||
#define SDR0_USB2D0CR_USB_DEV_INT_SEL_MASK 0x00000002 /* USB Device Interface
|
||||
Selection */
|
||||
#define SDR0_USB2D0CR_USB20D_DEVSEL 0x00000000 /* USB2.0 Device Selected */
|
||||
#define SDR0_USB2D0CR_USB11D_DEVSEL 0x00000002 /* USB1.1 Device Selected */
|
||||
|
||||
#define SDR0_USB2D0CR_LEEN_MASK 0x00000001 /* Little Endian selection */
|
||||
#define SDR0_USB2D0CR_LEEN_DISABLE 0x00000000 /* Little Endian Disable */
|
||||
#define SDR0_USB2D0CR_LEEN_ENABLE 0x00000001 /* Little Endian Enable */
|
||||
|
||||
/* USB2 Host Control Register */
|
||||
#define SDR0_USB2H0CR 0x0340
|
||||
#define SDR0_USB2H0CR_WDINT_MASK 0x00000001 /* Host UTMI Word Interface*/
|
||||
#define SDR0_USB2H0CR_WDINT_8BIT_60MHZ 0x00000000 /* 8-bit/60MHz */
|
||||
#define SDR0_USB2H0CR_WDINT_16BIT_30MHZ 0x00000001 /* 16-bit/30MHz */
|
||||
#define SDR0_USB2H0CR_EFLADJ_MASK 0x0000007e /* EHCI Frame Length
|
||||
Adjustment */
|
||||
/* USB2PHY0 Control Register */
|
||||
#define SDR0_USB2PHY0CR 0x4103
|
||||
#define SDR0_USB2PHY0CR_UTMICN_MASK 0x00100000
|
||||
|
||||
/* PHY UTMI interface connection */
|
||||
#define SDR0_USB2PHY0CR_UTMICN_DEV 0x00000000 /* Device support */
|
||||
#define SDR0_USB2PHY0CR_UTMICN_HOST 0x00100000 /* Host support */
|
||||
|
||||
#define SDR0_USB2PHY0CR_DWNSTR_MASK 0x00400000 /* Select downstream port mode */
|
||||
#define SDR0_USB2PHY0CR_DWNSTR_DEV 0x00000000 /* Device */
|
||||
#define SDR0_USB2PHY0CR_DWNSTR_HOST 0x00400000 /* Host */
|
||||
|
||||
/* VBus detect (Device mode only) */
|
||||
#define SDR0_USB2PHY0CR_DVBUS_MASK 0x00800000
|
||||
/* Pull-up resistance on D+ is disabled */
|
||||
#define SDR0_USB2PHY0CR_DVBUS_PURDIS 0x00000000
|
||||
/* Pull-up resistance on D+ is enabled */
|
||||
#define SDR0_USB2PHY0CR_DVBUS_PUREN 0x00800000
|
||||
|
||||
/* PHY UTMI data width and clock select */
|
||||
#define SDR0_USB2PHY0CR_WDINT_MASK 0x01000000
|
||||
#define SDR0_USB2PHY0CR_WDINT_8BIT_60MHZ 0x00000000 /* 8-bit data/60MHz */
|
||||
#define SDR0_USB2PHY0CR_WDINT_16BIT_30MHZ 0x01000000 /* 16-bit data/30MHz */
|
||||
|
||||
#define SDR0_USB2PHY0CR_LOOPEN_MASK 0x02000000 /* Loop back test enable */
|
||||
#define SDR0_USB2PHY0CR_LOOP_ENABLE 0x00000000 /* Loop back disabled */
|
||||
/* Loop back enabled (only test purposes) */
|
||||
#define SDR0_USB2PHY0CR_LOOP_DISABLE 0x02000000
|
||||
|
||||
/* Force XO block on during a suspend */
|
||||
#define SDR0_USB2PHY0CR_XOON_MASK 0x04000000
|
||||
#define SDR0_USB2PHY0CR_XO_ON 0x00000000 /* PHY XO block is powered-on */
|
||||
/* PHY XO block is powered-off when all ports are suspended */
|
||||
#define SDR0_USB2PHY0CR_XO_OFF 0x04000000
|
||||
|
||||
#define SDR0_USB2PHY0CR_PWRSAV_MASK 0x08000000 /* Select PHY power-save mode */
|
||||
#define SDR0_USB2PHY0CR_PWRSAV_OFF 0x00000000 /* Non-power-save mode */
|
||||
#define SDR0_USB2PHY0CR_PWRSAV_ON 0x08000000 /* Power-save mode. Valid only
|
||||
for full-speed operation */
|
||||
|
||||
#define SDR0_USB2PHY0CR_XOREF_MASK 0x10000000 /* Select reference clock
|
||||
source */
|
||||
#define SDR0_USB2PHY0CR_XOREF_INTERNAL 0x00000000 /* PHY PLL uses chip internal
|
||||
48M clock as a reference */
|
||||
#define SDR0_USB2PHY0CR_XOREF_XO 0x10000000 /* PHY PLL uses internal XO
|
||||
block output as a reference */
|
||||
|
||||
#define SDR0_USB2PHY0CR_XOCLK_MASK 0x20000000 /* Select clock for XO
|
||||
block*/
|
||||
#define SDR0_USB2PHY0CR_XOCLK_EXTERNAL 0x00000000 /* PHY macro used an external
|
||||
clock */
|
||||
#define SDR0_USB2PHY0CR_XOCLK_CRYSTAL 0x20000000 /* PHY macro uses the clock
|
||||
from a crystal */
|
||||
|
||||
#define SDR0_USB2PHY0CR_CLKSEL_MASK 0xc0000000 /* Select ref clk freq */
|
||||
#define SDR0_USB2PHY0CR_CLKSEL_12MHZ 0x00000000 /* Select ref clk freq
|
||||
= 12 MHz */
|
||||
#define SDR0_USB2PHY0CR_CLKSEL_48MHZ 0x40000000 /* Select ref clk freq
|
||||
= 48 MHz */
|
||||
#define SDR0_USB2PHY0CR_CLKSEL_24MHZ 0x80000000 /* Select ref clk freq
|
||||
= 24 MHz */
|
||||
|
||||
/* USB2.0 Device */
|
||||
/*
|
||||
* todo: check if this can be completely removed, only used in
|
||||
* cpu/ppc4xx/usbdev.c. And offsets are completely wrong. This could
|
||||
* never have actually worked. Best probably is to remove this
|
||||
* usbdev.c file completely (and these defines).
|
||||
*/
|
||||
#define USB2D0_BASE CONFIG_SYS_USB2D0_BASE
|
||||
|
||||
#define USB2D0_INTRIN (USB2D0_BASE + 0x00000000)
|
||||
|
||||
#define USB2D0_INTRIN (USB2D0_BASE + 0x00000000) /* Interrupt register for
|
||||
Endpoint 0 plus IN Endpoints 1 to 3 */
|
||||
#define USB2D0_POWER (USB2D0_BASE + 0x00000000) /* Power management
|
||||
register */
|
||||
#define USB2D0_FADDR (USB2D0_BASE + 0x00000000) /* Function address
|
||||
register */
|
||||
#define USB2D0_INTRINE (USB2D0_BASE + 0x00000000) /* Interrupt enable
|
||||
register for USB2D0_INTRIN */
|
||||
#define USB2D0_INTROUT (USB2D0_BASE + 0x00000000) /* Interrupt register for
|
||||
OUT Endpoints 1 to 3 */
|
||||
#define USB2D0_INTRUSBE (USB2D0_BASE + 0x00000000) /* Interrupt enable
|
||||
register for USB2D0_INTRUSB */
|
||||
#define USB2D0_INTRUSB (USB2D0_BASE + 0x00000000) /* Interrupt register for
|
||||
common USB interrupts */
|
||||
#define USB2D0_INTROUTE (USB2D0_BASE + 0x00000000) /* Interrupt enable
|
||||
register for IntrOut */
|
||||
#define USB2D0_TSTMODE (USB2D0_BASE + 0x00000000) /* Enables the USB 2.0
|
||||
test modes */
|
||||
#define USB2D0_INDEX (USB2D0_BASE + 0x00000000) /* Index register for
|
||||
selecting the Endpoint status/control registers */
|
||||
#define USB2D0_FRAME (USB2D0_BASE + 0x00000000) /* Frame number */
|
||||
#define USB2D0_INCSR0 (USB2D0_BASE + 0x00000000) /* Control Status
|
||||
register for Endpoint 0. (Index register set to select Endpoint 0) */
|
||||
#define USB2D0_INCSR (USB2D0_BASE + 0x00000000) /* Control Status
|
||||
register for IN Endpoint. (Index register set to select Endpoints 13) */
|
||||
#define USB2D0_INMAXP (USB2D0_BASE + 0x00000000) /* Maximum packet
|
||||
size for IN Endpoint. (Index register set to select Endpoints 13) */
|
||||
#define USB2D0_OUTCSR (USB2D0_BASE + 0x00000000) /* Control Status
|
||||
register for OUT Endpoint. (Index register set to select Endpoints 13) */
|
||||
#define USB2D0_OUTMAXP (USB2D0_BASE + 0x00000000) /* Maximum packet
|
||||
size for OUT Endpoint. (Index register set to select Endpoints 13) */
|
||||
#define USB2D0_OUTCOUNT0 (USB2D0_BASE + 0x00000000) /* Number of received
|
||||
bytes in Endpoint 0 FIFO. (Index register set to select Endpoint 0) */
|
||||
#define USB2D0_OUTCOUNT (USB2D0_BASE + 0x00000000) /* Number of bytes in
|
||||
OUT Endpoint FIFO. (Index register set to select Endpoints 13) */
|
||||
|
||||
/* Miscealleneaous Function Reg. */
|
||||
#define SDR0_MFR_ETH0_CLK_SEL_MASK 0x08000000 /* Ethernet0 Clock Select */
|
||||
#define SDR0_MFR_ETH0_CLK_SEL_EXT 0x00000000
|
||||
#define SDR0_MFR_ETH1_CLK_SEL_MASK 0x04000000 /* Ethernet1 Clock Select */
|
||||
#define SDR0_MFR_ETH1_CLK_SEL_EXT 0x00000000
|
||||
#define SDR0_MFR_ZMII_MODE_MASK 0x03000000 /* ZMII Mode Mask */
|
||||
#define SDR0_MFR_ZMII_MODE_MII 0x00000000 /* ZMII Mode MII */
|
||||
#define SDR0_MFR_ZMII_MODE_SMII 0x01000000 /* ZMII Mode SMII */
|
||||
#define SDR0_MFR_ZMII_MODE_BIT0 0x02000000 /* ZMII Mode Bit0 */
|
||||
#define SDR0_MFR_ZMII_MODE_BIT1 0x01000000 /* ZMII Mode Bit1 */
|
||||
#define SDR0_MFR_ZM_ENCODE(n) ((((u32)(n)) & 0x3) << 24)
|
||||
#define SDR0_MFR_ZM_DECODE(n) ((((u32)(n)) << 24) & 0x3)
|
||||
#define SDR0_MFR_PKT_REJ_MASK 0x00300000 /* Pkt Rej. Enable Mask */
|
||||
#define SDR0_MFR_PKT_REJ_EN 0x00300000 /* Pkt Rej. Ena. on both EMAC3 0-1 */
|
||||
#define SDR0_MFR_PKT_REJ_EN0 0x00200000 /* Pkt Rej. Enable on EMAC3(0) */
|
||||
#define SDR0_MFR_PKT_REJ_EN1 0x00100000 /* Pkt Rej. Enable on EMAC3(1) */
|
||||
#define SDR0_MFR_PKT_REJ_POL 0x00080000 /* Packet Reject Polarity */
|
||||
|
||||
/* CUST0 Customer Configuration Register0 */
|
||||
#define SDR0_CUST0_MUX_E_N_G_MASK 0xC0000000 /* Mux_Emac_NDFC_GPIO */
|
||||
#define SDR0_CUST0_MUX_EMAC_SEL 0x40000000 /* Emac Selection */
|
||||
#define SDR0_CUST0_MUX_NDFC_SEL 0x80000000 /* NDFC Selection */
|
||||
#define SDR0_CUST0_MUX_GPIO_SEL 0xC0000000 /* GPIO Selection */
|
||||
|
||||
#define SDR0_CUST0_NDFC_EN_MASK 0x20000000 /* NDFC Enable Mask */
|
||||
#define SDR0_CUST0_NDFC_ENABLE 0x20000000 /* NDFC Enable */
|
||||
#define SDR0_CUST0_NDFC_DISABLE 0x00000000 /* NDFC Disable */
|
||||
|
||||
#define SDR0_CUST0_NDFC_BW_MASK 0x10000000 /* NDFC Boot Width */
|
||||
#define SDR0_CUST0_NDFC_BW_16_BIT 0x10000000 /* NDFC Boot Width = 16 Bit */
|
||||
#define SDR0_CUST0_NDFC_BW_8_BIT 0x00000000 /* NDFC Boot Width = 8 Bit */
|
||||
|
||||
#define SDR0_CUST0_NDFC_BP_MASK 0x0F000000 /* NDFC Boot Page */
|
||||
#define SDR0_CUST0_NDFC_BP_ENCODE(n) ((((u32)(n)) & 0xF) << 24)
|
||||
#define SDR0_CUST0_NDFC_BP_DECODE(n) ((((u32)(n)) >> 24) & 0xF)
|
||||
|
||||
#define SDR0_CUST0_NDFC_BAC_MASK 0x00C00000 /* NDFC Boot Address Cycle */
|
||||
#define SDR0_CUST0_NDFC_BAC_ENCODE(n) ((((u32)(n)) & 0x3) << 22)
|
||||
#define SDR0_CUST0_NDFC_BAC_DECODE(n) ((((u32)(n)) >> 22) & 0x3)
|
||||
|
||||
#define SDR0_CUST0_NDFC_ARE_MASK 0x00200000 /* NDFC Auto Read Enable */
|
||||
#define SDR0_CUST0_NDFC_ARE_ENABLE 0x00200000 /* NDFC Auto Read Enable */
|
||||
#define SDR0_CUST0_NDFC_ARE_DISABLE 0x00000000 /* NDFC Auto Read Disable */
|
||||
|
||||
#define SDR0_CUST0_NRB_MASK 0x00100000 /* NDFC Ready / Busy */
|
||||
#define SDR0_CUST0_NRB_BUSY 0x00100000 /* Busy */
|
||||
#define SDR0_CUST0_NRB_READY 0x00000000 /* Ready */
|
||||
|
||||
#define SDR0_CUST0_NDRSC_MASK 0x0000FFF0 /* NDFC Device Reset Count Mask */
|
||||
#define SDR0_CUST0_NDRSC_ENCODE(n) ((((u32)(n)) & 0xFFF) << 4)
|
||||
#define SDR0_CUST0_NDRSC_DECODE(n) ((((u32)(n)) >> 4) & 0xFFF)
|
||||
|
||||
#define SDR0_CUST0_CHIPSELGAT_MASK 0x0000000F /* Chip Select Gating Mask */
|
||||
#define SDR0_CUST0_CHIPSELGAT_DIS 0x00000000 /* Chip Select Gating Disable */
|
||||
#define SDR0_CUST0_CHIPSELGAT_ENALL 0x0000000F /*All Chip Select Gating Enable*/
|
||||
#define SDR0_CUST0_CHIPSELGAT_EN0 0x00000008 /* Chip Select0 Gating Enable */
|
||||
#define SDR0_CUST0_CHIPSELGAT_EN1 0x00000004 /* Chip Select1 Gating Enable */
|
||||
#define SDR0_CUST0_CHIPSELGAT_EN2 0x00000002 /* Chip Select2 Gating Enable */
|
||||
#define SDR0_CUST0_CHIPSELGAT_EN3 0x00000001 /* Chip Select3 Gating Enable */
|
||||
|
||||
#define SDR0_SRST0_BGO 0x80000000 /* PLB to OPB bridge */
|
||||
#define SDR0_SRST0_PLB4 0x40000000 /* PLB4 arbiter */
|
||||
#define SDR0_SRST0_EBC 0x20000000 /* External bus controller */
|
||||
#define SDR0_SRST0_OPB 0x10000000 /* OPB arbiter */
|
||||
#define SDR0_SRST0_UART0 0x08000000 /* Universal asynchronous receiver/
|
||||
transmitter 0 */
|
||||
#define SDR0_SRST0_UART1 0x04000000 /* Universal asynchronous receiver/
|
||||
transmitter 1 */
|
||||
#define SDR0_SRST0_IIC0 0x02000000 /* Inter integrated circuit 0 */
|
||||
#define SDR0_SRST0_USB2H 0x01000000 /* USB2.0 Host */
|
||||
#define SDR0_SRST0_GPIO 0x00800000 /* General purpose I/O */
|
||||
#define SDR0_SRST0_GPT 0x00400000 /* General purpose timer */
|
||||
#define SDR0_SRST0_DMC 0x00200000 /* DDR SDRAM memory controller */
|
||||
#define SDR0_SRST0_PCI 0x00100000 /* PCI */
|
||||
#define SDR0_SRST0_EMAC0 0x00080000 /* Ethernet media access controller 0 */
|
||||
#define SDR0_SRST0_EMAC1 0x00040000 /* Ethernet media access controller 1 */
|
||||
#define SDR0_SRST0_CPM0 0x00020000 /* Clock and power management */
|
||||
#define SDR0_SRST0_ZMII 0x00010000 /* ZMII bridge */
|
||||
#define SDR0_SRST0_UIC0 0x00008000 /* Universal interrupt controller 0 */
|
||||
#define SDR0_SRST0_UIC1 0x00004000 /* Universal interrupt controller 1 */
|
||||
#define SDR0_SRST0_IIC1 0x00002000 /* Inter integrated circuit 1 */
|
||||
#define SDR0_SRST0_SCP 0x00001000 /* Serial communications port */
|
||||
#define SDR0_SRST0_BGI 0x00000800 /* OPB to PLB bridge */
|
||||
#define SDR0_SRST0_DMA 0x00000400 /* Direct memory access controller */
|
||||
#define SDR0_SRST0_DMAC 0x00000200 /* DMA channel */
|
||||
#define SDR0_SRST0_MAL 0x00000100 /* Media access layer */
|
||||
#define SDR0_SRST0_USB2D 0x00000080 /* USB2.0 device */
|
||||
#define SDR0_SRST0_GPTR 0x00000040 /* General purpose timer */
|
||||
#define SDR0_SRST0_P4P3 0x00000010 /* PLB4 to PLB3 bridge */
|
||||
#define SDR0_SRST0_P3P4 0x00000008 /* PLB3 to PLB4 bridge */
|
||||
#define SDR0_SRST0_PLB3 0x00000004 /* PLB3 arbiter */
|
||||
#define SDR0_SRST0_UART2 0x00000002 /* Universal asynchronous receiver/
|
||||
transmitter 2 */
|
||||
#define SDR0_SRST0_UART3 0x00000001 /* Universal asynchronous receiver/
|
||||
transmitter 3 */
|
||||
|
||||
#define SDR0_SRST1_NDFC 0x80000000 /* Nand flash controller */
|
||||
#define SDR0_SRST1_OPBA1 0x40000000 /* OPB Arbiter attached to PLB4 */
|
||||
#define SDR0_SRST1_P4OPB0 0x20000000 /* PLB4 to OPB Bridge0 */
|
||||
#define SDR0_SRST1_PLB42OPB0 SDR0_SRST1_P4OPB0
|
||||
#define SDR0_SRST1_DMA4 0x10000000 /* DMA to PLB4 */
|
||||
#define SDR0_SRST1_DMA4CH 0x08000000 /* DMA Channel to PLB4 */
|
||||
#define SDR0_SRST1_OPBA2 0x04000000 /* OPB Arbiter attached to PLB4
|
||||
USB 2.0 Host */
|
||||
#define SDR0_SRST1_OPB2PLB40 0x02000000 /* OPB to PLB4 Bridge attached to
|
||||
USB 2.0 Host */
|
||||
#define SDR0_SRST1_PLB42OPB1 0x01000000 /* PLB4 to OPB Bridge attached to
|
||||
USB 2.0 Host */
|
||||
#define SDR0_SRST1_CPM1 0x00800000 /* Clock and Power management 1 */
|
||||
#define SDR0_SRST1_UIC2 0x00400000 /* Universal Interrupt Controller 2*/
|
||||
#define SDR0_SRST1_CRYP0 0x00200000 /* Security Engine */
|
||||
#define SDR0_SRST1_USB20PHY 0x00100000 /* USB 2.0 Phy */
|
||||
#define SDR0_SRST1_USB2HUTMI 0x00080000 /* USB 2.0 Host UTMI Interface */
|
||||
#define SDR0_SRST1_USB2HPHY 0x00040000 /* USB 2.0 Host Phy Interface */
|
||||
#define SDR0_SRST1_SRAM0 0x00020000 /* Internal SRAM Controller */
|
||||
#define SDR0_SRST1_RGMII0 0x00010000 /* RGMII Bridge */
|
||||
#define SDR0_SRST1_ETHPLL 0x00008000 /* Ethernet PLL */
|
||||
#define SDR0_SRST1_FPU 0x00004000 /* Floating Point Unit */
|
||||
#define SDR0_SRST1_KASU0 0x00002000 /* Kasumi Engine */
|
||||
|
||||
#define PLLSYS0_ENG_MASK 0x80000000 /* 0 = SysClk, 1 = PLL VCO */
|
||||
#define PLLSYS0_SRC_MASK 0x40000000 /* 0 = PLL A, 1 = PLL B */
|
||||
#define PLLSYS0_SEL_MASK 0x38000000 /* 0 = PLL, 1 = CPU, 5 = PerClk */
|
||||
#define PLLSYS0_TUNE_MASK 0x07fe0000 /* PLL Tune bits */
|
||||
#define PLLSYS0_FB_DIV_MASK 0x0001f000 /* Feedback divisor */
|
||||
#define PLLSYS0_FWD_DIV_A_MASK 0x00000f00 /* Fwd Div A */
|
||||
#define PLLSYS0_FWD_DIV_B_MASK 0x000000e0 /* Fwd Div B */
|
||||
#define PLLSYS0_PRI_DIV_B_MASK 0x0000001c /* PLL Primary Divisor B */
|
||||
#define PLLSYS0_OPB_DIV_MASK 0x00000003 /* OPB Divisor */
|
||||
|
||||
#define PLLC_ENG_MASK 0x20000000 /* PLL primary forward divisor source */
|
||||
#define PLLC_SRC_MASK 0x20000000 /* PLL feedback source */
|
||||
#define PLLD_FBDV_MASK 0x1f000000 /* PLL Feedback Divisor */
|
||||
#define PLLD_FWDVA_MASK 0x000f0000 /* PLL Forward Divisor A */
|
||||
#define PLLD_FWDVB_MASK 0x00000700 /* PLL Forward Divisor B */
|
||||
#define PLLD_LFBDV_MASK 0x0000003f /* PLL Local Feedback Divisor */
|
||||
|
||||
#define OPBDDV_MASK 0x03000000 /* OPB Clock Divisor Register */
|
||||
#define PERDV_MASK 0x07000000 /* Peripheral Clock Divisor */
|
||||
#define PRADV_MASK 0x07000000 /* Primary Divisor A */
|
||||
#define PRBDV_MASK 0x07000000 /* Primary Divisor B */
|
||||
#define SPCID_MASK 0x03000000 /* Sync PCI Divisor */
|
||||
|
||||
/* Strap 1 Register */
|
||||
#define PLLSYS1_LF_DIV_MASK 0xfc000000 /* PLL Local Feedback Divisor */
|
||||
#define PLLSYS1_PERCLK_DIV_MASK 0x03000000 /* Peripheral Clk Divisor */
|
||||
#define PLLSYS1_MAL_DIV_MASK 0x00c00000 /* MAL Clk Divisor */
|
||||
#define PLLSYS1_RW_MASK 0x00300000 /* ROM width */
|
||||
#define PLLSYS1_EAR_MASK 0x00080000 /* ERAP Address reset vector */
|
||||
#define PLLSYS1_PAE_MASK 0x00040000 /* PCI arbitor enable */
|
||||
#define PLLSYS1_PCHE_MASK 0x00020000 /* PCI host config enable */
|
||||
#define PLLSYS1_PISE_MASK 0x00010000 /* PCI init seq. enable */
|
||||
#define PLLSYS1_PCWE_MASK 0x00008000 /* PCI local cpu wait enable */
|
||||
#define PLLSYS1_PPIM_MASK 0x00007800 /* PCI inbound map */
|
||||
#define PLLSYS1_PR64E_MASK 0x00000400 /* PCI init Req64 enable */
|
||||
#define PLLSYS1_PXFS_MASK 0x00000300 /* PCI-X Freq Sel */
|
||||
#define PLLSYS1_RSVD_MASK 0x00000080 /* RSVD */
|
||||
#define PLLSYS1_PDM_MASK 0x00000040 /* PCI-X Driver Mode */
|
||||
#define PLLSYS1_EPS_MASK 0x00000038 /* Ethernet Pin Select */
|
||||
#define PLLSYS1_RMII_MASK 0x00000004 /* RMII Mode */
|
||||
#define PLLSYS1_TRE_MASK 0x00000002 /* GPIO Trace Enable */
|
||||
#define PLLSYS1_NTO1_MASK 0x00000001 /* CPU:PLB N-to-1 ratio */
|
||||
|
||||
#define CPR0_ICFG_RLI_MASK 0x80000000
|
||||
#define CPR0_ICFG_ICS_MASK 0x00000007
|
||||
#define CPR0_SPCID_SPCIDV0_MASK 0x03000000
|
||||
#define CPR0_SPCID_SPCIDV0_DIV1 0x01000000
|
||||
#define CPR0_SPCID_SPCIDV0_DIV2 0x02000000
|
||||
#define CPR0_SPCID_SPCIDV0_DIV3 0x03000000
|
||||
#define CPR0_SPCID_SPCIDV0_DIV4 0x00000000
|
||||
#define CPR0_PERD_PERDV0_MASK 0x07000000
|
||||
|
||||
#define PCI_MMIO_LCR_BASE (CONFIG_SYS_PCI_BASE + 0x0f400000) /* Real =>
|
||||
0x0EF400000 */
|
||||
|
||||
/* PCI Master Local Configuration Registers */
|
||||
#define PCIL0_PMM0LA (PCI_MMIO_LCR_BASE + 0x00) /* PMM0 Local Address */
|
||||
#define PCIL0_PMM0MA (PCI_MMIO_LCR_BASE + 0x04) /* PMM0 Mask/Attribute */
|
||||
#define PCIL0_PMM0PCILA (PCI_MMIO_LCR_BASE + 0x08) /* PMM0 PCI Low Address */
|
||||
#define PCIL0_PMM0PCIHA (PCI_MMIO_LCR_BASE + 0x0C) /* PMM0 PCI High Address */
|
||||
#define PCIL0_PMM1LA (PCI_MMIO_LCR_BASE + 0x10) /* PMM1 Local Address */
|
||||
#define PCIL0_PMM1MA (PCI_MMIO_LCR_BASE + 0x14) /* PMM1 Mask/Attribute */
|
||||
#define PCIL0_PMM1PCILA (PCI_MMIO_LCR_BASE + 0x18) /* PMM1 PCI Low Address */
|
||||
#define PCIL0_PMM1PCIHA (PCI_MMIO_LCR_BASE + 0x1C) /* PMM1 PCI High Address */
|
||||
#define PCIL0_PMM2LA (PCI_MMIO_LCR_BASE + 0x20) /* PMM2 Local Address */
|
||||
#define PCIL0_PMM2MA (PCI_MMIO_LCR_BASE + 0x24) /* PMM2 Mask/Attribute */
|
||||
#define PCIL0_PMM2PCILA (PCI_MMIO_LCR_BASE + 0x28) /* PMM2 PCI Low Address */
|
||||
#define PCIL0_PMM2PCIHA (PCI_MMIO_LCR_BASE + 0x2C) /* PMM2 PCI High Address */
|
||||
|
||||
/* PCI Target Local Configuration Registers */
|
||||
#define PCIL0_PTM1MS (PCI_MMIO_LCR_BASE + 0x30) /* PTM1 Memory Size/
|
||||
Attribute */
|
||||
#define PCIL0_PTM1LA (PCI_MMIO_LCR_BASE + 0x34) /* PTM1 Local Addr. Reg */
|
||||
#define PCIL0_PTM2MS (PCI_MMIO_LCR_BASE + 0x38) /* PTM2 Memory Size/
|
||||
Attribute */
|
||||
#define PCIL0_PTM2LA (PCI_MMIO_LCR_BASE + 0x3C) /* PTM2 Local Addr. Reg */
|
||||
|
||||
/* 440EPx boot strap options */
|
||||
#define BOOT_STRAP_OPTION_A 0x00000000
|
||||
#define BOOT_STRAP_OPTION_B 0x00000001
|
||||
#define BOOT_STRAP_OPTION_D 0x00000003
|
||||
#define BOOT_STRAP_OPTION_E 0x00000004
|
||||
|
||||
#endif /* _PPC440EPX_GRX_H_ */
|
|
@ -1,59 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2010
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef _PPC440GP_H_
|
||||
#define _PPC440GP_H_
|
||||
|
||||
#define CONFIG_SDRAM_PPC4xx_IBM_DDR /* IBM DDR controller */
|
||||
|
||||
/*
|
||||
* Some SoC specific registers (not common for all 440 SoC's)
|
||||
*/
|
||||
|
||||
/* Memory mapped register */
|
||||
#define CONFIG_SYS_PERIPHERAL_BASE 0xe0000000 /* Internal Peripherals */
|
||||
|
||||
#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_PERIPHERAL_BASE + 0x0200)
|
||||
#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_PERIPHERAL_BASE + 0x0300)
|
||||
|
||||
#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0700)
|
||||
|
||||
#define SDR0_PCI0 0x0300
|
||||
|
||||
#define CPC0_STRP1_PAE_MASK (0x80000000 >> 11)
|
||||
#define CPC0_STRP1_PISE_MASK (0x80000000 >> 13)
|
||||
|
||||
#define CNTRL_DCR_BASE 0x0b0
|
||||
|
||||
#define CPC0_SYS0 (CNTRL_DCR_BASE + 0x30) /* System configuration reg 0 */
|
||||
#define CPC0_SYS1 (CNTRL_DCR_BASE + 0x31) /* System configuration reg 1 */
|
||||
|
||||
#define CPC0_STRP0 (CNTRL_DCR_BASE + 0x34) /* Power-on config reg 0 (RO) */
|
||||
#define CPC0_STRP1 (CNTRL_DCR_BASE + 0x35) /* Power-on config reg 1 (RO) */
|
||||
|
||||
#define CPC0_GPIO (CNTRL_DCR_BASE + 0x38) /* GPIO config reg (440GP) */
|
||||
|
||||
#define CPC0_CR0 (CNTRL_DCR_BASE + 0x3b) /* Control 0 register */
|
||||
#define CPC0_CR1 (CNTRL_DCR_BASE + 0x3a) /* Control 1 register */
|
||||
|
||||
#define PLLSYS0_TUNE_MASK 0xffc00000 /* PLL TUNE bits */
|
||||
#define PLLSYS0_FB_DIV_MASK 0x003c0000 /* Feedback divisor */
|
||||
#define PLLSYS0_FWD_DIV_A_MASK 0x00038000 /* Forward divisor A */
|
||||
#define PLLSYS0_FWD_DIV_B_MASK 0x00007000 /* Forward divisor B */
|
||||
#define PLLSYS0_OPB_DIV_MASK 0x00000c00 /* OPB divisor */
|
||||
#define PLLSYS0_EPB_DIV_MASK 0x00000300 /* EPB divisor */
|
||||
#define PLLSYS0_EXTSL_MASK 0x00000080 /* PerClk feedback path */
|
||||
#define PLLSYS0_RW_MASK 0x00000060 /* ROM width */
|
||||
#define PLLSYS0_RL_MASK 0x00000010 /* ROM location */
|
||||
#define PLLSYS0_ZMII_SEL_MASK 0x0000000c /* ZMII selection */
|
||||
#define PLLSYS0_BYPASS_MASK 0x00000002 /* Bypass PLL */
|
||||
#define PLLSYS0_NTO1_MASK 0x00000001 /* CPU:PLB N-to-1 ratio */
|
||||
|
||||
#define PCIL0_BRDGOPT1 (PCIL0_CFGBASE + 0x0040)
|
||||
#define PCIL0_BRDGOPT2 (PCIL0_CFGBASE + 0x0044)
|
||||
|
||||
#endif /* _PPC440GP_H_ */
|
|
@ -1,89 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2010
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef _PPC440GX_H_
|
||||
#define _PPC440GX_H_
|
||||
|
||||
#define CONFIG_SDRAM_PPC4xx_IBM_DDR /* IBM DDR controller */
|
||||
|
||||
/*
|
||||
* Some SoC specific registers (not common for all 440 SoC's)
|
||||
*/
|
||||
|
||||
/* Memory mapped register */
|
||||
#define CONFIG_SYS_PERIPHERAL_BASE 0xe0000000 /* Internal Peripherals */
|
||||
|
||||
#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_PERIPHERAL_BASE + 0x0200)
|
||||
#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_PERIPHERAL_BASE + 0x0300)
|
||||
|
||||
#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0700)
|
||||
|
||||
/* SDR's */
|
||||
#define SDR0_PCI0 0x0300
|
||||
|
||||
#define SDR0_SDSTP2 0x4001
|
||||
#define SDR0_SDSTP3 0x4003
|
||||
|
||||
#define SDR0_SDSTP1_PAE_MASK (0x80000000 >> 13)
|
||||
#define SDR0_SDSTP1_PISE_MASK (0x80000000 >> 15)
|
||||
|
||||
#define SDR0_PFC1_EPS_DECODE(n) ((((u32)(n)) >> 22) & 0x07)
|
||||
#define SDR0_PFC1_CTEMS_MASK (0x80000000 >> 11)
|
||||
#define SDR0_PFC1_CTEMS_EMS 0x00000000
|
||||
#define SDR0_PFC1_CTEMS_CPUTRACE (0x80000000 >> 11)
|
||||
|
||||
#define SDR0_MFR_ECS_MASK 0x10000000
|
||||
|
||||
#define SDR0_SRST_DMC 0x00200000
|
||||
|
||||
#define PLLSYS0_ENG_MASK 0x80000000 /* 0 = SysClk, 1 = PLL VCO */
|
||||
#define PLLSYS0_SRC_MASK 0x40000000 /* 0 = PLL A, 1 = PLL B */
|
||||
#define PLLSYS0_SEL_MASK 0x38000000 /* 0 = PLL, 1 = CPU, 5 = PerClk */
|
||||
#define PLLSYS0_TUNE_MASK 0x07fe0000 /* PLL Tune bits */
|
||||
#define PLLSYS0_FB_DIV_MASK 0x0001f000 /* Feedback divisor */
|
||||
#define PLLSYS0_FWD_DIV_A_MASK 0x00000f00 /* Fwd Div A */
|
||||
#define PLLSYS0_FWD_DIV_B_MASK 0x000000e0 /* Fwd Div B */
|
||||
#define PLLSYS0_PRI_DIV_B_MASK 0x0000001c /* PLL Primary Divisor B */
|
||||
#define PLLSYS0_OPB_DIV_MASK 0x00000003 /* OPB Divisor */
|
||||
|
||||
#define PLLC_ENG_MASK 0x20000000 /* PLL primary forward divisor source */
|
||||
#define PLLC_SRC_MASK 0x20000000 /* PLL feedback source */
|
||||
#define PLLD_FBDV_MASK 0x1f000000 /* PLL Feedback Divisor */
|
||||
#define PLLD_FWDVA_MASK 0x000f0000 /* PLL Forward Divisor A */
|
||||
#define PLLD_FWDVB_MASK 0x00000700 /* PLL Forward Divisor B */
|
||||
#define PLLD_LFBDV_MASK 0x0000003f /* PLL Local Feedback Divisor */
|
||||
|
||||
#define OPBDDV_MASK 0x03000000 /* OPB Clock Divisor Register */
|
||||
#define PERDV_MASK 0x07000000 /* Peripheral Clock Divisor */
|
||||
#define PRADV_MASK 0x07000000 /* Primary Divisor A */
|
||||
#define PRBDV_MASK 0x07000000 /* Primary Divisor B */
|
||||
#define SPCID_MASK 0x03000000 /* Sync PCI Divisor */
|
||||
|
||||
/* Strap 1 Register */
|
||||
#define PLLSYS1_LF_DIV_MASK 0xfc000000 /* PLL Local Feedback Divisor */
|
||||
#define PLLSYS1_PERCLK_DIV_MASK 0x03000000 /* Peripheral Clk Divisor */
|
||||
#define PLLSYS1_MAL_DIV_MASK 0x00c00000 /* MAL Clk Divisor */
|
||||
#define PLLSYS1_RW_MASK 0x00300000 /* ROM width */
|
||||
#define PLLSYS1_EAR_MASK 0x00080000 /* ERAP Address reset vector */
|
||||
#define PLLSYS1_PAE_MASK 0x00040000 /* PCI arbitor enable */
|
||||
#define PLLSYS1_PCHE_MASK 0x00020000 /* PCI host config enable */
|
||||
#define PLLSYS1_PISE_MASK 0x00010000 /* PCI init seq. enable */
|
||||
#define PLLSYS1_PCWE_MASK 0x00008000 /* PCI local cpu wait enable */
|
||||
#define PLLSYS1_PPIM_MASK 0x00007800 /* PCI inbound map */
|
||||
#define PLLSYS1_PR64E_MASK 0x00000400 /* PCI init Req64 enable */
|
||||
#define PLLSYS1_PXFS_MASK 0x00000300 /* PCI-X Freq Sel */
|
||||
#define PLLSYS1_RSVD_MASK 0x00000080 /* RSVD */
|
||||
#define PLLSYS1_PDM_MASK 0x00000040 /* PCI-X Driver Mode */
|
||||
#define PLLSYS1_EPS_MASK 0x00000038 /* Ethernet Pin Select */
|
||||
#define PLLSYS1_RMII_MASK 0x00000004 /* RMII Mode */
|
||||
#define PLLSYS1_TRE_MASK 0x00000002 /* GPIO Trace Enable */
|
||||
#define PLLSYS1_NTO1_MASK 0x00000001 /* CPU:PLB N-to-1 ratio */
|
||||
|
||||
#define PCIL0_BRDGOPT1 (PCIL0_CFGBASE + 0x0040)
|
||||
#define PCIL0_BRDGOPT2 (PCIL0_CFGBASE + 0x0044)
|
||||
|
||||
#endif /* _PPC440GX_H_ */
|
|
@ -1,85 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2010
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef _PPC440SP_H_
|
||||
#define _PPC440SP_H_
|
||||
|
||||
#define CONFIG_SDRAM_PPC4xx_IBM_DDR2 /* IBM DDR(2) controller */
|
||||
|
||||
/*
|
||||
* Some SoC specific registers (not common for all 440 SoC's)
|
||||
*/
|
||||
|
||||
/* Memory mapped register */
|
||||
#define CONFIG_SYS_PERIPHERAL_BASE 0xf0000000 /* Internal Peripherals */
|
||||
|
||||
#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_PERIPHERAL_BASE + 0x0200)
|
||||
#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_PERIPHERAL_BASE + 0x0300)
|
||||
|
||||
#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0700)
|
||||
|
||||
/* SDR's */
|
||||
#define SDR0_PCI0 0x0300
|
||||
#define SDR0_SDSTP2 0x0022
|
||||
#define SDR0_SDSTP3 0x0023
|
||||
|
||||
#define SDR0_SDSTP1_PAE_MASK (0x80000000 >> 13)
|
||||
#define SDR0_SDSTP1_PISE_MASK (0x80000000 >> 15)
|
||||
|
||||
#define SDR0_PFC1_EM_1000 (0x80000000 >> 10)
|
||||
|
||||
#define SDR0_MFR_FIXD (0x80000000 >> 3) /* Workaround for PCI/DMA */
|
||||
|
||||
#define SDR0_SRST0_DMC 0x00200000
|
||||
|
||||
#define PLLSYS0_ENG_MASK 0x80000000 /* 0 = SysClk, 1 = PLL VCO */
|
||||
#define PLLSYS0_SRC_MASK 0x40000000 /* 0 = PLL A, 1 = PLL B */
|
||||
#define PLLSYS0_SEL_MASK 0x38000000 /* 0 = PLL, 1 = CPU, 5 = PerClk */
|
||||
#define PLLSYS0_TUNE_MASK 0x07fe0000 /* PLL Tune bits */
|
||||
#define PLLSYS0_FB_DIV_MASK 0x0001f000 /* Feedback divisor */
|
||||
#define PLLSYS0_FWD_DIV_A_MASK 0x00000f00 /* Fwd Div A */
|
||||
#define PLLSYS0_FWD_DIV_B_MASK 0x000000e0 /* Fwd Div B */
|
||||
#define PLLSYS0_PRI_DIV_B_MASK 0x0000001c /* PLL Primary Divisor B */
|
||||
#define PLLSYS0_OPB_DIV_MASK 0x00000003 /* OPB Divisor */
|
||||
|
||||
#define PLLC_ENG_MASK 0x20000000 /* PLL primary forward divisor source */
|
||||
#define PLLC_SRC_MASK 0x20000000 /* PLL feedback source */
|
||||
#define PLLD_FBDV_MASK 0x1f000000 /* PLL Feedback Divisor */
|
||||
#define PLLD_FWDVA_MASK 0x000f0000 /* PLL Forward Divisor A */
|
||||
#define PLLD_FWDVB_MASK 0x00000700 /* PLL Forward Divisor B */
|
||||
#define PLLD_LFBDV_MASK 0x0000003f /* PLL Local Feedback Divisor */
|
||||
|
||||
#define OPBDDV_MASK 0x03000000 /* OPB Clock Divisor Register */
|
||||
#define PERDV_MASK 0x07000000 /* Peripheral Clock Divisor */
|
||||
#define PRADV_MASK 0x07000000 /* Primary Divisor A */
|
||||
#define PRBDV_MASK 0x07000000 /* Primary Divisor B */
|
||||
#define SPCID_MASK 0x03000000 /* Sync PCI Divisor */
|
||||
|
||||
/* Strap 1 Register */
|
||||
#define PLLSYS1_LF_DIV_MASK 0xfc000000 /* PLL Local Feedback Divisor */
|
||||
#define PLLSYS1_PERCLK_DIV_MASK 0x03000000 /* Peripheral Clk Divisor */
|
||||
#define PLLSYS1_MAL_DIV_MASK 0x00c00000 /* MAL Clk Divisor */
|
||||
#define PLLSYS1_RW_MASK 0x00300000 /* ROM width */
|
||||
#define PLLSYS1_EAR_MASK 0x00080000 /* ERAP Address reset vector */
|
||||
#define PLLSYS1_PAE_MASK 0x00040000 /* PCI arbitor enable */
|
||||
#define PLLSYS1_PCHE_MASK 0x00020000 /* PCI host config enable */
|
||||
#define PLLSYS1_PISE_MASK 0x00010000 /* PCI init seq. enable */
|
||||
#define PLLSYS1_PCWE_MASK 0x00008000 /* PCI local cpu wait enable */
|
||||
#define PLLSYS1_PPIM_MASK 0x00007800 /* PCI inbound map */
|
||||
#define PLLSYS1_PR64E_MASK 0x00000400 /* PCI init Req64 enable */
|
||||
#define PLLSYS1_PXFS_MASK 0x00000300 /* PCI-X Freq Sel */
|
||||
#define PLLSYS1_RSVD_MASK 0x00000080 /* RSVD */
|
||||
#define PLLSYS1_PDM_MASK 0x00000040 /* PCI-X Driver Mode */
|
||||
#define PLLSYS1_EPS_MASK 0x00000038 /* Ethernet Pin Select */
|
||||
#define PLLSYS1_RMII_MASK 0x00000004 /* RMII Mode */
|
||||
#define PLLSYS1_TRE_MASK 0x00000002 /* GPIO Trace Enable */
|
||||
#define PLLSYS1_NTO1_MASK 0x00000001 /* CPU:PLB N-to-1 ratio */
|
||||
|
||||
#define PCIL0_BRDGOPT1 (PCIL0_CFGBASE + 0x0040)
|
||||
#define PCIL0_BRDGOPT2 (PCIL0_CFGBASE + 0x0044)
|
||||
|
||||
#endif /* _PPC440SP_H_ */
|
|
@ -1,101 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2010
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef _PPC440SPE_H_
|
||||
#define _PPC440SPE_H_
|
||||
|
||||
#define CONFIG_SDRAM_PPC4xx_IBM_DDR2 /* IBM DDR(2) controller */
|
||||
|
||||
/*
|
||||
* Some SoC specific registers (not common for all 440 SoC's)
|
||||
*/
|
||||
|
||||
/* Memory mapped register */
|
||||
#define CONFIG_SYS_PERIPHERAL_BASE 0xa0000000 /* Internal Peripherals */
|
||||
|
||||
#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_PERIPHERAL_BASE + 0x0200)
|
||||
#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_PERIPHERAL_BASE + 0x0300)
|
||||
|
||||
#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0700)
|
||||
|
||||
/* SDR's */
|
||||
#define SDR0_PCI0 0x0300
|
||||
#define SDR0_SDSTP2 0x0022
|
||||
#define SDR0_SDSTP3 0x0023
|
||||
|
||||
#define SDR0_SDSTP1_PAE_MASK (0x80000000 >> 13)
|
||||
#define SDR0_SDSTP1_PISE_MASK (0x80000000 >> 15)
|
||||
#define SDR0_SDSTP1_ERPN_MASK (0x80000000 >> 12)
|
||||
#define SDR0_SDSTP1_ERPN_EBC 0
|
||||
#define SDR0_SDSTP1_ERPN_PCI (0x80000000 >> 12)
|
||||
#define SDR0_SDSTP1_EBCW_MASK (0x80000000 >> 24)
|
||||
#define SDR0_SDSTP1_EBCW_8_BITS 0
|
||||
#define SDR0_SDSTP1_EBCW_16_BITS (0x80000000 >> 24)
|
||||
|
||||
#define SDR0_PFC1_EM_1000 (0x80000000 >> 10)
|
||||
|
||||
#define SDR0_MFR_FIXD (0x80000000 >> 3) /* Workaround for PCI/DMA */
|
||||
|
||||
#define SDR0_PINSTP_BOOTSTRAP_MASK 0xC0000000 /* Strap Bits */
|
||||
#define SDR0_PINSTP_BOOTSTRAP_SETTINGS0 0x00000000 /* Default strap settings 0
|
||||
(EBC boot) */
|
||||
#define SDR0_PINSTP_BOOTSTRAP_SETTINGS1 0x40000000 /* Default strap settings 1
|
||||
(PCI boot) */
|
||||
#define SDR0_PINSTP_BOOTSTRAP_IIC_54_EN 0x80000000 /* Serial Device Enabled -
|
||||
Addr = 0x54 */
|
||||
#define SDR0_PINSTP_BOOTSTRAP_IIC_50_EN 0xC0000000 /* Serial Device Enabled -
|
||||
Addr = 0x50 */
|
||||
|
||||
#define SDR0_SRST0_DMC 0x00200000
|
||||
|
||||
#define PLLSYS0_ENG_MASK 0x80000000 /* 0 = SysClk, 1 = PLL VCO */
|
||||
#define PLLSYS0_SRC_MASK 0x40000000 /* 0 = PLL A, 1 = PLL B */
|
||||
#define PLLSYS0_SEL_MASK 0x38000000 /* 0 = PLL, 1 = CPU, 5 = PerClk */
|
||||
#define PLLSYS0_TUNE_MASK 0x07fe0000 /* PLL Tune bits */
|
||||
#define PLLSYS0_FB_DIV_MASK 0x0001f000 /* Feedback divisor */
|
||||
#define PLLSYS0_FWD_DIV_A_MASK 0x00000f00 /* Fwd Div A */
|
||||
#define PLLSYS0_FWD_DIV_B_MASK 0x000000e0 /* Fwd Div B */
|
||||
#define PLLSYS0_PRI_DIV_B_MASK 0x0000001c /* PLL Primary Divisor B */
|
||||
#define PLLSYS0_OPB_DIV_MASK 0x00000003 /* OPB Divisor */
|
||||
|
||||
#define PLLC_ENG_MASK 0x20000000 /* PLL primary forward divisor source */
|
||||
#define PLLC_SRC_MASK 0x20000000 /* PLL feedback source */
|
||||
#define PLLD_FBDV_MASK 0x1f000000 /* PLL Feedback Divisor */
|
||||
#define PLLD_FWDVA_MASK 0x000f0000 /* PLL Forward Divisor A */
|
||||
#define PLLD_FWDVB_MASK 0x00000700 /* PLL Forward Divisor B */
|
||||
#define PLLD_LFBDV_MASK 0x0000003f /* PLL Local Feedback Divisor */
|
||||
|
||||
#define OPBDDV_MASK 0x03000000 /* OPB Clock Divisor Register */
|
||||
#define PERDV_MASK 0x07000000 /* Peripheral Clock Divisor */
|
||||
#define PRADV_MASK 0x07000000 /* Primary Divisor A */
|
||||
#define PRBDV_MASK 0x07000000 /* Primary Divisor B */
|
||||
#define SPCID_MASK 0x03000000 /* Sync PCI Divisor */
|
||||
|
||||
/* Strap 1 Register */
|
||||
#define PLLSYS1_LF_DIV_MASK 0xfc000000 /* PLL Local Feedback Divisor */
|
||||
#define PLLSYS1_PERCLK_DIV_MASK 0x03000000 /* Peripheral Clk Divisor */
|
||||
#define PLLSYS1_MAL_DIV_MASK 0x00c00000 /* MAL Clk Divisor */
|
||||
#define PLLSYS1_RW_MASK 0x00300000 /* ROM width */
|
||||
#define PLLSYS1_EAR_MASK 0x00080000 /* ERAP Address reset vector */
|
||||
#define PLLSYS1_PAE_MASK 0x00040000 /* PCI arbitor enable */
|
||||
#define PLLSYS1_PCHE_MASK 0x00020000 /* PCI host config enable */
|
||||
#define PLLSYS1_PISE_MASK 0x00010000 /* PCI init seq. enable */
|
||||
#define PLLSYS1_PCWE_MASK 0x00008000 /* PCI local cpu wait enable */
|
||||
#define PLLSYS1_PPIM_MASK 0x00007800 /* PCI inbound map */
|
||||
#define PLLSYS1_PR64E_MASK 0x00000400 /* PCI init Req64 enable */
|
||||
#define PLLSYS1_PXFS_MASK 0x00000300 /* PCI-X Freq Sel */
|
||||
#define PLLSYS1_RSVD_MASK 0x00000080 /* RSVD */
|
||||
#define PLLSYS1_PDM_MASK 0x00000040 /* PCI-X Driver Mode */
|
||||
#define PLLSYS1_EPS_MASK 0x00000038 /* Ethernet Pin Select */
|
||||
#define PLLSYS1_RMII_MASK 0x00000004 /* RMII Mode */
|
||||
#define PLLSYS1_TRE_MASK 0x00000002 /* GPIO Trace Enable */
|
||||
#define PLLSYS1_NTO1_MASK 0x00000001 /* CPU:PLB N-to-1 ratio */
|
||||
|
||||
#define PCIL0_BRDGOPT1 (PCIL0_CFGBASE + 0x0040)
|
||||
#define PCIL0_BRDGOPT2 (PCIL0_CFGBASE + 0x0044)
|
||||
|
||||
#endif /* _PPC440SPE_H_ */
|
|
@ -1,211 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2010
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef _PPC460EX_GT_H_
|
||||
#define _PPC460EX_GT_H_
|
||||
|
||||
#define CONFIG_SDRAM_PPC4xx_IBM_DDR2 /* IBM DDR(2) controller */
|
||||
|
||||
#define CONFIG_NAND_NDFC
|
||||
|
||||
/*
|
||||
* Some SoC specific registers
|
||||
*/
|
||||
|
||||
/* Memory mapped registers */
|
||||
#define CONFIG_SYS_PERIPHERAL_BASE 0xef600000 /* Internal Peripherals */
|
||||
|
||||
#ifndef CONFIG_DM_SERIAL
|
||||
#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_PERIPHERAL_BASE + 0x0300)
|
||||
#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_PERIPHERAL_BASE + 0x0400)
|
||||
#define CONFIG_SYS_NS16550_COM3 (CONFIG_SYS_PERIPHERAL_BASE + 0x0500)
|
||||
#define CONFIG_SYS_NS16550_COM4 (CONFIG_SYS_PERIPHERAL_BASE + 0x0600)
|
||||
#endif
|
||||
|
||||
#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0b00)
|
||||
#define GPIO1_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0c00)
|
||||
|
||||
/* DCR */
|
||||
#define AHB_TOP 0x00a4
|
||||
#define AHB_BOT 0x00a5
|
||||
|
||||
/* SDR */
|
||||
#define SDR0_PCI0 0x01c0
|
||||
#define SDR0_AHB_CFG 0x0370
|
||||
#define SDR0_USB2HOST_CFG 0x0371
|
||||
#define SDR0_ETH_PLL 0x4102
|
||||
#define SDR0_ETH_CFG 0x4103
|
||||
#define SDR0_ETH_STS 0x4104
|
||||
|
||||
/*
|
||||
* Register bits and masks
|
||||
*/
|
||||
#define SDR0_SDSTP1_PAE_MASK (0x80000000 >> 13)
|
||||
#define SDR0_SDSTP1_PISE_MASK (0x80000000 >> 15)
|
||||
|
||||
/* CUST0 Customer Configuration Register0 */
|
||||
#define SDR0_CUST0_MUX_E_N_G_MASK 0xC0000000 /* Mux_Emac_NDFC_GPIO */
|
||||
#define SDR0_CUST0_MUX_EMAC_SEL 0x40000000 /* Emac Selection */
|
||||
#define SDR0_CUST0_MUX_NDFC_SEL 0x80000000 /* NDFC Selection */
|
||||
#define SDR0_CUST0_MUX_GPIO_SEL 0xC0000000 /* GPIO Selection */
|
||||
|
||||
#define SDR0_CUST0_NDFC_EN_MASK 0x20000000 /* NDFC Enable Mask */
|
||||
#define SDR0_CUST0_NDFC_ENABLE 0x20000000 /* NDFC Enable */
|
||||
#define SDR0_CUST0_NDFC_DISABLE 0x00000000 /* NDFC Disable */
|
||||
|
||||
#define SDR0_CUST0_NDFC_BW_MASK 0x10000000 /* NDFC Boot Width */
|
||||
#define SDR0_CUST0_NDFC_BW_16_BIT 0x10000000 /* NDFC Boot Width = 16 Bit */
|
||||
#define SDR0_CUST0_NDFC_BW_8_BIT 0x00000000 /* NDFC Boot Width = 8 Bit */
|
||||
|
||||
#define SDR0_CUST0_NDFC_BP_MASK 0x0F000000 /* NDFC Boot Page */
|
||||
#define SDR0_CUST0_NDFC_BP_ENCODE(n) ((((u32)(n)) & 0xF) << 24)
|
||||
#define SDR0_CUST0_NDFC_BP_DECODE(n) ((((u32)(n)) >> 24) & 0xF)
|
||||
|
||||
#define SDR0_CUST0_NDFC_BAC_MASK 0x00C00000 /* NDFC Boot Address Cycle */
|
||||
#define SDR0_CUST0_NDFC_BAC_ENCODE(n) ((((u32)(n)) & 0x3) << 22)
|
||||
#define SDR0_CUST0_NDFC_BAC_DECODE(n) ((((u32)(n)) >> 22) & 0x3)
|
||||
|
||||
#define SDR0_CUST0_NDFC_ARE_MASK 0x00200000 /* NDFC Auto Read Enable */
|
||||
#define SDR0_CUST0_NDFC_ARE_ENABLE 0x00200000 /* NDFC Auto Read Enable */
|
||||
#define SDR0_CUST0_NDFC_ARE_DISABLE 0x00000000 /* NDFC Auto Read Disable */
|
||||
|
||||
#define SDR0_CUST0_NRB_MASK 0x00100000 /* NDFC Ready / Busy */
|
||||
#define SDR0_CUST0_NRB_BUSY 0x00100000 /* Busy */
|
||||
#define SDR0_CUST0_NRB_READY 0x00000000 /* Ready */
|
||||
|
||||
#define SDR0_CUST0_NDRSC_MASK 0x0000FFF0 /* NDFC Device Reset Count Mask */
|
||||
#define SDR0_CUST0_NDRSC_ENCODE(n) ((((u32)(n)) & 0xFFF) << 4)
|
||||
#define SDR0_CUST0_NDRSC_DECODE(n) ((((u32)(n)) >> 4) & 0xFFF)
|
||||
|
||||
#define SDR0_CUST0_CHIPSELGAT_MASK 0x0000000F /* Chip Select Gating Mask */
|
||||
#define SDR0_CUST0_CHIPSELGAT_DIS 0x00000000 /* Chip Select Gating Disable */
|
||||
#define SDR0_CUST0_CHIPSELGAT_ENALL 0x0000000F /*All Chip Select Gating Enable*/
|
||||
#define SDR0_CUST0_CHIPSELGAT_EN0 0x00000008 /* Chip Select0 Gating Enable */
|
||||
#define SDR0_CUST0_CHIPSELGAT_EN1 0x00000004 /* Chip Select1 Gating Enable */
|
||||
#define SDR0_CUST0_CHIPSELGAT_EN2 0x00000002 /* Chip Select2 Gating Enable */
|
||||
#define SDR0_CUST0_CHIPSELGAT_EN3 0x00000001 /* Chip Select3 Gating Enable */
|
||||
|
||||
/* Ethernet PLL Configuration Register (SDR0_ETH_PLL) */
|
||||
#define SDR0_ETH_PLL_PLLLOCK 0x80000000 /* Ethernet PLL lock indication */
|
||||
|
||||
/* Ethernet Configuration Register (SDR0_ETH_CFG) */
|
||||
#define SDR0_ETH_CFG_SGMII3_LPBK 0x00800000 /*SGMII3 port loopback
|
||||
enable */
|
||||
#define SDR0_ETH_CFG_SGMII2_LPBK 0x00400000 /*SGMII2 port loopback
|
||||
enable */
|
||||
#define SDR0_ETH_CFG_SGMII1_LPBK 0x00200000 /*SGMII1 port loopback
|
||||
enable */
|
||||
#define SDR0_ETH_CFG_SGMII0_LPBK 0x00100000 /*SGMII0 port loopback
|
||||
enable */
|
||||
#define SDR0_ETH_CFG_SGMII_MASK 0x00070000 /*SGMII Mask */
|
||||
#define SDR0_ETH_CFG_SGMII2_ENABLE 0x00040000 /*SGMII2 port enable */
|
||||
#define SDR0_ETH_CFG_SGMII1_ENABLE 0x00020000 /*SGMII1 port enable */
|
||||
#define SDR0_ETH_CFG_SGMII0_ENABLE 0x00010000 /*SGMII0 port enable */
|
||||
#define SDR0_ETH_CFG_TAHOE1_BYPASS 0x00002000 /*TAHOE1 Bypass selector */
|
||||
#define SDR0_ETH_CFG_TAHOE0_BYPASS 0x00001000 /*TAHOE0 Bypass selector */
|
||||
#define SDR0_ETH_CFG_EMAC3_PHY_CLK_SEL 0x00000800 /*EMAC 3 PHY clock selector*/
|
||||
#define SDR0_ETH_CFG_EMAC2_PHY_CLK_SEL 0x00000400 /*EMAC 2 PHY clock selector*/
|
||||
#define SDR0_ETH_CFG_EMAC1_PHY_CLK_SEL 0x00000200 /*EMAC 1 PHY clock selector*/
|
||||
#define SDR0_ETH_CFG_EMAC0_PHY_CLK_SEL 0x00000100 /*EMAC 0 PHY clock selector*/
|
||||
#define SDR0_ETH_CFG_EMAC_2_1_SWAP 0x00000080 /*Swap EMAC2 with EMAC1 */
|
||||
#define SDR0_ETH_CFG_EMAC_0_3_SWAP 0x00000040 /*Swap EMAC0 with EMAC3 */
|
||||
#define SDR0_ETH_CFG_MDIO_SEL_MASK 0x00000030 /*MDIO source selector mask*/
|
||||
#define SDR0_ETH_CFG_MDIO_SEL_EMAC0 0x00000000 /*MDIO source - EMAC0 */
|
||||
#define SDR0_ETH_CFG_MDIO_SEL_EMAC1 0x00000010 /*MDIO source - EMAC1 */
|
||||
#define SDR0_ETH_CFG_MDIO_SEL_EMAC2 0x00000020 /*MDIO source - EMAC2 */
|
||||
#define SDR0_ETH_CFG_MDIO_SEL_EMAC3 0x00000030 /*MDIO source - EMAC3 */
|
||||
#define SDR0_ETH_CFG_GMC1_BRIDGE_SEL 0x00000002 /*GMC Port 1 bridge
|
||||
selector */
|
||||
#define SDR0_ETH_CFG_GMC0_BRIDGE_SEL 0x00000001 /*GMC Port 0 bridge
|
||||
selector */
|
||||
|
||||
#define SDR0_SRST0_BGO 0x80000000 /* PLB to OPB bridge */
|
||||
#define SDR0_SRST0_PLB4 0x40000000 /* PLB4 arbiter */
|
||||
#define SDR0_SRST0_EBC 0x20000000 /* External bus controller */
|
||||
#define SDR0_SRST0_OPB 0x10000000 /* OPB arbiter */
|
||||
#define SDR0_SRST0_UART0 0x08000000 /* Universal asynchronous receiver/
|
||||
transmitter 0 */
|
||||
#define SDR0_SRST0_UART1 0x04000000 /* Universal asynchronous receiver/
|
||||
transmitter 1 */
|
||||
#define SDR0_SRST0_IIC0 0x02000000 /* Inter integrated circuit 0 */
|
||||
#define SDR0_SRST0_IIC1 0x01000000 /* Inter integrated circuit 1 */
|
||||
#define SDR0_SRST0_GPIO0 0x00800000 /* General purpose I/O 0 */
|
||||
#define SDR0_SRST0_GPT 0x00400000 /* General purpose timer */
|
||||
#define SDR0_SRST0_DMC 0x00200000 /* DDR SDRAM memory controller */
|
||||
#define SDR0_SRST0_PCI 0x00100000 /* PCI */
|
||||
#define SDR0_SRST0_CPM0 0x00020000 /* Clock and power management */
|
||||
#define SDR0_SRST0_IMU 0x00010000 /* I2O DMA */
|
||||
#define SDR0_SRST0_UIC0 0x00008000 /* Universal interrupt controller 0*/
|
||||
#define SDR0_SRST0_UIC1 0x00004000 /* Universal interrupt controller 1*/
|
||||
#define SDR0_SRST0_SRAM 0x00002000 /* Universal interrupt controller 0*/
|
||||
#define SDR0_SRST0_UIC2 0x00001000 /* Universal interrupt controller 2*/
|
||||
#define SDR0_SRST0_UIC3 0x00000800 /* Universal interrupt controller 3*/
|
||||
#define SDR0_SRST0_OCM 0x00000400 /* Universal interrupt controller 0*/
|
||||
#define SDR0_SRST0_UART2 0x00000200 /* Universal asynchronous receiver/
|
||||
transmitter 2 */
|
||||
#define SDR0_SRST0_MAL 0x00000100 /* Media access layer */
|
||||
#define SDR0_SRST0_GPTR 0x00000040 /* General purpose timer */
|
||||
#define SDR0_SRST0_L2CACHE 0x00000004 /* L2 Cache */
|
||||
#define SDR0_SRST0_UART3 0x00000002 /* Universal asynchronous receiver/
|
||||
transmitter 3 */
|
||||
#define SDR0_SRST0_GPIO1 0x00000001 /* General purpose I/O 1 */
|
||||
|
||||
#define SDR0_SRST1_RLL 0x80000000 /* SRIO RLL */
|
||||
#define SDR0_SRST1_SCP 0x40000000 /* Serial communications port */
|
||||
#define SDR0_SRST1_PLBARB 0x20000000 /* PLB Arbiter */
|
||||
#define SDR0_SRST1_EIPPKP 0x10000000 /* EIPPPKP */
|
||||
#define SDR0_SRST1_EIP94 0x08000000 /* EIP 94 */
|
||||
#define SDR0_SRST1_EMAC0 0x04000000 /* Ethernet media access
|
||||
controller 0 */
|
||||
#define SDR0_SRST1_EMAC1 0x02000000 /* Ethernet media access
|
||||
controller 1 */
|
||||
#define SDR0_SRST1_EMAC2 0x01000000 /* Ethernet media access
|
||||
controller 2 */
|
||||
#define SDR0_SRST1_EMAC3 0x00800000 /* Ethernet media access
|
||||
controller 3 */
|
||||
#define SDR0_SRST1_ZMII 0x00400000 /* Ethernet ZMII/RMII/SMII */
|
||||
#define SDR0_SRST1_RGMII0 0x00200000 /* Ethernet RGMII/RTBI 0 */
|
||||
#define SDR0_SRST1_RGMII1 0x00100000 /* Ethernet RGMII/RTBI 1 */
|
||||
#define SDR0_SRST1_DMA4 0x00080000 /* DMA to PLB4 */
|
||||
#define SDR0_SRST1_DMA4CH 0x00040000 /* DMA Channel to PLB4 */
|
||||
#define SDR0_SRST1_SATAPHY 0x00020000 /* Serial ATA PHY */
|
||||
#define SDR0_SRST1_SRIODEV 0x00010000 /* Serial Rapid IO core, PCS, and
|
||||
serdes */
|
||||
#define SDR0_SRST1_SRIOPCS 0x00008000 /* Serial Rapid IO core and PCS */
|
||||
#define SDR0_SRST1_NDFC 0x00004000 /* Nand flash controller */
|
||||
#define SDR0_SRST1_SRIOPLB 0x00002000 /* Serial Rapid IO PLB */
|
||||
#define SDR0_SRST1_ETHPLL 0x00001000 /* Ethernet PLL */
|
||||
#define SDR0_SRST1_TAHOE1 0x00000800 /* Ethernet Tahoe 1 */
|
||||
#define SDR0_SRST1_TAHOE0 0x00000400 /* Ethernet Tahoe 0 */
|
||||
#define SDR0_SRST1_SGMII0 0x00000200 /* Ethernet SGMII 0 */
|
||||
#define SDR0_SRST1_SGMII1 0x00000100 /* Ethernet SGMII 1 */
|
||||
#define SDR0_SRST1_SGMII2 0x00000080 /* Ethernet SGMII 2 */
|
||||
#define SDR0_SRST1_AHB 0x00000040 /* PLB4XAHB bridge */
|
||||
#define SDR0_SRST1_USBOTGPHY 0x00000020 /* USB 2.0 OTG PHY */
|
||||
#define SDR0_SRST1_USBOTG 0x00000010 /* USB 2.0 OTG controller */
|
||||
#define SDR0_SRST1_USBHOST 0x00000008 /* USB 2.0 Host controller */
|
||||
#define SDR0_SRST1_AHBDMAC 0x00000004 /* AHB DMA controller */
|
||||
#define SDR0_SRST1_AHBICM 0x00000002 /* AHB inter-connect matrix */
|
||||
#define SDR0_SRST1_SATA 0x00000001 /* Serial ATA controller */
|
||||
|
||||
#define PLLSYS0_FWD_DIV_A_MASK 0x000000f0 /* Fwd Div A */
|
||||
#define PLLSYS0_FWD_DIV_B_MASK 0x0000000f /* Fwd Div B */
|
||||
#define PLLSYS0_FB_DIV_MASK 0x0000ff00 /* Feedback divisor */
|
||||
#define PLLSYS0_OPB_DIV_MASK 0x0c000000 /* OPB Divisor */
|
||||
#define PLLSYS0_PLBEDV0_DIV_MASK 0xe0000000 /* PLB Early Clock Divisor */
|
||||
#define PLLSYS0_PERCLK_DIV_MASK 0x03000000 /* Peripheral Clk Divisor */
|
||||
#define PLLSYS0_SEL_MASK 0x18000000 /* 0 = PLL, 1 = PerClk */
|
||||
|
||||
#define CPR0_ICFG_RLI_MASK 0x80000000
|
||||
|
||||
#define CPR0_PLLC_RST 0x80000000
|
||||
#define CPR0_PLLC_ENG 0x40000000
|
||||
|
||||
#define PCIL0_BRDGOPT1 (PCIL0_CFGBASE + 0x0040)
|
||||
#define PCIL0_BRDGOPT2 (PCIL0_CFGBASE + 0x0044)
|
||||
|
||||
#endif /* _PPC460EX_GT_H_ */
|
|
@ -1,31 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2010
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef _PPC460SX_H_
|
||||
#define _PPC460SX_H_
|
||||
|
||||
#define CONFIG_SDRAM_PPC4xx_IBM_DDR2 /* IBM DDR(2) controller */
|
||||
|
||||
/* Memory mapped registers */
|
||||
#define CONFIG_SYS_PERIPHERAL_BASE 0xa0000000 /* Internal Peripherals */
|
||||
|
||||
#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_PERIPHERAL_BASE + 0x0200)
|
||||
#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_PERIPHERAL_BASE + 0x0300)
|
||||
|
||||
#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0700)
|
||||
|
||||
#define SDR0_SRST0_DMC 0x00200000
|
||||
|
||||
#define PLLSYS0_FWD_DIV_A_MASK 0x000000f0 /* Fwd Div A */
|
||||
#define PLLSYS0_FWD_DIV_B_MASK 0x0000000f /* Fwd Div B */
|
||||
#define PLLSYS0_FB_DIV_MASK 0x0000ff00 /* Feedback divisor */
|
||||
#define PLLSYS0_OPB_DIV_MASK 0x0c000000 /* OPB Divisor */
|
||||
#define PLLSYS0_PLBEDV0_DIV_MASK 0xe0000000 /* PLB Early Clock Divisor */
|
||||
#define PLLSYS0_PERCLK_DIV_MASK 0x03000000 /* Peripheral Clk Divisor */
|
||||
#define PLLSYS0_SEL_MASK 0x18000000 /* 0 = PLL, 1 = PerClk */
|
||||
|
||||
#endif /* _PPC460SX_H_ */
|
|
@ -1,183 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2008
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef _PPC4xx_EBC_H_
|
||||
#define _PPC4xx_EBC_H_
|
||||
|
||||
/*
|
||||
* Currently there are two register layout versions for the IBM EBC core
|
||||
* used on 4xx PPC's. The following grouping lists the first layout.
|
||||
* Within this group there is a slight variation concerning the bit field
|
||||
* position of the EMPL and EMPH fields:
|
||||
*/
|
||||
#if defined(CONFIG_405GP) || \
|
||||
defined(CONFIG_405EP) || \
|
||||
defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
|
||||
defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
|
||||
#define CONFIG_EBC_PPC4xx_IBM_VER1
|
||||
#if defined(CONFIG_405GP) || \
|
||||
defined(CONFIG_405EP)
|
||||
#define EBC_CFG_EMPH_POS 8
|
||||
#define EBC_CFG_EMPL_POS 6
|
||||
#else
|
||||
#define EBC_CFG_EMPH_POS 6
|
||||
#define EBC_CFG_EMPL_POS 8
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Define the max number of EBC banks (chip selects)
|
||||
*/
|
||||
#if defined(CONFIG_405GP) || \
|
||||
defined(CONFIG_405EZ) || \
|
||||
defined(CONFIG_440GP) || defined(CONFIG_440GX)
|
||||
#define EBC_NUM_BANKS 8
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_405EP)
|
||||
#define EBC_NUM_BANKS 5
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_405EX) || \
|
||||
defined(CONFIG_460SX)
|
||||
#define EBC_NUM_BANKS 4
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
|
||||
defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
|
||||
defined(CONFIG_460EX) || defined(CONFIG_460GT)
|
||||
#define EBC_NUM_BANKS 6
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_440SP) || defined(CONFIG_440SPE)
|
||||
#define EBC_NUM_BANKS 3
|
||||
#endif
|
||||
|
||||
/* Bank Configuration Register */
|
||||
#define EBC_BXCR(n) (n)
|
||||
#define EBC_BXCR_BANK_SIZE(n) (0x100000 << (((n) & EBC_BXCR_BS_MASK) >> 17))
|
||||
|
||||
#define EBC_BXCR_BAS_MASK PPC_REG_VAL(11, 0xFFF)
|
||||
#define EBC_BXCR_BAS_ENCODE(n) (((static_cast(u32, n)) & EBC_BXCR_BAS_MASK))
|
||||
#define EBC_BXCR_BS_MASK PPC_REG_VAL(14, 0x7)
|
||||
#define EBC_BXCR_BS_1MB PPC_REG_VAL(14, 0x0)
|
||||
#define EBC_BXCR_BS_2MB PPC_REG_VAL(14, 0x1)
|
||||
#define EBC_BXCR_BS_4MB PPC_REG_VAL(14, 0x2)
|
||||
#define EBC_BXCR_BS_8MB PPC_REG_VAL(14, 0x3)
|
||||
#define EBC_BXCR_BS_16MB PPC_REG_VAL(14, 0x4)
|
||||
#define EBC_BXCR_BS_32MB PPC_REG_VAL(14, 0x5)
|
||||
#define EBC_BXCR_BS_64MB PPC_REG_VAL(14, 0x6)
|
||||
#define EBC_BXCR_BS_128MB PPC_REG_VAL(14, 0x7)
|
||||
#define EBC_BXCR_BU_MASK PPC_REG_VAL(16, 0x3)
|
||||
#define EBC_BXCR_BU_NONE PPC_REG_VAL(16, 0x0)
|
||||
#define EBC_BXCR_BU_R PPC_REG_VAL(16, 0x1)
|
||||
#define EBC_BXCR_BU_W PPC_REG_VAL(16, 0x2)
|
||||
#define EBC_BXCR_BU_RW PPC_REG_VAL(16, 0x3)
|
||||
#define EBC_BXCR_BW_MASK PPC_REG_VAL(18, 0x3)
|
||||
#define EBC_BXCR_BW_8BIT PPC_REG_VAL(18, 0x0)
|
||||
#define EBC_BXCR_BW_16BIT PPC_REG_VAL(18, 0x1)
|
||||
#if defined(CONFIG_EBC_PPC4xx_IBM_VER1)
|
||||
#define EBC_BXCR_BW_32BIT PPC_REG_VAL(18, 0x2)
|
||||
#else
|
||||
#define EBC_BXCR_BW_32BIT PPC_REG_VAL(18, 0x3)
|
||||
#endif
|
||||
|
||||
/* Bank Access Parameter Register */
|
||||
#define EBC_BXAP_BME_ENABLED PPC_REG_VAL(0, 0x1)
|
||||
#define EBC_BXAP_BME_DISABLED PPC_REG_VAL(0, 0x0)
|
||||
#define EBC_BXAP_TWT_ENCODE(n) PPC_REG_VAL(8, (static_cast(u32, n)) & 0xFF)
|
||||
#define EBC_BXAP_FWT_ENCODE(n) PPC_REG_VAL(5, (static_cast(u32, n)) & 0x1F)
|
||||
#define EBC_BXAP_BWT_ENCODE(n) PPC_REG_VAL(8, (static_cast(u32, n)) & 0x7)
|
||||
#define EBC_BXAP_BCE_DISABLE PPC_REG_VAL(9, 0x0)
|
||||
#define EBC_BXAP_BCE_ENABLE PPC_REG_VAL(9, 0x1)
|
||||
#define EBC_BXAP_BCT_MASK PPC_REG_VAL(11, 0x3)
|
||||
#define EBC_BXAP_BCT_2TRANS PPC_REG_VAL(11, 0x0)
|
||||
#define EBC_BXAP_BCT_4TRANS PPC_REG_VAL(11, 0x1)
|
||||
#define EBC_BXAP_BCT_8TRANS PPC_REG_VAL(11, 0x2)
|
||||
#define EBC_BXAP_BCT_16TRANS PPC_REG_VAL(11, 0x3)
|
||||
#define EBC_BXAP_CSN_ENCODE(n) PPC_REG_VAL(13, (static_cast(u32, n)) & 0x3)
|
||||
#define EBC_BXAP_OEN_ENCODE(n) PPC_REG_VAL(15, (static_cast(u32, n)) & 0x3)
|
||||
#define EBC_BXAP_WBN_ENCODE(n) PPC_REG_VAL(17, (static_cast(u32, n)) & 0x3)
|
||||
#define EBC_BXAP_WBF_ENCODE(n) PPC_REG_VAL(19, (static_cast(u32, n)) & 0x3)
|
||||
#define EBC_BXAP_TH_ENCODE(n) PPC_REG_VAL(22, (static_cast(u32, n)) & 0x7)
|
||||
#define EBC_BXAP_RE_ENABLED PPC_REG_VAL(23, 0x1)
|
||||
#define EBC_BXAP_RE_DISABLED PPC_REG_VAL(23, 0x0)
|
||||
#define EBC_BXAP_SOR_DELAYED PPC_REG_VAL(24, 0x0)
|
||||
#define EBC_BXAP_SOR_NONDELAYED PPC_REG_VAL(24, 0x1)
|
||||
#define EBC_BXAP_BEM_WRITEONLY PPC_REG_VAL(25, 0x0)
|
||||
#define EBC_BXAP_BEM_RW PPC_REG_VAL(25, 0x1)
|
||||
#define EBC_BXAP_PEN_DISABLED PPC_REG_VAL(26, 0x0)
|
||||
#define EBC_BXAP_PEN_ENABLED PPC_REG_VAL(26, 0x1)
|
||||
|
||||
/* Common fields in EBC0_CFG register */
|
||||
#define EBC_CFG_PTD_MASK PPC_REG_VAL(1, 0x1)
|
||||
#define EBC_CFG_PTD_ENABLE PPC_REG_VAL(1, 0x0)
|
||||
#define EBC_CFG_PTD_DISABLE PPC_REG_VAL(1, 0x1)
|
||||
#define EBC_CFG_RTC_MASK PPC_REG_VAL(4, 0x7)
|
||||
#define EBC_CFG_RTC_16PERCLK PPC_REG_VAL(4, 0x0)
|
||||
#define EBC_CFG_RTC_32PERCLK PPC_REG_VAL(4, 0x1)
|
||||
#define EBC_CFG_RTC_64PERCLK PPC_REG_VAL(4, 0x2)
|
||||
#define EBC_CFG_RTC_128PERCLK PPC_REG_VAL(4, 0x3)
|
||||
#define EBC_CFG_RTC_256PERCLK PPC_REG_VAL(4, 0x4)
|
||||
#define EBC_CFG_RTC_512PERCLK PPC_REG_VAL(4, 0x5)
|
||||
#define EBC_CFG_RTC_1024PERCLK PPC_REG_VAL(4, 0x6)
|
||||
#define EBC_CFG_RTC_2048PERCLK PPC_REG_VAL(4, 0x7)
|
||||
#define EBC_CFG_PME_MASK PPC_REG_VAL(14, 0x1)
|
||||
#define EBC_CFG_PME_DISABLE PPC_REG_VAL(14, 0x0)
|
||||
#define EBC_CFG_PME_ENABLE PPC_REG_VAL(14, 0x1)
|
||||
#define EBC_CFG_PMT_MASK PPC_REG_VAL(19, 0x1F)
|
||||
#define EBC_CFG_PMT_ENCODE(n) PPC_REG_VAL(19, (static_cast(u32, n)) & 0x1F)
|
||||
|
||||
/* Now the two versions of the other bits */
|
||||
#if defined(CONFIG_EBC_PPC4xx_IBM_VER1)
|
||||
#define EBC_CFG_EBTC_MASK PPC_REG_VAL(0, 0x1)
|
||||
#define EBC_CFG_EBTC_HI PPC_REG_VAL(0, 0x0)
|
||||
#define EBC_CFG_EBTC_DRIVEN PPC_REG_VAL(0, 0x1)
|
||||
#define EBC_CFG_EMPH_MASK PPC_REG_VAL(EBC_CFG_EMPH_POS, 0x3)
|
||||
#define EBC_CFG_EMPH_ENCODE(n) PPC_REG_VAL(EBC_CFG_EMPH_POS, \
|
||||
(static_cast(u32, n)) & 0x3)
|
||||
#define EBC_CFG_EMPL_MASK PPC_REG_VAL(EBC_CFG_EMPL_POS, 0x3)
|
||||
#define EBC_CFG_EMPL_ENCODE(n) PPC_REG_VAL(EBC_CFG_EMPH_POS, \
|
||||
(static_cast(u32, n)) & 0x3)
|
||||
#define EBC_CFG_CSTC_MASK PPC_REG_VAL(9, 0x1)
|
||||
#define EBC_CFG_CSTC_HI PPC_REG_VAL(9, 0x0)
|
||||
#define EBC_CFG_CSTC_DRIVEN PPC_REG_VAL(9, 0x1)
|
||||
#define EBC_CFG_BPR_MASK PPC_REG_VAL(11, 0x3)
|
||||
#define EBC_CFG_BPR_1DW PPC_REG_VAL(11, 0x0)
|
||||
#define EBC_CFG_BPR_2DW PPC_REG_VAL(11, 0x1)
|
||||
#define EBC_CFG_BPR_4DW PPC_REG_VAL(11, 0x2)
|
||||
#define EBC_CFG_EMS_MASK PPC_REG_VAL(13, 0x3)
|
||||
#define EBC_CFG_EMS_8BIT PPC_REG_VAL(13, 0x0)
|
||||
#define EBC_CFG_EMS_16BIT PPC_REG_VAL(13, 0x1)
|
||||
#define EBC_CFG_EMS_32BIT PPC_REG_VAL(13, 0x2)
|
||||
#else
|
||||
#define EBC_CFG_LE_MASK PPC_REG_VAL(0, 0x1)
|
||||
#define EBC_CFG_LE_UNLOCK PPC_REG_VAL(0, 0x0)
|
||||
#define EBC_CFG_LE_LOCK PPC_REG_VAL(0, 0x1)
|
||||
#define EBC_CFG_ATC_MASK PPC_REG_VAL(5, 0x1)
|
||||
#define EBC_CFG_ATC_HI PPC_REG_VAL(5, 0x0)
|
||||
#define EBC_CFG_ATC_PREVIOUS PPC_REG_VAL(5, 0x1)
|
||||
#define EBC_CFG_DTC_MASK PPC_REG_VAL(6, 0x1)
|
||||
#define EBC_CFG_DTC_HI PPC_REG_VAL(6, 0x0)
|
||||
#define EBC_CFG_DTC_PREVIOUS PPC_REG_VAL(6, 0x1)
|
||||
#define EBC_CFG_CTC_MASK PPC_REG_VAL(7, 0x1)
|
||||
#define EBC_CFG_CTC_HI PPC_REG_VAL(7, 0x0)
|
||||
#define EBC_CFG_CTC_PREVIOUS PPC_REG_VAL(7, 0x1)
|
||||
#define EBC_CFG_OEO_MASK PPC_REG_VAL(8, 0x1)
|
||||
#define EBC_CFG_OEO_HI PPC_REG_VAL(8, 0x0)
|
||||
#define EBC_CFG_OEO_PREVIOUS PPC_REG_VAL(8, 0x1)
|
||||
#define EBC_CFG_EMC_MASK PPC_REG_VAL(9, 0x1)
|
||||
#define EBC_CFG_EMC_NONDEFAULT PPC_REG_VAL(9, 0x0)
|
||||
#define EBC_CFG_EMC_DEFAULT PPC_REG_VAL(9, 0x1)
|
||||
#define EBC_CFG_PR_MASK PPC_REG_VAL(21, 0x3)
|
||||
#define EBC_CFG_PR_16 PPC_REG_VAL(21, 0x0)
|
||||
#define EBC_CFG_PR_32 PPC_REG_VAL(21, 0x1)
|
||||
#define EBC_CFG_PR_64 PPC_REG_VAL(21, 0x2)
|
||||
#define EBC_CFG_PR_128 PPC_REG_VAL(21, 0x3)
|
||||
#endif
|
||||
|
||||
#endif /* _PPC4xx_EBC_H_ */
|
|
@ -1,536 +0,0 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: GPL-2.0 IBM-pibs
|
||||
*/
|
||||
/*----------------------------------------------------------------------------+
|
||||
|
|
||||
| File Name: enetemac.h
|
||||
|
|
||||
| Function: Header file for the EMAC3 macro on the 405GP.
|
||||
|
|
||||
| Author: Mark Wisner
|
||||
|
|
||||
| Change Activity-
|
||||
|
|
||||
| Date Description of Change BY
|
||||
| --------- --------------------- ---
|
||||
| 29-Apr-99 Created MKW
|
||||
|
|
||||
+----------------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------------+
|
||||
| 19-Nov-03 Travis Sawyer, Sandburst Corporation, tsawyer@sandburst.com
|
||||
| ported to handle 440GP and 440GX multiple EMACs
|
||||
+----------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _PPC4XX_ENET_H_
|
||||
#define _PPC4XX_ENET_H_
|
||||
|
||||
#include <net.h>
|
||||
#include "asm/ppc4xx-mal.h"
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------+
|
||||
| General enternet defines. 802 frames are not supported.
|
||||
+-----------------------------------------------------------------------------*/
|
||||
#define ENET_ADDR_LENGTH 6
|
||||
#define ENET_ARPTYPE 0x806
|
||||
#define ARP_REQUEST 1
|
||||
#define ARP_REPLY 2
|
||||
#define ENET_IPTYPE 0x800
|
||||
#define ARP_CACHE_SIZE 5
|
||||
|
||||
#define NUM_TX_BUFF 1
|
||||
#define NUM_RX_BUFF PKTBUFSRX
|
||||
|
||||
struct enet_frame {
|
||||
unsigned char dest_addr[ENET_ADDR_LENGTH];
|
||||
unsigned char source_addr[ENET_ADDR_LENGTH];
|
||||
unsigned short type;
|
||||
unsigned char enet_data[1];
|
||||
};
|
||||
|
||||
struct arp_entry {
|
||||
unsigned long inet_address;
|
||||
unsigned char mac_address[ENET_ADDR_LENGTH];
|
||||
unsigned long valid;
|
||||
unsigned long sec;
|
||||
unsigned long nsec;
|
||||
};
|
||||
|
||||
|
||||
/* Statistic Areas */
|
||||
#define MAX_ERR_LOG 10
|
||||
|
||||
typedef struct emac_stats_st{ /* Statistic Block */
|
||||
int data_len_err;
|
||||
int rx_frames;
|
||||
int rx;
|
||||
int rx_prot_err;
|
||||
int int_err;
|
||||
int pkts_tx;
|
||||
int pkts_rx;
|
||||
int pkts_handled;
|
||||
short tx_err_log[MAX_ERR_LOG];
|
||||
short rx_err_log[MAX_ERR_LOG];
|
||||
} EMAC_STATS_ST, *EMAC_STATS_PST;
|
||||
|
||||
/* Structure containing variables used by the shared code (4xx_enet.c) */
|
||||
typedef struct emac_4xx_hw_st {
|
||||
uint32_t hw_addr; /* EMAC offset */
|
||||
uint32_t tah_addr; /* TAH offset */
|
||||
uint32_t phy_id;
|
||||
uint32_t phy_addr;
|
||||
uint32_t original_fc;
|
||||
uint32_t txcw;
|
||||
uint32_t autoneg_failed;
|
||||
uint32_t emac_ier;
|
||||
volatile mal_desc_t *tx;
|
||||
volatile mal_desc_t *rx;
|
||||
u32 tx_phys;
|
||||
u32 rx_phys;
|
||||
bd_t *bis; /* for eth_init upon mal error */
|
||||
mal_desc_t *alloc_tx_buf;
|
||||
mal_desc_t *alloc_rx_buf;
|
||||
char *txbuf_ptr;
|
||||
uint16_t devnum;
|
||||
int get_link_status;
|
||||
int tbi_compatibility_en;
|
||||
int tbi_compatibility_on;
|
||||
int fc_send_xon;
|
||||
int report_tx_early;
|
||||
int first_init;
|
||||
int tx_err_index;
|
||||
int rx_err_index;
|
||||
int rx_slot; /* MAL Receive Slot */
|
||||
int rx_i_index; /* Receive Interrupt Queue Index */
|
||||
int rx_u_index; /* Receive User Queue Index */
|
||||
int tx_slot; /* MAL Transmit Slot */
|
||||
int tx_i_index; /* Transmit Interrupt Queue Index */
|
||||
int tx_u_index; /* Transmit User Queue Index */
|
||||
int rx_ready[NUM_RX_BUFF]; /* Receive Ready Queue */
|
||||
int tx_run[NUM_TX_BUFF]; /* Transmit Running Queue */
|
||||
int is_receiving; /* sync with eth interrupt */
|
||||
int print_speed; /* print speed message upon start */
|
||||
EMAC_STATS_ST stats;
|
||||
} EMAC_4XX_HW_ST, *EMAC_4XX_HW_PST;
|
||||
|
||||
|
||||
#if defined(CONFIG_440GX) || defined(CONFIG_460GT)
|
||||
#define EMAC_NUM_DEV 4
|
||||
#elif (defined(CONFIG_440) || defined(CONFIG_405EP)) && \
|
||||
!defined(CONFIG_440SP) && !defined(CONFIG_440SPE)
|
||||
#define EMAC_NUM_DEV 2
|
||||
#else
|
||||
#define EMAC_NUM_DEV 1
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IBM_EMAC4_V4 /* EMAC4 V4 changed bit setting */
|
||||
#define EMAC_STACR_OC_MASK (0x00008000)
|
||||
#else
|
||||
#define EMAC_STACR_OC_MASK (0x00000000)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* XMII bridge configurations for those systems (e.g. 405EX(r)) that do
|
||||
* not have a pin function control (PFC) register to otherwise determine
|
||||
* the bridge configuration.
|
||||
*/
|
||||
#define EMAC_PHY_MODE_NONE 0
|
||||
#define EMAC_PHY_MODE_NONE_RGMII 1
|
||||
#define EMAC_PHY_MODE_RGMII_NONE 2
|
||||
#define EMAC_PHY_MODE_RGMII_RGMII 3
|
||||
#define EMAC_PHY_MODE_NONE_GMII 4
|
||||
#define EMAC_PHY_MODE_GMII_NONE 5
|
||||
#define EMAC_PHY_MODE_NONE_MII 6
|
||||
#define EMAC_PHY_MODE_MII_NONE 7
|
||||
|
||||
/* ZMII Bridge Register addresses */
|
||||
#if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
|
||||
defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
|
||||
defined(CONFIG_460EX) || defined(CONFIG_460GT)
|
||||
#define ZMII0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0D00)
|
||||
#else
|
||||
#define ZMII0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0780)
|
||||
#endif
|
||||
#define ZMII0_FER (ZMII0_BASE)
|
||||
#define ZMII0_SSR (ZMII0_BASE + 4)
|
||||
#define ZMII0_SMIISR (ZMII0_BASE + 8)
|
||||
|
||||
/* ZMII FER Register Bit Definitions */
|
||||
#define ZMII_FER_DIS (0x0)
|
||||
#define ZMII_FER_MDI (0x8)
|
||||
#define ZMII_FER_SMII (0x4)
|
||||
#define ZMII_FER_RMII (0x2)
|
||||
#define ZMII_FER_MII (0x1)
|
||||
|
||||
#define ZMII_FER_RSVD11 (0x00200000)
|
||||
#define ZMII_FER_RSVD10 (0x00100000)
|
||||
#define ZMII_FER_RSVD14_31 (0x0003FFFF)
|
||||
|
||||
#define ZMII_FER_V(__x) (((3 - __x) * 4) + 16)
|
||||
|
||||
|
||||
/* ZMII Speed Selection Register Bit Definitions */
|
||||
#define ZMII0_SSR_SCI (0x4)
|
||||
#define ZMII0_SSR_FSS (0x2)
|
||||
#define ZMII0_SSR_SP (0x1)
|
||||
#define ZMII0_SSR_RSVD16_31 (0x0000FFFF)
|
||||
|
||||
#define ZMII0_SSR_V(__x) (((3 - __x) * 4) + 16)
|
||||
|
||||
|
||||
/* ZMII SMII Status Register Bit Definitions */
|
||||
#define ZMII0_SMIISR_E1 (0x80)
|
||||
#define ZMII0_SMIISR_EC (0x40)
|
||||
#define ZMII0_SMIISR_EN (0x20)
|
||||
#define ZMII0_SMIISR_EJ (0x10)
|
||||
#define ZMII0_SMIISR_EL (0x08)
|
||||
#define ZMII0_SMIISR_ED (0x04)
|
||||
#define ZMII0_SMIISR_ES (0x02)
|
||||
#define ZMII0_SMIISR_EF (0x01)
|
||||
|
||||
#define ZMII0_SMIISR_V(__x) ((3 - __x) * 8)
|
||||
|
||||
/* RGMII Register Addresses */
|
||||
#if defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
|
||||
#define RGMII_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x1000)
|
||||
#elif defined(CONFIG_460EX) || defined(CONFIG_460GT)
|
||||
#define RGMII_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x1500)
|
||||
#elif defined(CONFIG_405EX)
|
||||
#define RGMII_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0xB00)
|
||||
#else
|
||||
#define RGMII_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0790)
|
||||
#endif
|
||||
#define RGMII_FER (RGMII_BASE + 0x00)
|
||||
#define RGMII_SSR (RGMII_BASE + 0x04)
|
||||
|
||||
#if defined(CONFIG_460GT)
|
||||
#define RGMII1_BASE_OFFSET 0x100
|
||||
#endif
|
||||
|
||||
/* RGMII Function Enable (FER) Register Bit Definitions */
|
||||
#define RGMII_FER_DIS (0x00)
|
||||
#define RGMII_FER_RTBI (0x04)
|
||||
#define RGMII_FER_RGMII (0x05)
|
||||
#define RGMII_FER_TBI (0x06)
|
||||
#define RGMII_FER_GMII (0x07)
|
||||
#define RGMII_FER_MII (RGMII_FER_GMII)
|
||||
|
||||
#define RGMII_FER_V(__x) ((__x - 2) * 4)
|
||||
|
||||
#define RGMII_FER_MDIO(__x) (1 << (19 - (__x)))
|
||||
|
||||
/* RGMII Speed Selection Register Bit Definitions */
|
||||
#define RGMII_SSR_SP_10MBPS (0x00)
|
||||
#define RGMII_SSR_SP_100MBPS (0x02)
|
||||
#define RGMII_SSR_SP_1000MBPS (0x04)
|
||||
|
||||
#if defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
|
||||
defined(CONFIG_460EX) || defined(CONFIG_460GT) || \
|
||||
defined(CONFIG_405EX)
|
||||
#define RGMII_SSR_V(__x) ((__x) * 8)
|
||||
#else
|
||||
#define RGMII_SSR_V(__x) ((__x -2) * 8)
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------------+
|
||||
| TCP/IP Acceleration Hardware (TAH) 440GX Only
|
||||
+---------------------------------------------------------------------------*/
|
||||
#if defined(CONFIG_440GX)
|
||||
#define TAH_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0B50)
|
||||
#define TAH_REVID (TAH_BASE + 0x0) /* Revision ID (RO)*/
|
||||
#define TAH_MR (TAH_BASE + 0x10) /* Mode Register (R/W) */
|
||||
#define TAH_SSR0 (TAH_BASE + 0x14) /* Segment Size Reg 0 (R/W) */
|
||||
#define TAH_SSR1 (TAH_BASE + 0x18) /* Segment Size Reg 1 (R/W) */
|
||||
#define TAH_SSR2 (TAH_BASE + 0x1C) /* Segment Size Reg 2 (R/W) */
|
||||
#define TAH_SSR3 (TAH_BASE + 0x20) /* Segment Size Reg 3 (R/W) */
|
||||
#define TAH_SSR4 (TAH_BASE + 0x24) /* Segment Size Reg 4 (R/W) */
|
||||
#define TAH_SSR5 (TAH_BASE + 0x28) /* Segment Size Reg 5 (R/W) */
|
||||
#define TAH_TSR (TAH_BASE + 0x2C) /* Transmit Status Register (RO) */
|
||||
|
||||
/* TAH Revision */
|
||||
#define TAH_REV_RN_M (0x000FFF00) /* Revision Number */
|
||||
#define TAH_REV_BN_M (0x000000FF) /* Branch Revision Number */
|
||||
|
||||
#define TAH_REV_RN_V (8)
|
||||
#define TAH_REV_BN_V (0)
|
||||
|
||||
/* TAH Mode Register */
|
||||
#define TAH_MR_CVR (0x80000000) /* Checksum verification on RX */
|
||||
#define TAH_MR_SR (0x40000000) /* Software reset */
|
||||
#define TAH_MR_ST (0x3F000000) /* Send Threshold */
|
||||
#define TAH_MR_TFS (0x00E00000) /* Transmit FIFO size */
|
||||
#define TAH_MR_DTFP (0x00100000) /* Disable TX FIFO parity */
|
||||
#define TAH_MR_DIG (0x00080000) /* Disable interrupt generation */
|
||||
#define TAH_MR_RSVD (0x0007FFFF) /* Reserved */
|
||||
|
||||
#define TAH_MR_ST_V (20)
|
||||
#define TAH_MR_TFS_V (17)
|
||||
|
||||
#define TAH_MR_TFS_2K (0x1) /* Transmit FIFO size 2Kbyte */
|
||||
#define TAH_MR_TFS_4K (0x2) /* Transmit FIFO size 4Kbyte */
|
||||
#define TAH_MR_TFS_6K (0x3) /* Transmit FIFO size 6Kbyte */
|
||||
#define TAH_MR_TFS_8K (0x4) /* Transmit FIFO size 8Kbyte */
|
||||
#define TAH_MR_TFS_10K (0x5) /* Transmit FIFO size 10Kbyte (max)*/
|
||||
|
||||
|
||||
/* TAH Segment Size Registers 0:5 */
|
||||
#define TAH_SSR_RSVD0 (0xC0000000) /* Reserved */
|
||||
#define TAH_SSR_SS (0x3FFE0000) /* Segment size in multiples of 2 */
|
||||
#define TAH_SSR_RSVD1 (0x0001FFFF) /* Reserved */
|
||||
|
||||
/* TAH Transmit Status Register */
|
||||
#define TAH_TSR_TFTS (0x80000000) /* Transmit FIFO too small */
|
||||
#define TAH_TSR_UH (0x40000000) /* Unrecognized header */
|
||||
#define TAH_TSR_NIPF (0x20000000) /* Not IPv4 */
|
||||
#define TAH_TSR_IPOP (0x10000000) /* IP option present */
|
||||
#define TAH_TSR_NISF (0x08000000) /* No IEEE SNAP format */
|
||||
#define TAH_TSR_ILTS (0x04000000) /* IP length too short */
|
||||
#define TAH_TSR_IPFP (0x02000000) /* IP fragment present */
|
||||
#define TAH_TSR_UP (0x01000000) /* Unsupported protocol */
|
||||
#define TAH_TSR_TFP (0x00800000) /* TCP flags present */
|
||||
#define TAH_TSR_SUDP (0x00400000) /* Segmentation for UDP */
|
||||
#define TAH_TSR_DLM (0x00200000) /* Data length mismatch */
|
||||
#define TAH_TSR_SIEEE (0x00100000) /* Segmentation for IEEE */
|
||||
#define TAH_TSR_TFPE (0x00080000) /* Transmit FIFO parity error */
|
||||
#define TAH_TSR_SSTS (0x00040000) /* Segment size too small */
|
||||
#define TAH_TSR_RSVD (0x0003FFFF) /* Reserved */
|
||||
#endif /* CONFIG_440GX */
|
||||
|
||||
|
||||
/* Ethernet MAC Regsiter Addresses */
|
||||
#if defined(CONFIG_440)
|
||||
#if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
|
||||
defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
|
||||
defined(CONFIG_460EX) || defined(CONFIG_460GT)
|
||||
#define EMAC0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0E00)
|
||||
#else
|
||||
#define EMAC0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0800)
|
||||
#endif
|
||||
#else
|
||||
#if defined(CONFIG_405EZ) || defined(CONFIG_405EX)
|
||||
#define EMAC0_BASE 0xEF600900
|
||||
#else
|
||||
#define EMAC0_BASE 0xEF600800
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_440EPX)
|
||||
#define EMAC1_BASE 0xEF600F00
|
||||
#define EMAC1_MR1 (EMAC1_BASE + 0x04)
|
||||
#endif
|
||||
|
||||
#define EMAC0_MR0 (EMAC0_BASE)
|
||||
#define EMAC0_MR1 (EMAC0_BASE + 0x04)
|
||||
#define EMAC0_TMR0 (EMAC0_BASE + 0x08)
|
||||
#define EMAC0_TMR1 (EMAC0_BASE + 0x0c)
|
||||
#define EMAC0_RXM (EMAC0_BASE + 0x10)
|
||||
#define EMAC0_ISR (EMAC0_BASE + 0x14)
|
||||
#define EMAC0_IER (EMAC0_BASE + 0x18)
|
||||
#define EMAC0_IAH (EMAC0_BASE + 0x1c)
|
||||
#define EMAC0_IAL (EMAC0_BASE + 0x20)
|
||||
#define EMAC0_PTR (EMAC0_BASE + 0x2c)
|
||||
#define EMAC0_PAUSE_TIME_REG EMAC0_PTR
|
||||
#define EMAC0_IPGVR (EMAC0_BASE + 0x58)
|
||||
#define EMAC0_I_FRAME_GAP_REG EMAC0_IPGVR
|
||||
#define EMAC0_STACR (EMAC0_BASE + 0x5c)
|
||||
#define EMAC0_TRTR (EMAC0_BASE + 0x60)
|
||||
#define EMAC0_RWMR (EMAC0_BASE + 0x64)
|
||||
#define EMAC0_RX_HI_LO_WMARK EMAC0_RWMR
|
||||
|
||||
/* bit definitions */
|
||||
/* MODE REG 0 */
|
||||
#define EMAC_MR0_RXI (0x80000000)
|
||||
#define EMAC_MR0_TXI (0x40000000)
|
||||
#define EMAC_MR0_SRST (0x20000000)
|
||||
#define EMAC_MR0_TXE (0x10000000)
|
||||
#define EMAC_MR0_RXE (0x08000000)
|
||||
#define EMAC_MR0_WKE (0x04000000)
|
||||
|
||||
/* on 440GX EMAC_MR1 has a different layout! */
|
||||
#if defined(CONFIG_440GX) || \
|
||||
defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
|
||||
defined(CONFIG_440SP) || defined(CONFIG_440SPE) || \
|
||||
defined(CONFIG_460EX) || defined(CONFIG_460GT) || \
|
||||
defined(CONFIG_405EX)
|
||||
/* MODE Reg 1 */
|
||||
#define EMAC_MR1_FDE (0x80000000)
|
||||
#define EMAC_MR1_ILE (0x40000000)
|
||||
#define EMAC_MR1_VLE (0x20000000)
|
||||
#define EMAC_MR1_EIFC (0x10000000)
|
||||
#define EMAC_MR1_APP (0x08000000)
|
||||
#define EMAC_MR1_RSVD (0x06000000)
|
||||
#define EMAC_MR1_IST (0x01000000)
|
||||
#define EMAC_MR1_MF_1000GPCS (0x00C00000)
|
||||
#define EMAC_MR1_MF_1000MBPS (0x00800000) /* 0's for 10MBPS */
|
||||
#define EMAC_MR1_MF_100MBPS (0x00400000)
|
||||
#define EMAC_MR1_RFS_MASK (0x00380000)
|
||||
#define EMAC_MR1_RFS_16K (0x00280000)
|
||||
#define EMAC_MR1_RFS_8K (0x00200000)
|
||||
#define EMAC_MR1_RFS_4K (0x00180000)
|
||||
#define EMAC_MR1_RFS_2K (0x00100000)
|
||||
#define EMAC_MR1_RFS_1K (0x00080000)
|
||||
#define EMAC_MR1_TX_FIFO_MASK (0x00070000)
|
||||
#define EMAC_MR1_TX_FIFO_16K (0x00050000)
|
||||
#define EMAC_MR1_TX_FIFO_8K (0x00040000)
|
||||
#define EMAC_MR1_TX_FIFO_4K (0x00030000)
|
||||
#define EMAC_MR1_TX_FIFO_2K (0x00020000)
|
||||
#define EMAC_MR1_TX_FIFO_1K (0x00010000)
|
||||
#define EMAC_MR1_TR_MULTI (0x00008000) /* 0'x for single packet */
|
||||
#define EMAC_MR1_MWSW (0x00007000)
|
||||
#define EMAC_MR1_JUMBO_ENABLE (0x00000800)
|
||||
#define EMAC_MR1_IPPA (0x000007c0)
|
||||
#define EMAC_MR1_IPPA_SET(id) (((id) & 0x1f) << 6)
|
||||
#define EMAC_MR1_IPPA_GET(id) (((id) >> 6) & 0x1f)
|
||||
#define EMAC_MR1_OBCI_GT100 (0x00000020)
|
||||
#define EMAC_MR1_OBCI_100 (0x00000018)
|
||||
#define EMAC_MR1_OBCI_83 (0x00000010)
|
||||
#define EMAC_MR1_OBCI_66 (0x00000008)
|
||||
#define EMAC_MR1_RSVD1 (0x00000007)
|
||||
#else /* defined(CONFIG_440GX) */
|
||||
/* EMAC_MR1 is the same on 405GP, 405GPr, 405EP, 440GP, 440EP */
|
||||
#define EMAC_MR1_FDE 0x80000000
|
||||
#define EMAC_MR1_ILE 0x40000000
|
||||
#define EMAC_MR1_VLE 0x20000000
|
||||
#define EMAC_MR1_EIFC 0x10000000
|
||||
#define EMAC_MR1_APP 0x08000000
|
||||
#define EMAC_MR1_AEMI 0x02000000
|
||||
#define EMAC_MR1_IST 0x01000000
|
||||
#define EMAC_MR1_MF_1000MBPS 0x00800000 /* 0's for 10MBPS */
|
||||
#define EMAC_MR1_MF_100MBPS 0x00400000
|
||||
#define EMAC_MR1_RFS_MASK 0x00300000
|
||||
#define EMAC_MR1_RFS_4K 0x00300000
|
||||
#define EMAC_MR1_RFS_2K 0x00200000
|
||||
#define EMAC_MR1_RFS_1K 0x00100000
|
||||
#define EMAC_MR1_RFS_512 0x00000000
|
||||
#define EMAC_MR1_TX_FIFO_MASK 0x000c0000
|
||||
#define EMAC_MR1_TX_FIFO_2K 0x00080000
|
||||
#define EMAC_MR1_TX_FIFO_1K 0x00040000
|
||||
#define EMAC_MR1_TX_FIFO_512 0x00000000
|
||||
#define EMAC_MR1_TR0_DEPEND 0x00010000 /* 0'x for single packet */
|
||||
#define EMAC_MR1_TR0_MULTI 0x00008000
|
||||
#define EMAC_MR1_TR1_DEPEND 0x00004000
|
||||
#define EMAC_MR1_TR1_MULTI 0x00002000
|
||||
#if defined(CONFIG_440EP) || defined(CONFIG_440GR)
|
||||
#define EMAC_MR1_JUMBO_ENABLE 0x00001000
|
||||
#endif /* defined(CONFIG_440EP) || defined(CONFIG_440GR) */
|
||||
#endif /* defined(CONFIG_440GX) */
|
||||
|
||||
#define EMAC_MR1_FIFO_MASK (EMAC_MR1_RFS_MASK | EMAC_MR1_TX_FIFO_MASK)
|
||||
#if defined(CONFIG_405EZ)
|
||||
/* 405EZ only supports 512 bytes fifos */
|
||||
#define EMAC_MR1_FIFO_SIZE (EMAC_MR1_RFS_512 | EMAC_MR1_TX_FIFO_512)
|
||||
#else
|
||||
/* Set receive fifo to 4k and tx fifo to 2k */
|
||||
#define EMAC_MR1_FIFO_SIZE (EMAC_MR1_RFS_4K | EMAC_MR1_TX_FIFO_2K)
|
||||
#endif
|
||||
|
||||
/* Transmit Mode Register 0 */
|
||||
#define EMAC_TMR0_GNP0 (0x80000000)
|
||||
#define EMAC_TMR0_GNP1 (0x40000000)
|
||||
#define EMAC_TMR0_GNPD (0x20000000)
|
||||
#define EMAC_TMR0_FC (0x10000000)
|
||||
|
||||
/* Receive Mode Register */
|
||||
#define EMAC_RMR_SP (0x80000000)
|
||||
#define EMAC_RMR_SFCS (0x40000000)
|
||||
#define EMAC_RMR_ARRP (0x20000000)
|
||||
#define EMAC_RMR_ARP (0x10000000)
|
||||
#define EMAC_RMR_AROP (0x08000000)
|
||||
#define EMAC_RMR_ARPI (0x04000000)
|
||||
#define EMAC_RMR_PPP (0x02000000)
|
||||
#define EMAC_RMR_PME (0x01000000)
|
||||
#define EMAC_RMR_PMME (0x00800000)
|
||||
#define EMAC_RMR_IAE (0x00400000)
|
||||
#define EMAC_RMR_MIAE (0x00200000)
|
||||
#define EMAC_RMR_BAE (0x00100000)
|
||||
#define EMAC_RMR_MAE (0x00080000)
|
||||
|
||||
/* Interrupt Status & enable Regs */
|
||||
#define EMAC_ISR_OVR (0x02000000)
|
||||
#define EMAC_ISR_PP (0x01000000)
|
||||
#define EMAC_ISR_BP (0x00800000)
|
||||
#define EMAC_ISR_RP (0x00400000)
|
||||
#define EMAC_ISR_SE (0x00200000)
|
||||
#define EMAC_ISR_SYE (0x00100000)
|
||||
#define EMAC_ISR_BFCS (0x00080000)
|
||||
#define EMAC_ISR_PTLE (0x00040000)
|
||||
#define EMAC_ISR_ORE (0x00020000)
|
||||
#define EMAC_ISR_IRE (0x00010000)
|
||||
#define EMAC_ISR_DBDM (0x00000200)
|
||||
#define EMAC_ISR_DB0 (0x00000100)
|
||||
#define EMAC_ISR_SE0 (0x00000080)
|
||||
#define EMAC_ISR_TE0 (0x00000040)
|
||||
#define EMAC_ISR_DB1 (0x00000020)
|
||||
#define EMAC_ISR_SE1 (0x00000010)
|
||||
#define EMAC_ISR_TE1 (0x00000008)
|
||||
#define EMAC_ISR_MOS (0x00000002)
|
||||
#define EMAC_ISR_MOF (0x00000001)
|
||||
|
||||
/* STA CONTROL REG */
|
||||
#define EMAC_STACR_OC (0x00008000)
|
||||
#define EMAC_STACR_PHYE (0x00004000)
|
||||
|
||||
#ifdef CONFIG_IBM_EMAC4_V4 /* EMAC4 V4 changed bit setting */
|
||||
#define EMAC_STACR_INDIRECT_MODE (0x00002000)
|
||||
#define EMAC_STACR_WRITE (0x00000800) /* $BUC */
|
||||
#define EMAC_STACR_READ (0x00001000) /* $BUC */
|
||||
#define EMAC_STACR_OP_MASK (0x00001800)
|
||||
#define EMAC_STACR_MDIO_ADDR (0x00000000)
|
||||
#define EMAC_STACR_MDIO_WRITE (0x00000800)
|
||||
#define EMAC_STACR_MDIO_READ (0x00001800)
|
||||
#define EMAC_STACR_MDIO_READ_INC (0x00001000)
|
||||
#else
|
||||
#define EMAC_STACR_WRITE (0x00002000)
|
||||
#define EMAC_STACR_READ (0x00001000)
|
||||
#endif
|
||||
|
||||
#define EMAC_STACR_CLK_83MHZ (0x00000800) /* 0's for 50Mhz */
|
||||
#define EMAC_STACR_CLK_66MHZ (0x00000400)
|
||||
#define EMAC_STACR_CLK_100MHZ (0x00000C00)
|
||||
|
||||
/* Transmit Request Threshold Register */
|
||||
#define EMAC_TRTR_256 (0x18000000) /* 0's for 64 Bytes */
|
||||
#define EMAC_TRTR_192 (0x10000000)
|
||||
#define EMAC_TRTR_128 (0x01000000)
|
||||
|
||||
/* the follwing defines are for the MadMAL status and control registers. */
|
||||
/* For bits 0..5 look at the mal.h file */
|
||||
#define EMAC_TX_CTRL_GFCS (0x0200)
|
||||
#define EMAC_TX_CTRL_GP (0x0100)
|
||||
#define EMAC_TX_CTRL_ISA (0x0080)
|
||||
#define EMAC_TX_CTRL_RSA (0x0040)
|
||||
#define EMAC_TX_CTRL_IVT (0x0020)
|
||||
#define EMAC_TX_CTRL_RVT (0x0010)
|
||||
|
||||
#define EMAC_TX_CTRL_DEFAULT (EMAC_TX_CTRL_GFCS |EMAC_TX_CTRL_GP)
|
||||
|
||||
#define EMAC_TX_ST_BFCS (0x0200)
|
||||
#define EMAC_TX_ST_BPP (0x0100)
|
||||
#define EMAC_TX_ST_LCS (0x0080)
|
||||
#define EMAC_TX_ST_ED (0x0040)
|
||||
#define EMAC_TX_ST_EC (0x0020)
|
||||
#define EMAC_TX_ST_LC (0x0010)
|
||||
#define EMAC_TX_ST_MC (0x0008)
|
||||
#define EMAC_TX_ST_SC (0x0004)
|
||||
#define EMAC_TX_ST_UR (0x0002)
|
||||
#define EMAC_TX_ST_SQE (0x0001)
|
||||
|
||||
#define EMAC_TX_ST_DEFAULT (0x03F3)
|
||||
|
||||
|
||||
/* madmal receive status / Control bits */
|
||||
|
||||
#define EMAC_RX_ST_OE (0x0200)
|
||||
#define EMAC_RX_ST_PP (0x0100)
|
||||
#define EMAC_RX_ST_BP (0x0080)
|
||||
#define EMAC_RX_ST_RP (0x0040)
|
||||
#define EMAC_RX_ST_SE (0x0020)
|
||||
#define EMAC_RX_ST_AE (0x0010)
|
||||
#define EMAC_RX_ST_BFCS (0x0008)
|
||||
#define EMAC_RX_ST_PTL (0x0004)
|
||||
#define EMAC_RX_ST_ORE (0x0002)
|
||||
#define EMAC_RX_ST_IRE (0x0001)
|
||||
/* all the errors we care about */
|
||||
#define EMAC_RX_ERRORS (0x03FF)
|
||||
|
||||
#endif /* _PPC4XX_ENET_H_ */
|
|
@ -1,103 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2007-2008
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef __ASM_PPC_GPIO_H
|
||||
#define __ASM_PPC_GPIO_H
|
||||
|
||||
#include <asm/types.h>
|
||||
|
||||
/* 4xx PPC's have 2 GPIO controllers */
|
||||
#if defined(CONFIG_405EZ) || \
|
||||
defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
|
||||
defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
|
||||
defined(CONFIG_460EX) || defined(CONFIG_460GT)
|
||||
#define GPIO_GROUP_MAX 2
|
||||
#else
|
||||
#define GPIO_GROUP_MAX 1
|
||||
#endif
|
||||
|
||||
/* GPIO controller */
|
||||
struct ppc4xx_gpio {
|
||||
u32 or; /* Output Control */
|
||||
u32 tcr; /* Tri-State Control */
|
||||
u32 osl; /* Output Select 16..31 */
|
||||
u32 osh; /* Output Select 0..15 */
|
||||
u32 tsl; /* Tri-State Select 16..31 */
|
||||
u32 tsh; /* Tri-State Select 0..15 */
|
||||
u32 odr; /* Open Drain */
|
||||
u32 ir; /* Input */
|
||||
u32 rr1; /* Receive Register 1 */
|
||||
u32 rr2; /* Receive Register 2 */
|
||||
u32 rr3; /* Receive Register 3 */
|
||||
u32 reserved;
|
||||
u32 is1l; /* Input Select 1 16..31 */
|
||||
u32 is1h; /* Input Select 1 0..15 */
|
||||
u32 is2l; /* Input Select 2 16..31 */
|
||||
u32 is2h; /* Input Select 2 0..15 */
|
||||
u32 is3l; /* Input Select 3 16..31 */
|
||||
u32 is3h; /* Input Select 3 0..15 */
|
||||
};
|
||||
|
||||
/* Offsets */
|
||||
#define GPIOx_OR 0x00 /* GPIO Output Register */
|
||||
#define GPIOx_TCR 0x04 /* GPIO Three-State Control Register */
|
||||
#define GPIOx_OSL 0x08 /* GPIO Output Select Register (Bits 0-31) */
|
||||
#define GPIOx_OSH 0x0C /* GPIO Ouput Select Register (Bits 32-63) */
|
||||
#define GPIOx_TSL 0x10 /* GPIO Three-State Select Register (Bits 0-31) */
|
||||
#define GPIOx_TSH 0x14 /* GPIO Three-State Select Register (Bits 32-63) */
|
||||
#define GPIOx_ODR 0x18 /* GPIO Open drain Register */
|
||||
#define GPIOx_IR 0x1C /* GPIO Input Register */
|
||||
#define GPIOx_RR1 0x20 /* GPIO Receive Register 1 */
|
||||
#define GPIOx_RR2 0x24 /* GPIO Receive Register 2 */
|
||||
#define GPIOx_RR3 0x28 /* GPIO Receive Register 3 */
|
||||
#define GPIOx_IS1L 0x30 /* GPIO Input Select Register 1 (Bits 0-31) */
|
||||
#define GPIOx_IS1H 0x34 /* GPIO Input Select Register 1 (Bits 32-63) */
|
||||
#define GPIOx_IS2L 0x38 /* GPIO Input Select Register 2 (Bits 0-31) */
|
||||
#define GPIOx_IS2H 0x3C /* GPIO Input Select Register 2 (Bits 32-63) */
|
||||
#define GPIOx_IS3L 0x40 /* GPIO Input Select Register 3 (Bits 0-31) */
|
||||
#define GPIOx_IS3H 0x44 /* GPIO Input Select Register 3 (Bits 32-63) */
|
||||
|
||||
#define GPIO_OR(x) (x+GPIOx_OR) /* GPIO Output Register */
|
||||
#define GPIO_TCR(x) (x+GPIOx_TCR) /* GPIO Three-State Control Register */
|
||||
#define GPIO_OS(x) (x+GPIOx_OSL) /* GPIO Output Select Register High or Low */
|
||||
#define GPIO_TS(x) (x+GPIOx_TSL) /* GPIO Three-state Control Reg High or Low */
|
||||
#define GPIO_IS1(x) (x+GPIOx_IS1L) /* GPIO Input register1 High or Low */
|
||||
#define GPIO_IS2(x) (x+GPIOx_IS2L) /* GPIO Input register2 High or Low */
|
||||
#define GPIO_IS3(x) (x+GPIOx_IS3L) /* GPIO Input register3 High or Low */
|
||||
|
||||
#define GPIO0 0
|
||||
#define GPIO1 1
|
||||
|
||||
#define GPIO_MAX 32
|
||||
#define GPIO_ALT1_SEL 0x40000000
|
||||
#define GPIO_ALT2_SEL 0x80000000
|
||||
#define GPIO_ALT3_SEL 0xc0000000
|
||||
#define GPIO_IN_SEL 0x40000000
|
||||
#define GPIO_MASK 0xc0000000
|
||||
|
||||
#define GPIO_VAL(gpio) (0x80000000 >> (gpio))
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
typedef enum gpio_select { GPIO_SEL, GPIO_ALT1, GPIO_ALT2, GPIO_ALT3 } gpio_select_t;
|
||||
typedef enum gpio_driver { GPIO_DIS, GPIO_IN, GPIO_OUT, GPIO_BI } gpio_driver_t;
|
||||
typedef enum gpio_out { GPIO_OUT_0, GPIO_OUT_1, GPIO_OUT_NO_CHG } gpio_out_t;
|
||||
|
||||
typedef struct {
|
||||
unsigned long add; /* gpio core base address */
|
||||
gpio_driver_t in_out; /* Driver Setting */
|
||||
gpio_select_t alt_nb; /* Selected Alternate */
|
||||
gpio_out_t out_val;/* Default Output Value */
|
||||
} gpio_param_s;
|
||||
#endif
|
||||
|
||||
void gpio_config(int pin, int in_out, int gpio_alt, int out_val);
|
||||
void gpio_write_bit(int pin, int val);
|
||||
int gpio_read_out_bit(int pin);
|
||||
int gpio_read_in_bit(int pin);
|
||||
void gpio_set_chip_configuration(void);
|
||||
|
||||
#endif /* __ASM_PPC_GPIO_H */
|
|
@ -1,95 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2007-2009
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef _4xx_i2c_h_
|
||||
#define _4xx_i2c_h_
|
||||
|
||||
#define IIC_OK 0
|
||||
#define IIC_NOK 1
|
||||
#define IIC_NOK_LA 2 /* Lost arbitration */
|
||||
#define IIC_NOK_ICT 3 /* Incomplete transfer */
|
||||
#define IIC_NOK_XFRA 4 /* Transfer aborted */
|
||||
#define IIC_NOK_DATA 5 /* No data in buffer */
|
||||
#define IIC_NOK_TOUT 6 /* Transfer timeout */
|
||||
|
||||
#define IIC_TIMEOUT 1 /* 1 second */
|
||||
|
||||
struct ppc4xx_i2c {
|
||||
u8 mdbuf;
|
||||
u8 res1;
|
||||
u8 sdbuf;
|
||||
u8 res2;
|
||||
u8 lmadr;
|
||||
u8 hmadr;
|
||||
u8 cntl;
|
||||
u8 mdcntl;
|
||||
u8 sts;
|
||||
u8 extsts;
|
||||
u8 lsadr;
|
||||
u8 hsadr;
|
||||
u8 clkdiv;
|
||||
u8 intrmsk;
|
||||
u8 xfrcnt;
|
||||
u8 xtcntlss;
|
||||
u8 directcntl;
|
||||
u8 intr;
|
||||
};
|
||||
|
||||
/* MDCNTL Register Bit definition */
|
||||
#define IIC_MDCNTL_HSCL 0x01
|
||||
#define IIC_MDCNTL_EUBS 0x02
|
||||
#define IIC_MDCNTL_EINT 0x04
|
||||
#define IIC_MDCNTL_ESM 0x08
|
||||
#define IIC_MDCNTL_FSM 0x10
|
||||
#define IIC_MDCNTL_EGC 0x20
|
||||
#define IIC_MDCNTL_FMDB 0x40
|
||||
#define IIC_MDCNTL_FSDB 0x80
|
||||
|
||||
/* CNTL Register Bit definition */
|
||||
#define IIC_CNTL_PT 0x01
|
||||
#define IIC_CNTL_READ 0x02
|
||||
#define IIC_CNTL_CHT 0x04
|
||||
#define IIC_CNTL_RPST 0x08
|
||||
/* bit 2/3 for Transfer count*/
|
||||
#define IIC_CNTL_AMD 0x40
|
||||
#define IIC_CNTL_HMT 0x80
|
||||
|
||||
/* STS Register Bit definition */
|
||||
#define IIC_STS_PT 0x01
|
||||
#define IIC_STS_IRQA 0x02
|
||||
#define IIC_STS_ERR 0x04
|
||||
#define IIC_STS_SCMP 0x08
|
||||
#define IIC_STS_MDBF 0x10
|
||||
#define IIC_STS_MDBS 0x20
|
||||
#define IIC_STS_SLPR 0x40
|
||||
#define IIC_STS_SSS 0x80
|
||||
|
||||
/* EXTSTS Register Bit definition */
|
||||
#define IIC_EXTSTS_XFRA 0x01
|
||||
#define IIC_EXTSTS_ICT 0x02
|
||||
#define IIC_EXTSTS_LA 0x04
|
||||
#define IIC_EXTSTS_BCS_MASK 0x70
|
||||
#define IIC_EXTSTS_BCS_FREE 0x40
|
||||
|
||||
/* XTCNTLSS Register Bit definition */
|
||||
#define IIC_XTCNTLSS_SRST 0x01
|
||||
#define IIC_XTCNTLSS_EPI 0x02
|
||||
#define IIC_XTCNTLSS_SDBF 0x04
|
||||
#define IIC_XTCNTLSS_SBDD 0x08
|
||||
#define IIC_XTCNTLSS_SWS 0x10
|
||||
#define IIC_XTCNTLSS_SWC 0x20
|
||||
#define IIC_XTCNTLSS_SRS 0x40
|
||||
#define IIC_XTCNTLSS_SRC 0x80
|
||||
|
||||
/* IICx_DIRECTCNTL register */
|
||||
#define IIC_DIRCNTL_SDAC 0x08
|
||||
#define IIC_DIRCNTL_SCC 0x04
|
||||
#define IIC_DIRCNTL_MSDA 0x02
|
||||
#define IIC_DIRCNTL_MSC 0x01
|
||||
|
||||
#define DIRCTNL_FREE(v) (((v) & 0x0f) == 0x0f)
|
||||
#endif
|
|
@ -1,62 +0,0 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef _PPC4xx_ISRAM_H_
|
||||
#define _PPC4xx_ISRAM_H_
|
||||
|
||||
/*
|
||||
* Internal SRAM
|
||||
*/
|
||||
#if defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
|
||||
#define ISRAM0_DCR_BASE 0x380
|
||||
#else
|
||||
#define ISRAM0_DCR_BASE 0x020
|
||||
#endif
|
||||
#define ISRAM0_SB0CR (ISRAM0_DCR_BASE+0x00) /* SRAM bank config 0*/
|
||||
#define ISRAM0_SB1CR (ISRAM0_DCR_BASE+0x01) /* SRAM bank config 1*/
|
||||
#define ISRAM0_SB2CR (ISRAM0_DCR_BASE+0x02) /* SRAM bank config 2*/
|
||||
#define ISRAM0_SB3CR (ISRAM0_DCR_BASE+0x03) /* SRAM bank config 3*/
|
||||
#define ISRAM0_BEAR (ISRAM0_DCR_BASE+0x04) /* SRAM bus error addr reg */
|
||||
#define ISRAM0_BESR0 (ISRAM0_DCR_BASE+0x05) /* SRAM bus error status reg 0 */
|
||||
#define ISRAM0_BESR1 (ISRAM0_DCR_BASE+0x06) /* SRAM bus error status reg 1 */
|
||||
#define ISRAM0_PMEG (ISRAM0_DCR_BASE+0x07) /* SRAM power management */
|
||||
#define ISRAM0_CID (ISRAM0_DCR_BASE+0x08) /* SRAM bus core id reg */
|
||||
#define ISRAM0_REVID (ISRAM0_DCR_BASE+0x09) /* SRAM bus revision id reg */
|
||||
#define ISRAM0_DPC (ISRAM0_DCR_BASE+0x0a) /* SRAM data parity check reg */
|
||||
|
||||
#if defined(CONFIG_460EX) || defined(CONFIG_460GT)
|
||||
#define ISRAM1_DCR_BASE 0x0B0
|
||||
#define ISRAM1_SB0CR (ISRAM1_DCR_BASE+0x00) /* SRAM1 bank config 0*/
|
||||
#define ISRAM1_BEAR (ISRAM1_DCR_BASE+0x04) /* SRAM1 bus error addr reg */
|
||||
#define ISRAM1_BESR0 (ISRAM1_DCR_BASE+0x05) /* SRAM1 bus error status reg 0 */
|
||||
#define ISRAM1_BESR1 (ISRAM1_DCR_BASE+0x06) /* SRAM1 bus error status reg 1 */
|
||||
#define ISRAM1_PMEG (ISRAM1_DCR_BASE+0x07) /* SRAM1 power management */
|
||||
#define ISRAM1_CID (ISRAM1_DCR_BASE+0x08) /* SRAM1 bus core id reg */
|
||||
#define ISRAM1_REVID (ISRAM1_DCR_BASE+0x09) /* SRAM1 bus revision id reg */
|
||||
#define ISRAM1_DPC (ISRAM1_DCR_BASE+0x0a) /* SRAM1 data parity check reg */
|
||||
#endif /* CONFIG_460EX || CONFIG_460GT */
|
||||
|
||||
#if defined(CONFIG_460EX) || defined(CONFIG_460GT)
|
||||
#define ISRAM1_SIZE 0x0984 /* OCM size 64k */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* L2 Cache
|
||||
*/
|
||||
#if defined (CONFIG_440GX) || \
|
||||
defined(CONFIG_440SP) || defined(CONFIG_440SPE) || \
|
||||
defined(CONFIG_460EX) || defined(CONFIG_460GT) || \
|
||||
defined(CONFIG_460SX)
|
||||
#define L2_CACHE_BASE 0x030
|
||||
#define L2_CACHE_CFG (L2_CACHE_BASE+0x00) /* L2 Cache Config */
|
||||
#define L2_CACHE_CMD (L2_CACHE_BASE+0x01) /* L2 Cache Command */
|
||||
#define L2_CACHE_ADDR (L2_CACHE_BASE+0x02) /* L2 Cache Address */
|
||||
#define L2_CACHE_DATA (L2_CACHE_BASE+0x03) /* L2 Cache Data */
|
||||
#define L2_CACHE_STAT (L2_CACHE_BASE+0x04) /* L2 Cache Status */
|
||||
#define L2_CACHE_CVER (L2_CACHE_BASE+0x05) /* L2 Cache Revision ID */
|
||||
#define L2_CACHE_SNP0 (L2_CACHE_BASE+0x06) /* L2 Cache Snoop reg 0 */
|
||||
#define L2_CACHE_SNP1 (L2_CACHE_BASE+0x07) /* L2 Cache Snoop reg 1 */
|
||||
#endif /* CONFIG_440GX */
|
||||
|
||||
#endif /* _PPC4xx_ISRAM_H_ */
|
|
@ -1,149 +0,0 @@
|
|||
/* include/mal.h, openbios_walnut, walnut_bios 8/6/99 08:48:40 */
|
||||
/*
|
||||
* SPDX-License-Identifier: GPL-2.0 IBM-pibs
|
||||
*/
|
||||
/*----------------------------------------------------------------------------+
|
||||
|
|
||||
| File Name: mal.h
|
||||
|
|
||||
| Function: Header file for the MAL (MADMAL) macro on the 405GP.
|
||||
|
|
||||
| Author: Mark Wisner
|
||||
|
|
||||
| Change Activity-
|
||||
|
|
||||
| Date Description of Change BY
|
||||
| --------- --------------------- ---
|
||||
| 29-Apr-99 Created MKW
|
||||
|
|
||||
+----------------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------------+
|
||||
| 17-Nov-03 Travis B. Sawyer, Sandburst Corporation, tsawyer@sandburst.com
|
||||
| Added register bit definitions to support multiple channels
|
||||
+----------------------------------------------------------------------------*/
|
||||
#ifndef _mal_h_
|
||||
#define _mal_h_
|
||||
|
||||
#if !defined(MAL_DCR_BASE)
|
||||
#define MAL_DCR_BASE 0x180
|
||||
#endif
|
||||
#define MAL0_CFG (MAL_DCR_BASE + 0x00) /* MAL Config reg */
|
||||
#define MAL0_ESR (MAL_DCR_BASE + 0x01) /* Error Status (Read/Clear) */
|
||||
#define MAL0_IER (MAL_DCR_BASE + 0x02) /* Interrupt enable */
|
||||
#define MAL0_TXCASR (MAL_DCR_BASE + 0x04) /* TX Channel active (set) */
|
||||
#define MAL0_TXCARR (MAL_DCR_BASE + 0x05) /* TX Channel active (reset) */
|
||||
#define MAL0_TXEOBISR (MAL_DCR_BASE + 0x06) /* TX End of buffer int status*/
|
||||
#define MAL0_TXDEIR (MAL_DCR_BASE + 0x07) /* TX Descr. Error Int */
|
||||
#define MAL0_TXBADDR (MAL_DCR_BASE + 0x09) /* TX descriptor base addr*/
|
||||
#define MAL0_RXCASR (MAL_DCR_BASE + 0x10) /* RX Channel active (set) */
|
||||
#define MAL0_RXCARR (MAL_DCR_BASE + 0x11) /* RX Channel active (reset) */
|
||||
#define MAL0_RXEOBISR (MAL_DCR_BASE + 0x12) /* RX End of buffer int status*/
|
||||
#define MAL0_RXDEIR (MAL_DCR_BASE + 0x13) /* RX Descr. Error Int */
|
||||
#define MAL0_RXBADDR (MAL_DCR_BASE + 0x15) /* RX descriptor base addr */
|
||||
#define MAL0_TXCTP0R (MAL_DCR_BASE + 0x20) /* TX 0 Channel table pointer */
|
||||
#define MAL0_TXCTP1R (MAL_DCR_BASE + 0x21) /* TX 1 Channel table pointer */
|
||||
#define MAL0_TXCTP2R (MAL_DCR_BASE + 0x22) /* TX 2 Channel table pointer */
|
||||
#define MAL0_TXCTP3R (MAL_DCR_BASE + 0x23) /* TX 3 Channel table pointer */
|
||||
#define MAL0_RXCTP0R (MAL_DCR_BASE + 0x40) /* RX 0 Channel table pointer */
|
||||
#define MAL0_RXCTP1R (MAL_DCR_BASE + 0x41) /* RX 1 Channel table pointer */
|
||||
#define MAL0_RCBS0 (MAL_DCR_BASE + 0x60) /* RX 0 Channel buffer size */
|
||||
#define MAL0_RCBS1 (MAL_DCR_BASE + 0x61) /* RX 1 Channel buffer size */
|
||||
#if defined(CONFIG_440GX) || \
|
||||
defined(CONFIG_460EX) || defined(CONFIG_460GT)
|
||||
#define MAL0_RXCTP2R (MAL_DCR_BASE + 0x42) /* RX 2 Channel table pointer */
|
||||
#define MAL0_RXCTP3R (MAL_DCR_BASE + 0x43) /* RX 3 Channel table pointer */
|
||||
#define MAL0_RXCTP8R (MAL_DCR_BASE + 0x48) /* RX 8 Channel table pointer */
|
||||
#define MAL0_RXCTP16R (MAL_DCR_BASE + 0x50) /* RX 16 Channel table pointer*/
|
||||
#define MAL0_RXCTP24R (MAL_DCR_BASE + 0x58) /* RX 24 Channel table pointer*/
|
||||
#define MAL0_RCBS2 (MAL_DCR_BASE + 0x62) /* RX 2 Channel buffer size */
|
||||
#define MAL0_RCBS3 (MAL_DCR_BASE + 0x63) /* RX 3 Channel buffer size */
|
||||
#define MAL0_RCBS8 (MAL_DCR_BASE + 0x68) /* RX 8 Channel buffer size */
|
||||
#define MAL0_RCBS16 (MAL_DCR_BASE + 0x70) /* RX 16 Channel buffer size */
|
||||
#define MAL0_RCBS24 (MAL_DCR_BASE + 0x78) /* RX 24 Channel buffer size */
|
||||
#endif /* CONFIG_440GX */
|
||||
|
||||
/* MADMAL transmit and receive status/control bits */
|
||||
/* for COMMAC bits, refer to the COMMAC header file */
|
||||
|
||||
#define MAL_TX_CTRL_READY 0x8000
|
||||
#define MAL_TX_CTRL_WRAP 0x4000
|
||||
#define MAL_TX_CTRL_CM 0x2000
|
||||
#define MAL_TX_CTRL_LAST 0x1000
|
||||
#define MAL_TX_CTRL_INTR 0x0400
|
||||
|
||||
#define MAL_RX_CTRL_EMPTY 0x8000
|
||||
#define MAL_RX_CTRL_WRAP 0x4000
|
||||
#define MAL_RX_CTRL_CM 0x2000
|
||||
#define MAL_RX_CTRL_LAST 0x1000
|
||||
#define MAL_RX_CTRL_FIRST 0x0800
|
||||
#define MAL_RX_CTRL_INTR 0x0400
|
||||
|
||||
/* Configuration Reg */
|
||||
#define MAL_CR_MMSR 0x80000000
|
||||
#define MAL_CR_PLBP_1 0x00400000 /* lowsest is 00 */
|
||||
#define MAL_CR_PLBP_2 0x00800000
|
||||
#define MAL_CR_PLBP_3 0x00C00000 /* highest */
|
||||
#define MAL_CR_GA 0x00200000
|
||||
#define MAL_CR_OA 0x00100000
|
||||
#define MAL_CR_PLBLE 0x00080000
|
||||
#define MAL_CR_PLBLT_1 0x00040000
|
||||
#define MAL_CR_PLBLT_2 0x00020000
|
||||
#define MAL_CR_PLBLT_3 0x00010000
|
||||
#define MAL_CR_PLBLT_4 0x00008000
|
||||
#define MAL_CR_PLBLT_DEFAULT 0x00078000 /* ????? */
|
||||
#define MAL_CR_PLBB 0x00004000
|
||||
#define MAL_CR_OPBBL 0x00000080
|
||||
#define MAL_CR_EOPIE 0x00000004
|
||||
#define MAL_CR_LEA 0x00000002
|
||||
#define MAL_CR_MSD 0x00000001
|
||||
|
||||
/* Error Status Reg */
|
||||
#define MAL_ESR_EVB 0x80000000
|
||||
#define MAL_ESR_CID 0x40000000
|
||||
#define MAL_ESR_DE 0x00100000
|
||||
#define MAL_ESR_ONE 0x00080000
|
||||
#define MAL_ESR_OTE 0x00040000
|
||||
#define MAL_ESR_OSE 0x00020000
|
||||
#define MAL_ESR_PEIN 0x00010000
|
||||
/* same bit position as the IER */
|
||||
/* VV VV */
|
||||
#define MAL_ESR_DEI 0x00000010
|
||||
#define MAL_ESR_ONEI 0x00000008
|
||||
#define MAL_ESR_OTEI 0x00000004
|
||||
#define MAL_ESR_OSEI 0x00000002
|
||||
#define MAL_ESR_PBEI 0x00000001
|
||||
/* ^^ ^^ */
|
||||
/* Mal IER */
|
||||
#if defined(CONFIG_440SPE) || \
|
||||
defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
|
||||
defined(CONFIG_460EX) || defined(CONFIG_460GT) || \
|
||||
defined(CONFIG_405EX)
|
||||
#define MAL_IER_PT 0x00000080
|
||||
#define MAL_IER_PRE 0x00000040
|
||||
#define MAL_IER_PWE 0x00000020
|
||||
#define MAL_IER_DE 0x00000010
|
||||
#define MAL_IER_OTE 0x00000004
|
||||
#define MAL_IER_OE 0x00000002
|
||||
#define MAL_IER_PE 0x00000001
|
||||
#else
|
||||
#define MAL_IER_DE 0x00000010
|
||||
#define MAL_IER_NE 0x00000008
|
||||
#define MAL_IER_TE 0x00000004
|
||||
#define MAL_IER_OPBE 0x00000002
|
||||
#define MAL_IER_PLBE 0x00000001
|
||||
#endif
|
||||
|
||||
/* MAL Channel Active Set and Reset Registers */
|
||||
#define MAL_TXRX_CASR (0x80000000)
|
||||
|
||||
#define MAL_TXRX_CASR_V(__x) (__x) /* Channel 0 shifts 0, channel 1 shifts 1, etc */
|
||||
|
||||
|
||||
/* MAL Buffer Descriptor structure */
|
||||
typedef struct {
|
||||
short ctrl; /* MAL / Commac status control bits */
|
||||
short data_len; /* Max length is 4K-1 (12 bits) */
|
||||
char *data_ptr; /* pointer to actual data buffer */
|
||||
} mal_desc_t;
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load diff
|
@ -1,288 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2002 Scott McNutt <smcnutt@artesyncp.com>
|
||||
*
|
||||
* (C) Copyright 2008-2009
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef _PPC4xx_UIC_H_
|
||||
#define _PPC4xx_UIC_H_
|
||||
|
||||
/*
|
||||
* Define the number of UIC's
|
||||
*/
|
||||
#if defined(CONFIG_440GX) || defined(CONFIG_440SPE) || \
|
||||
defined(CONFIG_460EX) || defined(CONFIG_460GT) || \
|
||||
defined(CONFIG_460SX)
|
||||
#define UIC_MAX 4
|
||||
#elif defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
|
||||
defined(CONFIG_405EX)
|
||||
#define UIC_MAX 3
|
||||
#elif defined(CONFIG_440GP) || defined(CONFIG_440SP) || \
|
||||
defined(CONFIG_440EP) || defined(CONFIG_440GR)
|
||||
#define UIC_MAX 2
|
||||
#else
|
||||
#define UIC_MAX 1
|
||||
#endif
|
||||
|
||||
#define IRQ_MAX (UIC_MAX * 32)
|
||||
|
||||
/*
|
||||
* UIC register
|
||||
*/
|
||||
#define UIC_SR 0x0 /* UIC status */
|
||||
#define UIC_ER 0x2 /* UIC enable */
|
||||
#define UIC_CR 0x3 /* UIC critical */
|
||||
#define UIC_PR 0x4 /* UIC polarity */
|
||||
#define UIC_TR 0x5 /* UIC triggering */
|
||||
#define UIC_MSR 0x6 /* UIC masked status */
|
||||
#define UIC_VR 0x7 /* UIC vector */
|
||||
#define UIC_VCR 0x8 /* UIC vector configuration */
|
||||
|
||||
/*
|
||||
* On 440GX we use the UICB0 as UIC0. Its the root UIC where all other UIC's
|
||||
* are cascaded on. With this trick we can use the common UIC code for 440GX
|
||||
* too.
|
||||
*/
|
||||
#if defined(CONFIG_440GX)
|
||||
#define UIC0_DCR_BASE 0x200
|
||||
#define UIC1_DCR_BASE 0xc0
|
||||
#define UIC2_DCR_BASE 0xd0
|
||||
#define UIC3_DCR_BASE 0x210
|
||||
#else
|
||||
#define UIC0_DCR_BASE 0xc0
|
||||
#define UIC1_DCR_BASE 0xd0
|
||||
#define UIC2_DCR_BASE 0xe0
|
||||
#define UIC3_DCR_BASE 0xf0
|
||||
#endif
|
||||
|
||||
#define UIC0SR (UIC0_DCR_BASE+0x0) /* UIC0 status */
|
||||
#define UIC0ER (UIC0_DCR_BASE+0x2) /* UIC0 enable */
|
||||
#define UIC0CR (UIC0_DCR_BASE+0x3) /* UIC0 critical */
|
||||
#define UIC0PR (UIC0_DCR_BASE+0x4) /* UIC0 polarity */
|
||||
#define UIC0TR (UIC0_DCR_BASE+0x5) /* UIC0 triggering */
|
||||
#define UIC0MSR (UIC0_DCR_BASE+0x6) /* UIC0 masked status */
|
||||
#define UIC0VR (UIC0_DCR_BASE+0x7) /* UIC0 vector */
|
||||
#define UIC0VCR (UIC0_DCR_BASE+0x8) /* UIC0 vector configuration */
|
||||
|
||||
#define UIC1SR (UIC1_DCR_BASE+0x0) /* UIC1 status */
|
||||
#define UIC1ER (UIC1_DCR_BASE+0x2) /* UIC1 enable */
|
||||
#define UIC1CR (UIC1_DCR_BASE+0x3) /* UIC1 critical */
|
||||
#define UIC1PR (UIC1_DCR_BASE+0x4) /* UIC1 polarity */
|
||||
#define UIC1TR (UIC1_DCR_BASE+0x5) /* UIC1 triggering */
|
||||
#define UIC1MSR (UIC1_DCR_BASE+0x6) /* UIC1 masked status */
|
||||
#define UIC1VR (UIC1_DCR_BASE+0x7) /* UIC1 vector */
|
||||
#define UIC1VCR (UIC1_DCR_BASE+0x8) /* UIC1 vector configuration */
|
||||
|
||||
#define UIC2SR (UIC2_DCR_BASE+0x0) /* UIC2 status-Read Clear */
|
||||
#define UIC2ER (UIC2_DCR_BASE+0x2) /* UIC2 enable */
|
||||
#define UIC2CR (UIC2_DCR_BASE+0x3) /* UIC2 critical */
|
||||
#define UIC2PR (UIC2_DCR_BASE+0x4) /* UIC2 polarity */
|
||||
#define UIC2TR (UIC2_DCR_BASE+0x5) /* UIC2 triggering */
|
||||
#define UIC2MSR (UIC2_DCR_BASE+0x6) /* UIC2 masked status */
|
||||
#define UIC2VR (UIC2_DCR_BASE+0x7) /* UIC2 vector */
|
||||
#define UIC2VCR (UIC2_DCR_BASE+0x8) /* UIC2 vector configuration */
|
||||
|
||||
#define UIC3SR (UIC3_DCR_BASE+0x0) /* UIC3 status-Read Clear */
|
||||
#define UIC3ER (UIC3_DCR_BASE+0x2) /* UIC3 enable */
|
||||
#define UIC3CR (UIC3_DCR_BASE+0x3) /* UIC3 critical */
|
||||
#define UIC3PR (UIC3_DCR_BASE+0x4) /* UIC3 polarity */
|
||||
#define UIC3TR (UIC3_DCR_BASE+0x5) /* UIC3 triggering */
|
||||
#define UIC3MSR (UIC3_DCR_BASE+0x6) /* UIC3 masked status */
|
||||
#define UIC3VR (UIC3_DCR_BASE+0x7) /* UIC3 vector */
|
||||
#define UIC3VCR (UIC3_DCR_BASE+0x8) /* UIC3 vector configuration */
|
||||
|
||||
/*
|
||||
* Now the interrupt vector definitions. They are different for most of
|
||||
* the 4xx variants, so we need some more #ifdef's here. No mask
|
||||
* definitions anymore here. For this please use the UIC_MASK macro below.
|
||||
*
|
||||
* Note: Please only define the interrupts really used in U-Boot here.
|
||||
* Those are the cascading and EMAC/MAL related interrupt.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_405EP) || defined(CONFIG_405GP)
|
||||
#define VECNUM_MAL_SERR 10
|
||||
#define VECNUM_MAL_TXEOB 11
|
||||
#define VECNUM_MAL_RXEOB 12
|
||||
#define VECNUM_MAL_TXDE 13
|
||||
#define VECNUM_MAL_RXDE 14
|
||||
#define VECNUM_ETH0 15
|
||||
#define VECNUM_ETH1_OFFS 2
|
||||
#define VECNUM_EIRQ6 29
|
||||
#endif /* defined(CONFIG_405EP) */
|
||||
|
||||
#if defined(CONFIG_405EZ)
|
||||
#define VECNUM_USBDEV 15
|
||||
#define VECNUM_ETH0 16
|
||||
#define VECNUM_MAL_SERR 18
|
||||
#define VECNUM_MAL_TXDE 18
|
||||
#define VECNUM_MAL_RXDE 18
|
||||
#define VECNUM_MAL_TXEOB 19
|
||||
#define VECNUM_MAL_RXEOB 21
|
||||
#endif /* CONFIG_405EX */
|
||||
|
||||
#if defined(CONFIG_405EX)
|
||||
/* UIC 0 */
|
||||
#define VECNUM_MAL_TXEOB 10
|
||||
#define VECNUM_MAL_RXEOB 11
|
||||
#define VECNUM_ETH0 24
|
||||
#define VECNUM_ETH1_OFFS 1
|
||||
#define VECNUM_UIC2NCI 28
|
||||
#define VECNUM_UIC2CI 29
|
||||
#define VECNUM_UIC1NCI 30
|
||||
#define VECNUM_UIC1CI 31
|
||||
|
||||
/* UIC 1 */
|
||||
#define VECNUM_MAL_SERR (32 + 0)
|
||||
#define VECNUM_MAL_TXDE (32 + 1)
|
||||
#define VECNUM_MAL_RXDE (32 + 2)
|
||||
#endif /* CONFIG_405EX */
|
||||
|
||||
#if defined(CONFIG_440GP) || \
|
||||
defined(CONFIG_440EP) || defined(CONFIG_440GR)
|
||||
/* UIC 0 */
|
||||
#define VECNUM_MAL_TXEOB 10
|
||||
#define VECNUM_MAL_RXEOB 11
|
||||
#define VECNUM_UIC1NCI 30
|
||||
#define VECNUM_UIC1CI 31
|
||||
|
||||
/* UIC 1 */
|
||||
#define VECNUM_MAL_SERR (32 + 0)
|
||||
#define VECNUM_MAL_TXDE (32 + 1)
|
||||
#define VECNUM_MAL_RXDE (32 + 2)
|
||||
#define VECNUM_USBDEV (32 + 23)
|
||||
#define VECNUM_ETH0 (32 + 28)
|
||||
#define VECNUM_ETH1_OFFS 2
|
||||
#endif /* CONFIG_440GP */
|
||||
|
||||
#if defined(CONFIG_440GX)
|
||||
/* UICB 0 (440GX only) */
|
||||
/*
|
||||
* All those defines below are off-by-one, so that the common UIC code
|
||||
* can be used. So VECNUM_UIC1CI refers to VECNUM_UIC0CI etc.
|
||||
*/
|
||||
#define VECNUM_UIC1CI 0
|
||||
#define VECNUM_UIC1NCI 1
|
||||
#define VECNUM_UIC2CI 2
|
||||
#define VECNUM_UIC2NCI 3
|
||||
#define VECNUM_UIC3CI 4
|
||||
#define VECNUM_UIC3NCI 5
|
||||
|
||||
/* UIC 0, used as UIC1 on 440GX because of UICB0 */
|
||||
#define VECNUM_MAL_TXEOB (32 + 10)
|
||||
#define VECNUM_MAL_RXEOB (32 + 11)
|
||||
|
||||
/* UIC 1, used as UIC2 on 440GX because of UICB0 */
|
||||
#define VECNUM_MAL_SERR (64 + 0)
|
||||
#define VECNUM_MAL_TXDE (64 + 1)
|
||||
#define VECNUM_MAL_RXDE (64 + 2)
|
||||
#define VECNUM_ETH0 (64 + 28)
|
||||
#define VECNUM_ETH1_OFFS 2
|
||||
#endif /* CONFIG_440GX */
|
||||
|
||||
#if defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
|
||||
/* UIC 0 */
|
||||
#define VECNUM_MAL_TXEOB 10
|
||||
#define VECNUM_MAL_RXEOB 11
|
||||
#define VECNUM_USBDEV 20
|
||||
#define VECNUM_ETH0 24
|
||||
#define VECNUM_ETH1_OFFS 1
|
||||
#define VECNUM_UIC2NCI 28
|
||||
#define VECNUM_UIC2CI 29
|
||||
#define VECNUM_UIC1NCI 30
|
||||
#define VECNUM_UIC1CI 31
|
||||
|
||||
/* UIC 1 */
|
||||
#define VECNUM_MAL_SERR (32 + 0)
|
||||
#define VECNUM_MAL_TXDE (32 + 1)
|
||||
#define VECNUM_MAL_RXDE (32 + 2)
|
||||
|
||||
/* UIC 2 */
|
||||
#define VECNUM_EIRQ2 (64 + 3)
|
||||
#endif /* CONFIG_440EPX */
|
||||
|
||||
#if defined(CONFIG_440SP)
|
||||
/* UIC 0 */
|
||||
#define VECNUM_UIC1NCI 30
|
||||
#define VECNUM_UIC1CI 31
|
||||
|
||||
/* UIC 1 */
|
||||
#define VECNUM_MAL_SERR (32 + 1)
|
||||
#define VECNUM_MAL_TXDE (32 + 2)
|
||||
#define VECNUM_MAL_RXDE (32 + 3)
|
||||
#define VECNUM_MAL_TXEOB (32 + 6)
|
||||
#define VECNUM_MAL_RXEOB (32 + 7)
|
||||
#define VECNUM_ETH0 (32 + 28)
|
||||
#endif /* CONFIG_440SP */
|
||||
|
||||
#if defined(CONFIG_440SPE)
|
||||
/* UIC 0 */
|
||||
#define VECNUM_UIC2NCI 10
|
||||
#define VECNUM_UIC2CI 11
|
||||
#define VECNUM_UIC3NCI 16
|
||||
#define VECNUM_UIC3CI 17
|
||||
#define VECNUM_UIC1NCI 30
|
||||
#define VECNUM_UIC1CI 31
|
||||
|
||||
/* UIC 1 */
|
||||
#define VECNUM_MAL_SERR (32 + 1)
|
||||
#define VECNUM_MAL_TXDE (32 + 2)
|
||||
#define VECNUM_MAL_RXDE (32 + 3)
|
||||
#define VECNUM_MAL_TXEOB (32 + 6)
|
||||
#define VECNUM_MAL_RXEOB (32 + 7)
|
||||
#define VECNUM_ETH0 (32 + 28)
|
||||
#endif /* CONFIG_440SPE */
|
||||
|
||||
#if defined(CONFIG_460EX) || defined(CONFIG_460GT)
|
||||
/* UIC 0 */
|
||||
#define VECNUM_UIC2NCI 10
|
||||
#define VECNUM_UIC2CI 11
|
||||
#define VECNUM_UIC3NCI 16
|
||||
#define VECNUM_UIC3CI 17
|
||||
#define VECNUM_UIC1NCI 30
|
||||
#define VECNUM_UIC1CI 31
|
||||
|
||||
/* UIC 2 */
|
||||
#define VECNUM_MAL_SERR (64 + 3)
|
||||
#define VECNUM_MAL_TXDE (64 + 4)
|
||||
#define VECNUM_MAL_RXDE (64 + 5)
|
||||
#define VECNUM_MAL_TXEOB (64 + 6)
|
||||
#define VECNUM_MAL_RXEOB (64 + 7)
|
||||
#define VECNUM_ETH0 (64 + 16)
|
||||
#define VECNUM_ETH1_OFFS 1
|
||||
#endif /* CONFIG_460EX */
|
||||
|
||||
#if defined(CONFIG_460SX)
|
||||
/* UIC 0 */
|
||||
#define VECNUM_UIC2NCI 10
|
||||
#define VECNUM_UIC2CI 11
|
||||
#define VECNUM_UIC3NCI 16
|
||||
#define VECNUM_UIC3CI 17
|
||||
#define VECNUM_ETH0 19
|
||||
#define VECNUM_ETH1_OFFS 1
|
||||
#define VECNUM_UIC1NCI 30
|
||||
#define VECNUM_UIC1CI 31
|
||||
|
||||
/* UIC 1 */
|
||||
#define VECNUM_MAL_SERR (32 + 1)
|
||||
#define VECNUM_MAL_TXDE (32 + 2)
|
||||
#define VECNUM_MAL_RXDE (32 + 3)
|
||||
#define VECNUM_MAL_TXEOB (32 + 6)
|
||||
#define VECNUM_MAL_RXEOB (32 + 7)
|
||||
#endif /* CONFIG_460EX */
|
||||
|
||||
#if !defined(VECNUM_ETH1_OFFS)
|
||||
#define VECNUM_ETH1_OFFS 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Mask definitions (used for example in 4xx_enet.c)
|
||||
*/
|
||||
#define UIC_MASK(vec) (0x80000000 >> ((vec) & 0x1f))
|
||||
/* UIC_NR won't work for 440GX because of its specific UIC DCR addresses */
|
||||
#define UIC_NR(vec) ((vec) >> 5)
|
||||
|
||||
#endif /* _PPC4xx_UIC_H_ */
|
|
@ -1,304 +0,0 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: GPL-2.0 IBM-pibs
|
||||
*/
|
||||
|
||||
#ifndef __PPC4XX_H__
|
||||
#define __PPC4XX_H__
|
||||
|
||||
/*
|
||||
* Include SoC specific headers
|
||||
*/
|
||||
#if defined(CONFIG_405EP)
|
||||
#include <asm/ppc405ep.h>
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_405EX)
|
||||
#include <asm/ppc405ex.h>
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_405EZ)
|
||||
#include <asm/ppc405ez.h>
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_405GP)
|
||||
#include <asm/ppc405gp.h>
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_440EP) || defined(CONFIG_440GR)
|
||||
#include <asm/ppc440ep_gr.h>
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
|
||||
#include <asm/ppc440epx_grx.h>
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_440GP)
|
||||
#include <asm/ppc440gp.h>
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_440GX)
|
||||
#include <asm/ppc440gx.h>
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_440SP)
|
||||
#include <asm/ppc440sp.h>
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_440SPE)
|
||||
#include <asm/ppc440spe.h>
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_460EX) || defined(CONFIG_460GT)
|
||||
#include <asm/ppc460ex_gt.h>
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_460SX)
|
||||
#include <asm/ppc460sx.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Common registers for all SoC's
|
||||
*/
|
||||
/* DCR registers */
|
||||
#define PLB3A0_ACR 0x0077
|
||||
#define PLB4A0_ACR 0x0081
|
||||
#define PLB4A1_ACR 0x0089
|
||||
|
||||
/* CPR register declarations */
|
||||
|
||||
#define PLB4Ax_ACR_PPM_MASK 0xf0000000
|
||||
#define PLB4Ax_ACR_PPM_FIXED 0x00000000
|
||||
#define PLB4Ax_ACR_PPM_FAIR 0xd0000000
|
||||
#define PLB4Ax_ACR_HBU_MASK 0x08000000
|
||||
#define PLB4Ax_ACR_HBU_DISABLED 0x00000000
|
||||
#define PLB4Ax_ACR_HBU_ENABLED 0x08000000
|
||||
#define PLB4Ax_ACR_RDP_MASK 0x06000000
|
||||
#define PLB4Ax_ACR_RDP_DISABLED 0x00000000
|
||||
#define PLB4Ax_ACR_RDP_2DEEP 0x02000000
|
||||
#define PLB4Ax_ACR_RDP_3DEEP 0x04000000
|
||||
#define PLB4Ax_ACR_RDP_4DEEP 0x06000000
|
||||
#define PLB4Ax_ACR_WRP_MASK 0x01000000
|
||||
#define PLB4Ax_ACR_WRP_DISABLED 0x00000000
|
||||
#define PLB4Ax_ACR_WRP_2DEEP 0x01000000
|
||||
|
||||
/*
|
||||
* External Bus Controller
|
||||
*/
|
||||
/* Values for EBC0_CFGADDR register - indirect addressing of these regs */
|
||||
#define PB0CR 0x00 /* periph bank 0 config reg */
|
||||
#define PB1CR 0x01 /* periph bank 1 config reg */
|
||||
#define PB2CR 0x02 /* periph bank 2 config reg */
|
||||
#define PB3CR 0x03 /* periph bank 3 config reg */
|
||||
#define PB4CR 0x04 /* periph bank 4 config reg */
|
||||
#define PB5CR 0x05 /* periph bank 5 config reg */
|
||||
#define PB6CR 0x06 /* periph bank 6 config reg */
|
||||
#define PB7CR 0x07 /* periph bank 7 config reg */
|
||||
#define PB0AP 0x10 /* periph bank 0 access parameters */
|
||||
#define PB1AP 0x11 /* periph bank 1 access parameters */
|
||||
#define PB2AP 0x12 /* periph bank 2 access parameters */
|
||||
#define PB3AP 0x13 /* periph bank 3 access parameters */
|
||||
#define PB4AP 0x14 /* periph bank 4 access parameters */
|
||||
#define PB5AP 0x15 /* periph bank 5 access parameters */
|
||||
#define PB6AP 0x16 /* periph bank 6 access parameters */
|
||||
#define PB7AP 0x17 /* periph bank 7 access parameters */
|
||||
#define PBEAR 0x20 /* periph bus error addr reg */
|
||||
#define PBESR0 0x21 /* periph bus error status reg 0 */
|
||||
#define PBESR1 0x22 /* periph bus error status reg 1 */
|
||||
#define EBC0_CFG 0x23 /* external bus configuration reg */
|
||||
|
||||
/*
|
||||
* GPIO macro register defines
|
||||
*/
|
||||
/* todo: merge with gpio.h header */
|
||||
#define GPIO_BASE GPIO0_BASE
|
||||
|
||||
#define GPIO0_OR (GPIO0_BASE + 0x0)
|
||||
#define GPIO0_TCR (GPIO0_BASE + 0x4)
|
||||
#define GPIO0_OSRL (GPIO0_BASE + 0x8)
|
||||
#define GPIO0_OSRH (GPIO0_BASE + 0xC)
|
||||
#define GPIO0_TSRL (GPIO0_BASE + 0x10)
|
||||
#define GPIO0_TSRH (GPIO0_BASE + 0x14)
|
||||
#define GPIO0_ODR (GPIO0_BASE + 0x18)
|
||||
#define GPIO0_IR (GPIO0_BASE + 0x1C)
|
||||
#define GPIO0_RR1 (GPIO0_BASE + 0x20)
|
||||
#define GPIO0_RR2 (GPIO0_BASE + 0x24)
|
||||
#define GPIO0_RR3 (GPIO0_BASE + 0x28)
|
||||
#define GPIO0_ISR1L (GPIO0_BASE + 0x30)
|
||||
#define GPIO0_ISR1H (GPIO0_BASE + 0x34)
|
||||
#define GPIO0_ISR2L (GPIO0_BASE + 0x38)
|
||||
#define GPIO0_ISR2H (GPIO0_BASE + 0x3C)
|
||||
#define GPIO0_ISR3L (GPIO0_BASE + 0x40)
|
||||
#define GPIO0_ISR3H (GPIO0_BASE + 0x44)
|
||||
|
||||
#define GPIO1_OR (GPIO1_BASE + 0x0)
|
||||
#define GPIO1_TCR (GPIO1_BASE + 0x4)
|
||||
#define GPIO1_OSRL (GPIO1_BASE + 0x8)
|
||||
#define GPIO1_OSRH (GPIO1_BASE + 0xC)
|
||||
#define GPIO1_TSRL (GPIO1_BASE + 0x10)
|
||||
#define GPIO1_TSRH (GPIO1_BASE + 0x14)
|
||||
#define GPIO1_ODR (GPIO1_BASE + 0x18)
|
||||
#define GPIO1_IR (GPIO1_BASE + 0x1C)
|
||||
#define GPIO1_RR1 (GPIO1_BASE + 0x20)
|
||||
#define GPIO1_RR2 (GPIO1_BASE + 0x24)
|
||||
#define GPIO1_RR3 (GPIO1_BASE + 0x28)
|
||||
#define GPIO1_ISR1L (GPIO1_BASE + 0x30)
|
||||
#define GPIO1_ISR1H (GPIO1_BASE + 0x34)
|
||||
#define GPIO1_ISR2L (GPIO1_BASE + 0x38)
|
||||
#define GPIO1_ISR2H (GPIO1_BASE + 0x3C)
|
||||
#define GPIO1_ISR3L (GPIO1_BASE + 0x40)
|
||||
#define GPIO1_ISR3H (GPIO1_BASE + 0x44)
|
||||
|
||||
/* General Purpose Timer (GPT) Register Offsets */
|
||||
#define GPT0_TBC 0x00000000
|
||||
#define GPT0_IM 0x00000018
|
||||
#define GPT0_ISS 0x0000001C
|
||||
#define GPT0_ISC 0x00000020
|
||||
#define GPT0_IE 0x00000024
|
||||
#define GPT0_COMP0 0x00000080
|
||||
#define GPT0_COMP1 0x00000084
|
||||
#define GPT0_COMP2 0x00000088
|
||||
#define GPT0_COMP3 0x0000008C
|
||||
#define GPT0_COMP4 0x00000090
|
||||
#define GPT0_COMP5 0x00000094
|
||||
#define GPT0_COMP6 0x00000098
|
||||
#define GPT0_MASK0 0x000000C0
|
||||
#define GPT0_MASK1 0x000000C4
|
||||
#define GPT0_MASK2 0x000000C8
|
||||
#define GPT0_MASK3 0x000000CC
|
||||
#define GPT0_MASK4 0x000000D0
|
||||
#define GPT0_MASK5 0x000000D4
|
||||
#define GPT0_MASK6 0x000000D8
|
||||
#define GPT0_DCT0 0x00000110
|
||||
#define GPT0_DCIS 0x0000011C
|
||||
|
||||
#if defined(CONFIG_440)
|
||||
#include <asm/ppc440.h>
|
||||
#else
|
||||
#include <asm/ppc405.h>
|
||||
#endif
|
||||
|
||||
#include <asm/ppc4xx-sdram.h>
|
||||
#include <asm/ppc4xx-ebc.h>
|
||||
#if !defined(CONFIG_XILINX_440)
|
||||
#include <asm/ppc4xx-uic.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Macro for generating register field mnemonics
|
||||
*/
|
||||
#define PPC_REG_BITS 32
|
||||
#define PPC_REG_VAL(bit, value) ((value) << ((PPC_REG_BITS - 1) - (bit)))
|
||||
|
||||
/*
|
||||
* Elide casts when assembling register mnemonics
|
||||
*/
|
||||
#ifndef __ASSEMBLY__
|
||||
#define static_cast(type, val) (type)(val)
|
||||
#else
|
||||
#define static_cast(type, val) (val)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Common stuff for 4xx (405 and 440)
|
||||
*/
|
||||
|
||||
#define EXC_OFF_SYS_RESET 0x0100 /* System reset */
|
||||
#define _START_OFFSET (EXC_OFF_SYS_RESET + 0x2000)
|
||||
|
||||
#define RESET_VECTOR 0xfffffffc
|
||||
#define CACHELINE_MASK (CONFIG_SYS_CACHELINE_SIZE - 1) /* Address mask for
|
||||
cache line aligned data. */
|
||||
|
||||
#define CPR0_DCR_BASE 0x0C
|
||||
#define CPR0_CFGADDR (CPR0_DCR_BASE + 0x0)
|
||||
#define CPR0_CFGDATA (CPR0_DCR_BASE + 0x1)
|
||||
|
||||
#define SDR_DCR_BASE 0x0E
|
||||
#define SDR0_CFGADDR (SDR_DCR_BASE + 0x0)
|
||||
#define SDR0_CFGDATA (SDR_DCR_BASE + 0x1)
|
||||
|
||||
#define SDRAM_DCR_BASE 0x10
|
||||
#define SDRAM0_CFGADDR (SDRAM_DCR_BASE + 0x0)
|
||||
#define SDRAM0_CFGDATA (SDRAM_DCR_BASE + 0x1)
|
||||
|
||||
#define EBC_DCR_BASE 0x12
|
||||
#define EBC0_CFGADDR (EBC_DCR_BASE + 0x0)
|
||||
#define EBC0_CFGDATA (EBC_DCR_BASE + 0x1)
|
||||
|
||||
/*
|
||||
* Macros for indirect DCR access
|
||||
*/
|
||||
#define mtcpr(reg, d) \
|
||||
do { mtdcr(CPR0_CFGADDR, reg); mtdcr(CPR0_CFGDATA, d); } while (0)
|
||||
#define mfcpr(reg, d) \
|
||||
do { mtdcr(CPR0_CFGADDR, reg); d = mfdcr(CPR0_CFGDATA); } while (0)
|
||||
|
||||
#define mtebc(reg, d) \
|
||||
do { mtdcr(EBC0_CFGADDR, reg); mtdcr(EBC0_CFGDATA, d); } while (0)
|
||||
#define mfebc(reg, d) \
|
||||
do { mtdcr(EBC0_CFGADDR, reg); d = mfdcr(EBC0_CFGDATA); } while (0)
|
||||
|
||||
#define mtsdram(reg, d) \
|
||||
do { mtdcr(SDRAM0_CFGADDR, reg); mtdcr(SDRAM0_CFGDATA, d); } while (0)
|
||||
#define mfsdram(reg, d) \
|
||||
do { mtdcr(SDRAM0_CFGADDR, reg); d = mfdcr(SDRAM0_CFGDATA); } while (0)
|
||||
|
||||
#define mtsdr(reg, d) \
|
||||
do { mtdcr(SDR0_CFGADDR, reg); mtdcr(SDR0_CFGDATA, d); } while (0)
|
||||
#define mfsdr(reg, d) \
|
||||
do { mtdcr(SDR0_CFGADDR, reg); d = mfdcr(SDR0_CFGDATA); } while (0)
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned long freqDDR;
|
||||
unsigned long freqEBC;
|
||||
unsigned long freqOPB;
|
||||
unsigned long freqPCI;
|
||||
unsigned long freqPLB;
|
||||
unsigned long freqTmrClk;
|
||||
unsigned long freqUART;
|
||||
unsigned long freqProcessor;
|
||||
unsigned long freqVCOHz;
|
||||
unsigned long freqVCOMhz; /* in MHz */
|
||||
unsigned long pciClkSync; /* PCI clock is synchronous */
|
||||
unsigned long pciIntArbEn; /* Internal PCI arbiter is enabled */
|
||||
unsigned long pllExtBusDiv;
|
||||
unsigned long pllFbkDiv;
|
||||
unsigned long pllFwdDiv;
|
||||
unsigned long pllFwdDivA;
|
||||
unsigned long pllFwdDivB;
|
||||
unsigned long pllOpbDiv;
|
||||
unsigned long pllPciDiv;
|
||||
unsigned long pllPlbDiv;
|
||||
} PPC4xx_SYS_INFO;
|
||||
|
||||
static inline u32 get_mcsr(void)
|
||||
{
|
||||
u32 val;
|
||||
|
||||
asm volatile("mfspr %0, 0x23c" : "=r" (val) :);
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline void set_mcsr(u32 val)
|
||||
{
|
||||
asm volatile("mtspr 0x23c, %0" : "=r" (val) :);
|
||||
}
|
||||
|
||||
int ppc4xx_pci_sync_clock_config(u32 async);
|
||||
|
||||
unsigned long get_OPB_freq(void);
|
||||
unsigned long get_PCI_freq(void);
|
||||
|
||||
typedef PPC4xx_SYS_INFO sys_info_t;
|
||||
int ppc440spe_revB(void);
|
||||
void get_sys_info(sys_info_t *);
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
/* for multi-cpu support */
|
||||
#define NA_OR_UNKNOWN_CPU -1
|
||||
|
||||
#endif /* __PPC4XX_H__ */
|
|
@ -1,25 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2008-2009
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* (C) Copyright 2009
|
||||
* Dirk Eibach, Guntermann & Drunck GmbH, eibach@gdsys.de
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef __PPC4xx_CONFIG_H
|
||||
#define __PPC4xx_CONFIG_H
|
||||
|
||||
#include <common.h>
|
||||
|
||||
struct ppc4xx_config {
|
||||
char label[16];
|
||||
char description[64];
|
||||
u8 val[CONFIG_4xx_CONFIG_BLOCKSIZE];
|
||||
};
|
||||
|
||||
extern struct ppc4xx_config ppc4xx_config_val[];
|
||||
extern int ppc4xx_config_count;
|
||||
|
||||
#endif /* __PPC4xx_CONFIG_H */
|
|
@ -89,11 +89,6 @@
|
|||
|
||||
/* Special Purpose Registers (SPRNs)*/
|
||||
|
||||
/* PPC440 Architecture is BOOK-E */
|
||||
#ifdef CONFIG_440
|
||||
#define CONFIG_BOOKE
|
||||
#endif
|
||||
|
||||
#define SPRN_CCR0 0x3B3 /* Core Configuration Register 0 */
|
||||
#ifdef CONFIG_BOOKE
|
||||
#define SPRN_CCR1 0x378 /* Core Configuration Register for 440 only */
|
||||
|
@ -570,12 +565,7 @@
|
|||
#define SPRN_MCAR 0x23d /* Machine Check Address register */
|
||||
#define MCSR_MCS 0x80000000 /* Machine Check Summary */
|
||||
#define MCSR_IB 0x40000000 /* Instruction PLB Error */
|
||||
#if defined(CONFIG_440)
|
||||
#define MCSR_DRB 0x20000000 /* Data Read PLB Error */
|
||||
#define MCSR_DWB 0x10000000 /* Data Write PLB Error */
|
||||
#else
|
||||
#define MCSR_DB 0x20000000 /* Data PLB Error */
|
||||
#endif /* defined(CONFIG_440) */
|
||||
#define MCSR_TLBP 0x08000000 /* TLB Parity Error */
|
||||
#define MCSR_ICP 0x04000000 /* I-Cache Parity Error */
|
||||
#define MCSR_DCSP 0x02000000 /* D-Cache Search Parity Error */
|
||||
|
@ -764,7 +754,7 @@
|
|||
#define MAS7 SPRN_MAS7
|
||||
#define MAS8 SPRN_MAS8
|
||||
|
||||
#if defined(CONFIG_4xx) || defined(CONFIG_44x) || defined(CONFIG_MPC85xx)
|
||||
#if defined(CONFIG_MPC85xx)
|
||||
#define DAR_DEAR DEAR
|
||||
#else
|
||||
#define DAR_DEAR DAR
|
||||
|
@ -1369,7 +1359,7 @@ int prt_8260_clks(void);
|
|||
#endif
|
||||
#endif /* CONFIG_MACH_SPECIFIC */
|
||||
|
||||
#if defined(CONFIG_MPC85xx) || defined(CONFIG_440)
|
||||
#if defined(CONFIG_MPC85xx)
|
||||
#define EPAPR_MAGIC (0x45504150)
|
||||
#else
|
||||
#define EPAPR_MAGIC (0x65504150)
|
||||
|
|
|
@ -17,7 +17,6 @@ MINIMAL=y
|
|||
endif
|
||||
endif
|
||||
|
||||
obj-$(CONFIG_SYS_EXTBDINFO) += setup.o
|
||||
ifdef MINIMAL
|
||||
obj-y += cache.o time.o
|
||||
obj-y += ticks.o
|
||||
|
|
|
@ -65,7 +65,7 @@ ppcSync:
|
|||
* flush_dcache_range(unsigned long start, unsigned long stop)
|
||||
*/
|
||||
_GLOBAL(flush_dcache_range)
|
||||
#if defined(CONFIG_4xx) || defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
|
||||
#if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
|
||||
li r5,L1_CACHE_BYTES-1
|
||||
andc r3,r3,r5
|
||||
subf r4,r3,r4
|
||||
|
@ -89,7 +89,7 @@ _GLOBAL(flush_dcache_range)
|
|||
* invalidate_dcache_range(unsigned long start, unsigned long stop)
|
||||
*/
|
||||
_GLOBAL(invalidate_dcache_range)
|
||||
#if defined(CONFIG_4xx) || defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
|
||||
#if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
|
||||
li r5,L1_CACHE_BYTES-1
|
||||
andc r3,r3,r5
|
||||
subf r4,r3,r4
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2017 Google, Inc
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <version.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
int setup_board_extra(void)
|
||||
{
|
||||
bd_t *bd = gd->bd;
|
||||
|
||||
strncpy((char *)bd->bi_s_version, "1.2", sizeof(bd->bi_s_version));
|
||||
strncpy((char *)bd->bi_r_version, U_BOOT_VERSION,
|
||||
sizeof(bd->bi_r_version));
|
||||
|
||||
bd->bi_procfreq = gd->cpu_clk; /* Processor Speed, In Hz */
|
||||
bd->bi_plb_busfreq = gd->bus_clk;
|
||||
#if defined(CONFIG_405GP) || defined(CONFIG_405EP) || \
|
||||
defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
|
||||
defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
|
||||
bd->bi_pci_busfreq = get_PCI_freq();
|
||||
bd->bi_opbfreq = get_OPB_freq();
|
||||
#elif defined(CONFIG_XILINX_405)
|
||||
bd->bi_pci_busfreq = get_PCI_freq();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
if TARGET_ACADIA
|
||||
|
||||
config SYS_BOARD
|
||||
default "acadia"
|
||||
|
||||
config SYS_VENDOR
|
||||
default "amcc"
|
||||
|
||||
config SYS_CONFIG_NAME
|
||||
default "acadia"
|
||||
|
||||
endif
|
|
@ -1,6 +0,0 @@
|
|||
ACADIA BOARD
|
||||
M: Stefan Roese <sr@denx.de>
|
||||
S: Maintained
|
||||
F: board/amcc/acadia/
|
||||
F: include/configs/acadia.h
|
||||
F: configs/acadia_defconfig
|
|
@ -1,8 +0,0 @@
|
|||
#
|
||||
# (C) Copyright 2007
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
obj-y = acadia.o cmd_acadia.o memory.o pll.o
|
|
@ -1,101 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2007
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/processor.h>
|
||||
|
||||
extern void board_pll_init_f(void);
|
||||
|
||||
static void acadia_gpio_init(void)
|
||||
{
|
||||
/*
|
||||
* GPIO0 setup (select GPIO or alternate function)
|
||||
*/
|
||||
out32(GPIO0_OSRL, CONFIG_SYS_GPIO0_OSRL);
|
||||
out32(GPIO0_OSRH, CONFIG_SYS_GPIO0_OSRH); /* output select */
|
||||
out32(GPIO0_ISR1L, CONFIG_SYS_GPIO0_ISR1L);
|
||||
out32(GPIO0_ISR1H, CONFIG_SYS_GPIO0_ISR1H); /* input select */
|
||||
out32(GPIO0_TSRL, CONFIG_SYS_GPIO0_TSRL);
|
||||
out32(GPIO0_TSRH, CONFIG_SYS_GPIO0_TSRH); /* three-state select */
|
||||
out32(GPIO0_TCR, CONFIG_SYS_GPIO0_TCR); /* enable output driver for outputs */
|
||||
|
||||
/*
|
||||
* Ultra (405EZ) was nice enough to add another GPIO controller
|
||||
*/
|
||||
out32(GPIO1_OSRH, CONFIG_SYS_GPIO1_OSRH); /* output select */
|
||||
out32(GPIO1_OSRL, CONFIG_SYS_GPIO1_OSRL);
|
||||
out32(GPIO1_ISR1H, CONFIG_SYS_GPIO1_ISR1H); /* input select */
|
||||
out32(GPIO1_ISR1L, CONFIG_SYS_GPIO1_ISR1L);
|
||||
out32(GPIO1_TSRH, CONFIG_SYS_GPIO1_TSRH); /* three-state select */
|
||||
out32(GPIO1_TSRL, CONFIG_SYS_GPIO1_TSRL);
|
||||
out32(GPIO1_TCR, CONFIG_SYS_GPIO1_TCR); /* enable output driver for outputs */
|
||||
}
|
||||
|
||||
int board_early_init_f(void)
|
||||
{
|
||||
unsigned int reg;
|
||||
|
||||
/* don't reinit PLL when booting via I2C bootstrap option */
|
||||
mfsdr(SDR0_PINSTP, reg);
|
||||
if (reg != 0xf0000000)
|
||||
board_pll_init_f();
|
||||
|
||||
acadia_gpio_init();
|
||||
|
||||
/* Configure 405EZ for NAND usage */
|
||||
mtsdr(SDR0_NAND0, SDR_NAND0_NDEN | SDR_NAND0_NDAREN | SDR_NAND0_NDRBEN);
|
||||
mfsdr(SDR0_ULTRA0, reg);
|
||||
reg &= ~SDR_ULTRA0_CSN_MASK;
|
||||
reg |= (SDR_ULTRA0_CSNSEL0 >> CONFIG_SYS_NAND_CS) |
|
||||
SDR_ULTRA0_NDGPIOBP |
|
||||
SDR_ULTRA0_EBCRDYEN |
|
||||
SDR_ULTRA0_NFSRSTEN;
|
||||
mtsdr(SDR0_ULTRA0, reg);
|
||||
|
||||
/* USB Host core needs this bit set */
|
||||
mfsdr(SDR0_ULTRA1, reg);
|
||||
mtsdr(SDR0_ULTRA1, reg | SDR_ULTRA1_LEDNENABLE);
|
||||
|
||||
mtdcr(UIC0SR, 0xFFFFFFFF); /* clear all ints */
|
||||
mtdcr(UIC0ER, 0x00000000); /* disable all ints */
|
||||
mtdcr(UIC0CR, 0x00000010);
|
||||
mtdcr(UIC0PR, 0xFE7FFFF0); /* set int polarities */
|
||||
mtdcr(UIC0TR, 0x00000010); /* set int trigger levels */
|
||||
mtdcr(UIC0SR, 0xFFFFFFFF); /* clear all ints */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int misc_init_f(void)
|
||||
{
|
||||
/* Set EPLD to take PHY out of reset */
|
||||
out8(CONFIG_SYS_CPLD_BASE + 0x05, 0x00);
|
||||
udelay(100000);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check Board Identity:
|
||||
*/
|
||||
int checkboard(void)
|
||||
{
|
||||
char buf[64];
|
||||
int i = getenv_f("serial#", buf, sizeof(buf));
|
||||
u8 rev;
|
||||
|
||||
rev = in8(CONFIG_SYS_CPLD_BASE + 0);
|
||||
printf("Board: Acadia - AMCC PPC405EZ Evaluation Board, Rev. %X", rev);
|
||||
|
||||
if (i > 0) {
|
||||
puts(", serial# ");
|
||||
puts(buf);
|
||||
}
|
||||
putc('\n');
|
||||
|
||||
return (0);
|
||||
}
|
|
@ -1,82 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2007
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <i2c.h>
|
||||
|
||||
static u8 boot_267_nor[] = {
|
||||
0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8e, 0x00,
|
||||
0x14, 0xc0, 0x36, 0xcc, 0x00, 0x0c, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
static u8 boot_267_nand[] = {
|
||||
0xd0, 0x38, 0xc3, 0x50, 0x13, 0x88, 0x8e, 0x00,
|
||||
0x14, 0xc0, 0x36, 0xcc, 0x00, 0x0c, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
static int do_bootstrap(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
{
|
||||
u8 chip;
|
||||
u8 *buf;
|
||||
int cpu_freq;
|
||||
|
||||
if (argc < 3)
|
||||
return cmd_usage(cmdtp);
|
||||
|
||||
cpu_freq = simple_strtol(argv[1], NULL, 10);
|
||||
if (cpu_freq != 267) {
|
||||
printf("Unsupported cpu-frequency - only 267 supported\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* use 0x50 as I2C EEPROM address for now */
|
||||
chip = 0x50;
|
||||
|
||||
if ((strcmp(argv[2], "nor") != 0) &&
|
||||
(strcmp(argv[2], "nand") != 0)) {
|
||||
printf("Unsupported boot-device - only nor|nand support\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (strcmp(argv[2], "nand") == 0) {
|
||||
switch (cpu_freq) {
|
||||
case 267:
|
||||
buf = boot_267_nand;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch (cpu_freq) {
|
||||
case 267:
|
||||
buf = boot_267_nor;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i2c_write(chip, 0, 1, buf, 16) != 0)
|
||||
printf("Error writing to EEPROM at address 0x%x\n", chip);
|
||||
udelay(CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS * 1000);
|
||||
if (i2c_write(chip, 0x10, 1, buf+16, 4) != 0)
|
||||
printf("Error2 writing to EEPROM at address 0x%x\n", chip);
|
||||
|
||||
printf("Done\n");
|
||||
printf("Please power-cycle the board for the changes to take effect\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
bootstrap, 3, 0, do_bootstrap,
|
||||
"program the I2C bootstrap EEPROM",
|
||||
"<cpu-freq> <nor|nand> - program the I2C bootstrap EEPROM"
|
||||
);
|
|
@ -1,14 +0,0 @@
|
|||
#
|
||||
# (C) Copyright 2007-2010
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
#
|
||||
# AMCC 405EZ Reference Platform (Acadia) board
|
||||
#
|
||||
|
||||
ifeq ($(debug),1)
|
||||
PLATFORM_CPPFLAGS += -DDEBUG
|
||||
endif
|
|
@ -1,85 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2007
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
/* define DEBUG for debugging output (obviously ;-)) */
|
||||
#if 0
|
||||
#define DEBUG
|
||||
#endif
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/ppc4xx-gpio.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
extern void board_pll_init_f(void);
|
||||
|
||||
static void cram_bcr_write(u32 wr_val)
|
||||
{
|
||||
wr_val <<= 2;
|
||||
|
||||
/* set CRAM_CRE to 1 */
|
||||
gpio_write_bit(CONFIG_SYS_GPIO_CRAM_CRE, 1);
|
||||
|
||||
/* Write BCR to CRAM on CS1 */
|
||||
out32(wr_val + 0x00200000, 0);
|
||||
debug("CRAM VAL: %08x for CS1 ", wr_val + 0x00200000);
|
||||
|
||||
/* Write BCR to CRAM on CS2 */
|
||||
out32(wr_val + 0x02200000, 0);
|
||||
debug("CRAM VAL: %08x for CS2\n", wr_val + 0x02200000);
|
||||
|
||||
sync();
|
||||
eieio();
|
||||
|
||||
/* set CRAM_CRE back to 0 (normal operation) */
|
||||
gpio_write_bit(CONFIG_SYS_GPIO_CRAM_CRE, 0);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
int dram_init(void)
|
||||
{
|
||||
int i;
|
||||
u32 val;
|
||||
|
||||
/* 1. EBC need to program READY, CLK, ADV for ASync mode */
|
||||
gpio_config(CONFIG_SYS_GPIO_CRAM_CLK, GPIO_OUT, GPIO_SEL, GPIO_OUT_0);
|
||||
gpio_config(CONFIG_SYS_GPIO_CRAM_ADV, GPIO_OUT, GPIO_SEL, GPIO_OUT_0);
|
||||
gpio_config(CONFIG_SYS_GPIO_CRAM_CRE, GPIO_OUT, GPIO_SEL, GPIO_OUT_0);
|
||||
gpio_config(CONFIG_SYS_GPIO_CRAM_WAIT, GPIO_IN, GPIO_SEL, GPIO_OUT_NO_CHG);
|
||||
|
||||
/* 2. EBC in Async mode */
|
||||
mtebc(PB1AP, 0x078F1EC0);
|
||||
mtebc(PB2AP, 0x078F1EC0);
|
||||
mtebc(PB1CR, 0x000BC000);
|
||||
mtebc(PB2CR, 0x020BC000);
|
||||
|
||||
/* 3. Set CRAM in Sync mode */
|
||||
cram_bcr_write(0x7012); /* CRAM burst setting */
|
||||
|
||||
/* 4. EBC in Sync mode */
|
||||
mtebc(PB1AP, 0x9C0201C0);
|
||||
mtebc(PB2AP, 0x9C0201C0);
|
||||
|
||||
/* Set GPIO pins back to alternate function */
|
||||
gpio_config(CONFIG_SYS_GPIO_CRAM_CLK, GPIO_OUT, GPIO_ALT1, GPIO_OUT_NO_CHG);
|
||||
gpio_config(CONFIG_SYS_GPIO_CRAM_ADV, GPIO_OUT, GPIO_ALT1, GPIO_OUT_NO_CHG);
|
||||
|
||||
/* Config EBC to use RDY */
|
||||
mfsdr(SDR0_ULTRA0, val);
|
||||
mtsdr(SDR0_ULTRA0, val | SDR_ULTRA0_EBCRDYEN);
|
||||
|
||||
/* Wait a short while, since for NAND booting this is too fast */
|
||||
for (i=0; i<200000; i++)
|
||||
;
|
||||
|
||||
gd->ram_size = CONFIG_SYS_MBYTES_RAM << 20;
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,137 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2007
|
||||
* Stefan Roese, DENX Software Engineering, sr@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/ppc405.h>
|
||||
|
||||
/* test-only: move into cpu directory!!! */
|
||||
|
||||
#if defined(PLLMR0_200_133_66)
|
||||
void board_pll_init_f(void)
|
||||
{
|
||||
/*
|
||||
* set PLL clocks based on input sysclk is 33M
|
||||
*
|
||||
* ----------------------------------
|
||||
* | CLK | FREQ (MHz) | DIV RATIO |
|
||||
* ----------------------------------
|
||||
* | CPU | 200.0 | 4 (0x02)|
|
||||
* | PLB | 133.3 | 6 (0x06)|
|
||||
* | OPB | 66.6 | 12 (0x0C)|
|
||||
* | EBC | 66.6 | 12 (0x0C)|
|
||||
* | SPI | 66.6 | 12 (0x0C)|
|
||||
* | UART0 | 10.0 | 40 (0x28)|
|
||||
* | UART1 | 10.0 | 40 (0x28)|
|
||||
* | DAC | 2.0 | 200 (0xC8)|
|
||||
* | ADC | 2.0 | 200 (0xC8)|
|
||||
* | PWM | 100.0 | 4 (0x04)|
|
||||
* | EMAC | 25.0 | 16 (0x10)|
|
||||
* -----------------------------------
|
||||
*/
|
||||
|
||||
/* Initialize PLL */
|
||||
mtcpr(CPR0_PLLC, 0x0000033c);
|
||||
mtcpr(CPR0_PLLD, 0x0c010200);
|
||||
mtcpr(CPR0_PRIMAD, 0x04060c0c);
|
||||
mtcpr(CPR0_PERD0, 0x000c0000); /* SPI clk div. eq. OPB clk div. */
|
||||
mtcpr(CPR0_CLKUPD, 0x40000000);
|
||||
}
|
||||
|
||||
#elif defined(PLLMR0_266_160_80)
|
||||
|
||||
void board_pll_init_f(void)
|
||||
{
|
||||
/*
|
||||
* set PLL clocks based on input sysclk is 33M
|
||||
*
|
||||
* ----------------------------------
|
||||
* | CLK | FREQ (MHz) | DIV RATIO |
|
||||
* ----------------------------------
|
||||
* | CPU | 266.64 | 3 |
|
||||
* | PLB | 159.98 | 5 (0x05)|
|
||||
* | OPB | 79.99 | 10 (0x0A)|
|
||||
* | EBC | 79.99 | 10 (0x0A)|
|
||||
* | SPI | 79.99 | 10 (0x0A)|
|
||||
* | UART0 | 28.57 | 7 (0x07)|
|
||||
* | UART1 | 28.57 | 7 (0x07)|
|
||||
* | DAC | 28.57 | 7 (0xA7)|
|
||||
* | ADC | 4 | 50 (0x32)|
|
||||
* | PWM | 28.57 | 7 (0x07)|
|
||||
* | EMAC | 4 | 50 (0x32)|
|
||||
* -----------------------------------
|
||||
*/
|
||||
|
||||
/* Initialize PLL */
|
||||
mtcpr(CPR0_PLLC, 0x20000238);
|
||||
mtcpr(CPR0_PLLD, 0x03010400);
|
||||
mtcpr(CPR0_PRIMAD, 0x03050a0a);
|
||||
mtcpr(CPR0_PERC0, 0x00000000);
|
||||
mtcpr(CPR0_PERD0, 0x070a0707); /* SPI clk div. eq. OPB clk div. */
|
||||
mtcpr(CPR0_PERD1, 0x07323200);
|
||||
mtcpr(CPR0_CLKUP, 0x40000000);
|
||||
}
|
||||
|
||||
#elif defined(PLLMR0_333_166_83)
|
||||
|
||||
void board_pll_init_f(void)
|
||||
{
|
||||
/*
|
||||
* set PLL clocks based on input sysclk is 33M
|
||||
*
|
||||
* ----------------------------------
|
||||
* | CLK | FREQ (MHz) | DIV RATIO |
|
||||
* ----------------------------------
|
||||
* | CPU | 333.33 | 2 |
|
||||
* | PLB | 166.66 | 4 (0x04)|
|
||||
* | OPB | 83.33 | 8 (0x08)|
|
||||
* | EBC | 83.33 | 8 (0x08)|
|
||||
* | SPI | 83.33 | 8 (0x08)|
|
||||
* | UART0 | 16.66 | 5 (0x05)|
|
||||
* | UART1 | 16.66 | 5 (0x05)|
|
||||
* | DAC | ???? | 166 (0xA6)|
|
||||
* | ADC | ???? | 166 (0xA6)|
|
||||
* | PWM | 41.66 | 3 (0x03)|
|
||||
* | EMAC | ???? | 3 (0x03)|
|
||||
* -----------------------------------
|
||||
*/
|
||||
|
||||
/* Initialize PLL */
|
||||
mtcpr(CPR0_PLLC, 0x0000033C);
|
||||
mtcpr(CPR0_PLLD, 0x0a010000);
|
||||
mtcpr(CPR0_PRIMAD, 0x02040808);
|
||||
mtcpr(CPR0_PERD0, 0x02080505); /* SPI clk div. eq. OPB clk div. */
|
||||
mtcpr(CPR0_PERD1, 0xA6A60300);
|
||||
mtcpr(CPR0_CLKUP, 0x40000000);
|
||||
}
|
||||
|
||||
#elif defined(PLLMR0_100_100_12)
|
||||
|
||||
void board_pll_init_f(void)
|
||||
{
|
||||
/*
|
||||
* set PLL clocks based on input sysclk is 33M
|
||||
*
|
||||
* ----------------------
|
||||
* | CLK | FREQ (MHz) |
|
||||
* ----------------------
|
||||
* | CPU | 100.00 |
|
||||
* | PLB | 100.00 |
|
||||
* | OPB | 12.00 |
|
||||
* | EBC | 49.00 |
|
||||
* ----------------------
|
||||
*/
|
||||
|
||||
/* Initialize PLL */
|
||||
mtcpr(CPR0_PLLC, 0x000003BC);
|
||||
mtcpr(CPR0_PLLD, 0x06060600);
|
||||
mtcpr(CPR0_PRIMAD, 0x02020004);
|
||||
mtcpr(CPR0_PERD0, 0x04002828); /* SPI clk div. eq. OPB clk div. */
|
||||
mtcpr(CPR0_PERD1, 0xC8C81600);
|
||||
mtcpr(CPR0_CLKUP, 0x40000000);
|
||||
}
|
||||
#endif /* CPU_<speed>_405EZ */
|
|
@ -1,12 +0,0 @@
|
|||
if TARGET_BAMBOO
|
||||
|
||||
config SYS_BOARD
|
||||
default "bamboo"
|
||||
|
||||
config SYS_VENDOR
|
||||
default "amcc"
|
||||
|
||||
config SYS_CONFIG_NAME
|
||||
default "bamboo"
|
||||
|
||||
endif
|
|
@ -1,6 +0,0 @@
|
|||
BAMBOO BOARD
|
||||
M: Stefan Roese <sr@denx.de>
|
||||
S: Maintained
|
||||
F: board/amcc/bamboo/
|
||||
F: include/configs/bamboo.h
|
||||
F: configs/bamboo_defconfig
|
|
@ -1,9 +0,0 @@
|
|||
#
|
||||
# (C) Copyright 2002-2007
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
obj-y = bamboo.o flash.o
|
||||
extra-y += init.o
|
|
@ -1,77 +0,0 @@
|
|||
The 2 important dipswitches are configured as shown below:
|
||||
|
||||
SW1 (for 33MHz SysClk)
|
||||
----------------------
|
||||
S1 S2 S3 S4 S5 S6 S7 S8
|
||||
OFF OFF OFF OFF OFF OFF OFF ON
|
||||
|
||||
SW7 (for Op-Code Flash and Boot Option H)
|
||||
-----------------------------------------
|
||||
S1 S2 S3 S4 S5 S6 S7 S8
|
||||
OFF OFF OFF ON OFF OFF OFF OFF
|
||||
|
||||
The EEPROM at location 0x52 is loaded with these 16 bytes:
|
||||
C47042A6 05D7A190 40082350 0d050000
|
||||
|
||||
SDR0_SDSTP0[ENG]: 1 : PLL's VCO is the source for PLL forward divisors
|
||||
SDR0_SDSTP0[SRC]: 1 : Feedback originates from PLLOUTB
|
||||
SDR0_SDSTP0[SEL]: 0 : Feedback selection is PLL output
|
||||
SDR0_SDSTP0[TUNE]: 1000111000 : 10 <= M <= 22, 600MHz < VCO <= 900MHz
|
||||
SDR0_SDSTP0[FBDV]: 4 : PLL feedback divisor
|
||||
SDR0_SDSTP0[FBDVA]: 2 : PLL forward divisor A
|
||||
SDR0_SDSTP0[FBDVB]: 5 : PLL forward divisor B
|
||||
SDR0_SDSTP0[PRBDV0]: 1 : PLL primary divisor B
|
||||
SDR0_SDSTP0[OPBDV0]: 2 : OPB clock divisor
|
||||
SDR0_SDSTP0[LFBDV]: 1 : PLL local feedback divisor
|
||||
SDR0_SDSTP0[PERDV0]: 3 : Peripheral clock divisor 0
|
||||
SDR0_SDSTP0[MALDV0]: 2 : MAL clock divisor 0
|
||||
SDR0_SDSTP0[PCIDV0]: 2 : Sync PCI clock divisor 0
|
||||
SDR0_SDSTP0[PLLTIMER]: 7 : PLL locking timer
|
||||
SDR0_SDSTP0[RW]: 1 : EBC ROM width: 16-bit
|
||||
SDR0_SDSTP0[RL]: 0 : EBC ROM location: EBC
|
||||
SDR0_SDSTP0[PAE]: 0 : PCI internal arbiter: disabled
|
||||
SDR0_SDSTP0[PHCE]: 0 : PCI host configuration: disabled
|
||||
SDR0_SDSTP0[ZM]: 3 : ZMII mode: RMII mode 100
|
||||
SDR0_SDSTP0[CTE]: 0 : CPU trace: disabled
|
||||
SDR0_SDSTP0[Nto1]: 0 : CPU/PLB ratio N/P: not N to 1
|
||||
SDR0_SDSTP0[PAME]: 1 : PCI asynchronous mode: enabled
|
||||
SDR0_SDSTP0[MEM]: 1 : Multiplex: EMAC
|
||||
SDR0_SDSTP0[NE]: 0 : NDFC: disabled
|
||||
SDR0_SDSTP0[NBW]: 0 : NDFC boot width: 8-bit
|
||||
SDR0_SDSTP0[NBW]: 0 : NDFC boot page selection
|
||||
SDR0_SDSTP0[NBAC]: 0 : NDFC boot address selection cycle: 3 Addr. Cycles, 1 Col. + 2 Row (512 page size)
|
||||
SDR0_SDSTP0[NARE]: 0 : NDFC auto read : disabled
|
||||
SDR0_SDSTP0[NRB]: 0 : NDFC Ready/Busy : Ready
|
||||
SDR0_SDSTP0[NDRSC]: 33333 : NDFC device reset counter
|
||||
SDR0_SDSTP0[NCG0]: 0 : NDFC/EBC chip select gating CS0 : EBC
|
||||
SDR0_SDSTP0[NCG1]: 0 : NDFC/EBC chip select gating CS1 : EBC
|
||||
SDR0_SDSTP0[NCG2]: 0 : NDFC/EBC chip select gating CS2 : EBC
|
||||
SDR0_SDSTP0[NCG3]: 0 : NDFC/EBC chip select gating CS3 : EBC
|
||||
SDR0_SDSTP0[NCRDC]: 3333 : NDFC device read count
|
||||
|
||||
PPC440EP Clocking Configuration
|
||||
|
||||
SysClk is 33.0MHz, M is 20, VCO is 660.0MHz, CPU is 330.0MHz, PLB is 132.0MHz
|
||||
OPB is 66.0MHz, EBC is 44.0MHz, MAL is 66.0MHz, Sync PCI is 66.0MHz
|
||||
|
||||
The above information is reported by Eugene O'Brien
|
||||
<Eugene.O'Brien@advantechamt.com>. Thanks a lot.
|
||||
|
||||
2007-08-06, Stefan Roese <sr@denx.de>
|
||||
---------------------------------------------------------------------
|
||||
|
||||
The configuration for the AMCC 440EP eval board "Bamboo" was changed
|
||||
to only use 384 kbytes of FLASH for the U-Boot image. This way the
|
||||
redundant environment can be saved in the remaining 2 sectors of the
|
||||
same flash chip.
|
||||
|
||||
Caution: With an upgrade from an earlier U-Boot version the current
|
||||
environment will be erased since the environment is now saved in
|
||||
different sectors. By using the following command the environment can
|
||||
be saved after upgrading the U-Boot image and *before* resetting the
|
||||
board:
|
||||
|
||||
setenv recover_env 'prot off FFF80000 FFF9FFFF;era FFF80000 FFF9FFFF;' \
|
||||
'cp.b FFF60000 FFF80000 20000'
|
||||
|
||||
2006-07-27, Stefan Roese <sr@denx.de>
|
File diff suppressed because it is too large
Load diff
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue