summaryrefslogtreecommitdiffstats
path: root/drivers/soc/amlogic
Commit message (Collapse)AuthorAgeFilesLines
* soc: amlogic: fix compile failure with MESON_SECURE_PM_DOMAINS & !MESON_SMJianxin Pan2020-02-291-1/+1
| | | | | | | | | | | | | | | | | When MESON_SECURE_PM_DOMAINS & !MESON_SM, there will be compile failure: .../meson-secure-pwrc.o: In function `meson_secure_pwrc_on': .../meson-secure-pwrc.c:76: undefined reference to `meson_sm_call' Fix this by adding depends on MESON_SM for MESON_SECURE_PM_DOMAINS. Fixes: b3dde5013e13 ("soc: amlogic: Add support for Secure power domains controller") Reported-by: Stephen Rothwell<sfr@canb.auug.org.au> Reported-by: patchwork-bot+linux-amlogic<patchwork-bot+linux-amlogic@kernel.org> Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Jianxin Pan <jianxin.pan@amlogic.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com> Tested-by: Stephen Rothwell<sfr@canb.auug.org.au> Link: https://lore.kernel.org/r/1581955933-69832-1-git-send-email-jianxin.pan@amlogic.com
* soc: amlogic: Add support for Secure power domains controllerJianxin Pan2020-02-143-0/+218
| | | | | | | | | Add support for the Amlogic Secure Power controller. In A1/C1 series, power control registers are in secure domain, and should be accessed by smc. Signed-off-by: Jianxin Pan <jianxin.pan@amlogic.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com> Link: https://lore.kernel.org/r/1579087831-94965-4-git-send-email-jianxin.pan@amlogic.com
* soc: amlogic: meson-ee-pwrc: propagate errors from pm_genpd_init()Martin Blumenstingl2019-12-091-6/+14
| | | | | | | | | | pm_genpd_init() can return an error. Propagate the error code to prevent the driver from indicating that it successfully probed while there were errors during pm_genpd_init(). Fixes: eef3c2ba0a42a6 ("soc: amlogic: Add support for Everything-Else power domains controller") Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* soc: amlogic: meson-ee-pwrc: propagate PD provider registration errorsMartin Blumenstingl2019-12-091-3/+1
| | | | | | | | | | of_genpd_add_provider_onecell() can return an error. Propagate the error so the driver registration fails when of_genpd_add_provider_onecell() did not work. Fixes: eef3c2ba0a42a6 ("soc: amlogic: Add support for Everything-Else power domains controller") Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* soc: amlogic: meson-gx-socinfo: Fix S905D3 ID for VIM3LChristian Hewitt2019-11-061-1/+1
| | | | | | | | | | | | | | Chip on the board is S905D3 not S905X3: [ 0.098998] soc soc0: Amlogic Meson SM1 (S905D3) Revision 2b:c (b0:2) Detected Change from v1: use 0xf0 mask instead of 0xf2 as advised by Neil Armstrong. Fixes: 1d7c541b8a5b ("soc: amlogic: meson-gx-socinfo: Add S905X3 ID for VIM3L") Signed-off-by: Christian Hewitt <christianshewitt@gmail.com> Acked-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* soc: amlogic: meson-gx-socinfo: Add S905X3 ID for VIM3LChristian Hewitt2019-10-071-0/+1
| | | | | | | | | VIM3L appears to use a different ID: [ 0.086470] soc soc0: Amlogic Meson SM1 (S905X3) Revision 2b:c (b0:2) Detected Signed-off-by: Christian Hewitt <christianshewitt@gmail.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* soc: amlogic: meson-gx-socinfo: Add A1 and A113L IDsJianxin Pan2019-10-071-0/+2
| | | | | | | | | | Add the SoC IDs for the A113L Amlogic A1 SoC. Signed-off-by: Jianxin Pan <jianxin.pan@amlogic.com> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Reviewed-by: Kevin Hilman <khilman@baylibre.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* soc: amlogic: Add support for Everything-Else power domains controllerNeil Armstrong2019-08-283-0/+504
| | | | | | | | | | | Add support for the General Purpose Amlogic Everything-Else Power controller, with the first support for G12A and SM1 SoCs dedicated to the VPU, PCIe, USB, NNA, GE2D and Ethernet Power Domains. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Kevin Hilman <khilman@baylibre.com> Tested-by: Kevin Hilman <khilman@baylibre.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* soc: amlogic: meson-gx-socinfo: Add of_node_put() before returnNishka Dasgupta2019-08-201-1/+3
| | | | | | | | | | | | | The variable np in function meson_gx_socinfo_init takes the return value of of_find_compatible_node, which gets a node but does not put it. If this node is not put it may cause a memory leak. Hence put np after its usefulness has been exhausted. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Fixes: a9daaba2965e ("soc: Add Amlogic SoC Information driver") Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* soc: amlogic: clk-measure: Add support for SM1Neil Armstrong2019-08-201-0/+134
| | | | | | | Add the clk-measurer clocks IDs for the Amlogic SM1 SoC family. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* soc: amlogic: meson-gx-socinfo: Add SM1 and S905X3 IDsNeil Armstrong2019-08-201-0/+2
| | | | | | | | | Add the SoC IDs for the S905X3 Amlogic SM1 SoC. Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Reviewed-by: Jerome Brunet <jbrunet@baylibre.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* soc: amlogic: meson-gx-socinfo: add A311D idChristian Hewitt2019-08-051-0/+1
| | | | | | | | | Add the SoC ID for the A311D Amlogic SoC. Signed-off-by: Christian Hewitt <christianshewitt@gmail.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Kevin Hilman <khilman@baylibre.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* soc: amlogic: meson-clk-measure: add G12B second cluster cpu clkNeil Armstrong2019-08-051-0/+2
| | | | | | | | | | | Add the G12B second CPU cluster CPU and SYS_PLL measure IDs. These IDs returns 0Hz on G12A. Reviewed-by: Kevin Hilman <khilman@baylibre.com> Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* soc: amlogic: meson-clk-measure: protect measure with a mutexNeil Armstrong2019-08-051-1/+11
| | | | | | | | | | In order to protect clock measuring when multiple process asks for a measure, protect the main measure function with mutexes. Reviewed-by: Kevin Hilman <khilman@baylibre.com> Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* Merge tag 'amlogic-drivers' of ↵Olof Johansson2019-06-251-1/+13
|\ | | | | | | | | | | | | | | | | | | | | | | | | https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic into arm/drivers soc: Amlogic driver updates for v5.3 - canvas: add support for Meson8* * tag 'amlogic-drivers' of https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic: soc: amlogic: canvas: add support for Meson8, Meson8b and Meson8m2 dt-bindings: soc: amlogic: canvas: document support for Meson8/8b/8m2 Signed-off-by: Olof Johansson <olof@lixom.net>
| * soc: amlogic: canvas: add support for Meson8, Meson8b and Meson8m2Martin Blumenstingl2019-05-221-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The canvas IP on Meson8, Meson8b and Meson8m2 is mostly identical to the one on GXBB and newer. The only known difference so far is that that the "endianness" bits are not supported on Meson8m2 and earlier. Add new compatible strings and a check in meson_canvas_config() to validate that the endianness bits cannot be configured on the 32-bit SoCs. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Reviewed-by: Maxime Jourdan <mjourdan@baylibre.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* | treewide: Add SPDX license identifier - Makefile/KconfigThomas Gleixner2019-05-212-0/+2
|/ | | | | | | | | | | | | | Add SPDX license identifiers to all Make/Kconfig files which: - Have no license information of any form These files fall under the project license, GPL v2 only. The resulting SPDX license identifier is: GPL-2.0-only Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* soc: amlogic: meson-gx-pwrc-vpu: Add support for G12ANeil Armstrong2019-04-161-12/+140
| | | | | | | | | | The Amlogic G12A SoC has a very similar VPU Power Controller setup than the older GXBB, GXL & GXm SoCs. This patch adds the variant support for G12A. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* soc: amlogic: meson-gx-pwrc-vpu: Fix power on/off register bitmaskNeil Armstrong2019-04-161-4/+4
| | | | | | | | | | The register bitmask to power on/off the VPU memories was incorectly set to 0x2 instead of 0x3. While still working, let's use the recommended vendor value instead. Fixes: 75fcb5ca4b46 ("soc: amlogic: add Meson GX VPU Domains driver") Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* meson-gx-socinfo: add missing of_node_put after of_device_is_availableJulia Lawall2019-03-181-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an of_node_put when a tested device node is not available. The semantic patch that fixes this problem is as follows (http://coccinelle.lip6.fr): // <smpl> @@ identifier f; local idexpression e; expression x; @@ e = f(...); ... when != of_node_put(e) when != x = e when != e = x when any if (<+...of_device_is_available(e)...+>) { ... when != of_node_put(e) ( return e; | + of_node_put(e); return ...; ) } // </smpl> Fixes: a9daaba2965e8 ("soc: Add Amlogic SoC Information driver") Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* soc: amlogic: gx-socinfo: Add new SoC IDs and Packages IDsNeil Armstrong2019-03-181-0/+7
| | | | | | | | | | | This adds the: - G12A SoC ID and S905X2, S905D2 package IDs, found booting the X96 Max and U200 Reference Board - G12B SoC ID and S922X package ID, found booting the Odroid-N2 - S805X, S805Y package IDs found in the vendor U-Boot source Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* soc: amlogic: gx-socinfo: Add mask for each SoC packagesNeil Armstrong2019-03-181-15/+17
| | | | | | | | | | | | | | | | | | | | | | | | | When updated IDs on f842c41adc04 ("amlogic: meson-gx-socinfo: Update soc ids") we introduced packages ids using the full 8bit value, but in the function socinfo_to_package_id() the id was filtered with the 0xf0 mask. While the 0xf0 mask is valid for most board, it filters out the lower 4 bits which encodes some characteristics of the chip. This patch moves the mask into the meson_gx_package_id table to be applied on each package name independently and add the correct mask for some specific entries. An example is the S905, in the vendor code the S905 is package_id different from 0x20, and S905M is exactly 0x20. Another example are the The Wetek Hub & Play2 boards using a S905-H variant, which is the S905 SoC with some licence bits enabled. These licence bits are encoded in the lower 4bits, so to detect the -H variant, we must detect the id == 0x3 with the 0xf mask. Fixes: f842c41adc04 ("amlogic: meson-gx-socinfo: Update soc ids") Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* soc: amlogic: clk-measure: add axg and g12a supportJerome Brunet2019-02-071-0/+196
| | | | | | | | | Add support for the axg and g12a SoC family in amlogic clk measure Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> [khilman: squashed some fixups from Martin] Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* soc: amlogic: canvas: Fix meson_canvas_get when probe failedNeil Armstrong2019-02-071-1/+12
| | | | | | | | | | | | | When probe fails, a platforn_device is still associated to the node, but dev_get_drvdata() returns NULL. Handle this case by returning a consistent error. Fixes: d4983983d987 ("soc: amlogic: add meson-canvas driver") Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Maxime Jourdan <mjourdan@baylibre.com> [khilman: fixed minor typo in comment ] Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* soc: amlogic: add missing of_node_put()wen yang2019-02-061-1/+4
| | | | | | | | | | | The call to of_parse_phandle returns a node pointer with refcount incremented thus it must be explicitly decremented here after the last usage. Signed-off-by: Wen Yang <yellowriver2010@hotmail.com> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Fixes: d4983983d987 ("soc: amlogic: add meson-canvas driver") Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* soc: amlogic: meson-clk-measure: Add missing REGMAP_MMIO dependencyCorentin Labbe2018-12-101-0/+1
| | | | | | | | | | This patchs adds a missing dependency on REGMAP_MMIO. This cause the following build failure on SPARC: drivers/soc/amlogic/meson-clk-measure.o: In function `meson_msr_probe': meson-clk-measure.c:(.text+0xc4): undefined reference to `__devm_regmap_init_mmio_clk' Signed-off-by: Corentin Labbe <clabbe@baylibre.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* soc: amlogic: Add Meson Clock Measure driverNeil Armstrong2018-11-283-0/+359
| | | | | | | | | | | | | | | The Amlogic Meson SoCs embeds a clock measurer IP to measure the internal clock paths frequencies. The precision is determined by stepping into the duration until the counter overflows. The debugfs slows a pretty summary and each clock can be measured individually aswell. Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* soc: amlogic: add meson-canvas driverMaxime Jourdan2018-09-123-0/+193
| | | | | | | | | | | | | | | Amlogic SoCs have a repository of 256 canvas which they use to describe pixel buffers. They contain metadata like width, height, block mode, endianness [..] Many IPs within those SoCs like vdec/vpu rely on those canvas to read/write pixels. Reviewed-by: Jerome Brunet <jbrunet@baylibre.com> Tested-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Maxime Jourdan <mjourdan@baylibre.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* amlogic: meson-gx-socinfo: Update soc idsNeil Armstrong2018-03-191-0/+10
| | | | | | | | Updates the Amlogic Meson SoCs IDs for the Armv8 based SoCs. It includes the new families and packages. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* meson-gx-socinfo: make local function meson_gx_socinfo_init staticweiyongjun (A)2018-02-121-1/+1
| | | | | | | | | | | Fixes the following sparse warnings: drivers/soc/amlogic/meson-gx-socinfo.c:100:12: warning: symbol 'meson_gx_socinfo_init' was not declared. Should it be static? Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Acked-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* meson-mx-socinfo: Make local function meson_mx_socinfo_init() staticweiyongjun (A)2018-02-121-1/+1
| | | | | | | | | | Fixes the following sparse warnings: drivers/soc/amlogic/meson-mx-socinfo.c:107:12: warning: symbol 'meson_mx_socinfo_init' was not declared. Should it be static? Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* soc: amlogic: meson-gx-pwrc-vpu: fix error on shutdown when domain is ↵Heiner Kallweit2018-02-121-1/+5
| | | | | | | | | | | | | | | | powered off When operating the system headless headless, the domain is never powered on, leaving the clocks disabled. The shutdown function then tries to disable the already disabled clocks, resulting in errors. Therefore call meson_gx_pwrc_vpu_power_off() only if domain is powered on. This patch fixes the described issue on my system (Odorid-C2). Fixes: 339cd0ea0822 "soc: amlogic: meson-gx-pwrc-vpu: fix power-off when powered by bootloader" Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* soc: amlogic: meson-gx-pwrc-vpu: don't print error message on probe deferralHeiner Kallweit2018-02-121-1/+2
| | | | | | | | | | The error message may be misleading in case of probe deferral (happens on my Odroid-C2). Therefore don't print it in this case. Fixes: 75fcb5ca4b46 "soc: amlogic: add Meson GX VPU Domains driver" Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Acked-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* meson-gx-socinfo: Fix package id parsingArnaud Patard2017-11-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | I've noticed the following message while booting a S905X based board: soc soc0: Amlogic Meson GXL (S905D) Revision 21:82 (b:2) Detected The S905D string is obviously wrong. The vendor code does: ... ver = (readl(assist_hw_rev) >> 8) & 0xff; meson_cpu_version[MESON_CPU_VERSION_LVL_MINOR] = ver; ver = (readl(assist_hw_rev) >> 16) & 0xff; meson_cpu_version[MESON_CPU_VERSION_LVL_PACK] = ver; ... while the current code does: ... ... This means that the current mainline code has package id and minor version reversed. Fixes: a9daaba2965e8 ("soc: Add Amlogic SoC Information driver") Signed-off-by: Arnaud Patard <apatard@hupstream.com> Acked-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* soc: amlogic: meson-gx-pwrc-vpu: fix power-off when powered by bootloaderNeil Armstrong2017-11-091-10/+19
| | | | | | | | | | | | | | In the case the VPU power domain has been powered on by the bootloader and no driver are attached to this power domain, the genpd will power it off after a certain amount of time, but the clocks hasn't been enabled by the kernel itself and the power-off will trigger some faults. This patch enable the clocks to have a coherent state for an eventual poweroff and switches to the pm_domain_always_on_gov governor. Fixes: 75fcb5ca4b46 ("soc: amlogic: add Meson GX VPU Domains driver") Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Tested-by: Kevin Hilman <khilman@baylibre.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
* soc: amlogic: gx pm domain: add PM and OF dependenciesArnd Bergmann2017-11-021-0/+1
| | | | | | | | | | | | | The new driver introduces harmless warnings: warning: (PM_RMOBILE && ARCH_RCAR_GEN1 && ARCH_RCAR_GEN2 && ARCH_R7S72100 && MESON_GX_PM_DOMAINS) selects PM_GENERIC_DOMAINS which has unmet direct dependencies (PM) warning: (MESON_GX_PM_DOMAINS) selects PM_GENERIC_DOMAINS_OF which has unmet direct dependencies (PM_GENERIC_DOMAINS && OF) This adds CONFIG_OF and CONFIG_PM dependencies to ensure it will only be enabled in valid configurations. Fixes: 75fcb5ca4b46 ("soc: amlogic: add Meson GX VPU Domains driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de>
* soc: amlogic: add Meson GX VPU Domains driverNeil Armstrong2017-10-293-0/+245
| | | | | | | | The Video Processing Unit needs a specific Power Domain powering scheme this driver handles this as a PM Power Domain driver. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* soc: amlogic: Add Meson6/Meson8/Meson8b/Meson8m2 SoC Information driverMartin Blumenstingl2017-10-063-0/+186
| | | | | | | | | | Amlogic SoCs have an information register which contains the SoC type and revision information. This patchs adds support for decoding those registers and exposing the resulting information via the SoC bus infrastructure. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
* soc: Add Amlogic SoC Information driverNeil Armstrong2017-07-283-0/+190
Amlogic SoCs have a SoC information register for SoC type, package type and revision information. This patchs adds support for this register decoding and exposing with the SoC bus infrastructure. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com>