Skip to content

Commit

Permalink
Merge branch 'devel' of git://git.kernel.org/pub/scm/linux/kernel/git…
Browse files Browse the repository at this point in the history
…/ycmiao/pxa-linux-2.6 into devel-stable
  • Loading branch information
Russell King committed Oct 18, 2010
2 parents 4af8f24 + b476ef0 commit 7f9c7e2
Show file tree
Hide file tree
Showing 75 changed files with 1,252 additions and 161 deletions.
5 changes: 5 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,11 @@ M: Lennert Buytenhek <kernel@wantstofly.org>
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
S: Maintained

ARM/TETON BGA MACHINE SUPPORT
M: Mark F. Brown <mark.brown314@gmail.com>
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
S: Maintained

ARM/THECUS N2100 MACHINE SUPPORT
M: Lennert Buytenhek <kernel@wantstofly.org>
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ config ARCH_MMP
select GENERIC_CLOCKEVENTS
select TICK_ONESHOT
select PLAT_PXA
select SPARSE_IRQ
help
Support for Marvell's PXA168/PXA910(MMP) and MMP2 processor line.

Expand Down Expand Up @@ -587,6 +588,7 @@ config ARCH_PXA
select GENERIC_CLOCKEVENTS
select TICK_ONESHOT
select PLAT_PXA
select SPARSE_IRQ
help
Support for Intel/Marvell's PXA2xx/PXA3xx processor line.

Expand Down
7 changes: 7 additions & 0 deletions arch/arm/mach-mmp/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ config MACH_MARVELL_JASPER
PXA910-based development board. Since MMP2 is compatible to
ARMv6 architecture.

config MACH_TETON_BGA
bool "Marvell's PXA168 Teton BGA Development Board"
select CPU_PXA168
help
Say 'Y' here if you want to support the Marvell PXA168-based
Teton BGA Development Board.

endmenu

config CPU_PXA168
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-mmp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ obj-$(CONFIG_MACH_TAVOREVB) += tavorevb.o
obj-$(CONFIG_MACH_TTC_DKB) += ttc_dkb.o
obj-$(CONFIG_MACH_FLINT) += flint.o
obj-$(CONFIG_MACH_MARVELL_JASPER) += jasper.o
obj-$(CONFIG_MACH_TETON_BGA) += teton_bga.o
90 changes: 90 additions & 0 deletions arch/arm/mach-mmp/aspenite.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/mtd/nand.h>
#include <linux/interrupt.h>

#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <mach/addr-map.h>
#include <mach/mfp-pxa168.h>
#include <mach/pxa168.h>
#include <mach/gpio.h>
#include <video/pxa168fb.h>
#include <linux/input.h>
#include <plat/pxa27x_keypad.h>

#include "common.h"

Expand Down Expand Up @@ -66,6 +70,43 @@ static unsigned long common_pin_config[] __initdata = {
GPIO115_I2S_BCLK,
GPIO116_I2S_RXD,
GPIO117_I2S_TXD,

/* LCD */
GPIO56_LCD_FCLK_RD,
GPIO57_LCD_LCLK_A0,
GPIO58_LCD_PCLK_WR,
GPIO59_LCD_DENA_BIAS,
GPIO60_LCD_DD0,
GPIO61_LCD_DD1,
GPIO62_LCD_DD2,
GPIO63_LCD_DD3,
GPIO64_LCD_DD4,
GPIO65_LCD_DD5,
GPIO66_LCD_DD6,
GPIO67_LCD_DD7,
GPIO68_LCD_DD8,
GPIO69_LCD_DD9,
GPIO70_LCD_DD10,
GPIO71_LCD_DD11,
GPIO72_LCD_DD12,
GPIO73_LCD_DD13,
GPIO74_LCD_DD14,
GPIO75_LCD_DD15,
GPIO76_LCD_DD16,
GPIO77_LCD_DD17,
GPIO78_LCD_DD18,
GPIO79_LCD_DD19,
GPIO80_LCD_DD20,
GPIO81_LCD_DD21,
GPIO82_LCD_DD22,
GPIO83_LCD_DD23,

/* Keypad */
GPIO109_KP_MKIN1,
GPIO110_KP_MKIN0,
GPIO111_KP_MKOUT7,
GPIO112_KP_MKOUT6,
GPIO121_KP_MKIN4,
};

static struct smc91x_platdata smc91x_info = {
Expand Down Expand Up @@ -134,6 +175,51 @@ static struct i2c_board_info aspenite_i2c_info[] __initdata = {
{ I2C_BOARD_INFO("wm8753", 0x1b), },
};

static struct fb_videomode video_modes[] = {
[0] = {
.pixclock = 30120,
.refresh = 60,
.xres = 800,
.yres = 480,
.hsync_len = 1,
.left_margin = 215,
.right_margin = 40,
.vsync_len = 1,
.upper_margin = 34,
.lower_margin = 10,
.sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,
},
};

struct pxa168fb_mach_info aspenite_lcd_info = {
.id = "Graphic Frame",
.modes = video_modes,
.num_modes = ARRAY_SIZE(video_modes),
.pix_fmt = PIX_FMT_RGB565,
.io_pin_allocation_mode = PIN_MODE_DUMB_24,
.dumb_mode = DUMB_MODE_RGB888,
.active = 1,
.panel_rbswap = 0,
.invert_pixclock = 0,
};

static unsigned int aspenite_matrix_key_map[] = {
KEY(0, 6, KEY_UP), /* SW 4 */
KEY(0, 7, KEY_DOWN), /* SW 5 */
KEY(1, 6, KEY_LEFT), /* SW 6 */
KEY(1, 7, KEY_RIGHT), /* SW 7 */
KEY(4, 6, KEY_ENTER), /* SW 8 */
KEY(4, 7, KEY_ESC), /* SW 9 */
};

static struct pxa27x_keypad_platform_data aspenite_keypad_info __initdata = {
.matrix_key_rows = 5,
.matrix_key_cols = 8,
.matrix_key_map = aspenite_matrix_key_map,
.matrix_key_map_size = ARRAY_SIZE(aspenite_matrix_key_map),
.debounce_interval = 30,
};

static void __init common_init(void)
{
mfp_config(ARRAY_AND_SIZE(common_pin_config));
Expand All @@ -143,6 +229,8 @@ static void __init common_init(void)
pxa168_add_twsi(1, NULL, ARRAY_AND_SIZE(aspenite_i2c_info));
pxa168_add_ssp(1);
pxa168_add_nand(&aspenite_nand_info);
pxa168_add_fb(&aspenite_lcd_info);
pxa168_add_keypad(&aspenite_keypad_info);

/* off-chip devices */
platform_device_register(&smc91x_device);
Expand All @@ -152,6 +240,7 @@ MACHINE_START(ASPENITE, "PXA168-based Aspenite Development Platform")
.phys_io = APB_PHYS_BASE,
.io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc,
.map_io = mmp_map_io,
.nr_irqs = IRQ_BOARD_START,
.init_irq = pxa168_init_irq,
.timer = &pxa168_timer,
.init_machine = common_init,
Expand All @@ -161,6 +250,7 @@ MACHINE_START(ZYLONITE2, "PXA168-based Zylonite2 Development Platform")
.phys_io = APB_PHYS_BASE,
.io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc,
.map_io = mmp_map_io,
.nr_irqs = IRQ_BOARD_START,
.init_irq = pxa168_init_irq,
.timer = &pxa168_timer,
.init_machine = common_init,
Expand Down
10 changes: 10 additions & 0 deletions arch/arm/mach-mmp/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,20 @@

#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>

#include <asm/page.h>
#include <asm/mach/map.h>
#include <mach/addr-map.h>
#include <mach/cputype.h>

#include "common.h"

#define MMP_CHIPID (AXI_VIRT_BASE + 0x82c00)

unsigned int mmp_chip_id;
EXPORT_SYMBOL(mmp_chip_id);

static struct map_desc standard_io_desc[] __initdata = {
{
.pfn = __phys_to_pfn(APB_PHYS_BASE),
Expand All @@ -34,4 +41,7 @@ static struct map_desc standard_io_desc[] __initdata = {
void __init mmp_map_io(void)
{
iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc));

/* this is early, initialize mmp_chip_id here */
mmp_chip_id = __raw_readl(MMP_CHIPID);
}
4 changes: 4 additions & 0 deletions arch/arm/mach-mmp/flint.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <linux/smc91x.h>
#include <linux/io.h>
#include <linux/gpio.h>
#include <linux/interrupt.h>

#include <asm/mach-types.h>
#include <asm/mach/arch.h>
Expand All @@ -25,6 +26,8 @@

#include "common.h"

#define FLINT_NR_IRQS (IRQ_BOARD_START + 48)

static unsigned long flint_pin_config[] __initdata = {
/* UART1 */
GPIO45_UART1_RXD,
Expand Down Expand Up @@ -116,6 +119,7 @@ MACHINE_START(FLINT, "Flint Development Platform")
.phys_io = APB_PHYS_BASE,
.io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc,
.map_io = mmp_map_io,
.nr_irqs = FLINT_NR_IRQS,
.init_irq = mmp2_init_irq,
.timer = &mmp2_timer,
.init_machine = flint_init,
Expand Down
49 changes: 32 additions & 17 deletions arch/arm/mach-mmp/include/mach/cputype.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,51 @@
#include <asm/cputype.h>

/*
* CPU Stepping OLD_ID CPU_ID CHIP_ID
* CPU Stepping CPU_ID CHIP_ID
*
* PXA168 A0 0x41159263 0x56158400 0x00A0A333
* PXA910 Y0 0x41159262 0x56158000 0x00F0C910
* MMP2 Z0 0x560f5811
* PXA168 S0 0x56158400 0x0000C910
* PXA168 A0 0x56158400 0x00A0A168
* PXA910 Y1 0x56158400 0x00F2C920
* PXA910 A0 0x56158400 0x00F2C910
* PXA910 A1 0x56158400 0x00A0C910
* PXA920 Y0 0x56158400 0x00F2C920
* PXA920 A0 0x56158400 0x00A0C920
* PXA920 A1 0x56158400 0x00A1C920
* MMP2 Z0 0x560f5811 0x00F00410
* MMP2 Z1 0x560f5811 0x00E00410
* MMP2 A0 0x560f5811 0x00A0A610
*/

extern unsigned int mmp_chip_id;

#ifdef CONFIG_CPU_PXA168
# define __cpu_is_pxa168(id) \
({ unsigned int _id = ((id) >> 8) & 0xff; _id == 0x84; })
static inline int cpu_is_pxa168(void)
{
return (((read_cpuid_id() >> 8) & 0xff) == 0x84) &&
((mmp_chip_id & 0xfff) == 0x168);
}
#else
# define __cpu_is_pxa168(id) (0)
#define cpu_is_pxa168() (0)
#endif

/* cpu_is_pxa910() is shared on both pxa910 and pxa920 */
#ifdef CONFIG_CPU_PXA910
# define __cpu_is_pxa910(id) \
({ unsigned int _id = ((id) >> 8) & 0xff; _id == 0x80; })
static inline int cpu_is_pxa910(void)
{
return (((read_cpuid_id() >> 8) & 0xff) == 0x84) &&
(((mmp_chip_id & 0xfff) == 0x910) ||
((mmp_chip_id & 0xfff) == 0x920));
}
#else
# define __cpu_is_pxa910(id) (0)
#define cpu_is_pxa910() (0)
#endif

#ifdef CONFIG_CPU_MMP2
# define __cpu_is_mmp2(id) \
({ unsigned int _id = ((id) >> 8) & 0xff; _id == 0x58; })
static inline int cpu_is_mmp2(void)
{
return (((cpu_readid_id() >> 8) & 0xff) == 0x58);
#else
# define __cpu_is_mmp2(id) (0)
#define cpu_is_mmp2() (0)
#endif

#define cpu_is_pxa168() ({ __cpu_is_pxa168(read_cpuid_id()); })
#define cpu_is_pxa910() ({ __cpu_is_pxa910(read_cpuid_id()); })
#define cpu_is_mmp2() ({ __cpu_is_mmp2(read_cpuid_id()); })

#endif /* __ASM_MACH_CPUTYPE_H */
4 changes: 1 addition & 3 deletions arch/arm/mach-mmp/include/mach/irqs.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,8 @@
#define IRQ_GPIO_NUM 192
#define IRQ_GPIO(x) (IRQ_GPIO_START + (x))

/* Board IRQ - 64 by default, increase if not enough */
#define IRQ_BOARD_START (IRQ_GPIO_START + IRQ_GPIO_NUM)
#define IRQ_BOARD_END (IRQ_BOARD_START + 64)

#define NR_IRQS (IRQ_BOARD_END)
#define NR_IRQS (IRQ_BOARD_START)

#endif /* __ASM_MACH_IRQS_H */
7 changes: 7 additions & 0 deletions arch/arm/mach-mmp/include/mach/mfp-pxa168.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,4 +289,11 @@
#define GPIO86_PWM1_OUT MFP_CFG(GPIO86, AF2)
#define GPIO86_PWM2_OUT MFP_CFG(GPIO86, AF3)

/* Keypad */
#define GPIO109_KP_MKIN1 MFP_CFG(GPIO109, AF7)
#define GPIO110_KP_MKIN0 MFP_CFG(GPIO110, AF7)
#define GPIO111_KP_MKOUT7 MFP_CFG(GPIO111, AF7)
#define GPIO112_KP_MKOUT6 MFP_CFG(GPIO112, AF7)
#define GPIO121_KP_MKIN4 MFP_CFG(GPIO121, AF7)

#endif /* __ASM_MACH_MFP_PXA168_H */
20 changes: 20 additions & 0 deletions arch/arm/mach-mmp/include/mach/pxa168.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ struct sys_timer;

extern struct sys_timer pxa168_timer;
extern void __init pxa168_init_irq(void);
extern void pxa168_clear_keypad_wakeup(void);

#include <linux/i2c.h>
#include <mach/devices.h>
#include <plat/i2c.h>
#include <plat/pxa3xx_nand.h>
#include <video/pxa168fb.h>
#include <plat/pxa27x_keypad.h>
#include <mach/cputype.h>

extern struct pxa_device_desc pxa168_device_uart1;
extern struct pxa_device_desc pxa168_device_uart2;
Expand All @@ -25,6 +29,8 @@ extern struct pxa_device_desc pxa168_device_ssp3;
extern struct pxa_device_desc pxa168_device_ssp4;
extern struct pxa_device_desc pxa168_device_ssp5;
extern struct pxa_device_desc pxa168_device_nand;
extern struct pxa_device_desc pxa168_device_fb;
extern struct pxa_device_desc pxa168_device_keypad;

static inline int pxa168_add_uart(int id)
{
Expand Down Expand Up @@ -97,4 +103,18 @@ static inline int pxa168_add_nand(struct pxa3xx_nand_platform_data *info)
{
return pxa_register_device(&pxa168_device_nand, info, sizeof(*info));
}

static inline int pxa168_add_fb(struct pxa168fb_mach_info *mi)
{
return pxa_register_device(&pxa168_device_fb, mi, sizeof(*mi));
}

static inline int pxa168_add_keypad(struct pxa27x_keypad_platform_data *data)
{
if (cpu_is_pxa168())
data->clear_wakeup_event = pxa168_clear_keypad_wakeup;

return pxa_register_device(&pxa168_device_keypad, data, sizeof(*data));
}

#endif /* __ASM_MACH_PXA168_H */
12 changes: 12 additions & 0 deletions arch/arm/mach-mmp/include/mach/regs-apmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,16 @@
#define APMU_FNRST_DIS (1 << 1)
#define APMU_AXIRST_DIS (1 << 0)

/* Wake Clear Register */
#define APMU_WAKE_CLR APMU_REG(0x07c)

#define APMU_PXA168_KP_WAKE_CLR (1 << 7)
#define APMU_PXA168_CFI_WAKE_CLR (1 << 6)
#define APMU_PXA168_XD_WAKE_CLR (1 << 5)
#define APMU_PXA168_MSP_WAKE_CLR (1 << 4)
#define APMU_PXA168_SD4_WAKE_CLR (1 << 3)
#define APMU_PXA168_SD3_WAKE_CLR (1 << 2)
#define APMU_PXA168_SD2_WAKE_CLR (1 << 1)
#define APMU_PXA168_SD1_WAKE_CLR (1 << 0)

#endif /* __ASM_MACH_REGS_APMU_H */
Loading

0 comments on commit 7f9c7e2

Please sign in to comment.