summaryrefslogtreecommitdiffstats
path: root/drivers/clk/at91
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '2021-02-02-drop-asm_global_data-when-unused'Tom Rini2021-02-152-2/+2
|\ | | | | | | - Merge the patch to take <asm/global_data.h> out of <common.h>
| * common: Drop asm/global_data.h from common headerSimon Glass2021-02-022-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Move this out of the common header and include it only where needed. In a number of cases this requires adding "struct udevice;" to avoid adding another large header or in other cases replacing / adding missing header files that had been pulled in, very indirectly. Finally, we have a few cases where we did not need to include <asm/global_data.h> at all, so remove that include. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
* | clk: at91: compat: partially revert "dm: Remove uses of device_bind_offset()"Eugen Hristev2021-02-111-8/+12
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert changes in at91 compat.c that cause u-boot to fail booting on sama5d4_xplained and sama5d2_xplained Log below: <debug_uart> No serial driver found Could not initialize timer (err -19) Could not initialize timer (err -19) Could not initialize timer (err -19) Could not initialize timer (err -19) Could not initialize timer (err -19) Could not initialize timer (err -19) Could not initialize timer (err -19) Could not initialize timer (err -19) Fixes: a2703ce10c ("dm: Remove uses of device_bind_offset()") Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* Merge tag 'v2021.01-rc5' into nextTom Rini2021-01-051-4/+1
|\ | | | | | | | | | | Prepare v2021.01-rc5 Signed-off-by: Tom Rini <trini@konsulko.com>
| * clk: at91: sam9x60: remove the parsing of atmel, main-osc-bypassClaudiu Beznea2020-12-071-4/+1
| | | | | | | | | | | | | | | | | | Remove the parsing of atmel,main-osc-bypass DT property as the SAM9X60 have no support for crystal oscillator bypass. Setting this bit might affect the device functionality. Fixes: a64862284f65 ("clk: at91: sam9x60: add support compatible with CCF") Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
* | dm: treewide: Rename ..._platdata variables to just ..._platSimon Glass2020-12-131-25/+25
| | | | | | | | | | | | | | Try to maintain some consistency between these variables by using _plat as a suffix for them. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: treewide: Rename ofdata_to_platdata() to of_to_plat()Simon Glass2020-12-131-6/+6
| | | | | | | | | | | | | | This name is far too long. Rename it to remove the 'data' bits. This makes it consistent with the platdata->plat rename. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: treewide: Rename dev_get_platdata() to dev_get_plat()Simon Glass2020-12-131-15/+15
| | | | | | | | | | | | Rename this to be consistent with the change from 'platdata'. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: treewide: Rename 'platdata' variables to just 'plat'Simon Glass2020-12-131-9/+9
| | | | | | | | | | | | | | | | | | | | We use 'priv' for private data but often use 'platdata' for platform data. We can't really use 'pdata' since that is ambiguous (it could mean private or platform data). Rename some of the latter variables to end with 'plat' for consistency. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: treewide: Rename auto_alloc_size members to be shorterSimon Glass2020-12-132-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | This construct is quite long-winded. In earlier days it made some sense since auto-allocation was a strange concept. But with driver model now used pretty universally, we can shorten this to 'auto'. This reduces verbosity and makes it easier to read. Coincidentally it also ensures that every declaration is on one line, thus making dtoc's job easier. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: Remove uses of device_bind_offset()Simon Glass2020-12-131-12/+8
|/ | | | | | | This function is not needed since the standard device_bind() can be used instead. Signed-off-by: Simon Glass <sjg@chromium.org>
* clk: at91: sama7g5: add 5th divisor for mck0 layout and characteristicsEugen Hristev2020-10-191-2/+2
| | | | | | | | | This SoC has the 5th divisor for the mck0 master clock. Adapt the characteristics accordingly. Reported-by: Mihai Sain <mihai.sain@microchip.com> Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
* clk: at91: clk-master: add 5th divisor for mck masterEugen Hristev2020-10-192-2/+2
| | | | | | | | | | | clk-master can have 5 divisors with a field width of 3 bits on some products. Change the mask and number of divisors accordingly. Reported-by: Mihai Sain <mihai.sain@microchip.com> Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
* clk: at91: sam9x60: add support compatible with CCFClaudiu Beznea2020-10-192-0/+650
| | | | | | Add SAM9X60 clock support compatible with CCF. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
* clk: at91: Include device_compat.h in compat.cTom Rini2020-10-161-0/+1
| | | | | | Necessary for dev_xxx. Signed-off-by: Tom Rini <trini@konsulko.com>
* clk: at91: sama7g5: add clock supportClaudiu Beznea2020-09-222-0/+1402
| | | | | | Add clock support for SAMA7G5. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
* clk: at91: pmc: add generic clock opsClaudiu Beznea2020-09-222-0/+73
| | | | | | | Add generic clock ops to be used by every AT91 PMC driver built on top of CCF. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
* clk: at91: clk-generic: add driver compatible with ccfClaudiu Beznea2020-09-223-0/+209
| | | | | | Add clk-generic driver compatible with common clock framework. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
* clk: at91: clk-peripheral: add driver compatible with ccfClaudiu Beznea2020-09-223-0/+272
| | | | | | Add clk-peripheral compatible with common clock framework. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
* clk: at91: clk-system: add driver compatible with ccfClaudiu Beznea2020-09-223-1/+116
| | | | | | Add clk-system driver compatible with common clock framework. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
* clk: at91: clk-programmable: add driver compatible with ccfClaudiu Beznea2020-09-223-1/+226
| | | | | | Add clk-programmable driver compatible with common clock framework. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
* clk: at91: clk-utmi: add support for sama7g5Claudiu Beznea2020-09-222-1/+73
| | | | | | | | Add UTMI support for SAMA7G5. SAMA7G5's UTMI control is done via XTALF register. Values written at bits 2..0 in this register correspond to the on board crystal oscillator frequency. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
* clk: at91: clk-utmi: add driver compatible with ccfClaudiu Beznea2020-09-223-0/+169
| | | | | | Add clk-utmi driver compatible with common clock framework. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
* clk: at91: clk-master: add support for sama7g5Claudiu Beznea2020-09-222-1/+182
| | | | | | | | | Add master clock (MCK1..MCK4) support for SAMA7G5. SAMA7G5's PMC has multiple master clocks feeding different subsystems. One of them feeds image subsystem and is changeable based on image subsystem needs. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
* clk: at91: clk-master: add driver compatible with ccfClaudiu Beznea2020-09-223-1/+178
| | | | | | Add clk-master driver compatible with common clock framework. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
* clk: at91: sam9x60-pll: add driver compatible with ccfClaudiu Beznea2020-09-224-0/+486
| | | | | | Add sam9x60-pll driver compatible with common clock framework. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
* clk: at91: clk-main: add driver compatible with ccfClaudiu Beznea2020-09-223-1/+398
| | | | | | Add clk-main driver compatible with common clock framework. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
* clk: at91: sckc: add driver compatible with ccfClaudiu Beznea2020-09-222-1/+173
| | | | | | | | Add sckc driver compatible with common clock framework. Driver implements slow clock support for SAM9X60 compatible IPs (in this list it is also present SAMA7G5's slow clock IP). Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
* clk: at91: move clock code to compat.cClaudiu Beznea2020-09-2216-1163/+1030
| | | | | | | | Move clock code to compat.c to allow switching to CCF without mixing CCF code with non CCF code. This prepares the field for next commits. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
* clk: at91: pmc: add helpers for clock driversClaudiu Beznea2020-09-222-0/+104
| | | | | | | Add helper for clock drivers. These will be used by following commits in the process of switching AT91 clock drivers to CCF. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
* treewide: convert devfdt_get_addr_ptr() to dev_read_addr_ptr()Masahiro Yamada2020-08-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When you enable CONFIG_OF_LIVE, you will end up with a lot of conversions. To help this tedious work, this commit converts devfdt_get_addr_ptr() to dev_read_addr_ptr() by coccinelle. I also removed redundant casts because dev_read_addr_ptr() returns an opaque pointer. To generate this commit, I ran the following semantic patch excluding include/dm/. <smpl> @@ type T; expression dev; @@ -(T *)devfdt_get_addr_ptr(dev) +dev_read_addr_ptr(dev) @@ expression dev; @@ -devfdt_get_addr_ptr(dev) +dev_read_addr_ptr(dev) </smpl> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* core: add support for U_BOOT_DRIVER_ALIASWalter Lozano2020-07-091-0/+2
| | | | | | | | | | | | | | | | Currently when using OF_PLATDATA the binding between devices and drivers is done trying to match the compatible string in the node with a driver name. However, usually a single driver supports multiple compatible strings which causes that only devices which its compatible string matches a driver name get bound. To overcome this issue, this patch adds the U_BOOT_DRIVER_ALIAS macro, which generates no code at all, but allows an easy way to declare driver name aliases. Thanks to this, dtoc could be improve to look for the driver name based on its alias when it populates the U_BOOT_DEVICE entry. Signed-off-by: Walter Lozano <walter.lozano@collabora.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* drivers: rename drivers to match compatible stringWalter Lozano2020-07-093-6/+6
| | | | | | | | | | | | | | | | | When using OF_PLATDATA, the bind process between devices and drivers is performed trying to match compatible string with driver names. However driver names are not strictly defined, and also there are different names used when declaring a driver with U_BOOT_DRIVER, the name of the symbol used in the linker list and the used in the struct driver_info. In order to make things a bit more clear, rename the drivers names. This will also help for further OF_PLATDATA improvements, such as checking for valid driver names. Signed-off-by: Walter Lozano <walter.lozano@collabora.com> Reviewed-by: Simon Glass <sjg@chromium.org> Add a fix for sandbox of-platdata to avoid using an invalid ANSI colour: Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Drop linux/bitops.h from common headerSimon Glass2020-05-181-0/+1
| | | | | | Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Drop log.h from common headerSimon Glass2020-05-183-0/+3
| | | | | | Move this header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: core: remove the duplicated function dm_ofnode_pre_relocPatrick Delaunay2020-04-161-1/+1
| | | | | | | | | | | | | | The content dm_ofnode_pre_reloc() is identical with ofnode_pre_reloc() defined in drivers/core/ofnode.c and used only three times: - drivers/core/lists.c:lists_bind_fdt() - drivers/clk/at91/pmc.c::at91_clk_sub_device_bind - drivers/clk/altera/clk-arria10.c::socfpga_a10_clk_bind So this function dm_ofnode_pre_reloc can be removed and replaced by these function calls by ofnode_pre_reloc(). Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Acked-by: Simon Glass <sjg@chromium.org>
* dm: core: Create a new header file for 'compat' featuresSimon Glass2020-02-053-0/+3
| | | | | | | | | | | | At present dm/device.h includes the linux-compatible features. This requires including linux/compat.h which in turn includes a lot of headers. One of these is malloc.h which we thus end up including in every file in U-Boot. Apart from the inefficiency of this, it is problematic for sandbox which needs to use the system malloc() in some files. Move the compatibility features into a separate header file. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: core: Require users of devres to include the headerSimon Glass2020-02-052-0/+2
| | | | | | | | | | At present devres.h is included in all files that include dm.h but few make use of it. Also this pulls in linux/compat which adds several more headers. Drop the automatic inclusion and require files to include devres themselves. This provides a good indication of which files use devres. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de>
* ARM: at91: Rename sama5_sfr.h to at91_sfr.hTudor Ambarus2019-10-081-1/+1
| | | | | | | The Special Function Registers (SFR) are present in sam9x5 and sam9x60 too, rename sama5_sfr to at91_sfr.h. Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
* clk: at91: replace dm_fdt_pre_reloc by dm_ofnode_pre_relocPatrick Delaunay2019-04-111-1/+1
| | | | | | | Prepare to remove dm_fdt_pre_reloc Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* clk: at91: utmi: add timeout for utmi lockEugen Hristev2018-08-131-1/+6
| | | | | | | | | | In case the slow clock is not properly configured, the UTMI clock cannot lock the PLL, because UPLLCOUNT will "wait X slow clock cycles". In this case U-boot will loop indefinitely. Added a timeout in this case, to start U-boot even if UTMI clock is not enabled, so the user can use different media if needed, or investigate. Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
* clk: at91: clk-h32mx: replace dm_warn with dev_dbgEugen Hristev2018-05-231-1/+1
| | | | | | | | dm_warn is too noisy, replace with dev_dbg for less noise. Based on original work by Wenyou Yang Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
* SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini2018-05-0714-28/+14
| | | | | | | | | | | | | | | | | | | | When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
* Remove unnecessary instances of DECLARE_GLOBAL_DATA_PTRTom Rini2018-04-273-6/+0
| | | | | | | | We have a large number of places where while we historically referenced gd in the code we no longer do, as well as cases where the code added that line "just in case" during development and never dropped it. Signed-off-by: Tom Rini <trini@konsulko.com>
* clk: at91: clk-system: add set/get_rate operationsWenyou Yang2018-03-161-0/+26
| | | | | | To support set/get the clock rate, add set/get_rate operations. Signed-off-by: Wenyou Yang <wenyou.yang@microchip.com>
* clk: at91: add PLLADIV driverWenyou Yang2018-03-162-1/+89
| | | | | | | | As said in the SAMA5D2 datasheet, the PLLA clock must be divided by 2 by writing the PLLADIV2 bit in PMC_MCKR, if the ratio between PCK and MCK is 3 (MDIV = 3). This is the purpose of the driver. Signed-off-by: Wenyou Yang <wenyou.yang@microchip.com>
* clk: at91: add USB Host clock driverWenyou Yang2018-03-163-0/+155
| | | | | | | | Add USB clock driver to configure the input clock and the divider in the PMC_USB register to generate a 48MHz and a 12MHz signal to the USB Host OHCI. Signed-off-by: Wenyou Yang <wenyou.yang@microchip.com>
* clk: at91: clk-generated: fix incorrect index of clk sourceWenyou Yang2017-11-291-6/+8
| | | | | | | | Differentiate the generic clock source selection value from the parent clock index to fix the incorrect assignment of the generic clock source selection. Signed-off-by: Wenyou Yang <wenyou.yang@microchip.com>
* clk: at91: clk-generated: select absolute closest rateLudovic Desroches2017-11-291-3/+1
| | | | | | | | | To get the same behavior as the Linux driver, instead of selecting the closest inferior rate, select the closest inferior or superior rate Signed-off-by: Ludovic Desroches <ludovic.desroches@microchip.com> Signed-off-by: Wenyou Yang <wenyou.yang@microchip.com>
* clk: at91: Kconfig: fix the dependency of AT91_UTMIWenyou Yang2017-11-291-3/+3
| | | | | | | What the AT91_UTMI depends on SPL_DM isn't right. AT91_UTMI is not only used in SPL, also in other place, even if SPL_DM isn't enabled. Signed-off-by: Wenyou Yang <wenyou.yang@microchip.com>