summaryrefslogtreecommitdiffstats
path: root/drivers/soc
Commit message (Collapse)AuthorAgeFilesLines
* soc: rockchip: io-domain: handle missing supply correctlyAhmad Fatoum2 days1-1/+1
| | | | | | | | | | | | | | | The original Linux code calls regulator_get_optional and handles its -ENODEV return code, which morphed into regulator_get when ported to barebox. The error handling stayed as-is leading to causing supplies to trigger errors instead of being silently ignored. As we use NULL to describe the dummy regulator in barebox, we can add a trivial regulator_get_optional implementation and use it to fix the I/O domain driver. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240415053130.368278-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* soc: sifive: l2_cache: fix 32-bit compilationAhmad Fatoum2024-04-031-0/+1
| | | | | | | | | | The StarFive SoCs are 64-bit, but the L2 cache driver could be compile-tested on 32-bit as well. Currently, this would fail, because writeq isn't defined. Fix this by emulating it using a lo-hi write. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240402134501.3689322-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arm: mach-imx: tzasc: convert to cpu_is_mx8xyz macrosStefan Kerkmann2024-03-131-1/+1
| | | | | | | | | | | | | Instead of passing in configuration parameters at runtime we can utilize the `cpu_is_mx8xyz` macro family to determine which bits should be set. As the tzasc driver is imx specific, all functions are prefixed with `imx8m_` as well. Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Stefan Kerkmann <s.kerkmann@pengutronix.de> Link: https://lore.barebox.org/20240228-v2024-02-0-topic-imx8m-n-p-tzac-v2-3-ee1ae48dc399@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2024-02-211-3/+1
|\
| * treewide: use dev_err_probe instead of comparisons against EPROBE_DEFERAhmad Fatoum2024-02-201-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Drivers should not need to compare an error value against EPROBE_DEFER. We have a number of drivers doing that though to decide whether to print an error or not. This error message will be lost if the probe is deferred, so use dev_err_probe to store the error in that case. While at it, we shorten the error messages a bit. dev_err_probe will already print the string 'error' before the error code string. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240219172659.3796647-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: i.MX8M: convert the machine init to the soc driverMarco Felsch2024-01-292-0/+297
|/ | | | | | | | | | | | | | | | | | | | | | | | | Convert the i.MX8M machine init code to the previously introduced soc framework. The soc driver was mostly copied from Linux with slightly adaptions for barebox. To the soc driver is called during the postcore_initcall to keep the level aligned with the previous imx_init(). The ocotp clock must keept running else the ARM-SMCCC stuck for calls where the TF-A tries to access the ocotp. A sample output of the new introduced soc0 device: | | barebox@FSL i.MX8MM EVKB:/ devinfo soc0 | Bus: soc | Parameters: | family: Freescale i.MX (type: string) | machine: FSL i.MX8MM EVKB (type: string) | revision: 1.0 (type: string) | serial_number: 15182A09DAB5B3C9 (type: string) | soc_id: i.MX8MM (type: string) Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20240125133856.3792552-2-m.felsch@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/imx-hsio-blk-ctrl'Sascha Hauer2024-01-238-1528/+0
|\
| * drivers: soc: split off powerdomains into new pmdomain directoryAhmad Fatoum2024-01-228-1528/+0
| | | | | | | | | | | | | | | | | | Linux v6.6 has moved the pmdomain drivers from drivers/soc to drivers/pmdomain. Follow its lead in barebox too. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240119162610.1014870-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | soc: imx: featctrl: finalize support for i.MX8MPAhmad Fatoum2024-01-221-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We only had preliminary feature controller support for i.MX8MP and support for detecting missing VPU, DSP, NPU, LVDS and CPUs was missing. Add support for them, so barebox may fix up the kernel device tree to disable these nodes. This is especially important for the VPU and NPU as the kernel's blk-ctrl power domain driver may try to power them down as they are unused, which would make the SoC hang. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240119224522.1399213-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | nvmem: ocotp: prepare adding tester3 supportAhmad Fatoum2024-01-221-13/+19
|/ | | | | | | | | | | | The tester fuses are written to the OCOTP by NXP during production. So far, we only evaluated tester4 to determine which peripherals are missing from the SoC. On the i.MX8MP, VPU and CPUs existence is instead encoded into the tester3 fuse word. In preparation for adding support for tester4, rename the existing masks to be tester4-specific. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240119224522.1399213-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* soc: ti: Add ti_sci_pm_domains driverSascha Hauer2023-11-065-0/+206
| | | | | | | | This adds a driver to control power domains on TI K3 SoCs. The driver is based on Linux-6.5-rc3. Link: https://lore.barebox.org/20230803105003.4088205-12-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: switch regmap.h include to linux/regmap.hAhmad Fatoum2023-10-262-2/+2
| | | | | | | | | | | | | | | Now that there are no longer any users of regmap.h in headers, let's switch all users in the source files to linux/regmap.h. That way, the only users of regmap.h whether directly or indirectly will be out-of-tree code, which will fail with an error if they are dependent on the old semantics of regmap_bulk_read and regmap_bulk_write. After a transitory period, we can then drop regmap.h. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20231020071853.2826528-12-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* imx: Fix Kconfig dependencyAlexander Shiyan2023-09-041-0/+1
| | | | | | | | | | | | | | | | WARNING: unmet direct dependencies detected for IMX_OCOTP Depends on [n]: NVMEM [=n] && (ARCH_IMX6 [=n] || ARCH_VF610 [=n] || ARCH_IMX8M[=y] || ARCH_IMX7 [=n]) && OFDEVICE [=y] Selected by [y]: - IMX8M_FEATCTRL [=y] && ARCH_IMX8M [=y] WARNING: unmet direct dependencies detected for IMX_OCOTP Depends on [n]: NVMEM [=n] && (ARCH_IMX6 [=n] || ARCH_VF610 [=n] || ARCH_IMX8M[=y] || ARCH_IMX7 [=n]) && OFDEVICE [=y] Selected by [y]: - IMX8M_FEATCTRL [=y] && ARCH_IMX8M [=y] Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com> Link: https://lore.barebox.org/20230824153933.817192-1-eagle.alexander923@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* soc: kvx: Add board_sn global var from OTPJules Maselbas2023-07-261-1/+32
| | | | | | | | | Add the magic variable "kvx.board_sn" that will reflect the board serial number stored in OTP. Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu> Link: https://lore.barebox.org/20230711091123.19111-3-jmaselbas@kalray.eu Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* soc: kvx: Fix memory leaksJules Maselbas2023-07-261-0/+2
| | | | | | | | When calling nvmem_cell_get_and_read the resulting memory must be freed. Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu> Link: https://lore.barebox.org/20230711091123.19111-2-jmaselbas@kalray.eu Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* soc: kvx: Rename function to match global variableJules Maselbas2023-07-261-2/+2
| | | | | | | | | The global variable "kvx_serial" has been renamed to "kvx_mppa_id". Do the same with the function name that sets this global variable. Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu> Link: https://lore.barebox.org/20230711091123.19111-1-jmaselbas@kalray.eu Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* soc: imx: have IMX8M_FEATCTRL select IMX_OCOTPAhmad Fatoum2023-07-041-0/+1
| | | | | | | | | | | | | | IMX8M_FEATCTRL selects FEATURE_CONTROLLER, so of_feature_controller_check() will return an error if the feature controller driver is missing. Given that the default for IMX_OCOTP is n, but for IMX8M_FEATCTRL is y, this error case is easily hit. Resolve this by selecting IMX_OCOTP when IMX8M_FEATCTRL is enabled. Reported-by: Bastian Krause <bst@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230703172054.536931-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* soc: imx: featctrl: add help text for CONFIG_IMX8M_FEATCTRLAhmad Fatoum2023-07-041-1/+4
| | | | | | | | | There's no equivalent Linux driver, so a short help text is certainly in order. While at it, replace spaces with tabs for the prompt line. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230703172054.536931-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: add MODULE_DEVICE_TABLE markersAhmad Fatoum2023-06-134-0/+4
| | | | | | | | | | | | | | | | Syncing device trees with Linux upstream can lead to breakage, when the device trees are switched to newer bindings, which are not yet supported in barebox. To make it easier to spot such issues, we want to start applying some heuristics to flag possibly problematic DT changes. One step towards being able to do that is to know what nodes barebox actually consumes. Most of the nodes have a compatible entry, which is matched by an array of of_device_id, so let's have MODULE_DEVICE_TABLE point at it for future extraction. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230612125908.1087340-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Rename struct driver_d to driverSascha Hauer2023-01-104-5/+5
| | | | | | | | | | | The '_d' suffix was originally meant to distinguish barebox struct names from Linux struct names. struct driver doesn't exist in Linux, so we can rename it and remove the meaningless suffix. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-4-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Rename struct device_d to deviceSascha Hauer2023-01-105-10/+10
| | | | | | | | | | | | | The '_d' suffix was originally introduced in case we want to import Linux struct device as a separate struct into barebox. Over time it became clear that this won't happen, instead barebox struct device_d is basically the same as Linux struct device. Rename the struct name accordingly to make porting Linux code easier. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-3-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Rename device_d::device_node to device_d::of_nodeSascha Hauer2023-01-103-6/+6
| | | | | | | | | | | | | | | | | | | | Linux struct device has the member of_node for the device_node pointer. Rename this in barebox accordingly to minimize the necessary changes when porting Linux code. This was done with the semantic patch: @@ struct device_d E; @@ - E.device_node + E.of_node @@ struct device_d *E; @@ - E->device_node + E->of_node Plus some manual adjustments. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-2-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: i.MX8MP: add feature controller support for PlusAhmad Fatoum2022-10-181-7/+13
| | | | | | | | | | | | | | Plus has lots of peripherals that need be disabled, depending on fusebox settings. Some of these are already described in the upstream device tree, so reference them in the barebox DT and add the necessary glue for disabling them like we already do on i.MX8MM/N. We omit CPU fusing for now. These are handled by tester3 and would need a bit more rework. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221017134929.622022-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* soc: imx: imx8m-featctrl: check if all bits are setAhmad Fatoum2022-10-181-2/+7
| | | | | | | | | | | | | The bits are not documented in the reference manual, so the bit masks were taken from NXP code written for U-Boot. There, checking is done for whether any bit is set. For 8MP however, all-bits-set is checked. Testing on i.MX8MM shows that all bits are set though, so switch to that for uniformity. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221017134929.622022-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* soc: rockchip: add driver for rockchip io domainsMichael Riesch2022-09-225-0/+248
| | | | | | | | | | | | | The IO domains in Rockchip SoCs need to be configured to match the corresponding bank voltage. In Linux this is achieved by means of a platform driver that reads the voltage value of the supplies and configures the bits in the general register file (GRF) accordingly. Port this driver to barebox to provide support for the Rockchip RK356x SoCs. Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net> Link: https://lore.barebox.org/20220919113948.991245-2-michael.riesch@wolfvision.net Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2022-09-143-0/+71
|\
| * soc: imx: add i.MX8M feature controller driverAhmad Fatoum2022-09-013-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tester4 fuse bank of the i.MX8M is a 32-bit collection of fuses, apaprently fused during test, which contains information about the available IPs: How many cores are available and whether a VPU and GPU is available an usable. Add a imx8m_feat_ctrl_init() function that initializes a bitmap of supported features using tester4's value and registers a feature controller with a check callback that just looks up the relevant bit. This function can then be called from a standalone driver or from the fuse bank (ocotp) driver itself. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220818051955.2088238-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | soc: imx: gpcv2: make available to all i.MX8MAhmad Fatoum2022-09-131-3/+3
| | | | | | | | | | | | | | | | | | Now that the driver supports i.MX8M Mini, Nano and Plus, we should no longer restrict it to just i.MX7 and i.MX8MQ. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220905070406.539244-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | soc: imx: gpcv2: extend for i.MX8M Mini/Nano/Plus supportAhmad Fatoum2022-09-011-90/+864
| | | | | | | | | | | | | | | | | | | | Add suppport for i.MX8MM, i.MX8MN and i.MX8MP, taken directly from the kernel driver. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20220831125248.2105893-5-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | soc: imx: gpcv2: align with upstream Linux driverAhmad Fatoum2022-09-011-80/+29
| | | | | | | | | | | | | | | | | | | | Bring the code closer to the upstream Linux driver to make it better comparable to that code. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20220831125248.2105893-4-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | soc: imx: gpcv2: split power_up/power_offAhmad Fatoum2022-09-011-13/+79
| | | | | | | | | | | | | | | | | | | | | | | | Splitting a single power function into power_up/power_off makes the code easier to follow. The kernel uses the same approach, so do it for barebox as well. This only splits up the functions into two without functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20220831125248.2105893-3-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | soc: imx: gpcv2: switch to regmapAhmad Fatoum2022-09-011-23/+32
|/ | | | | | | | | | The Kernel driver uses regmap, so switch to regmap as well to get the code closer to the kernel code. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20220831125248.2105893-2-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* soc: imx: gpcv2: associate PGC device tree node with platform deviceAhmad Fatoum2022-08-091-1/+1
| | | | | | | | | | We aren't using of_platform_device_create, but instead create our own platform devices which lack a reference from the device tree node to the newly created device. Add this reference to support of_device_ensure_probed. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220808140035.1672733-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers: soc: Fix unconditional compilation of imx directoryAlexander Shiyan2022-06-101-2/+2
| | | | | | | | As a side change, this patch sorts entries alphabetically. Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com> Link: https://lore.barebox.org/20220601060226.3756-4-eagle.alexander923@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2022-01-191-2/+20
|\
| * soc: imx: gpcv2: split PGC domain probe in two passesLucas Stach2022-01-181-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently it is possible that the platform device for a nested PGC domain is added before the parent PGC device is there, which leads to -EPROBE_DEFER when probing the driver. With normal probe this isn't an issue, as the probe will be retried. With deep-probe this is fatal, as the PGC domain devices aren't probed from DT, but via registration of platform devices from the GPC driver, so the usual deep-probe approach to ensure the devices are probed before the lookup isn't working in this case. Make sure to register the PGC domain platform devices in the correct order to avoid the EPROBE_DEFER altogether. Signed-off-by: Lucas Stach <dev@lynxeye.de> Link: https://lore.barebox.org/20220116213221.3466936-2-dev@lynxeye.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | soc: add kvx_socinfo driverClement Leger2022-01-185-0/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This driver uses various source (sfr, nvmem) to determine the mppa_id and the architecture revision. These are then exported using global variables which are: - global.kvx.arch_rev: Architecture revision (kv3-1 for instance) - global.kvx.mppa_id: Unique chip id, composed of lot and wafer id Signed-off-by: Clement Leger <clement.leger@bootlin.com> Co-developed-by: Jules Maselbas <jmaselbas@kalray.eu> Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu> Link: https://lore.barebox.org/20220117221917.26970-12-jmaselbas@kalray.eu Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | drivers: add soc hierarchy properlyClement Leger2022-01-181-0/+5
|/ | | | | | | | | We will add kvx driver in this folder to create a proper hierarchy. Signed-off-by: Clement Leger <clement.leger@bootlin.com> Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu> Link: https://lore.barebox.org/20220117221917.26970-11-jmaselbas@kalray.eu Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers: migrate "GPL-2.0+" license identifiers to SPDX 2.0Roland Hieber2021-11-221-1/+1
| | | | | | | | | "GPL-2.0-or-later" was introduced in SPDX 2.0, and the old identifier "GPL-2.0+" is now deprecated; see <https://spdx.org/licenses>. Signed-off-by: Roland Hieber <rhi@pengutronix.de> Link: https://lore.barebox.org/20211117113851.2022669-3-rhi@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers: migrate "GPL-2.0" license identifiers to SPDX 2.0Roland Hieber2021-11-227-7/+7
| | | | | | | | | | "GPL-2.0-only" was introduced in SPDX 2.0, and the old identifier "GPL-2.0" is now considered deprecated; see <https://spdx.org/licenses>. Fixes: 28f4a6a4df76f0f1581d (2021-10-30, "drivers: add missing SPDX-License-Identifier") Signed-off-by: Roland Hieber <rhi@pengutronix.de> Link: https://lore.barebox.org/20211117113851.2022669-2-rhi@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/spdx'Sascha Hauer2021-11-154-0/+4
|\
| * drivers: add missing SPDX-License-IdentifierAhmad Fatoum2021-11-014-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the suitable SPDX-License-Identifier to all files in drivers/ that previously lacked one. To aid manual inspection, following heuristics can be used: * No changes outside of comments/whitespace: git show -U0 HEAD | rg -v '^(@@|diff|index)|[-+]([-+]|//|#|[\s/]\*)' * -or-later come in pairs: git show --inter-hunk-context=19 HEAD | \ perl -0777 -F'/^@/gm' -ne 'for (@F) { @m = /later/g; print if @m & 1 }' Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211030175632.2276077-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | include: add dedicated header for printf/printkAhmad Fatoum2021-11-011-1/+1
|/ | | | | | | | | | | | Including <stdio.h> for printf is a bit problematic, because it pulls in other headers for <console.h>, which includes quite a few more headers as well. To make it easier to share code between barebox and host tools make <printk.h> the new minimal header for printf and move the extra logging stuff into <linux/printk.h>. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211030141739.2207431-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* soc: sifive: l2_cache: enable maximum available cache waysAhmad Fatoum2021-06-241-0/+19
| | | | | | | | | | | Previous boot stages may not enable all cache ways, e.g. because they are running from L2 cache. By the time barebox proper is running, execution should be from main SDRAM, so it's ok now to enable the maximum available count of cache ways. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210619045055.779-15-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* soc: starfive: add support for JH7100 incoherent interconnectAhmad Fatoum2021-06-244-0/+58
| | | | | | | | | | | | | | | | The preproduction JH7100 used in the BeagleV beta does not ensure cache coherence between CPU and some DMA masters like the Ethernet MAC. Fix this for streaming DMA mappings by implementing cache cleaning and discarding. The Flush64 primitive can be used for both as it will invalidate after flushing and not write-back clean lines. Coherent DMA mapping will be implemented using allocation from uncached SRAM in a follow-up commit. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210619045055.779-14-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers: soc: sifive: add basic L2 cache controller driverAhmad Fatoum2021-06-243-0/+121
| | | | | | | | | | | | | | SiFive SoCs are cache coherent with respect to other DMA masters, so there is no need to explicitly flush cache lines. Incoming StarFive SoC uses SiFive CPU and L2 cache controller, but is cache-incoherent and thus needs the maintenance for DMA. Add a basic driver that exports the cache flush function for SoC-specific drivers to use. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210619045055.779-13-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* soc: imx: gpcv2: add support for i.MX8MQ SoCAndrey Smirnov2019-02-113-5/+180
| | | | | | | | | | | | | | | Port of a Linux commit 685efffe37c921cf1d56dd3c8617dc67bc343a99 The GPCv2 on the Freescale i.MX8MQ SoC works in the same way as the GPCv2 on the i.MX7, but only controls more power domains with a different mapping. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Shawn Guo <shawnguo@kernel.org> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* soc: imx: gpcv2: prefix i.MX7 specific definesAndrey Smirnov2019-02-111-22/+22
| | | | | | | | | | | | Port of a Linux commit a800f418420d37f60fa471665a156c45d2702437 So we can add i.MX8M support without introducing name clashes. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Shawn Guo <shawnguo@kernel.org> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* soc: imx: gpcv2: Switch to SPDX identifierAndrey Smirnov2019-02-111-7/+1
| | | | | | | | | | | | | Port of a Linux commit 8d8e3b7d8f06f69005d829d4a195b00ef976004b Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* soc: imx: gpcv2: make pgc driver more generic for other i.MX platformsAndrey Smirnov2019-02-111-27/+41
| | | | | | | | | | | | | | | | | | | Port of a Linux commit 73f59712a1a3e532a2cbfe582ecfdbf56c33297d i.MX8MQ and i.MX8MM share same gpc module with i.MX7D, they can reuse gpcv2 pgc driver for power domain control, this patch renames all functions and structure definitions started with "imx7" to "imx", and use .data in imx_gpcv2_dt_ids[] to pass platform specific power domain data for power domain driver, thus make gpcv2 pgc driver more generic for i.MX platforms. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Acked-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>