Skip to content

Commit

Permalink
MIPS: RB532: Cleanup the headers again
Browse files Browse the repository at this point in the history
This patch cleans up headers and regroups informations to
where they should reside. While moving, try to have a
consistant naming for defines.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Florian Fainelli authored and Ralf Baechle committed Oct 11, 2008
1 parent deeb45a commit 606a083
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 36 deletions.
2 changes: 1 addition & 1 deletion arch/mips/rb532/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#include <asm/mipsregs.h>
#include <asm/system.h>

#include <asm/mach-rc32434/rc32434.h>
#include <asm/mach-rc32434/irq.h>

struct intr_group {
u32 mask; /* mask of valid bits in pending/mask registers */
Expand Down
6 changes: 3 additions & 3 deletions arch/mips/rb532/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@
#include <linux/serial_8250.h>

#include <asm/serial.h>
#include <asm/mach-rc32434/rc32434.h>
#include <asm/mach-rc32434/rb.h>

extern unsigned int idt_cpu_freq;

static struct uart_port rb532_uart = {
.type = PORT_16550A,
.line = 0,
.irq = RC32434_UART0_IRQ,
.irq = UART0_IRQ,
.iotype = UPIO_MEM,
.membase = (char *)KSEG1ADDR(RC32434_UART0_BASE),
.membase = (char *)KSEG1ADDR(REGBASE + UART0BASE),
.regshift = 2
};

Expand Down
4 changes: 2 additions & 2 deletions arch/mips/rb532/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <asm/time.h>
#include <linux/ioport.h>

#include <asm/mach-rc32434/rc32434.h>
#include <asm/mach-rc32434/rb.h>
#include <asm/mach-rc32434/pci.h>

struct pci_reg __iomem *pci_reg;
Expand All @@ -27,7 +27,7 @@ static struct resource pci0_res[] = {
static void rb_machine_restart(char *command)
{
/* just jump to the reset vector */
writel(0x80000001, (void *)KSEG1ADDR(RC32434_REG_BASE + RC32434_RST));
writel(0x80000001, IDT434_REG_BASE + RST);
((void (*)(void)) KSEG1ADDR(0x1FC00000u))();
}

Expand Down
20 changes: 20 additions & 0 deletions include/asm-mips/mach-rc32434/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,26 @@
#define NR_IRQS 256

#include <asm/mach-generic/irq.h>
#include <asm/mach-rc32434/rb.h>

/* Interrupt Controller */
#define IC_GROUP0_PEND (REGBASE + 0x38000)
#define IC_GROUP0_MASK (REGBASE + 0x38008)
#define IC_GROUP_OFFSET 0x0C

#define NUM_INTR_GROUPS 5

/* 16550 UARTs */
#define GROUP0_IRQ_BASE 8 /* GRP2 IRQ numbers start here */
/* GRP3 IRQ numbers start here */
#define GROUP1_IRQ_BASE (GROUP0_IRQ_BASE + 32)
/* GRP4 IRQ numbers start here */
#define GROUP2_IRQ_BASE (GROUP1_IRQ_BASE + 32)
/* GRP5 IRQ numbers start here */
#define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 32)
#define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 32)

#define UART0_IRQ (GROUP3_IRQ_BASE + 0)

#define ETH0_DMA_RX_IRQ (GROUP1_IRQ_BASE + 0)
#define ETH0_DMA_TX_IRQ (GROUP1_IRQ_BASE + 1)
Expand Down
2 changes: 2 additions & 0 deletions include/asm-mips/mach-rc32434/rb.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

#define REGBASE 0x18000000
#define IDT434_REG_BASE ((volatile void *) KSEG1ADDR(REGBASE))
#define UART0BASE 0x58000
#define RST (1 << 15)
#define DEV0BASE 0x010000
#define DEV0MASK 0x010004
#define DEV0C 0x010008
Expand Down
30 changes: 0 additions & 30 deletions include/asm-mips/mach-rc32434/rc32434.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,7 @@
#include <linux/delay.h>
#include <linux/io.h>

#define RC32434_REG_BASE 0x18000000
#define RC32434_RST (1 << 15)

#define IDT_CLOCK_MULT 2
#define MIPS_CPU_TIMER_IRQ 7

/* Interrupt Controller */
#define IC_GROUP0_PEND (RC32434_REG_BASE + 0x38000)
#define IC_GROUP0_MASK (RC32434_REG_BASE + 0x38008)
#define IC_GROUP_OFFSET 0x0C

#define NUM_INTR_GROUPS 5

/* 16550 UARTs */
#define GROUP0_IRQ_BASE 8 /* GRP2 IRQ numbers start here */
/* GRP3 IRQ numbers start here */
#define GROUP1_IRQ_BASE (GROUP0_IRQ_BASE + 32)
/* GRP4 IRQ numbers start here */
#define GROUP2_IRQ_BASE (GROUP1_IRQ_BASE + 32)
/* GRP5 IRQ numbers start here */
#define GROUP3_IRQ_BASE (GROUP2_IRQ_BASE + 32)
#define GROUP4_IRQ_BASE (GROUP3_IRQ_BASE + 32)


#ifdef __MIPSEB__
#define RC32434_UART0_BASE (RC32434_REG_BASE + 0x58003)
#else
#define RC32434_UART0_BASE (RC32434_REG_BASE + 0x58000)
#endif

#define RC32434_UART0_IRQ (GROUP3_IRQ_BASE + 0)

/* cpu pipeline flush */
static inline void rc32434_sync(void)
Expand Down

0 comments on commit 606a083

Please sign in to comment.