Commit 35786727 authored by John Lenz's avatar John Lenz Committed by Russell King

[ARM PATCH] 2461/1: base support for poodle machine

Patch from John Lenz

Adds support for the Sharp Zaurus SL-5600
Add the ability to compile any collection of poodle and
corgi support under the PXA_SHARPSL option.
arch/arm/boot/compressed/head-sharpsl.S already has code
to detect the poodle machine.

Signed-off-by: John Lenz
Signed-off-by: Russell King
parent 3386c76a
......@@ -231,7 +231,7 @@ config SA1111
config SHARP_LOCOMO
bool
depends on SA1100_COLLIE
depends on SA1100_COLLIE || MACH_POODLE
default y
config SHARP_SCOOP
......
......@@ -19,28 +19,36 @@ config ARCH_PXA_IDP
select PXA25x
config PXA_SHARPSL
bool "SHARP SL-C7xx Models (Corgi, Shepherd and Husky)"
bool "SHARP SL-5600 and SL-C7xx Models"
select PXA25x
help
Say Y here if you intend to run this kernel on a
Sharp SL-C700 (Corgi), SL-C750 (Shepherd) or a
Sharp SL-C760 (Husky) handheld computer.
Sharp SL-5600 (Poodle), Sharp SL-C700 (Corgi),
SL-C750 (Shepherd) or a Sharp SL-C760 (Husky)
handheld computer.
endchoice
endmenu
config MACH_POODLE
bool "Enable Sharp SL-5600 (Poodle) Support"
depends PXA_SHARPSL
config MACH_CORGI
bool "Enable Sharp SL-C700 (Corgi) Support"
depends PXA_SHARPSL
select PXA_SHARP_C7xx
config MACH_SHEPHERD
bool "Enable Sharp SL-C750 (Shepherd) Support"
depends PXA_SHARPSL
select PXA_SHARP_C7xx
config MACH_HUSKY
bool "Enable Sharp SL-C760 (Husky) Support"
depends PXA_SHARPSL
select PXA_SHARP_C7xx
config PXA25x
bool
......@@ -57,4 +65,9 @@ config IWMMXT
help
Enable support for iWMMXt
config PXA_SHARP_C7xx
bool
help
Enable support for all Sharp C7xx models
endif
......@@ -11,7 +11,8 @@ obj-$(CONFIG_PXA27x) += pxa27x.o
obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o
obj-$(CONFIG_MACH_MAINSTONE) += mainstone.o
obj-$(CONFIG_ARCH_PXA_IDP) += idp.o
obj-$(CONFIG_PXA_SHARPSL) += corgi.o corgi_ssp.o ssp.o
obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o corgi_ssp.o ssp.o
obj-$(CONFIG_MACH_POODLE) += poodle.o
# Support for blinky lights
led-y := leds.o
......
/*
* linux/arch/arm/mach-pxa/poodle.c
*
* Support for the SHARP Poodle Board.
*
* Based on:
* linux/arch/arm/mach-pxa/lubbock.c Author: Nicolas Pitre
*
* 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.
*
* Change Log
* 12-Dec-2002 Sharp Corporation for Poodle
* John Lenz <lenz@cs.wisc.edu> updates to 2.6
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/fb.h>
#include <asm/hardware.h>
#include <asm/mach-types.h>
#include <asm/irq.h>
#include <asm/setup.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/irq.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/irq.h>
#include <asm/arch/poodle.h>
#include <asm/arch/pxafb.h>
#include <asm/hardware/scoop.h>
#include <asm/hardware/locomo.h>
#include "generic.h"
static struct resource poodle_scoop_resources[] = {
[0] = {
.start = 0x10800000,
.end = 0x10800fff,
.flags = IORESOURCE_MEM,
},
};
static struct scoop_config poodle_scoop_setup = {
.io_dir = POODLE_SCOOP_IO_DIR,
.io_out = POODLE_SCOOP_IO_OUT,
};
static struct platform_device poodle_scoop_device = {
.name = "sharp-scoop",
.id = -1,
.dev = {
.platform_data = &poodle_scoop_setup,
},
.num_resources = ARRAY_SIZE(poodle_scoop_resources),
.resource = poodle_scoop_resources,
};
/* LoCoMo device */
static struct resource locomo_resources[] = {
[0] = {
.start = 0x10000000,
.end = 0x10001fff,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_GPIO(10),
.end = IRQ_GPIO(10),
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device locomo_device = {
.name = "locomo",
.id = 0,
.num_resources = ARRAY_SIZE(locomo_resources),
.resource = locomo_resources,
};
/* PXAFB device */
static struct pxafb_mach_info poodle_fb_info __initdata = {
.pixclock = 144700,
.xres = 320,
.yres = 240,
.bpp = 16,
.hsync_len = 7,
.left_margin = 11,
.right_margin = 30,
.vsync_len = 2,
.upper_margin = 2,
.lower_margin = 0,
.sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
.lccr0 = LCCR0_Act | LCCR0_Sngl | LCCR0_Color,
.lccr3 = 0,
.pxafb_backlight_power = NULL,
.pxafb_lcd_power = NULL,
};
static struct platform_device *devices[] __initdata = {
&locomo_device,
&poodle_scoop_device,
};
static void __init poodle_init(void)
{
int ret = 0;
/* cpu initialize */
/* Pgsr Register */
PGSR0 = 0x0146dd80;
PGSR1 = 0x03bf0890;
PGSR2 = 0x0001c000;
/* Alternate Register */
GAFR0_L = 0x01001000;
GAFR0_U = 0x591a8010;
GAFR1_L = 0x900a8451;
GAFR1_U = 0xaaa5aaaa;
GAFR2_L = 0x8aaaaaaa;
GAFR2_U = 0x00000002;
/* Direction Register */
GPDR0 = 0xd3f0904c;
GPDR1 = 0xfcffb7d3;
GPDR2 = 0x0001ffff;
/* Output Register */
GPCR0 = 0x00000000;
GPCR1 = 0x00000000;
GPCR2 = 0x00000000;
GPSR0 = 0x00400000;
GPSR1 = 0x00000000;
GPSR2 = 0x00000000;
set_pxa_fb_info(&poodle_fb_info);
ret = platform_add_devices(devices, ARRAY_SIZE(devices));
if (ret) {
printk(KERN_WARNING "poodle: Unable to register LoCoMo device\n");
}
}
static struct map_desc poodle_io_desc[] __initdata = {
/* virtual physical length */
{ 0xef800000, 0x00000000, 0x00800000, MT_DEVICE }, /* Boot Flash */
};
static void __init poodle_map_io(void)
{
pxa_map_io();
iotable_init(poodle_io_desc, ARRAY_SIZE(poodle_io_desc));
/* setup sleep mode values */
PWER = 0x00000002;
PFER = 0x00000000;
PRER = 0x00000002;
PGSR0 = 0x00008000;
PGSR1 = 0x003F0202;
PGSR2 = 0x0001C000;
PCFR |= PCFR_OPDE;
}
MACHINE_START(POODLE, "SHARP Poodle")
BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000))
MAPIO(poodle_map_io)
INITIRQ(pxa_init_irq)
.timer = &pxa_timer,
.init_machine = poodle_init,
MACHINE_END
......@@ -140,14 +140,41 @@
#define IRQ_S0_BVD1_STSCHG (IRQ_BOARD_END + 53)
#define IRQ_S1_BVD1_STSCHG (IRQ_BOARD_END + 54)
#define IRQ_LOCOMO_START (IRQ_BOARD_END)
#define IRQ_LOCOMO_KEY (IRQ_BOARD_END + 0)
#define IRQ_LOCOMO_GPIO0 (IRQ_BOARD_END + 1)
#define IRQ_LOCOMO_GPIO1 (IRQ_BOARD_END + 2)
#define IRQ_LOCOMO_GPIO2 (IRQ_BOARD_END + 3)
#define IRQ_LOCOMO_GPIO3 (IRQ_BOARD_END + 4)
#define IRQ_LOCOMO_GPIO4 (IRQ_BOARD_END + 5)
#define IRQ_LOCOMO_GPIO5 (IRQ_BOARD_END + 6)
#define IRQ_LOCOMO_GPIO6 (IRQ_BOARD_END + 7)
#define IRQ_LOCOMO_GPIO7 (IRQ_BOARD_END + 8)
#define IRQ_LOCOMO_GPIO8 (IRQ_BOARD_END + 9)
#define IRQ_LOCOMO_GPIO9 (IRQ_BOARD_END + 10)
#define IRQ_LOCOMO_GPIO10 (IRQ_BOARD_END + 11)
#define IRQ_LOCOMO_GPIO11 (IRQ_BOARD_END + 12)
#define IRQ_LOCOMO_GPIO12 (IRQ_BOARD_END + 13)
#define IRQ_LOCOMO_GPIO13 (IRQ_BOARD_END + 14)
#define IRQ_LOCOMO_GPIO14 (IRQ_BOARD_END + 15)
#define IRQ_LOCOMO_GPIO15 (IRQ_BOARD_END + 16)
#define IRQ_LOCOMO_LT (IRQ_BOARD_END + 17)
#define IRQ_LOCOMO_SPI_RFR (IRQ_BOARD_END + 18)
#define IRQ_LOCOMO_SPI_RFW (IRQ_BOARD_END + 19)
#define IRQ_LOCOMO_SPI_OVRN (IRQ_BOARD_END + 20)
#define IRQ_LOCOMO_SPI_TEND (IRQ_BOARD_END + 21)
/*
* Figure out the MAX IRQ number.
*
* If we have an SA1111, the max IRQ is S1_BVD1_STSCHG+1.
* If we have an LoCoMo, the max IRQ is IRQ_LOCOMO_SPI_TEND+1
* Otherwise, we have the standard IRQs only.
*/
#ifdef CONFIG_SA1111
#define NR_IRQS (IRQ_S1_BVD1_STSCHG + 1)
#elif defined(CONFIG_SHARP_LOCOMO)
#define NR_IRQS (IRQ_LOCOMO_SPI_TEND + 1)
#elif defined(CONFIG_ARCH_LUBBOCK) || \
defined(CONFIG_MACH_MAINSTONE)
#define NR_IRQS (IRQ_BOARD_END)
......@@ -185,3 +212,8 @@
#define MAINSTONE_S1_STSCHG_IRQ MAINSTONE_IRQ(14)
#define MAINSTONE_S1_IRQ MAINSTONE_IRQ(15)
/* LoCoMo Interrupts (CONFIG_SHARP_LOCOMO) */
#define IRQ_LOCOMO_KEY_BASE (IRQ_BOARD_START + 0)
#define IRQ_LOCOMO_GPIO_BASE (IRQ_BOARD_START + 1)
#define IRQ_LOCOMO_LT_BASE (IRQ_BOARD_START + 2)
#define IRQ_LOCOMO_SPI_BASE (IRQ_BOARD_START + 3)
/*
* linux/include/asm-arm/arch-pxa/poodle.h
*
* May be copied or modified under the terms of the GNU General Public
* License. See linux/COPYING for more information.
*
* Based on:
* linux/include/asm-arm/arch-sa1100/collie.h
*
* ChangeLog:
* 04-06-2001 Lineo Japan, Inc.
* 04-16-2001 SHARP Corporation
* Update to 2.6 John Lenz
*/
#ifndef __ASM_ARCH_POODLE_H
#define __ASM_ARCH_POODLE_H 1
/*
* GPIOs
*/
/* PXA GPIOs */
#define POODLE_GPIO_ON_KEY (0)
#define POODLE_GPIO_AC_IN (1)
#define POODLE_GPIO_CO 16
#define POODLE_GPIO_TP_INT (5)
#define POODLE_GPIO_WAKEUP (11) /* change battery */
#define POODLE_GPIO_GA_INT (10)
#define POODLE_GPIO_IR_ON (22)
#define POODLE_GPIO_HP_IN (4)
#define POODLE_GPIO_CF_IRQ (17)
#define POODLE_GPIO_CF_CD (14)
#define POODLE_GPIO_CF_STSCHG (14)
#define POODLE_GPIO_SD_PWR (33)
#define POODLE_GPIO_nSD_CLK (6)
#define POODLE_GPIO_nSD_WP (7)
#define POODLE_GPIO_nSD_INT (8)
#define POODLE_GPIO_nSD_DETECT (9)
#define POODLE_GPIO_MAIN_BAT_LOW (13)
#define POODLE_GPIO_BAT_COVER (13)
#define POODLE_GPIO_ADC_TEMP_ON (21)
#define POODLE_GPIO_BYPASS_ON (36)
#define POODLE_GPIO_CHRG_ON (38)
#define POODLE_GPIO_CHRG_FULL (16)
/* PXA GPIOs */
#define POODLE_IRQ_GPIO_ON_KEY IRQ_GPIO0
#define POODLE_IRQ_GPIO_AC_IN IRQ_GPIO1
#define POODLE_IRQ_GPIO_HP_IN IRQ_GPIO4
#define POODLE_IRQ_GPIO_CO IRQ_GPIO16
#define POODLE_IRQ_GPIO_TP_INT IRQ_GPIO5
#define POODLE_IRQ_GPIO_WAKEUP IRQ_GPIO11
#define POODLE_IRQ_GPIO_GA_INT IRQ_GPIO10
#define POODLE_IRQ_GPIO_CF_IRQ IRQ_GPIO17
#define POODLE_IRQ_GPIO_CF_CD IRQ_GPIO14
#define POODLE_IRQ_GPIO_nSD_INT IRQ_GPIO8
#define POODLE_IRQ_GPIO_nSD_DETECT IRQ_GPIO9
#define POODLE_IRQ_GPIO_MAIN_BAT_LOW IRQ_GPIO13
/* SCOOP GPIOs */
#define POODLE_SCOOP_CHARGE_ON SCOOP_GPCR_PA11
#define POODLE_SCOOP_CP401 SCOOP_GPCR_PA13
#define POODLE_SCOOP_VPEN SCOOP_GPCR_PA18
#define POODLE_SCOOP_L_PCLK SCOOP_GPCR_PA20
#define POODLE_SCOOP_L_LCLK SCOOP_GPCR_PA21
#define POODLE_SCOOP_HS_OUT SCOOP_GPCR_PA22
#define POODLE_SCOOP_IO_DIR ( POODLE_SCOOP_VPEN | POODLE_SCOOP_HS_OUT )
#define POODLE_SCOOP_IO_OUT ( 0 )
/*
* Flash Memory mappings
*
* We have the following mapping:
* phys virt
* boot ROM 00000000 ef800000
*/
#define FLASH_MEM_BASE 0xa0000a00
#define FLASH_DATA(adr) (*(volatile unsigned int*)(FLASH_MEM_BASE+(adr)))
#define FLASH_DATA_F(adr) (*(volatile float32 *)(FLASH_MEM_BASE+(adr)))
#define FLASH_MAGIC_CHG(a,b,c,d) ( ( d << 24 ) | ( c << 16 ) | ( b << 8 ) | a )
/* COMADJ */
#define FLASH_COMADJ_MAJIC FLASH_MAGIC_CHG('C','M','A','D')
#define FLASH_COMADJ_MAGIC_ADR 0x00
#define FLASH_COMADJ_DATA_ADR 0x04
/* UUID */
#define FLASH_UUID_MAJIC FLASH_MAGIC_CHG('U','U','I','D')
#define FLASH_UUID_MAGIC_ADR 0x08
#define FLASH_UUID_DATA_ADR 0x0C
/* TOUCH PANEL */
#define FLASH_TOUCH_MAJIC FLASH_MAGIC_CHG('T','U','C','H')
#define FLASH_TOUCH_MAGIC_ADR 0x1C
#define FLASH_TOUCH_XP_DATA_ADR 0x20
#define FLASH_TOUCH_YP_DATA_ADR 0x24
#define FLASH_TOUCH_XD_DATA_ADR 0x28
#define FLASH_TOUCH_YD_DATA_ADR 0x2C
/* AD */
#define FLASH_AD_MAJIC FLASH_MAGIC_CHG('B','V','A','D')
#define FLASH_AD_MAGIC_ADR 0x30
#define FLASH_AD_DATA_ADR 0x34
/* PHAD */
#define FLASH_PHAD_MAJIC FLASH_MAGIC_CHG('P','H','A','D')
#define FLASH_PHAD_MAGIC_ADR 0x38
#define FLASH_PHAD_DATA_ADR 0x3C
#endif /* __ASM_ARCH_POODLE_H */
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