[PATCH rtems-libbsd 3/3] freebsd/cgem: Add weak symbol for riscv
Will
nyphbl8d at gmail.com
Wed Mar 1 14:27:58 UTC 2023
This functionality is ideally implemented in a platform-specific system
level control register (SLCR) driver similar to ZynqMP and Versal. You
could also just leave it as-is since the default does exactly the same
thing. This patch should be dropped unless you're going to define an
implementation that will actually set the reference clock.
On Tue, Feb 28, 2023 at 11:57 PM Padmarao Begari <
padmarao.begari at microchip.com> wrote:
> Add __weak_symbol instead of __weak_reference for the
> cgem_set_ref_clk() function for riscv build.
> ---
> freebsd/sys/dev/cadence/if_cgem.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/freebsd/sys/dev/cadence/if_cgem.c
> b/freebsd/sys/dev/cadence/if_cgem.c
> index 363a9717..a12f7b43 100644
> --- a/freebsd/sys/dev/cadence/if_cgem.c
> +++ b/freebsd/sys/dev/cadence/if_cgem.c
> @@ -1764,6 +1764,12 @@ cgem_miibus_linkchg(device_t dev)
> * Overridable weak symbol cgem_set_ref_clk(). This allows platforms to
> * provide a function to set the cgem's reference clock.
> */
> +#ifdef __riscv
> +__weak_symbol int cgem_set_ref_clk(int unit, int frequency)
> +{
> + return 0;
> +}
> +#else
> static int __used
> cgem_default_set_ref_clk(int unit, int frequency)
> {
> @@ -1771,6 +1777,7 @@ cgem_default_set_ref_clk(int unit, int frequency)
> return 0;
> }
> __weak_reference(cgem_default_set_ref_clk, cgem_set_ref_clk);
> +#endif /* __riscv */
>
> /* Call to set reference clock and network config bits according to
> media. */
> static void
> --
> 2.25.1
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20230301/d96d9be1/attachment-0001.htm>
More information about the devel
mailing list