Bug 245160 - allow selection of am335x rtc external / internal clock source
Summary: allow selection of am335x rtc external / internal clock source
Status: In Progress
Alias: None
Product: Base System
Classification: Unclassified
Component: arm (show other bugs)
Version: 12.1-STABLE
Hardware: arm Any
: --- Affects Some People
Assignee: freebsd-arm (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-29 10:39 UTC by Oskar Holmlund
Modified: 2024-09-30 12:08 UTC (History)
3 users (show)

See Also:


Attachments
Use external or internal clock source (1.30 KB, patch)
2020-03-29 10:39 UTC, Oskar Holmlund
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oskar Holmlund 2020-03-29 10:39:47 UTC
Created attachment 212825 [details]
Use external or internal clock source

Tested on stable r359316
PB, BBB

The RTC on AM335x are used in the shutdown process of the system. Current code assumes it exists an external 32kHz clock source and configure register RTC_OSC_REG with bit RTC_OSC_REG set [1].

PocketBeagle doent have a external clock as a consequence it cant power down correctly.

Attached patch check if RTC contains a clock [2] it assumes its an external clock  otherwise an internal clock source.
Maybe a better solution is to check the name of the clocks if it contains "ext-clk" as defined in sys/gnu/dts/arm/am335x-bone-common.dtsi (used by BBB)

[1] ch 20.3.5.19 http://www.ti.com/lit/ug/spruh73q/spruh73q.pdf

[2] Documentation/devicetree/bindings/rtc/rtc-omap.txt
Comment 1 Emmanuel Vadot freebsd_committer freebsd_triage 2020-04-11 15:46:38 UTC
Since we have no proper clock support on AM33XX I think it would be better the at least check the clock names and do the proper thing based on if ext-clk/int-clk is present. This will not break if pocketbeagle dts is updated to include the internal clock.
Comment 2 Emmanuel Vadot freebsd_committer freebsd_triage 2020-09-17 09:25:35 UTC
Hi Oskar,

Is this bug still relevant after your clock driver ?
Thanks,
Comment 3 Oskar Holmlund 2020-09-19 12:30:24 UTC
(In reply to Emmanuel Vadot from comment #2)

Yes, i will update with new code.
Comment 4 Graham Perrin freebsd_committer freebsd_triage 2022-10-17 12:36:11 UTC
Keyword: 

    patch
or  patch-ready

– in lieu of summary line prefix: 

    [patch]

* bulk change for the keyword
* summary lines may be edited manually (not in bulk). 

Keyword descriptions and search interface: 

    <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>
Comment 5 Mark Linimon freebsd_committer freebsd_triage 2024-09-30 12:08:04 UTC
^Triage: bring this PR up to modern standards.

To submitter: is this PR still relevant?


OSZAR »