]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mtd: spi: renesas: Add R-Car Gen4 support
authorHai Pham <hai.pham.ud@renesas.com>
Thu, 5 Aug 2021 07:38:26 +0000 (14:38 +0700)
committerMarek Vasut <marek.vasut+renesas@mailbox.org>
Sat, 10 Jun 2023 09:50:45 +0000 (11:50 +0200)
Support RPC SPI on R-Car Gen4 R8A779F0 S4 and R8A779G0 V4H SoCs.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Squash S4 and V4H patches, fix brackets around STRTIM2]

drivers/spi/renesas_rpc_spi.c

index 07ff2d29fd4290fa3976de79b8a81ed006a4b08d..af1b368f69e30b2d476094a88e1b0f297ca06f46 100644 (file)
 #define PRC_PHYCNT_EXDS                BIT(21)
 #define RPC_PHYCNT_OCT         BIT(20)
 #define RPC_PHYCNT_STRTIM(v)   (((v) & 0x7) << 15)
+#define RPC_PHYCNT_STRTIM2(v)  ((((v) & 0x7) << 15) | (((v) & 0x8) << 24))
 #define RPC_PHYCNT_WBUF2       BIT(4)
 #define RPC_PHYCNT_WBUF                BIT(2)
 #define RPC_PHYCNT_MEM(v)      (((v) & 0x3) << 0)
@@ -212,9 +213,13 @@ static u32 rpc_spi_get_strobe_delay(void)
         *       0: On H3 ES1.x (not supported in mainline U-Boot)
         *       6: On M3 ES1.x
         *       7: On other R-Car Gen3
+        *      15: On R-Car Gen4
         */
        if (cpu_type == RMOBILE_CPU_TYPE_R8A7796 && rmobile_get_cpu_rev_integer() == 1)
                return RPC_PHYCNT_STRTIM(6);
+       else if (cpu_type == RMOBILE_CPU_TYPE_R8A779F0 ||
+                cpu_type == RMOBILE_CPU_TYPE_R8A779G0)
+               return RPC_PHYCNT_STRTIM2(15);
        else
 #endif
                return RPC_PHYCNT_STRTIM(7);