* MTD partition offset info via /proc/mtd & ioctl(MEMGETINFO)
@ 2004-08-09 0:35 Gopi Palaniappan
0 siblings, 0 replies; 3+ messages in thread
From: Gopi Palaniappan @ 2004-08-09 0:35 UTC (permalink / raw)
To: linux-mtd
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 3882 bytes --]
Sorry to mail this again.. I corrected the diff output
in my previous mail
Why doesn't "struct mtd_info" expose partition offset
info so it can be displayed via /proc/mtd?
Mak had asked this qn earlier
http://lists.infradead.org/pipermail/linux-mtd/2004-July/010062.html
perhaps his message was not clear... I think he was
asking why /proc/mtd does not display info on
partition offset for each mtd partition.
I made a small fix to struct mtd_info, mtdcore.c,
mtdpart.c that adds a new element "offset" to struct
mtd_info...exposing partion offset info from "struct
mtd_part" in mtdpart.c
I feel a better solution would be to move the "offset"
element in struct mtd_part into
struct mtd_info and change all occurances of
"mtd_part->offset" to
"mtdpart->mtd->offset"
Here's the patch I made...
Please let me know if you have any
comments/suggestions on the patch...or my
suggestion above to move the "offset" element from
mtd_part to mtd_info...
===========================================================
diff -rc linux2.4.old/drivers/mtd/mtdcore.c
linux2.4/drivers/mtd/mtdcore.c
*** linux2.4.old/drivers/mtd/mtdcore.c 2004-08-08
19:05:05.000000000 -0500
--- linux2.4/drivers/mtd/mtdcore.c 2004-08-08
19:03:17.000000000 -0500
***************
*** 337,344 ****
if (!this)
return 0;
!
! return sprintf(buf, "mtd%d: %8.8x %8.8x
\"%s\"\n", i, this->size,
this->erasesize, this->name);
}
--- 337,343 ----
if (!this)
return 0;
! return sprintf(buf, "mtd%d: %8.8x %8.8x %8.8x
\"%s\"\n", i, this->offset, this->size,
this->erasesize, this->name);
}
***************
*** 355,361 ****
down(&mtd_table_mutex);
! len = sprintf(page, "dev: size erasesize
name\n");
for (i=0; i< MAX_MTD_DEVICES; i++) {
l = mtd_proc_info(page + len, i);
--- 354,360 ----
down(&mtd_table_mutex);
! len = sprintf(page, "dev: offset size
erasesize name\n");
for (i=0; i< MAX_MTD_DEVICES; i++) {
l = mtd_proc_info(page + len, i);
diff -rc linux2.4.old/drivers/mtd/mtdpart.c
linux2.4/drivers/mtd/mtdpart.c
*** linux2.4.old/drivers/mtd/mtdpart.c 2004-08-08
19:04:43.000000000 -0500
--- linux2.4/drivers/mtd/mtdpart.c 2004-08-08
19:05:46.000000000 -0500
***************
*** 320,325 ****
--- 320,326 ----
slave->mtd.eccsize = master->eccsize;
slave->mtd.name = parts[i].name;
+ slave->mtd.offset = parts[i].offset;
slave->mtd.bank_size =
master->bank_size;
slave->mtd.module = master->module;
diff -rc linux2.4.old/include/linux/mtd.h
linux2.4/include/linux/mtd.h
*** linux2.4.old/include/linux/mtd.h 2004-08-08
19:01:02.000000000 -0500
--- linux2.4/include/linux/mtd.h 2004-08-08
19:07:08.000000000 -0500
***************
*** 69,74 ****
--- 69,75 ----
struct mtd_info_user {
u_char type;
u_int32_t flags;
+ u_int32_t offset; // Offset to MTD
partition
u_int32_t size; // Total size of the MTD
u_int32_t erasesize;
u_int32_t oobblock; // Size of OOB blocks
(e.g. 512)
***************
*** 137,142 ****
--- 138,144 ----
struct mtd_info {
u_char type;
u_int32_t flags;
+ u_int32_t offset; // Offset to MTD
partition
u_int32_t size; // Total size of the MTD
/* "Major" erase size for the device. Nave
users may take this
============================================================
Thanks,
Gopi
---------------------------------
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* MTD partition offset info via /proc/mtd & ioctl(MEMGETINFO)
@ 2004-08-11 3:06 Gopi Palaniappan
2004-08-12 6:50 ` Eric W. Biederman
0 siblings, 1 reply; 3+ messages in thread
From: Gopi Palaniappan @ 2004-08-11 3:06 UTC (permalink / raw)
To: linux-mtd
I didn't see any comments about my previous posting...
I was wondering if I needed to provide additional
info?
--
Gopi
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: MTD partition offset info via /proc/mtd & ioctl(MEMGETINFO)
2004-08-11 3:06 MTD partition offset info via /proc/mtd & ioctl(MEMGETINFO) Gopi Palaniappan
@ 2004-08-12 6:50 ` Eric W. Biederman
0 siblings, 0 replies; 3+ messages in thread
From: Eric W. Biederman @ 2004-08-12 6:50 UTC (permalink / raw)
To: Gopi Palaniappan; +Cc: linux-mtd
Gopi Palaniappan <gpalani1@yahoo.com> writes:
> I didn't see any comments about my previous posting...
> I was wondering if I needed to provide additional
> info?
I had a similar desire. But I wanted the physical starting address of the
mtd devices.
Modify mtd_info_user especially to stick a field in the middle a no-go
that breaks the user space ABI. And will seriously annoy people.
In talking with Dave we came up with two possible solutions. Put
the physical starting address into the name so it is displayed in /proc/mtd.
And longer term we can look at using sysfs to export that information.
I have just modified the map drivers amd76xrom and ichxrom to add that
information to the name field of /proc/mtd.
That should be a simple and expedient way to get things moving.
I am puzzled though why you would need partition offset information,
I thought the purpose of partitions was to remove the need for worrying about
offsets into the flash chip.
Eric
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-08-12 6:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-11 3:06 MTD partition offset info via /proc/mtd & ioctl(MEMGETINFO) Gopi Palaniappan
2004-08-12 6:50 ` Eric W. Biederman
-- strict thread matches above, loose matches on Subject: below --
2004-08-09 0:35 Gopi Palaniappan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox