Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 112462
b: refs/heads/master
c: 5a89770
h: refs/heads/master
v: v3
  • Loading branch information
Russell King authored and Russell King committed Oct 7, 2008
1 parent ccaba41 commit cce63c9
Show file tree
Hide file tree
Showing 21 changed files with 266 additions and 74 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: af7c951d76708c61b862463d579d76be757130bf
refs/heads/master: 5a89770daad83df74d77a8d34a1ffaedae565ce9
3 changes: 1 addition & 2 deletions trunk/arch/arm/include/asm/mach/udc_pxa2xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ struct pxa2xx_udc_mach_info {
/* Boards following the design guidelines in the developer's manual,
* with on-chip GPIOs not Lubbock's weird hardware, can have a sane
* VBUS IRQ and omit the methods above. Store the GPIO number
* here; for GPIO 0, also mask in one of the pxa_gpio_mode() bits.
* Note that sometimes the signals go through inverters...
* here. Note that sometimes the signals go through inverters...
*/
bool gpio_vbus_inverted;
u16 gpio_vbus; /* high == vbus present */
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-pxa/devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ extern struct platform_device pxa27x_device_pwm0;
extern struct platform_device pxa27x_device_pwm1;

extern struct platform_device pxa3xx_device_nand;
extern struct platform_device pxa3xx_device_i2c_power;

void __init pxa_register_device(struct platform_device *dev, void *data);
4 changes: 2 additions & 2 deletions trunk/arch/arm/mach-pxa/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void clear_reset_status(unsigned int mask)
*/
unsigned int get_clk_frequency_khz(int info)
{
if (cpu_is_pxa21x() || cpu_is_pxa25x())
if (cpu_is_pxa25x())
return pxa25x_get_clk_frequency_khz(info);
else if (cpu_is_pxa27x())
return pxa27x_get_clk_frequency_khz(info);
Expand All @@ -60,7 +60,7 @@ EXPORT_SYMBOL(get_clk_frequency_khz);
*/
unsigned int get_memclk_frequency_10khz(void)
{
if (cpu_is_pxa21x() || cpu_is_pxa25x())
if (cpu_is_pxa25x())
return pxa25x_get_memclk_frequency_10khz();
else if (cpu_is_pxa27x())
return pxa27x_get_memclk_frequency_10khz();
Expand Down
79 changes: 66 additions & 13 deletions trunk/arch/arm/mach-pxa/include/mach/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,26 +62,72 @@

#ifndef __ASSEMBLY__

/*
* CPU Stepping CPU_ID JTAG_ID
*
* PXA210 B0 0x69052922 0x2926C013
* PXA210 B1 0x69052923 0x3926C013
* PXA210 B2 0x69052924 0x4926C013
* PXA210 C0 0x69052D25 0x5926C013
*
* PXA250 A0 0x69052100 0x09264013
* PXA250 A1 0x69052101 0x19264013
* PXA250 B0 0x69052902 0x29264013
* PXA250 B1 0x69052903 0x39264013
* PXA250 B2 0x69052904 0x49264013
* PXA250 C0 0x69052D05 0x59264013
*
* PXA255 A0 0x69052D06 0x69264013
*
* PXA26x A0 0x69052903 0x39264013
* PXA26x B0 0x69052D05 0x59264013
*
* PXA27x A0 0x69054110 0x09265013
* PXA27x A1 0x69054111 0x19265013
* PXA27x B0 0x69054112 0x29265013
* PXA27x B1 0x69054113 0x39265013
* PXA27x C0 0x69054114 0x49265013
* PXA27x C5 0x69054117 0x79265013
*
* PXA30x A0 0x69056880 0x0E648013
* PXA30x A1 0x69056881 0x1E648013
* PXA31x A0 0x69056890 0x0E649013
* PXA31x A1 0x69056891 0x1E649013
* PXA31x A2 0x69056892 0x2E649013
* PXA32x B1 0x69056825 0x5E642013
* PXA32x B2 0x69056826 0x6E642013
*
* PXA930 B0 0x69056835 0x5E643013
* PXA930 B1 0x69056837 0x7E643013
* PXA930 B2 0x69056838 0x8E643013
*/
#ifdef CONFIG_PXA25x
#define __cpu_is_pxa21x(id) \
#define __cpu_is_pxa210(id) \
({ \
unsigned int _id = (id) >> 4 & 0xf3f; \
_id == 0x212; \
unsigned int _id = (id) & 0xf3f0; \
_id == 0x2120; \
})

#define __cpu_is_pxa255(id) \
({ \
unsigned int _id = (id) >> 4 & 0xfff; \
_id == 0x2d0; \
})
#define __cpu_is_pxa250(id) \
({ \
unsigned int _id = (id) & 0xf3ff; \
_id <= 0x2105; \
})

#define __cpu_is_pxa255(id) \
({ \
unsigned int _id = (id) & 0xffff; \
_id == 0x2d06; \
})

#define __cpu_is_pxa25x(id) \
({ \
unsigned int _id = (id) >> 4 & 0xfff; \
_id == 0x2d0 || _id == 0x290; \
unsigned int _id = (id) & 0xf300; \
_id == 0x2100; \
})
#else
#define __cpu_is_pxa21x(id) (0)
#define __cpu_is_pxa210(id) (0)
#define __cpu_is_pxa250(id) (0)
#define __cpu_is_pxa255(id) (0)
#define __cpu_is_pxa25x(id) (0)
#endif
Expand Down Expand Up @@ -136,9 +182,14 @@
#define __cpu_is_pxa930(id) (0)
#endif

#define cpu_is_pxa21x() \
#define cpu_is_pxa210() \
({ \
__cpu_is_pxa21x(read_cpuid_id()); \
__cpu_is_pxa210(read_cpuid_id()); \
})

#define cpu_is_pxa250() \
({ \
__cpu_is_pxa250(read_cpuid_id()); \
})

#define cpu_is_pxa255() \
Expand All @@ -151,6 +202,8 @@
__cpu_is_pxa25x(read_cpuid_id()); \
})

extern int cpu_is_pxa26x(void);

#define cpu_is_pxa27x() \
({ \
__cpu_is_pxa27x(read_cpuid_id()); \
Expand Down
9 changes: 7 additions & 2 deletions trunk/arch/arm/mach-pxa/include/mach/i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,18 @@ struct i2c_pxa_platform_data {
unsigned int slave_addr;
struct i2c_slave_client *slave;
unsigned int class;
int use_pio;
unsigned int use_pio :1;
unsigned int fast_mode :1;
};

extern void pxa_set_i2c_info(struct i2c_pxa_platform_data *info);

#ifdef CONFIG_PXA27x
extern void pxa_set_i2c_power_info(struct i2c_pxa_platform_data *info);
extern void pxa27x_set_i2c_power_info(struct i2c_pxa_platform_data *info);
#endif

#ifdef CONFIG_PXA3xx
extern void pxa3xx_set_i2c_power_info(struct i2c_pxa_platform_data *info);
#endif

#endif
2 changes: 2 additions & 0 deletions trunk/arch/arm/mach-pxa/include/mach/pm.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ struct pxa_cpu_pm_fns {
void (*restore)(unsigned long *);
int (*valid)(suspend_state_t state);
void (*enter)(suspend_state_t state);
int (*prepare)(void);
void (*finish)(void);
};

extern struct pxa_cpu_pm_fns *pxa_cpu_pm_fns;
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-pxa/include/mach/pxa-regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@
#define ICR_ALDIE (1 << 12) /* enable arbitration interrupt */
#define ICR_SADIE (1 << 13) /* slave address detected int enable */
#define ICR_UR (1 << 14) /* unit reset */
#define ICR_FM (1 << 15) /* fast mode */

#define ISR_RWM (1 << 0) /* read/write mode */
#define ISR_ACKNAK (1 << 1) /* ack/nak status */
Expand Down
24 changes: 24 additions & 0 deletions trunk/arch/arm/mach-pxa/include/mach/ssp.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define __ASM_ARCH_SSP_H

#include <linux/list.h>
#include <linux/io.h>

enum pxa_ssp_type {
SSP_UNDEFINED = 0,
Expand Down Expand Up @@ -78,6 +79,29 @@ int ssp_init(struct ssp_dev *dev, u32 port, u32 init_flags);
int ssp_config(struct ssp_dev *dev, u32 mode, u32 flags, u32 psp_flags, u32 speed);
void ssp_exit(struct ssp_dev *dev);

/**
* ssp_write_reg - Write to a SSP register
*
* @dev: SSP device to access
* @reg: Register to write to
* @val: Value to be written.
*/
static inline void ssp_write_reg(struct ssp_device *dev, u32 reg, u32 val)
{
__raw_writel(val, dev->mmio_base + reg);
}

/**
* ssp_read_reg - Read from a SSP register
*
* @dev: SSP device to access
* @reg: Register to read from
*/
static inline u32 ssp_read_reg(struct ssp_device *dev, u32 reg)
{
return __raw_readl(dev->mmio_base + reg);
}

struct ssp_device *ssp_request(int port, const char *label);
void ssp_free(struct ssp_device *);
#endif /* __ASM_ARCH_SSP_H */
18 changes: 18 additions & 0 deletions trunk/arch/arm/mach-pxa/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,27 @@ static int pxa_pm_valid(suspend_state_t state)
return -EINVAL;
}

static int pxa_pm_prepare(void)
{
int ret = 0;

if (pxa_cpu_pm_fns && pxa_cpu_pm_fns->prepare)
ret = pxa_cpu_pm_fns->prepare();

return ret;
}

static void pxa_pm_finish(void)
{
if (pxa_cpu_pm_fns && pxa_cpu_pm_fns->finish)
pxa_cpu_pm_fns->finish();
}

static struct platform_suspend_ops pxa_pm_ops = {
.valid = pxa_pm_valid,
.enter = pxa_pm_enter,
.prepare = pxa_pm_prepare,
.finish = pxa_pm_finish,
};

static int __init pxa_pm_init(void)
Expand Down
38 changes: 26 additions & 12 deletions trunk/arch/arm/mach-pxa/pxa25x.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@
#include "devices.h"
#include "clock.h"

int cpu_is_pxa26x(void)
{
return cpu_is_pxa250() && ((BOOT_DEF & 0x8) == 0);
}
EXPORT_SYMBOL_GPL(cpu_is_pxa26x);

/*
* Various clock factors driven by the CCCR register.
*/
Expand Down Expand Up @@ -218,9 +224,6 @@ static void pxa25x_cpu_pm_save(unsigned long *sleep_save)

static void pxa25x_cpu_pm_restore(unsigned long *sleep_save)
{
/* ensure not to come back here if it wasn't intended */
PSPR = 0;

RESTORE(CKEN);
RESTORE(PSTR);
}
Expand All @@ -232,19 +235,32 @@ static void pxa25x_cpu_pm_enter(suspend_state_t state)

switch (state) {
case PM_SUSPEND_MEM:
/* set resume return address */
PSPR = virt_to_phys(pxa_cpu_resume);
pxa25x_cpu_suspend(PWRMODE_SLEEP);
break;
}
}

static int pxa25x_cpu_pm_prepare(void)
{
/* set resume return address */
PSPR = virt_to_phys(pxa_cpu_resume);
return 0;
}

static void pxa25x_cpu_pm_finish(void)
{
/* ensure not to come back here if it wasn't intended */
PSPR = 0;
}

static struct pxa_cpu_pm_fns pxa25x_cpu_pm_fns = {
.save_count = SLEEP_SAVE_COUNT,
.valid = suspend_valid_only_mem,
.save = pxa25x_cpu_pm_save,
.restore = pxa25x_cpu_pm_restore,
.enter = pxa25x_cpu_pm_enter,
.prepare = pxa25x_cpu_pm_prepare,
.finish = pxa25x_cpu_pm_finish,
};

static void __init pxa25x_init_pm(void)
Expand Down Expand Up @@ -316,11 +332,7 @@ static int __init pxa25x_init(void)
{
int i, ret = 0;

/* Only add HWUART for PXA255/26x; PXA210/250/27x do not have it. */
if (cpu_is_pxa255())
clks_register(&pxa25x_hwuart_clk, 1);

if (cpu_is_pxa21x() || cpu_is_pxa25x()) {
if (cpu_is_pxa25x()) {

reset_status = RCSR;

Expand All @@ -343,9 +355,11 @@ static int __init pxa25x_init(void)
return ret;
}

/* Only add HWUART for PXA255/26x; PXA210/250/27x do not have it. */
if (cpu_is_pxa255())
/* Only add HWUART for PXA255/26x; PXA210/250 do not have it. */
if (cpu_is_pxa255() || cpu_is_pxa26x()) {
clks_register(&pxa25x_hwuart_clk, 1);
ret = platform_device_register(&pxa_device_hwuart);
}

return ret;
}
Expand Down
22 changes: 16 additions & 6 deletions trunk/arch/arm/mach-pxa/pxa27x.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,6 @@ void pxa27x_cpu_pm_save(unsigned long *sleep_save)

void pxa27x_cpu_pm_restore(unsigned long *sleep_save)
{
/* ensure not to come back here if it wasn't intended */
PSPR = 0;

RESTORE(MDREFR);
RESTORE(PCFR);

Expand Down Expand Up @@ -232,8 +229,6 @@ void pxa27x_cpu_pm_enter(suspend_state_t state)
pxa_cpu_standby();
break;
case PM_SUSPEND_MEM:
/* set resume return address */
PSPR = virt_to_phys(pxa_cpu_resume);
pxa27x_cpu_suspend(PWRMODE_SLEEP);
break;
}
Expand All @@ -244,12 +239,27 @@ static int pxa27x_cpu_pm_valid(suspend_state_t state)
return state == PM_SUSPEND_MEM || state == PM_SUSPEND_STANDBY;
}

static int pxa27x_cpu_pm_prepare(void)
{
/* set resume return address */
PSPR = virt_to_phys(pxa_cpu_resume);
return 0;
}

static void pxa27x_cpu_pm_finish(void)
{
/* ensure not to come back here if it wasn't intended */
PSPR = 0;
}

static struct pxa_cpu_pm_fns pxa27x_cpu_pm_fns = {
.save_count = SLEEP_SAVE_COUNT,
.save = pxa27x_cpu_pm_save,
.restore = pxa27x_cpu_pm_restore,
.valid = pxa27x_cpu_pm_valid,
.enter = pxa27x_cpu_pm_enter,
.prepare = pxa27x_cpu_pm_prepare,
.finish = pxa27x_cpu_pm_finish,
};

static void __init pxa27x_init_pm(void)
Expand Down Expand Up @@ -322,7 +332,7 @@ struct platform_device pxa27x_device_i2c_power = {
.num_resources = ARRAY_SIZE(i2c_power_resources),
};

void __init pxa_set_i2c_power_info(struct i2c_pxa_platform_data *info)
void __init pxa27x_set_i2c_power_info(struct i2c_pxa_platform_data *info)
{
local_irq_disable();
PCFR |= PCFR_PI2CEN;
Expand Down
Loading

0 comments on commit cce63c9

Please sign in to comment.