Hi all, Several people have expressed an interest in seeing some more of our Resource Manager - a kernel library for allocating/releasing on-chip resources of all PQ processors. We currently have PQ1, PQ2 and PQ3 for 2.4 and 2.6 kernels.
Attached are some of our Resource Manager files. It's not complete - just some "documentation" and examples. If you'd like to see more, please just let me know. resmgr.c - is the generic part of the Resource Manager pq2rm.c - is the part of RM that is specific to all PQ2 family members pqfcc_enet.c - is an FCC/Eth driver using the Resource Manager mpc8260ads.c - a board-specific file for the 8260ADS To get the gist of it (and without getting too long-winded here) - take parallel pin assignment in the FCC/Eth driver as an example. In pqfcc_enet.c we find the board-specific configuration choices by using pqboard_get_port_config (which is in the board-specific file). Specific pins are then set/cleared by calling pq_pin_set (or clear, program, ...). This is located in pq2rm.c. pq_pin-set uses the generic RM code to allocate a resource of this type (a parallel I/O bit), check that it is not already in use, attach it to its consumer and so on. We don't have ANY board-level dependencies anywhere in our drivers outside mpc8260ads.c. More than that - the FCC driver is completely independent of the chip itself (across any of the PQ2's or even PQ3's) since this level of dependency is handled inside the Resource Manager. If it's the same FCC in the chip, the driver is supposed completely unchanged. You can see in the source files that the RM handles allocation of clocks, GPIO, internal DPRAM and communication channels in the same way. We are in the process of updating this for platforms too. Best regards, Jonathan -------------- next part -------------- A non-text attachment was scrubbed... Name: resmgr.tar.bz2 Type: application/octet-stream Size: 41026 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20050518/2ee8fe45/attachment.obj