Commit db3a8f46 authored by Ralf Bächle's avatar Ralf Bächle Committed by Linus Torvalds

[PATCH] mips: TX49 updates

 o Handle big and little endian configurations in PCI code
 o Get rid of superfluous bug checks
 o The usual cleanups of spinlock definitions
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent fa8ae435
...@@ -42,8 +42,8 @@ ...@@ -42,8 +42,8 @@
#include <linux/init.h> #include <linux/init.h>
#include <asm/addrspace.h> #include <asm/addrspace.h>
#include <asm/byteorder.h>
#include <asm/tx4927/tx4927_pci.h> #include <asm/tx4927/tx4927_pci.h>
#include <asm/debug.h>
/* initialize in setup */ /* initialize in setup */
struct resource pci_io_resource = { struct resource pci_io_resource = {
...@@ -107,16 +107,6 @@ static int tx4927_pcibios_read_config(struct pci_bus *bus, unsigned int devfn, i ...@@ -107,16 +107,6 @@ static int tx4927_pcibios_read_config(struct pci_bus *bus, unsigned int devfn, i
dev = PCI_SLOT(devfn); dev = PCI_SLOT(devfn);
func = PCI_FUNC(devfn); func = PCI_FUNC(devfn);
if (size == 2) {
if (where & 1)
return PCIBIOS_BAD_REGISTER_NUMBER;
}
if (size == 4) {
if (where & 3)
return PCIBIOS_BAD_REGISTER_NUMBER;
}
/* check if the bus is top-level */ /* check if the bus is top-level */
if (bus->parent != NULL) { if (bus->parent != NULL) {
busno = bus->number; busno = bus->number;
...@@ -130,11 +120,21 @@ static int tx4927_pcibios_read_config(struct pci_bus *bus, unsigned int devfn, i ...@@ -130,11 +120,21 @@ static int tx4927_pcibios_read_config(struct pci_bus *bus, unsigned int devfn, i
switch (size) { switch (size) {
case 1: case 1:
*val = *(volatile u8 *) ((ulong) & tx4927_pcicptr-> *val = *(volatile u8 *) ((ulong) & tx4927_pcicptr->
g2pcfgdata | (where & 3)); g2pcfgdata |
#ifdef __LITTLE_ENDIAN
(where & 3));
#else
((where & 0x3) ^ 0x3));
#endif
break; break;
case 2: case 2:
*val = *(volatile u16 *) ((ulong) & tx4927_pcicptr-> *val = *(volatile u16 *) ((ulong) & tx4927_pcicptr->
g2pcfgdata | (where & 3)); g2pcfgdata |
#ifdef __LITTLE_ENDIAN
(where & 3));
#else
((where & 0x3) ^ 0x2));
#endif
break; break;
case 4: case 4:
*val = tx4927_pcicptr->g2pcfgdata; *val = tx4927_pcicptr->g2pcfgdata;
...@@ -156,16 +156,6 @@ static int tx4927_pcibios_write_config(struct pci_bus *bus, unsigned int devfn, ...@@ -156,16 +156,6 @@ static int tx4927_pcibios_write_config(struct pci_bus *bus, unsigned int devfn,
dev = PCI_SLOT(devfn); dev = PCI_SLOT(devfn);
func = PCI_FUNC(devfn); func = PCI_FUNC(devfn);
if (size == 1) {
if (where & 1)
return PCIBIOS_BAD_REGISTER_NUMBER;
}
if (size == 4) {
if (where & 3)
return PCIBIOS_BAD_REGISTER_NUMBER;
}
/* check if the bus is top-level */ /* check if the bus is top-level */
if (bus->parent != NULL) { if (bus->parent != NULL) {
busno = bus->number; busno = bus->number;
...@@ -179,12 +169,22 @@ static int tx4927_pcibios_write_config(struct pci_bus *bus, unsigned int devfn, ...@@ -179,12 +169,22 @@ static int tx4927_pcibios_write_config(struct pci_bus *bus, unsigned int devfn,
switch (size) { switch (size) {
case 1: case 1:
*(volatile u8 *) ((ulong) & tx4927_pcicptr-> *(volatile u8 *) ((ulong) & tx4927_pcicptr->
g2pcfgdata | (where & 3)) = val; g2pcfgdata |
#ifdef __LITTLE_ENDIAN
(where & 3)) = val;
#else
((where & 0x3) ^ 0x3)) = val;
#endif
break; break;
case 2: case 2:
*(volatile u16 *) ((ulong) & tx4927_pcicptr-> *(volatile u16 *) ((ulong) & tx4927_pcicptr->
g2pcfgdata | (where & 3)) = val; g2pcfgdata |
#ifdef __LITTLE_ENDIAN
(where & 3)) = val;
#else
((where & 0x3) ^ 0x2)) = val;
#endif
break; break;
case 4: case 4:
tx4927_pcicptr->g2pcfgdata = val; tx4927_pcicptr->g2pcfgdata = val;
......
...@@ -143,8 +143,8 @@ static void tx4927_irq_pic_end(unsigned int irq); ...@@ -143,8 +143,8 @@ static void tx4927_irq_pic_end(unsigned int irq);
* Kernel structs for all pic's * Kernel structs for all pic's
*/ */
static spinlock_t tx4927_cp0_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(tx4927_cp0_lock);
static spinlock_t tx4927_pic_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(tx4927_pic_lock);
#define TX4927_CP0_NAME "TX4927-CP0" #define TX4927_CP0_NAME "TX4927-CP0"
static struct hw_interrupt_type tx4927_irq_cp0_type = { static struct hw_interrupt_type tx4927_irq_cp0_type = {
......
...@@ -248,7 +248,7 @@ static void toshiba_rbtx4927_irq_isa_mask_and_ack(unsigned int irq); ...@@ -248,7 +248,7 @@ static void toshiba_rbtx4927_irq_isa_mask_and_ack(unsigned int irq);
static void toshiba_rbtx4927_irq_isa_end(unsigned int irq); static void toshiba_rbtx4927_irq_isa_end(unsigned int irq);
#endif #endif
static spinlock_t toshiba_rbtx4927_ioc_lock = SPIN_LOCK_UNLOCKED; static DEFINE_SPINLOCK(toshiba_rbtx4927_ioc_lock);
#define TOSHIBA_RBTX4927_IOC_NAME "RBTX4927-IOC" #define TOSHIBA_RBTX4927_IOC_NAME "RBTX4927-IOC"
...@@ -669,7 +669,7 @@ void __init arch_init_irq(void) ...@@ -669,7 +669,7 @@ void __init arch_init_irq(void)
{ {
extern void tx4927_irq_init(void); extern void tx4927_irq_init(void);
cli(); local_irq_disable();
tx4927_irq_init(); tx4927_irq_init();
toshiba_rbtx4927_irq_ioc_init(); toshiba_rbtx4927_irq_ioc_init();
......
...@@ -727,7 +727,7 @@ void toshiba_rbtx4927_restart(char *command) ...@@ -727,7 +727,7 @@ void toshiba_rbtx4927_restart(char *command)
reg_wr08(RBTX4927_SW_RESET_DO, RBTX4927_SW_RESET_DO_SET); reg_wr08(RBTX4927_SW_RESET_DO, RBTX4927_SW_RESET_DO_SET);
/* do something passive while waiting for reset */ /* do something passive while waiting for reset */
cli(); local_irq_disable();
while (1) while (1)
asm_wait(); asm_wait();
...@@ -738,7 +738,7 @@ void toshiba_rbtx4927_restart(char *command) ...@@ -738,7 +738,7 @@ void toshiba_rbtx4927_restart(char *command)
void toshiba_rbtx4927_halt(void) void toshiba_rbtx4927_halt(void)
{ {
printk(KERN_NOTICE "System Halted\n"); printk(KERN_NOTICE "System Halted\n");
cli(); local_irq_disable();
while (1) { while (1) {
asm_wait(); asm_wait();
} }
......
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