Commit 43db7fe9 authored by John Lenz's avatar John Lenz Committed by Russell King

[ARM PATCH] 2417/1: update collie to use scoop driver

Patch from John Lenz

Update collie machine to use the new scoop driver written
by Richard Purdie.

Signed-off-by: John Lenz
Signed-off-by: Russell King
parent 41acbfd6
......@@ -236,7 +236,7 @@ config SHARP_LOCOMO
config SHARP_SCOOP
bool
depends on PXA_SHARPSL
depends on PXA_SHARPSL || SA1100_COLLIE
default y
config FORCE_MAX_ZONEORDER
......
......@@ -37,36 +37,34 @@
#include <asm/mach/map.h>
#include <asm/mach/serial_sa1100.h>
#include <asm/hardware/scoop.h>
#include <asm/hardware/locomo.h>
#include "generic.h"
static void __init scoop_init(void)
{
static struct resource collie_scoop_resources[] = {
[0] = {
.start = 0x40800000,
.end = 0x40800fff,
.flags = IORESOURCE_MEM,
},
};
#define COLLIE_SCP_INIT_DATA(adr,dat) (((adr)<<16)|(dat))
#define COLLIE_SCP_INIT_DATA_END ((unsigned long)-1)
static const unsigned long scp_init[] = {
COLLIE_SCP_INIT_DATA(COLLIE_SCP_MCR, 0x0140), // 00
COLLIE_SCP_INIT_DATA(COLLIE_SCP_MCR, 0x0100),
COLLIE_SCP_INIT_DATA(COLLIE_SCP_CDR, 0x0000), // 04
COLLIE_SCP_INIT_DATA(COLLIE_SCP_CPR, 0x0000), // 0C
COLLIE_SCP_INIT_DATA(COLLIE_SCP_CCR, 0x0000), // 10
COLLIE_SCP_INIT_DATA(COLLIE_SCP_IMR, 0x0000), // 18
COLLIE_SCP_INIT_DATA(COLLIE_SCP_IRM, 0x00FF), // 14
COLLIE_SCP_INIT_DATA(COLLIE_SCP_ISR, 0x0000), // 1C
COLLIE_SCP_INIT_DATA(COLLIE_SCP_IRM, 0x0000),
COLLIE_SCP_INIT_DATA(COLLIE_SCP_GPCR, COLLIE_SCP_IO_DIR), // 20
COLLIE_SCP_INIT_DATA(COLLIE_SCP_GPWR, COLLIE_SCP_IO_OUT), // 24
COLLIE_SCP_INIT_DATA_END
};
int i;
for (i = 0; scp_init[i] != COLLIE_SCP_INIT_DATA_END; i++) {
int adr = scp_init[i] >> 16;
COLLIE_SCP_REG(adr) = scp_init[i] & 0xFFFF;
}
static struct scoop_config collie_scoop_setup = {
.io_dir = COLLIE_SCOOP_IO_DIR,
.io_out = COLLIE_SCOOP_IO_OUT,
};
static struct platform_device colliescoop_device = {
.name = "sharp-scoop",
.id = -1,
.dev = {
.platform_data = &collie_scoop_setup,
},
.num_resources = ARRAY_SIZE(collie_scoop_resources),
.resource = collie_scoop_resources,
};
}
static struct resource locomo_resources[] = {
[0] = {
......@@ -90,6 +88,7 @@ static struct platform_device locomo_device = {
static struct platform_device *devices[] __initdata = {
&locomo_device,
&colliescoop_device,
};
static struct mtd_partition collie_partitions[] = {
......@@ -111,11 +110,11 @@ static struct mtd_partition collie_partitions[] = {
static void collie_set_vpp(int vpp)
{
COLLIE_SCP_REG_GPCR |= COLLIE_SCP_VPEN;
write_scoop_reg(SCOOP_GPCR, read_scoop_reg(SCOOP_GPCR) | COLLIE_SCP_VPEN);
if (vpp) {
COLLIE_SCP_REG_GPWR |= COLLIE_SCP_VPEN;
write_scoop_reg(SCOOP_GPWR, read_scoop_reg(SCOOP_GPWR) | COLLIE_SCP_VPEN);
} else {
COLLIE_SCP_REG_GPWR &= ~COLLIE_SCP_VPEN;
write_scoop_reg(SCOOP_GPWR, read_scoop_reg(SCOOP_GPWR) & ~COLLIE_SCP_VPEN);
}
}
......@@ -160,8 +159,6 @@ static void __init collie_init(void)
GPDR |= GPIO_32_768kHz;
TUCR = TUCR_32_768kHz;
scoop_init();
ret = platform_add_devices(devices, ARRAY_SIZE(devices));
if (ret) {
printk(KERN_WARNING "collie: Unable to register LoCoMo device\n");
......@@ -175,7 +172,6 @@ static struct map_desc collie_io_desc[] __initdata = {
/* virtual physical length type */
{0xe8000000, 0x00000000, 0x02000000, MT_DEVICE}, /* 32M main flash (cs0) */
{0xea000000, 0x08000000, 0x02000000, MT_DEVICE}, /* 32M boot flash (cs1) */
{0xf0000000, 0x40000000, 0x01000000, MT_DEVICE}, /* 16M LOCOMO & SCOOP (cs4) */
};
static void __init collie_map_io(void)
......
......@@ -15,57 +15,20 @@
#include <linux/config.h>
#define CF_BUF_CTRL_BASE 0xF0800000
#define COLLIE_SCP_REG(adr) (*(volatile unsigned short*)(CF_BUF_CTRL_BASE+(adr)))
#define COLLIE_SCP_MCR 0x00
#define COLLIE_SCP_CDR 0x04
#define COLLIE_SCP_CSR 0x08
#define COLLIE_SCP_CPR 0x0C
#define COLLIE_SCP_CCR 0x10
#define COLLIE_SCP_IRR 0x14
#define COLLIE_SCP_IRM 0x14
#define COLLIE_SCP_IMR 0x18
#define COLLIE_SCP_ISR 0x1C
#define COLLIE_SCP_GPCR 0x20
#define COLLIE_SCP_GPWR 0x24
#define COLLIE_SCP_GPRR 0x28
#define COLLIE_SCP_REG_MCR COLLIE_SCP_REG(COLLIE_SCP_MCR)
#define COLLIE_SCP_REG_CDR COLLIE_SCP_REG(COLLIE_SCP_CDR)
#define COLLIE_SCP_REG_CSR COLLIE_SCP_REG(COLLIE_SCP_CSR)
#define COLLIE_SCP_REG_CPR COLLIE_SCP_REG(COLLIE_SCP_CPR)
#define COLLIE_SCP_REG_CCR COLLIE_SCP_REG(COLLIE_SCP_CCR)
#define COLLIE_SCP_REG_IRR COLLIE_SCP_REG(COLLIE_SCP_IRR)
#define COLLIE_SCP_REG_IRM COLLIE_SCP_REG(COLLIE_SCP_IRM)
#define COLLIE_SCP_REG_IMR COLLIE_SCP_REG(COLLIE_SCP_IMR)
#define COLLIE_SCP_REG_ISR COLLIE_SCP_REG(COLLIE_SCP_ISR)
#define COLLIE_SCP_REG_GPCR COLLIE_SCP_REG(COLLIE_SCP_GPCR)
#define COLLIE_SCP_REG_GPWR COLLIE_SCP_REG(COLLIE_SCP_GPWR)
#define COLLIE_SCP_REG_GPRR COLLIE_SCP_REG(COLLIE_SCP_GPRR)
#define COLLIE_SCP_GPCR_PA19 ( 1 << 9 )
#define COLLIE_SCP_GPCR_PA18 ( 1 << 8 )
#define COLLIE_SCP_GPCR_PA17 ( 1 << 7 )
#define COLLIE_SCP_GPCR_PA16 ( 1 << 6 )
#define COLLIE_SCP_GPCR_PA15 ( 1 << 5 )
#define COLLIE_SCP_GPCR_PA14 ( 1 << 4 )
#define COLLIE_SCP_GPCR_PA13 ( 1 << 3 )
#define COLLIE_SCP_GPCR_PA12 ( 1 << 2 )
#define COLLIE_SCP_GPCR_PA11 ( 1 << 1 )
#define COLLIE_SCP_CHARGE_ON COLLIE_SCP_GPCR_PA11
#define COLLIE_SCP_DIAG_BOOT1 COLLIE_SCP_GPCR_PA12
#define COLLIE_SCP_DIAG_BOOT2 COLLIE_SCP_GPCR_PA13
#define COLLIE_SCP_MUTE_L COLLIE_SCP_GPCR_PA14
#define COLLIE_SCP_MUTE_R COLLIE_SCP_GPCR_PA15
#define COLLIE_SCP_5VON COLLIE_SCP_GPCR_PA16
#define COLLIE_SCP_AMP_ON COLLIE_SCP_GPCR_PA17
#define COLLIE_SCP_VPEN COLLIE_SCP_GPCR_PA18
#define COLLIE_SCP_LB_VOL_CHG COLLIE_SCP_GPCR_PA19
#define COLLIE_SCP_IO_DIR ( COLLIE_SCP_CHARGE_ON | COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | \
#define COLLIE_SCP_CHARGE_ON SCOOP_GPCR_PA11
#define COLLIE_SCP_DIAG_BOOT1 SCOOP_GPCR_PA12
#define COLLIE_SCP_DIAG_BOOT2 SCOOP_GPCR_PA13
#define COLLIE_SCP_MUTE_L SCOOP_GPCR_PA14
#define COLLIE_SCP_MUTE_R SCOOP_GPCR_PA15
#define COLLIE_SCP_5VON SCOOP_GPCR_PA16
#define COLLIE_SCP_AMP_ON SCOOP_GPCR_PA17
#define COLLIE_SCP_VPEN SCOOP_GPCR_PA18
#define COLLIE_SCP_LB_VOL_CHG SCOOP_GPCR_PA19
#define COLLIE_SCOOP_IO_DIR ( COLLIE_SCP_CHARGE_ON | COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | \
COLLIE_SCP_5VON | COLLIE_SCP_AMP_ON | COLLIE_SCP_VPEN | \
COLLIE_SCP_LB_VOL_CHG )
#define COLLIE_SCP_IO_OUT ( COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | COLLIE_SCP_VPEN | \
#define COLLIE_SCOOP_IO_OUT ( COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | COLLIE_SCP_VPEN | \
COLLIE_SCP_CHARGE_ON )
/* GPIOs for which the generic definition doesn't say much */
......
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