RFC cpm2_devices DPRAM resource
Slightly different question than the current thread:
Should the DPRAM appear as it's own platform_device?
Option 1) Specify the portion of the DPRAM used by each device with that platform_device definition. (current)
Option 2) Define the whole DPRAM region as its own platform_device entry. Move the device DPRAM information to the device specific platform structure.
Would this help with a general dpalloc() implementation? It would reduce the number of ioremap() regions.
Another thought.
Quoted 6 lines · Allen Curtis
Slightly different question than the current thread:
Should the DPRAM appear as it's own
platform_device? Option 1) Specify the portion of the DPRAM used by each device with thatplatform_devicedefinition. (current)
Quoted 6 lines
Option 2) Define the whole DPRAM region as its own
platform_deviceentry. Move the device DPRAM information to the device specific platform structure.Would this help with a general
dpalloc()implementation? It would reduce the number ofioremap()regions.
Well, we already have an allocator for general dpram memory. I'm not really sure how this would help beyond reducing the fact that we may ioremap() regions more than once. I think the better solution there is to look at the patches that have been made to ioremap() to return the same virtual addresses if you are remapping a region of physical memory that already has a mapping.
- kumar
Quoted 6 lines
Quoted 6 lines
Slightly different question than the current thread:
Should the DPRAM appear as it's own
platform_device? Option 1) Specify the portion of the DPRAM used by each device with thatplatform_devicedefinition. (current)
Quoted 9 lines
Quoted 6 lines
Option 2) Define the whole DPRAM region as its own
platform_deviceentry. Move the device DPRAM information to the device specific platform structure.Would this help with a general
dpalloc()implementation? It would reduce the number ofioremap()regions.Well, we already have an allocator for general dpram memory. I'm not really sure how this would help beyond reducing the fact that we may
ioremap()regions more than once. I think the better solution there is to look at the patches that have been made toioremap()to return the same virtual addresses if you are remapping a region of physical memory that already has a mapping.
I guess my thought regarding the dpalloc() statement is that those functions could query the platform_device structure to find the region they are managing. Make them a little more general.
Quoted 1 line · Kumar Gala
Well, we already have an allocator for general dpram memory. I'm not really sure how this would help beyond reducing the fact that we may
ioremap()regions more than once. I think the better solution there is to look at the patches that have been made toioremap()to return the same virtual addresses if you are remapping a region of physical memory that already has a mapping.
I agree. Specifically for 85xx, we have to make sure we have CAMs mapping these spaces and ioremap() will reuse them.
-- Dan
Quoted 1 line · Allen Curtis
Should the DPRAM appear as it's own
platform_device?
No.
Quoted 1 line
Option 1) Specify the portion of the DPRAM used by each device with that
platform_devicedefinition. (current)
You mean the parameter space? That's different from DPRAM.
Quoted 1 line
Option 2) Define the whole DPRAM region as its own
platform_deviceentry. Move the device DPRAM information to the device specific platform structure.
How is this any different from using the dpalloc() as it is today?
The problem is that for the few standard devices we publicly support in Linux it is easy to think of DPRAM as a "general" resource. However, for more challenging devices and implementation, there are sometimes specific regions of DPRAM that must be used with various additional restrictions. For many of the "real world" devices I have done, drivers would manage their own, well known, DPRAM areas. It isn't something that is easy to generalize or configure in advance.
Thanks.
-- Dan
Quoted 12 lines
Quoted 1 line
Should the DPRAM appear as it's own
platform_device?No.
Quoted 1 line
Option 1) Specify the portion of the DPRAM used by each device with that
platform_devicedefinition. (current)You mean the parameter space? That's different from DPRAM.
Quoted 1 line
Option 2) Define the whole DPRAM region as its own
platform_deviceentry. Move the device DPRAM information to the device specific platform structure.How is this any different from using the
dpalloc()as it is today?
Quoted 8 lines
The problem is that for the few standard devices we publicly support in Linux it is easy to think of DPRAM as a "general" resource. However, for more challenging devices and implementation, there are sometimes specific regions of DPRAM that must be used with various additional restrictions. For many of the "real world" devices I have done, drivers would manage their own, well known, DPRAM areas. It isn't something that is easy to generalize or configure in advance.
Time for code.
- Allen
Quoted 23 lines · Allen Curtis
Quoted 15 lines
Quoted 1 line
Should the DPRAM appear as it's own
platform_device?No.
Quoted 1 line
Option 1) Specify the portion of the DPRAM used by each device with that
platform_devicedefinition. (current)You mean the parameter space? That's different from DPRAM.
Quoted 1 line
Option 2) Define the whole DPRAM region as its own
platform_deviceentry. Move the device DPRAM information to the device specific platform structure.How is this any different from using the
dpalloc()as it is today?Quoted 8 lines
The problem is that for the few standard devices we publicly support in Linux it is easy to think of DPRAM as a "general" resource. However, for more challenging devices and implementation, there are sometimes specific regions of DPRAM that must be used with various additional restrictions. For many of the "real world" devices I have done, drivers would manage their own, well known, DPRAM areas. It isn't something that is easy to generalize or configure in advance.
Quoted 4 lines
Time for code.
- Allen
FWIW the current dpalloc implementation supports "carving out" the usable dpram out of the whole. I mean you could conceivably not "give" the driver specific dpram areas to the generic allocator. This should be a per platform configuration item.
The current code just doesn't bother...
Regards
Pantelis