Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 372346
b: refs/heads/master
c: 3a54435
h: refs/heads/master
v: v3
  • Loading branch information
Jon Hunter committed Apr 1, 2013
1 parent 379b065 commit 80e5ba5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 48 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: 012e338625f5ea58d2a16cf98a44779255b458ca
refs/heads/master: 3a544354d5b6e97459ba9c15e9d89dac60023553
2 changes: 1 addition & 1 deletion trunk/arch/arm/mach-omap2/gpmc-nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ int gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data,
if (err < 0)
goto out_free_cs;

err = gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_WP, 0);
err = gpmc_configure(GPMC_CONFIG_WP, 0);
if (err < 0)
goto out_free_cs;
}
Expand Down
49 changes: 7 additions & 42 deletions trunk/arch/arm/mach-omap2/gpmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,16 +550,14 @@ void gpmc_cs_free(int cs)
EXPORT_SYMBOL(gpmc_cs_free);

/**
* gpmc_cs_configure - write request to configure gpmc
* @cs: chip select number
* gpmc_configure - write request to configure gpmc
* @cmd: command type
* @wval: value to write
* @return status of the operation
*/
int gpmc_cs_configure(int cs, int cmd, int wval)
int gpmc_configure(int cmd, int wval)
{
int err = 0;
u32 regval = 0;
u32 regval;

switch (cmd) {
case GPMC_ENABLE_IRQ:
Expand All @@ -579,47 +577,14 @@ int gpmc_cs_configure(int cs, int cmd, int wval)
gpmc_write_reg(GPMC_CONFIG, regval);
break;

case GPMC_CONFIG_RDY_BSY:
regval = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
if (wval)
regval |= WR_RD_PIN_MONITORING;
else
regval &= ~WR_RD_PIN_MONITORING;
gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, regval);
break;

case GPMC_CONFIG_DEV_SIZE:
regval = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);

/* clear 2 target bits */
regval &= ~GPMC_CONFIG1_DEVICESIZE(3);

/* set the proper value */
regval |= GPMC_CONFIG1_DEVICESIZE(wval);

gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, regval);
break;

case GPMC_CONFIG_DEV_TYPE:
regval = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
/* clear 4 target bits */
regval &= ~(GPMC_CONFIG1_DEVICETYPE(3) |
GPMC_CONFIG1_MUXTYPE(3));
/* set the proper value */
regval |= GPMC_CONFIG1_DEVICETYPE(wval);
if (wval == GPMC_DEVICETYPE_NOR)
regval |= GPMC_CONFIG1_MUXADDDATA;
gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, regval);
break;

default:
printk(KERN_ERR "gpmc_configure_cs: Not supported\n");
err = -EINVAL;
pr_err("%s: command not supported\n", __func__);
return -EINVAL;
}

return err;
return 0;
}
EXPORT_SYMBOL(gpmc_cs_configure);
EXPORT_SYMBOL(gpmc_configure);

void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs)
{
Expand Down
5 changes: 1 addition & 4 deletions trunk/arch/arm/mach-omap2/gpmc.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@
#define GPMC_CONFIG1_DEVICETYPE(val) ((val & 3) << 10)
#define GPMC_CONFIG1_DEVICETYPE_NOR GPMC_CONFIG1_DEVICETYPE(0)
#define GPMC_CONFIG1_MUXTYPE(val) ((val & 3) << 8)
#define GPMC_CONFIG1_MUXNONMUX GPMC_CONFIG1_MUXTYPE(0)
#define GPMC_CONFIG1_MUXAAD GPMC_CONFIG1_MUXTYPE(GPMC_MUX_AAD)
#define GPMC_CONFIG1_MUXADDDATA GPMC_CONFIG1_MUXTYPE(GPMC_MUX_AD)
#define GPMC_CONFIG1_TIME_PARA_GRAN (1 << 4)
#define GPMC_CONFIG1_FCLK_DIV(val) (val & 3)
#define GPMC_CONFIG1_FCLK_DIV2 (GPMC_CONFIG1_FCLK_DIV(1))
Expand Down Expand Up @@ -227,6 +224,6 @@ extern int gpmc_cs_request(int cs, unsigned long size, unsigned long *base);
extern void gpmc_cs_free(int cs);
extern void omap3_gpmc_save_context(void);
extern void omap3_gpmc_restore_context(void);
extern int gpmc_cs_configure(int cs, int cmd, int wval);
extern int gpmc_configure(int cmd, int wval);

#endif

0 comments on commit 80e5ba5

Please sign in to comment.