History log of /fuchsia/zircon/system/dev/clk/amlogic-clk/aml-clk.cpp
Revision Date Author Comments
# afda3d80 07-Sep-2018 George Kulakowski <kulakowski@google.com>

[compiler.h] Migrate more C++ code from countof to fbl::countof

Test: CQ; should be no functional change
Change-Id: Idbdb9606827eccaad936c12961f845729db00a4f


# fd3d6217 25-Aug-2018 Mike Voydanoff <voydanoff@google.com>

[platform-bus][aml-canvas] Add support for proxying SOC-specific protocols

This change adds support to the platform bus driver for proxying
SOC-specific protocols to platform devices without modifying the
platform bus source code. It also removes support for the Amlogic canvas
protocol from the platform bus driver and uses this new proxying support instead.

The Amlogic canvas driver is now split into two drivers:
the canvas implementation driver and the canvas proxy driver.
The implementation driver runs in the platform bus devhost and implements the main
functionality of the driver. The proxy driver runs in the devhosts of the
drivers that are clients of the canvas protocol and is responsible for proxying
the canvas protocol to the implementation driver.

To make this work we add a new protocol ZX_PROTOCOL_PLATFORM_PROXY
and add new support to ZX_PROTOCOL_PLATFORM_BUS.
In ZX_PROTOCOL_PLATFORM_BUS, the pbus_register_protocol() API now adds an
optional callback of type platform_proxy_cb_t. This callback handles
RPCs from a protocol proxy driver.

The new protocol ZX_PROTOCOL_PLATFORM_PROXY is used for protocol proxy drivers
to communicate with the platform bus in the client devhosts.
When the proxy driver loads, it calls platform_proxy_register_protocol()
to register its protocol implementation with the platform bus proxy driver.
When the client driver calls a protocol API implemented by the proxy driver,
the proxy driver calls platform_proxy_proxy() to proxy the protocol
to the implementation driver in the platform device devhost, via the channel
that connects the two devhosts.

Support for proxying the Amlogic canvas protocol is now removed from the
platform bus driver, since we are using this new mechanism instead.

Within the platform bus driver, we add a new class ProxyClient.
This is a subclass of ddk::Device that is used for binding the
protocol proxy drivers. In the case where a platform device relies on
SOC-specific protocols implemented using this new mechanism,
the platform bus proxy driver creates a PlatformProxyClient for each
of the protocols and waits for them all to register their protocols
via the ZX_PROTOCOL_PLATFORM_PROXY protocol before creating the
ProxyDevice object to bind the platform device driver.

Below illustrates the parts of the device tree is changed by this CL:

BEFORE:
[04:02:1] pid=1785 /boot/driver/platform-bus.so
<04:02:1> pid=2881 /boot/driver/platform-bus.proxy.so
[vim2-display] pid=2881 /boot/driver/vim-display.so
[display-controller] pid=2881 /boot/driver/display.so

AFTER:
[04:02:1] pid=1850 /boot/driver/platform-bus.so
<04:02:1> pid=3024 /boot/driver/platform-bus.proxy.so
[ProxyClient[7043414e]] pid=3024 /boot/driver/platform-bus.proxy.so
[aml-canvas-proxy] pid=3024 /boot/driver/aml-canvas.proxy.so
[ProxyDevice] pid=3024 /boot/driver/platform-bus.proxy.so
[vim2-display] pid=3024 /boot/driver/vim-display.so
[display-controller] pid=3024 /boot/driver/display.so

In the AFTER subtree, the platform proxy driver inserts a new root device that has
both the aml-canvas and vim2-display drivers as children.

TEST: manual testing on VIM2 and astro

Change-Id: Ibfa925948491fb3793dd934ee5737ace7903edb9


# 7fa9fc80 24-Aug-2018 Brijen Raval <braval@google.com>

[amlogic-clk] Enable certain clocks to allow measuring of CPU freq

- Enable CLK_SYS_PLL_DIV16 & CLK_SYS_CPU_CLK_DIV16 so we can
measure the actual CPU core freq.
- Enable clock gating for G12A family
- Currently added only support to enable/disable SYS_CPU clock
gates.
- Use Clock Protocol to enable these clocks.

Test: Manual testing on Astro.

Change-Id: I52f16aca885e8e8566337204f9b1dbd8ba281993


# db8c6033 23-Aug-2018 Mike Voydanoff <voydanoff@google.com>

[amlogic-clk] Fix uninitialized protocol passed to pbus_register_protocol()

That code was accidentally deleted in a previous change.

ZX-2542 #done

TEST: Boot on gauss, platform bus is no longer crashing
Change-Id: Idc8a28829230b31d84cf15e30ba8093f70ed7960


# d17af78d 23-Aug-2018 Brijen Raval <braval@google.com>

[amlogic][clock] Add clkctl command line utility to measure clocks

Changes in this CL
- Memcpy the static array before creating fbl::Array so
static array doesn't get destroyed when fbl::Array gets destroyed.
- Added new IOCTL to get the count of clocks in the clock_table.
- Added a command line utility to measure clocks.
- Renamed the folder because of possibility of overlapping .so's
generated due to an existing bug in the build system

Test: manual testing on Astro

Change-Id: I2c06d19cdc2c41cdcca949db15de762d1eb9e6f4