Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 231691
b: refs/heads/master
c: 4ad916b
h: refs/heads/master
i:
  231689: 2454b71
  231687: f573303
v: v3
  • Loading branch information
Linus Walleij authored and David Woodhouse committed Dec 3, 2010
1 parent 4300696 commit d790c4c
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 19 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: 6b2995b62eba81df0f7d0b4be5b782be623c13eb
refs/heads/master: 4ad916bca7c372110815e77c2db95fb2eb2f8ab3
66 changes: 48 additions & 18 deletions trunk/drivers/mtd/nand/fsmc_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,37 +119,69 @@ static struct fsmc_eccplace fsmc_ecc4_sp_place = {
}
};

/*
* Default partition tables to be used if the partition information not
* provided through platform data
*/
#define PARTITION(n, off, sz) {.name = n, .offset = off, .size = sz}

#ifdef CONFIG_MTD_PARTITIONS
/*
* Default partition tables to be used if the partition information not
* provided through platform data.
*
* Default partition layout for small page(= 512 bytes) devices
* Size for "Root file system" is updated in driver based on actual device size
*/
static struct mtd_partition partition_info_16KB_blk[] = {
PARTITION("X-loader", 0, 4 * 0x4000),
PARTITION("U-Boot", 0x10000, 20 * 0x4000),
PARTITION("Kernel", 0x60000, 256 * 0x4000),
PARTITION("Root File System", 0x460000, 0),
{
.name = "X-loader",
.offset = 0,
.size = 4*0x4000,
},
{
.name = "U-Boot",
.offset = 0x10000,
.size = 20*0x4000,
},
{
.name = "Kernel",
.offset = 0x60000,
.size = 256*0x4000,
},
{
.name = "Root File System",
.offset = 0x460000,
.size = 0,
},
};

/*
* Default partition layout for large page(> 512 bytes) devices
* Size for "Root file system" is updated in driver based on actual device size
*/
static struct mtd_partition partition_info_128KB_blk[] = {
PARTITION("X-loader", 0, 4 * 0x20000),
PARTITION("U-Boot", 0x80000, 12 * 0x20000),
PARTITION("Kernel", 0x200000, 48 * 0x20000),
PARTITION("Root File System", 0x800000, 0),
{
.name = "X-loader",
.offset = 0,
.size = 4*0x20000,
},
{
.name = "U-Boot",
.offset = 0x80000,
.size = 12*0x20000,
},
{
.name = "Kernel",
.offset = 0x200000,
.size = 48*0x20000,
},
{
.name = "Root File System",
.offset = 0x800000,
.size = 0,
},
};

#ifdef CONFIG_MTD_CMDLINE_PARTS
const char *part_probes[] = { "cmdlinepart", NULL };
#endif
#endif

/**
* struct fsmc_nand_data - atructure for FSMC NAND device state
Expand Down Expand Up @@ -508,7 +540,7 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
struct nand_chip *nand;
struct fsmc_regs *regs;
struct resource *res;
int nr_parts, ret = 0;
int ret = 0;

if (!pdata) {
dev_err(&pdev->dev, "platform data is NULL\n");
Expand Down Expand Up @@ -676,11 +708,9 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
* Check if partition info passed via command line
*/
host->mtd.name = "nand";
nr_parts = parse_mtd_partitions(&host->mtd, part_probes,
host->nr_partitions = parse_mtd_partitions(&host->mtd, part_probes,
&host->partitions, 0);
if (nr_parts > 0) {
host->nr_partitions = nr_parts;
} else {
if (host->nr_partitions <= 0) {
#endif
/*
* Check if partition info passed via command line
Expand Down

0 comments on commit d790c4c

Please sign in to comment.