[U-Boot] [PATCH 1/3] Create API to map between CPU physical and bus addresses

Stephen Warren
2015-03-25T14:40:28Z

On 03/25/2015 05:55 AM, Marek Vasut wrote:
> On Wednesday, March 25, 2015 at 03:07:33 AM, Stephen Warren wrote:
>> On some SoCs, DMA-capable peripherals see a different address space to
>> the CPU's physical address space. Create an API to allow platform-agnostic
>> drivers to convert between the two address spaces when programming DMA
>> operations.
>>
>> This API will exist on all platforms, but will have a dummy implementation
>> when this feature is not required. Other platforms will enable
>> CONFIG_PHYS_TO_BUS and provide the required implementation.
>>
>> Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
>
> Applied to -next, thanks!
>
> btw. can't you use __weak here instead of a new ifdef macro (which is not
> documented btw)?

__weak wont' work with inlines, which I used to ensure zero code
overhead in the case the functions aren't needed. If we were OK with
calling a no-op function in all cases, we could indeed provide a weak
default implementation and get rid of the ifdef.

The new option is documented in the Kconfig file. I assume we don't need
to document options in multiple places (both Kconfig and README), since
if we do, the documentation is bound to become inconsistent in those two
places. Hopefully README goes away once everything is in Kconfig.