diff options
Diffstat (limited to 'arch/m68k/mvme16x/config.c')
| -rw-r--r-- | arch/m68k/mvme16x/config.c | 56 | 
1 files changed, 18 insertions, 38 deletions
diff --git a/arch/m68k/mvme16x/config.c b/arch/m68k/mvme16x/config.c index 080a342458a..a53803cc66c 100644 --- a/arch/m68k/mvme16x/config.c +++ b/arch/m68k/mvme16x/config.c @@ -29,6 +29,8 @@  #include <linux/module.h>  #include <asm/bootinfo.h> +#include <asm/bootinfo-vme.h> +#include <asm/byteorder.h>  #include <asm/pgtable.h>  #include <asm/setup.h>  #include <asm/irq.h> @@ -60,9 +62,10 @@ unsigned short mvme16x_config;  EXPORT_SYMBOL(mvme16x_config); -int mvme16x_parse_bootinfo(const struct bi_record *bi) +int __init mvme16x_parse_bootinfo(const struct bi_record *bi)  { -	if (bi->tag == BI_VME_TYPE || bi->tag == BI_VME_BRDINFO) +	uint16_t tag = be16_to_cpu(bi->tag); +	if (tag == BI_VME_TYPE || tag == BI_VME_BRDINFO)  		return 0;  	else  		return 1; @@ -87,15 +90,15 @@ static void mvme16x_get_model(char *model)      suf[3] = '\0';      suf[0] = suf[1] ? '-' : '\0'; -    sprintf(model, "Motorola MVME%x%s", p->brdno, suf); +    sprintf(model, "Motorola MVME%x%s", be16_to_cpu(p->brdno), suf);  }  static void mvme16x_get_hardware_list(struct seq_file *m)  { -    p_bdid p = &mvme_bdid; +    uint16_t brdno = be16_to_cpu(mvme_bdid.brdno); -    if (p->brdno == 0x0162 || p->brdno == 0x0172) +    if (brdno == 0x0162 || brdno == 0x0172)      {  	unsigned char rev = *(unsigned char *)MVME162_VERSION_REG; @@ -210,7 +213,7 @@ static void __init mvme16x_init_IRQ (void)  #define CySCRH		(0x22)  #define CyTFTC		(0x80) -static void cons_write(struct console *co, const char *str, unsigned count) +void mvme16x_cons_write(struct console *co, const char *str, unsigned count)  {  	volatile unsigned char *base_addr = (u_char *)CD2401_ADDR;  	volatile u_char sink; @@ -265,26 +268,13 @@ static void cons_write(struct console *co, const char *str, unsigned count)  	base_addr[CyIER] = ier;  } -static struct console cons_info = -{ -	.name	= "sercon", -	.write	= cons_write, -	.flags	= CON_PRINTBUFFER | CON_BOOT, -	.index	= -1, -}; - -static void __init mvme16x_early_console(void) -{ -	register_console(&cons_info); - -	printk(KERN_INFO "MVME16x: early console registered\n"); -}  #endif  void __init config_mvme16x(void)  {      p_bdid p = &mvme_bdid;      char id[40]; +    uint16_t brdno = be16_to_cpu(p->brdno);      mach_max_dma_address = 0xffffffff;      mach_sched_init      = mvme16x_sched_init; @@ -306,18 +296,18 @@ void __init config_mvme16x(void)      }      /* Board type is only set by newer versions of vmelilo/tftplilo */      if (vme_brdtype == 0) -	vme_brdtype = p->brdno; +	vme_brdtype = brdno;      mvme16x_get_model(id);      printk ("\nBRD_ID: %s   BUG %x.%x %02x/%02x/%02x\n", id, p->rev>>4,  					p->rev&0xf, p->yr, p->mth, p->day); -    if (p->brdno == 0x0162 || p->brdno == 0x172) +    if (brdno == 0x0162 || brdno == 0x172)      {  	unsigned char rev = *(unsigned char *)MVME162_VERSION_REG;  	mvme16x_config = rev | MVME16x_CONFIG_GOT_SCCA; -	printk ("MVME%x Hardware status:\n", p->brdno); +	printk ("MVME%x Hardware status:\n", brdno);  	printk ("    CPU Type           68%s040\n",  			rev & MVME16x_CONFIG_GOT_FPU ? "" : "LC");  	printk ("    CPU clock          %dMHz\n", @@ -332,27 +322,17 @@ void __init config_mvme16x(void)      else      {  	mvme16x_config = MVME16x_CONFIG_GOT_LP | MVME16x_CONFIG_GOT_CD2401; - -	/* Dont allow any interrupts from the CD2401 until the interrupt */ -	/* handlers are installed					 */ - -	pcc2chip[PccSCCMICR] = 0x10; -	pcc2chip[PccSCCTICR] = 0x10; -	pcc2chip[PccSCCRICR] = 0x10; -#ifdef CONFIG_EARLY_PRINTK -	mvme16x_early_console(); -#endif      }  }  static irqreturn_t mvme16x_abort_int (int irq, void *dev_id)  { -	p_bdid p = &mvme_bdid;  	unsigned long *new = (unsigned long *)vectors;  	unsigned long *old = (unsigned long *)0xffe00000;  	volatile unsigned char uc, *ucp; +	uint16_t brdno = be16_to_cpu(mvme_bdid.brdno); -	if (p->brdno == 0x0162 || p->brdno == 0x172) +	if (brdno == 0x0162 || brdno == 0x172)  	{  		ucp = (volatile unsigned char *)0xfff42043;  		uc = *ucp | 8; @@ -366,7 +346,7 @@ static irqreturn_t mvme16x_abort_int (int irq, void *dev_id)  	*(new+9) = *(old+9);		/* Trace */  	*(new+47) = *(old+47);		/* Trap #15 */ -	if (p->brdno == 0x0162 || p->brdno == 0x172) +	if (brdno == 0x0162 || brdno == 0x172)  		*(new+0x5e) = *(old+0x5e);	/* ABORT switch */  	else  		*(new+0x6e) = *(old+0x6e);	/* ABORT switch */ @@ -381,7 +361,7 @@ static irqreturn_t mvme16x_timer_int (int irq, void *dev_id)  void mvme16x_sched_init (irq_handler_t timer_routine)  { -    p_bdid p = &mvme_bdid; +    uint16_t brdno = be16_to_cpu(mvme_bdid.brdno);      int irq;      tick_handler = timer_routine; @@ -394,7 +374,7 @@ void mvme16x_sched_init (irq_handler_t timer_routine)  				"timer", mvme16x_timer_int))  	panic ("Couldn't register timer int"); -    if (p->brdno == 0x0162 || p->brdno == 0x172) +    if (brdno == 0x0162 || brdno == 0x172)  	irq = MVME162_IRQ_ABORT;      else          irq = MVME167_IRQ_ABORT;  | 
