platform/kernel/linux-starfive.git
15 months agoRISCV: configs: Enable spi defconfig
Hoegeun Kwon [Fri, 12 May 2023 05:23:08 +0000 (14:23 +0900)]
RISCV: configs: Enable spi defconfig

Enable SPI starfive driver.

Change-Id: I395a723ca0e5f35e8666f59c5ab9d5067e549c46
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
15 months agospi: Add support pl022 spi driver
xingyu.wu [Thu, 30 Jun 2022 06:45:38 +0000 (14:45 +0800)]
spi: Add support pl022 spi driver

Add support pl022 spi driver and device tree of starfive JH7110. This
driver is from [1], and the imported patch list[2]. We modified
compatible and clock in the device-tree to fix kernel v6.1.

[1] https://github.com/starfive-tech/linux

[2] patch list from v5.15.y
  d88bd4b6aa1d ziv.xu    spi-pl022-starfive:Enable spi to be compiled into modules
  871266269a62 ziv.xu    spi-pl022-starfive:fix the problem of spi overlay reload
  9e71e5c05fee ziv.xu    spi-pl022-starfive.c: prompt warning when frequency does not surpport
  a1c1236322ba ziv.xu    spi-pl022-starfive.c: make spi work without dma
  9962a36e5788 Ziv.Xu    add device pm for spi
  9bd42158c0bd Xingyu Wu spi:starfive:Modify compatible name
  c9c015abab34 xingyu.wu spi:pl022-starfive:Turn off dma channel search under overlay
  c4eef3b4b80e xingyu.wu spi:pl022-starfive:Avoid power device error when CONFIG_PM enable
  e10123abbc5d xingyu.wu spi:Modify pl022 driver format
  a86c836215ce xingyu.wu spi-pl022:starfive:Add platform bus register to adapt overlay
  17c6be971d69 xingyu.wu spi-pl022:starfive:Add spi driver for StarFive SoC platform

Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Xingyu Wu <xingyu.wu@starfivetech.com>
Signed-off-by: ziv.xu <ziv.xu@starfive.com>
Change-Id: I631a219d56ea26e6609e33daa6c470b512da2698
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
15 months agoRISCV: configs: Enable regulator AXP20X
Hoegeun Kwon [Mon, 8 May 2023 11:25:30 +0000 (20:25 +0900)]
RISCV: configs: Enable regulator AXP20X

Enable AXP20X regulator used by cpufreq.

Change-Id: I79160b30440732277bd25844ace40e4a8d54e734
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
15 months agoregulator: axp20x: Add AXP15060 support
Shengyu Qu [Mon, 8 May 2023 11:14:47 +0000 (20:14 +0900)]
regulator: axp20x: Add AXP15060 support

The AXP15060 is a typical I2C-controlled PMIC, seen on multiple boards
with different default register value. Current driver is tested on
Starfive Visionfive 2.

The RTCLDO is fixed, and cannot even be turned on or off. On top of
that, its voltage is customisable (either 1.8V or 3.3V). We pretend it's
a fixed 1.8V regulator since other AXP driver also do like this. Also,
BSP code ignores this regulator and it's not used according to VF2
schematic.

Describe the AXP15060's voltage settings and switch registers, how the
voltages are encoded, and connect this to the MFD device via its
regulator ID.

[1] https://lore.kernel.org/linux-sunxi/20230401001850.4988-1-andre.przywara@arm.com/

Signed-off-by: Shengyu Qu <wiagn233@outlook.com>
[Backported patch : https://lore.kernel.org/lkml/TY3P286MB2611DA5F918F90491A3AA02298609@TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM/#Z31drivers:regulator:axp20x-regulator.c]
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Change-Id: I24a8cc725d57bb07273df316e14d2eb05943d162

15 months agomfd: axp20x: Add support for AXP15060 PMIC
Shengyu Qu [Mon, 8 May 2023 08:30:25 +0000 (17:30 +0900)]
mfd: axp20x: Add support for AXP15060 PMIC

The AXP15060 is a PMIC chip produced by X-Powers, and could be connected
via an I2C bus.

Describe the regmap and the MFD bits, along with the registers exposed
via I2C. Eventually advertise the device using a new compatible string
and add support for power off the system.

The driver would disable PEK function if IRQ is not configured in device
tree, since some boards (For example, Starfive Visionfive 2) didn't
connect IRQ line of PMIC to SOC.

GPIO function isn't enabled in this commit, since its configuration
operation is different from any existing AXP PMICs and needs
logic modification on existing driver. GPIO support might come in later
patches.

Signed-off-by: Shengyu Qu <wiagn233@outlook.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/TY3P286MB261162D57695AC8164ED50E298609@TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM
[Backported patch : https://lore.kernel.org/lkml/TY3P286MB261162D57695AC8164ED50E298609@TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM/]
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Change-Id: I53ddfe6ea5df415f84f401c64fb29d1378ba1569

15 months agodt-bindings: mfd: x-powers,axp152: Document the AXP15060 variant
Shengyu Qu [Mon, 8 May 2023 07:43:12 +0000 (16:43 +0900)]
dt-bindings: mfd: x-powers,axp152: Document the AXP15060 variant

The X-Powers AXP15060 is a PMIC seen on Starfive Visionfive 2 board. Add
relative compatible item and CPUSLDO support and disables DC-DC
frequency setting for it.

Signed-off-by: Shengyu Qu <wiagn233@outlook.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
[Backported patch : https://lore.kernel.org/lkml/TY3P286MB261177CF7AA2959BD9517DA998609@TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM/]
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Change-Id: Ia8ada01c0f0e56642a14401d34a1b2a47ddf6851

15 months agoRISCV: configs: Enable cpufreq defconfig
Hoegeun Kwon [Thu, 4 May 2023 07:50:32 +0000 (16:50 +0900)]
RISCV: configs: Enable cpufreq defconfig

Enable cpufreq defconfig. Set default gov is ondemand.

Change-Id: I0c6ec29322e1e846d81e686528ac4c825b81287e
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
15 months agoriscv: Kconfig: Enable cpufreq kconfig menu
Lad Prabhakar [Tue, 15 Nov 2022 10:51:33 +0000 (10:51 +0000)]
riscv: Kconfig: Enable cpufreq kconfig menu

Enable cpufreq kconfig menu for RISC-V.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20221115105135.1180490-2-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
[Backported from https://github.com/starfive-tech/linux/tree/JH7110_VisionFive2_upstream]
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Change-Id: Ibc4020587fecdfcdbbde43732b4673c423c53e25

15 months agoriscv: dts: starfive: Add cpu scaling for JH7110 SoC
Mason Huo [Thu, 4 May 2023 05:40:23 +0000 (14:40 +0900)]
riscv: dts: starfive: Add cpu scaling for JH7110 SoC

Add the operating-points-v2 to support cpu scaling on StarFive JH7110 SoC.
It supports up to 4 cpu frequency loads.

Signed-off-by: Mason Huo <mason.huo@starfivetech.com>
[Backported patch : https://lore.kernel.org/all/20230421031431.23010-4-mason.huo@starfivetech.com/]
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Change-Id: I0aeac76676938da45165a460a1d042fc36d2c8e4

15 months agocpufreq: dt-platdev: Add JH7110 SOC to the allowlist
Mason Huo [Thu, 4 May 2023 05:34:59 +0000 (14:34 +0900)]
cpufreq: dt-platdev: Add JH7110 SOC to the allowlist

Add the compatible strings for supporting the generic
cpufreq driver on the StarFive JH7110 SoC.

Signed-off-by: Mason Huo <mason.huo@starfivetech.com>
[Backported patch :https://lore.kernel.org/all/20230421031431.23010-3-mason.huo@starfivetech.com/]
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Change-Id: I40c1539d935367f3da4b74f01aabde8428dc49d9

15 months agoriscv: dts: starfive: Enable axp15060 pmic for cpufreq
Mason Huo [Thu, 4 May 2023 05:31:44 +0000 (14:31 +0900)]
riscv: dts: starfive: Enable axp15060 pmic for cpufreq

The VisionFive 2 board has an embedded pmic axp15060,
which supports the cpu DVFS through the dcdc2 regulator.
This patch enables axp15060 pmic and configs the dcdc2.

Signed-off-by: Mason Huo <mason.huo@starfivetech.com>
[Backported patch : https://lore.kernel.org/all/20230421031431.23010-2-mason.huo@starfivetech.com/]
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Change-Id: I79e08462d7bd09766526418d65fb4299fc122fdc

15 months agoRISCV: configs: Enable crypto defconfig
Hoegeun Kwon [Wed, 3 May 2023 06:57:31 +0000 (15:57 +0900)]
RISCV: configs: Enable crypto defconfig

Enable crypto driver for jh7110.

Change-Id: I25902a13d2a2d907ad04f2985059b40782ba394e
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
15 months agoRISCV: dts: starfive: Add missing interrupt number of crypto
Hoegeun Kwon [Thu, 4 May 2023 02:20:19 +0000 (11:20 +0900)]
RISCV: dts: starfive: Add missing interrupt number of crypto

The interrupt number of crypto is missing and add.

Ref patch:
  https://lore.kernel.org/all/20230426065848.842221-4-jiajie.ho@starfivetech.com/

Change-Id: I2fe8951d5b68c5e21ca50b24c2c0de490937e4a9
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
15 months agoRISCV: configs: Enable pwm defconfig
Hoegeun Kwon [Wed, 3 May 2023 05:53:28 +0000 (14:53 +0900)]
RISCV: configs: Enable pwm defconfig

Enable pwm defconfig for pwm driver.

Change-Id: I860ff49fddacb47143f33d446e31a528c25b7fab
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
15 months agopwm: starfive: Fix incompatible pointer types
Hoegeun Kwon [Wed, 3 May 2023 05:04:20 +0000 (14:04 +0900)]
pwm: starfive: Fix incompatible pointer types

Fix starfive_pwm_ptc_get_state func and get_state pointer func and
return types not matching. In the current kernel version, get_status
does not use return value, so no problem. Fix return type to void.

  drivers/pwm/pwm-starfive-ptc.c:152:15: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
    .get_state = starfive_pwm_ptc_get_state,
               ^~~~~~~~~~~~~~~~~~~~~~~~~~

Change-Id: Ifd9fb81ead2b174d138dcad60f464e484074aac4
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
15 months agoRISCV: configs: Enable dma defconfig
Hoegeun Kwon [Wed, 3 May 2023 04:48:51 +0000 (13:48 +0900)]
RISCV: configs: Enable dma defconfig

Enable dma devices defconfig for dma driver.

Change-Id: I3172db384cca03691850acd300feee9f6d51cd06
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
15 months agoRISCV: configs: Enable temperature sensor defconfig
Hoegeun Kwon [Wed, 3 May 2023 04:31:47 +0000 (13:31 +0900)]
RISCV: configs: Enable temperature sensor defconfig

Enable temperature sensor defconfig for sensor driver.

Change-Id: Ifbc7734b5670389c4826eba08a39dab8d693afa3
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
15 months agoRISCV: configs: Enable power reset gpio
Hoegeun Kwon [Tue, 25 Apr 2023 06:50:03 +0000 (15:50 +0900)]
RISCV: configs: Enable power reset gpio

When rebooting, there is a problem that the pmic gpio is not set, so
rebooting is not possible. Enable power reset gpio.

Change-Id: I59c35303fe9416b4839d244e161776a034259a4b
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
15 months agoRISCV: configs: Enable pcie defconfig
Hoegeun Kwon [Mon, 17 Apr 2023 06:46:56 +0000 (15:46 +0900)]
RISCV: configs: Enable pcie defconfig

Enable CONFIG_PCIE_STARFIVE defconfig for pcie host controller driver.

Change-Id: Ie55481519cd03f9a7bf2679c0ca6a0f5703ceb21
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
15 months agoriscv: dts: starfive: Add full support for JH7110 and VisionFive 2 board
Hal Feng [Tue, 11 Apr 2023 08:31:15 +0000 (16:31 +0800)]
riscv: dts: starfive: Add full support for JH7110 and VisionFive 2 board

Merge all StarFive dts patches together.

Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
 Conflicts:
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi
arch/riscv/boot/dts/starfive/jh7110.dtsi

[Backported from https://github.com/starfive-tech/linux/tree/JH7110_VisionFive2_upstream]
Change-Id: I0b498d1c7694877a210026717bd1c4e8fffac22a
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
15 months agopcie: starfive: add StarFive JH7110 PCIe driver.
Minda Chen [Thu, 6 Apr 2023 11:11:41 +0000 (19:11 +0800)]
pcie: starfive: add StarFive JH7110 PCIe driver.

Add PCIe controller driver for StarFive JH7110
SoC platform. The PCIe controller is PCIe 2.0, single lane.

Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
[Backported from https://github.com/starfive-tech/linux/tree/JH7110_VisionFive2_upstream]
Change-Id: I04b0fd6ef7085030ecc682de384b009e2e1d66fe
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
15 months agodt-binding: pci: add JH7110 PCIe dt-binding documents.
Minda Chen [Thu, 6 Apr 2023 11:11:40 +0000 (19:11 +0800)]
dt-binding: pci: add JH7110 PCIe dt-binding documents.

Add PCIe controller driver dt-binding documents
for StarFive JH7110 SoC platform.

Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
[Backported from https://github.com/starfive-tech/linux/tree/JH7110_VisionFive2_upstream]
Change-Id: Ibd3ed0ecf830d56cedaf496510fecc610b4700cf
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
15 months agodt-bindings: phy: Add StarFive JH7110 PCIe document
Minda Chen [Thu, 6 Apr 2023 01:52:11 +0000 (09:52 +0800)]
dt-bindings: phy: Add StarFive JH7110 PCIe document

Add StarFive JH7110 SoC PCIe 2.0 PHY dt-binding.
PCIe PHY0 (phy@10210000) can be used as USB 3.0 PHY.

Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
[Backported from https://github.com/starfive-tech/linux/tree/JH7110_VisionFive2_upstream]
Change-Id: I67a7522fe31e9adb476e895f2107f4432d2ad19a
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
15 months agodt-bindings: phy: Add StarFive JH7110 USB document
Minda Chen [Thu, 6 Apr 2023 01:52:10 +0000 (09:52 +0800)]
dt-bindings: phy: Add StarFive JH7110 USB document

Add StarFive JH7110 SoC USB 2.0 PHY dt-binding.

Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
[Backported from https://github.com/starfive-tech/linux/tree/JH7110_VisionFive2_upstream]
Change-Id: I402d255181b5ff3a14e2faea7f54753f83757cd2
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
15 months agoRevert "PCI: Add support plda pcie host controller driver"
Hoegeun Kwon [Mon, 17 Apr 2023 06:18:48 +0000 (15:18 +0900)]
Revert "PCI: Add support plda pcie host controller driver"

This reverts commit b31cbbfa7c21b27610b850734b419469494948b7.

Revert this patch for use the pcie driver from upstream branch of
starfive-tech/linux.

Change-Id: I7617faba6679d0988140b22bda05c2cfd2a8d4cf
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
15 months agoRevert "RISCV: configs: Enable pcie plda defconfig"
Hoegeun Kwon [Mon, 17 Apr 2023 06:18:41 +0000 (15:18 +0900)]
Revert "RISCV: configs: Enable pcie plda defconfig"

This reverts commit c8cfb82195d6e397017aa28e3e347766402e43ac.

Revert this patch for use the pcie driver from upstream branch of
starfive-tech/linux.

Change-Id: I2769cb8e90bd8430508bda95762f39ac21fe0580
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
15 months agoRISCV: configs: Enable usb BT defconfig
Hoegeun Kwon [Thu, 13 Apr 2023 11:43:26 +0000 (20:43 +0900)]
RISCV: configs: Enable usb BT defconfig

Enable usb BT defconfig.

Change-Id: Ia751e369e4a6aad13c730c7e1f5129f347877b6b
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
15 months agoRISCV: configs: Enable usb wireless defconfig
Hoegeun Kwon [Thu, 13 Apr 2023 04:33:52 +0000 (13:33 +0900)]
RISCV: configs: Enable usb wireless defconfig

Enable usb wireless defconfig and realtek module.

Change-Id: Id186de5d13078a11b7142afceb881ade5da2683d
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
15 months agoRISCV: configs: Enable pcie plda defconfig
Hoegeun Kwon [Fri, 14 Apr 2023 04:27:13 +0000 (13:27 +0900)]
RISCV: configs: Enable pcie plda defconfig

Enable CONFIG_PCIE_PLDA defconfig for plda pcie host controller
driver.

Change-Id: Ie09fdf5761d4b5a4a758b69c91f7f7100e820f0f
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
15 months agoPCI: Add support plda pcie host controller driver
ke.zhu [Fri, 14 Apr 2023 04:22:11 +0000 (13:22 +0900)]
PCI: Add support plda pcie host controller driver

Add support plda pcie host controller driver and device tree of
starfive JH7110. This driver is from [1], and the imported patch list
[2]. We modified pinctrl and clock in device-tree to fit kernel v6.1.

[1] https://github.com/starfive-tech/linux

[2] patch list from v5.15.y
    9edf6749fde8 drivers: pci: Fix crash in rt-linux because of an uninitialized lock.
    2757ebeaf399 drivers: pci: Add PHY settings in pcie host driver.
    d3b5483a84d4 drivers: pci: Set PCIe PCI standard configuration ID.
    758a22e27bc6 dts: starfive: Modified PCIe pin setting for bring up PCIe USB hub.
    1c1671ff173d drivers: pci: Support system pm no irq ops.
    d38610f5403c drivers: pci: Support runtime pm & release when found empty slot in probe.
    fecebab6581f drivers: pci: Support 64bit prefetchable MMIO range.
    39cbd7746b45 driver: pci: Add extended reset time for better compatibility
    b1163a7a7de2 driver: pci: Fix kernel stuck caused by ASPM LTR
    036944785f52 PCIe: plda: Add support for evb
    38e23080fe16 PCI: plda: Add port1 support
    157cf2806f0a PCI: plda: Fix kernel compile warnings
    64e6d9f6f659 PCI: plda: Add syscon register config
    48ed9fb901ff PCI: plda: Add pcie clk & rst
    08c3249e8021 PCI: plda: Optimize plda pcie host driver
    4ac91988fa82 1.Add plda pcie host controller driver. 2.Add PCIe host controller DT bingdings of starfive JH7110.

Signed-off-by: ke.zhu <ke.zhu@starfivetech.com>
Signed-off-by: mason.huo <mason.huo@starfivetech.com>
Signed-off-by: Kevin.xie <kevin.xie@starfivetech.com>
Change-Id: I7e58f62026e69318c9305e5fea4d0a3d9e40e7e3
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
15 months agoRISCV: configs: Fix to build-in clk_starfive
Hoegeun Kwon [Fri, 7 Apr 2023 08:46:01 +0000 (17:46 +0900)]
RISCV: configs: Fix to build-in clk_starfive

When the clk operates as a module, defered occurs in ethernet,
causing a problem in which eth0 and eth1 are switched. Modify the
corresponding clk to built-in.

Change-Id: I734b470294538a080aa02a01f0585c52a3d29acf
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
15 months agoRISCV: configs: enable motorcomm phy driver
Jaehoon Chung [Mon, 10 Apr 2023 02:14:16 +0000 (11:14 +0900)]
RISCV: configs: enable motorcomm phy driver

Enable motrocomm phy driver to use ethernet.

Change-Id: I71e988989fc9332b2d38339858fa49109daf6163
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
15 months agonet: phy: motorcomm: uninitialized variables in yt8531_link_change_notify()
Dan Carpenter [Wed, 15 Feb 2023 04:21:47 +0000 (07:21 +0300)]
net: phy: motorcomm: uninitialized variables in yt8531_link_change_notify()

These booleans are never set to false, but are just used without being
initialized.

Fixes: 4ac94f728a58 ("net: phy: Add driver for Motorcomm yt8531 gigabit ethernet phy")
Signed-off-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Frank Sae <Frank.Sae@motor-comm.com>
Link: https://lore.kernel.org/r/Y+xd2yJet2ImHLoQ@kili
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I1b34e53290b0e99aa7d2e5c7269625cdc6a779cb

15 months agonet: phy: Add driver for Motorcomm yt8531 gigabit ethernet phy
Frank Sae [Thu, 2 Feb 2023 03:00:37 +0000 (11:00 +0800)]
net: phy: Add driver for Motorcomm yt8531 gigabit ethernet phy

Add a driver for the motorcomm yt8531 gigabit ethernet phy. We have
 verified the driver on AM335x platform with yt8531 board. On the
 board, yt8531 gigabit ethernet phy works in utp mode, RGMII
 interface, supports 1000M/100M/10M speeds, and wol(magic package).

Signed-off-by: Frank Sae <Frank.Sae@motor-comm.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: Iaab41bb4da6fc537ec994ec09beaf65a92a4d8f6

15 months agonet: phy: Add dts support for Motorcomm yt8531s gigabit ethernet phy
Frank Sae [Thu, 2 Feb 2023 03:00:36 +0000 (11:00 +0800)]
net: phy: Add dts support for Motorcomm yt8531s gigabit ethernet phy

Add dts support for Motorcomm yt8531s gigabit ethernet phy.
 Change yt8521_probe to support clk config of yt8531s. Becase
 yt8521_probe does the things which yt8531s is needed, so
 removed yt8531s function.
 This patch has been verified on AM335x platform with yt8531s board.

Signed-off-by: Frank Sae <Frank.Sae@motor-comm.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I85e5655baba7120eadad1e25c4da1797c9943154

15 months agonet: phy: Add dts support for Motorcomm yt8521 gigabit ethernet phy
Frank Sae [Thu, 2 Feb 2023 03:00:35 +0000 (11:00 +0800)]
net: phy: Add dts support for Motorcomm yt8521 gigabit ethernet phy

Add dts support for Motorcomm yt8521 gigabit ethernet phy.
 Add ytphy_rgmii_clk_delay_config function to support dst config for
 the delay of rgmii clk. This funciont is common for yt8521, yt8531s
 and yt8531.
 This patch has been verified on AM335x platform.

Signed-off-by: Frank Sae <Frank.Sae@motor-comm.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I96c978c5b0ee9c6d227f771b35001e331882f33a

15 months agonet: phy: Add BIT macro for Motorcomm yt8521/yt8531 gigabit ethernet phy
Frank Sae [Thu, 2 Feb 2023 03:00:34 +0000 (11:00 +0800)]
net: phy: Add BIT macro for Motorcomm yt8521/yt8531 gigabit ethernet phy

Add BIT macro for Motorcomm yt8521/yt8531 gigabit ethernet phy.
 This is a preparatory patch. Add BIT macro for 0xA012 reg, and
 supplement for 0xA001 and 0xA003 reg. These will be used to support dts.

Signed-off-by: Frank Sae <Frank.Sae@motor-comm.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: Ia86f4b51b61329bcc4b585ec4cfa26fe80943d02

15 months agonet: phy: motorcomm: change the phy id of yt8521 and yt8531s to lowercase
Frank Sae [Sat, 28 Jan 2023 06:35:58 +0000 (14:35 +0800)]
net: phy: motorcomm: change the phy id of yt8521 and yt8531s to lowercase

The phy id is usually defined in lower case.

Signed-off-by: Frank Sae <Frank.Sae@motor-comm.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20230128063558.5850-2-Frank.Sae@motor-comm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: If5dba6dda0ac08f235f08bb333298b093d180853

15 months agonet: phy: fix the spelling problem of Sentinel
Frank Sae [Sat, 28 Jan 2023 06:35:57 +0000 (14:35 +0800)]
net: phy: fix the spelling problem of Sentinel

CHECK: 'sentinal' may be misspelled - perhaps 'sentinel'?

Signed-off-by: Frank Sae <Frank.Sae@motor-comm.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20230128063558.5850-1-Frank.Sae@motor-comm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I1b526c10df1df49984224c1a2cd8d690918f0a72

15 months agonet: phy: add Motorcomm YT8531S phy id.
Frank [Tue, 22 Nov 2022 08:42:32 +0000 (16:42 +0800)]
net: phy: add Motorcomm YT8531S phy id.

We added patch for motorcomm.c to support YT8531S. This patch has
been tested on AM335x platform which has one YT8531S interface
card and passed all test cases.
The tested cases indluding: YT8531S UTP function with support of
10M/100M/1000M; YT8531S Fiber function with support of 100M/1000M;
and YT8531S Combo function that supports auto detection of media type.

Since most functions of YT8531S are similar to YT8521 and we reuse some
codes for YT8521 in the patch file.

Signed-off-by: Frank <Frank.Sae@motor-comm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: Ic52d4469045c2bfbf97250e137004729fc6dea46

15 months agonet: phy: fix yt8521 duplicated argument to & or |
Frank [Fri, 4 Nov 2022 08:44:41 +0000 (16:44 +0800)]
net: phy: fix yt8521 duplicated argument to & or |

cocci warnings: (new ones prefixed by >>)
>> drivers/net/phy/motorcomm.c:1122:8-35: duplicated argument to & or |
  drivers/net/phy/motorcomm.c:1126:8-35: duplicated argument to & or |
  drivers/net/phy/motorcomm.c:1130:8-34: duplicated argument to & or |
  drivers/net/phy/motorcomm.c:1134:8-34: duplicated argument to & or |

 The second YT8521_RC1R_GE_TX_DELAY_xx should be YT8521_RC1R_FE_TX_DELAY_xx.

Fixes: 70479a40954c ("net: phy: Add driver for Motorcomm yt8521 gigabit ethernet phy")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Frank <Frank.Sae@motor-comm.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I3f15389f5b7c13d23c068b1f5c178dc9462d05d1

15 months agonet: phy: Add driver for Motorcomm yt8521 gigabit ethernet phy
Frank [Fri, 28 Oct 2022 09:26:21 +0000 (17:26 +0800)]
net: phy: Add driver for Motorcomm yt8521 gigabit ethernet phy

Add a driver for the motorcomm yt8521 gigabit ethernet phy. We have verified
 the driver on StarFive VisionFive development board, which is developed by
 Shanghai StarFive Technology Co., Ltd.. On the board, yt8521 gigabit ethernet
 phy works in utp mode, RGMII interface, supports 1000M/100M/10M speeds, and
 wol(magic package).

Signed-off-by: Frank <Frank.Sae@motor-comm.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I98c7dd937da59afce8a5a79fa78c6cca8dc47096

15 months agoRISCV: configs: enable FUSE_FS configuration
Jaehoon Chung [Wed, 5 Apr 2023 00:12:46 +0000 (09:12 +0900)]
RISCV: configs: enable FUSE_FS configuration

Enable CONFIG_FUSE_FS configs and other missed configs.

Change-Id: If6c234ad9b945bd0e9b634cd03fafe681a15dfe1
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
15 months agoRISCV: configs: Enanble some configs from module to static
Jaehoon Chung [Mon, 3 Apr 2023 02:00:43 +0000 (11:00 +0900)]
RISCV: configs: Enanble some configs from module to static

Enable some configs from module to static.
Current module partitions is using to 32MB, so it needs to decrease
module size under 32MB.

Change-Id: I9925f0019540b984e4d400b1fbc054ee8b05e960
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
15 months agoconfig: Enable FTRACE
Marek Pikuła [Fri, 31 Mar 2023 14:16:59 +0000 (16:16 +0200)]
config: Enable FTRACE

Required by IoT-headless preset.

Change-Id: I779f566b1e7bd74a7db168c909e1ebdb7287caee
Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
15 months agopackaging: Add version to modules directory
Marek Pikuła [Fri, 31 Mar 2023 13:14:22 +0000 (15:14 +0200)]
packaging: Add version to modules directory

Prevents conflict with `filesystem` package.

Change-Id: I5281cf8f5349d82bdcaed9b66fdc0cb6896af96b
Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
15 months agoconfig: Enable NBD module
Marek Pikuła [Fri, 31 Mar 2023 13:13:17 +0000 (15:13 +0200)]
config: Enable NBD module

Useful for development with networked SD card emulation.

Change-Id: Ie02b2bdd81b44d874978497cb9dded874a9482a3
Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
15 months agomedia: starfive: add "WITH Linux-syscall-note" to SPDX tag of uapi headers
Łukasz Stelmach [Wed, 29 Mar 2023 12:28:23 +0000 (14:28 +0200)]
media: starfive: add "WITH Linux-syscall-note" to SPDX tag of uapi headers

UAPI headers licensed under GPL are supposed to have exception
"WITH Linux-syscall-note" so that they can be included into non-GPL
user space application code.

Change-Id: I129c7bf343e3da61f8d49a023b5d16699cb18796
Origin: upstream, https://github.com/starfive-tech/linux/pull/94
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
15 months agoRISCV: configs: enable USB/ETH configurations
Jaehoon Chung [Wed, 29 Mar 2023 08:06:58 +0000 (17:06 +0900)]
RISCV: configs: enable USB/ETH configurations

Enable USB/ETH configuration relevant to JH7110.

Change-Id: I14b9e28cb96b38765997373375f87bdb71ca00f7
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
15 months agobuild: add the separated device tree file
Jaehoon Chung [Tue, 28 Mar 2023 08:32:52 +0000 (17:32 +0900)]
build: add the separated device tree file

Add the separated device tree file according to VisionFive2 board
revision.

Change-Id: I35fa7e81199f363e0cda53fd9ecac5943743a3ab
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
15 months agobuild: Add local build script for VisionFive2
Jaehoon Chung [Mon, 13 Mar 2023 03:31:05 +0000 (12:31 +0900)]
build: Add local build script for VisionFive2

Add local build script for VisionFive2.

Change-Id: I0ca80fd1e383b9ce62797944fba1755e315fa9c7
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
15 months agopackaging: Add linux-visionfive2 spec file
Jaehoon Chung [Fri, 10 Mar 2023 06:31:40 +0000 (15:31 +0900)]
packaging: Add linux-visionfive2 spec file

Add linux-visionfive2 spec vile to build with gbs.
This is for only visionfive2 board.

Change-Id: Icc8feec48b9d77c27b4ce8f2d9468ca882d1fca1
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
15 months agoriscv: fix riscv64 unrecognized opcode build error
Marek Szulc [Fri, 19 Aug 2022 10:29:48 +0000 (12:29 +0200)]
riscv: fix riscv64 unrecognized opcode build error

Considering older gcc version, "imafd" has to be changed
to "g", in order for asm to handle "zicsr" and "zifencei"
extensions.

Support for the mentioned extensions has been added
in GCC 11.1, hence this commit may be removed
after GCC update.

The lack of this causes following errors:
Error: unrecognized opcode `csrr a5,0xc01'
Error: unrecognized opcode `csrr a2,0xc01'

Change-Id: I0768a7b1255c828c4fc319f74f2783bc7e1581bf
Signed-off-by: Marek Szulc <m.szulc3@samsung.com>
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
15 months agoRISCV: configs: Add tizen_vf2_defconfig file
Jaehoon Chung [Fri, 10 Mar 2023 05:32:13 +0000 (14:32 +0900)]
RISCV: configs: Add tizen_vf2_defconfig file

Add tizen_vf2_defconfig file for VisionFive2 boardi.
This defconfig is an initial version to use Tizen on VisionFive2.

Change-Id: Ie675e71129f698d294f637f7545be323466537de
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
15 months agoRISC-V: Add arch functions to support hibernation/suspend-to-disk
Sia Jee Heng [Tue, 14 Mar 2023 05:03:16 +0000 (13:03 +0800)]
RISC-V: Add arch functions to support hibernation/suspend-to-disk

Low level Arch functions were created to support hibernation.
swsusp_arch_suspend() relies code from __cpu_suspend_enter() to write
cpu state onto the stack, then calling swsusp_save() to save the memory
image.

Arch specific hibernation header is implemented and is utilized by the
arch_hibernation_header_restore() and arch_hibernation_header_save()
functions. The arch specific hibernation header consists of satp, hartid,
and the cpu_resume address. The kernel built version is also need to be
saved into the hibernation image header to making sure only the same
kernel is restore when resume.

swsusp_arch_resume() creates a temporary page table that covering only
the linear map. It copies the restore code to a 'safe' page, then start
to restore the memory image. Once completed, it restores the original
kernel's page table. It then calls into __hibernate_cpu_resume()
to restore the CPU context. Finally, it follows the normal hibernation
path back to the hibernation core.

To enable hibernation/suspend to disk into RISCV, the below config
need to be enabled:
- CONFIG_ARCH_HIBERNATION_HEADER
- CONFIG_ARCH_HIBERNATION_POSSIBLE

Signed-off-by: Sia Jee Heng <jeeheng.sia@starfivetech.com>
Reviewed-by: Ley Foon Tan <leyfoon.tan@starfivetech.com>
Reviewed-by: Mason Huo <mason.huo@starfivetech.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
15 months agoRISC-V: Factor out common code of __cpu_resume_enter()
Sia Jee Heng [Tue, 14 Mar 2023 05:03:14 +0000 (13:03 +0800)]
RISC-V: Factor out common code of __cpu_resume_enter()

The cpu_resume() function is very similar for the suspend to disk and
suspend to ram cases. Factor out the common code into suspend_restore_csrs
macro and suspend_restore_regs macro.

Signed-off-by: Sia Jee Heng <jeeheng.sia@starfivetech.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
15 months agoRISC-V: Change suspend_save_csrs and suspend_restore_csrs to public function
Sia Jee Heng [Tue, 14 Mar 2023 05:03:13 +0000 (13:03 +0800)]
RISC-V: Change suspend_save_csrs and suspend_restore_csrs to public function

Currently suspend_save_csrs() and suspend_restore_csrs() functions are
statically defined in the suspend.c. Change the function's attribute
to public so that the functions can be used by hibernation as well.

Signed-off-by: Sia Jee Heng <jeeheng.sia@starfivetech.com>
Reviewed-by: Ley Foon Tan <leyfoon.tan@starfivetech.com>
Reviewed-by: Mason Huo <mason.huo@starfivetech.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
15 months agodts: usb: add StarFive JH7110 USB dts configuration.
Minda Chen [Wed, 15 Mar 2023 10:44:11 +0000 (18:44 +0800)]
dts: usb: add StarFive JH7110 USB dts configuration.

USB Glue layer and Cadence USB subnode configuration,
also includes USB and PCIe phy dts configuration.

Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
15 months agousb: cdns3: add StarFive JH7110 USB driver.
Minda Chen [Wed, 15 Mar 2023 10:44:10 +0000 (18:44 +0800)]
usb: cdns3: add StarFive JH7110 USB driver.

There is a Cadence USB3 core for JH7110 SoCs, the cdns
core is the child of this USB wrapper module device.

Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
15 months agodt-binding: Add JH7110 USB wrapper layer doc.
Minda Chen [Wed, 15 Mar 2023 10:44:09 +0000 (18:44 +0800)]
dt-binding: Add JH7110 USB wrapper layer doc.

The dt-binding doc of Cadence USBSS-DRD controller wrapper
layer.

Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
Reviewed-by: Peter Chen <peter.chen@kernel.org>
15 months agophy: starfive: add JH7110 PCIE 2.0 and USB 2.0 PHY driver.
Minda Chen [Wed, 15 Mar 2023 10:44:08 +0000 (18:44 +0800)]
phy: starfive: add JH7110 PCIE 2.0 and USB 2.0 PHY driver.

Add Starfive JH7110 SoC PCIe 2.0 and USB 2.0 PHY driver support.
PCIe 2.0 PHY can used as USB 3.0 PHY

Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
15 months agodt-bindings: phy: Add StarFive JH7110 USB/PCIe document
Minda Chen [Wed, 15 Mar 2023 10:44:07 +0000 (18:44 +0800)]
dt-bindings: phy: Add StarFive JH7110 USB/PCIe document

Add StarFive JH7110 SoC USB 2.0/3.0 and PCIe 2.0 PHY dt-binding.
PCIe 2.0 phy can use as USB 3.0 PHY.

Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
15 months agomedia: starfive: Add Starfive Camera Subsystem driver
Jack Zhu [Fri, 10 Mar 2023 12:05:53 +0000 (20:05 +0800)]
media: starfive: Add Starfive Camera Subsystem driver

Add the driver for Starfive Camera Subsystem found on
Starfive JH7110 SoC. It is used for handing image sensor
data.

Signed-off-by: Jack Zhu <jack.zhu@starfivetech.com>
15 months agoMAINTAINERS: Add Starfive Camera Subsystem driver
Jack Zhu [Thu, 9 Mar 2023 10:48:44 +0000 (18:48 +0800)]
MAINTAINERS: Add Starfive Camera Subsystem driver

Add an entry for Starfive Camera Subsystem driver.

Signed-off-by: Jack Zhu <jack.zhu@starfivetech.com>
15 months agomedia: cadence: Add support for external dphy and JH7110 SoC
Jack Zhu [Fri, 10 Mar 2023 12:05:51 +0000 (20:05 +0800)]
media: cadence: Add support for external dphy and JH7110 SoC

Add support for external MIPI D-PHY and Starfive JH7110 SoC which
has the cadence csi2 receiver.

Signed-off-by: Jack Zhu <jack.zhu@starfivetech.com>
15 months agomedia: admin-guide: Add starfive_camss.rst for Starfive Camera Subsystem
Jack Zhu [Fri, 10 Mar 2023 12:05:50 +0000 (20:05 +0800)]
media: admin-guide: Add starfive_camss.rst for Starfive Camera Subsystem

Add the file 'starfive_camss.rst' that documents the Starfive Camera
Subsystem driver which is used for handing image sensor data.

Signed-off-by: Jack Zhu <jack.zhu@starfivetech.com>
15 months agomedia: dt-bindings: cadence-csi2rx: Convert to DT schema
Jack Zhu [Fri, 10 Mar 2023 12:05:49 +0000 (20:05 +0800)]
media: dt-bindings: cadence-csi2rx: Convert to DT schema

Convert DT bindings document for Cadence MIPI-CSI2 RX controller
to DT schema format and add new properties.

Signed-off-by: Jack Zhu <jack.zhu@starfivetech.com>
15 months agomedia: dt-bindings: Add bindings for JH7110 Camera Subsystem
Jack Zhu [Fri, 10 Mar 2023 12:05:48 +0000 (20:05 +0800)]
media: dt-bindings: Add bindings for JH7110 Camera Subsystem

Add the bindings documentation for Starfive JH7110 Camera Subsystem
which is used for handing image sensor data.

Signed-off-by: Jack Zhu <jack.zhu@starfivetech.com>
15 months agoriscv: dts: starfive: Add dphy rx node
Changhuang Liang [Wed, 15 Mar 2023 10:04:21 +0000 (03:04 -0700)]
riscv: dts: starfive: Add dphy rx node

Add dphy rx node for the StarFive JH7110 SoC. It is used to transfer CSI
camera data.

Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
15 months agophy: starfive: Add mipi dphy rx support
Changhuang Liang [Wed, 15 Mar 2023 10:04:20 +0000 (03:04 -0700)]
phy: starfive: Add mipi dphy rx support

Add mipi dphy rx support for the StarFive JH7110 SoC. It is used to
transfer CSI camera data.

Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
15 months agodt-bindings: phy: Add starfive,jh7110-dphy-rx
Changhuang Liang [Wed, 15 Mar 2023 10:04:19 +0000 (03:04 -0700)]
dt-bindings: phy: Add starfive,jh7110-dphy-rx

StarFive SoCs like the jh7110 use a MIPI D-PHY RX controller based on
a M31 IP. Add a binding for it.

Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
15 months agocrypto: starfive - Add hash and HMAC support
Jia Jie Ho [Mon, 13 Mar 2023 13:56:46 +0000 (21:56 +0800)]
crypto: starfive - Add hash and HMAC support

Adding hash/HMAC support for SHA-2 and SM3 to StarFive cryptographic
module.

Co-developed-by: Huan Feng <huan.feng@starfivetech.com>
Signed-off-by: Huan Feng <huan.feng@starfivetech.com>
Signed-off-by: Jia Jie Ho <jiajie.ho@starfivetech.com>
15 months agoriscv: dts: starfive: Add crypto and DMA node for VisionFive 2
Jia Jie Ho [Tue, 22 Nov 2022 05:56:50 +0000 (13:56 +0800)]
riscv: dts: starfive: Add crypto and DMA node for VisionFive 2

Add StarFive cryptographic module and dedicated DMA controller node to
VisionFive 2 SoCs.

Co-developed-by: Huan Feng <huan.feng@starfivetech.com>
Signed-off-by: Huan Feng <huan.feng@starfivetech.com>
Signed-off-by: Jia Jie Ho <jiajie.ho@starfivetech.com>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
15 months agocrypto: starfive - Add crypto engine support
Jia Jie Ho [Mon, 13 Mar 2023 13:56:44 +0000 (21:56 +0800)]
crypto: starfive - Add crypto engine support

Adding device probe and DMA init for StarFive cryptographic module.

Co-developed-by: Huan Feng <huan.feng@starfivetech.com>
Signed-off-by: Huan Feng <huan.feng@starfivetech.com>
Signed-off-by: Jia Jie Ho <jiajie.ho@starfivetech.com>
15 months agodt-bindings: crypto: Add StarFive crypto module
Jia Jie Ho [Mon, 13 Mar 2023 13:56:43 +0000 (21:56 +0800)]
dt-bindings: crypto: Add StarFive crypto module

Add documentation to describe StarFive cryptographic engine.

Co-developed-by: Huan Feng <huan.feng@starfivetech.com>
Signed-off-by: Huan Feng <huan.feng@starfivetech.com>
Signed-off-by: Jia Jie Ho <jiajie.ho@starfivetech.com>
Reviewed-by: Rob Herring <robh@kernel.org>
15 months agoriscv: dts: starfive: Add TRNG node for VisionFive 2
Jia Jie Ho [Fri, 2 Dec 2022 06:25:38 +0000 (14:25 +0800)]
riscv: dts: starfive: Add TRNG node for VisionFive 2

Adding StarFive TRNG controller node to VisionFive 2 board.

Co-developed-by: Jenny Zhang <jenny.zhang@starfivetech.com>
Signed-off-by: Jenny Zhang <jenny.zhang@starfivetech.com>
Signed-off-by: Jia Jie Ho <jiajie.ho@starfivetech.com>
15 months agoriscv: dts: starfive: add dma controller node
Walker Chen [Mon, 27 Feb 2023 12:51:36 +0000 (20:51 +0800)]
riscv: dts: starfive: add dma controller node

Add the dma controller node for the Starfive JH7110 SoC.

Signed-off-by: Walker Chen <walker.chen@starfivetech.com>
15 months agodmaengine: dw-axi-dmac: Add support for StarFive JH7110 DMA
Walker Chen [Tue, 14 Mar 2023 08:35:36 +0000 (16:35 +0800)]
dmaengine: dw-axi-dmac: Add support for StarFive JH7110 DMA

Add DMA reset operation in device probe and use different configuration
on CH_CFG registers according to match data. Update all uses of
of_device_is_compatible with of_device_get_match_data.

Signed-off-by: Walker Chen <walker.chen@starfivetech.com>
15 months agodt-bindings: dma: snps,dw-axi-dmac: constrain the items of resets for JH7110 dma
Walker Chen [Tue, 14 Mar 2023 08:35:35 +0000 (16:35 +0800)]
dt-bindings: dma: snps,dw-axi-dmac: constrain the items of resets for JH7110 dma

The DMA controller needs two reset items to work properly on JH7110 SoC,
so there is need to constrain the items' value to 2, other platforms
have 1 reset item at most.

Signed-off-by: Walker Chen <walker.chen@starfivetech.com>
Reviewed-by: Rob Herring <robh@kernel.org>
15 months agoriscv: dts: starfive: visionfive-2: Add thermal-zones
Emil Renner Berthing [Sun, 6 Jun 2021 20:31:18 +0000 (22:31 +0200)]
riscv: dts: starfive: visionfive-2: Add thermal-zones

Add thermal-zones for StarFive VisionFive 2 board.

Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
15 months agoriscv: dts: starfive: jh7110: Add temperature sensor node
Emil Renner Berthing [Sun, 6 Jun 2021 20:31:18 +0000 (22:31 +0200)]
riscv: dts: starfive: jh7110: Add temperature sensor node

Add temperature sensor support for StarFive JH7110 SoC.

Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
15 months agohwmon: (sfctemp) Add StarFive JH71x0 temperature sensor
Emil Renner Berthing [Sun, 6 Jun 2021 20:31:18 +0000 (22:31 +0200)]
hwmon: (sfctemp) Add StarFive JH71x0 temperature sensor

Add driver for the StarFive JH71x0 temperature sensor. You
can enable/disable it and read temperature in milli Celcius
through sysfs.

Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Co-developed-by: Samin Guo <samin.guo@starfivetech.com>
Signed-off-by: Samin Guo <samin.guo@starfivetech.com>
Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
15 months agodt-bindings: hwmon: Add starfive,jh71x0-temp
Emil Renner Berthing [Sun, 6 Jun 2021 20:15:22 +0000 (22:15 +0200)]
dt-bindings: hwmon: Add starfive,jh71x0-temp

Add bindings for the temperature sensor on the StarFive JH7100 and
JH7110 SoCs.

Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
Reviewed-by: Rob Herring <robh@kernel.org>
15 months agoriscv: dts: starfive: visionfive 2: Add configuration of gmac and phy
Samin Guo [Tue, 1 Nov 2022 10:11:02 +0000 (18:11 +0800)]
riscv: dts: starfive: visionfive 2: Add configuration of gmac and phy

v1.3B:
  v1.3B uses motorcomm YT8531(rgmii-id phy) x2, need delay and
  inverse configurations.
  The tx_clk of v1.3B uses an external clock and needs to be
  switched to an external clock source.

v1.2A:
  v1.2A gmac0 uses motorcomm YT8531(rgmii-id) PHY, and needs delay
  configurations.
  v1.2A gmac1 uses motorcomm YT8512(rmii) PHY, and needs to
  switch rx and rx to external clock sources.

Signed-off-by: Samin Guo <samin.guo@starfivetech.com>
Tested-by: Tommaso Merciai <tomm.merciai@gmail.com>
15 months agoriscv: dts: starfive: jh7110: Add ethernet device nodes
Samin Guo [Fri, 3 Mar 2023 08:49:31 +0000 (16:49 +0800)]
riscv: dts: starfive: jh7110: Add ethernet device nodes

Add JH7110 ethernet device node to support gmac driver for the JH7110
RISC-V SoC.

Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
Signed-off-by: Samin Guo <samin.guo@starfivetech.com>
Tested-by: Tommaso Merciai <tomm.merciai@gmail.com>
15 months agonet: stmmac: starfive_dmac: Add phy interface settings
Samin Guo [Thu, 2 Mar 2023 11:52:37 +0000 (19:52 +0800)]
net: stmmac: starfive_dmac: Add phy interface settings

dwmac supports multiple modess. When working under rmii and rgmii,
you need to set different phy interfaces.

According to the dwmac document, when working in rmii, it needs to be
set to 0x4, and rgmii needs to be set to 0x1.

The phy interface needs to be set in syscon, the format is as follows:
starfive,syscon: <&syscon, offset, shift>

Signed-off-by: Samin Guo <samin.guo@starfivetech.com>
Tested-by: Tommaso Merciai <tomm.merciai@gmail.com>
15 months agonet: stmmac: Add glue layer for StarFive JH7110 SoC
Samin Guo [Fri, 3 Mar 2023 08:50:58 +0000 (16:50 +0800)]
net: stmmac: Add glue layer for StarFive JH7110 SoC

This adds StarFive dwmac driver support on the StarFive JH7110 SoC.

Co-developed-by: Emil Renner Berthing <kernel@esmil.dk>
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Signed-off-by: Samin Guo <samin.guo@starfivetech.com>
Tested-by: Tommaso Merciai <tomm.merciai@gmail.com>
15 months agodt-bindings: net: Add support StarFive dwmac
Yanhong Wang [Mon, 31 Oct 2022 10:08:15 +0000 (18:08 +0800)]
dt-bindings: net: Add support StarFive dwmac

Add documentation to describe StarFive dwmac driver(GMAC).

Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
Signed-off-by: Samin Guo <samin.guo@starfivetech.com>
Tested-by: Tommaso Merciai <tomm.merciai@gmail.com>
15 months agodt-bindings: net: snps,dwmac: Add 'ahb' reset/reset-name
Samin Guo [Mon, 27 Feb 2023 10:26:04 +0000 (18:26 +0800)]
dt-bindings: net: snps,dwmac: Add 'ahb' reset/reset-name

According to:
stmmac_platform.c: stmmac_probe_config_dt
stmmac_main.c: stmmac_dvr_probe

dwmac controller may require one (stmmaceth) or two (stmmaceth+ahb)
reset signals, and the maxItems of resets/reset-names is going to be 2.

The gmac of Starfive Jh7110 SOC must have two resets.
it uses snps,dwmac-5.20 IP.

Signed-off-by: Samin Guo <samin.guo@starfivetech.com>
Tested-by: Tommaso Merciai <tomm.merciai@gmail.com>
15 months agonet: stmmac: platform: Add snps,dwmac-5.20 IP compatible string
Emil Renner Berthing [Sun, 7 Aug 2022 20:26:00 +0000 (22:26 +0200)]
net: stmmac: platform: Add snps,dwmac-5.20 IP compatible string

Add "snps,dwmac-5.20" compatible string for 5.20 version that can avoid
to define some platform data in the glue layer.

Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Signed-off-by: Samin Guo <samin.guo@starfivetech.com>
Tested-by: Tommaso Merciai <tomm.merciai@gmail.com>
15 months agodt-bindings: net: snps,dwmac: Add dwmac-5.20 version
Emil Renner Berthing [Mon, 8 Aug 2022 15:13:34 +0000 (17:13 +0200)]
dt-bindings: net: snps,dwmac: Add dwmac-5.20 version

Add dwmac-5.20 IP version to snps.dwmac.yaml

Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Signed-off-by: Samin Guo <samin.guo@starfivetech.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tested-by: Tommaso Merciai <tomm.merciai@gmail.com>
15 months agoriscv: dts: starfive: Add PWM node
William Qiu [Wed, 1 Mar 2023 08:45:11 +0000 (16:45 +0800)]
riscv: dts: starfive: Add PWM node

Adding StarFive PWM controller node to VisionFive 2 SoC.

Signed-off-by: William Qiu <william.qiu@starfivetech.com>
15 months agopwm: starfive: Add PWM driver support
William Qiu [Tue, 21 Mar 2023 05:52:28 +0000 (13:52 +0800)]
pwm: starfive: Add PWM driver support

Add Pulse Width Modulation driver support for StarFive
JH7110 soc.

Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
Signed-off-by: William Qiu <william.qiu@starfivetech.com>
15 months agodt-bindings: PWM: Add StarFive PWM module
William Qiu [Tue, 21 Mar 2023 05:52:27 +0000 (13:52 +0800)]
dt-bindings: PWM: Add StarFive PWM module

Add documentation to describe StarFive Pulse Width Modulation
controller driver.

Signed-off-by: William Qiu <william.qiu@starfivetech.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
15 months agoriscv: dts: starfive: jh7110: Add qspi controller node
William Qiu [Thu, 2 Mar 2023 08:42:57 +0000 (16:42 +0800)]
riscv: dts: starfive: jh7110: Add qspi controller node

Add the quad spi controller node for the Starfive JH7110 SoC.

Signed-off-by: William Qiu <william.qiu@starfivetech.com>
15 months agospi: cadence-quadspi: Add support for StarFive JH7110 QSPI
William Qiu [Thu, 2 Mar 2023 10:52:21 +0000 (18:52 +0800)]
spi: cadence-quadspi: Add support for StarFive JH7110 QSPI

Add QSPI reset operation in device probe and add RISCV support to
QUAD SPI Kconfig.

Co-developed-by: Ziv Xu <ziv.xu@starfivetech.com>
Signed-off-by: Ziv Xu <ziv.xu@starfivetech.com>
Signed-off-by: William Qiu <william.qiu@starfivetech.com>
Link: https://lore.kernel.org/r/20230302105221.197421-3-william.qiu@starfivetech.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agodt-bindings: qspi: cdns,qspi-nor: constrain minItems/maxItems of resets
William Qiu [Thu, 2 Mar 2023 10:52:20 +0000 (18:52 +0800)]
dt-bindings: qspi: cdns,qspi-nor: constrain minItems/maxItems of resets

The QSPI controller needs three reset items to work properly on JH7110 SoC,
so there is need to change the maxItems's value to 3 and add minItems
whose value is equal to 2. Other platforms do not have this constraint.

Signed-off-by: William Qiu <william.qiu@starfivetech.com>
Link: https://lore.kernel.org/r/20230302105221.197421-2-william.qiu@starfivetech.com
Signed-off-by: Mark Brown <broonie@kernel.org>
15 months agoriscv: dts: starfive: Add mmc node
William Qiu [Wed, 15 Feb 2023 09:51:55 +0000 (17:51 +0800)]
riscv: dts: starfive: Add mmc node

Adds the mmc node for the StarFive JH7110 SoC.
Set mmco node to emmc and set mmc1 node to sd.

Signed-off-by: William Qiu <william.qiu@starfivetech.com>
15 months agoriscv: dts: jh7110: starfive: Add timer node
Xingyu Wu [Tue, 1 Nov 2022 13:54:04 +0000 (21:54 +0800)]
riscv: dts: jh7110: starfive: Add timer node

Add the timer node for the Starfive JH7110 SoC.

Signed-off-by: Xingyu Wu <xingyu.wu@starfivetech.com>
15 months agoclocksource: Add StarFive timer driver
Xingyu Wu [Tue, 1 Nov 2022 13:45:06 +0000 (21:45 +0800)]
clocksource: Add StarFive timer driver

Add timer driver for the StarFive JH7110 SoC.

Signed-off-by: Xingyu Wu <xingyu.wu@starfivetech.com>