Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c7834a6 authored by Paul Mundt's avatar Paul Mundt
Browse files

sh: machvec rework.



Some more machvec overhauling and setup code cleanup. Kill off
get_system_type() and platform_setup(), we can do these both
through the machvec. While we're add it, kill off more useless
mach.c's and drop some legacy cruft from setup.c.

Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent bc8fb5d0
Loading
Loading
Loading
Loading
+20 −27
Original line number Diff line number Diff line
@@ -41,31 +41,7 @@
//		Big Sur Init Routines	
/*===========================================================*/

const char *get_system_type(void)
{
	return "Big Sur";
}

/*
 * The Machine Vector
 */
extern void heartbeat_bigsur(void);
extern void init_bigsur_IRQ(void);

struct sh_machine_vector mv_bigsur __initmv = {
	.mv_nr_irqs		= NR_IRQS,     // Defined in <asm/irq.h>

	.mv_isa_port2addr	= bigsur_isa_port2addr,
	.mv_irq_demux       	= bigsur_irq_demux,

	.mv_init_irq		= init_bigsur_IRQ,
#ifdef CONFIG_HEARTBEAT
	.mv_heartbeat		= heartbeat_bigsur,
#endif
};
ALIAS_MV(bigsur)

int __init platform_setup(void)
static void __init bigsur_setup(char **cmdline_p)
{
	/* Mask all 2nd level IRQ's */
	outb(-1,BIGSUR_IMR0);
@@ -89,7 +65,24 @@ int __init platform_setup(void)
	outw(1, BIGSUR_ETHR+0xe);
	/* set the IO port to BIGSUR_ETHER_IOPORT */
	outw(BIGSUR_ETHER_IOPORT<<3, BIGSUR_ETHR+0x2);

	return 0;
}

/*
 * The Machine Vector
 */
extern void heartbeat_bigsur(void);
extern void init_bigsur_IRQ(void);

struct sh_machine_vector mv_bigsur __initmv = {
	.mv_name		= "Big Sur",
	.mv_setup		= bigsur_setup,

	.mv_isa_port2addr	= bigsur_isa_port2addr,
	.mv_irq_demux       	= bigsur_irq_demux,

	.mv_init_irq		= init_bigsur_IRQ,
#ifdef CONFIG_HEARTBEAT
	.mv_heartbeat		= heartbeat_bigsur,
#endif
};
ALIAS_MV(bigsur)
+13 −21
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@
#include <linux/init.h>
#include <linux/irq.h>
#include <linux/device.h>

#include <asm/io.h>
#include <asm/irq.h>
#include <asm/rtc.h>
@@ -37,24 +36,7 @@ extern int systemasic_irq_demux(int);
void *dreamcast_consistent_alloc(struct device *, size_t, dma_addr_t *, gfp_t);
int dreamcast_consistent_free(struct device *, size_t, void *, dma_addr_t);

const char *get_system_type(void)
{
	return "Sega Dreamcast";
}

struct sh_machine_vector mv_dreamcast __initmv = {
	.mv_nr_irqs		= NR_IRQS,

	.mv_irq_demux		= systemasic_irq_demux,

#ifdef CONFIG_PCI
	.mv_consistent_alloc	= dreamcast_consistent_alloc,
	.mv_consistent_free	= dreamcast_consistent_free,
#endif
};
ALIAS_MV(dreamcast)

int __init platform_setup(void)
static void __init dreamcast_setup(char **cmdline_p)
{
	int i;

@@ -76,6 +58,16 @@ int __init platform_setup(void)
	if (gapspci_init() < 0)
		printk(KERN_WARNING "GAPSPCI was not detected.\n");
#endif

	return 0;
}

struct sh_machine_vector mv_dreamcast __initmv = {
	.mv_name		= "Sega Dreamcast",
	.mv_setup		= dreamcast_setup,
	.mv_irq_demux		= systemasic_irq_demux,

#ifdef CONFIG_PCI
	.mv_consistent_alloc	= dreamcast_consistent_alloc,
	.mv_consistent_free	= dreamcast_consistent_free,
#endif
};
ALIAS_MV(dreamcast)
+18 −31
Original line number Diff line number Diff line
@@ -21,22 +21,36 @@
#include <linux/init.h>
#include <linux/irq.h>
#include <linux/types.h>

#include <asm/io.h>
#include <asm/irq.h>
#include <asm/machvec.h>
#include <asm/mach/ec3104.h>

const char *get_system_type(void)
static void __init ec3104_setup(char **cmdline_p)
{
	return "EC3104";
	char str[8];
	int i;

	for (i=0; i<8; i++)
		str[i] = ctrl_readb(EC3104_BASE + i);

	for (i = EC3104_IRQBASE; i < EC3104_IRQBASE + 32; i++)
		irq_desc[i].handler = &ec3104_int;

	printk("initializing EC3104 \"%.8s\" at %08x, IRQ %d, IRQ base %d\n",
	       str, EC3104_BASE, EC3104_IRQ, EC3104_IRQBASE);

	/* mask all interrupts.  this should have been done by the boot
	 * loader for us but we want to be sure ... */
	ctrl_writel(0xffffffff, EC3104_IMR);
}

/*
 * The Machine Vector
 */

struct sh_machine_vector mv_ec3104 __initmv = {
	.mv_name	= "EC3104",
	.mv_setup	= ec3104_setup,
	.mv_nr_irqs	= 96,

	.mv_inb		= ec3104_inb,
@@ -48,31 +62,4 @@ struct sh_machine_vector mv_ec3104 __initmv = {

	.mv_irq_demux	= ec3104_irq_demux,
};

ALIAS_MV(ec3104)

int __init platform_setup(void)
{
	char str[8];
	int i;
	
	if (0)
		return 0;

	for (i=0; i<8; i++)
		str[i] = ctrl_readb(EC3104_BASE + i);

	for (i = EC3104_IRQBASE; i < EC3104_IRQBASE + 32; i++)
		irq_desc[i].chip = &ec3104_int;

	printk("initializing EC3104 \"%.8s\" at %08x, IRQ %d, IRQ base %d\n",
	       str, EC3104_BASE, EC3104_IRQ, EC3104_IRQBASE);


	/* mask all interrupts.  this should have been done by the boot
	 * loader for us but we want to be sure ... */
	ctrl_writel(0xffffffff, EC3104_IMR);
	
	return 0;
}
+1 −3
Original line number Diff line number Diff line
@@ -2,8 +2,6 @@
# Makefile for the HP6xx specific parts of the kernel
#

obj-y	 		:= mach.o setup.o
obj-y	 		:= setup.o
obj-$(CONFIG_PM)	+= pm.o pm_wakeup.o
obj-$(CONFIG_APM)	+= hp6xx_apm.o

+39 −8
Original line number Diff line number Diff line
@@ -19,12 +19,7 @@
#define	SCPCR	0xa4000116
#define SCPDR	0xa4000136

const char *get_system_type(void)
{
	return "HP6xx";
}

int __init platform_setup(void)
static void __init hp6xx_setup(char **cmdline_p)
{
	u8 v8;
	u16 v;
@@ -64,6 +59,42 @@ int __init platform_setup(void)
	v &= ~SCPCR_TS_MASK;
	v |= SCPCR_TS_ENABLE;
	ctrl_outw(v, SCPCR);

	return 0;
}

/*
 * XXX: This is stupid, we should have a generic machine vector for the cchips
 * and just wrap the platform setup code in to this, as it's the only thing
 * that ends up being different.
 */
struct sh_machine_vector mv_hp6xx __initmv = {
	.mv_name = "hp6xx",
	.mv_setup = hp6xx_setup,
	.mv_nr_irqs = HD64461_IRQBASE + HD64461_IRQ_NUM,

	.mv_inb = hd64461_inb,
	.mv_inw = hd64461_inw,
	.mv_inl = hd64461_inl,
	.mv_outb = hd64461_outb,
	.mv_outw = hd64461_outw,
	.mv_outl = hd64461_outl,

	.mv_inb_p = hd64461_inb_p,
	.mv_inw_p = hd64461_inw,
	.mv_inl_p = hd64461_inl,
	.mv_outb_p = hd64461_outb_p,
	.mv_outw_p = hd64461_outw,
	.mv_outl_p = hd64461_outl,

	.mv_insb = hd64461_insb,
	.mv_insw = hd64461_insw,
	.mv_insl = hd64461_insl,
	.mv_outsb = hd64461_outsb,
	.mv_outsw = hd64461_outsw,
	.mv_outsl = hd64461_outsl,

	.mv_readw = hd64461_readw,
	.mv_writew = hd64461_writew,

	.mv_irq_demux = hd64461_irq_demux,
};
ALIAS_MV(hp6xx)
Loading