diff for duplicates of <200904060943.29189.sr@denx.de> diff --git a/a/1.txt b/N1/1.txt index 3688bd4..8942acf 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -1,16 +1,16 @@ On Friday 03 April 2009, Grant Likely wrote: -> > flash@f0000000,0 { -> > #address-cells = <1>; -> > #size-cells = <1>; -> > compatible = "cfi-flash"; -> > reg = <0 0x00000000 0x02000000 -> > 0 0x02000000 0x02000000>; -> > bank-width = <2>; -> > partition@0 { -> > label = "test-part1"; -> > reg = <0 0x04000000>; -> > }; -> > }; +> > =A0 =A0 =A0 =A0flash@f0000000,0 { +> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#address-cells =3D <1>; +> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#size-cells =3D <1>; +> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0compatible =3D "cfi-flash"; +> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0reg =3D <0 0x00000000 0x02000000 +> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 0 0x02000000 0x02000000>; +> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0bank-width =3D <2>; +> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0partition@0 { +> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0label =3D "test-part1"; +> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0reg =3D <0 0x04000000>; +> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}; +> > =A0 =A0 =A0 =A0}; > > Binding looks good to me. Add a variant of this blurb to > Documentation/powerpc/booting-without-of.txt. For extra credit, @@ -24,7 +24,7 @@ OK, will do. > > Signed-off-by: Stefan Roese <sr@denx.de> > > CC: Grant Likely <grant.likely@secretlab.ca> > > --- -> > drivers/mtd/maps/physmap_of.c | 174 +> > =A0drivers/mtd/maps/physmap_of.c | =A0174 > > ++++++++++++++++++++++++++++------------- 1 files changed, 120 > > insertions(+), 54 deletions(-) > > @@ -33,21 +33,21 @@ OK, will do. > > --- a/drivers/mtd/maps/physmap_of.c > > +++ b/drivers/mtd/maps/physmap_of.c > > @@ -20,13 +20,17 @@ -> > #include <linux/mtd/mtd.h> -> > #include <linux/mtd/map.h> -> > #include <linux/mtd/partitions.h> +> > =A0#include <linux/mtd/mtd.h> +> > =A0#include <linux/mtd/map.h> +> > =A0#include <linux/mtd/partitions.h> > > +#include <linux/mtd/concat.h> -> > #include <linux/of.h> -> > #include <linux/of_platform.h> +> > =A0#include <linux/of.h> +> > =A0#include <linux/of_platform.h> > > -> > +#define MAX_RESOURCES 4 +> > +#define MAX_RESOURCES =A0 =A0 =A0 =A0 =A04 > > + > > Why is this static? Because I cloned it from physmap.c. -> Instead you could define: +> Instead you could define:=20 > > struct of_flash_list { > struct mtd_info *mtd; @@ -67,95 +67,107 @@ Because I cloned it from physmap.c. > Using a zero length array at the end of the structure allows you to do > this after counting the number of reg tuples: > -> f = kzalloc(sizeof(struct of_flash) + sizeof(struct +> f =3D kzalloc(sizeof(struct of_flash) + sizeof(struct > of_flash_list)*num_chips); > > That eliminates a needless hard limit to the number of flash chips. Good idea. Will update. Thanks. -> > struct of_flash { -> > - struct mtd_info *mtd; -> > - struct map_info map; -> > - struct resource *res; -> > + struct mtd_info *mtd[MAX_RESOURCES]; -> > + struct mtd_info *cmtd; -> > + struct map_info map[MAX_RESOURCES]; -> > + struct resource *res[MAX_RESOURCES]; -> > #ifdef CONFIG_MTD_PARTITIONS -> > struct mtd_partition *parts; -> > #endif -> > @@ -88,28 +92,40 @@ static int parse_obsolete_partitions(struct of_device +> > =A0struct of_flash { +> > - =A0 =A0 =A0 struct mtd_info =A0 =A0 =A0 =A0 *mtd; +> > - =A0 =A0 =A0 struct map_info =A0 =A0 =A0 =A0 map; +> > - =A0 =A0 =A0 struct resource =A0 =A0 =A0 =A0 *res; +> > + =A0 =A0 =A0 struct mtd_info =A0 =A0 =A0 =A0 *mtd[MAX_RESOURCES]; +> > + =A0 =A0 =A0 struct mtd_info =A0 =A0 =A0 =A0 *cmtd; +> > + =A0 =A0 =A0 struct map_info =A0 =A0 =A0 =A0 map[MAX_RESOURCES]; +> > + =A0 =A0 =A0 struct resource =A0 =A0 =A0 =A0 *res[MAX_RESOURCES]; +> > =A0#ifdef CONFIG_MTD_PARTITIONS +> > =A0 =A0 =A0 =A0struct mtd_partition =A0 =A0*parts; +> > =A0#endif +> > @@ -88,28 +92,40 @@ static int parse_obsolete_partitions(struct of_devi= +ce > > *dev, static int of_flash_remove(struct of_device *dev) -> > { -> > struct of_flash *info; -> > + int i; +> > =A0{ +> > =A0 =A0 =A0 =A0struct of_flash *info; +> > + =A0 =A0 =A0 int i; > > -> > info = dev_get_drvdata(&dev->dev); -> > if (!info) -> > return 0; -> > dev_set_drvdata(&dev->dev, NULL); +> > =A0 =A0 =A0 =A0info =3D dev_get_drvdata(&dev->dev); +> > =A0 =A0 =A0 =A0if (!info) +> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return 0; +> > =A0 =A0 =A0 =A0dev_set_drvdata(&dev->dev, NULL); > > -> > - if (info->mtd) { +> > - =A0 =A0 =A0 if (info->mtd) { > > +#ifdef CONFIG_MTD_CONCAT -> > + if (info->cmtd != info->mtd[0]) { -> > + del_mtd_device(info->cmtd); -> > + mtd_concat_destroy(info->cmtd); -> > + } +> > + =A0 =A0 =A0 if (info->cmtd !=3D info->mtd[0]) { +> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 del_mtd_device(info->cmtd); +> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 mtd_concat_destroy(info->cmtd); +> > + =A0 =A0 =A0 } > > +#endif > > + -> > + if (info->cmtd) { -> > if (OF_FLASH_PARTS(info)) { -> > - del_mtd_partitions(info->mtd); -> > + del_mtd_partitions(info->cmtd); -> > kfree(OF_FLASH_PARTS(info)); -> > } else { -> > - del_mtd_device(info->mtd); -> > + del_mtd_device(info->cmtd); -> > } -> > - map_destroy(info->mtd); -> > } +> > + =A0 =A0 =A0 if (info->cmtd) { +> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (OF_FLASH_PARTS(info)) { +> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 del_mtd_partitions(info->= +mtd); +> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 del_mtd_partitions(info->= +cmtd); +> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0kfree(OF_FLASH_PARTS(inf= +o)); +> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} else { +> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 del_mtd_device(info->mtd); +> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 del_mtd_device(info->cmtd= +); +> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} +> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 map_destroy(info->mtd); +> > =A0 =A0 =A0 =A0} > > -> > - if (info->map.virt) -> > - iounmap(info->map.virt); -> > + for (i = 0; i < MAX_RESOURCES; i++) { -> > + if (info->mtd[i]) -> > + map_destroy(info->mtd[i]); +> > - =A0 =A0 =A0 if (info->map.virt) +> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 iounmap(info->map.virt); +> > + =A0 =A0 =A0 for (i =3D 0; i < MAX_RESOURCES; i++) { +> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (info->mtd[i]) +> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 map_destroy(info->mtd[i]); > > + -> > + if (info->map[i].virt) -> > + iounmap(info->map[i].virt); +> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (info->map[i].virt) +> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 iounmap(info->map[i].virt= +); > > -> > - if (info->res) { -> > - release_resource(info->res); -> > - kfree(info->res); -> > + if (info->res[i]) { -> > + release_resource(info->res[i]); -> > + kfree(info->res[i]); -> > + } -> > } +> > - =A0 =A0 =A0 if (info->res) { +> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 release_resource(info->res); +> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 kfree(info->res); +> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (info->res[i]) { +> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 release_resource(info->re= +s[i]); +> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 kfree(info->res[i]); +> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } +> > =A0 =A0 =A0 =A0} > > -> > return 0; +> > =A0 =A0 =A0 =A0return 0; > > @@ -164,15 +180,25 @@ static int __devinit of_flash_probe(struct -> > of_device *dev, const char *probe_type = match->data; -> > const u32 *width; -> > int err; +> > of_device *dev, const char *probe_type =3D match->data; +> > =A0 =A0 =A0 =A0const u32 *width; +> > =A0 =A0 =A0 =A0int err; > > - -> > - err = -ENXIO; -> > - if (of_address_to_resource(dp, 0, &res)) { -> > - dev_err(&dev->dev, "Can't get IO address from device -> > tree\n"); + int i; -> > + int count; -> > + const u32 *p; -> > + int devices_found = 0; +> > - =A0 =A0 =A0 err =3D -ENXIO; +> > - =A0 =A0 =A0 if (of_address_to_resource(dp, 0, &res)) { +> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 dev_err(&dev->dev, "Can't get IO address = +from device +> > tree\n"); + =A0 =A0 =A0 int i; +> > + =A0 =A0 =A0 int count; +> > + =A0 =A0 =A0 const u32 *p; +> > + =A0 =A0 =A0 int devices_found =3D 0; > > + -> > + /* -> > + * Get number of "reg" tuples. Scan for MTD devices on area's -> > + * described by each "reg" region. This makes it possible -> > (including + * the concat support) to support the Intel P30 -> > 48F4400 chips which + * consists internally of 2 non-identical NOR -> > chips on one die. + */ -> > + p = of_get_property(dp, "reg", &count); -> > + if (count % 12 != 0) { +> > + =A0 =A0 =A0 /* +> > + =A0 =A0 =A0 =A0* Get number of "reg" tuples. Scan for MTD devices on = +area's +> > + =A0 =A0 =A0 =A0* described by each "reg" region. This makes it possib= +le +> > (including + =A0 =A0 =A0 =A0* the concat support) to support the Intel = +P30 +> > 48F4400 chips which + =A0 =A0 =A0 =A0* consists internally of 2 non-ide= +ntical NOR +> > chips on one die. + =A0 =A0 =A0 =A0*/ +> > + =A0 =A0 =A0 p =3D of_get_property(dp, "reg", &count); +> > + =A0 =A0 =A0 if (count % 12 !=3D 0) { > > This doesn't work. You cannot know the size of each reg tuple until > #address-cells/#size-cells is parsed for the parent node. It won't diff --git a/a/content_digest b/N1/content_digest index 2ef700e..4030566 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -10,18 +10,18 @@ "\00:1\0" "b\0" "On Friday 03 April 2009, Grant Likely wrote:\n" - "> > \302\240 \302\240 \302\240 \302\240flash@f0000000,0 {\n" - "> > \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240#address-cells = <1>;\n" - "> > \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240#size-cells = <1>;\n" - "> > \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240compatible = \"cfi-flash\";\n" - "> > \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240reg = <0 0x00000000 0x02000000\n" - "> > \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 0 0x02000000 0x02000000>;\n" - "> > \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240bank-width = <2>;\n" - "> > \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240partition@0 {\n" - "> > \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240label = \"test-part1\";\n" - "> > \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240reg = <0 0x04000000>;\n" - "> > \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240};\n" - "> > \302\240 \302\240 \302\240 \302\240};\n" + "> > =A0 =A0 =A0 =A0flash@f0000000,0 {\n" + "> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#address-cells =3D <1>;\n" + "> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#size-cells =3D <1>;\n" + "> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0compatible =3D \"cfi-flash\";\n" + "> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0reg =3D <0 0x00000000 0x02000000\n" + "> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 0 0x02000000 0x02000000>;\n" + "> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0bank-width =3D <2>;\n" + "> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0partition@0 {\n" + "> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0label =3D \"test-part1\";\n" + "> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0reg =3D <0 0x04000000>;\n" + "> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0};\n" + "> > =A0 =A0 =A0 =A0};\n" ">\n" "> Binding looks good to me. Add a variant of this blurb to\n" "> Documentation/powerpc/booting-without-of.txt. For extra credit,\n" @@ -35,7 +35,7 @@ "> > Signed-off-by: Stefan Roese <sr@denx.de>\n" "> > CC: Grant Likely <grant.likely@secretlab.ca>\n" "> > ---\n" - "> > \302\240drivers/mtd/maps/physmap_of.c | \302\240174\n" + "> > =A0drivers/mtd/maps/physmap_of.c | =A0174\n" "> > ++++++++++++++++++++++++++++------------- 1 files changed, 120\n" "> > insertions(+), 54 deletions(-)\n" "> >\n" @@ -44,21 +44,21 @@ "> > --- a/drivers/mtd/maps/physmap_of.c\n" "> > +++ b/drivers/mtd/maps/physmap_of.c\n" "> > @@ -20,13 +20,17 @@\n" - "> > \302\240#include <linux/mtd/mtd.h>\n" - "> > \302\240#include <linux/mtd/map.h>\n" - "> > \302\240#include <linux/mtd/partitions.h>\n" + "> > =A0#include <linux/mtd/mtd.h>\n" + "> > =A0#include <linux/mtd/map.h>\n" + "> > =A0#include <linux/mtd/partitions.h>\n" "> > +#include <linux/mtd/concat.h>\n" - "> > \302\240#include <linux/of.h>\n" - "> > \302\240#include <linux/of_platform.h>\n" + "> > =A0#include <linux/of.h>\n" + "> > =A0#include <linux/of_platform.h>\n" "> >\n" - "> > +#define MAX_RESOURCES \302\240 \302\240 \302\240 \302\240 \302\2404\n" + "> > +#define MAX_RESOURCES =A0 =A0 =A0 =A0 =A04\n" "> > +\n" ">\n" "> Why is this static?\n" "\n" "Because I cloned it from physmap.c.\n" "\n" - "> Instead you could define: \n" + "> Instead you could define:=20\n" ">\n" "> struct of_flash_list {\n" "> struct mtd_info *mtd;\n" @@ -78,95 +78,107 @@ "> Using a zero length array at the end of the structure allows you to do\n" "> this after counting the number of reg tuples:\n" ">\n" - "> f = kzalloc(sizeof(struct of_flash) + sizeof(struct\n" + "> f =3D kzalloc(sizeof(struct of_flash) + sizeof(struct\n" "> of_flash_list)*num_chips);\n" ">\n" "> That eliminates a needless hard limit to the number of flash chips.\n" "\n" "Good idea. Will update. Thanks.\n" "\n" - "> > \302\240struct of_flash {\n" - "> > - \302\240 \302\240 \302\240 struct mtd_info \302\240 \302\240 \302\240 \302\240 *mtd;\n" - "> > - \302\240 \302\240 \302\240 struct map_info \302\240 \302\240 \302\240 \302\240 map;\n" - "> > - \302\240 \302\240 \302\240 struct resource \302\240 \302\240 \302\240 \302\240 *res;\n" - "> > + \302\240 \302\240 \302\240 struct mtd_info \302\240 \302\240 \302\240 \302\240 *mtd[MAX_RESOURCES];\n" - "> > + \302\240 \302\240 \302\240 struct mtd_info \302\240 \302\240 \302\240 \302\240 *cmtd;\n" - "> > + \302\240 \302\240 \302\240 struct map_info \302\240 \302\240 \302\240 \302\240 map[MAX_RESOURCES];\n" - "> > + \302\240 \302\240 \302\240 struct resource \302\240 \302\240 \302\240 \302\240 *res[MAX_RESOURCES];\n" - "> > \302\240#ifdef CONFIG_MTD_PARTITIONS\n" - "> > \302\240 \302\240 \302\240 \302\240struct mtd_partition \302\240 \302\240*parts;\n" - "> > \302\240#endif\n" - "> > @@ -88,28 +92,40 @@ static int parse_obsolete_partitions(struct of_device\n" + "> > =A0struct of_flash {\n" + "> > - =A0 =A0 =A0 struct mtd_info =A0 =A0 =A0 =A0 *mtd;\n" + "> > - =A0 =A0 =A0 struct map_info =A0 =A0 =A0 =A0 map;\n" + "> > - =A0 =A0 =A0 struct resource =A0 =A0 =A0 =A0 *res;\n" + "> > + =A0 =A0 =A0 struct mtd_info =A0 =A0 =A0 =A0 *mtd[MAX_RESOURCES];\n" + "> > + =A0 =A0 =A0 struct mtd_info =A0 =A0 =A0 =A0 *cmtd;\n" + "> > + =A0 =A0 =A0 struct map_info =A0 =A0 =A0 =A0 map[MAX_RESOURCES];\n" + "> > + =A0 =A0 =A0 struct resource =A0 =A0 =A0 =A0 *res[MAX_RESOURCES];\n" + "> > =A0#ifdef CONFIG_MTD_PARTITIONS\n" + "> > =A0 =A0 =A0 =A0struct mtd_partition =A0 =A0*parts;\n" + "> > =A0#endif\n" + "> > @@ -88,28 +92,40 @@ static int parse_obsolete_partitions(struct of_devi=\n" + "ce\n" "> > *dev, static int of_flash_remove(struct of_device *dev)\n" - "> > \302\240{\n" - "> > \302\240 \302\240 \302\240 \302\240struct of_flash *info;\n" - "> > + \302\240 \302\240 \302\240 int i;\n" + "> > =A0{\n" + "> > =A0 =A0 =A0 =A0struct of_flash *info;\n" + "> > + =A0 =A0 =A0 int i;\n" "> >\n" - "> > \302\240 \302\240 \302\240 \302\240info = dev_get_drvdata(&dev->dev);\n" - "> > \302\240 \302\240 \302\240 \302\240if (!info)\n" - "> > \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240return 0;\n" - "> > \302\240 \302\240 \302\240 \302\240dev_set_drvdata(&dev->dev, NULL);\n" + "> > =A0 =A0 =A0 =A0info =3D dev_get_drvdata(&dev->dev);\n" + "> > =A0 =A0 =A0 =A0if (!info)\n" + "> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return 0;\n" + "> > =A0 =A0 =A0 =A0dev_set_drvdata(&dev->dev, NULL);\n" "> >\n" - "> > - \302\240 \302\240 \302\240 if (info->mtd) {\n" + "> > - =A0 =A0 =A0 if (info->mtd) {\n" "> > +#ifdef CONFIG_MTD_CONCAT\n" - "> > + \302\240 \302\240 \302\240 if (info->cmtd != info->mtd[0]) {\n" - "> > + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 del_mtd_device(info->cmtd);\n" - "> > + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 mtd_concat_destroy(info->cmtd);\n" - "> > + \302\240 \302\240 \302\240 }\n" + "> > + =A0 =A0 =A0 if (info->cmtd !=3D info->mtd[0]) {\n" + "> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 del_mtd_device(info->cmtd);\n" + "> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 mtd_concat_destroy(info->cmtd);\n" + "> > + =A0 =A0 =A0 }\n" "> > +#endif\n" "> > +\n" - "> > + \302\240 \302\240 \302\240 if (info->cmtd) {\n" - "> > \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240if (OF_FLASH_PARTS(info)) {\n" - "> > - \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 del_mtd_partitions(info->mtd);\n" - "> > + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 del_mtd_partitions(info->cmtd);\n" - "> > \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240kfree(OF_FLASH_PARTS(info));\n" - "> > \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240} else {\n" - "> > - \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 del_mtd_device(info->mtd);\n" - "> > + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 del_mtd_device(info->cmtd);\n" - "> > \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240}\n" - "> > - \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 map_destroy(info->mtd);\n" - "> > \302\240 \302\240 \302\240 \302\240}\n" + "> > + =A0 =A0 =A0 if (info->cmtd) {\n" + "> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (OF_FLASH_PARTS(info)) {\n" + "> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 del_mtd_partitions(info->=\n" + "mtd);\n" + "> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 del_mtd_partitions(info->=\n" + "cmtd);\n" + "> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0kfree(OF_FLASH_PARTS(inf=\n" + "o));\n" + "> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} else {\n" + "> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 del_mtd_device(info->mtd);\n" + "> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 del_mtd_device(info->cmtd=\n" + ");\n" + "> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}\n" + "> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 map_destroy(info->mtd);\n" + "> > =A0 =A0 =A0 =A0}\n" "> >\n" - "> > - \302\240 \302\240 \302\240 if (info->map.virt)\n" - "> > - \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 iounmap(info->map.virt);\n" - "> > + \302\240 \302\240 \302\240 for (i = 0; i < MAX_RESOURCES; i++) {\n" - "> > + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 if (info->mtd[i])\n" - "> > + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 map_destroy(info->mtd[i]);\n" + "> > - =A0 =A0 =A0 if (info->map.virt)\n" + "> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 iounmap(info->map.virt);\n" + "> > + =A0 =A0 =A0 for (i =3D 0; i < MAX_RESOURCES; i++) {\n" + "> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (info->mtd[i])\n" + "> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 map_destroy(info->mtd[i]);\n" "> > +\n" - "> > + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 if (info->map[i].virt)\n" - "> > + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 iounmap(info->map[i].virt);\n" + "> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (info->map[i].virt)\n" + "> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 iounmap(info->map[i].virt=\n" + ");\n" "> >\n" - "> > - \302\240 \302\240 \302\240 if (info->res) {\n" - "> > - \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 release_resource(info->res);\n" - "> > - \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 kfree(info->res);\n" - "> > + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 if (info->res[i]) {\n" - "> > + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 release_resource(info->res[i]);\n" - "> > + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 kfree(info->res[i]);\n" - "> > + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 }\n" - "> > \302\240 \302\240 \302\240 \302\240}\n" + "> > - =A0 =A0 =A0 if (info->res) {\n" + "> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 release_resource(info->res);\n" + "> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 kfree(info->res);\n" + "> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (info->res[i]) {\n" + "> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 release_resource(info->re=\n" + "s[i]);\n" + "> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 kfree(info->res[i]);\n" + "> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 }\n" + "> > =A0 =A0 =A0 =A0}\n" "> >\n" - "> > \302\240 \302\240 \302\240 \302\240return 0;\n" + "> > =A0 =A0 =A0 =A0return 0;\n" "> > @@ -164,15 +180,25 @@ static int __devinit of_flash_probe(struct\n" - "> > of_device *dev, const char *probe_type = match->data;\n" - "> > \302\240 \302\240 \302\240 \302\240const u32 *width;\n" - "> > \302\240 \302\240 \302\240 \302\240int err;\n" + "> > of_device *dev, const char *probe_type =3D match->data;\n" + "> > =A0 =A0 =A0 =A0const u32 *width;\n" + "> > =A0 =A0 =A0 =A0int err;\n" "> > -\n" - "> > - \302\240 \302\240 \302\240 err = -ENXIO;\n" - "> > - \302\240 \302\240 \302\240 if (of_address_to_resource(dp, 0, &res)) {\n" - "> > - \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 dev_err(&dev->dev, \"Can't get IO address from device\n" - "> > tree\\n\"); + \302\240 \302\240 \302\240 int i;\n" - "> > + \302\240 \302\240 \302\240 int count;\n" - "> > + \302\240 \302\240 \302\240 const u32 *p;\n" - "> > + \302\240 \302\240 \302\240 int devices_found = 0;\n" + "> > - =A0 =A0 =A0 err =3D -ENXIO;\n" + "> > - =A0 =A0 =A0 if (of_address_to_resource(dp, 0, &res)) {\n" + "> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 dev_err(&dev->dev, \"Can't get IO address =\n" + "from device\n" + "> > tree\\n\"); + =A0 =A0 =A0 int i;\n" + "> > + =A0 =A0 =A0 int count;\n" + "> > + =A0 =A0 =A0 const u32 *p;\n" + "> > + =A0 =A0 =A0 int devices_found =3D 0;\n" "> > +\n" - "> > + \302\240 \302\240 \302\240 /*\n" - "> > + \302\240 \302\240 \302\240 \302\240* Get number of \"reg\" tuples. Scan for MTD devices on area's\n" - "> > + \302\240 \302\240 \302\240 \302\240* described by each \"reg\" region. This makes it possible\n" - "> > (including + \302\240 \302\240 \302\240 \302\240* the concat support) to support the Intel P30\n" - "> > 48F4400 chips which + \302\240 \302\240 \302\240 \302\240* consists internally of 2 non-identical NOR\n" - "> > chips on one die. + \302\240 \302\240 \302\240 \302\240*/\n" - "> > + \302\240 \302\240 \302\240 p = of_get_property(dp, \"reg\", &count);\n" - "> > + \302\240 \302\240 \302\240 if (count % 12 != 0) {\n" + "> > + =A0 =A0 =A0 /*\n" + "> > + =A0 =A0 =A0 =A0* Get number of \"reg\" tuples. Scan for MTD devices on =\n" + "area's\n" + "> > + =A0 =A0 =A0 =A0* described by each \"reg\" region. This makes it possib=\n" + "le\n" + "> > (including + =A0 =A0 =A0 =A0* the concat support) to support the Intel =\n" + "P30\n" + "> > 48F4400 chips which + =A0 =A0 =A0 =A0* consists internally of 2 non-ide=\n" + "ntical NOR\n" + "> > chips on one die. + =A0 =A0 =A0 =A0*/\n" + "> > + =A0 =A0 =A0 p =3D of_get_property(dp, \"reg\", &count);\n" + "> > + =A0 =A0 =A0 if (count % 12 !=3D 0) {\n" ">\n" "> This doesn't work. You cannot know the size of each reg tuple until\n" "> #address-cells/#size-cells is parsed for the parent node. It won't\n" @@ -180,4 +192,4 @@ "Best regards,\n" Stefan -c7ca45ab48e53858ae23cc205d33fe795ab26ab09f040d9eb8412e1927a97193 +ed025f74d5d988cbb018090a5cf521ef4dd38206793b9aa1d3c615edf9e24da8
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.