Skip to content

Commit

Permalink
[PATCH] ppc32: mv64x60 updates & enhancements
Browse files Browse the repository at this point in the history
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: Mark A. Greer <mgreer@mvista.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Mark A. Greer authored and Linus Torvalds committed Sep 5, 2005
1 parent bbde630 commit d01c08c
Show file tree
Hide file tree
Showing 7 changed files with 212 additions and 113 deletions.
3 changes: 2 additions & 1 deletion arch/ppc/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 27 additions & 0 deletions arch/ppc/boot/simple/misc-mv64x60.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
31 changes: 17 additions & 14 deletions arch/ppc/syslib/mv64360_pic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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,
Expand All @@ -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);
Expand All @@ -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;
}
Expand Down
Loading

0 comments on commit d01c08c

Please sign in to comment.