g2gps opened a new pull request, #8233:
URL: https://github.com/apache/nuttx/pull/8233

   ## Summary
   
   When using Litex, it is possible that the chosen peripheral base addresses 
and IRQ index can change, depending on the gateware configuration.
   
   I'd like to propose a method for allowing the default values to be specified 
in another file, which possibly resides outside of the NuttX tree. For example, 
when using a custom board directory.
   
   Using the changes proposed in the pull request. I'm able, with Kconfig, to 
specify the path to the file containing the peripheral mapping for our 
gateware. Which, for example could look like this.
   
   ```c
   #ifndef __LITEX_MEMORY_MAP_H
   #define __LITEX_MEMORY_MAP_H
   
   #define LITEX_TIMER0_BASE                  0xf0004000
   #define LITEX_UART0_BASE                   0xf0005000
   
   #endif // LITEX_MEMORY_MAP_H
   ```  
   I don't have any other peripherals enabled, so I've only defined `TIMER0` 
and `UART0`. If a peripheral is enabled without the defined base address, 
compilation will fail. 
   
   The ISR index can also be redefined, in a similar way.
   
   The main concern I have with this solution is that the specified path, needs 
to be relative to the file from which it is included. So for our custom board, 
which resides beside the NuttX directory, `LITEX_CUSTOM_IRQ_DEFINITIONS_PATH` 
needs to be defined to 
`../../../../../boards/risc-v/litex/xxx/include/memory_map.h` 
   
   I'd welcome suggestions on any other alternative to this issue. 
   
   ## Impact
   
   No impact on the exiting Litex configuration. Adds additional Kconfig 
options to the "peripherals" menu.
   
   ## Testing
   
   `./tools/configure.sh arty_a7:nsh &&  make` will do a build with the new 
Kconfig options. Specifying the relative path to the included file works as 
expected.


-- 
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: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to