Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 339619
b: refs/heads/master
c: 3852ccd
h: refs/heads/master
i:
  339617: e1b7bf7
  339615: 7d8bdd0
v: v3
  • Loading branch information
Afzal Mohammed committed Oct 15, 2012
1 parent a2521d4 commit a44b279
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 47f88af4ed80ac9ca593543e21ebf86a31d7e8ba
refs/heads/master: 3852ccd66a9bcb2aa6f46bce5442b6d8d08e5b5d
24 changes: 24 additions & 0 deletions trunk/arch/arm/mach-omap2/gpmc-nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,27 @@ static int omap2_nand_gpmc_retime(
return 0;
}

static bool __init gpmc_hwecc_bch_capable(enum omap_ecc ecc_opt)
{
/* support only OMAP3 class */
if (!cpu_is_omap34xx()) {
pr_err("BCH ecc is not supported on this CPU\n");
return 0;
}

/*
* For now, assume 4-bit mode is only supported on OMAP3630 ES1.x, x>=1.
* Other chips may be added if confirmed to work.
*/
if ((ecc_opt == OMAP_ECC_BCH4_CODE_HW) &&
(!cpu_is_omap3630() || (GET_OMAP_REVISION() == 0))) {
pr_err("BCH 4-bit mode is not supported on this CPU\n");
return 0;
}

return 1;
}

int __init gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data,
struct gpmc_timings *gpmc_t)
{
Expand Down Expand Up @@ -128,6 +149,9 @@ int __init gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data,

gpmc_update_nand_reg(&gpmc_nand_data->reg, gpmc_nand_data->cs);

if (!gpmc_hwecc_bch_capable(gpmc_nand_data->ecc_opt))
return -EINVAL;

err = platform_device_register(&gpmc_nand_device);
if (err < 0) {
dev_err(dev, "Unable to register NAND device\n");
Expand Down

0 comments on commit a44b279

Please sign in to comment.