uboot-d1: add bootloader for upcoming d1 target
[openwrt/staging/981213.git] / package / boot / uboot-d1 / patches / 0084-spi-sunxi-Hack-up-the-driver-for-the-D1.patch
1 From 46f73ce33478734dabd5a93d425f7148b60198e1 Mon Sep 17 00:00:00 2001
2 From: Samuel Holland <samuel@sholland.org>
3 Date: Wed, 8 Sep 2021 21:31:06 -0500
4 Subject: [PATCH 84/90] spi: sunxi: Hack up the driver for the D1
5
6 Signed-off-by: Samuel Holland <samuel@sholland.org>
7 ---
8 drivers/spi/spi-sunxi.c | 3 ++-
9 1 file changed, 2 insertions(+), 1 deletion(-)
10
11 --- a/drivers/spi/spi-sunxi.c
12 +++ b/drivers/spi/spi-sunxi.c
13 @@ -30,6 +30,7 @@
14 #include <asm/global_data.h>
15 #include <dm/device_compat.h>
16 #include <linux/bitops.h>
17 +#include <linux/log2.h>
18
19 #include <asm/bitops.h>
20 #include <asm/io.h>
21 @@ -85,7 +86,7 @@ DECLARE_GLOBAL_DATA_PTR;
22 #define SUN4I_SPI_DEFAULT_RATE 1000000
23 #define SUN4I_SPI_TIMEOUT_MS 1000
24
25 -#define SPI_REG(priv, reg) ((priv)->base + \
26 +#define SPI_REG(priv, reg) (void *)((priv)->base + \
27 (priv)->variant->regs[reg])
28 #define SPI_BIT(priv, bit) ((priv)->variant->bits[bit])
29 #define SPI_CS(priv, cs) (((cs) << SPI_BIT(priv, SPI_TCR_CS_SEL)) & \