Forum Discussion
Altera_Forum
Honored Contributor
20 years agoHi Mike,
> I have _not_ included MTD_WRITEABLE in my partition definition, so there must > be some other logic that's deciding this is the case. I'm getting confused WRT the partition you are actually trying to access ... mtd partition 0: 0x00200000-0x005f8000 : "ROMfs" mtd partition 1: 0x00000000-0x00200000 : "kernel" mtd partition 2: 0x00700000-0x00800000 : "Flash FS" mtd partition 3: 0x00800000-0x01000000 : "FPGA Cores" Just to be sure ... you are try to access mtd partition 1 (the "kernel" partition, minor number 2), AND it does NOT have the MTD_WRITEABLE attribute set ... correct? Given a particular minor number for the char driver, the partition number is: minor >> 1. Basically: partition = minor >> 1 partition is read only = minor & 1 partition is read/write = ~(minor & 1) irrespective of your char mode device inode attributes. E.g.: crw------- 1 root root 90, 0 Jan 1 1970 /dev/mtd0 crw------- 1 root root 90, 1 Jan 1 1970 /dev/mtd0_ro crw------- 1 root root 90, 2 Jan 1 1970 /dev/mtd1 crw------- 1 root root 90, 3 Jan 1 1970 /dev/mtd1_ro crw------- 1 root root 90, 4 Jan 1 1970 /dev/mtd2 crw------- 1 root root 90, 5 Jan 1 1970 /dev/mtd2_ro crw------- 1 root root 90, 6 Jan 1 1970 /dev/mtd3 crw------- 1 root root 90, 7 Jan 1 1970 /dev/mtd3_ro Regards, --Scott