Add CONFIG_DEBUG_OFMEM option to configurations which implement OF memory manager. Implement DEBUG_OFMEM macro to be used by debug traces in OF memory manager code.
Index: openbios-devel/include/ofmem.h =================================================================== --- openbios-devel.orig/include/ofmem.h +++ openbios-devel/include/ofmem.h @@ -58,4 +58,10 @@ void *map_io(uint64_t pa, int size); #define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK) #endif
+#if defined(CONFIG_DEBUG_OFMEM) +# define OFMEM_TRACE(fmt, ...) do { printk("OFMEM: " fmt, ## __VA_ARGS__); } while (0) +#else +# define OFMEM_TRACE(fmt, ...) do {} while(0) +#endif + #endif /* _H_OFMEM */ Index: openbios-devel/config/examples/cross-ppc_config.xml =================================================================== --- openbios-devel.orig/config/examples/cross-ppc_config.xml +++ openbios-devel/config/examples/cross-ppc_config.xml @@ -27,6 +27,7 @@ <option name="CONFIG_SERIAL_PORT" type="integer" value="0"/> <option name="CONFIG_SERIAL_SPEED" type="integer" value="115200"/> <option name="CONFIG_DEBUG_CONSOLE_VGA" type="boolean" value="true"/> + <option name="CONFIG_DEBUG_OFMEM" type="boolean" value="false"/>
<!-- Module Configuration --> Index: openbios-devel/config/examples/cross-sparc32_config.xml =================================================================== --- openbios-devel.orig/config/examples/cross-sparc32_config.xml +++ openbios-devel/config/examples/cross-sparc32_config.xml @@ -33,6 +33,7 @@ <option name="CONFIG_DEBUG_IOMMU" type="boolean" value="false"/> <option name="CONFIG_SERIAL_PORT" type="integer" value="0"/> <option name="CONFIG_SERIAL_SPEED" type="integer" value="9600"/> + <option name="CONFIG_DEBUG_OFMEM" type="boolean" value="false"/>
<!-- Module Configuration --> Index: openbios-devel/config/examples/cross-sparc64_config.xml =================================================================== --- openbios-devel.orig/config/examples/cross-sparc64_config.xml +++ openbios-devel/config/examples/cross-sparc64_config.xml @@ -30,6 +30,7 @@ <option name="CONFIG_SERIAL_PORT" type="integer" value="0"/> <option name="CONFIG_SERIAL_SPEED" type="integer" value="115200"/> <option name="CONFIG_DEBUG_CONSOLE_VGA" type="boolean" value="true"/> + <option name="CONFIG_DEBUG_OFMEM" type="boolean" value="false"/>
<!-- Module Configuration --> Index: openbios-devel/config/examples/ppc_config.xml =================================================================== --- openbios-devel.orig/config/examples/ppc_config.xml +++ openbios-devel/config/examples/ppc_config.xml @@ -27,6 +27,7 @@ <option name="CONFIG_SERIAL_PORT" type="integer" value="0"/> <option name="CONFIG_SERIAL_SPEED" type="integer" value="115200"/> <option name="CONFIG_DEBUG_CONSOLE_VGA" type="boolean" value="true"/> + <option name="CONFIG_DEBUG_OFMEM" type="boolean" value="false"/>
<!-- Module Configuration --> Index: openbios-devel/config/examples/sparc32_config.xml =================================================================== --- openbios-devel.orig/config/examples/sparc32_config.xml +++ openbios-devel/config/examples/sparc32_config.xml @@ -33,6 +33,7 @@ <option name="CONFIG_DEBUG_IOMMU" type="boolean" value="false"/> <option name="CONFIG_SERIAL_PORT" type="integer" value="0"/> <option name="CONFIG_SERIAL_SPEED" type="integer" value="9600"/> + <option name="CONFIG_DEBUG_OFMEM" type="boolean" value="false"/>
<!-- Module Configuration --> Index: openbios-devel/config/examples/sparc64_config.xml =================================================================== --- openbios-devel.orig/config/examples/sparc64_config.xml +++ openbios-devel/config/examples/sparc64_config.xml @@ -30,6 +30,7 @@ <option name="CONFIG_SERIAL_PORT" type="integer" value="0"/> <option name="CONFIG_SERIAL_SPEED" type="integer" value="115200"/> <option name="CONFIG_DEBUG_CONSOLE_VGA" type="boolean" value="true"/> + <option name="CONFIG_DEBUG_OFMEM" type="boolean" value="false"/>
<!-- Module Configuration -->