arm-trusted-firmware-rockchip: add m0 gcc toolchain
[openwrt/staging/jow.git] / package / kernel / qca-ssdk / patches / 0014-SSDK-qca808x-use-get_random_u32.patch
1 From 6a49dd6bb2e40ce49351adb6100599f176d80494 Mon Sep 17 00:00:00 2001
2 From: Robert Marko <robimarko@gmail.com>
3 Date: Fri, 21 Oct 2022 13:40:15 +0200
4 Subject: [PATCH 14/14] SSDK: qca808x: use get_random_u32
5
6 prandom has been removed from the kernel in 6.1-rc1, so use get_random_u32
7 instead as its the drop-in replacement.
8
9 Signed-off-by: Robert Marko <robimarko@gmail.com>
10 ---
11 src/hsl/phy/qca808x_phy.c | 4 ++++
12 1 file changed, 4 insertions(+)
13
14 --- a/src/hsl/phy/qca808x_phy.c
15 +++ b/src/hsl/phy/qca808x_phy.c
16 @@ -299,7 +299,11 @@ qca808x_phy_ms_random_seed_set(a_uint32_
17 phy_data = qca808x_phy_debug_read(dev_id, phy_id,
18 QCA808X_DEBUG_LOCAL_SEED);
19 phy_data &= ~(QCA808X_MASTER_SLAVE_SEED_CFG);
20 +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
21 phy_data |= (prandom_u32()%QCA808X_MASTER_SLAVE_SEED_RANGE) << 2;
22 +#else
23 + phy_data |= (get_random_u32()%QCA808X_MASTER_SLAVE_SEED_RANGE) << 2;
24 +#endif
25 SSDK_DEBUG("QCA808X_DEBUG_LOCAL_SEED:%x\n", phy_data);
26 rv = qca808x_phy_debug_write(dev_id, phy_id,
27 QCA808X_DEBUG_LOCAL_SEED, phy_data);