Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/geert/linux-m68k

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k:
  m68k: use the new byteorder headers
  fbcon: Protect free_irq() by MACH_IS_ATARI check
  fbcon: remove broken mac vbl handler
  m68k: fix trigraph ignored warning in setox.S
  macfb annotations and compiler warning fix
  m68k: mac baboon interrupt enable/disable
  m68k: machw.h cleanup
  m68k: Mac via cleanup and commentry
  m68k: Reinstate mac rtc
  • Loading branch information
torvalds committed Dec 28, 2008
2 parents 0191b62 + aa6eeee commit 541ef5c
Show file tree
Hide file tree
Showing 18 changed files with 105 additions and 206 deletions.
4 changes: 2 additions & 2 deletions arch/m68k/fpsp040/setox.S
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
| depending on their values, the program may run faster or slower --
| but no worse than 10% slower even in the extreme cases.
|
| The program setoxm1 takes approximately ???/??? cycles for input
| The program setoxm1 takes approximately ??? / ??? cycles for input
| argument X, 0.25 <= |X| < 70log2. For |X| < 0.25, it takes
| approximately ???/??? cycles. For the less common arguments,
| approximately ??? / ??? cycles. For the less common arguments,
| depending on their values, the program may run faster or slower --
| but no worse than 10% slower even in the extreme cases.
|
Expand Down
42 changes: 31 additions & 11 deletions arch/m68k/mac/baboon.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@
#include <asm/macints.h>
#include <asm/mac_baboon.h>

/* #define DEBUG_BABOON */
/* #define DEBUG_IRQS */

extern void mac_enable_irq(unsigned int);
extern void mac_disable_irq(unsigned int);

int baboon_present;
static volatile struct baboon *baboon;
static unsigned char baboon_disabled;

#if 0
extern int macide_ack_intr(struct ata_channel *);
Expand Down Expand Up @@ -88,34 +91,51 @@ static irqreturn_t baboon_irq(int irq, void *dev_id)

void __init baboon_register_interrupts(void)
{
request_irq(IRQ_NUBUS_C, baboon_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST,
"baboon", (void *) baboon);
baboon_disabled = 0;
request_irq(IRQ_NUBUS_C, baboon_irq, 0, "baboon", (void *)baboon);
}

void baboon_irq_enable(int irq) {
/*
* The means for masking individual baboon interrupts remains a mystery, so
* enable the umbrella interrupt only when no baboon interrupt is disabled.
*/

void baboon_irq_enable(int irq)
{
int irq_idx = IRQ_IDX(irq);

#ifdef DEBUG_IRQUSE
printk("baboon_irq_enable(%d)\n", irq);
#endif
/* FIXME: figure out how to mask and unmask baboon interrupt sources */
enable_irq(IRQ_NUBUS_C);

baboon_disabled &= ~(1 << irq_idx);
if (!baboon_disabled)
mac_enable_irq(IRQ_NUBUS_C);
}

void baboon_irq_disable(int irq) {
void baboon_irq_disable(int irq)
{
int irq_idx = IRQ_IDX(irq);

#ifdef DEBUG_IRQUSE
printk("baboon_irq_disable(%d)\n", irq);
#endif
disable_irq(IRQ_NUBUS_C);

baboon_disabled |= 1 << irq_idx;
if (baboon_disabled)
mac_disable_irq(IRQ_NUBUS_C);
}

void baboon_irq_clear(int irq) {
int irq_idx = IRQ_IDX(irq);
void baboon_irq_clear(int irq)
{
int irq_idx = IRQ_IDX(irq);

baboon->mb_ifr &= ~(1 << irq_idx);
}

int baboon_irq_pending(int irq)
{
int irq_idx = IRQ_IDX(irq);
int irq_idx = IRQ_IDX(irq);

return baboon->mb_ifr & (1 << irq_idx);
}
3 changes: 0 additions & 3 deletions arch/m68k/mac/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,7 @@ void __init config_mac(void)
mach_init_IRQ = mac_init_IRQ;
mach_get_model = mac_get_model;
mach_gettimeoffset = mac_gettimeoffset;
#warning move to adb/via init
#if 0
mach_hwclk = mac_hwclk;
#endif
mach_set_clock_mmss = mac_set_clock_mmss;
mach_reset = mac_reset;
mach_halt = mac_poweroff;
Expand Down
1 change: 0 additions & 1 deletion arch/m68k/mac/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#define BOOTINFO_COMPAT_1_0
#include <asm/setup.h>
#include <asm/bootinfo.h>
#include <asm/machw.h>
#include <asm/macints.h>

extern unsigned long mac_videobase;
Expand Down
9 changes: 4 additions & 5 deletions arch/m68k/mac/macints.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@
#include <asm/irq.h>
#include <asm/traps.h>
#include <asm/bootinfo.h>
#include <asm/machw.h>
#include <asm/macintosh.h>
#include <asm/mac_via.h>
#include <asm/mac_psc.h>
Expand Down Expand Up @@ -215,8 +214,8 @@ irqreturn_t mac_debug_handler(int, void *);

/* #define DEBUG_MACINTS */

static void mac_enable_irq(unsigned int irq);
static void mac_disable_irq(unsigned int irq);
void mac_enable_irq(unsigned int irq);
void mac_disable_irq(unsigned int irq);

static struct irq_controller mac_irq_controller = {
.name = "mac",
Expand Down Expand Up @@ -275,7 +274,7 @@ void __init mac_init_IRQ(void)
* These routines are just dispatchers to the VIA/OSS/PSC routines.
*/

static void mac_enable_irq(unsigned int irq)
void mac_enable_irq(unsigned int irq)
{
int irq_src = IRQ_SRC(irq);

Expand Down Expand Up @@ -308,7 +307,7 @@ static void mac_enable_irq(unsigned int irq)
}
}

static void mac_disable_irq(unsigned int irq)
void mac_disable_irq(unsigned int irq)
{
int irq_src = IRQ_SRC(irq);

Expand Down
16 changes: 10 additions & 6 deletions arch/m68k/mac/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static void cuda_write_pram(int offset, __u8 data)
#define cuda_write_pram NULL
#endif

#ifdef CONFIG_ADB_PMU68K
#if 0 /* def CONFIG_ADB_PMU68K */
static long pmu_read_time(void)
{
struct adb_request req;
Expand Down Expand Up @@ -148,7 +148,7 @@ static void pmu_write_pram(int offset, __u8 data)
#define pmu_write_pram NULL
#endif

#ifdef CONFIG_ADB_MACIISI
#if 0 /* def CONFIG_ADB_MACIISI */
extern int maciisi_request(struct adb_request *req,
void (*done)(struct adb_request *), int nbytes, ...);

Expand Down Expand Up @@ -717,13 +717,18 @@ int mac_hwclk(int op, struct rtc_time *t)
unmktime(now, 0,
&t->tm_year, &t->tm_mon, &t->tm_mday,
&t->tm_hour, &t->tm_min, &t->tm_sec);
#if 0
printk("mac_hwclk: read %04d-%02d-%-2d %02d:%02d:%02d\n",
t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec);
t->tm_year + 1900, t->tm_mon + 1, t->tm_mday,
t->tm_hour, t->tm_min, t->tm_sec);
#endif
} else { /* write */
#if 0
printk("mac_hwclk: tried to write %04d-%02d-%-2d %02d:%02d:%02d\n",
t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec);
t->tm_year + 1900, t->tm_mon + 1, t->tm_mday,
t->tm_hour, t->tm_min, t->tm_sec);
#endif

#if 0 /* it trashes my rtc */
now = mktime(t->tm_year + 1900, t->tm_mon + 1, t->tm_mday,
t->tm_hour, t->tm_min, t->tm_sec);

Expand All @@ -742,7 +747,6 @@ int mac_hwclk(int op, struct rtc_time *t)
case MAC_ADB_IISI:
maciisi_write_time(now);
}
#endif
}
return 0;
}
Expand Down
1 change: 0 additions & 1 deletion arch/m68k/mac/oss.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <linux/init.h>

#include <asm/bootinfo.h>
#include <asm/machw.h>
#include <asm/macintosh.h>
#include <asm/macints.h>
#include <asm/mac_via.h>
Expand Down
80 changes: 32 additions & 48 deletions arch/m68k/mac/via.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,10 @@
#include <asm/bootinfo.h>
#include <asm/macintosh.h>
#include <asm/macints.h>
#include <asm/machw.h>
#include <asm/mac_via.h>
#include <asm/mac_psc.h>

volatile __u8 *via1, *via2;
#if 0
/* See note in mac_via.h about how this is possibly not useful */
volatile long *via_memory_bogon=(long *)&via_memory_bogon;
#endif
int rbv_present;
int via_alt_mapping;
EXPORT_SYMBOL(via_alt_mapping);
Expand All @@ -66,7 +61,7 @@ static int gIER,gIFR,gBufA,gBufB;
#define MAC_CLOCK_LOW (MAC_CLOCK_TICK&0xFF)
#define MAC_CLOCK_HIGH (MAC_CLOCK_TICK>>8)

/* To disable a NuBus slot on Quadras we make the slot IRQ lines outputs, set
/* To disable a NuBus slot on Quadras we make that slot IRQ line an output set
* high. On RBV we just use the slot interrupt enable register. On Macs with
* genuine VIA chips we must use nubus_disabled to keep track of disabled slot
* interrupts. When any slot IRQ is disabled we mask the (edge triggered) CA1
Expand Down Expand Up @@ -180,7 +175,7 @@ void __init via_init(void)
via1[vT1CH] = 0;
via1[vT2CL] = 0;
via1[vT2CH] = 0;
via1[vACR] &= 0x3F;
via1[vACR] &= ~0xC0; /* setup T1 timer with no PB7 output */
via1[vACR] &= ~0x03; /* disable port A & B latches */

/*
Expand All @@ -203,40 +198,41 @@ void __init via_init(void)

/* Everything below this point is VIA2/RBV only... */

if (oss_present) return;
if (oss_present)
return;

#if 1
/* Some machines support an alternate IRQ mapping that spreads */
/* Ethernet and Sound out to their own autolevel IRQs and moves */
/* VIA1 to level 6. A/UX uses this mapping and we do too. Note */
/* that the IIfx emulates this alternate mapping using the OSS. */

switch(macintosh_config->ident) {
case MAC_MODEL_P475:
case MAC_MODEL_P475F:
case MAC_MODEL_P575:
case MAC_MODEL_Q605:
case MAC_MODEL_Q605_ACC:
case MAC_MODEL_C610:
case MAC_MODEL_Q610:
case MAC_MODEL_Q630:
case MAC_MODEL_C650:
case MAC_MODEL_Q650:
case MAC_MODEL_Q700:
case MAC_MODEL_Q800:
case MAC_MODEL_Q900:
case MAC_MODEL_Q950:
via_alt_mapping = 0;
if (macintosh_config->via_type == MAC_VIA_QUADRA)
switch (macintosh_config->ident) {
case MAC_MODEL_C660:
case MAC_MODEL_Q840:
/* not applicable */
break;
case MAC_MODEL_P588:
case MAC_MODEL_TV:
case MAC_MODEL_PB140:
case MAC_MODEL_PB145:
case MAC_MODEL_PB160:
case MAC_MODEL_PB165:
case MAC_MODEL_PB165C:
case MAC_MODEL_PB170:
case MAC_MODEL_PB180:
case MAC_MODEL_PB180C:
case MAC_MODEL_PB190:
case MAC_MODEL_PB520:
/* not yet tested */
break;
default:
via_alt_mapping = 1;
via1[vDirB] |= 0x40;
via1[vBufB] &= ~0x40;
break;
default:
via_alt_mapping = 0;
break;
}
#else
via_alt_mapping = 0;
#endif
}

/*
* Now initialize VIA2. For RBV we just kill all interrupts;
Expand All @@ -252,14 +248,17 @@ void __init via_init(void)
via2[vT1CH] = 0;
via2[vT2CL] = 0;
via2[vT2CH] = 0;
via2[vACR] &= 0x3F;
via2[vACR] &= ~0xC0; /* setup T1 timer with no PB7 output */
via2[vACR] &= ~0x03; /* disable port A & B latches */
}

/*
* Set vPCR for SCSI interrupts (but not on RBV)
* Set vPCR for control line interrupts (but not on RBV)
*/
if (!rbv_present) {
/* For all VIA types, CA1 (SLOTS IRQ) and CB1 (ASC IRQ)
* are made negative edge triggered here.
*/
if (macintosh_config->scsi_type == MAC_SCSI_OLD) {
/* CB2 (IRQ) indep. input, positive edge */
/* CA2 (DRQ) indep. input, positive edge */
Expand Down Expand Up @@ -466,21 +465,6 @@ irqreturn_t via1_irq(int irq, void *dev_id)
++irq_num;
irq_bit <<= 1;
} while (events >= irq_bit);

#if 0 /* freakin' pmu is doing weird stuff */
if (!oss_present) {
/* This (still) seems to be necessary to get IDE
working. However, if you enable VBL interrupts,
you're screwed... */
/* FIXME: should we check the SLOTIRQ bit before
pulling this stunt? */
/* No, it won't be set. that's why we're doing this. */
via_irq_disable(IRQ_MAC_NUBUS);
via_irq_clear(IRQ_MAC_NUBUS);
m68k_handle_int(IRQ_MAC_NUBUS);
via_irq_enable(IRQ_MAC_NUBUS);
}
#endif
return IRQ_HANDLED;
}

Expand Down
1 change: 0 additions & 1 deletion drivers/ide/macide.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <linux/delay.h>
#include <linux/ide.h>

#include <asm/machw.h>
#include <asm/macintosh.h>
#include <asm/macints.h>
#include <asm/mac_baboon.h>
Expand Down
1 change: 0 additions & 1 deletion drivers/macintosh/via-cuda.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#else
#include <asm/macintosh.h>
#include <asm/macints.h>
#include <asm/machw.h>
#include <asm/mac_via.h>
#endif
#include <asm/io.h>
Expand Down
1 change: 0 additions & 1 deletion drivers/macintosh/via-macii.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include <linux/init.h>
#include <asm/macintosh.h>
#include <asm/macints.h>
#include <asm/machw.h>
#include <asm/mac_via.h>
#include <asm/system.h>

Expand Down
1 change: 0 additions & 1 deletion drivers/macintosh/via-maciisi.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <linux/interrupt.h>
#include <asm/macintosh.h>
#include <asm/macints.h>
#include <asm/machw.h>
#include <asm/mac_via.h>

static volatile unsigned char *via;
Expand Down
1 change: 0 additions & 1 deletion drivers/macintosh/via-pmu68k.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@

#include <asm/macintosh.h>
#include <asm/macints.h>
#include <asm/machw.h>
#include <asm/mac_via.h>

#include <asm/pgtable.h>
Expand Down
1 change: 0 additions & 1 deletion drivers/scsi/mac_scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@

#include <asm/macintosh.h>
#include <asm/macints.h>
#include <asm/machw.h>
#include <asm/mac_via.h>

#include "scsi.h"
Expand Down
Loading

0 comments on commit 541ef5c

Please sign in to comment.