Commit 2fbc109c authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://bk.arm.linux.org.uk

into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux
parents 1b8ad82f 93d84590
...@@ -335,6 +335,16 @@ hex 'Compressed ROM boot loader BSS address' CONFIG_ZBOOT_ROM_BSS 0 ...@@ -335,6 +335,16 @@ hex 'Compressed ROM boot loader BSS address' CONFIG_ZBOOT_ROM_BSS 0
if [ "$CONFIG_ARCH_SA1100" = "y" -o \ if [ "$CONFIG_ARCH_SA1100" = "y" -o \
"$CONFIG_ARCH_INTEGRATOR" = "y" ]; then "$CONFIG_ARCH_INTEGRATOR" = "y" ]; then
dep_bool 'Support CPU clock change (EXPERIMENTAL)' CONFIG_CPU_FREQ $CONFIG_EXPERIMENTAL dep_bool 'Support CPU clock change (EXPERIMENTAL)' CONFIG_CPU_FREQ $CONFIG_EXPERIMENTAL
else
define_bool CONFIG_CPU_FREQ n
fi
if [ "$CONFIG_CPU_FREQ" = "y" ]; then
define_bool CONFIG_CPU_FREQ_24_API y
define_bool CONFIG_CPU_FREQ_26_API y
else
define_bool CONFIG_CPU_FREQ_24_API n
define_bool CONFIG_CPU_FREQ_26_API n
fi fi
source drivers/pci/Config.in source drivers/pci/Config.in
......
...@@ -95,13 +95,14 @@ static void __init build_tag_list(struct param_struct *params, void *taglist) ...@@ -95,13 +95,14 @@ static void __init build_tag_list(struct param_struct *params, void *taglist)
{ {
struct tag *tag = taglist; struct tag *tag = taglist;
printk(KERN_DEBUG "Converting old-style param struct to taglist\n");
if (params->u1.s.page_size != PAGE_SIZE) { if (params->u1.s.page_size != PAGE_SIZE) {
printk(KERN_WARNING "Warning: bad configuration page, " printk(KERN_WARNING "Warning: bad configuration page, "
"trying to continue\n"); "trying to continue\n");
return; return;
} }
printk(KERN_DEBUG "Converting old-style param struct to taglist\n");
#ifdef CONFIG_ARCH_NETWINDER #ifdef CONFIG_ARCH_NETWINDER
if (params->u1.s.nr_pages != 0x02000 && if (params->u1.s.nr_pages != 0x02000 &&
params->u1.s.nr_pages != 0x04000 && params->u1.s.nr_pages != 0x04000 &&
......
...@@ -569,7 +569,7 @@ int request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *) ...@@ -569,7 +569,7 @@ int request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *)
* On a shared IRQ the caller must ensure the interrupt is disabled * On a shared IRQ the caller must ensure the interrupt is disabled
* on the card it drives before calling this function. * on the card it drives before calling this function.
* *
* This function may be called from interrupt context. * This function must not be called from interrupt context.
*/ */
void free_irq(unsigned int irq, void *dev_id) void free_irq(unsigned int irq, void *dev_id)
{ {
...@@ -591,15 +591,19 @@ void free_irq(unsigned int irq, void *dev_id) ...@@ -591,15 +591,19 @@ void free_irq(unsigned int irq, void *dev_id)
/* Found it - now free it */ /* Found it - now free it */
*p = action->next; *p = action->next;
kfree(action); break;
goto out;
} }
spin_unlock_irqrestore(&irq_controller_lock, flags);
if (!action) {
printk(KERN_ERR "Trying to free free IRQ%d\n",irq); printk(KERN_ERR "Trying to free free IRQ%d\n",irq);
#ifdef CONFIG_DEBUG_ERRORS #ifdef CONFIG_DEBUG_ERRORS
__backtrace(); __backtrace();
#endif #endif
out: } else {
spin_unlock_irqrestore(&irq_controller_lock, flags); synchronize_irq(irq);
kfree(action);
}
} }
/* Start the interrupt probing. Unlike other architectures, /* Start the interrupt probing. Unlike other architectures,
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include <asm/mach/serial_sa1100.h> #include <asm/mach/serial_sa1100.h>
#include "generic.h" #include "generic.h"
#include "sa1111.h"
static int __init adsbitsy_init(void) static int __init adsbitsy_init(void)
{ {
...@@ -53,7 +52,7 @@ static int __init adsbitsy_init(void) ...@@ -53,7 +52,7 @@ static int __init adsbitsy_init(void)
/* /*
* Probe for SA1111. * Probe for SA1111.
*/ */
ret = sa1111_init(NULL, 0x18000000, IRQ_GPIO0); ret = sa1111_init(0x18000000, IRQ_GPIO0);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include <asm/mach/serial_sa1100.h> #include <asm/mach/serial_sa1100.h>
#include "generic.h" #include "generic.h"
#include "sa1111.h"
static int __init badge4_sa1111_init(void) static int __init badge4_sa1111_init(void)
{ {
...@@ -45,7 +44,7 @@ static int __init badge4_sa1111_init(void) ...@@ -45,7 +44,7 @@ static int __init badge4_sa1111_init(void)
/* /*
* Probe for SA1111. * Probe for SA1111.
*/ */
return sa1111_init(NULL, BADGE4_SA1111_BASE, BADGE4_IRQ_GPIO_SA1111); return sa1111_init(BADGE4_SA1111_BASE, BADGE4_IRQ_GPIO_SA1111);
} }
static int __init badge4_init(void) static int __init badge4_init(void)
......
...@@ -90,9 +90,7 @@ ...@@ -90,9 +90,7 @@
#include <asm/hardware.h> #include <asm/hardware.h>
extern unsigned int sa11x0_freq_to_ppcr(unsigned int khz); #include "generic.h"
extern unsigned int sa11x0_validatespeed(unsigned int cpu, unsigned int khz);
extern unsigned int sa11x0_getspeed(void);
typedef struct { typedef struct {
int speed; int speed;
...@@ -107,7 +105,7 @@ typedef struct { ...@@ -107,7 +105,7 @@ typedef struct {
static sa1100_dram_regs_t sa1100_dram_settings[] = static sa1100_dram_regs_t sa1100_dram_settings[] =
{ {
/* { mdcnfg, mdcas0, mdcas1, mdcas2 } */ /* clock frequency */ /* speed, mdcnfg, mdcas0, mdcas1, mdcas2 clock frequency */
{ 59000, 0x00dc88a3, 0xcccccccf, 0xfffffffc, 0xffffffff }, /* 59.0 MHz */ { 59000, 0x00dc88a3, 0xcccccccf, 0xfffffffc, 0xffffffff }, /* 59.0 MHz */
{ 73700, 0x011490a3, 0xcccccccf, 0xfffffffc, 0xffffffff }, /* 73.7 MHz */ { 73700, 0x011490a3, 0xcccccccf, 0xfffffffc, 0xffffffff }, /* 73.7 MHz */
{ 88500, 0x014e90a3, 0xcccccccf, 0xfffffffc, 0xffffffff }, /* 88.5 MHz */ { 88500, 0x014e90a3, 0xcccccccf, 0xfffffffc, 0xffffffff }, /* 88.5 MHz */
...@@ -127,28 +125,25 @@ static sa1100_dram_regs_t sa1100_dram_settings[] = ...@@ -127,28 +125,25 @@ static sa1100_dram_regs_t sa1100_dram_settings[] =
{ 0, 0, 0, 0, 0 } /* last entry */ { 0, 0, 0, 0, 0 } /* last entry */
}; };
static void sa1100_update_dram_timings(int current_speed, int new_speed) static void sa1100_update_dram_timings(int current_speed, int new_speed)
{ {
sa1100_dram_regs_t *settings = sa1100_dram_settings; sa1100_dram_regs_t *settings = sa1100_dram_settings;
/* find speed */ /* find speed */
while(settings->speed != 0) { while (settings->speed != 0) {
if(new_speed == settings->speed) if(new_speed == settings->speed)
break; break;
settings++; settings++;
} }
if(settings->speed == 0) { if (settings->speed == 0) {
panic("%s: couldn't find dram setting for speed %d\n", panic("%s: couldn't find dram setting for speed %d\n",
__FUNCTION__, new_speed); __FUNCTION__, new_speed);
} }
/* No risk, no fun: run with interrupts on! */ /* No risk, no fun: run with interrupts on! */
if(new_speed > current_speed) { if (new_speed > current_speed) {
/* We're going FASTER, so first relax the memory /* We're going FASTER, so first relax the memory
* timings before changing the core frequency * timings before changing the core frequency
*/ */
...@@ -181,60 +176,39 @@ static void sa1100_update_dram_timings(int current_speed, int new_speed) ...@@ -181,60 +176,39 @@ static void sa1100_update_dram_timings(int current_speed, int new_speed)
} }
} }
static void sa1100_setspeed(struct cpufreq_policy *policy)
static int sa1100_dram_notifier(struct notifier_block *nb,
unsigned long val, void *data)
{ {
struct cpufreq_freqs *ci = data; unsigned int cur = sa11x0_getspeed();
struct cpufreq_freqs freqs;
switch(val) {
case CPUFREQ_MINMAX:
cpufreq_updateminmax(data, sa1100_dram_settings->speed, -1);
break;
case CPUFREQ_PRECHANGE:
if(ci->new > ci->cur)
sa1100_update_dram_timings(ci->cur, ci->new);
break;
case CPUFREQ_POSTCHANGE: freqs.old = cur;
if(ci->new < ci->cur) freqs.new = policy->max;
sa1100_update_dram_timings(ci->cur, ci->new); freqs.cpu = CPUFREQ_ALL_CPUS;
break;
default:
printk(KERN_INFO "%s: ignoring unknown notifier type (%ld)\n",
__FUNCTION__, val);
}
return 0;
}
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
if (policy->max > cur)
sa1100_update_dram_timings(cur, policy->max);
PPCR = sa11x0_freq_to_ppcr(policy->max);
static struct notifier_block sa1100_dram_block = { if (policy->max < cur)
.notifier_call = sa1100_dram_notifier, sa1100_update_dram_timings(cur, policy->max);
};
static void sa1100_setspeed(unsigned int cpu, unsigned int khz) cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
{
PPCR = sa11x0_freq_to_ppcr(khz);
} }
static struct cpufreq_freqs sa1100_freqs = { static struct cpufreq_policy sa1100_policy = {
.min = 59000, .cpu = 0,
.max = 287000, .policy = CPUFREQ_POLICY_POWERSAVE,
.max_cpu_freq = 287000,
}; };
static struct cpufreq_driver sa1100_driver = { static struct cpufreq_driver sa1100_driver = {
.freq = &sa1100_freqs, .verify = sa11x0_verify_speed,
.validate = sa11x0_validatespeed, .setpolicy = sa1100_setspeed,
.setspeed = sa1100_setspeed, .policy = &sa1100_policy,
.sync = 1, .cpu_min_freq = 59000,
}; };
static int __init sa1100_dram_init(void) static int __init sa1100_dram_init(void)
...@@ -242,11 +216,9 @@ static int __init sa1100_dram_init(void) ...@@ -242,11 +216,9 @@ static int __init sa1100_dram_init(void)
int ret = -ENODEV; int ret = -ENODEV;
if ((processor_id & CPU_SA1100_MASK) == CPU_SA1100_ID) { if ((processor_id & CPU_SA1100_MASK) == CPU_SA1100_ID) {
ret = cpufreq_register_notifier(&sa1100_dram_block); sa1100_driver.cpu_curr_freq[0] =
if (ret) sa1100_policy.min =
return ret; sa1100_policy.max = sa11x0_getspeed();
sa1100_freqs.cur = sa11x0_getspeed();
ret = cpufreq_register(&sa1100_driver); ret = cpufreq_register(&sa1100_driver);
} }
......
...@@ -28,11 +28,9 @@ ...@@ -28,11 +28,9 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/system.h> #include <asm/system.h>
#undef DEBUG #include "generic.h"
extern unsigned int sa11x0_freq_to_ppcr(unsigned int khz); #undef DEBUG
extern unsigned int sa11x0_validatespeed(unsigned int cpu, unsigned int khz);
extern unsigned int sa11x0_getspeed(void);
struct sdram_params { struct sdram_params {
u_char rows; /* bits */ u_char rows; /* bits */
...@@ -214,15 +212,16 @@ sdram_update_refresh(u_int cpu_khz, struct sdram_params *sdram) ...@@ -214,15 +212,16 @@ sdram_update_refresh(u_int cpu_khz, struct sdram_params *sdram)
* above, we can match for an exact frequency. If we don't find * above, we can match for an exact frequency. If we don't find
* an exact match, we will to set the lowest frequency to be safe. * an exact match, we will to set the lowest frequency to be safe.
*/ */
static void sa1110_setspeed(unsigned int cpu, unsigned int khz) static void sa1110_setspeed(struct cpufreq_policy *policy)
{ {
struct sdram_params *sdram = &sdram_params; struct sdram_params *sdram = &sdram_params;
struct cpufreq_freqs freqs;
struct sdram_info sd; struct sdram_info sd;
unsigned long flags; unsigned long flags;
unsigned int ppcr, unused; unsigned int ppcr, unused;
ppcr = sa11x0_freq_to_ppcr(khz); ppcr = sa11x0_freq_to_ppcr(policy->max);
sdram_calculate_timing(&sd, khz, sdram); sdram_calculate_timing(&sd, policy->max, sdram);
#if 0 #if 0
/* /*
...@@ -230,7 +229,7 @@ static void sa1110_setspeed(unsigned int cpu, unsigned int khz) ...@@ -230,7 +229,7 @@ static void sa1110_setspeed(unsigned int cpu, unsigned int khz)
* and errata, but they seem to work. Need to get a storage * and errata, but they seem to work. Need to get a storage
* scope on to the SDRAM signals to work out why. * scope on to the SDRAM signals to work out why.
*/ */
if (khz < 147500) { if (policy->max < 147500) {
sd.mdrefr |= MDREFR_K1DB2; sd.mdrefr |= MDREFR_K1DB2;
sd.mdcas[0] = 0xaaaaaa7f; sd.mdcas[0] = 0xaaaaaa7f;
} else { } else {
...@@ -240,6 +239,13 @@ static void sa1110_setspeed(unsigned int cpu, unsigned int khz) ...@@ -240,6 +239,13 @@ static void sa1110_setspeed(unsigned int cpu, unsigned int khz)
sd.mdcas[1] = 0xaaaaaaaa; sd.mdcas[1] = 0xaaaaaaaa;
sd.mdcas[2] = 0xaaaaaaaa; sd.mdcas[2] = 0xaaaaaaaa;
#endif #endif
freqs.old = sa11x0_getspeed();
freqs.new = policy->max;
freqs.cpu = CPUFREQ_ALL_CPUS;
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
/* /*
* The clock could be going away for some time. Set the SDRAMs * The clock could be going away for some time. Set the SDRAMs
* to refresh rapidly (every 64 memory clock cycles). To get * to refresh rapidly (every 64 memory clock cycles). To get
...@@ -257,7 +263,7 @@ static void sa1110_setspeed(unsigned int cpu, unsigned int khz) ...@@ -257,7 +263,7 @@ static void sa1110_setspeed(unsigned int cpu, unsigned int khz)
* the programming. * the programming.
*/ */
local_irq_save(flags); local_irq_save(flags);
asm("mcr p15, 0, %0, c10, c4" : : "r" (0)); asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (0));
udelay(10); udelay(10);
__asm__ __volatile__(" __asm__ __volatile__("
b 2f b 2f
...@@ -282,19 +288,22 @@ static void sa1110_setspeed(unsigned int cpu, unsigned int khz) ...@@ -282,19 +288,22 @@ static void sa1110_setspeed(unsigned int cpu, unsigned int khz)
/* /*
* Now, return the SDRAM refresh back to normal. * Now, return the SDRAM refresh back to normal.
*/ */
sdram_update_refresh(khz, sdram); sdram_update_refresh(policy->max, sdram);
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
} }
static struct cpufreq_freqs sa1110_freqs = { static struct cpufreq_policy sa1110_policy = {
.min = 59000, .cpu = 0,
.max = 287000, .policy = CPUFREQ_POLICY_POWERSAVE,
.max_cpu_freq = 287000,
}; };
static struct cpufreq_driver sa1110_driver = { static struct cpufreq_driver sa1110_driver = {
.freq = &sa1110_freqs, .verify = sa11x0_verify_speed,
.validate = sa11x0_validatespeed, .setpolicy = sa1110_setspeed,
.setspeed = sa1110_setspeed, .policy = &sa1110_policy,
.sync = 1, .cpu_min_freq = 59000,
}; };
static int __init sa1110_clk_init(void) static int __init sa1110_clk_init(void)
...@@ -318,8 +327,11 @@ static int __init sa1110_clk_init(void) ...@@ -318,8 +327,11 @@ static int __init sa1110_clk_init(void)
memcpy(&sdram_params, sdram, sizeof(sdram_params)); memcpy(&sdram_params, sdram, sizeof(sdram_params));
sa1110_freqs.cur = sa11x0_getspeed(); sa1110_driver.cpu_cur_freq[0] =
sa1110_setspeed(0, sa1110_freqs.cur); sa1110_policy.min =
sa1110_policy.max = sa11x0_getspeed();
sa1110_setspeed(&sa1110_policy);
return cpufreq_register(&sa1110_driver); return cpufreq_register(&sa1110_driver);
} }
......
...@@ -55,20 +55,26 @@ unsigned int sa11x0_freq_to_ppcr(unsigned int khz) ...@@ -55,20 +55,26 @@ unsigned int sa11x0_freq_to_ppcr(unsigned int khz)
khz /= 100; khz /= 100;
for (i = NR_FREQS - 1; i > 0; i--) for (i = 0; i < ARRAY_SIZE(cclk_frequency_100khz); i--)
if (cclk_frequency_100khz[i] <= khz) if (cclk_frequency_100khz[i] >= khz)
break; break;
return i; return i;
} }
/* /*
* Validate the speed in khz. If we can't generate the precise * Validate the policy. We aren't able to do any fancy in-kernel
* frequency requested, round it down (to be on the safe side). * scaling, so we force min=max, and set the policy to "performance".
* If we can't generate the precise frequency requested, round it up.
*/ */
unsigned int sa11x0_validatespeed(unsigned int cpu, unsigned int khz) void sa11x0_verify_speed(struct cpufreq_policy *policy)
{ {
return cclk_frequency_100khz[sa11x0_freq_to_ppcr(khz)] * 100; if (policy->max > policy->max_cpu_freq)
policy->max = policy->max_cpu_freq;
policy->max = cclk_frequency_100khz[sa11x0_freq_to_ppcr(policy->max)] * 100;
policy->min = policy->max;
policy->policy = CPUFREQ_POLICY_POWERSAVE;
} }
unsigned int sa11x0_getspeed(void) unsigned int sa11x0_getspeed(void)
......
...@@ -17,3 +17,9 @@ extern void (*sa1100fb_lcd_power)(int on); ...@@ -17,3 +17,9 @@ extern void (*sa1100fb_lcd_power)(int on);
extern void sa1110_mb_enable(void); extern void sa1110_mb_enable(void);
extern void sa1110_mb_disable(void); extern void sa1110_mb_disable(void);
struct cpufreq_policy;
extern unsigned int sa11x0_freq_to_ppcr(unsigned int khz);
extern void sa11x0_verify_speed(struct cpufreq_policy *policy);
extern unsigned int sa11x0_getspeed(void);
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include <asm/mach/serial_sa1100.h> #include <asm/mach/serial_sa1100.h>
#include "generic.h" #include "generic.h"
#include "sa1111.h"
static int __init graphicsmaster_init(void) static int __init graphicsmaster_init(void)
{ {
...@@ -43,7 +42,7 @@ static int __init graphicsmaster_init(void) ...@@ -43,7 +42,7 @@ static int __init graphicsmaster_init(void)
/* /*
* Probe for SA1111. * Probe for SA1111.
*/ */
ret = sa1111_init(NULL, 0x18000000, ADS_EXT_IRQ(0)); ret = sa1111_init(0x18000000, ADS_EXT_IRQ(0));
if (ret < 0) if (ret < 0)
return ret; return ret;
......
This diff is collapsed.
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include <asm/mach/serial_sa1100.h> #include <asm/mach/serial_sa1100.h>
#include "generic.h" #include "generic.h"
#include "sa1111.h"
#define JORTUCR_VAL 0x20000400 #define JORTUCR_VAL 0x20000400
...@@ -46,11 +45,7 @@ static int __init jornada720_init(void) ...@@ -46,11 +45,7 @@ static int __init jornada720_init(void)
PPSR &= ~(PPC_LDD3 | PPC_LDD4); PPSR &= ~(PPC_LDD3 | PPC_LDD4);
PPDR |= PPC_LDD3 | PPC_LDD4; PPDR |= PPC_LDD3 | PPC_LDD4;
/* initialize extra IRQs */ return sa1111_init(0x40000000, IRQ_GPIO1);
set_GPIO_IRQ_edge(GPIO_GPIO1, GPIO_RISING_EDGE);
sa1111_init_irq(IRQ_GPIO1); /* chained on GPIO 1 */
return 0;
} }
arch_initcall(jornada720_init); arch_initcall(jornada720_init);
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/serial_core.h> #include <linux/serial_core.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/slab.h>
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
...@@ -23,13 +24,6 @@ ...@@ -23,13 +24,6 @@
#include <asm/hardware/sa1111.h> #include <asm/hardware/sa1111.h>
#include <asm/sizes.h> #include <asm/sizes.h>
#include "sa1111.h"
static struct device neponset_device = {
.name = "Neponset",
.bus_id = "nep_bus",
};
/* /*
* Install handler for Neponset IRQ. Note that we have to loop here * Install handler for Neponset IRQ. Note that we have to loop here
* since the ETHERNET and USAR IRQs are level based, and we need to * since the ETHERNET and USAR IRQs are level based, and we need to
...@@ -163,6 +157,52 @@ static struct sa1100_port_fns neponset_port_fns __initdata = { ...@@ -163,6 +157,52 @@ static struct sa1100_port_fns neponset_port_fns __initdata = {
.get_mctrl = neponset_get_mctrl, .get_mctrl = neponset_get_mctrl,
}; };
/*
* LDM power management.
*/
static int neponset_suspend(struct device *dev, u32 state, u32 level)
{
/*
* Save state.
*/
if (level == SUSPEND_SAVE_STATE ||
level == SUSPEND_DISABLE ||
level == SUSPEND_POWER_DOWN) {
if (!dev->saved_state)
dev->saved_state = kmalloc(sizeof(unsigned int), GFP_KERNEL);
if (!dev->saved_state)
return -ENOMEM;
*(unsigned int *)dev->saved_state = NCR_0;
}
return 0;
}
static int neponset_resume(struct device *dev, u32 level)
{
if (level == RESUME_RESTORE_STATE || level == RESUME_ENABLE) {
if (dev->saved_state) {
NCR_0 = *(unsigned int *)dev->saved_state;
kfree(dev->saved_state);
dev->saved_state = NULL;
}
}
return 0;
}
static struct device_driver neponset_device_driver = {
.suspend = neponset_suspend,
.resume = neponset_resume,
};
static struct device neponset_device = {
.name = "Neponset",
.bus_id = "neponset",
.driver = &neponset_device_driver,
};
static int __init neponset_init(void) static int __init neponset_init(void)
{ {
int ret; int ret;
...@@ -191,7 +231,7 @@ static int __init neponset_init(void) ...@@ -191,7 +231,7 @@ static int __init neponset_init(void)
return -ENODEV; return -ENODEV;
} }
ret = device_register(&neponset_device); ret = register_sys_device(&neponset_device);
if (ret) if (ret)
return ret; return ret;
...@@ -213,7 +253,7 @@ static int __init neponset_init(void) ...@@ -213,7 +253,7 @@ static int __init neponset_init(void)
/* /*
* Probe and initialise the SA1111. * Probe and initialise the SA1111.
*/ */
return sa1111_init(&neponset_device, 0x40000000, IRQ_NEPONSET_SA1111); return sa1111_init(0x40000000, IRQ_NEPONSET_SA1111);
} }
arch_initcall(neponset_init); arch_initcall(neponset_init);
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include <asm/mach/serial_sa1100.h> #include <asm/mach/serial_sa1100.h>
#include "generic.h" #include "generic.h"
#include "sa1111.h"
static int __init pfs168_init(void) static int __init pfs168_init(void)
...@@ -36,7 +35,7 @@ static int __init pfs168_init(void) ...@@ -36,7 +35,7 @@ static int __init pfs168_init(void)
/* /*
* Probe for SA1111. * Probe for SA1111.
*/ */
return sa1111_init(NULL, 0x40000000, IRQ_GPIO25); return sa1111_init(0x40000000, IRQ_GPIO25);
} }
arch_initcall(pfs168_init); arch_initcall(pfs168_init);
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/sysctl.h> #include <linux/sysctl.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/device.h>
#include <linux/cpufreq.h> #include <linux/cpufreq.h>
#include <asm/hardware.h> #include <asm/hardware.h>
...@@ -193,11 +194,29 @@ static int sysctl_pm_do_suspend(void) ...@@ -193,11 +194,29 @@ static int sysctl_pm_do_suspend(void)
{ {
int retval; int retval;
/*
* Suspend "legacy" devices.
*/
retval = pm_send_all(PM_SUSPEND, (void *)3); retval = pm_send_all(PM_SUSPEND, (void *)3);
if (retval == 0) { if (retval == 0) {
/*
* Suspend LDM devices.
*/
device_suspend(4, SUSPEND_NOTIFY);
device_suspend(4, SUSPEND_SAVE_STATE);
device_suspend(4, SUSPEND_DISABLE);
retval = pm_do_suspend(); retval = pm_do_suspend();
/*
* Resume LDM devices.
*/
device_resume(RESUME_RESTORE_STATE);
device_resume(RESUME_ENABLE);
/*
* Resume "legacy" devices.
*/
pm_send_all(PM_RESUME, (void *)0); pm_send_all(PM_RESUME, (void *)0);
} }
......
This diff is collapsed.
/*
* linux/arch/arm/mach-sa1100/sa1111.h
*/
struct device;
/*
* Probe for a SA1111 chip.
*/
extern int
sa1111_init(struct device *parent, unsigned long phys, unsigned int irq);
/*
* Wake up a SA1111 chip.
*/
extern void sa1111_wake(void);
/*
* Doze the SA1111 chip.
*/
extern void sa1111_doze(void);
...@@ -284,6 +284,17 @@ storkInitTSandDtoA(void) ...@@ -284,6 +284,17 @@ storkInitTSandDtoA(void)
storkClockShortToDtoA(0x0A00); /* turn on the brightness */ storkClockShortToDtoA(0x0A00); /* turn on the brightness */
} }
static void stork_lcd_power(int on)
{
if (on) {
storkSetLCDCPLD(0, 1);
storkSetLatchA(STORK_LCD_BACKLIGHT_INVERTER_ON);
} else {
storkSetLCDCPLD(0, 0);
storkClearLatchA(STORK_LCD_BACKLIGHT_INVERTER_ON);
}
}
struct map_desc stork_io_desc[] __initdata = { struct map_desc stork_io_desc[] __initdata = {
/* virtual physical length type */ /* virtual physical length type */
{ STORK_VM_BASE_CS1, STORK_VM_OFF_CS1, 0x01000000, MT_DEVICE }, /* EGPIO 0 */ { STORK_VM_BASE_CS1, STORK_VM_OFF_CS1, 0x01000000, MT_DEVICE }, /* EGPIO 0 */
...@@ -312,6 +323,8 @@ stork_map_io(void) ...@@ -312,6 +323,8 @@ stork_map_io(void)
storkInitTSandDtoA(); storkInitTSandDtoA();
sa1100fb_lcd_power = stork_lcd_power;
return 0; return 0;
} }
......
...@@ -56,7 +56,6 @@ ...@@ -56,7 +56,6 @@
#include <linux/serial_core.h> #include <linux/serial_core.h>
#include "generic.h" #include "generic.h"
#include "sa1111.h"
#include <asm/hardware/sa1111.h> #include <asm/hardware/sa1111.h>
#define DEBUG 1 #define DEBUG 1
...@@ -401,7 +400,7 @@ static int __init system3_init(void) ...@@ -401,7 +400,7 @@ static int __init system3_init(void)
/* /*
* Probe for a SA1111. * Probe for a SA1111.
*/ */
ret = sa1111_init(NULL, PT_SA1111_BASE, IRQ_SYSTEM3_SA1111); ret = sa1111_init(PT_SA1111_BASE, IRQ_SYSTEM3_SA1111);
if (ret < 0) { if (ret < 0) {
printk( KERN_WARNING"PT Digital Board: no SA1111 found!\n" ); printk( KERN_WARNING"PT Digital Board: no SA1111 found!\n" );
goto DONE; goto DONE;
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#else #else
/* /*
* "code" is actually the FSR register. Bit 11 set means the * "code" is actually the FSR register. Bit 11 set means the
* isntruction was performing a write. * instruction was performing a write.
*/ */
#define DO_COW(code) ((code) & (1 << 11)) #define DO_COW(code) ((code) & (1 << 11))
#define READ_FAULT(code) (!DO_COW(code)) #define READ_FAULT(code) (!DO_COW(code))
...@@ -54,7 +54,7 @@ void show_pte(struct mm_struct *mm, unsigned long addr) ...@@ -54,7 +54,7 @@ void show_pte(struct mm_struct *mm, unsigned long addr)
printk(KERN_ALERT "pgd = %p\n", mm->pgd); printk(KERN_ALERT "pgd = %p\n", mm->pgd);
pgd = pgd_offset(mm, addr); pgd = pgd_offset(mm, addr);
printk(KERN_ALERT "*pgd=%08lx", pgd_val(*pgd)); printk(KERN_ALERT "[%08lx] *pgd=%08lx", addr, pgd_val(*pgd));
do { do {
pmd_t *pmd; pmd_t *pmd;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
# To add an entry into this database, please see Documentation/arm/README, # To add an entry into this database, please see Documentation/arm/README,
# or contact rmk@arm.linux.org.uk # or contact rmk@arm.linux.org.uk
# #
# Last update: Sat Jul 27 09:56:53 2002 # Last update: Sat Sep 21 13:39:13 2002
# #
# machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number
# #
...@@ -214,3 +214,31 @@ emailphone SA1100_EMAILPHONE EMAILPHONE 202 ...@@ -214,3 +214,31 @@ emailphone SA1100_EMAILPHONE EMAILPHONE 202
h3900 ARCH_H3900 H3900 203 h3900 ARCH_H3900 H3900 203
pxa1 ARCH_PXA1 PXA1 204 pxa1 ARCH_PXA1 PXA1 204
koan369 SA1100_KOAN369 KOAN369 205 koan369 SA1100_KOAN369 KOAN369 205
cogent ARCH_COGENT COGENT 206
esl_simputer ARCH_ESL_SIMPUTER ESL_SIMPUTER 207
esl_simputer_clr ARCH_ESL_SIMPUTER_CLR ESL_SIMPUTER_CLR 208
esl_simputer_bw ARCH_ESL_SIMPUTER_BW ESL_SIMPUTER_BW 209
hhp_cradle ARCH_HHP_CRADLE HHP_CRADLE 210
he500 ARCH_HE500 HE500 211
inhandelf2 SA1100_INHANDELF2 INHANDELF2 212
inhandftip SA1100_INHANDFTIP INHANDFTIP 213
dnp1110 SA1100_DNP1110 DNP1110 214
pnp1110 SA1100_PNP1110 PNP1110 215
csb226 ARCH_CSB226 CSB226 216
arnold SA1100_ARNOLD ARNOLD 217
psiboard SA1100_PSIBOARD PSIBOARD 218
jz8028 ARCH_JZ8028 JZ8028 219
ipaq3 ARCH_IPAQ3 IPAQ3 220
forte SA1100_FORTE FORTE 221
acam SA1100_ACAM ACAM 222
abox SA1100_ABOX ABOX 223
atmel ARCH_ATMEL ATMEL 224
sitsang ARCH_SITSANG SITSANG 225
cpu1110lcdnet SA1100_CPU1110LCDNET CPU1110LCDNET 226
mpl_vcma9 ARCH_MPL_VCMA9 MPL_VCMA9 227
opus_a1 ARCH_OPUS_A1 OPUS_A1 228
daytona ARCH_DAYTONA DAYTONA 229
killbear SA1100_KILLBEAR KILLBEAR 230
yoho ARCH_YOHO YOHO 231
jasper ARCH_JASPER JASPER 232
dsc25 ARCH_DSC25 DSC25 233
This diff is collapsed.
...@@ -20,6 +20,7 @@ if [ "$CONFIG_PCMCIA" != "n" ]; then ...@@ -20,6 +20,7 @@ if [ "$CONFIG_PCMCIA" != "n" ]; then
fi fi
if [ "$CONFIG_ARM" = "y" ]; then if [ "$CONFIG_ARM" = "y" ]; then
dep_tristate ' SA1100 support' CONFIG_PCMCIA_SA1100 $CONFIG_ARCH_SA1100 $CONFIG_PCMCIA dep_tristate ' SA1100 support' CONFIG_PCMCIA_SA1100 $CONFIG_ARCH_SA1100 $CONFIG_PCMCIA
dep_tristate ' SA1111 support' CONFIG_PCMCIA_SA1111 $CONFIG_PCMCIA_SA1100 $CONFIG_SA1111 $CONFIG_PCMCIA
fi fi
fi fi
......
...@@ -14,6 +14,7 @@ obj-$(CONFIG_I82092) += i82092.o ...@@ -14,6 +14,7 @@ obj-$(CONFIG_I82092) += i82092.o
obj-$(CONFIG_TCIC) += tcic.o obj-$(CONFIG_TCIC) += tcic.o
obj-$(CONFIG_HD64465_PCMCIA) += hd64465_ss.o obj-$(CONFIG_HD64465_PCMCIA) += hd64465_ss.o
obj-$(CONFIG_PCMCIA_SA1100) += sa1100_cs.o obj-$(CONFIG_PCMCIA_SA1100) += sa1100_cs.o
obj-$(CONFIG_PCMCIA_SA1111) += sa1111_cs.o
yenta_socket-objs := pci_socket.o yenta.o yenta_socket-objs := pci_socket.o yenta.o
...@@ -21,26 +22,29 @@ pcmcia_core-objs-y := cistpl.o rsrc_mgr.o bulkmem.o cs.o ...@@ -21,26 +22,29 @@ pcmcia_core-objs-y := cistpl.o rsrc_mgr.o bulkmem.o cs.o
pcmcia_core-objs-$(CONFIG_CARDBUS) += cardbus.o pcmcia_core-objs-$(CONFIG_CARDBUS) += cardbus.o
pcmcia_core-objs := $(pcmcia_core-objs-y) pcmcia_core-objs := $(pcmcia_core-objs-y)
sa1111_cs-objs-y := sa1111_generic.o
sa1111_cs-objs-$(CONFIG_SA1100_ADSBITSY) += sa1100_adsbitsy.o
sa1111_cs-objs-$(CONFIG_ASSABET_NEPONSET) += sa1100_neponset.o
sa1111_cs-objs-$(CONFIG_SA1100_BADGE4) += sa1100_badge4.o
sa1111_cs-objs-$(CONFIG_SA1100_GRAPHICSMASTER) += sa1100_graphicsmaster.o
sa1111_cs-objs-$(CONFIG_SA1100_JORNADA720) += sa1100_jornada720.o
sa1111_cs-objs-$(CONFIG_SA1100_PFS168) += sa1100_pfs168.o
sa1111_cs-objs-$(CONFIG_SA1100_PT_SYSTEM3) += sa1100_system3.o
sa1111_cs-objs-$(CONFIG_SA1100_XP860) += sa1100_xp860.o
sa1111_cs-objs := $(sa1111_cs-objs-y)
sa1100_cs-objs-y := sa1100_generic.o sa1100_cs-objs-y := sa1100_generic.o
sa1100_cs-objs-$(CONFIG_SA1100_ADSBITSY) += sa1100_adsbitsy.o sa1111_generic.o
sa1100_cs-objs-$(CONFIG_SA1100_ASSABET) += sa1100_assabet.o sa1100_cs-objs-$(CONFIG_SA1100_ASSABET) += sa1100_assabet.o
sa1100_cs-objs-$(CONFIG_ASSABET_NEPONSET) += sa1100_neponset.o sa1111_generic.o
sa1100_cs-objs-$(CONFIG_SA1100_BADGE4) += sa1100_badge4.o sa1111_generic.o
sa1100_cs-objs-$(CONFIG_SA1100_CERF) += sa1100_cerf.o sa1100_cs-objs-$(CONFIG_SA1100_CERF) += sa1100_cerf.o
sa1100_cs-objs-$(CONFIG_SA1100_FLEXANET) += sa1100_flexanet.o sa1100_cs-objs-$(CONFIG_SA1100_FLEXANET) += sa1100_flexanet.o
sa1100_cs-objs-$(CONFIG_SA1100_FREEBIRD) += sa1100_freebird.o sa1100_cs-objs-$(CONFIG_SA1100_FREEBIRD) += sa1100_freebird.o
sa1100_cs-objs-$(CONFIG_SA1100_GRAPHICSMASTER) += sa1100_graphicsmaster.o sa1111_generic.o
sa1100_cs-objs-$(CONFIG_SA1100_GRAPHICSCLIENT) += sa1100_graphicsclient.o sa1100_cs-objs-$(CONFIG_SA1100_GRAPHICSCLIENT) += sa1100_graphicsclient.o
sa1100_cs-objs-$(CONFIG_SA1100_H3600) += sa1100_h3600.o sa1100_cs-objs-$(CONFIG_SA1100_H3600) += sa1100_h3600.o
sa1100_cs-objs-$(CONFIG_SA1100_JORNADA720) += sa1100_jornada720.o sa1111_generic.o
sa1100_cs-objs-$(CONFIG_SA1100_PANGOLIN) += sa1100_pangolin.o sa1100_cs-objs-$(CONFIG_SA1100_PANGOLIN) += sa1100_pangolin.o
sa1100_cs-objs-$(CONFIG_SA1100_PFS168) += sa1100_pfs168.o sa1111_generic.o
sa1100_cs-objs-$(CONFIG_SA1100_PT_SYSTEM3) += sa1100_system3.o sa1111_generic.o
sa1100_cs-objs-$(CONFIG_SA1100_SHANNON) += sa1100_shannon.o sa1100_cs-objs-$(CONFIG_SA1100_SHANNON) += sa1100_shannon.o
sa1100_cs-objs-$(CONFIG_SA1100_SIMPAD) += sa1100_simpad.o sa1100_cs-objs-$(CONFIG_SA1100_SIMPAD) += sa1100_simpad.o
sa1100_cs-objs-$(CONFIG_SA1100_STORK) += sa1100_stork.o sa1100_cs-objs-$(CONFIG_SA1100_STORK) += sa1100_stork.o
sa1100_cs-objs-$(CONFIG_SA1100_TRIZEPS) += sa1100_trizeps.o sa1100_cs-objs-$(CONFIG_SA1100_TRIZEPS) += sa1100_trizeps.o
sa1100_cs-objs-$(CONFIG_SA1100_XP860) += sa1100_xp860.o sa1111_generic.o
sa1100_cs-objs-$(CONFIG_SA1100_YOPY) += sa1100_yopy.o sa1100_cs-objs-$(CONFIG_SA1100_YOPY) += sa1100_yopy.o
sa1100_cs-objs := $(sa1100_cs-objs-y) sa1100_cs-objs := $(sa1100_cs-objs-y)
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/mach-types.h>
#include "sa1100_generic.h" #include "sa1100_generic.h"
#include "sa1111_generic.h" #include "sa1111_generic.h"
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/mach-types.h>
#include <asm/arch/badge4.h> #include <asm/arch/badge4.h>
#include <asm/hardware/sa1111.h> #include <asm/hardware/sa1111.h>
......
...@@ -110,12 +110,11 @@ sa1100_pcmcia_default_mecr_timing(unsigned int sock, unsigned int cpu_speed, ...@@ -110,12 +110,11 @@ sa1100_pcmcia_default_mecr_timing(unsigned int sock, unsigned int cpu_speed,
* Call board specific BS value calculation to allow boards * Call board specific BS value calculation to allow boards
* to tweak the BS values. * to tweak the BS values.
*/ */
static int sa1100_pcmcia_set_mecr(int sock) static int sa1100_pcmcia_set_mecr(int sock, unsigned int cpu_clock)
{ {
struct sa1100_pcmcia_socket *skt; struct sa1100_pcmcia_socket *skt;
u32 mecr; u32 mecr;
int clock; unsigned long flags;
long flags;
unsigned int bs; unsigned int bs;
if (sock < 0 || sock > SA1100_PCMCIA_MAX_SOCK) if (sock < 0 || sock > SA1100_PCMCIA_MAX_SOCK)
...@@ -125,8 +124,7 @@ static int sa1100_pcmcia_set_mecr(int sock) ...@@ -125,8 +124,7 @@ static int sa1100_pcmcia_set_mecr(int sock)
local_irq_save(flags); local_irq_save(flags);
clock = cpufreq_get(0); bs = pcmcia_low_level->socket_get_timing(sock, cpu_clock, skt->speed_io);
bs = pcmcia_low_level->socket_get_timing(sock, clock, skt->speed_io);
mecr = MECR; mecr = MECR;
MECR_FAST_SET(mecr, sock, 0); MECR_FAST_SET(mecr, sock, 0);
...@@ -652,7 +650,7 @@ sa1100_pcmcia_set_io_map(unsigned int sock, struct pccard_io_map *map) ...@@ -652,7 +650,7 @@ sa1100_pcmcia_set_io_map(unsigned int sock, struct pccard_io_map *map)
if ( map->speed == 0) if ( map->speed == 0)
map->speed = SA1100_PCMCIA_IO_ACCESS; map->speed = SA1100_PCMCIA_IO_ACCESS;
sa1100_pcmcia_set_mecr( sock ); sa1100_pcmcia_set_mecr(sock, cpufreq_get(0));
} }
if (map->stop == 1) if (map->stop == 1)
...@@ -741,7 +739,7 @@ sa1100_pcmcia_set_mem_map(unsigned int sock, struct pccard_mem_map *map) ...@@ -741,7 +739,7 @@ sa1100_pcmcia_set_mem_map(unsigned int sock, struct pccard_mem_map *map)
map->speed = SA1100_PCMCIA_5V_MEM_ACCESS; map->speed = SA1100_PCMCIA_5V_MEM_ACCESS;
} }
sa1100_pcmcia_set_mecr( sock ); sa1100_pcmcia_set_mecr(sock, cpufreq_get(0));
} }
...@@ -885,9 +883,8 @@ static void sa1100_pcmcia_update_mecr(unsigned int clock) ...@@ -885,9 +883,8 @@ static void sa1100_pcmcia_update_mecr(unsigned int clock)
{ {
unsigned int sock; unsigned int sock;
for (sock = 0; sock < SA1100_PCMCIA_MAX_SOCK; ++sock) { for (sock = 0; sock < SA1100_PCMCIA_MAX_SOCK; ++sock)
sa1100_pcmcia_set_mecr(sock); sa1100_pcmcia_set_mecr(sock, clock);
}
} }
/* sa1100_pcmcia_notifier() /* sa1100_pcmcia_notifier()
...@@ -904,26 +901,26 @@ static int ...@@ -904,26 +901,26 @@ static int
sa1100_pcmcia_notifier(struct notifier_block *nb, unsigned long val, sa1100_pcmcia_notifier(struct notifier_block *nb, unsigned long val,
void *data) void *data)
{ {
struct cpufreq_info *ci = data; struct cpufreq_freqs *freqs = data;
switch (val) { switch (val) {
case CPUFREQ_PRECHANGE: case CPUFREQ_PRECHANGE:
if (ci->new_freq > ci->old_freq) { if (freqs->new > freqs->old) {
DEBUG(2, "%s(): new frequency %u.%uMHz > %u.%uMHz, pre-updating\n", DEBUG(2, "%s(): new frequency %u.%uMHz > %u.%uMHz, "
__FUNCTION__, "pre-updating\n", __FUNCTION__,
ci->new_freq / 1000, (ci->new_freq / 100) % 10, freqs->new / 1000, (freqs->new / 100) % 10,
ci->old_freq / 1000, (ci->old_freq / 100) % 10); freqs->old / 1000, (freqs->old / 100) % 10);
sa1100_pcmcia_update_mecr(ci->new_freq); sa1100_pcmcia_update_mecr(freqs->new);
} }
break; break;
case CPUFREQ_POSTCHANGE: case CPUFREQ_POSTCHANGE:
if (ci->new_freq < ci->old_freq) { if (freqs->new < freqs->old) {
DEBUG(2, "%s(): new frequency %u.%uMHz < %u.%uMHz, post-updating\n", DEBUG(2, "%s(): new frequency %u.%uMHz < %u.%uMHz, "
__FUNCTION__, "post-updating\n", __FUNCTION__,
ci->new_freq / 1000, (ci->new_freq / 100) % 10, freqs->new / 1000, (freqs->new / 100) % 10,
ci->old_freq / 1000, (ci->old_freq / 100) % 10); freqs->old / 1000, (freqs->old / 100) % 10);
sa1100_pcmcia_update_mecr(ci->new_freq); sa1100_pcmcia_update_mecr(freqs->new);
} }
break; break;
} }
...@@ -946,7 +943,7 @@ int sa1100_register_pcmcia(struct pcmcia_low_level *ops) ...@@ -946,7 +943,7 @@ int sa1100_register_pcmcia(struct pcmcia_low_level *ops)
struct pcmcia_init pcmcia_init; struct pcmcia_init pcmcia_init;
struct pcmcia_state state[SA1100_PCMCIA_MAX_SOCK]; struct pcmcia_state state[SA1100_PCMCIA_MAX_SOCK];
struct pcmcia_state_array state_array; struct pcmcia_state_array state_array;
unsigned int i; unsigned int i, cpu_clock;
int ret; int ret;
/* /*
...@@ -986,6 +983,8 @@ int sa1100_register_pcmcia(struct pcmcia_low_level *ops) ...@@ -986,6 +983,8 @@ int sa1100_register_pcmcia(struct pcmcia_low_level *ops)
goto shutdown; goto shutdown;
} }
cpu_clock = cpufreq_get(0);
/* /*
* We initialize the MECR to default values here, because we are * We initialize the MECR to default values here, because we are
* not guaranteed to see a SetIOMap operation at runtime. * not guaranteed to see a SetIOMap operation at runtime.
...@@ -1019,7 +1018,7 @@ int sa1100_register_pcmcia(struct pcmcia_low_level *ops) ...@@ -1019,7 +1018,7 @@ int sa1100_register_pcmcia(struct pcmcia_low_level *ops)
goto out_err; goto out_err;
} }
sa1100_pcmcia_set_mecr( i ); sa1100_pcmcia_set_mecr(i, cpu_clock);
} }
...@@ -1110,7 +1109,7 @@ static int __init sa1100_pcmcia_init(void) ...@@ -1110,7 +1109,7 @@ static int __init sa1100_pcmcia_init(void)
servinfo_t info; servinfo_t info;
int ret, i; int ret, i;
printk(KERN_INFO "SA-1100 PCMCIA (CS release %s)\n", CS_RELEASE); printk(KERN_INFO "SA11x0 PCMCIA (CS release %s)\n", CS_RELEASE);
CardServices(GetCardServicesInfo, &info); CardServices(GetCardServicesInfo, &info);
if (info.Revision != CS_RELEASE_CODE) { if (info.Revision != CS_RELEASE_CODE) {
...@@ -1127,7 +1126,8 @@ static int __init sa1100_pcmcia_init(void) ...@@ -1127,7 +1126,8 @@ static int __init sa1100_pcmcia_init(void)
} }
#ifdef CONFIG_CPU_FREQ #ifdef CONFIG_CPU_FREQ
ret = cpufreq_register_notifier(&sa1100_pcmcia_notifier_block); ret = cpufreq_register_notifier(&sa1100_pcmcia_notifier_block,
CPUFREQ_TRANSITION_NOTIFIER);
if (ret < 0) { if (ret < 0) {
printk(KERN_ERR "Unable to register CPU frequency change " printk(KERN_ERR "Unable to register CPU frequency change "
"notifier (%d)\n", ret); "notifier (%d)\n", ret);
...@@ -1135,15 +1135,9 @@ static int __init sa1100_pcmcia_init(void) ...@@ -1135,15 +1135,9 @@ static int __init sa1100_pcmcia_init(void)
} }
#endif #endif
#ifdef CONFIG_SA1100_ADSBITSY
pcmcia_adsbitsy_init();
#endif
#ifdef CONFIG_SA1100_ASSABET #ifdef CONFIG_SA1100_ASSABET
pcmcia_assabet_init(); pcmcia_assabet_init();
#endif #endif
#ifdef CONFIG_SA1100_BADGE4
pcmcia_badge4_init();
#endif
#ifdef CONFIG_SA1100_CERF #ifdef CONFIG_SA1100_CERF
pcmcia_cerf_init(); pcmcia_cerf_init();
#endif #endif
...@@ -1156,24 +1150,9 @@ static int __init sa1100_pcmcia_init(void) ...@@ -1156,24 +1150,9 @@ static int __init sa1100_pcmcia_init(void)
#ifdef CONFIG_SA1100_GRAPHICSCLIENT #ifdef CONFIG_SA1100_GRAPHICSCLIENT
pcmcia_gcplus_init(); pcmcia_gcplus_init();
#endif #endif
#ifdef CONFIG_SA1100_GRAPHICSMASTER
pcmcia_graphicsmaster_init();
#endif
#ifdef CONFIG_SA1100_JORNADA720
pcmcia_jornada720_init();
#endif
#ifdef CONFIG_ASSABET_NEPONSET
pcmcia_neponset_init();
#endif
#ifdef CONFIG_SA1100_PANGOLIN #ifdef CONFIG_SA1100_PANGOLIN
pcmcia_pangolin_init(); pcmcia_pangolin_init();
#endif #endif
#ifdef CONFIG_SA1100_PFS168
pcmcia_pfs_init();
#endif
#ifdef CONFIG_SA1100_PT_SYSTEM3
pcmcia_system3_init();
#endif
#ifdef CONFIG_SA1100_SHANNON #ifdef CONFIG_SA1100_SHANNON
pcmcia_shannon_init(); pcmcia_shannon_init();
#endif #endif
...@@ -1186,9 +1165,6 @@ static int __init sa1100_pcmcia_init(void) ...@@ -1186,9 +1165,6 @@ static int __init sa1100_pcmcia_init(void)
#ifdef CONFIG_SA1100_TRIZEPS #ifdef CONFIG_SA1100_TRIZEPS
pcmcia_trizeps_init(); pcmcia_trizeps_init();
#endif #endif
#ifdef CONFIG_SA1100_XP860
pcmcia_xp860_init();
#endif
#ifdef CONFIG_SA1100_YOPY #ifdef CONFIG_SA1100_YOPY
pcmcia_yopy_init(); pcmcia_yopy_init();
#endif #endif
...@@ -1203,15 +1179,9 @@ static int __init sa1100_pcmcia_init(void) ...@@ -1203,15 +1179,9 @@ static int __init sa1100_pcmcia_init(void)
*/ */
static void __exit sa1100_pcmcia_exit(void) static void __exit sa1100_pcmcia_exit(void)
{ {
#ifdef CONFIG_SA1100_ADSBITSY
pcmcia_adsbitsy_exit();
#endif
#ifdef CONFIG_SA1100_ASSABET #ifdef CONFIG_SA1100_ASSABET
pcmcia_assabet_exit(); pcmcia_assabet_exit();
#endif #endif
#ifdef CONFIG_SA1100_BADGE4
pcmcia_badge4_exit();
#endif
#ifdef CONFIG_SA1100_CERF #ifdef CONFIG_SA1100_CERF
pcmcia_cerf_exit(); pcmcia_cerf_exit();
#endif #endif
...@@ -1224,21 +1194,9 @@ static void __exit sa1100_pcmcia_exit(void) ...@@ -1224,21 +1194,9 @@ static void __exit sa1100_pcmcia_exit(void)
#ifdef CONFIG_SA1100_GRAPHICSCLIENT #ifdef CONFIG_SA1100_GRAPHICSCLIENT
pcmcia_gcplus_exit(); pcmcia_gcplus_exit();
#endif #endif
#ifdef CONFIG_SA1100_GRAPHICSMASTER
pcmcia_graphicsmaster_exit();
#endif
#ifdef CONFIG_SA1100_JORNADA720
pcmcia_jornada720_exit();
#endif
#ifdef CONFIG_ASSABET_NEPONSET
pcmcia_neponset_exit();
#endif
#ifdef CONFIG_SA1100_PANGOLIN #ifdef CONFIG_SA1100_PANGOLIN
pcmcia_pangolin_exit(); pcmcia_pangolin_exit();
#endif #endif
#ifdef CONFIG_SA1100_PFS168
pcmcia_pfs_exit();
#endif
#ifdef CONFIG_SA1100_SHANNON #ifdef CONFIG_SA1100_SHANNON
pcmcia_shannon_exit(); pcmcia_shannon_exit();
#endif #endif
...@@ -1248,9 +1206,6 @@ static void __exit sa1100_pcmcia_exit(void) ...@@ -1248,9 +1206,6 @@ static void __exit sa1100_pcmcia_exit(void)
#ifdef CONFIG_SA1100_STORK #ifdef CONFIG_SA1100_STORK
pcmcia_stork_exit(); pcmcia_stork_exit();
#endif #endif
#ifdef CONFIG_SA1100_XP860
pcmcia_xp860_exit();
#endif
#ifdef CONFIG_SA1100_YOPY #ifdef CONFIG_SA1100_YOPY
pcmcia_yopy_exit(); pcmcia_yopy_exit();
#endif #endif
...@@ -1261,7 +1216,7 @@ static void __exit sa1100_pcmcia_exit(void) ...@@ -1261,7 +1216,7 @@ static void __exit sa1100_pcmcia_exit(void)
} }
#ifdef CONFIG_CPU_FREQ #ifdef CONFIG_CPU_FREQ
cpufreq_unregister_notifier(&sa1100_pcmcia_notifier_block); cpufreq_unregister_notifier(&sa1100_pcmcia_notifier_block, CPUFREQ_TRANSITION_NOTIFIER);
#endif #endif
} }
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/mach-types.h>
#include "sa1100_generic.h" #include "sa1100_generic.h"
#include "sa1111_generic.h" #include "sa1111_generic.h"
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/mach-types.h>
#include "sa1100_generic.h" #include "sa1100_generic.h"
#include "sa1111_generic.h" #include "sa1111_generic.h"
......
...@@ -10,33 +10,16 @@ ...@@ -10,33 +10,16 @@
#include <linux/init.h> #include <linux/init.h>
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/arch/assabet.h> #include <asm/mach-types.h>
#include <asm/arch/neponset.h>
#include <asm/hardware/sa1111.h> #include <asm/hardware/sa1111.h>
#include "sa1100_generic.h" #include "sa1100_generic.h"
#include "sa1111_generic.h" #include "sa1111_generic.h"
static int neponset_pcmcia_init(struct pcmcia_init *init) /*
{ * Neponset uses the Maxim MAX1600, with the following connections:
/* Set GPIO_A<3:0> to be outputs for PCMCIA/CF power controller: */ *
PA_DDR &= ~(GPIO_GPIO0 | GPIO_GPIO1 | GPIO_GPIO2 | GPIO_GPIO3);
/* MAX1600 to standby mode: */
PA_DWR &= ~(GPIO_GPIO0 | GPIO_GPIO1 | GPIO_GPIO2 | GPIO_GPIO3);
NCR_0 &= ~(NCR_A0VPP | NCR_A1VPP);
return sa1111_pcmcia_init(init);
}
static int
neponset_pcmcia_configure_socket(const struct pcmcia_configure *conf)
{
unsigned int ncr_mask, pa_dwr_mask;
unsigned int ncr_set, pa_dwr_set;
int ret;
/* Neponset uses the Maxim MAX1600, with the following connections:
* MAX1600 Neponset * MAX1600 Neponset
* *
* A0VCC SA-1111 GPIO A<1> * A0VCC SA-1111 GPIO A<1>
...@@ -58,6 +41,29 @@ neponset_pcmcia_configure_socket(const struct pcmcia_configure *conf) ...@@ -58,6 +41,29 @@ neponset_pcmcia_configure_socket(const struct pcmcia_configure *conf)
* the corresponding truth table. * the corresponding truth table.
*/ */
static int neponset_pcmcia_init(struct pcmcia_init *init)
{
NCR_0 &= ~(NCR_A0VPP | NCR_A1VPP);
/*
* Set GPIO_A<3:0> to be outputs for the MAX1600,
* and switch to standby mode.
*/
PA_DDR = 0;
PA_SDR = 0;
PA_DWR = 0;
PA_SSR = 0;
return sa1111_pcmcia_init(init);
}
static int
neponset_pcmcia_configure_socket(const struct pcmcia_configure *conf)
{
unsigned int ncr_mask, pa_dwr_mask;
unsigned int ncr_set, pa_dwr_set;
int ret;
switch (conf->sock) { switch (conf->sock) {
case 0: case 0:
pa_dwr_mask = GPIO_GPIO0 | GPIO_GPIO1; pa_dwr_mask = GPIO_GPIO0 | GPIO_GPIO1;
...@@ -135,13 +141,13 @@ int __init pcmcia_neponset_init(void) ...@@ -135,13 +141,13 @@ int __init pcmcia_neponset_init(void)
{ {
int ret = -ENODEV; int ret = -ENODEV;
if (machine_is_assabet() && sa1111) if (machine_is_assabet())
ret = sa1100_register_pcmcia(&neponset_pcmcia_ops); ret = sa1100_register_pcmcia(&neponset_pcmcia_ops);
return ret; return ret;
} }
void __exit pcmcia_neponset_exit(void) void __devexit pcmcia_neponset_exit(void)
{ {
sa1100_unregister_pcmcia(&neponset_pcmcia_ops); sa1100_unregister_pcmcia(&neponset_pcmcia_ops);
} }
...@@ -7,10 +7,11 @@ ...@@ -7,10 +7,11 @@
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/delay.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/delay.h>
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/mach-types.h>
#include <asm/irq.h> #include <asm/irq.h>
#include "sa1100_generic.h" #include "sa1100_generic.h"
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <linux/ioport.h> #include <linux/ioport.h>
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/mach-types.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/hardware/sa1111.h> #include <asm/hardware/sa1111.h>
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/mach-types.h>
#include <asm/irq.h> #include <asm/irq.h>
#include "sa1100_generic.h" #include "sa1100_generic.h"
......
...@@ -5,10 +5,12 @@ ...@@ -5,10 +5,12 @@
* basically means we handle everything except controlling the * basically means we handle everything except controlling the
* power. Power is machine specific... * power. Power is machine specific...
*/ */
#include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/init.h>
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/hardware/sa1111.h> #include <asm/hardware/sa1111.h>
...@@ -21,19 +23,18 @@ static struct irqs { ...@@ -21,19 +23,18 @@ static struct irqs {
int irq; int irq;
const char *str; const char *str;
} irqs[] = { } irqs[] = {
{ S0_CD_VALID, "SA1111 PCMCIA card detect" }, { IRQ_S0_CD_VALID, "SA1111 PCMCIA card detect" },
{ S0_BVD1_STSCHG, "SA1111 PCMCIA BVD1" }, { IRQ_S0_BVD1_STSCHG, "SA1111 PCMCIA BVD1" },
{ S1_CD_VALID, "SA1111 CF card detect" }, { IRQ_S1_CD_VALID, "SA1111 CF card detect" },
{ S1_BVD1_STSCHG, "SA1111 CF BVD1" }, { IRQ_S1_BVD1_STSCHG, "SA1111 CF BVD1" },
}; };
static struct sa1111_dev *pcmcia;
int sa1111_pcmcia_init(struct pcmcia_init *init) int sa1111_pcmcia_init(struct pcmcia_init *init)
{ {
int i, ret; int i, ret;
if (!request_mem_region(_PCCR, 512, "PCMCIA"))
return -1;
for (i = ret = 0; i < ARRAY_SIZE(irqs); i++) { for (i = ret = 0; i < ARRAY_SIZE(irqs); i++) {
set_irq_type(irqs[i].irq, IRQT_FALLING); set_irq_type(irqs[i].irq, IRQT_FALLING);
ret = request_irq(irqs[i].irq, init->handler, SA_INTERRUPT, ret = request_irq(irqs[i].irq, init->handler, SA_INTERRUPT,
...@@ -47,8 +48,6 @@ int sa1111_pcmcia_init(struct pcmcia_init *init) ...@@ -47,8 +48,6 @@ int sa1111_pcmcia_init(struct pcmcia_init *init)
irqs[i].irq, ret); irqs[i].irq, ret);
while (i--) while (i--)
free_irq(irqs[i].irq, NULL); free_irq(irqs[i].irq, NULL);
release_mem_region(_PCCR, 16);
} }
return ret ? -1 : 2; return ret ? -1 : 2;
...@@ -61,8 +60,6 @@ int sa1111_pcmcia_shutdown(void) ...@@ -61,8 +60,6 @@ int sa1111_pcmcia_shutdown(void)
for (i = 0; i < ARRAY_SIZE(irqs); i++) for (i = 0; i < ARRAY_SIZE(irqs); i++)
free_irq(irqs[i].irq, NULL); free_irq(irqs[i].irq, NULL);
release_mem_region(_PCCR, 512);
return 0; return 0;
} }
...@@ -73,7 +70,7 @@ int sa1111_pcmcia_socket_state(struct pcmcia_state_array *state) ...@@ -73,7 +70,7 @@ int sa1111_pcmcia_socket_state(struct pcmcia_state_array *state)
if (state->size < 2) if (state->size < 2)
return -1; return -1;
status = PCSR; status = sa1111_readl(pcmcia->mapbase + SA1111_PCSR);
state->state[0].detect = status & PCSR_S0_DETECT ? 0 : 1; state->state[0].detect = status & PCSR_S0_DETECT ? 0 : 1;
state->state[0].ready = status & PCSR_S0_READY ? 1 : 0; state->state[0].ready = status & PCSR_S0_READY ? 1 : 0;
...@@ -99,8 +96,8 @@ int sa1111_pcmcia_get_irq_info(struct pcmcia_irq_info *info) ...@@ -99,8 +96,8 @@ int sa1111_pcmcia_get_irq_info(struct pcmcia_irq_info *info)
int ret = 0; int ret = 0;
switch (info->sock) { switch (info->sock) {
case 0: info->irq = S0_READY_NINT; break; case 0: info->irq = IRQ_S0_READY_NINT; break;
case 1: info->irq = S1_READY_NINT; break; case 1: info->irq = IRQ_S1_READY_NINT; break;
default: ret = 1; default: ret = 1;
} }
...@@ -109,7 +106,7 @@ int sa1111_pcmcia_get_irq_info(struct pcmcia_irq_info *info) ...@@ -109,7 +106,7 @@ int sa1111_pcmcia_get_irq_info(struct pcmcia_irq_info *info)
int sa1111_pcmcia_configure_socket(const struct pcmcia_configure *conf) int sa1111_pcmcia_configure_socket(const struct pcmcia_configure *conf)
{ {
unsigned int rst, flt, wait, pse, irq, pccr_mask; unsigned int rst, flt, wait, pse, irq, pccr_mask, val;
unsigned long flags; unsigned long flags;
switch (conf->sock) { switch (conf->sock) {
...@@ -118,7 +115,7 @@ int sa1111_pcmcia_configure_socket(const struct pcmcia_configure *conf) ...@@ -118,7 +115,7 @@ int sa1111_pcmcia_configure_socket(const struct pcmcia_configure *conf)
flt = PCCR_S0_FLT; flt = PCCR_S0_FLT;
wait = PCCR_S0_PWAITEN; wait = PCCR_S0_PWAITEN;
pse = PCCR_S0_PSE; pse = PCCR_S0_PSE;
irq = S0_READY_NINT; irq = IRQ_S0_READY_NINT;
break; break;
case 1: case 1:
...@@ -126,7 +123,7 @@ int sa1111_pcmcia_configure_socket(const struct pcmcia_configure *conf) ...@@ -126,7 +123,7 @@ int sa1111_pcmcia_configure_socket(const struct pcmcia_configure *conf)
flt = PCCR_S1_FLT; flt = PCCR_S1_FLT;
wait = PCCR_S1_PWAITEN; wait = PCCR_S1_PWAITEN;
pse = PCCR_S1_PSE; pse = PCCR_S1_PSE;
irq = S1_READY_NINT; irq = IRQ_S1_READY_NINT;
break; break;
default: default:
...@@ -159,7 +156,9 @@ int sa1111_pcmcia_configure_socket(const struct pcmcia_configure *conf) ...@@ -159,7 +156,9 @@ int sa1111_pcmcia_configure_socket(const struct pcmcia_configure *conf)
pccr_mask |= flt; pccr_mask |= flt;
local_irq_save(flags); local_irq_save(flags);
PCCR = (PCCR & ~(pse | flt | wait | rst)) | pccr_mask; val = sa1111_readl(pcmcia->mapbase + SA1111_PCCR);
val = (val & ~(pse | flt | wait | rst)) | pccr_mask;
sa1111_writel(val, pcmcia->mapbase + SA1111_PCCR);
local_irq_restore(flags); local_irq_restore(flags);
if (conf->irq) if (conf->irq)
...@@ -179,3 +178,130 @@ int sa1111_pcmcia_socket_suspend(int sock) ...@@ -179,3 +178,130 @@ int sa1111_pcmcia_socket_suspend(int sock)
{ {
return 0; return 0;
} }
static int pcmcia_probe(struct device *dev)
{
struct sa1111_dev *sadev = SA1111_DEV(dev);
unsigned long flags;
char *base;
local_irq_save(flags);
if (pcmcia) {
local_irq_restore(flags);
return -EBUSY;
}
pcmcia = sadev;
local_irq_restore(flags);
if (!request_mem_region(sadev->res.start, 512,
SA1111_DRIVER_NAME(sadev)))
return -EBUSY;
base = sadev->mapbase;
/*
* Initialise the suspend state.
*/
sa1111_writel(PCSSR_S0_SLEEP | PCSSR_S1_SLEEP, base + SA1111_PCSSR);
sa1111_writel(PCCR_S0_FLT | PCCR_S1_FLT, base + SA1111_PCCR);
#ifdef CONFIG_SA1100_ADSBITSY
pcmcia_adsbitsy_init();
#endif
#ifdef CONFIG_SA1100_BADGE4
pcmcia_badge4_init();
#endif
#ifdef CONFIG_SA1100_GRAPHICSMASTER
pcmcia_graphicsmaster_init();
#endif
#ifdef CONFIG_SA1100_JORNADA720
pcmcia_jornada720_init();
#endif
#ifdef CONFIG_ASSABET_NEPONSET
pcmcia_neponset_init();
#endif
#ifdef CONFIG_SA1100_PFS168
pcmcia_pfs_init();
#endif
#ifdef CONFIG_SA1100_PT_SYSTEM3
pcmcia_system3_init();
#endif
#ifdef CONFIG_SA1100_XP860
pcmcia_xp860_init();
#endif
return 0;
}
static int __devexit pcmcia_remove(struct device *dev)
{
struct sa1111_dev *sadev = SA1111_DEV(dev);
#ifdef CONFIG_SA1100_ADSBITSY
pcmcia_adsbitsy_exit();
#endif
#ifdef CONFIG_SA1100_BADGE4
pcmcia_badge4_exit();
#endif
#ifdef CONFIG_SA1100_GRAPHICSMASTER
pcmcia_graphicsmaster_exit();
#endif
#ifdef CONFIG_SA1100_JORNADA720
pcmcia_jornada720_exit();
#endif
#ifdef CONFIG_ASSABET_NEPONSET
pcmcia_neponset_exit();
#endif
#ifdef CONFIG_SA1100_PFS168
pcmcia_pfs_exit();
#endif
#ifdef CONFIG_SA1100_PT_SYSTEM3
pcmcia_system3_exit();
#endif
#ifdef CONFIG_SA1100_XP860
pcmcia_xp860_exit();
#endif
release_mem_region(sadev->res.start, 512);
pcmcia = NULL;
return 0;
}
static int pcmcia_suspend(struct device *dev, u32 state, u32 level)
{
return 0;
}
static int pcmcia_resume(struct device *dev, u32 level)
{
return 0;
}
static struct sa1111_driver pcmcia_driver = {
.drv = {
.name = "SA1111 PCMCIA",
.bus = &sa1111_bus_type,
.probe = pcmcia_probe,
.remove = __devexit_p(pcmcia_remove),
.suspend = pcmcia_suspend,
.resume = pcmcia_resume,
},
.devid = SA1111_DEVID_PCMCIA,
};
static int __init sa1111_drv_pcmcia_init(void)
{
return driver_register(&pcmcia_driver.drv);
}
static void __exit sa1111_drv_pcmcia_exit(void)
{
remove_driver(&pcmcia_driver.drv);
}
module_init(sa1111_drv_pcmcia_init);
module_exit(sa1111_drv_pcmcia_exit);
MODULE_DESCRIPTION("SA1111 PCMCIA card socket driver");
MODULE_LICENSE("GPL");
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
static void sa1111_start_hc(void) static void sa1111_start_hc(struct sa1111_dev *dev)
{ {
unsigned int usb_rst = 0; unsigned int usb_rst = 0;
...@@ -48,31 +48,35 @@ static void sa1111_start_hc(void) ...@@ -48,31 +48,35 @@ static void sa1111_start_hc(void)
* Configure the power sense and control lines. Place the USB * Configure the power sense and control lines. Place the USB
* host controller in reset. * host controller in reset.
*/ */
USB_RESET = usb_rst | USB_RESET_FORCEIFRESET | USB_RESET_FORCEHCRESET; sa1111_writel(usb_rst | USB_RESET_FORCEIFRESET | USB_RESET_FORCEHCRESET,
dev->mapbase + SA1111_USB_RESET);
/* /*
* Now, carefully enable the USB clock, and take * Now, carefully enable the USB clock, and take
* the USB host controller out of reset. * the USB host controller out of reset.
*/ */
SKPCR |= SKPCR_UCLKEN; sa1111_enable_device(dev);
udelay(11); udelay(11);
USB_RESET = usb_rst; sa1111_writel(usb_rst, dev->mapbase + SA1111_USB_RESET);
} }
static void sa1111_stop_hc(void) static void sa1111_stop_hc(struct sa1111_dev *dev)
{ {
unsigned int usb_rst;
printk(KERN_DEBUG __FILE__ printk(KERN_DEBUG __FILE__
": stopping SA-1111 OHCI USB Controller\n"); ": stopping SA-1111 OHCI USB Controller\n");
/* /*
* Put the USB host controller into reset. * Put the USB host controller into reset.
*/ */
USB_RESET |= USB_RESET_FORCEIFRESET | USB_RESET_FORCEHCRESET; usb_rst = sa1111_readl(dev->mapbase + SA1111_USB_RESET);
sa1111_writel(usb_rst | USB_RESET_FORCEIFRESET | USB_RESET_FORCEHCRESET,
dev->mapbase + SA1111_USB_RESET);
/* /*
* Stop the USB clock. * Stop the USB clock.
*/ */
SKPCR &= ~SKPCR_UCLKEN; sa1111_disable_device(dev);
#ifdef CONFIG_SA1100_BADGE4 #ifdef CONFIG_SA1100_BADGE4
if (machine_is_badge4()) { if (machine_is_badge4()) {
...@@ -86,9 +90,9 @@ static void sa1111_stop_hc(void) ...@@ -86,9 +90,9 @@ static void sa1111_stop_hc(void)
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
#if 0 #if 0
static void dump_hci_status(const char *label) static void dump_hci_status(struct usb_hcd *hcd, const char *label)
{ {
unsigned long status = USB_STATUS; unsigned long status = sa1111_readl(hcd->regs + SA1111_USB_STATUS);
dbg ("%s USB_STATUS = { %s%s%s%s%s}", label, dbg ("%s USB_STATUS = { %s%s%s%s%s}", label,
((status & USB_STATUS_IRQHCIRMTWKUP) ? "IRQHCIRMTWKUP " : ""), ((status & USB_STATUS_IRQHCIRMTWKUP) ? "IRQHCIRMTWKUP " : ""),
...@@ -101,11 +105,14 @@ static void dump_hci_status(const char *label) ...@@ -101,11 +105,14 @@ static void dump_hci_status(const char *label)
static void usb_hcd_sa1111_hcim_irq (int irq, void *__hcd, struct pt_regs * r) static void usb_hcd_sa1111_hcim_irq (int irq, void *__hcd, struct pt_regs * r)
{ {
//dump_hci_status("irq"); struct usb_hcd *hcd = __hcd;
// unsigned long status = sa1111_readl(hcd->regs + SA1111_USB_STATUS);
//dump_hci_status(hcd, "irq");
#if 0 #if 0
/* may work better this way -- need to investigate further */ /* may work better this way -- need to investigate further */
if (USB_STATUS & USB_STATUS_NIRQHCIM) { if (status & USB_STATUS_NIRQHCIM) {
//dbg ("not normal HC interrupt; ignoring"); //dbg ("not normal HC interrupt; ignoring");
return; return;
} }
...@@ -116,7 +123,7 @@ static void usb_hcd_sa1111_hcim_irq (int irq, void *__hcd, struct pt_regs * r) ...@@ -116,7 +123,7 @@ static void usb_hcd_sa1111_hcim_irq (int irq, void *__hcd, struct pt_regs * r)
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
void usb_hcd_sa1111_remove (struct usb_hcd *); void usb_hcd_sa1111_remove (struct usb_hcd *, struct sa1111_dev *);
/* configure so an HC device and id are always provided */ /* configure so an HC device and id are always provided */
/* always called with process context; sleeping is OK */ /* always called with process context; sleeping is OK */
...@@ -132,21 +139,20 @@ void usb_hcd_sa1111_remove (struct usb_hcd *); ...@@ -132,21 +139,20 @@ void usb_hcd_sa1111_remove (struct usb_hcd *);
* *
* Store this function in the HCD's struct pci_driver as probe(). * Store this function in the HCD's struct pci_driver as probe().
*/ */
int usb_hcd_sa1111_probe (const struct hc_driver *driver, struct usb_hcd **hcd_out) int usb_hcd_sa1111_probe (const struct hc_driver *driver,
struct usb_hcd **hcd_out,
struct sa1111_dev *dev)
{ {
int retval; int retval;
struct usb_hcd *hcd = 0; struct usb_hcd *hcd = 0;
if (!sa1111) if (!request_mem_region(dev->res.start,
return -ENODEV; dev->res.end - dev->res.start + 1, hcd_name)) {
if (!request_mem_region(_USB_OHCI_OP_BASE,
_USB_EXTENT, hcd_name)) {
dbg("request_mem_region failed"); dbg("request_mem_region failed");
return -EBUSY; return -EBUSY;
} }
sa1111_start_hc(); sa1111_start_hc(dev);
hcd = driver->hcd_alloc (); hcd = driver->hcd_alloc ();
if (hcd == NULL){ if (hcd == NULL){
...@@ -157,9 +163,10 @@ int usb_hcd_sa1111_probe (const struct hc_driver *driver, struct usb_hcd **hcd_o ...@@ -157,9 +163,10 @@ int usb_hcd_sa1111_probe (const struct hc_driver *driver, struct usb_hcd **hcd_o
hcd->driver = (struct hc_driver *) driver; hcd->driver = (struct hc_driver *) driver;
hcd->description = driver->description; hcd->description = driver->description;
hcd->irq = NIRQHCIM; hcd->irq = dev->irq[1];
hcd->regs = (void *) &USB_OHCI_OP_BASE; hcd->regs = dev->mapbase;
hcd->pdev = SA1111_FAKE_PCIDEV; hcd->pdev = SA1111_FAKE_PCIDEV;
hcd->parent = &dev->dev;
retval = hcd_buffer_create (hcd); retval = hcd_buffer_create (hcd);
if (retval != 0) { if (retval != 0) {
...@@ -167,8 +174,8 @@ int usb_hcd_sa1111_probe (const struct hc_driver *driver, struct usb_hcd **hcd_o ...@@ -167,8 +174,8 @@ int usb_hcd_sa1111_probe (const struct hc_driver *driver, struct usb_hcd **hcd_o
goto err1; goto err1;
} }
set_irq_type(NIRQHCIM, IRQT_RISING); set_irq_type(hcd->irq, IRQT_RISING);
retval = request_irq (NIRQHCIM, usb_hcd_sa1111_hcim_irq, SA_INTERRUPT, retval = request_irq (hcd->irq, usb_hcd_sa1111_hcim_irq, SA_INTERRUPT,
hcd->description, hcd); hcd->description, hcd);
if (retval != 0) { if (retval != 0) {
dbg("request_irq failed"); dbg("request_irq failed");
...@@ -191,7 +198,7 @@ int usb_hcd_sa1111_probe (const struct hc_driver *driver, struct usb_hcd **hcd_o ...@@ -191,7 +198,7 @@ int usb_hcd_sa1111_probe (const struct hc_driver *driver, struct usb_hcd **hcd_o
if ((retval = driver->start (hcd)) < 0) if ((retval = driver->start (hcd)) < 0)
{ {
usb_hcd_sa1111_remove(hcd); usb_hcd_sa1111_remove(hcd, dev);
return retval; return retval;
} }
...@@ -202,8 +209,8 @@ int usb_hcd_sa1111_probe (const struct hc_driver *driver, struct usb_hcd **hcd_o ...@@ -202,8 +209,8 @@ int usb_hcd_sa1111_probe (const struct hc_driver *driver, struct usb_hcd **hcd_o
hcd_buffer_destroy (hcd); hcd_buffer_destroy (hcd);
if (hcd) driver->hcd_free(hcd); if (hcd) driver->hcd_free(hcd);
err1: err1:
sa1111_stop_hc(); sa1111_stop_hc(dev);
release_mem_region(_USB_OHCI_OP_BASE, _USB_EXTENT); release_mem_region(dev->res.start, dev->res.end - dev->res.start + 1);
return retval; return retval;
} }
...@@ -221,7 +228,7 @@ int usb_hcd_sa1111_probe (const struct hc_driver *driver, struct usb_hcd **hcd_o ...@@ -221,7 +228,7 @@ int usb_hcd_sa1111_probe (const struct hc_driver *driver, struct usb_hcd **hcd_o
* context, normally "rmmod", "apmd", or something similar. * context, normally "rmmod", "apmd", or something similar.
* *
*/ */
void usb_hcd_sa1111_remove (struct usb_hcd *hcd) void usb_hcd_sa1111_remove (struct usb_hcd *hcd, struct sa1111_dev *dev)
{ {
struct usb_device *hub; struct usb_device *hub;
void *base; void *base;
...@@ -244,13 +251,13 @@ void usb_hcd_sa1111_remove (struct usb_hcd *hcd) ...@@ -244,13 +251,13 @@ void usb_hcd_sa1111_remove (struct usb_hcd *hcd)
usb_deregister_bus (&hcd->self); usb_deregister_bus (&hcd->self);
if (atomic_read (&hcd->self.refcnt) != 1) if (atomic_read (&hcd->self.refcnt) != 1)
err (__FUNCTION__ ": %s, count != 1", hcd->self.bus_name); err ("%s: %s, count != 1", __FUNCTION__, hcd->self.bus_name);
base = hcd->regs; base = hcd->regs;
hcd->driver->hcd_free (hcd); hcd->driver->hcd_free (hcd);
sa1111_stop_hc(); sa1111_stop_hc(dev);
release_mem_region(_USB_OHCI_OP_BASE, _USB_EXTENT); release_mem_region(dev->res.start, dev->res.end - dev->res.start + 1);
} }
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
...@@ -275,7 +282,7 @@ ohci_sa1111_start (struct usb_hcd *hcd) ...@@ -275,7 +282,7 @@ ohci_sa1111_start (struct usb_hcd *hcd)
} }
ohci->regs = hcd->regs; ohci->regs = hcd->regs;
ohci->parent_dev = &sa1111->dev; ohci->parent_dev = hcd->parent;
if (hc_reset (ohci) < 0) { if (hc_reset (ohci) < 0) {
ohci_stop (hcd); ohci_stop (hcd);
...@@ -342,8 +349,53 @@ static const struct hc_driver ohci_sa1111_hc_driver = { ...@@ -342,8 +349,53 @@ static const struct hc_driver ohci_sa1111_hc_driver = {
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
/* Only one SA-1111 ever exists. */ static int ohci_hcd_sa1111_drv_probe(struct device *_dev)
static struct usb_hcd *the_sa1111_hcd; {
struct sa1111_dev *dev = SA1111_DEV(_dev);
struct usb_hcd *hcd = NULL;
int ret;
ret = usb_hcd_sa1111_probe(&ohci_sa1111_hc_driver, &hcd, dev);
if (ret == 0)
dev->dev.driver_data = hcd;
return ret;
}
static int ohci_hcd_sa1111_drv_remove(struct device *_dev)
{
struct sa1111_dev *dev = SA1111_DEV(_dev);
struct usb_hcd *hcd = dev->dev.driver_data;
usb_hcd_sa1111_remove(hcd, dev);
dev->dev.driver_data = NULL;
return 0;
}
static int ohci_hcd_sa1111_drv_suspend(struct device *dev, u32 state, u32 level)
{
return 0;
}
static int ohci_hcd_sa1111_drv_resume(struct device *dev, u32 level)
{
return 0;
}
static struct sa1111_driver ohci_hcd_sa1111_driver = {
.drv = {
.name = "SA1111 OHCI",
.bus = &sa1111_bus_type,
.probe = ohci_hcd_sa1111_drv_probe,
.remove = ohci_hcd_sa1111_drv_remove,
.suspend = ohci_hcd_sa1111_drv_suspend,
.resume = ohci_hcd_sa1111_drv_resume,
},
.devid = SA1111_DEVID_USB,
};
static int __init ohci_hcd_sa1111_init (void) static int __init ohci_hcd_sa1111_init (void)
{ {
...@@ -351,17 +403,13 @@ static int __init ohci_hcd_sa1111_init (void) ...@@ -351,17 +403,13 @@ static int __init ohci_hcd_sa1111_init (void)
dbg ("block sizes: ed %d td %d", dbg ("block sizes: ed %d td %d",
sizeof (struct ed), sizeof (struct td)); sizeof (struct ed), sizeof (struct td));
the_sa1111_hcd = 0; return driver_register(&ohci_hcd_sa1111_driver.drv);
return usb_hcd_sa1111_probe(&ohci_sa1111_hc_driver, &the_sa1111_hcd);
} }
module_init (ohci_hcd_sa1111_init);
static void __exit ohci_hcd_sa1111_cleanup (void) static void __exit ohci_hcd_sa1111_cleanup (void)
{ {
if (the_sa1111_hcd) { remove_driver(&ohci_hcd_sa1111_driver.drv);
usb_hcd_sa1111_remove(the_sa1111_hcd);
the_sa1111_hcd = 0;
}
} }
module_init (ohci_hcd_sa1111_init);
module_exit (ohci_hcd_sa1111_cleanup); module_exit (ohci_hcd_sa1111_cleanup);
This diff is collapsed.
...@@ -107,7 +107,8 @@ struct sa1100fb_info { ...@@ -107,7 +107,8 @@ struct sa1100fb_info {
struct pm_dev *pm; struct pm_dev *pm;
#endif #endif
#ifdef CONFIG_CPU_FREQ #ifdef CONFIG_CPU_FREQ
struct notifier_block clockchg; struct notifier_block freq_transition;
struct notifier_block freq_policy;
#endif #endif
}; };
......
...@@ -26,6 +26,11 @@ ...@@ -26,6 +26,11 @@
/* generalized support for H3xxx series Compaq Pocket PC's */ /* generalized support for H3xxx series Compaq Pocket PC's */
#define machine_is_h3xxx() (machine_is_h3100() || machine_is_h3600() || machine_is_h3800()) #define machine_is_h3xxx() (machine_is_h3100() || machine_is_h3600() || machine_is_h3800())
/* Physical memory regions corresponding to chip selects */
#define H3600_EGPIO_PHYS (SA1100_CS5_PHYS + 0x01000000)
#define H3600_BANK_2_PHYS SA1100_CS2_PHYS
#define H3600_BANK_4_PHYS SA1100_CS4_PHYS
/* Virtual memory regions corresponding to chip selects 2 & 4 (used on sleeves) */ /* Virtual memory regions corresponding to chip selects 2 & 4 (used on sleeves) */
#define H3600_EGPIO_VIRT 0xf0000000 #define H3600_EGPIO_VIRT 0xf0000000
#define H3600_BANK_2_VIRT 0xf1000000 #define H3600_BANK_2_VIRT 0xf1000000
...@@ -37,7 +42,6 @@ ...@@ -37,7 +42,6 @@
*/ */
#define GPIO_H3600_NPOWER_BUTTON GPIO_GPIO (0) /* Also known as the "off button" */ #define GPIO_H3600_NPOWER_BUTTON GPIO_GPIO (0) /* Also known as the "off button" */
#define GPIO_H3600_MICROCONTROLLER GPIO_GPIO (1) /* From ASIC2 on H3800 */
#define GPIO_H3600_PCMCIA_CD1 GPIO_GPIO (10) #define GPIO_H3600_PCMCIA_CD1 GPIO_GPIO (10)
#define GPIO_H3600_PCMCIA_IRQ1 GPIO_GPIO (11) #define GPIO_H3600_PCMCIA_IRQ1 GPIO_GPIO (11)
...@@ -57,7 +61,6 @@ ...@@ -57,7 +61,6 @@
#define GPIO_H3600_COM_RTS GPIO_GPIO (26) #define GPIO_H3600_COM_RTS GPIO_GPIO (26)
#define IRQ_GPIO_H3600_NPOWER_BUTTON IRQ_GPIO0 #define IRQ_GPIO_H3600_NPOWER_BUTTON IRQ_GPIO0
#define IRQ_GPIO_H3600_MICROCONTROLLER IRQ_GPIO1
#define IRQ_GPIO_H3600_PCMCIA_CD1 IRQ_GPIO10 #define IRQ_GPIO_H3600_PCMCIA_CD1 IRQ_GPIO10
#define IRQ_GPIO_H3600_PCMCIA_IRQ1 IRQ_GPIO11 #define IRQ_GPIO_H3600_PCMCIA_IRQ1 IRQ_GPIO11
#define IRQ_GPIO_H3600_PCMCIA_CD0 IRQ_GPIO17 #define IRQ_GPIO_H3600_PCMCIA_CD0 IRQ_GPIO17
...@@ -68,14 +71,9 @@ ...@@ -68,14 +71,9 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
enum ipaq_model {
IPAQ_H3100,
IPAQ_H3600,
IPAQ_H3800
};
enum ipaq_egpio_type { enum ipaq_egpio_type {
IPAQ_EGPIO_LCD_ON, /* Power to the LCD panel */ IPAQ_EGPIO_LCD_POWER, /* Power to the LCD panel */
IPAQ_EGPIO_CODEC_NRESET, /* Clear to reset the audio codec (remember to return high) */ IPAQ_EGPIO_CODEC_NRESET, /* Clear to reset the audio codec (remember to return high) */
IPAQ_EGPIO_AUDIO_ON, /* Audio power */ IPAQ_EGPIO_AUDIO_ON, /* Audio power */
IPAQ_EGPIO_QMUTE, /* Audio muting */ IPAQ_EGPIO_QMUTE, /* Audio muting */
...@@ -87,52 +85,80 @@ enum ipaq_egpio_type { ...@@ -87,52 +85,80 @@ enum ipaq_egpio_type {
IPAQ_EGPIO_IR_FSEL, /* IR speed selection 1->fast, 0->slow */ IPAQ_EGPIO_IR_FSEL, /* IR speed selection 1->fast, 0->slow */
IPAQ_EGPIO_RS232_ON, /* Maxim RS232 chip power */ IPAQ_EGPIO_RS232_ON, /* Maxim RS232 chip power */
IPAQ_EGPIO_VPP_ON, /* Turn on power to flash programming */ IPAQ_EGPIO_VPP_ON, /* Turn on power to flash programming */
IPAQ_EGPIO_LCD_ENABLE, /* Enable/disable LCD controller */
}; };
struct ipaq_model_ops { struct ipaq_model_ops {
enum ipaq_model model;
const char *generic_name; const char *generic_name;
void (*initialize)(void);
void (*control)(enum ipaq_egpio_type, int); void (*control)(enum ipaq_egpio_type, int);
unsigned long (*read)(void); unsigned long (*read)(void);
void (*blank_callback)(int blank);
int (*pm_callback)(int req); /* Primary model callback */
int (*pm_callback_aux)(int req); /* Secondary callback (used by HAL modules) */
}; };
extern struct ipaq_model_ops ipaq_model_ops; extern struct ipaq_model_ops ipaq_model_ops;
static __inline__ enum ipaq_model h3600_model( void ) { static __inline__ const char * h3600_generic_name(void)
return ipaq_model_ops.model; {
}
static __inline__ const char * h3600_generic_name( void ) {
return ipaq_model_ops.generic_name; return ipaq_model_ops.generic_name;
} }
static __inline__ void init_h3600_egpio( void ) { static __inline__ void assign_h3600_egpio(enum ipaq_egpio_type x, int level)
if (ipaq_model_ops.initialize) {
ipaq_model_ops.initialize();
}
static __inline__ void assign_h3600_egpio( enum ipaq_egpio_type x, int level ) {
if (ipaq_model_ops.control) if (ipaq_model_ops.control)
ipaq_model_ops.control(x,level); ipaq_model_ops.control(x,level);
} }
static __inline__ void clr_h3600_egpio( enum ipaq_egpio_type x ) { static __inline__ void clr_h3600_egpio(enum ipaq_egpio_type x)
{
if (ipaq_model_ops.control) if (ipaq_model_ops.control)
ipaq_model_ops.control(x,0); ipaq_model_ops.control(x,0);
} }
static __inline__ void set_h3600_egpio( enum ipaq_egpio_type x ) { static __inline__ void set_h3600_egpio(enum ipaq_egpio_type x)
{
if (ipaq_model_ops.control) if (ipaq_model_ops.control)
ipaq_model_ops.control(x,1); ipaq_model_ops.control(x,1);
} }
static __inline__ unsigned long read_h3600_egpio( void ) { static __inline__ unsigned long read_h3600_egpio(void)
{
if (ipaq_model_ops.read) if (ipaq_model_ops.read)
return ipaq_model_ops.read(); return ipaq_model_ops.read();
return 0; return 0;
} }
static __inline__ int h3600_register_blank_callback(void (*f)(int))
{
ipaq_model_ops.blank_callback = f;
return 0;
}
static __inline__ void h3600_unregister_blank_callback(void (*f)(int))
{
ipaq_model_ops.blank_callback = NULL;
}
static __inline__ int h3600_register_pm_callback(int (*f)(int))
{
ipaq_model_ops.pm_callback_aux = f;
return 0;
}
static __inline__ void h3600_unregister_pm_callback(int (*f)(int))
{
ipaq_model_ops.pm_callback_aux = NULL;
}
static __inline__ int h3600_power_management(int req)
{
if (ipaq_model_ops.pm_callback)
return ipaq_model_ops.pm_callback(req);
return 0;
}
#endif /* ASSEMBLY */ #endif /* ASSEMBLY */
#endif /* _INCLUDE_H3600_H_ */ #endif /* _INCLUDE_H3600_H_ */
...@@ -108,18 +108,18 @@ ...@@ -108,18 +108,18 @@
#define AUDDTS (IRQ_BOARD_END + 40) #define AUDDTS (IRQ_BOARD_END + 40)
#define AUDRDD (IRQ_BOARD_END + 41) #define AUDRDD (IRQ_BOARD_END + 41)
#define AUDSTO (IRQ_BOARD_END + 42) #define AUDSTO (IRQ_BOARD_END + 42)
#define USBPWR (IRQ_BOARD_END + 43) #define IRQ_USBPWR (IRQ_BOARD_END + 43)
#define NIRQHCIM (IRQ_BOARD_END + 44) #define IRQ_NHCIM (IRQ_BOARD_END + 44)
#define IRQHCIBUFFACC (IRQ_BOARD_END + 45) #define IRQ_HCIBUFFACC (IRQ_BOARD_END + 45)
#define IRQHCIRMTWKP (IRQ_BOARD_END + 46) #define IRQ_HCIRMTWKP (IRQ_BOARD_END + 46)
#define NHCIMFCIR (IRQ_BOARD_END + 47) #define IRQ_NHCIMFCIR (IRQ_BOARD_END + 47)
#define USB_PORT_RESUME (IRQ_BOARD_END + 48) #define IRQ_USB_PORT_RESUME (IRQ_BOARD_END + 48)
#define S0_READY_NINT (IRQ_BOARD_END + 49) #define IRQ_S0_READY_NINT (IRQ_BOARD_END + 49)
#define S1_READY_NINT (IRQ_BOARD_END + 50) #define IRQ_S1_READY_NINT (IRQ_BOARD_END + 50)
#define S0_CD_VALID (IRQ_BOARD_END + 51) #define IRQ_S0_CD_VALID (IRQ_BOARD_END + 51)
#define S1_CD_VALID (IRQ_BOARD_END + 52) #define IRQ_S1_CD_VALID (IRQ_BOARD_END + 52)
#define S0_BVD1_STSCHG (IRQ_BOARD_END + 53) #define IRQ_S0_BVD1_STSCHG (IRQ_BOARD_END + 53)
#define S1_BVD1_STSCHG (IRQ_BOARD_END + 54) #define IRQ_S1_BVD1_STSCHG (IRQ_BOARD_END + 54)
/* /*
* Figure out the MAX IRQ number. * Figure out the MAX IRQ number.
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
* Otherwise, we have the standard IRQs only. * Otherwise, we have the standard IRQs only.
*/ */
#ifdef CONFIG_SA1111 #ifdef CONFIG_SA1111
#define NR_IRQS (S1_BVD1_STSCHG + 1) #define NR_IRQS (IRQ_S1_BVD1_STSCHG + 1)
#elif defined(CONFIG_SA1100_GRAPHICSCLIENT) || \ #elif defined(CONFIG_SA1100_GRAPHICSCLIENT) || \
defined(CONFIG_SA1100_GRAPHICSMASTER) || \ defined(CONFIG_SA1100_GRAPHICSMASTER) || \
defined(CONFIG_SA1100_H3800) defined(CONFIG_SA1100_H3800)
......
...@@ -64,18 +64,10 @@ ...@@ -64,18 +64,10 @@
#define SA1111_SMCR 0x0004 #define SA1111_SMCR 0x0004
#define SA1111_SKID 0x0008 #define SA1111_SKID 0x0008
#define _SBI_SKCR _SA1111(SA1111_SKCR)
#define _SBI_SMCR _SA1111(SA1111_SMCR)
#define _SBI_SKID _SA1111(SA1111_SKID)
#if LANGUAGE == C
#define SBI_SKCR __CCREG(SA1111_SKCR) #define SBI_SKCR __CCREG(SA1111_SKCR)
#define SBI_SMCR __CCREG(SA1111_SMCR) #define SBI_SMCR __CCREG(SA1111_SMCR)
#define SBI_SKID __CCREG(SA1111_SKID) #define SBI_SKID __CCREG(SA1111_SKID)
#endif /* LANGUAGE == C */
#define SKCR_PLL_BYPASS (1<<0) #define SKCR_PLL_BYPASS (1<<0)
#define SKCR_RCLKEN (1<<1) #define SKCR_RCLKEN (1<<1)
#define SKCR_SLEEP (1<<2) #define SKCR_SLEEP (1<<2)
...@@ -135,22 +127,10 @@ ...@@ -135,22 +127,10 @@
#define SA1111_SKPMC 0x020c #define SA1111_SKPMC 0x020c
#define SA1111_SKPTC 0x0210 #define SA1111_SKPTC 0x0210
#define SA1111_SKPEN0 0x0214 #define SA1111_SKPEN0 0x0214
#define SA1111_SKPWN0 0x0218 #define SA1111_SKPWM0 0x0218
#define SA1111_SKPEN1 0x021c #define SA1111_SKPEN1 0x021c
#define SA1111_SKPWM1 0x0220 #define SA1111_SKPWM1 0x0220
#define _SKPCR _SA1111(SA1111_SKPCR)
#define _SKCDR _SA1111(SA1111_SKCDR)
#define _SKAUD _SA1111(SA1111_SKAUD)
#define _SKPMC _SA1111(SA1111_SKPMC)
#define _SKPTC _SA1111(SA1111_SKPTC)
#define _SKPEN0 _SA1111(SA1111_SKPEN0)
#define _SKPWM0 _SA1111(SA1111_SKPWM0)
#define _SKPEN1 _SA1111(SA1111_SKPEN1)
#define _SKPWM1 _SA1111(SA1111_SKPWM1)
#if LANGUAGE == C
#define SKPCR __CCREG(SA1111_SKPCR) #define SKPCR __CCREG(SA1111_SKPCR)
#define SKCDR __CCREG(SA1111_SKCDR) #define SKCDR __CCREG(SA1111_SKCDR)
#define SKAUD __CCREG(SA1111_SKAUD) #define SKAUD __CCREG(SA1111_SKAUD)
...@@ -161,8 +141,6 @@ ...@@ -161,8 +141,6 @@
#define SKPEN1 __CCREG(SA1111_SKPEN1) #define SKPEN1 __CCREG(SA1111_SKPEN1)
#define SKPWM1 __CCREG(SA1111_SKPWM1) #define SKPWM1 __CCREG(SA1111_SKPWM1)
#endif /* LANGUAGE == C */
#define SKPCR_UCLKEN (1<<0) #define SKPCR_UCLKEN (1<<0)
#define SKPCR_ACCLKEN (1<<1) #define SKPCR_ACCLKEN (1<<1)
#define SKPCR_I2SCLKEN (1<<2) #define SKPCR_I2SCLKEN (1<<2)
...@@ -176,21 +154,14 @@ ...@@ -176,21 +154,14 @@
/* /*
* USB Host controller * USB Host controller
*/ */
#define _USB_OHCI_OP_BASE _SA1111( 0x400 ) #define SA1111_USB 0x0400
#define _USB_STATUS _SA1111( 0x518 )
#define _USB_RESET _SA1111( 0x51c )
#define _USB_INTERRUPTEST _SA1111( 0x520 )
#define _USB_EXTENT (_USB_INTERRUPTEST - _USB_OHCI_OP_BASE + 4)
#if LANGUAGE == C
#define USB_OHCI_OP_BASE __CCREG(0x0400)
#define USB_STATUS __CCREG(0x0518)
#define USB_RESET __CCREG(0x051c)
#define USB_INTERRUPTEST __CCReG(0x0520)
#endif /* LANGUAGE == C */ /*
* Offsets from SA1111_USB_BASE
*/
#define SA1111_USB_STATUS 0x0118
#define SA1111_USB_RESET 0x011c
#define SA1111_USB_IRQTEST 0x0120
#define USB_RESET_FORCEIFRESET (1 << 0) #define USB_RESET_FORCEIFRESET (1 << 0)
#define USB_RESET_FORCEHCRESET (1 << 1) #define USB_RESET_FORCEHCRESET (1 << 1)
...@@ -451,82 +422,56 @@ ...@@ -451,82 +422,56 @@
* WAKE_POL0 Wake-up polarity selection 0 * WAKE_POL0 Wake-up polarity selection 0
* WAKE_POL1 Wake-up polarity selection 1 * WAKE_POL1 Wake-up polarity selection 1
*/ */
#define SA1111_INTC 0x1600
#define SA1111_INTTEST0 0x1600 /*
#define SA1111_INTTEST1 0x1604 * These are offsets from the above base.
#define SA1111_INTEN0 0x1608 */
#define SA1111_INTEN1 0x160c #define SA1111_INTTEST0 0x0000
#define SA1111_INTPOL0 0x1610 #define SA1111_INTTEST1 0x0004
#define SA1111_INTPOL1 0x1614 #define SA1111_INTEN0 0x0008
#define SA1111_INTTSTSEL 0x1618 #define SA1111_INTEN1 0x000c
#define SA1111_INTSTATCLR0 0x161c #define SA1111_INTPOL0 0x0010
#define SA1111_INTSTATCLR1 0x1620 #define SA1111_INTPOL1 0x0014
#define SA1111_INTSET0 0x1624 #define SA1111_INTTSTSEL 0x0018
#define SA1111_INTSET1 0x1628 #define SA1111_INTSTATCLR0 0x001c
#define SA1111_WAKE_EN0 0x162c #define SA1111_INTSTATCLR1 0x0020
#define SA1111_WAKE_EN1 0x1630 #define SA1111_INTSET0 0x0024
#define SA1111_WAKE_POL0 0x1634 #define SA1111_INTSET1 0x0028
#define SA1111_WAKE_POL1 0x1638 #define SA1111_WAKEEN0 0x002c
#define SA1111_WAKEEN1 0x0030
#define _INTTEST0 _SA1111(SA1111_INTTEST0) #define SA1111_WAKEPOL0 0x0034
#define _INTTEST1 _SA1111(SA1111_INTTEST1) #define SA1111_WAKEPOL1 0x0038
#define _INTEN0 _SA1111(SA1111_INTEN0)
#define _INTEN1 _SA1111(SA1111_INTEN1) #define INTTEST0 __CCREG(SA1111_INTC + SA1111_INTTEST0)
#define _INTPOL0 _SA1111(SA1111_INTPOL0) #define INTTEST1 __CCREG(SA1111_INTC + SA1111_INTTEST1)
#define _INTPOL1 _SA1111(SA1111_INTPOL1) #define INTEN0 __CCREG(SA1111_INTC + SA1111_INTEN0)
#define _INTTSTSEL _SA1111(SA1111_INTTSTSEL) #define INTEN1 __CCREG(SA1111_INTC + SA1111_INTEN1)
#define _INTSTATCLR0 _SA1111(SA1111_INTSTATCLR0) #define INTPOL0 __CCREG(SA1111_INTC + SA1111_INTPOL0)
#define _INTSTATCLR1 _SA1111(SA1111_INTSTATCLR1) #define INTPOL1 __CCREG(SA1111_INTC + SA1111_INTPOL1)
#define _INTSET0 _SA1111(SA1111_INTSET0) #define INTTSTSEL __CCREG(SA1111_INTC + SA1111_INTTSTSEL)
#define _INTSET1 _SA1111(SA1111_INTSET1) #define INTSTATCLR0 __CCREG(SA1111_INTC + SA1111_INTSTATCLR0)
#define _WAKE_EN0 _SA1111(SA1111_WAKE_EN0) #define INTSTATCLR1 __CCREG(SA1111_INTC + SA1111_INTSTATCLR1)
#define _WAKE_EN1 _SA1111(SA1111_WAKE_EN1) #define INTSET0 __CCREG(SA1111_INTC + SA1111_INTSET0)
#define _WAKE_POL0 _SA1111(SA1111_WAKE_POL0) #define INTSET1 __CCREG(SA1111_INTC + SA1111_INTSET1)
#define _WAKE_POL1 _SA1111(SA1111_WAKE_POL1) #define WAKE_EN0 __CCREG(SA1111_INTC + SA1111_WAKEEN0)
#define WAKE_EN1 __CCREG(SA1111_INTC + SA1111_WAKEEN1)
#if LANGUAGE == C #define WAKE_POL0 __CCREG(SA1111_INTC + SA1111_WAKEPOL0)
#define WAKE_POL1 __CCREG(SA1111_INTC + SA1111_WAKEPOL1)
#define INTTEST0 __CCREG(SA1111_INTTEST0)
#define INTTEST1 __CCREG(SA1111_INTTEST1)
#define INTEN0 __CCREG(SA1111_INTEN0)
#define INTEN1 __CCREG(SA1111_INTEN1)
#define INTPOL0 __CCREG(SA1111_INTPOL0)
#define INTPOL1 __CCREG(SA1111_INTPOL1)
#define INTTSTSEL __CCREG(SA1111_INTTSTSEL)
#define INTSTATCLR0 __CCREG(SA1111_INTSTATCLR0)
#define INTSTATCLR1 __CCREG(SA1111_INTSTATCLR1)
#define INTSET0 __CCREG(SA1111_INTSET0)
#define INTSET1 __CCREG(SA1111_INTSET1)
#define WAKE_EN0 __CCREG(SA1111_WAKE_EN0)
#define WAKE_EN1 __CCREG(SA1111_WAKE_EN1)
#define WAKE_POL0 __CCREG(SA1111_WAKE_POL0)
#define WAKE_POL1 __CCREG(SA1111_WAKE_POL1)
#endif /* LANGUAGE == C */
/* /*
* PS/2 Trackpad and Mouse Interfaces * PS/2 Trackpad and Mouse Interfaces
* *
* Registers (prefix kbd applies to trackpad interface, mse to mouse) * Registers
* KBDCR Control Register * PS2CR Control Register
* KBDSTAT Status Register * PS2STAT Status Register
* KBDDATA Transmit/Receive Data register * PS2DATA Transmit/Receive Data register
* KBDCLKDIV Clock Division Register * PS2CLKDIV Clock Division Register
* KBDPRECNT Clock Precount Register * PS2PRECNT Clock Precount Register
* KBDTEST1 Test register 1 * PS2TEST1 Test register 1
* KBDTEST2 Test register 2 * PS2TEST2 Test register 2
* KBDTEST3 Test register 3 * PS2TEST3 Test register 3
* KBDTEST4 Test register 4 * PS2TEST4 Test register 4
* MSECR
* MSESTAT
* MSEDATA
* MSECLKDIV
* MSEPRECNT
* MSETEST1
* MSETEST2
* MSETEST3
* MSETEST4
*
*/ */
#define SA1111_KBD 0x0a00 #define SA1111_KBD 0x0a00
...@@ -564,17 +509,14 @@ ...@@ -564,17 +509,14 @@
* PCSSR Sleep State Register * PCSSR Sleep State Register
*/ */
#define _PCCR _SA1111( 0x1800 ) #define SA1111_PCMCIA 0x1600
#define _PCSSR _SA1111( 0x1804 )
#define _PCSR _SA1111( 0x1808 )
#if LANGUAGE == C
#define PCCR __CCREG(0x1800)
#define PCSSR __CCREG(0x1804)
#define PCSR __CCREG(0x1808)
#endif /* LANGUAGE == C */ /*
* These are offsets from the above base.
*/
#define SA1111_PCCR 0x0000
#define SA1111_PCSSR 0x0004
#define SA1111_PCSR 0x0008
#define PCSR_S0_READY (1<<0) #define PCSR_S0_READY (1<<0)
#define PCSR_S1_READY (1<<1) #define PCSR_S1_READY (1<<1)
...@@ -603,21 +545,61 @@ ...@@ -603,21 +545,61 @@
#define PCSSR_S0_SLEEP (1<<0) #define PCSSR_S0_SLEEP (1<<0)
#define PCSSR_S1_SLEEP (1<<1) #define PCSSR_S1_SLEEP (1<<1)
struct sa1111_device {
extern struct bus_type sa1111_bus_type;
#define SA1111_DEVID_SBI 0
#define SA1111_DEVID_SK 1
#define SA1111_DEVID_USB 2
#define SA1111_DEVID_SAC 3
#define SA1111_DEVID_SSP 4
#define SA1111_DEVID_PS2 5
#define SA1111_DEVID_GPIO 6
#define SA1111_DEVID_INT 7
#define SA1111_DEVID_PCMCIA 8
struct sa1111_dev {
struct device dev; struct device dev;
struct resource resource; unsigned int devid;
void *base; struct resource res;
void *mapbase;
unsigned int skpcr_mask;
unsigned int irq[6];
}; };
extern struct sa1111_device *sa1111; #define SA1111_DEV(_d) container_of((_d), struct sa1111_dev, dev)
int sa1111_check_dma_bug(dma_addr_t addr); struct sa1111_driver {
struct device_driver drv;
unsigned int devid;
};
#define SA1111_DRV(_d) container_of((_d), struct sa1111_driver, drv)
#define SA1111_DRIVER_NAME(_sadev) ((_sadev)->dev.driver->name)
/*
* Probe for a SA1111 chip.
*/
extern int sa1111_init(unsigned long phys, unsigned int irq);
/* /*
* These frob the SKPCR register. * These frob the SKPCR register.
*/ */
void sa1111_enable_device(unsigned int mask); void sa1111_enable_device(struct sa1111_dev *);
void sa1111_disable_device(unsigned int mask); void sa1111_disable_device(struct sa1111_dev *);
unsigned int sa1111_pll_clock(struct sa1111_dev *);
#define SA1111_AUDIO_ACLINK 0
#define SA1111_AUDIO_I2S 1
void sa1111_select_audio_mode(struct sa1111_dev *sadev, int mode);
int sa1111_set_audio_rate(struct sa1111_dev *sadev, int rate);
int sa1111_get_audio_rate(struct sa1111_dev *sadev);
int sa1111_check_dma_bug(dma_addr_t addr);
#endif /* _ASM_ARCH_SA1111 */ #endif /* _ASM_ARCH_SA1111 */
...@@ -27,15 +27,11 @@ void sa1111_dma_sync_sg(struct pci_dev *, struct scatterlist *, int, int); ...@@ -27,15 +27,11 @@ void sa1111_dma_sync_sg(struct pci_dev *, struct scatterlist *, int, int);
#ifdef CONFIG_SA1111 #ifdef CONFIG_SA1111
#define SA1111_FAKE_PCIDEV ((struct pci_dev *) 1111) #define SA1111_FAKE_PCIDEV ((struct pci_dev *) 1111)
#define dev_is_sa1111(dev) (dev == SA1111_FAKE_PCIDEV)
static inline int dev_is_sa1111(const struct pci_dev *dev)
{
return (dev == SA1111_FAKE_PCIDEV);
}
#else #else
static inline int dev_is_sa1111(const struct pci_dev *dev) { return 0; } #define dev_is_sa1111(dev) (0)
#endif #endif
......
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