Commit d01c08c9 authored by Mark A. Greer's avatar Mark A. Greer Committed by Linus Torvalds

[PATCH] ppc32: mv64x60 updates & enhancements

Updates and enhancement to the ppc32 mv64x60 code:
- move code to get mem size from mem ctlr to bootwrapper
- address some errata in the mv64360 pic code
- some minor cleanups
- export one of the bridge's regs via sysfs so user daemon can watch for
  extraction events
Signed-off-by: default avatarMark A. Greer <mgreer@mvista.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent bbde630b
......@@ -62,7 +62,8 @@ config BOOTX_TEXT
config SERIAL_TEXT_DEBUG
bool "Support for early boot texts over serial port"
depends on 4xx || GT64260 || LOPEC || PPLUS || PRPMC800 || PPC_GEN550 || PPC_MPC52xx
depends on 4xx || LOPEC || MV64X60 || PPLUS || PRPMC800 || \
PPC_GEN550 || PPC_MPC52xx
config PPC_OCP
bool
......
......@@ -19,6 +19,33 @@
extern struct bi_record *decompress_kernel(unsigned long load_addr,
int num_words, unsigned long cksum);
u32 size_reg[MV64x60_CPU2MEM_WINDOWS] = {
MV64x60_CPU2MEM_0_SIZE, MV64x60_CPU2MEM_1_SIZE,
MV64x60_CPU2MEM_2_SIZE, MV64x60_CPU2MEM_3_SIZE
};
/* Read mem ctlr to get the amount of mem in system */
unsigned long
mv64360_get_mem_size(void)
{
u32 enables, i, v;
u32 mem = 0;
enables = in_le32((void __iomem *)CONFIG_MV64X60_NEW_BASE +
MV64360_CPU_BAR_ENABLE) & 0xf;
for (i=0; i<MV64x60_CPU2MEM_WINDOWS; i++)
if (!(enables & (1<<i))) {
v = in_le32((void __iomem *)CONFIG_MV64X60_NEW_BASE
+ size_reg[i]) & 0xffff;
v = (v + 1) << 16;
mem += v;
}
return mem;
}
void
mv64x60_move_base(void __iomem *old_base, void __iomem *new_base)
{
......
......@@ -366,10 +366,16 @@ mv64360_pci_error_int_handler(int irq, void *dev_id, struct pt_regs *regs)
return IRQ_HANDLED;
}
/*
* Bit 0 of MV64x60_PCIx_ERR_MASK does not exist on the 64360 and because of
* errata FEr-#11 and FEr-##16 for the 64460, it should be 0 on that chip as
* well. IOW, don't set bit 0.
*/
#define MV64360_PCI0_ERR_MASK_VAL 0x00a50c24
static int __init
mv64360_register_hdlrs(void)
{
u32 mask;
int rc;
/* Clear old errors and register CPU interface error intr handler */
......@@ -387,17 +393,6 @@ mv64360_register_hdlrs(void)
mv64360_sram_error_int_handler,SA_INTERRUPT,SRAM_INTR_STR, 0)))
printk(KERN_WARNING "Can't register SRAM error handler: %d",rc);
/*
* Bit 0 reserved on 64360 and erratum FEr PCI-#11 (PCI internal
* data parity error set incorrectly) on rev 0 & 1 of 64460 requires
* bit 0 to be cleared.
*/
mask = 0x00a50c24;
if ((mv64x60_get_bridge_type() == MV64x60_TYPE_MV64460) &&
(mv64x60_get_bridge_rev() > 1))
mask |= 0x1; /* enable DPErr on 64460 */
/* Clear old errors and register PCI 0 error intr handler */
mv64x60_write(&bh, MV64x60_PCI0_ERR_CAUSE, 0);
if ((rc = request_irq(MV64360_IRQ_PCI0 + mv64360_irq_base,
......@@ -407,7 +402,11 @@ mv64360_register_hdlrs(void)
rc);
mv64x60_write(&bh, MV64x60_PCI0_ERR_MASK, 0);
mv64x60_write(&bh, MV64x60_PCI0_ERR_MASK, mask);
mv64x60_write(&bh, MV64x60_PCI0_ERR_MASK, MV64360_PCI0_ERR_MASK_VAL);
/* Erratum FEr PCI-#16 says to clear bit 0 of PCI SERRn Mask reg. */
mv64x60_write(&bh, MV64x60_PCI0_ERR_SERR_MASK,
mv64x60_read(&bh, MV64x60_PCI0_ERR_SERR_MASK) & ~0x1UL);
/* Clear old errors and register PCI 1 error intr handler */
mv64x60_write(&bh, MV64x60_PCI1_ERR_CAUSE, 0);
......@@ -418,7 +417,11 @@ mv64360_register_hdlrs(void)
rc);
mv64x60_write(&bh, MV64x60_PCI1_ERR_MASK, 0);
mv64x60_write(&bh, MV64x60_PCI1_ERR_MASK, mask);
mv64x60_write(&bh, MV64x60_PCI1_ERR_MASK, MV64360_PCI0_ERR_MASK_VAL);
/* Erratum FEr PCI-#16 says to clear bit 0 of PCI Intr Mask reg. */
mv64x60_write(&bh, MV64x60_PCI1_ERR_SERR_MASK,
mv64x60_read(&bh, MV64x60_PCI1_ERR_SERR_MASK) & ~0x1UL);
return 0;
}
......
This diff is collapsed.
......@@ -278,6 +278,13 @@ mv64x60_modify(struct mv64x60_handle *bh, u32 offs, u32 data, u32 mask)
#define mv64x60_set_bits(bh, offs, bits) mv64x60_modify(bh, offs, ~0, bits)
#define mv64x60_clr_bits(bh, offs, bits) mv64x60_modify(bh, offs, 0, bits)
#if defined(CONFIG_SYSFS) && !defined(CONFIG_GT64260)
#define MV64XXX_DEV_NAME "mv64xxx"
struct mv64xxx_pdata {
u32 hs_reg_valid;
};
#endif
/* Externally visible function prototypes */
int mv64x60_init(struct mv64x60_handle *bh, struct mv64x60_setup_info *si);
......
......@@ -333,7 +333,7 @@
/*
*****************************************************************************
*
* SRAM Cotnroller Registers
* SRAM Controller Registers
*
*****************************************************************************
*/
......@@ -352,7 +352,7 @@
/*
*****************************************************************************
*
* SDRAM/MEM Cotnroller Registers
* SDRAM/MEM Controller Registers
*
*****************************************************************************
*/
......@@ -375,6 +375,7 @@
/* SDRAM Control Registers */
#define MV64360_D_UNIT_CONTROL_LOW 0x1404
#define MV64360_D_UNIT_CONTROL_HIGH 0x1424
#define MV64460_D_UNIT_MMASK 0x14b0
/* SDRAM Error Report Registers (64360) */
#define MV64360_SDRAM_ERR_DATA_LO 0x1444
......@@ -388,7 +389,7 @@
/*
*****************************************************************************
*
* Device/BOOT Cotnroller Registers
* Device/BOOT Controller Registers
*
*****************************************************************************
*/
......@@ -680,6 +681,8 @@
#define MV64x60_PCI1_SLAVE_P2P_IO_REMAP 0x0dec
#define MV64x60_PCI1_SLAVE_CPU_REMAP 0x0df0
#define MV64360_PCICFG_CPCI_HOTSWAP 0x68
/*
*****************************************************************************
*
......
......@@ -980,7 +980,7 @@
/* I2C Registers */
/****************************************/
#define MV64XXX_I2C_CTLR_NAME "mv64xxx i2c"
#define MV64XXX_I2C_CTLR_NAME "mv64xxx_i2c"
#define MV64XXX_I2C_OFFSET 0xc000
#define MV64XXX_I2C_REG_BLOCK_SIZE 0x0020
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment