2005-04-17 06:20:36 +08:00
|
|
|
/*
|
|
|
|
* linux/arch/arm/mach-sa1100/collie.c
|
|
|
|
*
|
|
|
|
* May be copied or modified under the terms of the GNU General Public
|
|
|
|
* License. See linux/COPYING for more information.
|
|
|
|
*
|
|
|
|
* This file contains all Collie-specific tweaks.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* ChangeLog:
|
2010-07-18 20:27:13 +08:00
|
|
|
* 2006 Pavel Machek <pavel@ucw.cz>
|
2006-04-01 19:13:31 +08:00
|
|
|
* 03-06-2004 John Lenz <lenz@cs.wisc.edu>
|
2005-04-17 06:20:36 +08:00
|
|
|
* 06-04-2002 Chris Larson <kergoth@digitalnemesis.net>
|
|
|
|
* 04-16-2001 Lineo Japan,Inc. ...
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/tty.h>
|
|
|
|
#include <linux/delay.h>
|
2012-09-21 17:18:58 +08:00
|
|
|
#include <linux/platform_data/sa11x0-serial.h>
|
2005-10-30 02:07:23 +08:00
|
|
|
#include <linux/platform_device.h>
|
2012-01-21 06:13:52 +08:00
|
|
|
#include <linux/mfd/ucb1x00.h>
|
2005-04-17 06:20:36 +08:00
|
|
|
#include <linux/mtd/mtd.h>
|
|
|
|
#include <linux/mtd/partitions.h>
|
|
|
|
#include <linux/timer.h>
|
2014-01-09 20:31:48 +08:00
|
|
|
#include <linux/gpio_keys.h>
|
|
|
|
#include <linux/input.h>
|
2009-03-25 17:14:25 +08:00
|
|
|
#include <linux/gpio.h>
|
2009-02-10 20:48:32 +08:00
|
|
|
#include <linux/pda_power.h>
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2012-01-14 19:50:04 +08:00
|
|
|
#include <video/sa1100fb.h>
|
|
|
|
|
2008-08-05 23:14:15 +08:00
|
|
|
#include <mach/hardware.h>
|
2005-04-17 06:20:36 +08:00
|
|
|
#include <asm/mach-types.h>
|
2011-08-01 06:38:45 +08:00
|
|
|
#include <asm/page.h>
|
2005-04-17 06:20:36 +08:00
|
|
|
#include <asm/setup.h>
|
2008-08-05 23:14:15 +08:00
|
|
|
#include <mach/collie.h>
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
#include <asm/mach/arch.h>
|
|
|
|
#include <asm/mach/flash.h>
|
|
|
|
#include <asm/mach/map.h>
|
2014-01-09 20:32:18 +08:00
|
|
|
#include <asm/mach/irda.h>
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
#include <asm/hardware/scoop.h>
|
|
|
|
#include <asm/mach/sharpsl_param.h>
|
|
|
|
#include <asm/hardware/locomo.h>
|
2012-08-24 21:17:38 +08:00
|
|
|
#include <linux/platform_data/mfd-mcp-sa11x0.h>
|
2012-02-24 07:06:51 +08:00
|
|
|
#include <mach/irqs.h>
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
#include "generic.h"
|
|
|
|
|
|
|
|
static struct resource collie_scoop_resources[] = {
|
2012-01-12 18:25:29 +08:00
|
|
|
[0] = DEFINE_RES_MEM(0x40800000, SZ_4K),
|
2005-04-17 06:20:36 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct scoop_config collie_scoop_setup = {
|
|
|
|
.io_dir = COLLIE_SCOOP_IO_DIR,
|
|
|
|
.io_out = COLLIE_SCOOP_IO_OUT,
|
2008-10-29 02:41:39 +08:00
|
|
|
.gpio_base = COLLIE_SCOOP_GPIO_BASE,
|
2005-04-17 06:20:36 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
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,
|
|
|
|
};
|
|
|
|
|
2006-03-25 19:07:34 +08:00
|
|
|
static struct scoop_pcmcia_dev collie_pcmcia_scoop[] = {
|
2008-11-27 03:58:43 +08:00
|
|
|
{
|
|
|
|
.dev = &colliescoop_device.dev,
|
|
|
|
.irq = COLLIE_IRQ_GPIO_CF_IRQ,
|
|
|
|
.cd_irq = COLLIE_IRQ_GPIO_CF_CD,
|
|
|
|
.cd_irq_str = "PCMCIA0 CD",
|
|
|
|
},
|
2006-03-25 19:07:34 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct scoop_pcmcia_config collie_pcmcia_config = {
|
2008-11-27 03:58:43 +08:00
|
|
|
.devs = &collie_pcmcia_scoop[0],
|
|
|
|
.num_devs = 1,
|
2006-03-25 19:07:34 +08:00
|
|
|
};
|
|
|
|
|
2012-01-21 06:13:52 +08:00
|
|
|
static struct ucb1x00_plat_data collie_ucb1x00_data = {
|
|
|
|
.gpio_base = COLLIE_TC35143_GPIO_BASE,
|
|
|
|
};
|
|
|
|
|
2006-03-25 19:07:34 +08:00
|
|
|
static struct mcp_plat_data collie_mcp_data = {
|
2008-11-27 03:58:43 +08:00
|
|
|
.mccr0 = MCCR0_ADM | MCCR0_ExtClk,
|
|
|
|
.sclk_rate = 9216000,
|
2012-01-21 06:13:52 +08:00
|
|
|
.codec_pdata = &collie_ucb1x00_data,
|
2006-03-25 19:07:34 +08:00
|
|
|
};
|
|
|
|
|
2014-01-09 20:32:18 +08:00
|
|
|
static int collie_ir_startup(struct device *dev)
|
|
|
|
{
|
|
|
|
int rc = gpio_request(COLLIE_GPIO_IR_ON, "IrDA");
|
|
|
|
if (rc)
|
|
|
|
return rc;
|
|
|
|
rc = gpio_direction_output(COLLIE_GPIO_IR_ON, 1);
|
|
|
|
|
|
|
|
if (!rc)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
gpio_free(COLLIE_GPIO_IR_ON);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void collie_ir_shutdown(struct device *dev)
|
|
|
|
{
|
|
|
|
gpio_free(COLLIE_GPIO_IR_ON);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int collie_ir_set_power(struct device *dev, unsigned int state)
|
|
|
|
{
|
|
|
|
gpio_set_value(COLLIE_GPIO_IR_ON, !state);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct irda_platform_data collie_ir_data = {
|
|
|
|
.startup = collie_ir_startup,
|
|
|
|
.shutdown = collie_ir_shutdown,
|
|
|
|
.set_power = collie_ir_set_power,
|
|
|
|
};
|
|
|
|
|
2009-02-10 20:48:32 +08:00
|
|
|
/*
|
|
|
|
* Collie AC IN
|
|
|
|
*/
|
|
|
|
static int collie_power_init(struct device *dev)
|
|
|
|
{
|
|
|
|
int ret = gpio_request(COLLIE_GPIO_AC_IN, "ac in");
|
|
|
|
if (ret)
|
|
|
|
goto err_gpio_req;
|
|
|
|
|
|
|
|
ret = gpio_direction_input(COLLIE_GPIO_AC_IN);
|
|
|
|
if (ret)
|
|
|
|
goto err_gpio_in;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
err_gpio_in:
|
|
|
|
gpio_free(COLLIE_GPIO_AC_IN);
|
|
|
|
err_gpio_req:
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void collie_power_exit(struct device *dev)
|
|
|
|
{
|
|
|
|
gpio_free(COLLIE_GPIO_AC_IN);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int collie_power_ac_online(void)
|
|
|
|
{
|
|
|
|
return gpio_get_value(COLLIE_GPIO_AC_IN) == 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
static char *collie_ac_supplied_to[] = {
|
|
|
|
"main-battery",
|
|
|
|
"backup-battery",
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct pda_power_pdata collie_power_data = {
|
|
|
|
.init = collie_power_init,
|
|
|
|
.is_ac_online = collie_power_ac_online,
|
|
|
|
.exit = collie_power_exit,
|
|
|
|
.supplied_to = collie_ac_supplied_to,
|
|
|
|
.num_supplicants = ARRAY_SIZE(collie_ac_supplied_to),
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct resource collie_power_resource[] = {
|
|
|
|
{
|
|
|
|
.name = "ac",
|
|
|
|
.flags = IORESOURCE_IRQ |
|
|
|
|
IORESOURCE_IRQ_HIGHEDGE |
|
|
|
|
IORESOURCE_IRQ_LOWEDGE,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct platform_device collie_power_device = {
|
|
|
|
.name = "pda-power",
|
|
|
|
.id = -1,
|
|
|
|
.dev.platform_data = &collie_power_data,
|
|
|
|
.resource = collie_power_resource,
|
|
|
|
.num_resources = ARRAY_SIZE(collie_power_resource),
|
2006-03-25 19:07:34 +08:00
|
|
|
};
|
|
|
|
|
2006-04-01 19:13:31 +08:00
|
|
|
#ifdef CONFIG_SHARP_LOCOMO
|
|
|
|
/*
|
|
|
|
* low-level UART features.
|
|
|
|
*/
|
2006-09-26 03:11:48 +08:00
|
|
|
struct platform_device collie_locomo_device;
|
2006-04-01 19:13:31 +08:00
|
|
|
|
|
|
|
static void collie_uart_set_mctrl(struct uart_port *port, u_int mctrl)
|
|
|
|
{
|
2008-11-27 03:58:43 +08:00
|
|
|
if (mctrl & TIOCM_RTS)
|
2006-09-26 03:11:48 +08:00
|
|
|
locomo_gpio_write(&collie_locomo_device.dev, LOCOMO_GPIO_RTS, 0);
|
2008-11-27 03:58:43 +08:00
|
|
|
else
|
2006-09-26 03:11:48 +08:00
|
|
|
locomo_gpio_write(&collie_locomo_device.dev, LOCOMO_GPIO_RTS, 1);
|
2006-04-01 19:13:31 +08:00
|
|
|
|
2008-11-27 03:58:43 +08:00
|
|
|
if (mctrl & TIOCM_DTR)
|
2006-09-26 03:11:48 +08:00
|
|
|
locomo_gpio_write(&collie_locomo_device.dev, LOCOMO_GPIO_DTR, 0);
|
2008-11-27 03:58:43 +08:00
|
|
|
else
|
2006-09-26 03:11:48 +08:00
|
|
|
locomo_gpio_write(&collie_locomo_device.dev, LOCOMO_GPIO_DTR, 1);
|
2006-04-01 19:13:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static u_int collie_uart_get_mctrl(struct uart_port *port)
|
|
|
|
{
|
|
|
|
int ret = TIOCM_CD;
|
|
|
|
unsigned int r;
|
|
|
|
|
2006-09-26 03:11:48 +08:00
|
|
|
r = locomo_gpio_read_output(&collie_locomo_device.dev, LOCOMO_GPIO_CTS & LOCOMO_GPIO_DSR);
|
|
|
|
if (r == -ENODEV)
|
|
|
|
return ret;
|
2006-04-01 19:13:31 +08:00
|
|
|
if (r & LOCOMO_GPIO_CTS)
|
|
|
|
ret |= TIOCM_CTS;
|
|
|
|
if (r & LOCOMO_GPIO_DSR)
|
|
|
|
ret |= TIOCM_DSR;
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
2006-03-25 19:07:34 +08:00
|
|
|
|
|
|
|
static struct sa1100_port_fns collie_port_fns __initdata = {
|
|
|
|
.set_mctrl = collie_uart_set_mctrl,
|
|
|
|
.get_mctrl = collie_uart_get_mctrl,
|
|
|
|
};
|
|
|
|
|
2006-04-01 19:13:31 +08:00
|
|
|
static int collie_uart_probe(struct locomo_dev *dev)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int collie_uart_remove(struct locomo_dev *dev)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct locomo_driver collie_uart_driver = {
|
|
|
|
.drv = {
|
|
|
|
.name = "collie_uart",
|
|
|
|
},
|
|
|
|
.devid = LOCOMO_DEVID_UART,
|
|
|
|
.probe = collie_uart_probe,
|
|
|
|
.remove = collie_uart_remove,
|
|
|
|
};
|
|
|
|
|
2009-03-25 18:15:00 +08:00
|
|
|
static int __init collie_uart_init(void)
|
|
|
|
{
|
2006-04-01 19:13:31 +08:00
|
|
|
return locomo_driver_register(&collie_uart_driver);
|
|
|
|
}
|
|
|
|
device_initcall(collie_uart_init);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
static struct resource locomo_resources[] = {
|
2012-01-12 18:25:29 +08:00
|
|
|
[0] = DEFINE_RES_MEM(0x40000000, SZ_8K),
|
|
|
|
[1] = DEFINE_RES_IRQ(IRQ_GPIO25),
|
2005-04-17 06:20:36 +08:00
|
|
|
};
|
|
|
|
|
2010-02-05 10:07:33 +08:00
|
|
|
static struct locomo_platform_data locomo_info = {
|
|
|
|
.irq_base = IRQ_BOARD_START,
|
|
|
|
};
|
|
|
|
|
2006-09-26 03:11:48 +08:00
|
|
|
struct platform_device collie_locomo_device = {
|
2005-04-17 06:20:36 +08:00
|
|
|
.name = "locomo",
|
|
|
|
.id = 0,
|
2011-02-11 23:26:10 +08:00
|
|
|
.dev = {
|
|
|
|
.platform_data = &locomo_info,
|
|
|
|
},
|
2005-04-17 06:20:36 +08:00
|
|
|
.num_resources = ARRAY_SIZE(locomo_resources),
|
|
|
|
.resource = locomo_resources,
|
|
|
|
};
|
|
|
|
|
2014-01-09 20:31:48 +08:00
|
|
|
static struct gpio_keys_button collie_gpio_keys[] = {
|
|
|
|
{
|
|
|
|
.type = EV_PWR,
|
|
|
|
.code = KEY_RESERVED,
|
|
|
|
.gpio = COLLIE_GPIO_ON_KEY,
|
|
|
|
.desc = "On key",
|
|
|
|
.wakeup = 1,
|
|
|
|
.active_low = 1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.type = EV_PWR,
|
|
|
|
.code = KEY_WAKEUP,
|
|
|
|
.gpio = COLLIE_GPIO_WAKEUP,
|
|
|
|
.desc = "Sync",
|
|
|
|
.wakeup = 1,
|
|
|
|
.active_low = 1,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct gpio_keys_platform_data collie_gpio_keys_data = {
|
|
|
|
.buttons = collie_gpio_keys,
|
|
|
|
.nbuttons = ARRAY_SIZE(collie_gpio_keys),
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct platform_device collie_gpio_keys_device = {
|
|
|
|
.name = "gpio-keys",
|
|
|
|
.id = -1,
|
|
|
|
.dev = {
|
|
|
|
.platform_data = &collie_gpio_keys_data,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
static struct platform_device *devices[] __initdata = {
|
2006-09-26 03:11:48 +08:00
|
|
|
&collie_locomo_device,
|
2005-04-17 06:20:36 +08:00
|
|
|
&colliescoop_device,
|
2009-02-10 20:48:32 +08:00
|
|
|
&collie_power_device,
|
2014-01-09 20:31:48 +08:00
|
|
|
&collie_gpio_keys_device,
|
2005-04-17 06:20:36 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct mtd_partition collie_partitions[] = {
|
|
|
|
{
|
|
|
|
.name = "bootloader",
|
|
|
|
.offset = 0,
|
|
|
|
.size = 0x000C0000,
|
|
|
|
.mask_flags = MTD_WRITEABLE
|
|
|
|
}, {
|
|
|
|
.name = "kernel",
|
|
|
|
.offset = MTDPART_OFS_APPEND,
|
|
|
|
.size = 0x00100000,
|
|
|
|
}, {
|
|
|
|
.name = "rootfs",
|
|
|
|
.offset = MTDPART_OFS_APPEND,
|
|
|
|
.size = 0x00e20000,
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2009-03-25 17:14:25 +08:00
|
|
|
static int collie_flash_init(void)
|
|
|
|
{
|
2009-03-25 18:15:00 +08:00
|
|
|
int rc = gpio_request(COLLIE_GPIO_VPEN, "flash Vpp enable");
|
2009-03-25 17:14:25 +08:00
|
|
|
if (rc)
|
|
|
|
return rc;
|
|
|
|
|
|
|
|
rc = gpio_direction_output(COLLIE_GPIO_VPEN, 1);
|
|
|
|
if (rc)
|
|
|
|
gpio_free(COLLIE_GPIO_VPEN);
|
|
|
|
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
static void collie_set_vpp(int vpp)
|
|
|
|
{
|
2009-03-25 17:14:25 +08:00
|
|
|
gpio_set_value(COLLIE_GPIO_VPEN, vpp);
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
|
2009-03-25 17:14:25 +08:00
|
|
|
static void collie_flash_exit(void)
|
|
|
|
{
|
|
|
|
gpio_free(COLLIE_GPIO_VPEN);
|
|
|
|
}
|
2009-03-25 18:15:00 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
static struct flash_platform_data collie_flash_data = {
|
2013-09-16 06:04:42 +08:00
|
|
|
.map_name = "jedec_probe",
|
2009-03-25 17:14:25 +08:00
|
|
|
.init = collie_flash_init,
|
2005-04-17 06:20:36 +08:00
|
|
|
.set_vpp = collie_set_vpp,
|
2009-03-25 17:14:25 +08:00
|
|
|
.exit = collie_flash_exit,
|
2005-04-17 06:20:36 +08:00
|
|
|
.parts = collie_partitions,
|
|
|
|
.nr_parts = ARRAY_SIZE(collie_partitions),
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct resource collie_flash_resources[] = {
|
2012-01-12 18:25:29 +08:00
|
|
|
DEFINE_RES_MEM(SA1100_CS0_PHYS, SZ_32M),
|
2005-04-17 06:20:36 +08:00
|
|
|
};
|
|
|
|
|
2012-01-14 19:50:04 +08:00
|
|
|
static struct sa1100fb_mach_info collie_lcd_info = {
|
|
|
|
.pixclock = 171521, .bpp = 16,
|
|
|
|
.xres = 320, .yres = 240,
|
|
|
|
|
|
|
|
.hsync_len = 5, .vsync_len = 1,
|
|
|
|
.left_margin = 11, .upper_margin = 2,
|
|
|
|
.right_margin = 30, .lower_margin = 0,
|
|
|
|
|
|
|
|
.sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
|
|
|
|
|
|
|
|
.lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
|
|
|
|
.lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2),
|
2012-04-03 06:17:17 +08:00
|
|
|
|
|
|
|
#ifdef CONFIG_BACKLIGHT_LOCOMO
|
|
|
|
.lcd_power = locomolcd_power
|
|
|
|
#endif
|
2012-01-14 19:50:04 +08:00
|
|
|
};
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
static void __init collie_init(void)
|
|
|
|
{
|
|
|
|
int ret = 0;
|
|
|
|
|
|
|
|
/* cpu initialize */
|
2008-05-20 05:06:51 +08:00
|
|
|
GAFR = GPIO_SSP_TXD | GPIO_SSP_SCLK | GPIO_SSP_SFRM | GPIO_SSP_CLK |
|
|
|
|
GPIO_MCP_CLK | GPIO_32_768kHz;
|
|
|
|
|
|
|
|
GPDR = GPIO_LDD8 | GPIO_LDD9 | GPIO_LDD10 | GPIO_LDD11 | GPIO_LDD12 |
|
|
|
|
GPIO_LDD13 | GPIO_LDD14 | GPIO_LDD15 | GPIO_SSP_TXD |
|
|
|
|
GPIO_SSP_SCLK | GPIO_SSP_SFRM | GPIO_SDLC_SCLK |
|
2009-10-06 04:05:38 +08:00
|
|
|
_COLLIE_GPIO_UCB1x00_RESET | _COLLIE_GPIO_nMIC_ON |
|
|
|
|
_COLLIE_GPIO_nREMOCON_ON | GPIO_32_768kHz;
|
2008-05-20 05:06:51 +08:00
|
|
|
|
|
|
|
PPDR = PPC_LDD0 | PPC_LDD1 | PPC_LDD2 | PPC_LDD3 | PPC_LDD4 | PPC_LDD5 |
|
|
|
|
PPC_LDD6 | PPC_LDD7 | PPC_L_PCLK | PPC_L_LCLK | PPC_L_FCLK | PPC_L_BIAS |
|
|
|
|
PPC_TXD1 | PPC_TXD2 | PPC_TXD3 | PPC_TXD4 | PPC_SCLK | PPC_SFRM;
|
|
|
|
|
2009-10-06 04:05:38 +08:00
|
|
|
PWER = _COLLIE_GPIO_AC_IN | _COLLIE_GPIO_CO | _COLLIE_GPIO_ON_KEY |
|
|
|
|
_COLLIE_GPIO_WAKEUP | _COLLIE_GPIO_nREMOCON_INT | PWER_RTC;
|
2008-05-20 05:06:51 +08:00
|
|
|
|
2009-10-06 04:05:38 +08:00
|
|
|
PGSR = _COLLIE_GPIO_nREMOCON_ON;
|
2008-05-20 05:06:51 +08:00
|
|
|
|
|
|
|
PSDR = PPC_RXD1 | PPC_RXD2 | PPC_RXD3 | PPC_RXD4;
|
|
|
|
|
|
|
|
PCFR = PCFR_OPDE;
|
|
|
|
|
2009-10-06 04:05:38 +08:00
|
|
|
GPSR |= _COLLIE_GPIO_UCB1x00_RESET;
|
|
|
|
|
2012-01-19 07:46:28 +08:00
|
|
|
collie_power_resource[0].start = gpio_to_irq(COLLIE_GPIO_AC_IN);
|
|
|
|
collie_power_resource[0].end = gpio_to_irq(COLLIE_GPIO_AC_IN);
|
2012-03-26 06:56:30 +08:00
|
|
|
|
2012-01-21 06:24:07 +08:00
|
|
|
sa11x0_ppc_configure_mcp();
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2006-03-25 19:07:34 +08:00
|
|
|
platform_scoop_config = &collie_pcmcia_config;
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
ret = platform_add_devices(devices, ARRAY_SIZE(devices));
|
|
|
|
if (ret) {
|
|
|
|
printk(KERN_WARNING "collie: Unable to register LoCoMo device\n");
|
|
|
|
}
|
|
|
|
|
2012-01-14 19:50:04 +08:00
|
|
|
sa11x0_register_lcd(&collie_lcd_info);
|
2009-10-06 21:55:53 +08:00
|
|
|
sa11x0_register_mtd(&collie_flash_data, collie_flash_resources,
|
|
|
|
ARRAY_SIZE(collie_flash_resources));
|
|
|
|
sa11x0_register_mcp(&collie_mcp_data);
|
2014-01-09 20:32:18 +08:00
|
|
|
sa11x0_register_irda(&collie_ir_data);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
sharpsl_save_param();
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct map_desc collie_io_desc[] __initdata = {
|
2005-10-28 22:19:04 +08:00
|
|
|
{ /* 32M main flash (cs0) */
|
|
|
|
.virtual = 0xe8000000,
|
|
|
|
.pfn = __phys_to_pfn(0x00000000),
|
|
|
|
.length = 0x02000000,
|
|
|
|
.type = MT_DEVICE
|
|
|
|
}, { /* 32M boot flash (cs1) */
|
|
|
|
.virtual = 0xea000000,
|
|
|
|
.pfn = __phys_to_pfn(0x08000000),
|
|
|
|
.length = 0x02000000,
|
|
|
|
.type = MT_DEVICE
|
|
|
|
}
|
2005-04-17 06:20:36 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
static void __init collie_map_io(void)
|
|
|
|
{
|
|
|
|
sa1100_map_io();
|
|
|
|
iotable_init(collie_io_desc, ARRAY_SIZE(collie_io_desc));
|
2006-04-01 19:13:31 +08:00
|
|
|
|
|
|
|
#ifdef CONFIG_SHARP_LOCOMO
|
|
|
|
sa1100_register_uart_fns(&collie_port_fns);
|
|
|
|
#endif
|
|
|
|
sa1100_register_uart(0, 3);
|
|
|
|
sa1100_register_uart(1, 1);
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
MACHINE_START(COLLIE, "Sharp-Collie")
|
2005-07-04 00:38:58 +08:00
|
|
|
.map_io = collie_map_io,
|
2012-02-24 07:06:51 +08:00
|
|
|
.nr_irqs = SA1100_NR_IRQS,
|
2005-07-04 00:38:58 +08:00
|
|
|
.init_irq = sa1100_init_irq,
|
2012-11-09 03:40:59 +08:00
|
|
|
.init_time = sa1100_timer_init,
|
2005-04-17 06:20:36 +08:00
|
|
|
.init_machine = collie_init,
|
2012-04-26 21:22:45 +08:00
|
|
|
.init_late = sa11x0_init_late,
|
2011-11-05 18:28:50 +08:00
|
|
|
.restart = sa11x0_restart,
|
2005-04-17 06:20:36 +08:00
|
|
|
MACHINE_END
|