Matthew Fatheree <matthew.fathe...@belkin.com> writes: > support NAND device for Mamba board > > - Use kernel command line to define the partition layout. > - Add Mamba board config. Board specific support will be enabled by > this flag. The Mamba board should receive the partition table from > kernel argument from U-boot, which is prefixed by "armada-nand". We > cannot change the U-boot environment, so we have to change the pxa3xx > driver to use the "armada-nand" when checking the partition table.
[..] > @@ -0,0 +1,16 @@ > +diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c > +index 2a7a0b2..dc9d713 100644 > +--- a/drivers/mtd/nand/pxa3xx_nand.c > ++++ b/drivers/mtd/nand/pxa3xx_nand.c > +@@ -1776,7 +1776,11 @@ static int pxa3xx_nand_probe(struct platform_device > *pdev) > + * parameter. This name cannot be changed or otherwise > + * user's mtd partitions configuration would get broken. > + */ > ++#ifdef CONFIG_MACH_ARMADA_MAMBA > ++ mtd->name = "armada-nand"; > ++#else > + mtd->name = "pxa3xx_nand-0"; > ++#endif > + info->cs = cs; > + ret = pxa3xx_nand_scan(mtd); > + if (ret) { Building two incompatible versions of the same driver based on some build config setting does not seem like a good idea to me. How about finding some way to make this detectable at runtime? Bjørn _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel