22534 Commits

Author SHA1 Message Date
Samuel Holland
2c940eed61 Merge branch 'bl808/usb' into bl808/all 2023-02-05 14:37:47 -06:00
Samuel Holland
a9026dd92a Merge branch 'bl808/sysreset' into bl808/all 2023-02-05 14:37:47 -06:00
Samuel Holland
e9c6af350c Merge branch 'bl808/serial' into bl808/all 2023-02-05 14:37:47 -06:00
Samuel Holland
52f7b2906a Merge branch 'bl808/rproc' into bl808/all 2023-02-05 14:37:47 -06:00
Samuel Holland
e19f9e5235 Merge branch 'bl808/ram' into bl808/all 2023-02-05 14:37:47 -06:00
Samuel Holland
24f212f4e6 Merge branch 'bl808/pinctrl' into bl808/all 2023-02-05 14:37:46 -06:00
Samuel Holland
1eb3f7e048 Merge branch 'bl808/mmc' into bl808/all 2023-02-05 14:37:46 -06:00
Samuel Holland
a8893235ae Merge branch 'bl808/emac' into bl808/all 2023-02-05 14:37:46 -06:00
Samuel Holland
05115a6844 clk: bflb: Implement the .dump operation
Print the parent name, rate, and bit field values for each clock.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2023-02-05 14:37:37 -06:00
Samuel Holland
ecca454c9e clk: Implement soc_clk_dump() using the .dump operation
This provides a common implementation of soc_clk_dump() for platforms
that use DM clock drivers but not the CCF.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2023-02-05 14:37:37 -06:00
Samuel Holland
f579a60dc0 phy: Add BL808 USB PHY driver
Signed-off-by: Samuel Holland <samuel@sholland.org>
2023-02-05 14:37:36 -06:00
Samuel Holland
1e26ec977f sysreset: Add BL808 sysreset driver
Signed-off-by: Samuel Holland <samuel@sholland.org>
2023-02-05 14:37:36 -06:00
Samuel Holland
65f8f547d8 serial: Add a Bouffalo Lab UART driver
This driver supports the UARTs found in BL808 and related SoCs.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2023-02-05 14:37:36 -06:00
Samuel Holland
86ac9d21a3 remoteproc: Add BL808 remoteproc driver
Signed-off-by: Samuel Holland <samuel@sholland.org>
2023-02-05 14:37:36 -06:00
Samuel Holland
cc6790a7e9 remoteproc: Remove legacy probing method
This removes code that abused the device's platform data, interpreting
it as the uclass platform data.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2023-02-05 14:37:36 -06:00
Michael Walle
3e7287720b ram: Add Bouffalo Lab PSRAM driver
All the intitalization routines and values are taken from the
Bouffalolab MCU SDK @a574195a4b33:
https://github.com/bouffalolab/bl_mcu_sdk/

Signed-off-by: Michael Walle <michael@walle.cc>
2023-02-05 14:37:35 -06:00
Samuel Holland
64ca2ff591 pinctrl: Add Bouffalo Lab pinctrl driver
This driver supports the pinmux, pinconf, and GPIO functions of the
Bouffalo Lab BL616 and BL808 SoCs.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2023-02-05 14:37:35 -06:00
Samuel Holland
cda0d26518 mmc: Add Bouffalo Lab SDHCI driver
Signed-off-by: Samuel Holland <samuel@sholland.org>
2023-02-05 14:37:35 -06:00
Samuel Holland
42e6b3ef7b remoteproc: Remove unused mem_type platform data
There is only one possible value for this field, it is unused except for
debugging, and the devicetree property is not documented.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2023-02-05 14:37:35 -06:00
Samuel Holland
3463ddf5a9 remoteproc: Move rproc_cfg_arr out of the uclass header
This array is private to the IPU driver, so it should be declared there.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2023-02-05 14:37:35 -06:00
Samuel Holland
e110ca11b3 clk: bflb: Add BL808 clock/reset descriptions
BL808 contains clocks and resets controlled by registers in several MMIO
regions, mostly because each MMIO region is in a separate power domain.
Add the descriptions for the known clocks and resets.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2023-02-05 14:37:34 -06:00
Samuel Holland
3ee1aaa682 clk: Add Bouffalo Lab reset controller driver
This driver extends the clock driver with reset control capability.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2023-02-05 14:37:34 -06:00
Samuel Holland
970e1a1f7f clk: Add Bouffalo Lab clock driver
This driver supports most of the clocks in Bouffalo Lab SoCs, including
their parent selection, divider, and enable bits. It supports a
hierarchy of clocks provided by multiple devices/drivers.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2023-02-05 14:37:34 -06:00
Samuel Holland
a3041de622 clk: Add a .get_parent operation
This allows clk_get_parent() to work with non-CCF clock drivers.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2023-02-05 14:37:34 -06:00
Samuel Holland
91ad6fd6b8 clk: Remove an unneeded check from clk_get_parent_rate()
There is no need to check the parent clock's ops. The following call to
clk_get_rate() does that already.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2023-02-05 14:37:34 -06:00
Samuel Holland
319f3749f6 clk: Fix rate caching in clk_get_parent_rate()
clk_get_rate() can return an error value. Recompute the rate if the
cached value is an error value.

Fixes: 4aa78300a025 ("dm: clk: Define clk_get_parent_rate() for clk operations")
Signed-off-by: Samuel Holland <samuel@sholland.org>
2023-02-05 14:37:34 -06:00
Samuel Holland
430dfca65b clk: Fix error handling in clk_get_parent()
Do not return both NULL and error pointers. The function is only
documented as returning error pointers.

Fixes: 8a1661f20e6c ("drivers: clk: Handle gracefully NULL pointers")
Signed-off-by: Samuel Holland <samuel@sholland.org>
2023-02-05 14:37:34 -06:00
Samuel Holland
e12726eac8 clk: Fix error handling in clk_get_rate()
log_ret() cannot work with unsigned values, and the assignment to 'ret'
incorrectly truncated the rate on 64-bit platforms.

Fixes: 5c5992cb90cf ("clk: Add debugging for return values")
Signed-off-by: Samuel Holland <samuel@sholland.org>
2023-02-05 14:37:34 -06:00
Samuel Holland
1c4944d70d net: ethoc: Invalidate after RX instead of flush
Signed-off-by: Samuel Holland <samuel@sholland.org>
2023-02-05 14:16:10 -06:00
Samuel Holland
fe4d294777 net: ethoc: Add BL808 EMAC support
Signed-off-by: Samuel Holland <samuel@sholland.org>
2023-02-05 10:36:53 -06:00
Ioana Ciornei
878a20aa15 drivers: net: fsl_ls_mdio: prevent a NULL pointer dereference
Prevent a NULL pointer dereference in the probe path by checking the
return valud of dev_read_addr_ptr() against NULL.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2023-02-02 14:44:53 -05:00
Ioana Ciornei
cfbd388ae7 drivers: net: fsl-mc: do not use multiple blank lines
Remove the instances in which we have multiple blank lines.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2023-02-02 14:44:53 -05:00
Ioana Ciornei
f45ed0b5ec drivers: net: fsl-mc: align parameters to the open paranthesis
There were some cases in which the function parameters were not aligned
to the open paranthesis. Fix those instances.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2023-02-02 14:44:53 -05:00
Ioana Ciornei
6dcf5e4477 drivers: net: fsl-mc: remove explicit cast
Remove all the explicit casts from the void* returned by calloc.
With this we also improve a bit the length of those lines and there is
no need to split the assignment.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2023-02-02 14:44:53 -05:00
Ioana Ciornei
8ecf1ca093 drivers: net: fsl-mc: do not prefix decimal values with 0x
The fsl-mc driver printed debug information which used the 0x prefix for
decimal values. This only confuses anyone looking through the log.
Because of this, just remove the prefix and use the "DPXY.<id>" notation
which is the standard one for the DPAA2 objects.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2023-02-02 14:44:53 -05:00
Ioana Ciornei
3ad24e4d36 drivers: net: fsl-mc: remove an useless break statement
The break statement is just after a goto statement, thus it will not get
executed. Just remove it.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2023-02-02 14:44:53 -05:00
Ioana Ciornei
32221ee236 drivers: net: fsl-mc: remove useless assignment of variable
The cur_ptr variable is set to the start of the log buffer but then it's
not used. Just remove the assignment altogether.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2023-02-02 14:44:53 -05:00
Tim Harvey
01e7dd050f net: add MV88E6xxx DSA driver
Add a DSA driver for the MV88E6xxx compatible Ethernet switches.

Cc: Marek Behún <marek.behun@nic.cz>
Cc: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2023-02-02 14:44:53 -05:00
Tim Harvey
3b8f99a3e7 net: fec: add support for DM_MDIO
Add support for DM_MDIO by registering a UCLASS_MDIO driver and
attempting to use it. This is necessary if wanting to use a DSA
driver for example hanging off of the FEC MAC.

Care is taken to fallback to non DM_MDIO mii bus as several boards define
DM_MDIO without having the proper device-tree configuration necessary
such as an mdio subnode, a phy-mode prop, and either a valid phy-handle
prop or fixed-phy subnode which will cause dm_eth_phy_connect() to fail.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2023-02-02 14:44:51 -05:00
Tim Harvey
8abb9f6b17 net: ksz9477: remove unnecessary xmit and recv functions
Remove the unnecessary xmit and recv functions.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2023-02-02 14:22:08 -05:00
Tom Rini
9918b25d21 Merge commit 'refs/pipelines/15015' of https://source.denx.de/u-boot/custodians/u-boot-tegra 2023-02-02 12:44:12 -05:00
Svyatoslav Ryhel
adf869045d drivers: timer: add driver for ARMv7 based Tegra devices and T210
Add timer support for T20/T30/T114/T124 and T210 based devices.
Driver is based on DM, has device tree support and can be
used on SPL and early boot stage.

Arm64 Tegra (apart T210) according to comment in tegra-common.h use
architected timer.

Tested-by: Andreas Westman Dorcsak <hedmoo@yahoo.com> # ASUS TF600T T30
Tested-by: Jonas Schwöbel <jonasschwoebel@yahoo.de> # Surface RT T30
Tested-by: Robert Eckelmann <longnoserob@gmail.com> # ASUS TF101 T20
Tested-by: Agneli <poczt@protonmail.ch> # Toshiba AC100 T20
Tested-by: Svyatoslav Ryhel <clamor95@gmail.com> # LG P895 T30
Co-developed-by: Jonas Schwöbel <jonasschwoebel@yahoo.de>
Signed-off-by: Jonas Schwöbel <jonasschwoebel@yahoo.de>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom <twarren@nvidia.com>
2023-02-02 10:16:41 -07:00
Svyatoslav Ryhel
87a758652b ARM: tegra: remap clock_osc_freq for all Tegra family
Enum clock_osc_freq was designed to use only with T20.
This patch remaps it to use additional frequencies, added in
T30+ SoC while maintaining backwards compatibility with T20.

Tested-by: Andreas Westman Dorcsak <hedmoo@yahoo.com> # ASUS TF600T T30
Tested-by: Jonas Schwöbel <jonasschwoebel@yahoo.de> # Surface RT T30
Tested-by: Robert Eckelmann <longnoserob@gmail.com> # ASUS TF101 T20
Tested-by: Agneli <poczt@protonmail.ch> # Toshiba AC100 T20
Tested-by: Thierry Reding <treding@nvidia.com> # T30, T124, T210
Tested-by: Svyatoslav Ryhel <clamor95@gmail.com> # LG P895 T30
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom <twarren@nvidia.com>
2023-02-02 10:16:41 -07:00
Marek Vasut
1006b33b3a net: ravb: Drop SoC-specific compatible support
The current set of U-Boot upstream R-Car Gen3 DTs all contain generic
"renesas,etheravb-rcar-gen3" compatible strings, drop the SoC specific
compatible string support from U-Boot to reduce size and duplication.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-02-02 01:49:21 +01:00
Hai Pham
1b4ca865b2 clk: renesas: rcar-gen3: Factor out CPG library
R-Car V3U has a CPG different enough to not be a generic Gen3 CPG but
similar enough to reuse code. Introduce a new CPG library, factor out
the SD clock and RPC clock handling and hook them to the generic Gen3
CPG driver so we have an equal state.

Based on Linux commit [1] and [2] by Wolfram Sang

[1] 8bb67d87346a ("clk: renesas: rcar-gen3: Factor out CPG library")
[2] 6f21d145b90f ("clk: renesas: cpg-lib: Move RPC clock registration to
the library")

Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Marek: - Add rcar_clk_* prefix to all functions
       - Rebase on changes to
         clk: renesas: Introduce and use rcar_clk_get_rate64_div_table function
       - Use u32_encode_bits/GENMASK bitfield ops
2023-02-02 01:49:20 +01:00
Hai Pham
d8132ae37a clk: renesas: Add R8A77970 SD0H/SD0 clocks for SDHI
On R-Car V3M (AKA R8A77970), the SD0CKCR is laid out differently than on
the other R-Car gen3 SoCs. Hence, new clock types are introduced
respectively.

Based on Linux commit 381081ffc294 ("clk: renesas: r8a77970: Add SD0H/SD0
clocks for SDHI") by Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Marek: - Fix missing ~ in GENMASK(a, b), use clrsetbits_le32 instead
       - Do not modify r8a77970-cpg-mssr.c much, drop enum r8a77970_clk_types
         which is now part of common clock types in rcar-gen3-cpg.h instead
2023-02-02 01:49:20 +01:00
Hai Pham
4dbbc3f373 clk: renesas: Switch to new SD clock handling
The old SD handling code was huge and could not handle all the details
which showed up on R-Car Gen3 SoCs meanwhile. It is time to switch to
another design. Have SDnH a separate clock, use the existing divider
clocks and move the errata handling from the clock driver to the SDHI
driver where it belongs.

Based on Linux series by Wolfram Sang, commit bb6d3fa98a41 ("clk:
renesas: rcar-gen3: Switch to new SD clock handling") and commit
e5f7e81ee430a ("mmc: renesas_sdhi: Parse DT for SDnH")

Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Marek: - Add rcar_clk_* prefix to all functions
       - Fix missing ~ in GENMASK(a, b), use clrsetbits_le32 instead
       - Use DIV_ROUND_CLOSEST, else if parent clock = 199999992 and
         rate = 200000000, the divider would be 0 and table lookup
	 would fail.
       - Turn rcar_clk_get_table_val into signed integer, so it can
         return 0 as a valid value and negative values as errors.
       - Make the code operate on correct clock and add comment
         which explains the reasoning behind it.
       - Rebase on changes to
         clk: renesas: Introduce and use rcar_clk_get_rate64_div_table function
2023-02-02 01:49:20 +01:00
Hai Pham
c287c184ae clk: renesas: Handle E3/D3 RPCSRC clock
The RPCSRC clock divider on R-Car D3 is very similar to the one on R-Car
E3, but uses a different pre-divider for the PLL0 parent.  Add a new
macro to describe it, reusing the existing clock type for R-Car E3.

As both E3/D3 RPCSRC clock divider are different from the rest of R-Car
Gen3, keep the original implementation from Linux.

Based on Linux commit 40745482eec8 ("clk: renesas: r8a774c0: Add RPC
clocks") by Lad Prabhakar and 9d18f81b3535 ("clk: renesas: r8a77995: Add
RPC clocks") by Geert Uytterhoeven.

Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> # Add D3 tweaks
2023-02-02 01:49:20 +01:00
Hai Pham
a1ec0bbc28 clk: renesas: Introduce and use rcar_clk_get_rate64_div_table function
Introduce new helper function to handle clock type that uses
clk_div_table struct. Based vaguely on Linux code. Make use
of clk_div_table in RPC clocks handling.

The E3/D3 RPCSRC need to be handled differently and will be addressed in
subsequence patch.

Based on Linux commit db4a0073cc82 ("clk: renesas: rcar-gen3: Add RPC
clocks") by Sergei Shtylyov.

Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Marek: - Squash patches to avoid adding unused code:
         clk: renesas: Make use of clk_div_table in RPC clocks handling
         clk: renesas: Introduce rcar_clk_get_rate64_div_table function
       - Move the new code to the beginning of clk-rcar-gen3 to avoid
         tables mixed with code
       - Use rcar_ prefix for get_table_div function
       - Get rid of custom macros, use GENMASK. Use custom field_get
         implementation as the generic FIELD_GET does not support
	 constant mask and u32_get_bits requires higher optimization level
       - Pass in the register bit mask instead of width/shift combination
       - Turn rcar_clk_get_rate64_div_table into s64, as it can return -EINVAL
2023-02-02 01:49:20 +01:00
Marek Vasut
d48c38db13 clk: renesas: Convert Gen2/Gen3 clock tables to clk-provider struct clk_div_table
Replace custom local structure with matching one from clk-provider.h .
No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-02-02 01:49:20 +01:00