jlaitine commented on PR #18817:
URL: https://github.com/apache/nuttx/pull/18817#issuecomment-4350581051

   > > Yes, it happens to many stm32xx chips as well. But I think it remounts 
from the decision that Greg took in the past, where duplication is better than 
having small differences that end-up creating many #ifdefs inside the drivers. 
If you see the arch/arm/src/stm32/ you will notice it. Most of the drivers are 
shared between F1, F2, F3 and F4 and it makes the driver more complex to read 
and maintain.
   > 
   > At the time Greg made this decision, it made sense. Now, with several new 
chip families released every year, I don't think this is a good solution. As 
the author of several stm32 ports, I'm not interested in adding support for 
additional families in the current state. The amount of code duplication has 
already reached a level that exceeds the bounds of good taste.
   > 
   > Maybe this is a good time to think about how to solve this problem better? 
in my case I'm mainly interested in stm32, but probably other architectures 
have or will have the same problem soon.
   
   This is not a very urgent topic, but I agree that it would be good to start 
thinking about it. All the points in this discussion are very valid.
   
   Just to clarify, I had a bit narrower scope in mind; I was referring to the 
CPUs and peripheral drivers only within the *same* SoC. Many SoC:s contain 
several CPU cores of different architectures.
   
   For example, i.MX95 has 4 Cortex-A cores, 1 Cortex-M7 and 1 Cortex-M33. And 
you can run NuttX in any of those CPU subsystems, depending on the need. That 
is, for that SoC (i.MX95), the peripheral IPs *are the same*, but the drivers 
get duplicated in arch/arm and arch/arm64. The same applies for i.MX93, where 
you can run nuttx in both Cortex-A cores and in Cortex-M33, also in that case 
the peripheral drivers would be duplicated in the source tree - with only very 
minor differencies like cache line width, register widths in cpu etc..
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to