Skip to contentSkip to conversation

fix cfi for collie flash

PATCH In review Thomas Kunze 2 participants 6 messages Apr 22, 2008 – Apr 23, 2008 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix cfi for collie flash

Hi,

collie seems to contain LH28F640BF flash chips. According to http://sharp-world.com/products/device/flash/pdf/*FUM00701*@E.pdf
(page 83) if they have 0x51 of Extended Query Table (number of hardware partitions) set to zero, they have a single fixed partition. This patch makes those chips work.

Regards,
Thomas

drivers/mtd/chips/cfi_cmdset_0001.c +5 -1
index 0080452..34da59b 100644
@@ -618,7 +618,11 @@ static int cfi_intelext_partition_fixup(struct mtd_info *mtd,
                              + (rinfo->NumBlockTypes - 1) *
                                sizeof(struct cfi_intelext_blockinfo);
              }
-
+
+               /* if numregions=0 we have one big partition */
+               if(!numparts)
+                       numparts = 1;
+
              /* Programming Region info */
              if (extp->MinorVersion >= '4') {
                      struct cfi_intelext_programming_regioninfo *prinfo;
#1 lore raw
Quoted 7 lines · Thomas Kunze

Hi,

collie seems to contain LH28F640BF flash chips. According to
http://sharp-world.com/products/device/flash/pdf/*FUM00701*@E.pdf
(page 83) if they have 0x51 of Extended Query Table (number of hardware partitions) set to zero, they have a single fixed partition. This patch makes those chips work.

fatal: corrupt patch at line 8
Patch failed at 0001.

Signature · 1 line
dwmw2
#2 lore raw

Again with (hopefully) no line wrappings.

drivers/mtd/chips/cfi_cmdset_0001.c +5 -1
index 0080452..34da59b 100644
@@ -618,7 +618,11 @@ static int cfi_intelext_partition_fixup(struct mtd_info *mtd,
                            + (rinfo->NumBlockTypes - 1) *
                              sizeof(struct cfi_intelext_blockinfo);
            }
-
+
+               /* if numregions=0 we have one big partition */
+               if(!numparts)
+                       numparts = 1;
+
            /* Programming Region info */
            if (extp->MinorVersion >= '4') {
                    struct cfi_intelext_programming_regioninfo *prinfo;
#3 lore raw
Quoted 1 line · Thomas Kunze

Again with (hopefully) no line wrappings.

Nope. In general, it's worth sending things to yourself first, saving them from the email you receive, and checking that you can apply them to a clean tree. Only then do you send it to other people.

Also, ...

ERROR: use tabs not spaces
#65: FILE: drivers/mtd/chips/cfi_cmdset_0001.c:622:
+ /* if numregions=0 we have one big partition */$

ERROR: use tabs not spaces
#66: FILE: drivers/mtd/chips/cfi_cmdset_0001.c:623:
+ if(!numparts)$

ERROR: space required before the open parenthesis '(' #66: FILE: drivers/mtd/chips/cfi_cmdset_0001.c:623:
+ if(!numparts)

ERROR: use tabs not spaces
#67: FILE: drivers/mtd/chips/cfi_cmdset_0001.c:624:
+ numparts = 1;$

total: 4 errors, 0 warnings, 12 lines checked

I've fixed it for now, but don't let that stop you from becoming familiar with scripts/checkpatch.pl and working out how to make your mailer behave :)

Thanks for the patch.

Signature · 1 line
dwmw2
#4 lore raw
Quoted 4 lines · David Woodhouse

I've fixed it for now, but don't let that stop you from becoming familiar with scripts/checkpatch.pl and working out how to make your mailer behave :)

Thanks. I ran that patch though checkpatch.pl but my mailer seems to convert tabs to spaces :(

#5 lore raw
Quoted 8 lines · Thomas Kunze
Quoted 4 lines · David Woodhouse

I've fixed it for now, but don't let that stop you from becoming familiar with scripts/checkpatch.pl and working out how to make your mailer behave :)

Thanks. I ran that patch though checkpatch.pl but my mailer seems to convert tabs to spaces :(

Yeah, Thunderbird is a steaming pile of crap. This apparently helps:
http://mbligh.org/linuxdocs/Email/Clients/Thunderbird

Signature · 1 line
dwmw2